Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Saitek Radio displays: provide blank display and/or blank digit #102

Closed
CyberGuerro opened this issue Apr 14, 2024 · 9 comments · Fixed by #104
Closed

[Enhancement] Saitek Radio displays: provide blank display and/or blank digit #102

CyberGuerro opened this issue Apr 14, 2024 · 9 comments · Fixed by #104
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@CyberGuerro
Copy link

If I can I'd like to give a suggestion:
when I select IDT/XPDR (where display is composed by 4 digit number), I'd like to view [blank]8888 on display instead 08888.
For all displays if I don't bind any dateref to the display, I'd like to view blank display instead "00000".
Is it possible to have this?

@CyberGuerro CyberGuerro changed the title [Enahcment] Saitek Radio displays [Enhancement] Saitek Radio displays Apr 14, 2024
@CyberGuerro CyberGuerro changed the title [Enhancement] Saitek Radio displays [Enhancement] Saitek Radio displays: provide blank display and/or blank digit Apr 15, 2024
@norberttak norberttak added this to the v1.10 milestone Apr 16, 2024
@norberttak norberttak added the enhancement New feature or request label Apr 16, 2024
@norberttak norberttak self-assigned this Apr 17, 2024
@norberttak norberttak linked a pull request Apr 20, 2024 that will close this issue
@norberttak
Copy link
Owner

norberttak commented Apr 20, 2024

PR created: #104
In this form, it blanks the leading zeros. If a display is not configured, then we turn it off.

@CyberGuerro : please check this version.

Still need to add some configuration options with the following changes:

  • new device level option to enable/disable the leading zero blanks
  • new line level option to set the minimum character that shall be displayed
  • add this blank property to multi panel as well
  • sanity check in the config parser to warn about contradictory options

@CyberGuerro
Copy link
Author

CyberGuerro commented Apr 22, 2024

Sorry for my late answer....
It seems ok, the only thing I noticed is: the unused display (not declared in configuration, es. in my IDT setting where I use only the LEFT display to show transponder code, the RIGHT display should be switched off instead show "00000")

