1
0
Fork 0

FG1000: Better handling of VFR transponder code

Support in-sim updates to
/instrumentation/transponder/factory-vfr-code
This commit is contained in:
Stuart Buchanan 2020-08-21 15:55:26 +01:00
parent f374bfabcb
commit 0c521de80b
3 changed files with 6 additions and 13 deletions

View file

@ -117,8 +117,6 @@ var ConfigStore = {
"Vr-visible" : 1,
"Vglide-visible" : 1,
"Vne-visible": 1,
"TransponderVFRCode" : 1200,
},
new : func()
@ -147,8 +145,6 @@ var ConfigStore = {
obj._layerRanges[i] = ConfigStore.layerRanges[i];
}
obj.updateVFRTransponderCode();
return obj;
},
@ -206,10 +202,4 @@ var ConfigStore = {
me._layerRanges[layer].range = math.min(range, me._layerRanges[layer].max_range);
},
updateVFRTransponderCode : func() {
# Special case VFR transponder code
var vfr_default = props.globals.getNode("/instrumentation/transponder/factory-vfr-code", 1);
if (vfr_default.getValue()) me.set("TransponderVFRCode", vfr_default.getValue());
},
};

View file

@ -114,6 +114,7 @@ var GenericNavComPublisher =
obj._triggeredPublisher.addPropMap("TransponderMode", "/instrumentation/transponder/inputs/knob-mode");
obj._triggeredPublisher.addPropMap("TransponderIdent", "/instrumentation/transponder/inputs/ident-btn");
obj._triggeredPublisher.addPropMap("TransponderCode", "/instrumentation/transponder/id-code");
obj._triggeredPublisher.addPropMap("TransponderVFRCode", "/instrumentation/transponder/factory-vfr-code");
return obj;
},

View file

@ -97,8 +97,9 @@ var PFDInstrumentsController =
_transponder_mode : 0,
_transponder_ident : 0,
_transponder_edit : 0, # If we're currently editing the transponder code
_transponder_edit_code : 0, # Current value being edited as transponder code
_transponder_edit : 0, # If we're currently editing the transponder code
_transponder_edit_code : 0, # Current value being edited as transponder code
_transponder_vfr_code : 1200, # Standard VFR code
_marker_beacon_outer : 0,
_marker_beacon_middle : 0,
@ -404,6 +405,7 @@ var PFDInstrumentsController =
if (data["TransponderMode"] != nil) me._transponder_mode = data["TransponderMode"];
if (data["TransponderCode"] != nil) me._transponder_code = data["TransponderCode"];
if (data["TransponderIdent"] != nil) me._transponder_ident = data["TransponderIdent"];
if (data["TransponderVFRCode"] != nil) me._transponder_vfr_code = data["TransponderVFRCode"];
if (data["MarkerBeaconInner"] != nil) me._marker_beacon_inner = data["MarkerBeaconInner"];
if (data["MarkerBeaconMiddle"] != nil) me._marker_beacon_middle = data["MarkerBeaconMiddle"];
@ -570,7 +572,7 @@ var PFDInstrumentsController =
},
setVFRTransponderCode : func() {
me.sendNavComDataNotification({"TransponderCode" : me.page.mfd.ConfigStore.get("TransponderVFRCode")});
me.sendNavComDataNotification({"TransponderCode" : me._transponder_vfr_code});
},
setTransponderCode : func(code) {