Hi there.
If you are reading this you probably know from my previous posts on this subject that I was modifying the KNS80.nas file included in the Patten's Aerostar 700 to make its KING'S KNS-80 work closer to the real one.
At the time I started my mod I was using Patten’s Aerostar-700-04-05_2016 version which used the KNS80.nas originally coded by Syd Adams and Ron Jensen, and the kns80.xml by Syd Adams. These are the files that as for today (I'm using FG2020.4) are also included in the fgdata/Aircraft/Instruments-3d/kns80 folder, which is the kns80 used by the original Syd Adams' Aerostar. However, now the Aerostar in Patten's hangar is the Aerostar-700-28-05_2021 (may 28, 2021) version which includes the newly coded kns80.nas by clm76 of the PAF Team. It solves some problems with the autopilot, and includes WoodSTock's KNS80 rebuild, but after having tried it I found that the RNAV modes in the new kns80 don't work properly (by the KNS80 Pilot's Guide).
The problem is that, although it apparently works since the needle points to the corresponding selected waypoint location, it makes the OBS knob unusable when the RNAV modes are selected, besides there is no change in the CDI/HSI or DME when using HOLD function while in RNAV modes which is against what we can read on the KNS80 Pilot's Guide. According to it, we can see:
a) on point 11., just under "
Take of and fly to waypoint 1", it is written that "
Before take off, check to be sure that RNV/ENR is still the active mode,"..."
You have determined you want to fly a 112º course to the first waypoint, so you place 112º under the lubber line on your CDI (using the OBS knob on the CDI) and fly to center the needle"
b) on point 12., just under "
Waypoint passage", it is written that
"You are now passing over waypoint 1"..."
Your flight plan calls for a course of 132º direct from waypoint 1 to Memphis, so you use your OBS knob to place 132º under the lubber line, fly to center the needle and continue your flight …",
c) when using the HOLD function while in RNAV modes or in VOR/PAR (in non ILS frequency) the CDI/HSI
should be flagged, and the DME
should show dashed lines (they would be unusable in that case).
So being back to FG world, I decided to finish my mod of the original KNS80.nas (again the one by Syd Adams and Ron Jensen) to make it work as per the KNS80 Pilot's Guide. Finally I have added some code to the DME_hold function so that when the HOLD button is depressed and the HLD annunciator is on, if the frequency is rechanneled to an already stored one the HLD will cancel as described in point 16. of the "
Tune an ILS frequency without losing DME" section of the Pilot's guide. I've done this by placing a listener inside the (hold==1) condition of the DME_hold function so that it only triggers when selecting new frequencies that affect to the
ACTIVE waypoint. The key here is “
If you should mistakenly try to use the HOLD function in RNAV modes, as soon as the frequency is changed” as said in the KNS80 Pilot’s Guide, or “
rechanneled” as per the MOONEY AIRCRAFT CORPORATION KNS80 RNAV SYSTEM SUPPLEMENT (I posted the links to this documents in previous posts).
Therefore, the listener has to point to "instrumentation/nav/frequencies/selected-mhz", and when using the frequency knob the listener’s function is executed only if (hold==1). The function sets the var "hold" to 0 when the "selected-mhz" from NAV (NAV1) and the DME are the same, otherwise HLD will remain ON. In other words, now, as per the Pilot's Guide, "
Hold (HLD) annunciation occurs only when VOR/ILS and DME frequencies are different".
The above will happen no matter which waypoint we have in use. If we do, as in the Pilot's guide, reselect the frequency to the value we hold to retain the DME for using with a non DME ILS, the HOLD function will end and the HLD annunciator will cancel. In the same manner, if we retain a frequency in one of the four waypoints to hold DME info, and we changed from that waypoint to another of the other three to find other VOR or ILS, if we
reselect the retained frequency in any of the other waypoins, as long as we make it
active, the HOLD function will end -since it is common for the four channels, and the HLD annunciator will cancel as well.
To make the condition work the frequencies have to be rounded first using the sprintf() function with "%.2f" to round to the two decimal figures shown on the KNS80 display, otherwise there is no way to compare the frequencies from DME and NAV1 in a reliable way since they are floating point numbers (with up to 13 decimal figures). My first thought was to use the round() function, but from the Nasal library/math wiki it is suggested to use sprintf() instead.
Also, as per the Pilot's guide, now the HOLD function will only work if VOR or VOR/PAR (with a ILS frequency) are selected, otherwise the DME will be unusable (showing dashed lines), and the CDI (or HSI) will be flagged. Take into account that this behavior is also described in the MOONEY AIRCRAFT CORPORATION KNS80 RNAV SYSTEM SUPPLEMENT, when it is said that the VOR PAR, RNV ENR, and RNV APR are “
Flagged if the VOR is rechanneled with the DME HOLD button depressed”.
However, it is NOT all true for VOR PAR mode and to correctly model it we need to recheck the KNS80 Pilot's Guide: in the MOONEY AIRCRAFT CORPORATION KNS80 RNAV SYSTEM SUPPLEMENT it is said that in VOR PAR mode the CDI will be "
Flagged if the VOR is rechanneled with the DME HOLD button depressed" (point 2. of section 4.2.2.11 - COURSE DEVIATION INDICATOR), but in the Pilot's guide it is clear that this flagged situation will NOT occur if an ILS frequency is selected. I've modeled that also inside the (hold==1) condition of the DME_hold function.
I haven’t seen a KNS80 working in real life, but I assumed that if we depress the HOLD button while in RNAV modes, and by the flagged CDI, and the dashed DME we realize of our mistake and cancel the HOLD function, the CDI and the DME will be serviceable again. That’s why I placed another listener inside the “else if” pointing to “instrumentation/kns-80/dme-hold”. Without it, if we had the HLD annunciator ON in RNAV modes, and cancel it by depressing the button again, the only way to regain the CDI and DME functionality was to use the frequency knob to get out of our desired frequency and then back to it (because everything is inside the listener pointing to "instrumentation/nav/frequencies/selected-mhz"), which doesn't seem logical during flight. If anyone knows the way the KNS80 works in such a case in real life, please comment so it can be re-fixed.
I’ve been searching for videos about the KNS80 to see if it is as I assumed, but I haven’t found anything of use. Although not from a real aircraft, the only video I’ve found of some interest, because it explains the HOLD function of the KNS80, is this one:
“Distance_Measuring_Equipment_DME__Using_Frequency_Hold__Setting_Waypoints__Transponder”At the end of this post I include the code for the modified KNS80.nas and kns80.xml files, so they can directly substitute the ones inside the kns80 folder in fgdata/Aircraft/Instruments-3d to be used by the original Syd Adams' Aerostar. A copy of the fixed kns80 folder from fgdata can also be placed, as previously, inside the Models/Instruments folder of Patten’s Aerostar-700
04-05_2016 version. However, the same procedure will not work for the new Patten's Aerostar, nor for some of the helijah’s airplanes (Ryan Navion, Velocity XL, etc for example) or the EC-145 of Melchior Franz (and others) -to mention some aircraft that I use- that still use the KNS80 slaved to the GPS. Simply placing a copy of the kns80 folder from fgdata/Aircraft/Instruments-3d/kns80 (already with my fixed KNS80.nas and kns80.xml) won’t make the KNS80 work in those aircraft. So
don’t do it! Some definitions of those aircraft would need to be recoded for them to be able to use the kns80 in fgdata as the original Syd Adams' Aerostar does.
To finish, I have to apologize for the over-commented KNS80.nas of my previous posts, but it has been really useful for me to finish the mod after all this time. The new file has been cleaned off so to check what modifications I did to the original one, please refer to my previous posts on this topic. I don't comment any of the new mods in the new KNS80.nas since I've already done here, and by comparison with the DME_hold section of the original file all are very obvious.
The code for the fixed KNS80.nas:
- Code: Select all
#### King KNS-80 Integrated Navigation System ####
#### Syd Adams ####
#### Ron Jensen ####
####
#### Must be included in the Set file to run the KNS80 radio
####
#### Nav Modes 0 = VOR ; 1 = VOR/PAR ; 2 = RNAV/ENR ; 3 = RNAV/APR ;
####
###############################################################
####
#### Joseba K. Gorbea-Isusi (jogois)- HOLD & GPS independent fix.
####
#### Version 1.4 July 2021
####
var KNS80 = {
new : func(prop){
var m = { parents : [KNS80]};
m.wpt_freq=[];
m.wpt_radial=[];
m.wpt_distance=[];
m.volume_adjust =0;
m.nav_selected = "instrumentation/nav/frequencies/selected-mhz";
m.dme_selected = "instrumentation/dme/frequencies/selected-mhz";
m.display_num = 0;
m.use_num = 0;
m.flasher = 0;
m.kns80 = props.globals.initNode(prop);
m.serviceable = m.kns80.initNode("serviceable",1,"BOOL");
m.data_mode = m.kns80.initNode("data-mode",0,"DOUBLE");
m.nav_mode = m.kns80.initNode("nav-mode",0,"DOUBLE");
m.dme_hold = m.kns80.initNode("dme-hold",0,"BOOL");
m.dsp_flash = m.kns80.initNode("flash",0,"BOOL");
m.display = m.kns80.initNode("display",0,"DOUBLE");
m.use = m.kns80.initNode("use",0,"DOUBLE");
m.to_flagrnav = m.kns80.initNode("to-flag-kns-80",0,"BOOL");
m.from_flagrnav = m.kns80.initNode("from-flag-kns-80",1,"BOOL");
append(m.wpt_freq,m.kns80.initNode("wpt[0]/frequency",115.80,"DOUBLE"));
append(m.wpt_freq,m.kns80.initNode("wpt[1]/frequency",111.70,"DOUBLE"));
append(m.wpt_freq,m.kns80.initNode("wpt[2]/frequency",116.80,"DOUBLE"));
append(m.wpt_freq,m.kns80.initNode("wpt[3]/frequency",113.90,"DOUBLE"));
append(m.wpt_radial,m.kns80.initNode("wpt[0]/radial",280.0,"DOUBLE"));
append(m.wpt_radial,m.kns80.initNode("wpt[1]/radial",280.0,"DOUBLE"));
append(m.wpt_radial,m.kns80.initNode("wpt[2]/radial",029.0,"DOUBLE"));
append(m.wpt_radial,m.kns80.initNode("wpt[3]/radial",029.0,"DOUBLE"));
append(m.wpt_distance,m.kns80.initNode("wpt[0]/distance",0,"DOUBLE"));
append(m.wpt_distance,m.kns80.initNode("wpt[1]/distance",0,"DOUBLE"));
append(m.wpt_distance,m.kns80.initNode("wpt[2]/distance",0,"DOUBLE"));
append(m.wpt_distance,m.kns80.initNode("wpt[3]/distance",0,"DOUBLE"));
m.displayed_distance = m.kns80.initNode("displayed-distance",m.wpt_distance[0].getValue(),"DOUBLE");
m.displayed_frequency = m.kns80.initNode("displayed-frequency",m.wpt_freq[0].getValue(),"DOUBLE");
m.displayed_radial = m.kns80.initNode("displayed-radial",m.wpt_radial[0].getValue(),"DOUBLE");
m.NAV=props.globals.initNode("instrumentation/nav");
m.NAV1 = m.NAV.initNode("frequencies/selected-mhz");
m.NAV1_RADIAL = m.NAV.initNode("radials/selected-deg");
m.NAV1_ACTUAL = m.NAV.initNode("radials/actual-deg");
m.NAV1_TO_FLAG = m.NAV.initNode("to-flag");
m.NAV1_FROM_FLAG = m.NAV.initNode("from-flag");
m.NAV1_HEADING_NEEDLE_DEFLECTION = m.NAV.initNode("heading-needle-deflection");
m.NAV1_IN_RANGE = m.NAV.initNode("in-range");
m.NAV1_distance = m.NAV.initNode("distance");
m.NAV_volume = m.NAV.initNode("volume",0.2,"DOUBLE");
m.RNAV = m.kns80.initNode("rnav");
m.RNAV_deflection = m.RNAV.initNode("heading-needle-deflection",0,"DOUBLE");
m.RNAV_distance = m.RNAV.initNode("indicated-distance-nm",0,"DOUBLE");
m.RNAV_reciprocal = m.RNAV.initNode("reciprocal-radial-deg",0,"DOUBLE");
m.RNAV_actual_deg = m.RNAV.initNode("actual-deg",0,"DOUBLE");
m.DME_mhz = props.globals.initNode("instrumentation/dme/frequencies/selected-mhz",0,"DOUBLE");
m.DME_src = props.globals.initNode("instrumentation/dme/frequencies/source",m.nav_selected,"STRING");
m.DME_dist = props.globals.initNode("instrumentation/dme/indicated-distance-nm",0,"DOUBLE");
return m;
},
#### volume adjust ####
volume : func(vlm){
var vol = me.NAV_volume.getValue();
vol += vlm;
if(vol > 1.0)vol = 1.0;
if(vol < 0.0){
vol = 0.0;
me.serviceable.setBoolValue(0);
setprop("/instrumentation/nav/serviceable",0);
setprop("/instrumentation/dme/serviceable",0);
}
if(vol > 0.0){
me.serviceable.setBoolValue(1);
setprop("/instrumentation/nav/serviceable",1);
setprop("/instrumentation/dme/serviceable",1);
}
me.NAV_volume.setValue(vol);
},
#### dme hold ####
DME_hold : func{
var hold = me.dme_hold.getValue();
hold= 1- hold;
me.dme_hold.setValue(hold);
if(hold==1){
me.DME_mhz.setValue(me.NAV1.getValue());
me.DME_src.setValue(me.dme_selected);
setlistener("instrumentation/nav/frequencies/selected-mhz",func {
if(sprintf("%.2f",me.NAV1.getValue())==sprintf("%.2f",me.DME_mhz.getValue())){
me.dme_hold.setBoolValue(0);
me.DME_mhz.setValue(0);
me.DME_src.setValue(me.nav_selected);
}
var mode_for_dme_hld = getprop("instrumentation/kns-80/nav-mode");
var VOR_has_ILS=getprop("instrumentation/nav/frequencies/is-localizer-frequency");
if(me.dme_hold.getValue()==1 and !VOR_has_ILS and mode_for_dme_hld==1){
setprop("instrumentation/dme/serviceable","false");
setprop("instrumentation/nav/serviceable","false");
}else if(me.dme_hold.getValue()==1 and (mode_for_dme_hld==2 or mode_for_dme_hld==3)){
setprop("instrumentation/dme/serviceable","false");
setprop("instrumentation/nav/serviceable","false");
}else if(me.dme_hold.getValue()==0){setlistener("instrumentation/kns-80/dme-hold",func{
setprop("instrumentation/dme/serviceable","true");
setprop("instrumentation/nav/serviceable","true");
});
}else{
setprop("instrumentation/dme/serviceable","true");
setprop("instrumentation/nav/serviceable","true");
}
});
}else{
me.DME_mhz.setValue(0);
me.DME_src.setValue(me.nav_selected);
}
},
#### display button ####
display_btn : func{
me.display_num +=1;
if(me.display_num>3) me.display_num=0;
me.displayed_frequency.setValue(me.wpt_freq[me.display_num].getValue());
me.displayed_distance.setValue(me.wpt_distance[me.display_num].getValue());
me.displayed_radial.setValue(me.wpt_radial[me.display_num].getValue());
me.data_mode.setValue(0);
if(me.use_num == me.display_num){
me.flasher=0;
}else{
me.flasher=1;
}
me.display.setValue(me.display_num);
},
#### use button ####
use_btn : func{
me.use_num = me.display_num;
me.flasher=0;
me.data_mode.setValue(0);
me.use.setValue(me.use_num);
me.NAV1.setValue(me.wpt_freq[me.display_num].getValue());
},
#### data button ####
data_btn : func{
var data = me.data_mode.getValue();
data +=1;
if(data > 2) data = 0;
me.data_mode.setValue(data);
},
#### data adjust ####
data_adjust : func(dtadj){
var dmode = me.data_mode.getValue();
var num = dtadj;
dtadj=0;
if(dmode == 0){
if(num == -1 or num ==1){num = num *0.05;}else{num = num *0.10;}
var newfreq = me.displayed_frequency.getValue();
newfreq += num;
if(newfreq > 118.95){newfreq -= 11.00;}
if(newfreq < 108.00){newfreq += 11.00;}
me.displayed_frequency.setValue(newfreq);
me.wpt_freq[me.display_num].setValue(newfreq);
if(me.use_num == me.display_num)me.NAV1.setValue(newfreq);
}elsif(dmode == 1){
var newrad = me.displayed_radial.getValue();
newrad += num;
if(newrad > 359){newrad -= 360;}
if(newrad < 0){newrad += 360;}
me.displayed_radial.setValue(newrad);
me.wpt_radial[me.display_num].setValue(newrad);
}elsif(dmode == 2){
var newdist = me.displayed_distance.getValue();
if(num == -1 or num ==1 ){num = num *0.1;}
newdist += num;
if(newdist > 99){newdist -= 100;}
if(newdist < 0){newdist += 100;}
me.displayed_distance.setValue(newdist);
me.wpt_distance[me.display_num].setValue(newdist);
}
},
#### update RNAV ####
# Properties
# outputs
# distance, radial from VOR Station
# rho, theta: distance and radial for phantom station
# range, bearing: distance and radial from phantom station
#### Nav Modes 0 = VOR ; 1 = VOR/PAR ; 2 = RNAV/ENR ; 3 = RNAV/APR ;
updateRNAV : func{
if(!me.NAV1_IN_RANGE.getValue()) {
return;
}
var mode = me.nav_mode.getValue() or 0;
var distance=me.DME_dist.getValue() or 0;
var selected_radial = me.NAV1_RADIAL.getValue() or 0;
var radial = me.NAV1_ACTUAL.getValue() or 0;
var rho = me.wpt_distance[me.use_num].getValue();
var theta = me.wpt_radial[me.use_num].getValue();
var fangle = 0;
var needle_deflection = 0;
var from_flag=1;
var to_flag =0;
var x1 = distance * math.cos( radial*D2R );
var y1 = distance * math.sin( radial*D2R );
var x2 = rho * math.cos( theta*D2R );
var y2 = rho * math.sin( theta*D2R );
var range = math.sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) );
var bearing = math.atan2 (( y1-y2), (x1-x2))*R2D;
if(bearing < 0) bearing += 360;
var abearing = bearing > 180 ? bearing - 180 : bearing + 180;
if( mode == 0){
needle_deflection = (me.NAV1_HEADING_NEEDLE_DEFLECTION.getValue());
range = distance;
}
if ( mode == 1){
fangle = math.abs(selected_radial - radial);
needle_deflection = math.sin((selected_radial - radial) * D2R) * distance * 2;
range = distance;
}
if ( mode == 2){
fangle = math.abs(selected_radial - bearing);
needle_deflection = math.sin((selected_radial - bearing) * D2R) * range * 2;
}
if ( mode == 3){
fangle = math.abs(selected_radial - bearing);
needle_deflection = math.sin((selected_radial - bearing) * D2R) * range * 8;
}
if (( mode == 2) or (mode == 3)) {
props.globals.getNode("/instrumentation/nav/radials/actual-deg").alias("/instrumentation/kns-80/rnav/actual-deg");
props.globals.getNode("/instrumentation/nav/radials/reciprocal-radial-deg").alias("/instrumentation/kns-80/rnav/reciprocal-radial-deg");
props.globals.getNode("/instrumentation/nav/heading-needle-deflection").alias("/instrumentation/kns-80/rnav/heading-needle-deflection");
}else{
props.globals.getNode("/instrumentation/nav/radials/actual-deg").unalias("/instrumentation/kns-80/rnav/actual-deg");
props.globals.getNode("/instrumentation/nav/radials/reciprocal-radial-deg").unalias("/instrumentation/kns-80/rnav/reciprocal-radial-deg");
props.globals.getNode("/instrumentation/nav/heading-needle-deflection").unalias("/instrumentation/kns-80/rnav/heading-needle-deflection");
}
if ( needle_deflection > 10) needle_deflection = 10;
if ( needle_deflection < -10) needle_deflection =-10;
if (fangle < 90 or fangle >270){
from_flag =1;
to_flag = 0;
} else {
from_flag=0;
to_flag =1;
}
me.from_flagrnav.setValue(from_flag);
me.to_flagrnav.setValue(to_flag);
me.RNAV_deflection.setValue(needle_deflection);
if((mode==2) or (mode==3)) {
props.globals.getNode("/instrumentation/nav/to-flag").alias("/instrumentation/kns-80/to-flag-kns-80");
props.globals.getNode("/instrumentation/nav/from-flag").alias("/instrumentation/kns-80/from-flag-kns-80");
}else{
props.globals.getNode("/instrumentation/nav/to-flag").unalias("/instrumentation/kns-80/to-flag-kns-80");
props.globals.getNode("/instrumentation/nav/from-flag").unalias("/instrumentation/kns-80/from-flag-kns-80");
}
me.RNAV_distance.setValue(range);
me.RNAV_reciprocal.setValue(abearing);
me.RNAV_actual_deg.setValue(bearing);
}
};
##################################
var kns80 = KNS80.new("instrumentation/kns-80");
setlistener("/sim/signals/fdm-initialized", func {
update();
flashstatus();
});
var update = func {
kns80.updateRNAV();
settimer(update,0.015);
};
var flashstatus = func {
var fl = kns80.dsp_flash.getValue();
if(kns80.flasher){
kns80.dsp_flash.setValue(1-fl);
}else{
kns80.dsp_flash.setValue(1);
};
settimer(flashstatus, 0.5);
};
The code for its accompanying kns80.xml:
- Code: Select all
<?xml version="1.0"?>
<!-- KNS 80
Bendix/King VOR/LOC/GS/DME/RVAV Integrated NAV System
Syd Adams
Joseba K. Gorbea-Isusi (jogois) - HOLD & GPS independent fix.
July 2021
-->
<PropertyList>
<path>kns80.ac</path>
<animation>
<type>material</type>
<object-name>VOR.btn</object-name>
<object-name>RNAV.btn</object-name>
<object-name>HOLD.btn</object-name>
<object-name>USE.btn</object-name>
<object-name>DSP.btn</object-name>
<object-name>DATA.btn</object-name>
<object-name>KNS80.volume</object-name>
<object-name>KNS80.freq</object-name>
<object-name>KNS80.freq1</object-name>
<emission>
<red>0.028</red>
<green>0.014</green>
<blue>0.007</blue>
<factor-prop>systems/electrical/outputs/instrument-lights</factor-prop>
</emission>
</animation>
<animation>
<name>dme-on</name>
<object-name>nm.101</object-name>
<object-name>nm.102</object-name>
<object-name>nm.103</object-name>
<object-name>kt.101</object-name>
<object-name>kt.102</object-name>
<object-name>kt.103</object-name>
<object-name>min.101</object-name>
<object-name>min.102</object-name>
</animation>
<animation>
<name>illumination</name>
<object-name>annun.nm</object-name>
<object-name>use.digit</object-name>
</animation>
<animation>
<name>frequencies</name>
<object-name>navfreq.101</object-name>
<object-name>navfreq.102</object-name>
<object-name>navfreq.103</object-name>
<object-name>navfreq.104</object-name>
<object-name>navfreq.105</object-name>
<object-name>freq.annun</object-name>
</animation>
<animation>
<name>radials</name>
<object-name>radial.101</object-name>
<object-name>radial.102</object-name>
<object-name>radial.103</object-name>
<object-name>radial.104</object-name>
<object-name>radial.annun</object-name>
</animation>
<animation>
<name>distance</name>
<object-name>dist.101</object-name>
<object-name>dist.102</object-name>
<object-name>dist.103</object-name>
<object-name>dist.annun</object-name>
</animation>
<animation>
<type>select</type>
<object-name>illumination</object-name>
<condition>
<and>
<property>instrumentation/kns-80/serviceable</property>
<greater-than>
<property>systems/electrical/outputs/KNS80</property>
<value>1</value>
</greater-than>
</and>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>display.digit</object-name>
<condition>
<and>
<greater-than>
<property>systems/electrical/outputs/KNS80</property>
<value>1</value>
</greater-than>
<property>instrumentation/kns-80/flash</property>
</and>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>frequencies</object-name>
<condition>
<and>
<property>instrumentation/kns-80/serviceable</property>
<equals>
<property>instrumentation/kns-80/data-mode</property>
<value>0</value>
</equals>
<greater-than>
<property>systems/electrical/outputs/KNS80</property>
<value>1</value>
</greater-than>
</and>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>radials</object-name>
<condition>
<and>
<property>instrumentation/kns-80/serviceable</property>
<equals>
<property>instrumentation/kns-80/data-mode</property>
<value>1</value>
</equals>
<greater-than>
<property>systems/electrical/outputs/KNS80</property>
<value>1</value>
</greater-than>
</and>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>distance</object-name>
<condition>
<and>
<property>instrumentation/kns-80/serviceable</property>
<equals>
<property>instrumentation/kns-80/data-mode</property>
<value>2</value>
</equals>
<greater-than>
<property>systems/electrical/outputs/KNS80</property>
<value>1</value>
</greater-than>
</and>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>dme.invalid</object-name>
<condition>
<and>
<property>instrumentation/kns-80/serviceable</property>
<not>
<property>instrumentation/dme/in-range</property>
</not>
<greater-than>
<property>systems/electrical/outputs/KNS80</property>
<value>1</value>
</greater-than>
</and>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>dme-on</object-name>
<condition>
<and>
<property>instrumentation/kns-80/serviceable</property>
<property>instrumentation/dme/in-range</property>
<greater-than>
<property>systems/electrical/outputs/KNS80</property>
<value>1</value>
</greater-than>
</and>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>vor.annun</object-name>
<condition>
<and>
<property>instrumentation/kns-80/serviceable</property>
<equals>
<property>instrumentation/kns-80/nav-mode</property>
<value>0</value>
</equals>
<greater-than>
<property>systems/electrical/outputs/KNS80</property>
<value>1</value>
</greater-than>
</and>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>par.annun</object-name>
<condition>
<and>
<property>instrumentation/kns-80/serviceable</property>
<equals>
<property>instrumentation/kns-80/nav-mode</property>
<value>1</value>
</equals>
<greater-than>
<property>systems/electrical/outputs/KNS80</property>
<value>1</value>
</greater-than>
</and>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>enr.annun</object-name>
<condition>
<and>
<property>instrumentation/kns-80/serviceable</property>
<equals>
<property>instrumentation/kns-80/nav-mode</property>
<value>2</value>
</equals>
<greater-than>
<property>systems/electrical/outputs/KNS80</property>
<value>1</value>
</greater-than>
</and>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>apr.annun</object-name>
<condition>
<and>
<property>instrumentation/kns-80/serviceable</property>
<equals>
<property>instrumentation/kns-80/nav-mode</property>
<value>3</value>
</equals>
<greater-than>
<property>systems/electrical/outputs/KNS80</property>
<value>1</value>
</greater-than>
</and>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>hld.annun</object-name>
<condition>
<and>
<property>instrumentation/kns-80/serviceable</property>
<property>instrumentation/kns-80/dme-hold</property>
<greater-than>
<property>systems/electrical/outputs/KNS80</property>
<value>1</value>
</greater-than>
</and>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>ils.annun</object-name>
<condition>
<and>
<property>instrumentation/kns-80/serviceable</property>
<property>instrumentation/nav/has-gs</property>
<property>instrumentation/nav/in-range</property>
<greater-than>
<property>systems/electrical/outputs/KNS80</property>
<value>1</value>
</greater-than>
</and>
</condition>
</animation>
<animation>
<type>rotate</type>
<object-name>KNS80.volume</object-name>
<property>instrumentation/nav/volume</property>
<interpolation>
<entry><ind>0</ind><dep>0</dep></entry>
<entry><ind>1.0</ind><dep>300</dep></entry>
</interpolation>
<center>
<x-m> 0.00260 </x-m>
<y-m> 0.04010 </y-m>
<z-m> -0.0279 </z-m>
</center>
<axis>
<x>-1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>translate</type>
<object-name>KNS80.volume</object-name>
<property>instrumentation/nav/ident</property>
<factor>0.005</factor>
<center>
<x-m> 0.00260 </x-m>
<y-m> 0.04010 </y-m>
<z-m> -0.0279 </z-m>
</center>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<!-- Frequency -->
<animation>
<type>textranslate</type>
<object-name>navfreq.101</object-name>
<property>instrumentation/kns-80/displayed-frequency</property>
<factor>0.001</factor>
<step>100</step>
<bias>0.005</bias>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>textranslate</type>
<object-name>navfreq.102</object-name>
<property>instrumentation/kns-80/displayed-frequency</property>
<factor>0.01</factor>
<step>10</step>
<bias>0.005</bias>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>textranslate</type>
<object-name>navfreq.103</object-name>
<property>instrumentation/kns-80/displayed-frequency</property>
<factor>0.1</factor>
<step>1</step>
<bias>0.005</bias>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>textranslate</type>
<object-name>navfreq.104</object-name>
<property>instrumentation/kns-80/displayed-frequency</property>
<factor>1.0</factor>
<step>0.1</step>
<bias>0.005</bias>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>textranslate</type>
<object-name>navfreq.105</object-name>
<property>instrumentation/kns-80/displayed-frequency</property>
<factor>10.0</factor>
<step>0.01</step>
<bias>0.005</bias>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<!-- Radials -->
<animation>
<type>textranslate</type>
<object-name>radial.101</object-name>
<property>instrumentation/kns-80/displayed-radial</property>
<factor>0.001</factor>
<step>100</step>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>textranslate</type>
<object-name>radial.102</object-name>
<property>instrumentation/kns-80/displayed-radial</property>
<factor>0.01</factor>
<step>10</step>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>textranslate</type>
<object-name>radial.103</object-name>
<property>instrumentation/kns-80/displayed-radial</property>
<factor>0.1</factor>
<step>1</step>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<!-- Distance -->
<animation>
<type>textranslate</type>
<object-name>dist.101</object-name>
<property>instrumentation/kns-80/displayed-distance</property>
<factor>0.01</factor>
<step>10</step>
<bias>0.005</bias>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>textranslate</type>
<object-name>dist.102</object-name>
<property>instrumentation/kns-80/displayed-distance</property>
<factor>0.1</factor>
<bias>0.005</bias>
<step>1</step>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>textranslate</type>
<object-name>dist.103</object-name>
<property>instrumentation/kns-80/displayed-distance</property>
<factor>1.0</factor>
<step>0.1</step>
<bias>0.005</bias>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<!-- DME -->
<animation>
<type>textranslate</type>
<object-name>nm.101</object-name>
<property>instrumentation/kns-80/rnav/indicated-distance-nm</property>
<factor>0.01</factor>
<step>10</step>
<bias>0.05</bias>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>textranslate</type>
<object-name>nm.102</object-name>
<property>instrumentation/kns-80/rnav/indicated-distance-nm</property>
<factor>0.1</factor>
<step>1</step>
<bias>0.05</bias>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>textranslate</type>
<object-name>nm.103</object-name>
<property>instrumentation/kns-80/rnav/indicated-distance-nm</property>
<factor>1.0</factor>
<step>0.1</step>
<bias>0.05</bias>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>textranslate</type>
<object-name>kt.101</object-name>
<property>instrumentation/dme/indicated-ground-speed-kt</property>
<factor>0.001</factor>
<step>100</step>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>textranslate</type>
<object-name>kt.102</object-name>
<property>instrumentation/dme/indicated-ground-speed-kt</property>
<factor>0.01</factor>
<step>10</step>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>textranslate</type>
<object-name>kt.103</object-name>
<property>instrumentation/dme/indicated-ground-speed-kt</property>
<factor>0.1</factor>
<step>1</step>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>textranslate</type>
<object-name>min.101</object-name>
<property>instrumentation/dme/indicated-time-min</property>
<factor>0.01</factor>
<step>10</step>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>textranslate</type>
<object-name>min.102</object-name>
<property>instrumentation/dme/indicated-time-min</property>
<factor>0.1</factor>
<step>1</step>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<!-- USED / DISPLAYED WAYPOINTS -->
<animation>
<type>textranslate</type>
<object-name>use.digit</object-name>
<property>instrumentation/kns-80/use</property>
<factor>0.1</factor>
<step>1</step>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>textranslate</type>
<object-name>display.digit</object-name>
<property>instrumentation/kns-80/display</property>
<factor>0.1</factor>
<step>1</step>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<!-- OSG hotspots -->
<animation>
<type>pick</type>
<object-name>KNS80.volume</object-name>
<action>
<button>0</button>
<repeatable>true</repeatable>
<interval-sec>0.1</interval-sec>
<binding>
<condition>
<not>
<property>devices/status/keyboard/shift</property>
</not>
</condition>
<command>nasal</command>
<script>systems.kns80.volume(0.05)</script>
</binding>
<binding>
<condition>
<property>devices/status/keyboard/shift</property>
</condition>
<command>property-toggle</command>
<property>instrumentation/nav/ident</property>
</binding>
</action>
</animation>
<animation>
<type>pick</type>
<object-name>KNS80.volume</object-name>
<action>
<button>1</button>
<repeatable>true</repeatable>
<interval-sec>0.1</interval-sec>
<binding>
<command>nasal</command>
<script>systems.kns80.volume(-0.05)</script>
</binding>
</action>
</animation>
<animation>
<type>pick</type>
<object-name>KNS80.volume</object-name>
<action>
<button>3</button>
<binding>
<command>nasal</command>
<script>systems.kns80.volume(0.05)</script>
</binding>
</action>
<hovered>
<binding>
<command>set-tooltip</command>
<tooltip-id>KNS80-Vol</tooltip-id>
<label>Volume: %3d%%</label>
<property>instrumentation/nav/volume</property>
<mapping>percent</mapping>
</binding>
</hovered>
</animation>
<animation>
<type>pick</type>
<object-name>KNS80.volume</object-name>
<action>
<button>4</button>
<binding>
<command>nasal</command>
<script>systems.kns80.volume(-0.05)</script>
</binding>
</action>
</animation>
<animation>
<type>pick</type>
<object-name>KNS80.freq1</object-name>
<action>
<button>0</button>
<repeatable>true</repeatable>
<interval-sec>0.2</interval-sec>
<binding>
<command>nasal</command>
<script>systems.kns80.data_adjust(1)</script>
</binding>
</action>
</animation>
<animation>
<type>pick</type>
<object-name>KNS80.freq1</object-name>
<action>
<button>1</button>
<repeatable>true</repeatable>
<interval-sec>0.2</interval-sec>
<binding>
<command>nasal</command>
<script>systems.kns80.data_adjust(-1)</script>
</binding>
</action>
</animation>
<animation>
<type>pick</type>
<object-name>KNS80.freq1</object-name>
<action>
<button>3</button>
<binding>
<command>nasal</command>
<script>systems.kns80.data_adjust(1)</script>
</binding>
</action>
</animation>
<animation>
<type>pick</type>
<object-name>KNS80.freq1</object-name>
<action>
<button>4</button>
<binding>
<command>nasal</command>
<script>systems.kns80.data_adjust(-1)</script>
</binding>
</action>
</animation>
<animation>
<type>pick</type>
<object-name>KNS80.freq</object-name>
<action>
<button>0</button>
<repeatable>true</repeatable>
<interval-sec>0.2</interval-sec>
<binding>
<command>nasal</command>
<script>systems.kns80.data_adjust(10)</script>
</binding>
</action>
</animation>
<animation>
<type>pick</type>
<object-name>KNS80.freq</object-name>
<action>
<button>1</button>
<repeatable>true</repeatable>
<interval-sec>0.2</interval-sec>
<binding>
<command>nasal</command>
<script>systems.kns80.data_adjust(-10)</script>
</binding>
</action>
</animation>
<animation>
<type>pick</type>
<object-name>KNS80.freq</object-name>
<action>
<button>3</button>
<binding>
<command>nasal</command>
<script>systems.kns80.data_adjust(10)</script>
</binding>
</action>
</animation>
<animation>
<type>pick</type>
<object-name>KNS80.freq</object-name>
<action>
<button>4</button>
<binding>
<command>nasal</command>
<script>systems.kns80.data_adjust(-10)</script>
</binding>
</action>
</animation>
<animation>
<type>pick</type>
<object-name>HOLD.btn</object-name>
<action>
<button>0</button>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>systems.kns80.DME_hold();</script>
</binding>
</action>
</animation>
<animation>
<type>pick</type>
<object-name>USE.btn</object-name>
<action>
<button>0</button>
<binding>
<command>nasal</command>
<script>systems.kns80.use_btn();</script>
</binding>
</action>
</animation>
<animation>
<type>pick</type>
<object-name>DSP.btn</object-name>
<action>
<button>0</button>
<binding>
<command>nasal</command>
<script>systems.kns80.display_btn();</script>
</binding>
</action>
</animation>
<animation>
<type>pick</type>
<object-name>DATA.btn</object-name>
<action>
<button>0</button>
<binding>
<command>nasal</command>
<script>systems.kns80.data_btn()</script>
</binding>
</action>
</animation>
<animation>
<type>pick</type>
<object-name>VOR.btn</object-name>
<action>
<button>0</button>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>
var test = getprop("/instrumentation/kns-80/nav-mode");
if(test != 0){
setprop("/instrumentation/kns-80/nav-mode",0);
setprop("/instrumentation/nav/slaved-to-gps", 0);
}else{
setprop("/instrumentation/kns-80/nav-mode",1);
setprop("/instrumentation/nav/slaved-to-gps", 0);
}
</script>
</binding>
</action>
</animation>
<animation>
<type>pick</type>
<object-name>RNAV.btn</object-name>
<action>
<button>0</button>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>
var test = getprop("/instrumentation/kns-80/nav-mode");
if(test != 2){
setprop("/instrumentation/kns-80/nav-mode",2);
}else{
setprop("/instrumentation/kns-80/nav-mode",3);
setprop("/instrumentation/nav/slaved-to-gps", 0);
}
</script>
</binding>
</action>
</animation>
</PropertyList>
Done.
jogois.