Hello!
First time posting here, so sorry for the wrong subrforum...
Because of the lack of physical buttons, I've programmed a four-button set to control the whole radio stack: "select active radio", "stby freq up", "stby freq down", "swap freq".
I've created a integer property called "/devices/status/yoke/actradio. My first button manages the property correctly. The two other buttons (using if/elsif and getprop/setprop) are able to increase/decrease the frequencies as I want. The Swap button doesn't work. Here is my coding attempt:
<button n="1">
<name>Black button</name>
<desc>swap active and stby freq of active radio</desc>
<binding>
<command>nasal</command>
<script> var act = getprop("/devices/status/yoke/actradio"); if (act == 1) {
<command>property-swap</command>
<property>/instrumentation/comm/frequencies/selected-mhz</property>
<property>/instrumentation/comm/frequencies/standby-mhz</property>;
}elsif (act == 2){
<command>property-swap</command>
<property>/instrumentation/comm[1]/frequencies/selected-mhz</property>
<property>/instrumentation/comm[1]/frequencies/standby-mhz</property>;
}elsif (act == 3){
<!--and so on for comm, nav and ADF-->
</script>
</binding>
</button>
This doesn't work (I suppose) because of the non-Nasal coding (<command>, <property>... ) into the Nasal <script>, but I can't find a Nasal function to manage the frequencies swapping. I'm dreaming of something like "swapprop"...
How can a simple copypase guy like me get this result?
Thank you!
Ivan