About
new device level option to enable/disable the leading zero blanks
I think that by default "leading zero blanks" should be disabled (if it's not declared or explicit setting to false)

new line level option to set the minimum character that shall be displayed
What does it mean? how it interacts with above option?

@norberttak
Copy link
Owner

Please send me your config, I'd double check it on my environment.

new device level option to enable/disable the leading zero blanks
I think my sentence was misleading. This option shall be enabled by default. That means the leading zeros will be removed by default. I guess that's what you want as well.

new line level option to set the minimum character that shall be displayed
For example, the IDT. This is always 4 characters, even if it starts with zero. So if your transponder code from the ATC is zero-one-two-three we should display as 0123 and not 123 Similar to the heading on multi panels: The HDG value is always 3 characters even if it starts with 0 (025 for example). The minimum character number depends on the function, so that's why I need a line level option.

@CyberGuerro
Copy link
Author

OK, now I understand it.
This is my configuration for C172

; Aircraft specific handler for Zibo 737 XPlane aircraft
log_level="WARNING"
aircraft_acf="Cessna_172SP.acf"

;---------------------- Saitek Radio Panel -------------------------
[device:id="saitek_radio"]
vid="06a3"
pid="0d05"

[multi_display:id="RADIO_DISPLAY_ACTIVE_UP"]
line="on_select:SW_UP_COM1,dataref:sim/cockpit/radios/com1_freq_hz"
line="on_select:SW_UP_COM2,dataref:sim/cockpit/radios/com2_freq_hz"
line="on_select:SW_UP_NAV1,dataref:sim/cockpit/radios/nav1_freq_hz"
line="on_select:SW_UP_NAV2,dataref:sim/cockpit/radios/nav2_freq_hz"
line="on_select:SW_UP_ADF,dataref:sim/cockpit/radios/adf1_freq_hz"
line="on_select:SW_UP_DME,dataref:sim/cockpit/radios/nav1_dme_dist_m"
line="on_select:SW_UP_IDT,dataref:sim/cockpit/radios/transponder_code"

[multi_display:id="RADIO_DISPLAY_STBY_UP"]
line="on_select:SW_UP_COM1,dataref:sim/cockpit/radios/com1_stdby_freq_hz"
line="on_select:SW_UP_COM2,dataref:sim/cockpit/radios/com2_stdby_freq_hz"
line="on_select:SW_UP_NAV1,dataref:sim/cockpit/radios/nav1_stdby_freq_hz"
line="on_select:SW_UP_NAV2,dataref:sim/cockpit/radios/nav2_stdby_freq_hz"
line="on_select:SW_UP_ADF,dataref:sim/cockpit/radios/adf1_stdby_freq_hz"
line="on_select:SW_UP_DME,dataref:sim/cockpit/radios/nav2_dme_dist_m"

[button:id="KNOB_UP_BIG_PLUS"]
on_push="on_select:SW_UP_COM1,dataref:sim/cockpit/radios/com1_stdby_freq_hz:100:0:15000"
on_push="on_select:SW_UP_COM2,dataref:sim/cockpit/radios/com2_stdby_freq_hz:100:0:15000"
on_push="on_select:SW_UP_NAV1,dataref:sim/cockpit/radios/nav1_stdby_freq_hz:100:0:15000"
on_push="on_select:SW_UP_NAV2,dataref:sim/cockpit/radios/nav2_stdby_freq_hz:100:0:15000"
on_push="on_select:SW_UP_ADF,dataref:sim/cockpit/radios/adf1_stdby_freq_hz:100:0:359"
on_push="on_select:SW_UP_IDT,dataref:sim/cockpit/radios/transponder_code:100:0:8888"

[button:id="KNOB_UP_BIG_MINUS"]
on_push="on_select:SW_UP_COM1,dataref:sim/cockpit/radios/com1_stdby_freq_hz:-100:0:16000"
on_push="on_select:SW_UP_COM2,dataref:sim/cockpit/radios/com2_stdby_freq_hz:-100:0:16000"
on_push="on_select:SW_UP_NAV1,dataref:sim/cockpit/radios/nav1_stdby_freq_hz:-100:0:16000"
on_push="on_select:SW_UP_NAV2,dataref:sim/cockpit/radios/nav2_stdby_freq_hz:-100:0:16000"
on_push="on_select:SW_UP_ADF,dataref:sim/cockpit/radios/adf1_stdby_freq_hz:-100:0:359"
on_push="on_select:SW_UP_IDT,dataref:sim/cockpit2/radios/actuators/transponder_code:-100:0:8888"

[button:id="KNOB_UP_SMALL_PLUS"]
on_push="on_select:SW_UP_COM1,dataref:sim/cockpit/radios/com1_stdby_freq_hz:5:0:15000"
on_push="on_select:SW_UP_COM2,dataref:sim/cockpit/radios/com2_stdby_freq_hz:5:0:15000"
on_push="on_select:SW_UP_NAV1,dataref:sim/cockpit/radios/nav1_stdby_freq_hz:1:0:15000"
on_push="on_select:SW_UP_NAV2,dataref:sim/cockpit/radios/nav2_stdby_freq_hz:1:0:15000"
on_push="on_select:SW_UP_ADF,dataref:sim/cockpit/radios/adf1_stdby_freq_hz:1:0:359"
on_push="on_select:SW_UP_IDT,dataref:sim/cockpit/radios/transponder_code:1:0:8888"

[button:id="KNOB_UP_SMALL_MINUS"]
on_push="on_select:SW_UP_COM1,dataref:sim/cockpit/radios/com1_stdby_freq_hz:-5:0:16000"
on_push="on_select:SW_UP_COM2,dataref:sim/cockpit/radios/com2_stdby_freq_hz:-5:0:16000"
on_push="on_select:SW_UP_NAV1,dataref:sim/cockpit/radios/nav1_stdby_freq_hz:-1:0:16000"
on_push="on_select:SW_UP_NAV2,dataref:sim/cockpit/radios/nav2_stdby_freq_hz:-1:0:16000"
on_push="on_select:SW_UP_ADF,dataref:sim/cockpit/radios/adf1_stdby_freq_hz:-1:0:359"
on_push="on_select:SW_UP_IDT,dataref:sim/cockpit2/radios/actuators/transponder_code:-1:0:8888"

[button:id="ACT_STBY_UP"]
on_push="on_select:SW_UP_COM1,commandref:sim/radios/com1_standy_flip:once"
on_push="on_select:SW_UP_COM2,commandref:sim/radios/com2_standy_flip:once"
on_push="on_select:SW_UP_NAV1,commandref:sim/radios/nav1_standy_flip:once"
on_push="on_select:SW_UP_NAV2,commandref:sim/radios/nav2_standy_flip:once"
on_push="on_select:SW_UP_ADF,commandref:sim/radios/adf1_standy_flip:once"



[multi_display:id="RADIO_DISPLAY_ACTIVE_DOWN"]
line="on_select:SW_DOWN_COM1,dataref:sim/cockpit/radios/com1_freq_hz"
line="on_select:SW_DOWN_COM2,dataref:sim/cockpit/radios/com2_freq_hz"
line="on_select:SW_DOWN_NAV1,dataref:sim/cockpit/radios/nav1_freq_hz"
line="on_select:SW_DOWN_NAV2,dataref:sim/cockpit/radios/nav2_freq_hz"
line="on_select:SW_DOWN_ADF,dataref:sim/cockpit/radios/adf1_freq_hz"
line="on_select:SW_DOWN_DME,dataref:sim/cockpit/radios/nav1_dme_dist_m"
line="on_select:SW_DOWN_IDT,dataref:sim/cockpit/radios/transponder_code"

[multi_display:id="RADIO_DISPLAY_STBY_DOWN"]
line="on_select:SW_DOWN_COM1,dataref:sim/cockpit/radios/com1_stdby_freq_hz"
line="on_select:SW_DOWN_COM2,dataref:sim/cockpit/radios/com2_stdby_freq_hz"
line="on_select:SW_DOWN_NAV1,dataref:sim/cockpit/radios/nav1_stdby_freq_hz"
line="on_select:SW_DOWN_NAV2,dataref:sim/cockpit/radios/nav2_stdby_freq_hz"
line="on_select:SW_DOWN_ADF,dataref:sim/cockpit/radios/adf1_stdby_freq_hz"
line="on_select:SW_DOWN_DME,dataref:sim/cockpit/radios/nav2_dme_dist_m"

[button:id="KNOB_DOWN_BIG_PLUS"]
on_push="on_select:SW_DOWN_COM1,dataref:sim/cockpit/radios/com1_stdby_freq_hz:100:0:15000"
on_push="on_select:SW_DOWN_COM2,dataref:sim/cockpit/radios/com2_stdby_freq_hz:100:0:15000"
on_push="on_select:SW_DOWN_NAV1,dataref:sim/cockpit/radios/nav1_stdby_freq_hz:100:0:15000"
on_push="on_select:SW_DOWN_NAV2,dataref:sim/cockpit/radios/nav2_stdby_freq_hz:100:0:15000"
on_push="on_select:SW_DOWN_ADF,dataref:sim/cockpit/radios/adf1_stdby_freq_hz:100:0:359"
on_push="on_select:SW_DOWN_IDT,dataref:sim/cockpit/radios/transponder_code:100:0:8888"

[button:id="KNOB_DOWN_BIG_MINUS"]
on_push="on_select:SW_DOWN_COM1,dataref:sim/cockpit/radios/com1_stdby_freq_hz:-100:0:16000"
on_push="on_select:SW_DOWN_COM2,dataref:sim/cockpit/radios/com2_stdby_freq_hz:-100:0:16000"
on_push="on_select:SW_DOWN_NAV1,dataref:sim/cockpit/radios/nav1_stdby_freq_hz:-100:0:16000"
on_push="on_select:SW_DOWN_NAV2,dataref:sim/cockpit/radios/nav2_stdby_freq_hz:-100:0:16000"
on_push="on_select:SW_DOWN_ADF,dataref:sim/cockpit/radios/adf1_stdby_freq_hz:-100:0:359"
on_push="on_select:SW_DOWN_IDT,dataref:sim/cockpit2/radios/actuators/transponder_code:-100:0:8888"

[button:id="KNOB_DOWN_SMALL_PLUS"]
on_push="on_select:SW_DOWN_COM1,dataref:sim/cockpit/radios/com1_stdby_freq_hz:5:0:15000"
on_push="on_select:SW_DOWN_COM2,dataref:sim/cockpit/radios/com2_stdby_freq_hz:5:0:15000"
on_push="on_select:SW_DOWN_NAV1,dataref:sim/cockpit/radios/nav1_stdby_freq_hz:1:0:15000"
on_push="on_select:SW_DOWN_NAV2,dataref:sim/cockpit/radios/nav2_stdby_freq_hz:1:0:15000"
on_push="on_select:SW_DOWN_ADF,dataref:sim/cockpit/radios/adf1_stdby_freq_hz:1:0:359"
on_push="on_select:SW_DOWN_IDT,dataref:sim/cockpit/radios/transponder_code:1:0:8888"

[button:id="KNOB_DOWN_SMALL_MINUS"]
on_push="on_select:SW_DOWN_COM1,dataref:sim/cockpit/radios/com1_stdby_freq_hz:-5:0:16000"
on_push="on_select:SW_DOWN_COM2,dataref:sim/cockpit/radios/com2_stdby_freq_hz:-5:0:16000"
on_push="on_select:SW_DOWN_NAV1,dataref:sim/cockpit/radios/nav1_stdby_freq_hz:-1:0:16000"
on_push="on_select:SW_DOWN_NAV2,dataref:sim/cockpit/radios/nav2_stdby_freq_hz:-1:0:16000"
on_push="on_select:SW_DOWN_ADF,dataref:sim/cockpit/radios/adf1_stdby_freq_hz:-1:0:359"
on_push="on_select:SW_DOWN_IDT,dataref:sim/cockpit2/radios/actuators/transponder_code:-1:0:8888"

[button:id="ACT_STBY_DOWN"]
on_push="on_select:SW_DOWN_COM1,commandref:sim/radios/com1_standy_flip:once"
on_push="on_select:SW_DOWN_COM2,commandref:sim/radios/com2_standy_flip:once"
on_push="on_select:SW_DOWN_NAV1,commandref:sim/radios/nav1_standy_flip:once"
on_push="on_select:SW_DOWN_NAV2,commandref:sim/radios/nav2_standy_flip:once"
on_push="on_select:SW_DOWN_ADF,commandref:sim/radios/adf1_standy_flip:once"
;-------------------------------------------------------------------

@norberttak
Copy link
Owner

I loaded your configuration. It works here. The IDT right display is blank (turned off) only the left display shows the transponder code. That's the case for the upper and for the lower displays as well.
The 00000 is not diaper whether you switch to another position (COM1 or NAV1) and switch back to IDT?

@CyberGuerro
Copy link
Author

CyberGuerro commented Apr 22, 2024

If I turn knob selector to com1 and then return to IDT, right display show COM1 standby and then "0" (no turned off), consider that in that moment DME (previous selection before IDT) selection value for right display is "0".
I noticed another thing: if I turn selector faster (from IDT -> COM1 in 0.5 sec) display show random value between one of the the selection (COM2, NAV1, NAV2 and so on), if I make selection per second displays show values according with selection.

@norberttak
Copy link
Owner

It works on Windows perfectly.
This morning I did a quick test on my Ubuntu 22.04 and the same issue happened what you wrote. I need some time to debug what is the difference between the two platform (I guess it is something regarding the hid layer again, but I don't know yet)

@norberttak
Copy link
Owner

I found the error in my code. It is working now on my Ubuntu 22.04 as well.
Please test this version

@CyberGuerro
Copy link
Author

Yess, now all works like expected.
I close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants