Skip to content

Commit

Permalink
new logic switch type Safe graphical display
Browse files Browse the repository at this point in the history
  • Loading branch information
shane-droid committed Jun 13, 2022
1 parent f0097ea commit c3f1a32
Show file tree
Hide file tree
Showing 18 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions radio/src/gui/colorlcd/model_logical_switches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class LogicalSwitchEditPage: public Page
LogicalSwitchData * cs = lswAddress(index);
uint8_t cstate = lswFamily(cs->func);

if (cstate == LS_FAMILY_BOOL || cstate == LS_FAMILY_STICKY) {
if (cstate == LS_FAMILY_BOOL || cstate == LS_FAMILY_STICKY || cs->func == LS_FUNC_SAFE) {
new StaticText(logicalSwitchOneWindow, grid.getLabelSlot(), STR_V1, 0, COLOR_THEME_PRIMARY1);
auto choice = new SwitchChoice(logicalSwitchOneWindow, grid.getFieldSlot(), SWSRC_FIRST_IN_LOGICAL_SWITCHES, SWSRC_LAST_IN_LOGICAL_SWITCHES, GET_SET_DEFAULT(cs->v1));
choice->setAvailableHandler(isSwitchAvailableInLogicalSwitches);
Expand Down Expand Up @@ -292,7 +292,7 @@ class LogicalSwitchButton : public Button
dc->drawTextAtIndex(col1, line1, STR_VCSWFUNC, ls->func, COLOR_THEME_SECONDARY1);

// CSW params
if (lsFamily == LS_FAMILY_BOOL || lsFamily == LS_FAMILY_STICKY) {
if (lsFamily == LS_FAMILY_BOOL || lsFamily == LS_FAMILY_STICKY || ls->func ==LS_FUNC_SAFE) {
drawSwitch(dc, col2, line1, ls->v1, COLOR_THEME_SECONDARY1);
drawSwitch(dc, col3, line1, ls->v2, COLOR_THEME_SECONDARY1);
} else if (lsFamily == LS_FAMILY_EDGE) {
Expand Down
1 change: 1 addition & 0 deletions radio/src/storage/conversions/yaml/myeeprom_220.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ enum LogicalSwitchesFunctions {
LS_FUNC_ADIFFEGREATER,
LS_FUNC_TIMER,
LS_FUNC_STICKY,
LS_FUNC_SAFE,
LS_FUNC_COUNT,
LS_FUNC_MAX = LS_FUNC_COUNT-1
};
Expand Down
1 change: 1 addition & 0 deletions radio/src/storage/yaml/yaml_datastructs_nv14.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
{ LS_FUNC_TIMER, "FUNC_TIMER" },
{ LS_FUNC_STICKY, "FUNC_STICKY" },
{ LS_FUNC_SAFE, "FUNC_SAFE" },
{ 0, NULL }
};
const struct YamlIdStr enum_SwashType[] = {
Expand Down
1 change: 1 addition & 0 deletions radio/src/storage/yaml/yaml_datastructs_t12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
{ LS_FUNC_TIMER, "FUNC_TIMER" },
{ LS_FUNC_STICKY, "FUNC_STICKY" },
{ LS_FUNC_SAFE, "FUNC_SAFE" },
{ 0, NULL }
};
const struct YamlIdStr enum_SwashType[] = {
Expand Down
1 change: 1 addition & 0 deletions radio/src/storage/yaml/yaml_datastructs_t8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
{ LS_FUNC_TIMER, "FUNC_TIMER" },
{ LS_FUNC_STICKY, "FUNC_STICKY" },
{ LS_FUNC_SAFE, "FUNC_SAFE" },
{ 0, NULL }
};
const struct YamlIdStr enum_SwashType[] = {
Expand Down
1 change: 1 addition & 0 deletions radio/src/storage/yaml/yaml_datastructs_tlite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
{ LS_FUNC_TIMER, "FUNC_TIMER" },
{ LS_FUNC_STICKY, "FUNC_STICKY" },
{ LS_FUNC_SAFE, "FUNC_SAFE" },
{ 0, NULL }
};
const struct YamlIdStr enum_SwashType[] = {
Expand Down
1 change: 1 addition & 0 deletions radio/src/storage/yaml/yaml_datastructs_tpro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
{ LS_FUNC_TIMER, "FUNC_TIMER" },
{ LS_FUNC_STICKY, "FUNC_STICKY" },
{ LS_FUNC_SAFE, "FUNC_SAFE" },
{ 0, NULL }
};
const struct YamlIdStr enum_SwashType[] = {
Expand Down
1 change: 1 addition & 0 deletions radio/src/storage/yaml/yaml_datastructs_tx12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
{ LS_FUNC_TIMER, "FUNC_TIMER" },
{ LS_FUNC_STICKY, "FUNC_STICKY" },
{ LS_FUNC_SAFE, "FUNC_SAFE" },
{ 0, NULL }
};
const struct YamlIdStr enum_SwashType[] = {
Expand Down
1 change: 1 addition & 0 deletions radio/src/storage/yaml/yaml_datastructs_x10.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
{ LS_FUNC_TIMER, "FUNC_TIMER" },
{ LS_FUNC_STICKY, "FUNC_STICKY" },
{ LS_FUNC_SAFE, "FUNC_SAFE" },
{ 0, NULL }
};
const struct YamlIdStr enum_SwashType[] = {
Expand Down
1 change: 1 addition & 0 deletions radio/src/storage/yaml/yaml_datastructs_x12s.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
{ LS_FUNC_TIMER, "FUNC_TIMER" },
{ LS_FUNC_STICKY, "FUNC_STICKY" },
{ LS_FUNC_SAFE, "FUNC_SAFE" },
{ 0, NULL }
};
const struct YamlIdStr enum_SwashType[] = {
Expand Down
1 change: 1 addition & 0 deletions radio/src/storage/yaml/yaml_datastructs_x7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
{ LS_FUNC_TIMER, "FUNC_TIMER" },
{ LS_FUNC_STICKY, "FUNC_STICKY" },
{ LS_FUNC_SAFE, "FUNC_SAFE" },
{ 0, NULL }
};
const struct YamlIdStr enum_SwashType[] = {
Expand Down
1 change: 1 addition & 0 deletions radio/src/storage/yaml/yaml_datastructs_x9d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
{ LS_FUNC_TIMER, "FUNC_TIMER" },
{ LS_FUNC_STICKY, "FUNC_STICKY" },
{ LS_FUNC_SAFE, "FUNC_SAFE" },
{ 0, NULL }
};
const struct YamlIdStr enum_SwashType[] = {
Expand Down
1 change: 1 addition & 0 deletions radio/src/storage/yaml/yaml_datastructs_x9e.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
{ LS_FUNC_TIMER, "FUNC_TIMER" },
{ LS_FUNC_STICKY, "FUNC_STICKY" },
{ LS_FUNC_SAFE, "FUNC_SAFE" },
{ 0, NULL }
};
const struct YamlIdStr enum_SwashType[] = {
Expand Down
1 change: 1 addition & 0 deletions radio/src/storage/yaml/yaml_datastructs_x9lite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
{ LS_FUNC_TIMER, "FUNC_TIMER" },
{ LS_FUNC_STICKY, "FUNC_STICKY" },
{ LS_FUNC_SAFE, "FUNC_SAFE" },
{ 0, NULL }
};
const struct YamlIdStr enum_SwashType[] = {
Expand Down
1 change: 1 addition & 0 deletions radio/src/storage/yaml/yaml_datastructs_x9lites.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
{ LS_FUNC_TIMER, "FUNC_TIMER" },
{ LS_FUNC_STICKY, "FUNC_STICKY" },
{ LS_FUNC_SAFE, "FUNC_SAFE" },
{ 0, NULL }
};
const struct YamlIdStr enum_SwashType[] = {
Expand Down
1 change: 1 addition & 0 deletions radio/src/storage/yaml/yaml_datastructs_xlite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
{ LS_FUNC_TIMER, "FUNC_TIMER" },
{ LS_FUNC_STICKY, "FUNC_STICKY" },
{ LS_FUNC_SAFE, "FUNC_SAFE" },
{ 0, NULL }
};
const struct YamlIdStr enum_SwashType[] = {
Expand Down
1 change: 1 addition & 0 deletions radio/src/storage/yaml/yaml_datastructs_xlites.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
{ LS_FUNC_TIMER, "FUNC_TIMER" },
{ LS_FUNC_STICKY, "FUNC_STICKY" },
{ LS_FUNC_SAFE, "FUNC_SAFE" },
{ 0, NULL }
};
const struct YamlIdStr enum_SwashType[] = {
Expand Down
1 change: 1 addition & 0 deletions radio/src/storage/yaml/yaml_datastructs_zorro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
{ LS_FUNC_TIMER, "FUNC_TIMER" },
{ LS_FUNC_STICKY, "FUNC_STICKY" },
{ LS_FUNC_SAFE, "FUNC_SAFE" },
{ 0, NULL }
};
const struct YamlIdStr enum_SwashType[] = {
Expand Down

0 comments on commit c3f1a32

Please sign in to comment.