Closed makerplane-jnicol closed 3 months ago
With the old menu you could make a hide/show button that was always visible, it would just need some timer event to automatically hide, user would press show to make it return and reset the timer. But unless someone has a compelling reason to keep the old menu I think we should eventually remove it.
Looking at the new touchscreen buttons I think we could do this with little effort:
button: hide
and button:show
actions so we can hide/show buttonsThe above would allow one to control when buttons show and hide. Think of the EMS button, it can be setup to turn red if some value is annunciating. That button could be setup to still show up red and be clickable even when MENUHIDE = True but when not annunciating and MENUHIDE = True it would be hidden.
EMS configuration to work like that:
type: simple
text: ""
dbkey: TSBTN{id}12
condition_keys:
- CHT11
- CHT12
- CHT13
- CHT14
- EGT11
- EGT12
- EGT13
- EGT14
- MENUHIDE
conditions:
- when: "[ SCREEN eq 'EMS' ] and not MENUHIDE"
actions:
- button: show
- set text: PFD
- set bg color: lightgray
continue: true
- when: "[ SCREEN ne 'EMS' ] and not MENUHIDE"
actions:
- button: show
- set text: EMS
- set bg color: lightgray
continue: true
- when: "SCREEN ne 'EMS' and [ CHT11.annunciate or CHT12.annunciate or CHT13.annunciate or CHT14.annunciate or EGT11.annunciate or EGT12.annunciate or EGT13.annunciate or EGT14.annunciate ]"
actions:
- button: show
- set bg color: red
continue: true
- when: "MENUHIDE and not PREVIOUS_CONDITION"
actions:
- button: hide
- when: "CLICKED eq true and SCREEN ne 'EMS'"
actions:
- show screen: EMS
- when: "CLICKED eq true and SCREEN eq 'EMS'"
actions:
- show screen: PFD
So that would take care of hiding and prevention of hiding under user defined conditions. How do we unhide all the buttons? With no additional code changes one could pick a button that does not hide and becomes a 'show' button when others are hidden. Modified Units button to do that:
type: simple
text: "Units"
dbkey: TSBTN{id}14
conditions:
- when: "MENUHIDE"
actions:
- set text: "Show\nMenu"
continue: true
- when: "CLICKED eq true and MENUHIDE"
actions:
- set text: Units
- set value: MENUHIDE,False
- when: "CLICKED eq true and not MENUHIDE"
actions:
- Set Instrument Units: "OAT,OILT1,Temperature,Pressure,Altitude:Toggle"
We could also setup the menu encoder option to set MENUHIDE to False when the user turns the encoder to make the buttons show up.
What do you think?
Add a feature to show the menu buttons on screen touch and then timeout to hide them after 10 seconds.