Board index FlightGear Development Aircraft Cockpit development

Please help with bindings.

Discussion about creating 2d and 3d cockpits.

Please help with bindings.

Postby kgwedi » Sat Jul 24, 2021 6:37 pm

I am trying to use a kr-87 adf radio to control a generic ADF indicator instead of the ki227 indicator.
I am using this in the kr87.xml file, so the "frq" button does this.....
.......
<binding>
<command>property-swap</command>
<property>/instrumentation/kr-87/outputs/standby-khz</property>
<property>/instrumentation/adf/frequencies/selected-khz</property>
</binding>

This works well, but, it also replaces the standby readout on the KR-87 with what ever was in the "/adf/frequencies" variable.
I don't want to "swap" the two, I want only to replace the value of one with the value of the other.

Something like:
<binding>
<command>property-assign</command>
<property>/instrumentation/adf/frequencies/selected-khz</property>
<value> <property>/instrumentation/kr-87/outputs/standby-khz</property> </value>
</binding>

I think using the "property-assign" command only works with a variable number like an integer....
How do I change a property value, with the value of another property?
Thanks in advance.
kgwedi
 
Posts: 13
Joined: Tue Jul 13, 2021 5:44 am

Re: Please help with bindings.

Postby D-ECHO » Sat Jul 24, 2021 6:56 pm

property-assign works with a property just as well as with a value. E.g.

Code: Select all
         <binding>
            <command>property-assign</command>
            <property>/foo</property>
            <property>/bar</property>
         </binding>


I'll update the wiki (https://wiki.flightgear.org/Bindings#property-assign) accordingly.
D-ECHO
 
Posts: 2460
Joined: Sat May 09, 2015 1:31 pm
Pronouns: Bea (she/her)
Version: next

Re: Please help with bindings.

Postby kgwedi » Sat Jul 24, 2021 7:08 pm

Thank you very much. Works perfect now :-)
kgwedi
 
Posts: 13
Joined: Tue Jul 13, 2021 5:44 am

Re: Please help with bindings.

Postby D-ECHO » Sat Jul 24, 2021 7:13 pm

Yw :)
D-ECHO
 
Posts: 2460
Joined: Sat May 09, 2015 1:31 pm
Pronouns: Bea (she/her)
Version: next


Return to Cockpit development

Who is online

Users browsing this forum: No registered users and 3 guests