1
0
Fork 0

FG1000 - Make transponder more robust, VFR code

Make transponder display more robust, and define
VFR code in the ConfigStore.
This commit is contained in:
Stuart Buchanan 2023-11-02 12:38:48 +00:00
parent 89f980393a
commit 2b47c8ac61
2 changed files with 4 additions and 1 deletions

View file

@ -117,6 +117,8 @@ var ConfigStore = {
"Vr-visible" : 1,
"Vglide-visible" : 1,
"Vne-visible": 1,
"TransponderVFRCode": 1200, # Factory set Transponder code
},
new : func()

View file

@ -918,9 +918,10 @@ var PFDInstruments =
# Update the Transponder display
updateTransponder : func(mode, code, ident, edit=0) {
# Data validation on the mode
# Data validation on the mode and code itself
if (mode < 0) mode = 0;
if (mode > 5) mode = 5;
if ((code == nil) or (! isnum(code))) code = 0;
# Ensure the code is a 4 digit string representation of a number.
# Normally this means padding with 0's at the left e.g. 42 becomes 0042.