2007-04-16 01:24:02 +00:00
|
|
|
#### King RDR-160 Weather Radar ####
|
|
|
|
#### Syd Adams ####
|
|
|
|
####
|
2007-04-27 06:23:56 +00:00
|
|
|
#### Include this file in the Set file to run the RDR-160 radar
|
2007-04-16 01:24:02 +00:00
|
|
|
####
|
|
|
|
#### Switch Modes 0 = off ; 1 = stby ; 2 = tst ; 3 = on;
|
|
|
|
#### Radar Modes WX ; WXA ; MAP
|
|
|
|
#### Ranges : 10 , 20, 40, 80 , 160
|
|
|
|
|
2007-12-18 07:13:10 +00:00
|
|
|
RADAR = props.globals.getNode("/instrumentation/radar",1);
|
2007-04-16 01:24:02 +00:00
|
|
|
FDM_ON = 0;
|
|
|
|
P_Str =["off","stby", "tst","on"];
|
2007-04-27 06:23:56 +00:00
|
|
|
RADAR.getNode("serviceable",1).setBoolValue(1);
|
2007-08-10 06:24:20 +00:00
|
|
|
RADAR.getNode("range",1).setIntValue(20);
|
|
|
|
RADAR.getNode("heading-marker",1).setBoolValue(0);
|
|
|
|
RADAR.getNode("lightning",1).setBoolValue(0);
|
2007-04-27 06:23:56 +00:00
|
|
|
RADAR.getNode("set-range",1).setIntValue(0);
|
|
|
|
RADAR.getNode("minimized",1).setBoolValue(0);
|
|
|
|
RADAR.getNode("switch",1).setValue("off");
|
|
|
|
RADAR.getNode("switch-pos",1).setIntValue(0);
|
|
|
|
RADAR.getNode("mode",1).setValue("WX");
|
2007-08-10 06:24:20 +00:00
|
|
|
RADAR.getNode("mode-control",1).setIntValue(3);
|
2007-04-27 06:23:56 +00:00
|
|
|
RADAR.getNode("display-mode",1).setValue("arc");
|
|
|
|
RADAR.getNode("dim",1).setDoubleValue(0.5);
|
2007-08-10 06:24:20 +00:00
|
|
|
RADAR.getNode("display-controls/WX",1).setBoolValue(1);
|
|
|
|
RADAR.getNode("display-controls/data",1).setBoolValue(0);
|
|
|
|
RADAR.getNode("display-controls/pos",1).setBoolValue(0);
|
2007-04-27 06:23:56 +00:00
|
|
|
|
|
|
|
setlistener("/sim/signals/fdm-initialized", func {
|
|
|
|
FDM_ON = 1;
|
|
|
|
print("KING RDR-160 ... OK");
|
|
|
|
});
|
2007-04-16 01:24:02 +00:00
|
|
|
|
2007-12-18 07:13:10 +00:00
|
|
|
setlistener("/instrumentation/radar/switch-pos", func {
|
2007-04-27 06:23:56 +00:00
|
|
|
if(FDM_ON != 0){
|
|
|
|
var swtch = cmdarg().getValue();
|
|
|
|
RADAR.getNode("switch",1).setValue(P_Str[swtch]);
|
|
|
|
}
|
|
|
|
});
|
2007-04-16 01:24:02 +00:00
|
|
|
|
2007-12-18 07:13:10 +00:00
|
|
|
setlistener("/instrumentation/radar/set-range", func {
|
2007-04-27 06:23:56 +00:00
|
|
|
if(FDM_ON != 0){
|
|
|
|
var rng = RADAR.getNode("range").getValue();
|
|
|
|
var num = cmdarg().getValue();
|
|
|
|
cmdarg().setValue(0);
|
|
|
|
if(num > 0){
|
|
|
|
rng *= 2;
|
|
|
|
if(rng > 160){rng = 160.0;}
|
|
|
|
}else{
|
|
|
|
if(num < 0){
|
|
|
|
rng *=0.5;
|
|
|
|
if(rng < 10){rng = 10.0;}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
RADAR.getNode("range").setValue(rng);
|
|
|
|
}
|
|
|
|
});
|
2007-04-16 01:24:02 +00:00
|
|
|
|