2007-04-09 19:33:41 +00:00
|
|
|
#### King KY-196 Comm Transciever ####
|
|
|
|
#### Syd Adams ####
|
|
|
|
####
|
2007-04-28 05:40:25 +00:00
|
|
|
####Must be included in the Set file to run the KY-196 radio
|
2007-04-09 19:33:41 +00:00
|
|
|
####
|
|
|
|
|
|
|
|
KY196 = props.globals.getNode("/instrumentation/ky-196",1);
|
|
|
|
FDM_ON = 0;
|
|
|
|
|
|
|
|
setlistener("/sim/signals/fdm-initialized", func {
|
2007-04-28 05:40:25 +00:00
|
|
|
KY196.getNode("comm-num",1).setIntValue(0);
|
|
|
|
KY196.getNode("volume-adjust",1).setDoubleValue(0);
|
|
|
|
FDM_ON = 1;
|
|
|
|
print("KY-196 Comm System ... OK");
|
|
|
|
});
|
|
|
|
|
2007-04-09 19:33:41 +00:00
|
|
|
setlistener("/instrumentation/ky-196/volume-adjust", func {
|
2007-04-28 05:40:25 +00:00
|
|
|
if(FDM_ON == 0){return;}
|
|
|
|
var setting = cmdarg().getValue();
|
|
|
|
cmdarg().setDoubleValue(0);
|
|
|
|
comm_num = KY196.getNode("comm-num").getValue();
|
|
|
|
var commNode = props.globals.getNode("instrumentation/comm[" ~ comm_num ~"]");
|
|
|
|
var vol = commNode.getNode("volume").getValue() + setting;
|
|
|
|
if(vol > 1.0){vol = 1.0;}
|
|
|
|
if(vol < 0.0){vol = 0.0;commNode.getNode("serviceable").setBoolValue(0);}
|
|
|
|
if(vol > 0.0){commNode.getNode("serviceable").setBoolValue(1);}
|
|
|
|
commNode.getNode("volume").setDoubleValue(vol);
|
|
|
|
});
|