Code Monkey home page Code Monkey logo

Comments (9)

norberttak avatar norberttak commented on August 24, 2024 1

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)

from xpanel.

norberttak avatar norberttak commented on August 24, 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

from xpanel.

CyberGuerro avatar CyberGuerro commented on August 24, 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?

from xpanel.

norberttak avatar norberttak commented on August 24, 2024

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.

from xpanel.

CyberGuerro avatar CyberGuerro commented on August 24, 2024

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"
;-------------------------------------------------------------------

from xpanel.

norberttak avatar norberttak commented on August 24, 2024

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?

from xpanel.

CyberGuerro avatar CyberGuerro commented on August 24, 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.

from xpanel.

norberttak avatar norberttak commented on August 24, 2024

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

from xpanel.

CyberGuerro avatar CyberGuerro commented on August 24, 2024

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

from xpanel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.