FG1000 - Make transponder more robust, VFR code
Make transponder display more robust, and define VFR code in the ConfigStore.
This commit is contained in:
parent
89f980393a
commit
2b47c8ac61
2 changed files with 4 additions and 1 deletions
|
@ -117,6 +117,8 @@ var ConfigStore = {
|
||||||
"Vr-visible" : 1,
|
"Vr-visible" : 1,
|
||||||
"Vglide-visible" : 1,
|
"Vglide-visible" : 1,
|
||||||
"Vne-visible": 1,
|
"Vne-visible": 1,
|
||||||
|
|
||||||
|
"TransponderVFRCode": 1200, # Factory set Transponder code
|
||||||
},
|
},
|
||||||
|
|
||||||
new : func()
|
new : func()
|
||||||
|
|
|
@ -918,9 +918,10 @@ var PFDInstruments =
|
||||||
|
|
||||||
# Update the Transponder display
|
# Update the Transponder display
|
||||||
updateTransponder : func(mode, code, ident, edit=0) {
|
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 < 0) mode = 0;
|
||||||
if (mode > 5) mode = 5;
|
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.
|
# 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.
|
# Normally this means padding with 0's at the left e.g. 42 becomes 0042.
|
||||||
|
|
Loading…
Add table
Reference in a new issue