1
0
Fork 0

Merge branch 'dev' into new-font

This commit is contained in:
Jonathan Redpath 2021-12-27 16:57:15 +00:00
commit 79219593bd
27 changed files with 2624 additions and 1086 deletions

View file

@ -111,6 +111,7 @@
<type>rotate</type> <type>rotate</type>
<object-name>ddrmi_hdg</object-name> <object-name>ddrmi_hdg</object-name>
<property>instrumentation/ddrmi/heading</property> <property>instrumentation/ddrmi/heading</property>
<factor>-1</factor>
<axis> <axis>
<object-name>ddrmi_hdg.axis</object-name> <object-name>ddrmi_hdg.axis</object-name>
</axis> </axis>
@ -121,6 +122,7 @@
<object-name>ddrmi_pointer_1</object-name> <object-name>ddrmi_pointer_1</object-name>
<type>rotate</type> <type>rotate</type>
<property>instrumentation/ddrmi/needle-1</property> <property>instrumentation/ddrmi/needle-1</property>
<factor>-1</factor>
<axis> <axis>
<object-name>ddrmi_hdg.axis</object-name> <object-name>ddrmi_hdg.axis</object-name>
</axis> </axis>
@ -131,6 +133,7 @@
<object-name>ddrmi_pointer_2</object-name> <object-name>ddrmi_pointer_2</object-name>
<type>rotate</type> <type>rotate</type>
<property>instrumentation/ddrmi/needle-2</property> <property>instrumentation/ddrmi/needle-2</property>
<factor>-1</factor>
<axis> <axis>
<object-name>ddrmi_hdg.axis</object-name> <object-name>ddrmi_hdg.axis</object-name>
</axis> </axis>
@ -148,7 +151,7 @@
<binding> <binding>
<command>property-adjust</command> <command>property-adjust</command>
<property>instrumentation/ddrmi/vor-adf-1</property> <property>instrumentation/ddrmi/vor-adf-1</property>
<min>-1</min> <min>0</min>
<max>1</max> <max>1</max>
</binding> </binding>
</action> </action>
@ -160,8 +163,7 @@
<object-name>ddrmi_vor_adf_select_1</object-name> <object-name>ddrmi_vor_adf_select_1</object-name>
<property>instrumentation/ddrmi/vor-adf-1</property> <property>instrumentation/ddrmi/vor-adf-1</property>
<interpolation> <interpolation>
<entry><ind>-1</ind><dep>90</dep></entry> <!-- ADF --> <entry><ind> 0</ind><dep>90</dep></entry> <!-- ADF -->
<entry><ind> 0</ind><dep>45</dep></entry> <!-- OFF -->
<entry><ind> 1</ind><dep> 0</dep></entry> <!-- VOR --> <entry><ind> 1</ind><dep> 0</dep></entry> <!-- VOR -->
</interpolation> </interpolation>
<axis> <axis>
@ -180,7 +182,7 @@
<binding> <binding>
<command>property-adjust</command> <command>property-adjust</command>
<property>instrumentation/ddrmi/vor-adf-2</property> <property>instrumentation/ddrmi/vor-adf-2</property>
<min>-1</min> <min>0</min>
<max>1</max> <max>1</max>
</binding> </binding>
</action> </action>
@ -192,8 +194,7 @@
<object-name>ddrmi_vor_adf_select_2</object-name> <object-name>ddrmi_vor_adf_select_2</object-name>
<property>instrumentation/ddrmi/vor-adf-2</property> <property>instrumentation/ddrmi/vor-adf-2</property>
<interpolation> <interpolation>
<entry><ind>-1</ind><dep>-90</dep></entry> <!-- ADF --> <entry><ind> 0</ind><dep>-90</dep></entry> <!-- ADF -->
<entry><ind> 0</ind><dep>-45</dep></entry> <!-- OFF -->
<entry><ind> 1</ind><dep> 0</dep></entry> <!-- VOR --> <entry><ind> 1</ind><dep> 0</dep></entry> <!-- VOR -->
</interpolation> </interpolation>
<axis> <axis>
@ -9037,8 +9038,6 @@
<kerning>default</kerning> <kerning>default</kerning>
</text> </text>
<text> <text>
<name>dme1_0</name> <name>dme1_0</name>
<offsets> <offsets>
@ -9101,14 +9100,74 @@
<kerning>default</kerning> <kerning>default</kerning>
</text> </text>
<text>
<name>dme_flag</name>
<offsets>
<x-m>-0.529</x-m>
<y-m>-0.149</y-m>
<z-m>0.1305</z-m>
<heading-deg>90</heading-deg>
<roll-deg>72.81</roll-deg>
</offsets>
<alignment>right-center</alignment>
<axis-alignment>xy-plane</axis-alignment>
<type type="string">literal</type>
<text type="string">----</text>
<truncate>false</truncate>
<layout>left-to-right</layout>
<draw-text type="bool">true</draw-text> <!-- draw the text itself -->
<draw-alignment type="bool">false</draw-alignment> <!-- draw crosshair at object center -->
<draw-boundingbox type="bool">false</draw-boundingbox> <!-- draw a bounding box -->
<font>led.txf</font> <!-- The font file name, relative to data/Fonts -->
<character-size type="double">0.007</character-size> <!-- size (height) im meters -->
<character-aspect-ratio type="double">1.0</character-aspect-ratio>
<max-height>0.012</max-height> <!-- the maximum height of the text -->
<max-width>0.040</max-width> <!-- the maximum width of the text -->
<font-resolution>
<width type="int">32</width>
<height type="int">32</height>
</font-resolution>
<kerning>default</kerning>
</text>
<text>
<name>dme1_flag</name>
<offsets>
<x-m>-0.529</x-m>
<y-m>-0.116</y-m>
<z-m>0.1305</z-m>
<heading-deg>90</heading-deg>
<roll-deg>72.81</roll-deg>
</offsets>
<alignment>right-center</alignment>
<axis-alignment>xy-plane</axis-alignment>
<type type="string">literal</type>
<text type="string">----</text>
<truncate>false</truncate>
<layout>left-to-right</layout>
<draw-text type="bool">true</draw-text> <!-- draw the text itself -->
<draw-alignment type="bool">false</draw-alignment> <!-- draw crosshair at object center -->
<draw-boundingbox type="bool">false</draw-boundingbox> <!-- draw a bounding box -->
<font>led.txf</font> <!-- The font file name, relative to data/Fonts -->
<character-size type="double">0.007</character-size> <!-- size (height) im meters -->
<character-aspect-ratio type="double">1.0</character-aspect-ratio>
<max-height>0.012</max-height> <!-- the maximum height of the text -->
<max-width>0.040</max-width> <!-- the maximum width of the text -->
<font-resolution>
<width type="int">32</width>
<height type="int">32</height>
</font-resolution>
<kerning>default</kerning>
</text>
<animation> <animation>
<type>material</type> <type>material</type>
<object-name>dme_0</object-name> <object-name>dme_0</object-name>
<object-name>dme</object-name> <object-name>dme</object-name>
<!-- <object-name>dme_20</object-name>--> <object-name>dme_flag</object-name>
<object-name>dme1_0</object-name> <object-name>dme1_0</object-name>
<object-name>dme1</object-name> <object-name>dme1</object-name>
<!-- <object-name>dme1_20</object-name>--> <object-name>dme1_flag</object-name>
<diffuse> <diffuse>
<red>1.00</red> <red>1.00</red>
<green>0.355</green> <green>0.355</green>
@ -9149,8 +9208,8 @@
</greater-than> </greater-than>
</or> </or>
<greater-than-equals> <greater-than-equals>
<property>systems/electrical/bus/dc-ess</property> <property>systems/electrical/bus/ac-ess</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
<equals> <equals>
<property>instrumentation/ddrmi/vor-adf-1</property> <property>instrumentation/ddrmi/vor-adf-1</property>
@ -9176,8 +9235,8 @@
<value>20</value> <value>20</value>
</less-than-equals> </less-than-equals>
<greater-than-equals> <greater-than-equals>
<property>systems/electrical/bus/dc-ess</property> <property>systems/electrical/bus/ac-ess</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
<equals> <equals>
<property>instrumentation/ddrmi/vor-adf-1</property> <property>instrumentation/ddrmi/vor-adf-1</property>
@ -9205,8 +9264,8 @@
</greater-than> </greater-than>
</or> </or>
<greater-than-equals> <greater-than-equals>
<property>systems/electrical/bus/dc-ess</property> <property>systems/electrical/bus/ac-ess</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
<equals> <equals>
<property>instrumentation/ddrmi/vor-adf-2</property> <property>instrumentation/ddrmi/vor-adf-2</property>
@ -9232,8 +9291,46 @@
<value>20.0</value> <value>20.0</value>
</less-than-equals> </less-than-equals>
<greater-than-equals> <greater-than-equals>
<property>systems/electrical/bus/dc-ess</property> <property>systems/electrical/bus/ac-ess</property>
<value>25.0</value> <value>110.0</value>
</greater-than-equals>
<equals>
<property>instrumentation/ddrmi/vor-adf-2</property>
<value>1</value>
</equals>
</and>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>dme_flag</object-name>
<condition>
<and>
<property>instrumentation/dme[2]/operable</property>
<not><property>instrumentation/dme[2]/in-range</property></not>
<greater-than-equals>
<property>systems/electrical/bus/ac-ess</property>
<value>110.0</value>
</greater-than-equals>
<equals>
<property>instrumentation/ddrmi/vor-adf-1</property>
<value>1</value>
</equals>
</and>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>dme1_flag</object-name>
<condition>
<and>
<property>instrumentation/dme[3]/operable</property>
<not><property>instrumentation/dme[3]/in-range</property></not>
<greater-than-equals>
<property>systems/electrical/bus/ac-ess</property>
<value>110.0</value>
</greater-than-equals> </greater-than-equals>
<equals> <equals>
<property>instrumentation/ddrmi/vor-adf-2</property> <property>instrumentation/ddrmi/vor-adf-2</property>

View file

@ -84,24 +84,6 @@ var database1 = props.globals.getNode("/FMGC/internal/navdatabase", 1);
var database2 = props.globals.getNode("/FMGC/internal/navdatabase2", 1); var database2 = props.globals.getNode("/FMGC/internal/navdatabase2", 1);
var databaseCode = props.globals.getNode("/FMGC/internal/navdatabasecode", 1); var databaseCode = props.globals.getNode("/FMGC/internal/navdatabasecode", 1);
# RADNAV
var vor1 = props.globals.getNode("/FMGC/internal/vor1-mcdu", 1);
var vor2 = props.globals.getNode("/FMGC/internal/vor2-mcdu", 1);
var ils1 = props.globals.getNode("/FMGC/internal/ils1-mcdu", 1);
var adf1 = props.globals.getNode("/FMGC/internal/adf1-mcdu", 1);
var adf2 = props.globals.getNode("/FMGC/internal/adf2-mcdu", 1);
var vor1FreqSet = props.globals.getNode("/FMGC/internal/vor1freq-set", 1);
var vor1CRSSet = props.globals.getNode("/FMGC/internal/vor1crs-set", 1);
var vor2FreqSet = props.globals.getNode("/FMGC/internal/vor2freq-set", 1);
var vor2CRSSet = props.globals.getNode("/FMGC/internal/vor2crs-set", 1);
var ils1FreqSet = props.globals.getNode("/FMGC/internal/ils1freq-set", 1);
var ils1CRSSet = props.globals.getNode("/FMGC/internal/ils1crs-set", 1);
var adf1FreqSet = props.globals.getNode("/FMGC/internal/adf1freq-set", 1);
var adf2FreqSet = props.globals.getNode("/FMGC/internal/adf2freq-set", 1);
var ils1CRS = props.globals.getNode("/instrumentation/nav[0]/radials/selected-deg", 1);
var vor1CRS = props.globals.getNode("/instrumentation/nav[2]/radials/selected-deg", 1);
var vor2CRS = props.globals.getNode("/instrumentation/nav[3]/radials/selected-deg", 1);
# INT-A # INT-A
var ADIRSMCDUBTN = props.globals.getNode("/controls/adirs/mcducbtn", 1); var ADIRSMCDUBTN = props.globals.getNode("/controls/adirs/mcducbtn", 1);
@ -2578,8 +2560,8 @@ var canvas_MCDU_base = {
me["Simple_L0S"].hide(); me["Simple_L0S"].hide();
showLeftS(me,1, 1, 1, 1, 1, -1); showLeftS(me,1, 1, 1, 1, 1, -1);
showLeftArrow(me,-1, -1, -1, -1, -1, -1); showLeftArrow(me,-1, -1, -1, -1, -1, -1);
showRight(me,1, 1, 1, 1, 1, -1); showRight(me,1, 1, -1, -1, 1, -1);
showRightS(me,1, 1, 1, 1, 1, -1); showRightS(me,1, 1, -1, -1, 1, -1);
showRightArrow(me,-1, -1, -1, -1, -1, -1); showRightArrow(me,-1, -1, -1, -1, -1, -1);
me["Simple_C3B"].hide(); me["Simple_C3B"].hide();
me["Simple_C4B"].hide(); me["Simple_C4B"].hide();
@ -2594,86 +2576,107 @@ var canvas_MCDU_base = {
me.colorLeft("blu", "blu", "blu", "blu", "blu", "blu"); me.colorLeft("blu", "blu", "blu", "blu", "blu", "blu");
me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht"); me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorLeftArrow("wht", "wht", "wht", "wht", "wht", "wht"); me.colorLeftArrow("wht", "wht", "wht", "wht", "wht", "blu");
me.colorCenter("wht", "wht", "wht", "wht", "wht", "grn"); me.colorCenter("wht", "wht", "wht", "wht", "wht", "grn");
me.colorCenterS("wht", "wht", "wht", "wht", "wht", "wht"); me.colorCenterS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRight("blu", "blu", "blu", "blu", "blu", "blu"); me.colorRight("blu", "blu", "blu", "blu", "blu", "blu");
me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht"); me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht"); me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "blu");
pageSwitch[i].setBoolValue(1); pageSwitch[i].setBoolValue(1);
} }
if (vor1FreqSet.getValue() == 1) { if (fmgc.FMGCInternal.VOR1.freqSet) {
me["Simple_L1"].setFontSize(normal); me["Simple_L1"].setFontSize(normal);
} else { } else {
me["Simple_L1"].setFontSize(small); me["Simple_L1"].setFontSize(small);
} }
if (vor1CRSSet.getValue() == 1) { if (fmgc.FMGCInternal.VOR1.crsSet) {
me["Simple_L2"].setFontSize(normal); me["Simple_L2"].setFontSize(normal);
} else { } else {
me["Simple_L2"].setFontSize(small); me["Simple_L2"].setFontSize(small);
} }
if (ils1FreqSet.getValue() == 1) { if (fmgc.FMGCInternal.ILS.freqSet) {
me["Simple_L3"].setFontSize(normal); me["Simple_L3"].setFontSize(normal);
} else { } else {
me["Simple_L3"].setFontSize(small); me["Simple_L3"].setFontSize(small);
} }
if (ils1CRSSet.getValue() == 1) { if (fmgc.FMGCInternal.ILS.crsSet) {
me["Simple_L4"].setFontSize(normal); me["Simple_L4"].setFontSize(normal);
} else { } else {
me["Simple_L4"].setFontSize(small); me["Simple_L4"].setFontSize(small);
} }
if (adf1FreqSet.getValue() == 1) {
me["Simple_L6"].setText(" ADF1 BFO");
me["Simple_R6"].setText("ADF2 BFO ");
if (fmgc.FMGCInternal.ADF1.freqSet) {
me["Simple_L5"].setFont(default); me["Simple_L5"].setFont(default);
me["Simple_L5"].setFontSize(normal); me["Simple_L5"].setFontSize(normal);
me["Simple_L5"].setText(sprintf("%s", adf1.getValue())); me["Simple_L5"].setText(sprintf(" %s", fmgc.FMGCInternal.ADF1.mcdu));
me["Simple_L6"].show();
if (rmp.BFOActive[0].getValue()) {
# TODO - wrong arrow
me["Simple_L6_Arrow"].hide();
} else {
me["Simple_L6_Arrow"].show();
}
} else { } else {
me["Simple_L5"].setFont(symbol); me["Simple_L5"].setFont(symbol);
me["Simple_L5"].setFontSize(small); me["Simple_L5"].setFontSize(small);
me["Simple_L5"].setText("[ ]/[ ]"); me["Simple_L5"].setText("[ ]/[ .]");
me["Simple_L6"].hide();
me["Simple_L6_Arrow"].hide();
} }
if (vor2FreqSet.getValue() == 1) { if (fmgc.FMGCInternal.VOR2.freqSet) {
me["Simple_R1"].setFontSize(normal); me["Simple_R1"].setFontSize(normal);
} else { } else {
me["Simple_R1"].setFontSize(small); me["Simple_R1"].setFontSize(small);
} }
if (vor2CRSSet.getValue() == 1) { if (fmgc.FMGCInternal.VOR2.crsSet) {
me["Simple_R2"].setFontSize(normal); me["Simple_R2"].setFontSize(normal);
} else { } else {
me["Simple_R2"].setFontSize(small); me["Simple_R2"].setFontSize(small);
} }
if (adf2FreqSet.getValue() == 1) {
if (fmgc.FMGCInternal.ADF2.freqSet) {
me["Simple_R5"].setFont(default); me["Simple_R5"].setFont(default);
me["Simple_R5"].setFontSize(normal); me["Simple_R5"].setFontSize(normal);
me["Simple_R5"].setText(sprintf("%s", adf2.getValue())); me["Simple_R5"].setText(sprintf("%s ", fmgc.FMGCInternal.ADF2.mcdu));
me["Simple_R6"].show();
if (rmp.BFOActive[1].getValue()) {
# TODO - wrong arrow
me["Simple_R6_Arrow"].hide();
} else {
me["Simple_R6_Arrow"].show();
}
} else { } else {
me["Simple_R5"].setFont(symbol); me["Simple_R5"].setFont(symbol);
me["Simple_R5"].setFontSize(small); me["Simple_R5"].setFontSize(small);
me["Simple_R5"].setText("[ ]/[ ]"); me["Simple_R5"].setText("[ .]/[ ]");
me["Simple_R6"].hide();
me["Simple_R6_Arrow"].hide();
} }
me["Simple_L1"].setText(" " ~ vor1.getValue()); me["Simple_L1"].setText(" " ~ fmgc.FMGCInternal.VOR1.mcdu);
me["Simple_L2"].setText(sprintf("%3.0f", vor1CRS.getValue())); me["Simple_L2"].setText(sprintf("%03.0f", pts.Instrumentation.Nav.Radials.selectedDeg[2].getValue()));
me["Simple_L3"].setText(" " ~ ils1.getValue()); me["Simple_L3"].setText(" " ~ fmgc.FMGCInternal.ILS.mcdu);
me["Simple_L4"].setText(sprintf("%3.0f", ils1CRS.getValue())); me["Simple_L4"].setText(sprintf("%03.0f", pts.Instrumentation.Nav.Radials.selectedDeg[0].getValue()));
me["Simple_L1S"].setText("VOR1/FREQ"); me["Simple_L1S"].setText("VOR1/FREQ");
me["Simple_L2S"].setText("CRS"); me["Simple_L2S"].setText("CRS");
me["Simple_L3S"].setText("ILS /FREQ"); me["Simple_L3S"].setText("ILS /FREQ");
me["Simple_L4S"].setText("CRS"); me["Simple_L4S"].setText("CRS");
me["Simple_L5S"].setText("ADF1/FREQ"); me["Simple_L5S"].setText("ADF1/FREQ");
me["Simple_R1"].setText(" " ~ vor2.getValue()); me["Simple_R1"].setText(" " ~ fmgc.FMGCInternal.VOR2.mcdu);
me["Simple_R2"].setText(sprintf("%3.0f", vor2CRS.getValue())); me["Simple_R2"].setText(sprintf("%03.0f", pts.Instrumentation.Nav.Radials.selectedDeg[3].getValue()));
me["Simple_R3"].setText("[ ]/[ ]");
me["Simple_R4"].setText("-.- [ ]");
me["Simple_R1S"].setText("FREQ/VOR2"); me["Simple_R1S"].setText("FREQ/VOR2");
me["Simple_R2S"].setText("CRS"); me["Simple_R2S"].setText("CRS");
me["Simple_R3S"].setText("CHAN/ MLS");
me["Simple_R4S"].setText("SLOPE CRS");
me["Simple_R5S"].setText("FREQ/ADF2"); me["Simple_R5S"].setText("FREQ/ADF2");
if (getprop("systems/radio/rmp[0]/nav") or getprop("systems/radio/rmp[1]/nav")) { if (rmp.rmpNav[0].getValue() or rmp.rmpNav[1].getValue()) {
me["Simple_L1"].hide(); me["Simple_L1"].hide();
me["Simple_L2"].hide(); me["Simple_L2"].hide();
me["Simple_L3"].hide(); me["Simple_L3"].hide();
@ -2681,8 +2684,6 @@ var canvas_MCDU_base = {
me["Simple_L5"].hide(); me["Simple_L5"].hide();
me["Simple_R1"].hide(); me["Simple_R1"].hide();
me["Simple_R2"].hide(); me["Simple_R2"].hide();
me["Simple_R3"].hide();
me["Simple_R4"].hide();
me["Simple_R5"].hide(); me["Simple_R5"].hide();
} else { } else {
me["Simple_L1"].show(); me["Simple_L1"].show();
@ -2692,8 +2693,6 @@ var canvas_MCDU_base = {
me["Simple_L5"].show(); me["Simple_L5"].show();
me["Simple_R1"].show(); me["Simple_R1"].show();
me["Simple_R2"].show(); me["Simple_R2"].show();
me["Simple_R3"].show();
me["Simple_R4"].show();
me["Simple_R5"].show(); me["Simple_R5"].show();
} }
} else if (page == "INITA") { } else if (page == "INITA") {

View file

@ -212,7 +212,8 @@ canvas.NavDisplay.newMFD = func(canvas_group, parent=nil, nd_options=nil, update
# because things are much better configurable that way # because things are much better configurable that way
# now look up all required SVG elements and initialize member fields using the same name to have a convenient handle # now look up all required SVG elements and initialize member fields using the same name to have a convenient handle
foreach(var element; ["dmeL","dmeR","vorL","vorR","vorLId","vorRId", foreach(var element; ["dmeL","dmeR","vorL","vorR","vorLId","vorRId",
"status.wxr","status.wpt","status.sta","status.arpt","terrHI","terrLO","TerrLabel","terrAhead","terrAltGroup"]) "status.wxr","status.wpt","status.sta","status.arpt","terrHI","terrLO","TerrLabel","terrAhead","terrAltGroup",
"vorLIdtuneMode","vorRIdtuneMode"])
me.symbols[element] = me.nd.getElementById(element); me.symbols[element] = me.nd.getElementById(element);
foreach(var element; ["dmeLDist","dmeRDist"]) foreach(var element; ["dmeLDist","dmeRDist"])
@ -572,7 +573,31 @@ canvas.NavDisplay.update = func() # FIXME: This stuff is still too aircraft spec
var dme1_path = "/instrumentation/dme[2]"; var dme1_path = "/instrumentation/dme[2]";
var dme2_path = "/instrumentation/dme[3]"; var dme2_path = "/instrumentation/dme[3]";
if(me.get_switch("toggle_lh_vor_adf") == 1) {
if (fmgc.FMGCInternal.VOR1.freqSet) {
me.symbols.vorLIdtuneMode.show();
} else {
me.symbols.vorLIdtuneMode.hide();
}
} else if(me.get_switch("toggle_lh_vor_adf") == -1) {
if (fmgc.FMGCInternal.ADF1.freqSet) {
me.symbols.vorLIdtuneMode.show();
} else {
me.symbols.vorLIdtuneMode.hide();
}
} else {
me.symbols.vorLIdtuneMode.hide();
}
if(me.get_switch("toggle_rh_vor_adf") == 1) { if(me.get_switch("toggle_rh_vor_adf") == 1) {
if (fmgc.FMGCInternal.VOR2.freqSet) {
me.symbols.vorRIdtuneMode.show();
} else {
me.symbols.vorRIdtuneMode.hide();
}
me.symbols.vorR.setText("VOR R"); me.symbols.vorR.setText("VOR R");
me.symbols.vorR.setColor(0.195,0.96,0.097); me.symbols.vorR.setColor(0.195,0.96,0.097);
me.symbols.dmeR.setText("DME"); me.symbols.dmeR.setText("DME");
@ -587,17 +612,25 @@ canvas.NavDisplay.update = func() # FIXME: This stuff is still too aircraft spec
else me.symbols.dmeRDist.setText(" ---"); else me.symbols.dmeRDist.setText(" ---");
me.symbols.dmeRDist.setColor(0.195,0.96,0.097); me.symbols.dmeRDist.setColor(0.195,0.96,0.097);
} elsif(me.get_switch("toggle_rh_vor_adf") == -1) { } elsif(me.get_switch("toggle_rh_vor_adf") == -1) {
if (fmgc.FMGCInternal.ADF2.freqSet) {
me.symbols.vorRIdtuneMode.show();
} else {
me.symbols.vorRIdtuneMode.hide();
}
me.symbols.vorR.setText("ADF R"); me.symbols.vorR.setText("ADF R");
me.symbols.vorR.setColor(0,0.6,0.85); me.symbols.vorR.setColor(0,0.6,0.85);
me.symbols.dmeR.setText(""); me.symbols.dmeR.setText("");
me.symbols.dmeR.setColor(0,0.6,0.85); me.symbols.dmeR.setColor(0,0.6,0.85);
if((var navident=getprop("/instrumentation/adf[1]/ident")) != "") if((var navident=getprop("/instrumentation/adf[1]/ident")) != "")
me.symbols.vorRId.setText(navident); me.symbols.vorRId.setText(navident);
else me.symbols.vorRId.setText(sprintf("%3d",getprop("/instrumentation/adf[1]/frequencies/selected-khz"))); else me.symbols.vorRId.setText(sprintf("%3d",pts.Instrumentation.Adf.Frequencies.selectedKhz[1].getValue()));
me.symbols.vorRId.setColor(0,0.6,0.85); me.symbols.vorRId.setColor(0,0.6,0.85);
me.symbols.dmeRDist.setText(""); me.symbols.dmeRDist.setText("");
me.symbols.dmeRDist.setColor(0,0.6,0.85); me.symbols.dmeRDist.setColor(0,0.6,0.85);
} else { } else {
me.symbols.vorRIdtuneMode.hide();
me.symbols.vorR.setText(""); me.symbols.vorR.setText("");
me.symbols.dmeR.setText(""); me.symbols.dmeR.setText("");
me.symbols.vorRId.setText(""); me.symbols.vorRId.setText("");

View file

@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg <svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
sodipodi:docname="airbusND.svg" sodipodi:docname="airbusND.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)" inkscape:version="1.1 (c68e22c387, 2021-05-23)"
xml:space="preserve" xml:space="preserve"
id="svg5180" id="svg5180"
height="1024" height="1024"
width="1024" width="1024"
version="1.1"><sodipodi:namedview version="1.1"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"><sodipodi:namedview
pagecolor="#000000" pagecolor="#000000"
bordercolor="#666666" bordercolor="#666666"
borderopacity="1" borderopacity="1"
@ -22,17 +22,17 @@
guidetolerance="10" guidetolerance="10"
inkscape:pageopacity="1" inkscape:pageopacity="1"
inkscape:pageshadow="2" inkscape:pageshadow="2"
inkscape:window-width="1366" inkscape:window-width="1920"
inkscape:window-height="705" inkscape:window-height="986"
id="namedview102" id="namedview102"
showgrid="false" showgrid="false"
inkscape:zoom="1.5540552" inkscape:zoom="4.3955319"
inkscape:cx="474.64782" inkscape:cx="75.872501"
inkscape:cy="152.79363" inkscape:cy="938.90799"
inkscape:window-x="-8" inkscape:window-x="-11"
inkscape:window-y="-8" inkscape:window-y="-11"
inkscape:window-maximized="1" inkscape:window-maximized="1"
inkscape:current-layer="g415" inkscape:current-layer="layer3"
inkscape:object-nodes="true" inkscape:object-nodes="true"
inkscape:snap-smooth-nodes="true" inkscape:snap-smooth-nodes="true"
inkscape:snap-object-midpoints="true" inkscape:snap-object-midpoints="true"
@ -1076,14 +1076,14 @@
</g><text </g><text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
x="39.859375" x="41.859375"
y="919.5495" y="919.5495"
id="vorL" id="vorL"
inkscape:label="#text7243"><tspan inkscape:label="#text7243"><tspan
style="font-size:32px;line-height:1.25;fill:#0dc04b;fill-opacity:1" style="font-size:32px;line-height:1.25;fill:#0dc04b;fill-opacity:1"
sodipodi:role="line" sodipodi:role="line"
id="tspan3056" id="tspan3056"
x="39.859375" x="41.859375"
y="919.5495">VOR1</tspan></text> y="919.5495">VOR1</tspan></text>
<text <text
@ -1102,16 +1102,38 @@
<text <text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
x="39.9375" x="126.51562"
y="956.56171" y="956.56171"
id="vorLId" id="vorLId"
inkscape:label="#text7243"><tspan inkscape:label="#text7243"><tspan
style="font-size:32px;line-height:1.25;fill:#0dc04b" style="font-size:32px;line-height:1.25;text-align:end;text-anchor:end;fill:#0dc04b"
sodipodi:role="line" sodipodi:role="line"
id="tspan3072" id="tspan3072"
x="39.9375" x="126.51562"
y="956.56171">ABC</tspan></text> y="956.56171">ABC</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:24px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
x="134.0838"
y="956.56171"
id="vorLIdtuneMode"
inkscape:label="#text7243"><tspan
style="font-size:24px;line-height:1.25;fill:#0dc04b;fill-opacity:0.6"
sodipodi:role="line"
id="tspan3072-6"
x="134.0838"
y="956.56171">M</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:24px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
x="856.42511"
y="955.98981"
id="vorRIdtuneMode"
inkscape:label="#text7243"><tspan
style="font-size:24px;line-height:1.25;fill:#0dc04b;fill-opacity:0.6"
sodipodi:role="line"
id="tspan3072-6-0"
x="856.42511"
y="955.98981">M</tspan></text>
<text <text
inkscape:label="#text7243" inkscape:label="#text7243"
@ -1196,7 +1218,7 @@
inkscape:connector-curvature="0" inkscape:connector-curvature="0"
id="trkline" id="trkline"
d="M 512,179.04645 V 777.94594" d="M 512,179.04645 V 777.94594"
style="fill:none;stroke:#66b266;stroke-width:5.12175989;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" style="fill:none;stroke:#66b266;stroke-width:5.12176;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:transform-center-y="-345.50518" inkscape:transform-center-y="-345.50518"
inkscape:label="#path6714" inkscape:label="#path6714"
inkscape:transform-center-x="-0.001953124" /><path inkscape:transform-center-x="-0.001953124" /><path
@ -2352,14 +2374,14 @@
id="g415" id="g415"
inkscape:label="ND_TCAS_MEMO" inkscape:label="ND_TCAS_MEMO"
style="display:inline"><rect style="display:inline"><rect
style="opacity:0.98999999;fill:none;stroke:#ffffff;stroke-width:3.15591002;stroke-miterlimit:4;stroke-dasharray:none" style="opacity:0.99;fill:none;stroke:#ffffff;stroke-width:3.15591;stroke-miterlimit:4;stroke-dasharray:none"
id="taOnlyBox" id="taOnlyBox"
width="563.05048" width="563.05048"
height="46.844471" height="46.844471"
x="230.3676" x="230.3676"
y="871.6969" /><text y="871.6969" /><text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:42.66669846px;line-height:0%;font-family:'Liberation Sans';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;fill:#ff6600;fill-opacity:1;stroke:none" style="font-style:normal;font-weight:normal;font-size:42.6667px;line-height:0%;font-family:'Liberation Sans';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;fill:#ff6600;fill-opacity:1;stroke:none"
x="511.39594" x="511.39594"
y="910.03772" y="910.03772"
id="taOnly" id="taOnly"
@ -2368,7 +2390,7 @@
id="taOnlyText" id="taOnlyText"
x="511.39594" x="511.39594"
y="910.03772" y="910.03772"
style="font-size:42.66669846px;line-height:1.25;fill:#ffffff">TA ONLY</tspan></text> style="font-size:42.6667px;line-height:1.25;fill:#ffffff">TA ONLY</tspan></text>
</g><g </g><g
inkscape:groupmode="layer" inkscape:groupmode="layer"
id="layer4" id="layer4"

Before

Width:  |  Height:  |  Size: 149 KiB

After

Width:  |  Height:  |  Size: 150 KiB

View file

@ -1386,9 +1386,9 @@ canvas.NDStyles["Airbus"] = {
is_true: func(nd) { is_true: func(nd) {
nd.symbols.vorCrsPtr.show(); nd.symbols.vorCrsPtr.show();
if (is_ils) { if (is_ils) {
nd.symbols.vorCrsPtr.setRotation((getprop("/instrumentation/nav[0]/radials/selected-deg")-nd.aircraft_source.get_hdg_mag())*D2R); nd.symbols.vorCrsPtr.setRotation((pts.Instrumentation.Nav.Radials.selectedDeg[0].getValue()-nd.aircraft_source.get_hdg_mag())*D2R);
} else { } else {
nd.symbols.vorCrsPtr.setRotation((getprop("/instrumentation/nav[2]/radials/selected-deg")-nd.aircraft_source.get_hdg_mag())*D2R); nd.symbols.vorCrsPtr.setRotation((pts.Instrumentation.Nav.Radials.selectedDeg[2].getValue()-nd.aircraft_source.get_hdg_mag())*D2R);
} }
}, },
@ -1406,9 +1406,10 @@ canvas.NDStyles["Airbus"] = {
var type = (is_ils ? "ils" : "vor"); var type = (is_ils ? "ils" : "vor");
var path = nd.get_nav_path(type, 0); var path = nd.get_nav_path(type, 0);
if (is_ils) { if (is_ils) {
nd.symbols.vorCrsPtr2.setRotation((getprop("/instrumentation/nav[0]/radials/selected-deg")-nd.aircraft_source.get_hdg_mag())*D2R); nd.symbols.vorCrsPtr2.setRotation((pts.Instrumentation.Nav.Radials.selectedDeg[0].getValue()-nd.aircraft_source.get_hdg_mag())*D2R);
} else { } else {
nd.symbols.vorCrsPtr2.setRotation((getprop("/instrumentation/nav[2]/radials/selected-deg")-nd.aircraft_source.get_hdg_mag())*D2R); # TODO - 3?
nd.symbols.vorCrsPtr2.setRotation((pts.Instrumentation.Nav.Radials.selectedDeg[2].getValue()-nd.aircraft_source.get_hdg_mag())*D2R);
} }
var line = nd.symbols.vorCrsPtr2.getElementById("vorCrsPtr2_line"); var line = nd.symbols.vorCrsPtr2.getElementById("vorCrsPtr2_line");
if(!is_ils){ if(!is_ils){
@ -1498,9 +1499,7 @@ canvas.NDStyles["Airbus"] = {
}, },
is_true: func(nd) { is_true: func(nd) {
nd.symbols.locTrkPointer.show(); nd.symbols.locTrkPointer.show();
var crs = getprop("/instrumentation/nav/radials/selected-deg"); nd.symbols.locTrkPointer.setRotation( (pts.Instrumentation.Nav.Radials.selectedDeg[0].getValue() - nd.aircraft_source.get_hdg_tru()) * D2R);
var rotation = (crs - nd.aircraft_source.get_hdg_tru())*D2R;
nd.symbols.locTrkPointer.setRotation(rotation);
}, },
is_false: func(nd) nd.symbols.locTrkPointer.hide(), is_false: func(nd) nd.symbols.locTrkPointer.hide(),
}, },
@ -1718,10 +1717,11 @@ canvas.NDStyles["Airbus"] = {
var adf = "instrumentation/adf/"; var adf = "instrumentation/adf/";
var navident = getprop(adf~ "ident"); var navident = getprop(adf~ "ident");
var frq = getprop(adf~ "frequencies/selected-khz"); var frq = getprop(adf~ "frequencies/selected-khz");
if(navident != "") if(navident != "") {
nd.symbols.vorLId.setText(navident); nd.symbols.vorLId.setText(navident);
else } else {
nd.symbols.vorLId.setText(sprintf("%3d", frq)); nd.symbols.vorLId.setText(sprintf("%3d", frq));
}
nd.symbols.dmeLDist.setText(""); nd.symbols.dmeLDist.setText("");
} else { } else {
var nav = nd.get_nav_path("vor", 0); var nav = nd.get_nav_path("vor", 0);
@ -1730,10 +1730,11 @@ canvas.NDStyles["Airbus"] = {
var dme = nd.get_nav_path("dme", 0); var dme = nd.get_nav_path("dme", 0);
var dst = getprop(dme~ "indicated-distance-nm"); var dst = getprop(dme~ "indicated-distance-nm");
#print(dme~ "indicated-distance-nm"); #print(dme~ "indicated-distance-nm");
if(getprop(nav~ "in-range")) if(getprop(nav~ "in-range")) {
nd.symbols.vorLId.setText(navID); nd.symbols.vorLId.setText(navID);
else } else {
nd.symbols.vorLId.setText(frq); nd.symbols.vorLId.setText(frq);
}
if(getprop(dme~ "in-range")) if(getprop(dme~ "in-range"))
nd.symbols.dmeLDist.setText(sprintf("%3.1f", nd.symbols.dmeLDist.setText(sprintf("%3.1f",
dst)); dst));
@ -1775,10 +1776,11 @@ canvas.NDStyles["Airbus"] = {
var adf = "instrumentation/adf[1]/"; var adf = "instrumentation/adf[1]/";
var navident = getprop(adf~ "ident"); var navident = getprop(adf~ "ident");
var frq = getprop(adf~ "frequencies/selected-khz"); var frq = getprop(adf~ "frequencies/selected-khz");
if(navident != "") if(navident != "") {
nd.symbols.vorRId.setText(navident); nd.symbols.vorRId.setText(navident);
else } else {
nd.symbols.vorRId.setText(sprintf("%3d", frq)); nd.symbols.vorRId.setText(sprintf("%3d", frq));
}
nd.symbols.dmeRDist.setText(""); nd.symbols.dmeRDist.setText("");
} else { } else {
var nav = nd.get_nav_path("vor", 1); var nav = nd.get_nav_path("vor", 1);
@ -1787,10 +1789,11 @@ canvas.NDStyles["Airbus"] = {
var dme = nd.get_nav_path("dme", 1); var dme = nd.get_nav_path("dme", 1);
var dst = getprop(dme~ "indicated-distance-nm"); var dst = getprop(dme~ "indicated-distance-nm");
#print(dme~ "indicated-distance-nm"); #print(dme~ "indicated-distance-nm");
if(getprop(nav~ "in-range")) if(getprop(nav~ "in-range")) {
nd.symbols.vorRId.setText(navID); nd.symbols.vorRId.setText(navID);
else } else {
nd.symbols.vorRId.setText(frq); nd.symbols.vorRId.setText(frq);
}
if(getprop(dme~ "in-range")) if(getprop(dme~ "in-range"))
nd.symbols.dmeRDist.setText(sprintf("%3.1f", nd.symbols.dmeRDist.setText(sprintf("%3.1f",
dst)); dst));

View file

@ -522,42 +522,6 @@ var canvas_pfd = {
obj["GS_scale"].hide(); obj["GS_scale"].hide();
} }
}), }),
props.UpdateManager.FromHashList(["pfdILS1","pfdILS2","dmeInRange","dmeDistance","pfdILSMcdu"], nil, func(val) {
if ((obj.number == 0 and val.pfdILS1) or (obj.number == 1 and val.pfdILS2)) {
obj.split_ils = split("/", val.pfdILSMcdu);
if (size(obj.split_ils) < 2) {
obj["ils_freq"].setText(obj.split_ils[0]);
obj["ils_freq"].show();
obj["ils_code"].hide();
obj["dme_dist"].hide();
obj["dme_dist_legend"].hide();
} else {
obj["ils_code"].setText(obj.split_ils[0]);
obj["ils_freq"].setText(obj.split_ils[1]);
obj["ils_code"].show();
obj["ils_freq"].show();
if (val.dmeInRange) {
obj["dme_dist"].show();
obj["dme_dist_legend"].show();
if (val.dmeDistance < 20.0) {
obj["dme_dist"].setText(sprintf("%1.1f", val.dmeDistance));
} else {
obj["dme_dist"].setText(sprintf("%2.0f", val.dmeDistance));
}
} else {
obj["dme_dist"].hide();
obj["dme_dist_legend"].hide();
}
}
} else {
obj["ils_code"].hide();
obj["ils_freq"].hide();
obj["dme_dist"].hide();
obj["dme_dist_legend"].hide();
}
}),
props.UpdateManager.FromHashList(["hasLocalizer","hasGlideslope","signalQuality","localizerInRange","glideslopeInRange","pfdILS1","pfdILS2"], nil, func(val) { props.UpdateManager.FromHashList(["hasLocalizer","hasGlideslope","signalQuality","localizerInRange","glideslopeInRange","pfdILS1","pfdILS2"], nil, func(val) {
if (((obj.number == 0 and val.pfdILS1) or (obj.number == 1 and val.pfdILS2)) and val.localizerInRange and val.hasLocalizer and val.signalQuality > 0.99) { if (((obj.number == 0 and val.pfdILS1) or (obj.number == 1 and val.pfdILS2)) and val.localizerInRange and val.hasLocalizer and val.signalQuality > 0.99) {
obj["LOC_pointer"].show(); obj["LOC_pointer"].show();
@ -747,50 +711,6 @@ var canvas_pfd = {
obj["HDG_target"].hide(); obj["HDG_target"].hide();
} }
}), }),
props.UpdateManager.FromHashList(["pfdILSMcdu","headingPFD","pfdILS1","pfdILS2","ilsCrs"], nil, func(val) {
obj.split_ils = split("/", val.pfdILSMcdu);
if (((obj.number == 0 and val.pfdILS1) or (obj.number == 1 and val.pfdILS2)) and size(obj.split_ils) == 2) {
obj.magnetic_hdg = val.ilsCrs;
obj.magnetic_hdg_dif = geo.normdeg180(obj.magnetic_hdg - val.headingPFD);
if (obj.magnetic_hdg_dif >= -23.62 and obj.magnetic_hdg_dif <= 23.62) {
obj["CRS_pointer"].setTranslation((obj.magnetic_hdg_dif / 10) * 98.5416, 0);
obj["ILS_HDG_R"].hide();
obj["ILS_HDG_L"].hide();
obj["CRS_pointer"].show();
} else if (obj.magnetic_hdg_dif < -23.62 and obj.magnetic_hdg_dif >= -180) {
if (int(obj.magnetic_hdg) < 10) {
obj["ILS_left"].setText(sprintf("00%1.0f", int(obj.magnetic_hdg)));
} else if (int(obj.magnetic_hdg) < 100) {
obj["ILS_left"].setText(sprintf("0%2.0f", int(obj.magnetic_hdg)));
} else {
obj["ILS_left"].setText(sprintf("%3.0f", int(obj.magnetic_hdg)));
}
obj["ILS_HDG_L"].show();
obj["ILS_HDG_R"].hide();
obj["CRS_pointer"].hide();
} else if (obj.magnetic_hdg_dif > 23.62 and obj.magnetic_hdg_dif <= 180) {
if (int(obj.magnetic_hdg) < 10) {
obj["ILS_right"].setText(sprintf("00%1.0f", int(obj.magnetic_hdg)));
} else if (int(obj.magnetic_hdg) < 100) {
obj["ILS_right"].setText(sprintf("0%2.0f", int(obj.magnetic_hdg)));
} else {
obj["ILS_right"].setText(sprintf("%3.0f", int(obj.magnetic_hdg)));
}
obj["ILS_HDG_R"].show();
obj["ILS_HDG_L"].hide();
obj["CRS_pointer"].hide();
} else {
obj["ILS_HDG_R"].hide();
obj["ILS_HDG_L"].hide();
obj["CRS_pointer"].hide();
}
} else {
obj["ILS_HDG_R"].hide();
obj["ILS_HDG_L"].hide();
obj["CRS_pointer"].hide();
}
}),
props.UpdateManager.FromHashList(["altimeterHpa","altimeterInhg","altimeterInhgMode"], nil, func(val) { props.UpdateManager.FromHashList(["altimeterHpa","altimeterInhg","altimeterInhgMode"], nil, func(val) {
if (val.altimeterInhgMode == 0) { if (val.altimeterInhgMode == 0) {
obj["QNH_setting"].setText(sprintf("%4.0f", val.altimeterHpa)); obj["QNH_setting"].setText(sprintf("%4.0f", val.altimeterHpa));
@ -1746,6 +1666,82 @@ var canvas_pfd = {
} }
} }
me.split_ils = split("/", fmgc.FMGCInternal.ILS.mcdu);
if ((me.number == 0 and notification.pfdILS1) or (me.number == 1 and notification.pfdILS2)) {
if (size(me.split_ils) < 2) {
me["ils_freq"].setText(me.split_ils[0]);
me["ils_freq"].show();
me["ils_code"].hide();
me["dme_dist"].hide();
me["dme_dist_legend"].hide();
} else {
me["ils_code"].setText(me.split_ils[0]);
me["ils_freq"].setText(me.split_ils[1]);
me["ils_code"].show();
me["ils_freq"].show();
if (notification.dmeInRange) {
me["dme_dist"].show();
me["dme_dist_legend"].show();
if (notification.dmeDistance < 20.0) {
me["dme_dist"].setText(sprintf("%1.1f", notification.dmeDistance));
} else {
me["dme_dist"].setText(sprintf("%2.0f", notification.dmeDistance));
}
} else {
me["dme_dist"].hide();
me["dme_dist_legend"].hide();
}
}
} else {
me["ils_code"].hide();
me["ils_freq"].hide();
me["dme_dist"].hide();
me["dme_dist_legend"].hide();
}
if (((me.number == 0 and notification.pfdILS1) or (me.number == 1 and notification.pfdILS2)) and size(me.split_ils) == 2) {
me.magnetic_hdg = notification.ilsCrs;
me.magnetic_hdg_dif = geo.normdeg180(me.magnetic_hdg - notification.headingPFD);
if (me.magnetic_hdg_dif >= -23.62 and me.magnetic_hdg_dif <= 23.62) {
me["CRS_pointer"].setTranslation((me.magnetic_hdg_dif / 10) * 98.5416, 0);
me["ILS_HDG_R"].hide();
me["ILS_HDG_L"].hide();
me["CRS_pointer"].show();
} else if (me.magnetic_hdg_dif < -23.62 and me.magnetic_hdg_dif >= -180) {
if (int(me.magnetic_hdg) < 10) {
me["ILS_left"].setText(sprintf("00%1.0f", int(me.magnetic_hdg)));
} else if (int(me.magnetic_hdg) < 100) {
me["ILS_left"].setText(sprintf("0%2.0f", int(me.magnetic_hdg)));
} else {
me["ILS_left"].setText(sprintf("%3.0f", int(me.magnetic_hdg)));
}
me["ILS_HDG_L"].show();
me["ILS_HDG_R"].hide();
me["CRS_pointer"].hide();
} else if (me.magnetic_hdg_dif > 23.62 and me.magnetic_hdg_dif <= 180) {
if (int(me.magnetic_hdg) < 10) {
me["ILS_right"].setText(sprintf("00%1.0f", int(me.magnetic_hdg)));
} else if (int(me.magnetic_hdg) < 100) {
me["ILS_right"].setText(sprintf("0%2.0f", int(me.magnetic_hdg)));
} else {
me["ILS_right"].setText(sprintf("%3.0f", int(me.magnetic_hdg)));
}
me["ILS_HDG_R"].show();
me["ILS_HDG_L"].hide();
me["CRS_pointer"].hide();
} else {
me["ILS_HDG_R"].hide();
me["ILS_HDG_L"].hide();
me["CRS_pointer"].hide();
}
} else {
me["ILS_HDG_R"].hide();
me["ILS_HDG_L"].hide();
me["CRS_pointer"].hide();
}
foreach(var update_item; me.update_items) foreach(var update_item; me.update_items)
{ {
update_item.update(notification); update_item.update(notification);
@ -2005,7 +2001,6 @@ var input = {
pfdILS1: "/modes/pfd/ILS1", pfdILS1: "/modes/pfd/ILS1",
pfdILS2: "/modes/pfd/ILS2", pfdILS2: "/modes/pfd/ILS2",
pfdILSMcdu: "/FMGC/internal/ils1-mcdu",
markerO: "/instrumentation/marker-beacon/outer", markerO: "/instrumentation/marker-beacon/outer",
markerM: "/instrumentation/marker-beacon/middle", markerM: "/instrumentation/marker-beacon/middle",

View file

@ -32,24 +32,6 @@ var alt = 0;
var altitude = 0; var altitude = 0;
var flap = 0; var flap = 0;
var flaps = 0; var flaps = 0;
var freqnav0uf = 0;
var freqnav0 = 0;
var namenav0 = "XX";
var freqnav1uf = 0;
var freqnav1 = 0;
var namenav1 = "XX";
var freqnav2uf = 0;
var freqnav2 = 0;
var namenav2 = "XX";
var freqnav3uf = 0;
var freqnav3 = 0;
var namenav3 = "XX";
var freqadf0uf = 0;
var freqadf0 = 0;
var nameadf0 = "XX";
var freqadf1uf = 0;
var freqadf1 = 0;
var nameadf1 = "XX";
var ias = 0; var ias = 0;
var mach = 0; var mach = 0;
var ktsmach = 0; var ktsmach = 0;
@ -66,18 +48,12 @@ var windSpeed = 0;
var windsDidChange = 0; var windsDidChange = 0;
var tempOverspeed = nil; var tempOverspeed = nil;
setprop("position/gear-agl-ft", 0); setprop("/position/gear-agl-ft", 0);
setprop("/it-autoflight/settings/accel-agl-ft", 1500); #eventually set to 1500 above runway setprop("/it-autoflight/settings/accel-agl-ft", 1500); #eventually set to 1500 above runway
setprop("/it-autoflight/internal/vert-speed-fpm", 0); setprop("/it-autoflight/internal/vert-speed-fpm", 0);
setprop("/it-autoflight/output/fma-pwr", 0); setprop("/it-autoflight/output/fma-pwr", 0);
setprop("/instrumentation/nav[0]/nav-id", "XXX"); setprop("/instrumentation/nav[0]/nav-id", "XXX");
setprop("/instrumentation/nav[1]/nav-id", "XXX"); setprop("/instrumentation/nav[1]/nav-id", "XXX");
setprop("/FMGC/internal/ils1-mcdu", "XXX/999.99");
setprop("/FMGC/internal/ils2-mcdu", "XXX/999.99");
setprop("/FMGC/internal/vor1-mcdu", "XXX/999.99");
setprop("/FMGC/internal/vor2-mcdu", "999.99/XXX");
setprop("/FMGC/internal/adf1-mcdu", "XXX/999.99");
setprop("/FMGC/internal/adf2-mcdu", "999.99/XXX");
var FMGCAlignDone = [props.globals.initNode("/FMGC/internal/align1-done", 0, "BOOL"), props.globals.initNode("/FMGC/internal/align2-done", 0, "BOOL"), props.globals.initNode("/FMGC/internal/align3-done", 0, "BOOL")]; var FMGCAlignDone = [props.globals.initNode("/FMGC/internal/align1-done", 0, "BOOL"), props.globals.initNode("/FMGC/internal/align2-done", 0, "BOOL"), props.globals.initNode("/FMGC/internal/align3-done", 0, "BOOL")];
var FMGCAlignTime = [props.globals.initNode("/FMGC/internal/align1-time", 0, "DOUBLE"), props.globals.initNode("/FMGC/internal/align2-time", 0, "DOUBLE"), props.globals.initNode("/FMGC/internal/align3-time", 0, "DOUBLE")]; var FMGCAlignTime = [props.globals.initNode("/FMGC/internal/align1-time", 0, "DOUBLE"), props.globals.initNode("/FMGC/internal/align2-time", 0, "DOUBLE"), props.globals.initNode("/FMGC/internal/align3-time", 0, "DOUBLE")];
@ -245,6 +221,32 @@ var FMGCInternal = {
mngKtsMach: 0, mngKtsMach: 0,
mngSpd: 0, mngSpd: 0,
mngSpdCmd: 0, mngSpdCmd: 0,
# RADNAV
ADF1: {
freqSet: 0,
mcdu: "XXX/999.99"
},
ADF2: {
freqSet: 0,
mcdu: "999.99/XXX"
},
ILS: {
crsSet: 0,
freqCalculated: 0,
freqSet: 0,
mcdu: "XXX/999.99"
},
VOR1: {
crsSet: 0,
freqSet: 0,
mcdu: "XXX/999.99"
},
VOR2: {
crsSet: 0,
freqSet: 0,
mcdu: "999.99/XXX"
},
}; };
var postInit = func() { var postInit = func() {
@ -523,88 +525,54 @@ var updateFuel = func {
############################ ############################
# Flight Phase and Various # # Flight Phase and Various #
############################ ############################
# TODO - if no ID is found, should trigger a NOT IN DATA BASE message
var freqnav0 = nil;
var nav0 = func { var nav0 = func {
var freqnav0uf = getprop("/instrumentation/nav[0]/frequencies/selected-mhz"); freqnav0 = sprintf("%.2f", pts.Instrumentation.Nav.Frequencies.selectedMhz[0].getValue());
var freqnav0 = sprintf("%.2f", freqnav0uf);
var namenav0 = getprop("/instrumentation/nav[0]/nav-id") or "";
if (freqnav0 >= 108.10 and freqnav0 <= 111.95) { if (freqnav0 >= 108.10 and freqnav0 <= 111.95) {
if (namenav0 != "") { var namenav0 = getprop("/instrumentation/nav[0]/nav-id") or " ";
setprop("/FMGC/internal/ils1-mcdu", namenav0 ~ "/" ~ freqnav0); fmgc.FMGCInternal.ILS.mcdu = namenav0 ~ "/" ~ freqnav0;
} else {
setprop("/FMGC/internal/ils1-mcdu", freqnav0);
}
}
}
var nav1 = func {
var freqnav1uf = getprop("/instrumentation/nav[1]/frequencies/selected-mhz");
var freqnav1 = sprintf("%.2f", freqnav1uf);
var namenav1 = getprop("/instrumentation/nav[1]/nav-id") or "";
if (freqnav1 >= 108.10 and freqnav1 <= 111.95) {
if (namenav1 != "") {
setprop("/FMGC/internal/ils2-mcdu", freqnav1 ~ "/" ~ namenav1);
} else {
setprop("/FMGC/internal/ils2-mcdu", freqnav1);
}
} }
} }
var freqnav2 = nil;
var nav2 = func { var nav2 = func {
var freqnav2uf = getprop("/instrumentation/nav[2]/frequencies/selected-mhz"); freqnav2 = sprintf("%.2f", pts.Instrumentation.Nav.Frequencies.selectedMhz[2].getValue());
var freqnav2 = sprintf("%.2f", freqnav2uf);
var namenav2 = getprop("/instrumentation/nav[2]/nav-id") or "";
if (freqnav2 >= 108.00 and freqnav2 <= 117.95) { if (freqnav2 >= 108.00 and freqnav2 <= 117.95) {
if (namenav2 != "") { var namenav2 = getprop("/instrumentation/nav[2]/nav-id") or " ";
setprop("/FMGC/internal/vor1-mcdu", namenav2 ~ "/" ~ freqnav2); fmgc.FMGCInternal.VOR1.mcdu = namenav2 ~ "/" ~ freqnav2;
} else {
setprop("/FMGC/internal/vor1-mcdu", freqnav2);
}
} }
} }
var freqnav3 = nil;
var nav3 = func { var nav3 = func {
var freqnav3uf = getprop("/instrumentation/nav[3]/frequencies/selected-mhz"); freqnav3 = sprintf("%.2f", pts.Instrumentation.Nav.Frequencies.selectedMhz[3].getValue());
var freqnav3 = sprintf("%.2f", freqnav3uf);
var namenav3 = getprop("/instrumentation/nav[3]/nav-id") or "";
if (freqnav3 >= 108.00 and freqnav3 <= 117.95) { if (freqnav3 >= 108.00 and freqnav3 <= 117.95) {
if (namenav3 != "") { var namenav3 = getprop("/instrumentation/nav[3]/nav-id") or " ";
setprop("/FMGC/internal/vor2-mcdu", freqnav3 ~ "/" ~ namenav3); fmgc.FMGCInternal.VOR2.mcdu = freqnav3 ~ "/" ~ namenav3;
} else {
setprop("/FMGC/internal/vor2-mcdu", freqnav3);
}
} }
} }
var freqadf0 = nil;
var adf0 = func { var adf0 = func {
var freqadf0uf = getprop("/instrumentation/adf[0]/frequencies/selected-khz"); freqadf0 = sprintf("%.1f", pts.Instrumentation.Adf.Frequencies.selectedKhz[0].getValue());
var freqadf0 = sprintf("%.2f", freqadf0uf); if (freqadf0 >= 190 and freqadf0 <= 1799) {
var nameadf0 = getprop("/instrumentation/adf[0]/ident") or ""; var nameadf0 = pts.Instrumentation.Adf.ident[0].getValue() or " ";
if (freqadf0 >= 190 and freqadf0 <= 1750) { fmgc.FMGCInternal.ADF1.mcdu = nameadf0 ~ "/" ~ freqadf0;
if (nameadf0 != "") {
setprop("/FMGC/internal/adf1-mcdu", nameadf0 ~ "/" ~ freqadf0);
} else {
setprop("/FMGC/internal/adf1-mcdu", freqadf0);
}
} }
} }
var freqadf1 = nil;
var adf1 = func { var adf1 = func {
var freqadf1uf = getprop("/instrumentation/adf[1]/frequencies/selected-khz"); freqadf1 = sprintf("%.1f", pts.Instrumentation.Adf.Frequencies.selectedKhz[1].getValue());
var freqadf1 = sprintf("%.2f", freqadf1uf); if (freqadf1 >= 190 and freqadf1 <= 1799) {
var nameadf1 = getprop("/instrumentation/adf[1]/ident") or ""; var nameadf1 = pts.Instrumentation.Adf.ident[1].getValue() or " ";
if (freqadf1 >= 190 and freqadf1 <= 1750) { fmgc.FMGCInternal.ADF2.mcdu = freqadf1 ~ "/" ~ nameadf1;
if (nameadf1 != "") {
setprop("/FMGC/internal/adf2-mcdu", freqadf1 ~ "/" ~ nameadf1);
} else {
setprop("/FMGC/internal/adf2-mcdu", freqadf1);
}
} }
} }
var radios = maketimer(1, func() { var radios = maketimer(1, func() {
nav0(); nav0();
nav1();
nav2(); nav2();
nav3(); nav3();
adf0(); adf0();
@ -962,28 +930,28 @@ var updateAirportRadios = func {
setprop("/FMGC/internal/ldg-elev", airport.elevation * M2FT); # eventually should be runway elevation setprop("/FMGC/internal/ldg-elev", airport.elevation * M2FT); # eventually should be runway elevation
magnetic_hdg = geo.normdeg(destination_rwy.heading - getprop("/environment/magnetic-variation-deg")); magnetic_hdg = geo.normdeg(destination_rwy.heading - getprop("/environment/magnetic-variation-deg"));
runway_ils = destination_rwy.ils_frequency_mhz; runway_ils = destination_rwy.ils_frequency_mhz;
if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set") and !getprop("/FMGC/internal/ils1crs-set")) { if (runway_ils != nil and !fmgc.FMGCInternal.ILS.freqSet and !fmgc.FMGCInternal.ILS.crsSet) {
setprop("/FMGC/internal/ils1freq-calculated", runway_ils); fmgc.FMGCInternal.ILS.freqCalculated = runway_ils;
setprop("/instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); pts.Instrumentation.Nav.Frequencies.selectedMhz[0].setValue(runway_ils);
setprop("/instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); pts.Instrumentation.Nav.Radials.selectedDeg[0].setValue(magnetic_hdg);
} elsif (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set")) { } elsif (runway_ils != nil and !fmgc.FMGCInternal.ILS.freqSet) {
setprop("/FMGC/internal/ils1freq-calculated", runway_ils); fmgc.FMGCInternal.ILS.freqCalculated = runway_ils;
setprop("/instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); pts.Instrumentation.Nav.Frequencies.selectedMhz[0].setValue(runway_ils);
} elsif (!getprop("/FMGC/internal/ils1crs-set")) { } elsif (!fmgc.FMGCInternal.ILS.crsSet) {
setprop("/instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); pts.Instrumentation.Nav.Radials.selectedDeg[0].setValue(magnetic_hdg);
} }
} elsif (airportRadiosPhase <= 1 and departure_rwy != nil) { } elsif (airportRadiosPhase <= 1 and departure_rwy != nil) {
magnetic_hdg = geo.normdeg(departure_rwy.heading - getprop("/environment/magnetic-variation-deg")); magnetic_hdg = geo.normdeg(departure_rwy.heading - getprop("/environment/magnetic-variation-deg"));
runway_ils = departure_rwy.ils_frequency_mhz; runway_ils = departure_rwy.ils_frequency_mhz;
if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set") and !getprop("/FMGC/internal/ils1crs-set")) { if (runway_ils != nil and !fmgc.FMGCInternal.ILS.freqSet and !fmgc.FMGCInternal.ILS.crsSet) {
setprop("/FMGC/internal/ils1freq-calculated", runway_ils); fmgc.FMGCInternal.ILS.freqCalculated = runway_ils;
setprop("/instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); pts.Instrumentation.Nav.Frequencies.selectedMhz[0].setValue(runway_ils);
setprop("/instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); pts.Instrumentation.Nav.Radials.selectedDeg[0].setValue(magnetic_hdg);
} elsif (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set")) { } elsif (runway_ils != nil and !fmgc.FMGCInternal.ILS.freqSet) {
setprop("/FMGC/internal/ils1freq-calculated", runway_ils); fmgc.FMGCInternal.ILS.freqCalculated = runway_ils;
setprop("/instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); pts.Instrumentation.Nav.Frequencies.selectedMhz[0].setValue(runway_ils);
} elsif (!getprop("/FMGC/internal/ils1crs-set")) { } elsif (!fmgc.FMGCInternal.ILS.crsSet) {
setprop("/instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); pts.Instrumentation.Nav.Radials.selectedDeg[0].setValue(magnetic_hdg);
} }
} }
@ -1248,6 +1216,7 @@ setlistener("/FMGC/internal/fuel-calculating", func() {
var timer30secLanding = maketimer(1, func() { var timer30secLanding = maketimer(1, func() {
if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/landing-time") + 30) { if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/landing-time") + 30) {
FMGCInternal.phase = 7; FMGCInternal.phase = 7;
if (FMGCInternal.costIndexSet) { if (FMGCInternal.costIndexSet) {
setprop("/FMGC/internal/last-cost-index", FMGCInternal.costIndex); setprop("/FMGC/internal/last-cost-index", FMGCInternal.costIndex);
} else { } else {

View file

@ -154,6 +154,12 @@ var Gear = {
}; };
var Instrumentation = { var Instrumentation = {
Adf: {
ident: [props.globals.getNode("/instrumentation/adf[0]/ident"), props.globals.getNode("/instrumentation/adf[1]/ident")],
Frequencies: {
selectedKhz: [props.globals.getNode("/instrumentation/adf[0]/frequencies/selected-khz"), props.globals.getNode("/instrumentation/adf[1]/frequencies/selected-khz")],
},
},
AirspeedIndicator: { AirspeedIndicator: {
indicatedSpdKt: props.globals.getNode("/instrumentation/airspeed-indicator/indicated-speed-kt"), indicatedSpdKt: props.globals.getNode("/instrumentation/airspeed-indicator/indicated-speed-kt"),
indicatedMach: props.globals.getNode("/instrumentation/airspeed-indicator/indicated-mach"), indicatedMach: props.globals.getNode("/instrumentation/airspeed-indicator/indicated-mach"),
@ -205,6 +211,12 @@ var Instrumentation = {
}, },
}, },
Nav: { Nav: {
Frequencies: {
selectedMhz: [props.globals.getNode("/instrumentation/nav[0]/frequencies/selected-mhz"), props.globals.getNode("/instrumentation/nav[1]/frequencies/selected-mhz"), props.globals.getNode("/instrumentation/nav[2]/frequencies/selected-mhz"), props.globals.getNode("/instrumentation/nav[3]/frequencies/selected-mhz")],
},
Radials: {
selectedDeg: [props.globals.getNode("/instrumentation/nav[0]/radials/selected-deg"), props.globals.getNode("/instrumentation/nav[1]/radials/selected-deg"), props.globals.getNode("/instrumentation/nav[2]/radials/selected-deg"), props.globals.getNode("/instrumentation/nav[3]/radials/selected-deg")],
},
gsDeflection: props.globals.getNode("/instrumentation/nav[0]/gs-needle-deflection-norm"), gsDeflection: props.globals.getNode("/instrumentation/nav[0]/gs-needle-deflection-norm"),
locDeflection: props.globals.getNode("/instrumentation/nav[0]/heading-needle-deflection-norm"), locDeflection: props.globals.getNode("/instrumentation/nav[0]/heading-needle-deflection-norm"),
}, },

View file

@ -17,7 +17,7 @@ var dataInput = func(key, i) {
canvas_mcdu.myClosestAirport[i] = closestAirportPage.new(i); canvas_mcdu.myClosestAirport[i] = closestAirportPage.new(i);
setprop("MCDU[" ~ i ~ "]/page", "CLOSESTAIRPORT"); setprop("MCDU[" ~ i ~ "]/page", "CLOSESTAIRPORT");
} elsif (key == "R5") { } elsif (key == "R5") {
setprop("MCDU[" ~ i ~ "]/page", "PRINTFUNC"); mcdu_message(i, "PRINTER NOT AVAILABLE");
} }
} }

View file

@ -45,15 +45,15 @@ var MCDU_reset = func(i) {
setprop("/FMGC/print/mcdu/page2/R4req", 0); setprop("/FMGC/print/mcdu/page2/R4req", 0);
#RADNAV #RADNAV
setprop("/FMGC/internal/ils1freq-set", 0); fmgc.FMGCInternal.ILS.freqSet = 0;
setprop("/FMGC/internal/ils1crs-set", 0); fmgc.FMGCInternal.ILS.freqCalculated = 0;
setprop("/FMGC/internal/ils1freq-calculated", 0); fmgc.FMGCInternal.ILS.crsSet = 0;
setprop("/FMGC/internal/vor1freq-set", 0); fmgc.FMGCInternal.VOR1.freqSet = 0;
setprop("/FMGC/internal/vor1crs-set", 0); fmgc.FMGCInternal.VOR1.crsSet = 0;
setprop("/FMGC/internal/vor2freq-set", 0); fmgc.FMGCInternal.VOR2.freqSet = 0;
setprop("/FMGC/internal/vor2crs-set", 0); fmgc.FMGCInternal.VOR2.crsSet = 0;
setprop("/FMGC/internal/adf1freq-set", 0); fmgc.FMGCInternal.ADF1.freqSet = 0;
setprop("/FMGC/internal/adf2freq-set", 0); fmgc.FMGCInternal.ADF2.freqSet = 0;
# INT-A # INT-A
fmgc.FMGCInternal.altAirport = ""; fmgc.FMGCInternal.altAirport = "";
@ -256,10 +256,6 @@ var lskbutton = func(btn, i) {
radnavInput("L1",i); radnavInput("L1",i);
} else if (page == "DATA") { } else if (page == "DATA") {
dataInput("L1",i); dataInput("L1",i);
} else if (page == "PRINTFUNC") {
printInput("L1",i);
} else if (page == "PRINTFUNC2") {
printInput2("L1",i);
} else if (page == "LATREV") { } else if (page == "LATREV") {
if (canvas_mcdu.myLatRev[i].type == 0) { if (canvas_mcdu.myLatRev[i].type == 0) {
if (canvas_mcdu.myDeparture[i] != nil) { if (canvas_mcdu.myDeparture[i] != nil) {
@ -410,10 +406,6 @@ var lskbutton = func(btn, i) {
perfDESInput("L2",i); perfDESInput("L2",i);
} else if (page == "DATA") { } else if (page == "DATA") {
dataInput("L2",i); dataInput("L2",i);
} else if (page == "PRINTFUNC") {
printInput("L2",i);
} else if (page == "PRINTFUNC2") {
printInput2("L2",i);
} else if (page == "F-PLNA" or page == "F-PLNB") { } else if (page == "F-PLNA" or page == "F-PLNB") {
canvas_mcdu.myFpln[i].pushButtonLeft(2); canvas_mcdu.myFpln[i].pushButtonLeft(2);
} else if (page == "DEPARTURE") { } else if (page == "DEPARTURE") {
@ -537,10 +529,6 @@ var lskbutton = func(btn, i) {
radnavInput("L3",i); radnavInput("L3",i);
} else if (page == "DATA") { } else if (page == "DATA") {
dataInput("L3",i); dataInput("L3",i);
} else if (page == "PRINTFUNC") {
printInput("L3",i);
} else if (page == "PRINTFUNC2") {
printInput2("L3",i);
} else if (page == "F-PLNA" or page == "F-PLNB") { } else if (page == "F-PLNA" or page == "F-PLNB") {
canvas_mcdu.myFpln[i].pushButtonLeft(3); canvas_mcdu.myFpln[i].pushButtonLeft(3);
} else if (page == "DEPARTURE") { } else if (page == "DEPARTURE") {
@ -664,8 +652,6 @@ var lskbutton = func(btn, i) {
perfAPPRInput("L4",i); perfAPPRInput("L4",i);
} else if (page == "RADNAV") { } else if (page == "RADNAV") {
radnavInput("L4",i); radnavInput("L4",i);
} else if (page == "PRINTFUNC2") {
printInput2("L4",i);
} else if (page == "F-PLNA" or page == "F-PLNB") { } else if (page == "F-PLNA" or page == "F-PLNB") {
canvas_mcdu.myFpln[i].pushButtonLeft(4); canvas_mcdu.myFpln[i].pushButtonLeft(4);
} else if (page == "DEPARTURE") { } else if (page == "DEPARTURE") {
@ -784,10 +770,6 @@ var lskbutton = func(btn, i) {
perfGAInput("L5",i); perfGAInput("L5",i);
} else if (page == "RADNAV") { } else if (page == "RADNAV") {
radnavInput("L5",i); radnavInput("L5",i);
} else if (page == "PRINTFUNC") {
printInput("L5",i);
} else if (page == "PRINTFUNC2") {
printInput2("L5",i);
} else if (page == "DATA") { } else if (page == "DATA") {
dataInput("L5",i); dataInput("L5",i);
} else if (page == "DATA2") { } else if (page == "DATA2") {
@ -843,6 +825,8 @@ var lskbutton = func(btn, i) {
pageNode[i].setValue("WINDCLB"); pageNode[i].setValue("WINDCLB");
} else if (page == "ROUTESELECTION") { } else if (page == "ROUTESELECTION") {
initInputROUTESEL("L6",i); initInputROUTESEL("L6",i);
} else if (page == "RADNAV") {
radnavInput("L6",i);
} else if (page == "PERFCLB") { } else if (page == "PERFCLB") {
perfCLBInput("L6",i); perfCLBInput("L6",i);
} else if (page == "PERFCRZ") { } else if (page == "PERFCRZ") {
@ -853,8 +837,6 @@ var lskbutton = func(btn, i) {
perfAPPRInput("L6",i); perfAPPRInput("L6",i);
} else if (page == "PERFGA") { } else if (page == "PERFGA") {
perfGAInput("L6",i); perfGAInput("L6",i);
} else if (page == "PRINTFUNC2") {
printInput2("L6",i);
} else if (page == "F-PLNA" or page == "F-PLNB") { } else if (page == "F-PLNA" or page == "F-PLNB") {
canvas_mcdu.myFpln[i].pushButtonLeft(6); canvas_mcdu.myFpln[i].pushButtonLeft(6);
} else if (page == "LATREV" or page == "VERTREV" or page == "DUPLICATENAMES") { } else if (page == "LATREV" or page == "VERTREV" or page == "DUPLICATENAMES") {
@ -930,10 +912,6 @@ var rskbutton = func(btn, i) {
canvas_mcdu.myDESWIND[i].pushButtonRight(1); canvas_mcdu.myDESWIND[i].pushButtonRight(1);
} else if (page == "RADNAV") { } else if (page == "RADNAV") {
radnavInput("R1",i); radnavInput("R1",i);
} else if (page == "PRINTFUNC") {
printInput("R1",i);
} else if (page == "PRINTFUNC2") {
printInput2("R1",i);
} else if (page == "LATREV") { } else if (page == "LATREV") {
if (canvas_mcdu.myLatRev[i].type == 1) { if (canvas_mcdu.myLatRev[i].type == 1) {
if (canvas_mcdu.myArrival[i] != nil) { if (canvas_mcdu.myArrival[i] != nil) {
@ -1006,10 +984,6 @@ var rskbutton = func(btn, i) {
perfAPPRInput("R2",i); perfAPPRInput("R2",i);
} else if (page == "RADNAV") { } else if (page == "RADNAV") {
radnavInput("R2",i); radnavInput("R2",i);
} else if (page == "PRINTFUNC") {
printInput("R2",i);
} else if (page == "PRINTFUNC2") {
printInput2("R2",i);
} else if (page == "DEPARTURE") { } else if (page == "DEPARTURE") {
canvas_mcdu.myDeparture[i].depPushbuttonRight(2); canvas_mcdu.myDeparture[i].depPushbuttonRight(2);
} else if (page == "ARRIVAL") { } else if (page == "ARRIVAL") {
@ -1051,10 +1025,6 @@ var rskbutton = func(btn, i) {
perfTOInput("R3",i); perfTOInput("R3",i);
} else if (page == "PERFAPPR") { } else if (page == "PERFAPPR") {
perfAPPRInput("R3",i); perfAPPRInput("R3",i);
} else if (page == "PRINTFUNC") {
printInput("R3",i);
} else if (page == "PRINTFUNC2") {
printInput2("R3",i);
} else if (page == "DEPARTURE") { } else if (page == "DEPARTURE") {
canvas_mcdu.myDeparture[i].depPushbuttonRight(3); canvas_mcdu.myDeparture[i].depPushbuttonRight(3);
} else if (page == "ARRIVAL") { } else if (page == "ARRIVAL") {
@ -1144,8 +1114,6 @@ var rskbutton = func(btn, i) {
perfAPPRInput("R4",i); perfAPPRInput("R4",i);
} else if (page == "RADNAV") { } else if (page == "RADNAV") {
radnavInput("R4",i); radnavInput("R4",i);
} else if (page == "PRINTFUNC2") {
printInput2("R4",i);
} else if (page == "DEPARTURE") { } else if (page == "DEPARTURE") {
canvas_mcdu.myDeparture[i].depPushbuttonRight(4); canvas_mcdu.myDeparture[i].depPushbuttonRight(4);
} else if (page == "ARRIVAL") { } else if (page == "ARRIVAL") {
@ -1282,10 +1250,12 @@ var rskbutton = func(btn, i) {
perfDESInput("R6",i); perfDESInput("R6",i);
} else if (page == "PERFAPPR") { } else if (page == "PERFAPPR") {
perfAPPRInput("R6",i); perfAPPRInput("R6",i);
} else if ((page == "DATA") or (page == "PRINTFUNC") or (page == "PRINTFUNC2")) { } else if (page == "DATA") {
mcdu_message(i, "AOC DISABLED"); mcdu_message(i, "AOC DISABLED");
} else if (page == "INITA") { } else if (page == "INITA") {
initInputA("R6",i); initInputA("R6",i);
} else if (page == "RADNAV") {
radnavInput("R6",i);
} else if (page == "F-PLNA" or page == "F-PLNB") { } else if (page == "F-PLNA" or page == "F-PLNB") {
canvas_mcdu.myFpln[i].pushButtonRight(6); canvas_mcdu.myFpln[i].pushButtonRight(6);
} else if (page == "VERTREV") { } else if (page == "VERTREV") {
@ -1339,10 +1309,6 @@ var arrowbutton = func(btn, i) {
} }
} else if (page == "INITB" or page == "FUELPRED") { } else if (page == "INITB" or page == "FUELPRED") {
pageNode[i].setValue("INITA"); pageNode[i].setValue("INITA");
} else if (page == "PRINTFUNC") {
pageNode[i].setValue("PRINTFUNC2");
} else if (page == "PRINTFUNC2") {
pageNode[i].setValue("PRINTFUNC");
} else if (page == "DEPARTURE") { } else if (page == "DEPARTURE") {
canvas_mcdu.myDeparture[i].scrollLeft(); canvas_mcdu.myDeparture[i].scrollLeft();
} else if (page == "ARRIVAL") { } else if (page == "ARRIVAL") {
@ -1371,10 +1337,6 @@ var arrowbutton = func(btn, i) {
} }
} else if (page == "INITB" or page == "FUELPRED") { } else if (page == "INITB" or page == "FUELPRED") {
pageNode[i].setValue("INITA"); pageNode[i].setValue("INITA");
} else if (page == "PRINTFUNC") {
pageNode[i].setValue("PRINTFUNC2");
} else if (page == "PRINTFUNC2") {
pageNode[i].setValue("PRINTFUNC");
} else if (page == "DEPARTURE") { } else if (page == "DEPARTURE") {
canvas_mcdu.myDeparture[i].scrollRight(); canvas_mcdu.myDeparture[i].scrollRight();
} else if (page == "ARRIVAL") { } else if (page == "ARRIVAL") {

View file

@ -1,49 +1,158 @@
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring) # A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring)
# Copyright (c) 2020 Josh Davidson (Octal450) # Copyright (c) 2020 Josh Davidson (Octal450)
var radnavInput = func(key, i) { var radNavScratchpad = nil;
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad; var radNavScratchpadSize = nil;
if (!getprop("/systems/radio/rmp[0]/nav") and !getprop("/systems/radio/rmp[1]/nav")) {
if (key == "L1") { var parseFrequencyVOR = func(scratchpad, i, num) {
if (scratchpad == "CLR") { if (size(scratchpad) == 3 or size(scratchpad) == 5 or size(scratchpad) == 6) {
setprop("/FMGC/internal/vor1freq-set", 0);
mcdu_scratchpad.scratchpads[i].empty();
} else {
var tfs = size(scratchpad);
if (tfs == 3 or tfs == 5 or tfs == 6) {
if (scratchpad >= 108.00 and scratchpad <= 111.95) { if (scratchpad >= 108.00 and scratchpad <= 111.95) {
if (scratchpad == 108.10 or scratchpad == 108.15 or scratchpad == 108.30 or scratchpad == 108.35 or scratchpad == 108.50 or scratchpad == 108.55 or scratchpad == 108.70 or scratchpad == 108.75 or scratchpad == 108.90 or scratchpad == 108.95 if (scratchpad == 108.10 or scratchpad == 108.15 or scratchpad == 108.30 or scratchpad == 108.35 or scratchpad == 108.50 or scratchpad == 108.55 or scratchpad == 108.70 or scratchpad == 108.75 or scratchpad == 108.90 or scratchpad == 108.95
or scratchpad == 109.10 or scratchpad == 109.15 or scratchpad == 109.30 or scratchpad == 109.35 or scratchpad == 109.50 or scratchpad == 109.55 or scratchpad == 109.70 or scratchpad == 109.75 or scratchpad == 109.90 or scratchpad == 109.95 or scratchpad == 109.10 or scratchpad == 109.15 or scratchpad == 109.30 or scratchpad == 109.35 or scratchpad == 109.50 or scratchpad == 109.55 or scratchpad == 109.70 or scratchpad == 109.75 or scratchpad == 109.90 or scratchpad == 109.95
or scratchpad == 110.10 or scratchpad == 110.15 or scratchpad == 110.30 or scratchpad == 110.35 or scratchpad == 110.50 or scratchpad == 110.55 or scratchpad == 110.70 or scratchpad == 110.75 or scratchpad == 110.90 or scratchpad == 110.95 or scratchpad == 110.10 or scratchpad == 110.15 or scratchpad == 110.30 or scratchpad == 110.35 or scratchpad == 110.50 or scratchpad == 110.55 or scratchpad == 110.70 or scratchpad == 110.75 or scratchpad == 110.90 or scratchpad == 110.95
or scratchpad == 111.10 or scratchpad == 111.15 or scratchpad == 111.30 or scratchpad == 111.35 or scratchpad == 111.50 or scratchpad == 111.55 or scratchpad == 111.70 or scratchpad == 111.75 or scratchpad == 111.90 or scratchpad == 111.95) { or scratchpad == 111.10 or scratchpad == 111.15 or scratchpad == 111.30 or scratchpad == 111.35 or scratchpad == 111.50 or scratchpad == 111.55 or scratchpad == 111.70 or scratchpad == 111.75 or scratchpad == 111.90 or scratchpad == 111.95) {
mcdu_message(i, "NOT ALLOWED"); return 3;
} else { } else {
setprop("instrumentation/nav[2]/frequencies/selected-mhz", scratchpad); pts.Instrumentation.Nav.Frequencies.selectedMhz[num].setValue(scratchpad);
setprop("/FMGC/internal/vor1freq-set", 1); return 4;
mcdu_scratchpad.scratchpads[i].empty();
} }
} else if (scratchpad >= 112.00 and scratchpad <= 117.95) { } else if (scratchpad >= 112.00 and scratchpad <= 117.95) {
setprop("instrumentation/nav[2]/frequencies/selected-mhz", scratchpad); pts.Instrumentation.Nav.Frequencies.selectedMhz[num].setValue(scratchpad);
setprop("/FMGC/internal/vor1freq-set", 1); return 4;
mcdu_scratchpad.scratchpads[i].empty();
} else { } else {
mcdu_message(i, "NOT ALLOWED"); return 2;
} }
} else { } else {
return 1;
}
}
var searchResultVOR = nil;
var parseIdentVOR = func(scratchpad, i, num) {
# TODO - duplicate names
if (size(scratchpad) == 2 or size(scratchpad) == 3) {
searchResultVOR = findNavaidsByID(scratchpad);
if (size(searchResultVOR) != 0) {
pts.Instrumentation.Nav.Frequencies.selectedMhz[num].setValue(searchResultVOR[0].frequency / 100);
return 3;
} else {
return 2;
}
} else {
return 1;
}
};
var splitScratchpadADF = nil;
var parseFrequencyADF = func(scratchpad, i, num) {
if (size(scratchpad) >= 3 and size(scratchpad) <= 6) {
if (scratchpad >= 190 and scratchpad <= 1799) {
if (scratchpad != int(scratchpad)) {
splitScratchpadADF = split(".",scratchpad);
if (size(splitScratchpadADF) != 2 or splitScratchpadADF[1] != "5") {
return 3;
} else {
pts.Instrumentation.Adf.Frequencies.selectedKhz[num].setValue(scratchpad);
return 4;
}
} else {
pts.Instrumentation.Adf.Frequencies.selectedKhz[num].setValue(scratchpad);
return 4;
}
} else {
return 2;
}
} else {
return 1;
}
}
var searchResultADF = nil;
var parseIdentADF = func(scratchpad, i, num) {
# TODO - duplicate names
if (size(scratchpad) == 2 or size(scratchpad) == 3) {
searchResultADF = findNavaidsByID(scratchpad);
if (size(searchResultADF) != 0) {
pts.Instrumentation.Adf.Frequencies.selectedKhz[num].setValue(searchResultADF[0].frequency / 100);
return 3;
} else {
return 2;
}
} else {
return 1;
}
};
var returny = nil;
var radnavInput = func(key, i) {
radNavScratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
radNavScratchpadSize = size(radNavScratchpad);
if (!rmp.rmpNav[0].getValue() and !rmp.rmpNav[1].getValue()) {
if (key == "L1") {
if (radNavScratchpad == "CLR") {
fmgc.FMGCInternal.VOR1.freqSet = 0;
mcdu_scratchpad.scratchpads[i].empty();
} else {
if (size(split("/", radNavScratchpad)) == 2) {
if (size(split("/", radNavScratchpad)[0]) != 0) {
mcdu_message(i, "FORMAT ERROR");
return;
} else {
radNavScratchpad = split("/", radNavScratchpad)[1];
if (num(radNavScratchpad) != radNavScratchpad) {
mcdu_message(i, "FORMAT ERROR");
} else {
returny = parseFrequencyVOR(radNavScratchpad, i, 2);
if (returny == 1) {
mcdu_message(i, "FORMAT ERROR");
} elsif (returny == 2) {
mcdu_message(i, "ENTRY OUT OF RANGE");
} elsif (returny == 3) {
mcdu_message(i, "NOT ALLOWED"); mcdu_message(i, "NOT ALLOWED");
} elsif (returny == 4) {
fmgc.FMGCInternal.VOR1.freqSet = 1;
mcdu_scratchpad.scratchpads[i].empty();
}
}
}
} else if (size(split("/", radNavScratchpad)) == 1) {
if (num(radNavScratchpad) == radNavScratchpad) {
returny = parseFrequencyVOR(radNavScratchpad, i, 2);
if (returny == 1) {
mcdu_message(i, "FORMAT ERROR");
} elsif (returny == 2) {
mcdu_message(i, "ENTRY OUT OF RANGE");
} elsif (returny == 3) {
mcdu_message(i, "NOT ALLOWED");
} elsif (returny == 4) {
fmgc.FMGCInternal.VOR1.freqSet = 1;
mcdu_scratchpad.scratchpads[i].empty();
}
} else if (isstr(radNavScratchpad)) {
returny = parseIdentVOR(radNavScratchpad, i, 2);
if (returny == 1) {
mcdu_message(i, "FORMAT ERROR");
} elsif (returny == 2) {
# TODO - NEW NAVAID page
mcdu_message(i, "NOT IN DATA BASE");
} elsif (returny == 3) {
fmgc.FMGCInternal.VOR1.freqSet = 1;
mcdu_scratchpad.scratchpads[i].empty();
}
}
} else {
mcdu_message(i, "FORMAT ERROR");
} }
} }
} else if (key == "L2") { } else if (key == "L2") {
if (scratchpad == "CLR") { if (radNavScratchpad == "CLR") {
setprop("/FMGC/internal/vor1crs-set", 0); fmgc.FMGCInternal.VOR1.crsSet = 0;
mcdu_scratchpad.scratchpads[i].empty(); mcdu_scratchpad.scratchpads[i].empty();
} else { } else {
var tfs = size(scratchpad); if (radNavScratchpadSize >= 1 and radNavScratchpadSize <= 3) {
if (tfs >= 1 and tfs <= 3) { if (radNavScratchpad >= 0 and radNavScratchpad <= 360) {
if (scratchpad >= 0 and scratchpad <= 360) { pts.Instrumentation.Nav.Radials.selectedDeg[2].setValue(radNavScratchpad);
setprop("instrumentation/nav[2]/radials/selected-deg", scratchpad); fmgc.FMGCInternal.VOR1.crsSet = 1;
setprop("/FMGC/internal/vor1crs-set", 1);
mcdu_scratchpad.scratchpads[i].empty(); mcdu_scratchpad.scratchpads[i].empty();
} else { } else {
mcdu_message(i, "NOT ALLOWED"); mcdu_message(i, "NOT ALLOWED");
@ -53,21 +162,20 @@ var radnavInput = func(key, i) {
} }
} }
} else if (key == "L3") { } else if (key == "L3") {
if (scratchpad == "CLR") { if (radNavScratchpad == "CLR") {
setprop("/FMGC/internal/ils1freq-set", 0); fmgc.FMGCInternal.ILS.freqSet = 0;
mcdu_scratchpad.scratchpads[i].empty(); mcdu_scratchpad.scratchpads[i].empty();
} else { } else {
var tfs = size(scratchpad); if (radNavScratchpadSize == 3 or radNavScratchpadSize == 5 or radNavScratchpadSize == 6) {
if (tfs == 3 or tfs == 5 or tfs == 6) { if (radNavScratchpad >= 108.00 and radNavScratchpad <= 111.95) {
if (scratchpad >= 108.00 and scratchpad <= 111.95) { if (radNavScratchpad == 108.10 or radNavScratchpad == 108.15 or radNavScratchpad == 108.30 or radNavScratchpad == 108.35 or radNavScratchpad == 108.50 or radNavScratchpad == 108.55 or radNavScratchpad == 108.70 or radNavScratchpad == 108.75 or radNavScratchpad == 108.90 or radNavScratchpad == 108.95
if (scratchpad == 108.10 or scratchpad == 108.15 or scratchpad == 108.30 or scratchpad == 108.35 or scratchpad == 108.50 or scratchpad == 108.55 or scratchpad == 108.70 or scratchpad == 108.75 or scratchpad == 108.90 or scratchpad == 108.95 or radNavScratchpad == 109.10 or radNavScratchpad == 109.15 or radNavScratchpad == 109.30 or radNavScratchpad == 109.35 or radNavScratchpad == 109.50 or radNavScratchpad == 109.55 or radNavScratchpad == 109.70 or radNavScratchpad == 109.75 or radNavScratchpad == 109.90 or radNavScratchpad == 109.95
or scratchpad == 109.10 or scratchpad == 109.15 or scratchpad == 109.30 or scratchpad == 109.35 or scratchpad == 109.50 or scratchpad == 109.55 or scratchpad == 109.70 or scratchpad == 109.75 or scratchpad == 109.90 or scratchpad == 109.95 or radNavScratchpad == 110.10 or radNavScratchpad == 110.15 or radNavScratchpad == 110.30 or radNavScratchpad == 110.35 or radNavScratchpad == 110.50 or radNavScratchpad == 110.55 or radNavScratchpad == 110.70 or radNavScratchpad == 110.75 or radNavScratchpad == 110.90 or radNavScratchpad == 110.95
or scratchpad == 110.10 or scratchpad == 110.15 or scratchpad == 110.30 or scratchpad == 110.35 or scratchpad == 110.50 or scratchpad == 110.55 or scratchpad == 110.70 or scratchpad == 110.75 or scratchpad == 110.90 or scratchpad == 110.95 or radNavScratchpad == 111.10 or radNavScratchpad == 111.15 or radNavScratchpad == 111.30 or radNavScratchpad == 111.35 or radNavScratchpad == 111.50 or radNavScratchpad == 111.55 or radNavScratchpad == 111.70 or radNavScratchpad == 111.75 or radNavScratchpad == 111.90 or radNavScratchpad == 111.95) {
or scratchpad == 111.10 or scratchpad == 111.15 or scratchpad == 111.30 or scratchpad == 111.35 or scratchpad == 111.50 or scratchpad == 111.55 or scratchpad == 111.70 or scratchpad == 111.75 or scratchpad == 111.90 or scratchpad == 111.95) { pts.Instrumentation.Nav.Frequencies.selectedMhz[0].setValue(radNavScratchpad);
setprop("instrumentation/nav[0]/frequencies/selected-mhz", scratchpad); fmgc.FMGCInternal.ILS.freqSet = 1;
setprop("/FMGC/internal/ils1freq-set", 1);
mcdu_scratchpad.scratchpads[i].empty(); mcdu_scratchpad.scratchpads[i].empty();
if (num(getprop("/FMGC/internal/ils1freq-calculated")) != 0 and num(getprop("/FMGC/internal/ils1freq-calculated")) != num(getprop("instrumentation/nav[0]/frequencies/selected-mhz"))) { if (num(fmgc.FMGCInternal.ILS.freqCalculated) != 0 and num(fmgc.FMGCInternal.ILS.freqCalculated) != num(pts.Instrumentation.Nav.Frequencies.selectedMhz[0].getValue())) {
mcdu_message(i, "RWY/LS MISMATCH"); mcdu_message(i, "RWY/LS MISMATCH");
} }
} else { } else {
@ -81,15 +189,14 @@ var radnavInput = func(key, i) {
} }
} }
} else if (key == "L4") { } else if (key == "L4") {
if (scratchpad == "CLR") { if (radNavScratchpad == "CLR") {
setprop("/FMGC/internal/ils1crs-set", 0); fmgc.FMGCInternal.ILS.crsSet = 0;
mcdu_scratchpad.scratchpads[i].empty(); mcdu_scratchpad.scratchpads[i].empty();
} else { } else {
var tfs = size(scratchpad); if (radNavScratchpadSize >= 1 and radNavScratchpadSize <= 3) {
if (tfs >= 1 and tfs <= 3) { if (radNavScratchpad >= 0 and radNavScratchpad <= 360) {
if (scratchpad >= 0 and scratchpad <= 360) { pts.Instrumentation.Nav.Radials.selectedDeg[0].setValue(radNavScratchpad);
setprop("instrumentation/nav[0]/radials/selected-deg", scratchpad); fmgc.FMGCInternal.ILS.crsSet = 1;
setprop("/FMGC/internal/ils1crs-set", 1);
mcdu_scratchpad.scratchpads[i].empty(); mcdu_scratchpad.scratchpads[i].empty();
} else { } else {
mcdu_message(i, "NOT ALLOWED"); mcdu_message(i, "NOT ALLOWED");
@ -99,62 +206,141 @@ var radnavInput = func(key, i) {
} }
} }
} else if (key == "L5") { } else if (key == "L5") {
if (scratchpad == "CLR") { if (radNavScratchpad == "CLR") {
setprop("/FMGC/internal/adf1freq-set", 0); fmgc.FMGCInternal.ADF1.freqSet = 0;
mcdu_scratchpad.scratchpads[i].empty(); mcdu_scratchpad.scratchpads[i].empty();
} else { } else {
var tfs = size(scratchpad); if (size(split("/", radNavScratchpad)) == 2) {
if (tfs == 3 or tfs == 4) { if (size(split("/", radNavScratchpad)[0]) != 0) {
if (scratchpad >= 190 and scratchpad <= 1750) { mcdu_message(i, "FORMAT ERROR");
setprop("instrumentation/adf[0]/frequencies/selected-khz", scratchpad); return;
setprop("/FMGC/internal/adf1freq-set", 1); } else {
radNavScratchpad = split("/", radNavScratchpad)[1];
if (num(radNavScratchpad) != radNavScratchpad) {
mcdu_message(i, "FORMAT ERROR");
} else {
returny = parseFrequencyADF(radNavScratchpad, i, 0);
if (returny == 1) {
mcdu_message(i, "FORMAT ERROR");
} elsif (returny == 2) {
mcdu_message(i, "ENTRY OUT OF RANGE");
} elsif (returny == 3) {
mcdu_message(i, "NOT ALLOWED");
} elsif (returny == 4) {
fmgc.FMGCInternal.ADF1.freqSet = 1;
mcdu_scratchpad.scratchpads[i].empty(); mcdu_scratchpad.scratchpads[i].empty();
}
}
}
} else if (size(split("/", radNavScratchpad)) == 1) {
if (num(radNavScratchpad) == radNavScratchpad) {
returny = parseFrequencyADF(radNavScratchpad, i, 0);
if (returny == 1) {
mcdu_message(i, "FORMAT ERROR");
} elsif (returny == 2) {
mcdu_message(i, "ENTRY OUT OF RANGE");
} elsif (returny == 3) {
mcdu_message(i, "NOT ALLOWED");
} elsif (returny == 4) {
fmgc.FMGCInternal.ADF1.freqSet = 1;
mcdu_scratchpad.scratchpads[i].empty();
}
} else if (isstr(radNavScratchpad)) {
returny = parseIdentADF(radNavScratchpad, i, 0);
if (returny == 1) {
mcdu_message(i, "FORMAT ERROR");
} elsif (returny == 2) {
# TODO - NEW NAVAID page
mcdu_message(i, "NOT IN DATA BASE");
} elsif (returny == 3) {
fmgc.FMGCInternal.ADF1.freqSet = 1;
mcdu_scratchpad.scratchpads[i].empty();
}
}
} else {
mcdu_message(i, "FORMAT ERROR");
}
}
} else if (key == "L6") {
if (fmgc.FMGCInternal.ADF1.freqSet) {
if (radNavScratchpad == "CLR" and rmp.BFOActive[0].getValue()) {
rmp.BFOActive[0].setValue(0);
mcdu_scratchpad.scratchpads[i].empty();
} else {
if (radNavScratchpadSize == 0 and !rmp.BFOActive[0].getValue()) {
rmp.BFOActive[0].setValue(1);
} else { } else {
mcdu_message(i, "NOT ALLOWED"); mcdu_message(i, "NOT ALLOWED");
} }
}
} else { } else {
mcdu_message(i, "NOT ALLOWED"); mcdu_message(i, "NOT ALLOWED");
} }
}
} else if (key == "R1") { } else if (key == "R1") {
if (scratchpad == "CLR") { if (radNavScratchpad == "CLR") {
setprop("/FMGC/internal/vor2freq-set", 0); fmgc.FMGCInternal.VOR2.freqSet = 0;
mcdu_scratchpad.scratchpads[i].empty(); mcdu_scratchpad.scratchpads[i].empty();
} else { } else {
var tfs = size(scratchpad); if (size(split("/", radNavScratchpad)) == 2) {
if (tfs == 3 or tfs == 5 or tfs == 6) { if (size(split("/", radNavScratchpad)[1]) != 0) {
if (scratchpad >= 108.10 and scratchpad <= 111.95) { mcdu_message(i, "FORMAT ERROR");
if (scratchpad == 108.10 or scratchpad == 108.15 or scratchpad == 108.30 or scratchpad == 108.35 or scratchpad == 108.50 or scratchpad == 108.55 or scratchpad == 108.70 or scratchpad == 108.75 or scratchpad == 108.90 or scratchpad == 108.95 return;
or scratchpad == 109.10 or scratchpad == 109.15 or scratchpad == 109.30 or scratchpad == 109.35 or scratchpad == 109.50 or scratchpad == 109.55 or scratchpad == 109.70 or scratchpad == 109.75 or scratchpad == 109.90 or scratchpad == 109.95
or scratchpad == 110.10 or scratchpad == 110.15 or scratchpad == 110.30 or scratchpad == 110.35 or scratchpad == 110.50 or scratchpad == 110.55 or scratchpad == 110.70 or scratchpad == 110.75 or scratchpad == 110.90 or scratchpad == 110.95
or scratchpad == 111.10 or scratchpad == 111.15 or scratchpad == 111.30 or scratchpad == 111.35 or scratchpad == 111.50 or scratchpad == 111.55 or scratchpad == 111.70 or scratchpad == 111.75 or scratchpad == 111.90 or scratchpad == 111.95) {
mcdu_message(i, "NOT ALLOWED");
} else { } else {
setprop("instrumentation/nav[3]/frequencies/selected-mhz", scratchpad); radNavScratchpad = split("/", radNavScratchpad)[0];
setprop("/FMGC/internal/vor2freq-set", 1); if (num(radNavScratchpad) != radNavScratchpad) {
mcdu_message(i, "FORMAT ERROR");
} else {
returny = parseFrequencyVOR(radNavScratchpad, i, 3);
if (returny == 1) {
mcdu_message(i, "FORMAT ERROR");
} elsif (returny == 2) {
mcdu_message(i, "ENTRY OUT OF RANGE");
} elsif (returny == 3) {
mcdu_message(i, "NOT ALLOWED");
} elsif (returny == 4) {
fmgc.FMGCInternal.VOR2.freqSet = 1;
mcdu_scratchpad.scratchpads[i].empty(); mcdu_scratchpad.scratchpads[i].empty();
} }
} else if (scratchpad >= 112.00 and scratchpad <= 117.95) { }
setprop("instrumentation/nav[3]/frequencies/selected-mhz", scratchpad); }
setprop("/FMGC/internal/vor2freq-set", 1); } else if (size(split("/", radNavScratchpad)) == 1) {
mcdu_scratchpad.scratchpads[i].empty(); if (num(radNavScratchpad) == radNavScratchpad) {
} else { returny = parseFrequencyVOR(radNavScratchpad, i, 3);
if (returny == 1) {
mcdu_message(i, "FORMAT ERROR");
} elsif (returny == 2) {
mcdu_message(i, "ENTRY OUT OF RANGE");
} elsif (returny == 3) {
mcdu_message(i, "NOT ALLOWED"); mcdu_message(i, "NOT ALLOWED");
} elsif (returny == 4) {
fmgc.FMGCInternal.VOR2.freqSet = 1;
mcdu_scratchpad.scratchpads[i].empty();
}
} else if (isstr(radNavScratchpad)) {
returny = parseIdentVOR(radNavScratchpad, i, 3);
if (returny == 1) {
mcdu_message(i, "FORMAT ERROR");
} elsif (returny == 2) {
# TODO - NEW NAVAID page
mcdu_message(i, "NOT IN DATA BASE");
} elsif (returny == 3) {
fmgc.FMGCInternal.VOR2.freqSet = 1;
mcdu_scratchpad.scratchpads[i].empty();
}
} }
} else { } else {
mcdu_message(i, "NOT ALLOWED"); mcdu_message(i, "FORMAT ERROR");
} }
} }
} else if (key == "R2") { } else if (key == "R2") {
if (scratchpad == "CLR") { if (radNavScratchpad == "CLR") {
setprop("/FMGC/internal/vor2crs-set", 0); fmgc.FMGCInternal.VOR2.crsSet = 0;
mcdu_scratchpad.scratchpads[i].empty(); mcdu_scratchpad.scratchpads[i].empty();
} else { } else {
var tfs = size(scratchpad); if (radNavScratchpadSize >= 1 and radNavScratchpadSize <= 3) {
if (tfs >= 1 and tfs <= 3) { if (radNavScratchpad >= 0 and radNavScratchpad <= 360) {
if (scratchpad >= 0 and scratchpad <= 360) { pts.Instrumentation.Nav.Radials.selectedDeg[3].setValue(radNavScratchpad);
setprop("instrumentation/nav[3]/radials/selected-deg", scratchpad); fmgc.FMGCInternal.VOR2.crsSet = 1;
setprop("/FMGC/internal/vor2crs-set", 1);
mcdu_scratchpad.scratchpads[i].empty(); mcdu_scratchpad.scratchpads[i].empty();
} else { } else {
mcdu_message(i, "NOT ALLOWED"); mcdu_message(i, "NOT ALLOWED");
@ -164,16 +350,73 @@ var radnavInput = func(key, i) {
} }
} }
} else if (key == "R5") { } else if (key == "R5") {
if (scratchpad == "CLR") { if (radNavScratchpad == "CLR") {
setprop("/FMGC/internal/adf2freq-set", 0); fmgc.FMGCInternal.ADF2.freqSet = 0;
mcdu_scratchpad.scratchpads[i].empty(); mcdu_scratchpad.scratchpads[i].empty();
} else { } else {
var tfs = size(scratchpad); if (size(split("/", radNavScratchpad)) == 2) {
if (tfs == 3 or tfs == 4) { if (size(split("/", radNavScratchpad)[1]) != 0) {
if (scratchpad >= 190 and scratchpad <= 1750) { mcdu_message(i, "FORMAT ERROR");
setprop("instrumentation/adf[1]/frequencies/selected-khz", scratchpad); return;
setprop("/FMGC/internal/adf2freq-set", 1); } else {
radNavScratchpad = split("/", radNavScratchpad)[0];
if (num(radNavScratchpad) != radNavScratchpad) {
mcdu_message(i, "FORMAT ERROR");
} else {
returny = parseFrequencyADF(radNavScratchpad, i, 1);
if (returny == 1) {
mcdu_message(i, "FORMAT ERROR");
} elsif (returny == 2) {
mcdu_message(i, "ENTRY OUT OF RANGE");
} elsif (returny == 3) {
mcdu_message(i, "NOT ALLOWED");
} elsif (returny == 4) {
fmgc.FMGCInternal.ADF2.freqSet = 1;
mcdu_scratchpad.scratchpads[i].empty();
}
}
}
} else if (size(split("/", radNavScratchpad)) == 1) {
if (num(radNavScratchpad) == radNavScratchpad) {
returny = parseFrequencyADF(radNavScratchpad, i, 1);
if (returny == 1) {
mcdu_message(i, "FORMAT ERROR");
} elsif (returny == 2) {
mcdu_message(i, "ENTRY OUT OF RANGE");
} elsif (returny == 3) {
mcdu_message(i, "NOT ALLOWED");
} elsif (returny == 4) {
fmgc.FMGCInternal.ADF2.freqSet = 1;
mcdu_scratchpad.scratchpads[i].empty();
}
} else if (isstr(radNavScratchpad)) {
returny = parseIdentADF(radNavScratchpad, i, 1);
if (returny == 1) {
mcdu_message(i, "FORMAT ERROR");
} elsif (returny == 2) {
# TODO - NEW NAVAID page
mcdu_message(i, "NOT IN DATA BASE");
} elsif (returny == 3) {
fmgc.FMGCInternal.ADF2.freqSet = 1;
mcdu_scratchpad.scratchpads[i].empty();
}
}
} else {
mcdu_message(i, "FORMAT ERROR");
}
}
} else if (key == "R6") {
if (fmgc.FMGCInternal.ADF2.freqSet) {
if (radNavScratchpad == "CLR" and rmp.BFOActive[1].getValue()) {
rmp.BFOActive[1].setValue(0);
mcdu_scratchpad.scratchpads[i].empty(); mcdu_scratchpad.scratchpads[i].empty();
} else {
if (radNavScratchpadSize == 0 and !rmp.BFOActive[1].getValue()) {
rmp.BFOActive[1].setValue(1);
} else {
mcdu_message(i, "NOT ALLOWED");
}
}
} else { } else {
mcdu_message(i, "NOT ALLOWED"); mcdu_message(i, "NOT ALLOWED");
} }
@ -182,7 +425,3 @@ var radnavInput = func(key, i) {
} }
} }
} }
} else {
mcdu_message(i, "NOT ALLOWED");
}
}

View file

@ -7,15 +7,40 @@
# NOTE: This is just temporary until FG allows a full implementation of the audio system. # NOTE: This is just temporary until FG allows a full implementation of the audio system.
var mkr_capt_recive = props.globals.initNode("/controls/audio/acp[0]/mkr-recive", 0, "BOOL");
var mkr_capt_volume = props.globals.initNode("/controls/audio/acp[0]/mkr-volume", 1, "DOUBLE");
var mkr_fo_recive = props.globals.initNode("/controls/audio/acp[1]/mkr-recive", 0, "BOOL");
var mkr_fo_volume = props.globals.initNode("/controls/audio/acp[1]/mkr-volume", 1, "DOUBLE");
var ils_capt_recive = props.globals.initNode("/controls/audio/acp[0]/ils-recive", 0, "BOOL");
var ils_capt_volume = props.globals.initNode("/controls/audio/acp[0]/ils-volume", 1, "DOUBLE");
var ils_fo_recive = props.globals.initNode("/controls/audio/acp[1]/ils-recive", 0, "BOOL");
var ils_fo_volume = props.globals.initNode("/controls/audio/acp[1]/ils-volume", 1, "DOUBLE");
var vhf1_capt_recive = props.globals.initNode("/controls/audio/acp[0]/vhf1-recive", 1, "BOOL"); var vhf1_capt_recive = props.globals.initNode("/controls/audio/acp[0]/vhf1-recive", 1, "BOOL");
var vhf2_capt_recive = props.globals.initNode("/controls/audio/acp[0]/vhf2-recive", 1, "BOOL"); var vhf2_capt_recive = props.globals.initNode("/controls/audio/acp[0]/vhf2-recive", 1, "BOOL");
var vhf1_capt_volume = props.globals.initNode("/controls/audio/acp[0]/vhf1-volume", 1, "DOUBLE"); var vhf1_capt_volume = props.globals.initNode("/controls/audio/acp[0]/vhf1-volume", 1, "DOUBLE");
var vhf2_capt_volume = props.globals.initNode("/controls/audio/acp[0]/vhf2-volume", 1, "DOUBLE"); var vhf2_capt_volume = props.globals.initNode("/controls/audio/acp[0]/vhf2-volume", 1, "DOUBLE");
var adf1_capt_receive = props.globals.initNode("/controls/audio/acp[0]/adf1-recive", 0, "BOOL");
var adf1_capt_volume = props.globals.initNode("/controls/audio/acp[0]/adf1-volume", 1, "DOUBLE");
var adf2_capt_receive = props.globals.initNode("/controls/audio/acp[0]/adf2-recive", 0, "BOOL");
var adf2_capt_volume = props.globals.initNode("/controls/audio/acp[0]/adf2-volume", 1, "DOUBLE");
var vor1_capt_receive = props.globals.initNode("/controls/audio/acp[0]/vor1-recive", 0, "BOOL");
var vor1_capt_volume = props.globals.initNode("/controls/audio/acp[0]/vor1-volume", 1, "DOUBLE");
var vor2_capt_receive = props.globals.initNode("/controls/audio/acp[0]/vor2-recive", 0, "BOOL");
var vor2_capt_volume = props.globals.initNode("/controls/audio/acp[0]/vor2-volume", 1, "DOUBLE");
var vhf1_fo_recive = props.globals.initNode("/controls/audio/acp[1]/vhf1-recive", 1, "BOOL"); var vhf1_fo_recive = props.globals.initNode("/controls/audio/acp[1]/vhf1-recive", 1, "BOOL");
var vhf2_fo_recive = props.globals.initNode("/controls/audio/acp[1]/vhf2-recive", 1, "BOOL"); var vhf2_fo_recive = props.globals.initNode("/controls/audio/acp[1]/vhf2-recive", 1, "BOOL");
var vhf1_fo_volume = props.globals.initNode("/controls/audio/acp[1]/vhf1-volume", 1, "DOUBLE"); var vhf1_fo_volume = props.globals.initNode("/controls/audio/acp[1]/vhf1-volume", 1, "DOUBLE");
var vhf2_fo_volume = props.globals.initNode("/controls/audio/acp[1]/vhf2-volume", 1, "DOUBLE"); var vhf2_fo_volume = props.globals.initNode("/controls/audio/acp[1]/vhf2-volume", 1, "DOUBLE");
var adf1_fo_receive = props.globals.initNode("/controls/audio/acp[1]/adf1-recive", 0, "BOOL");
var adf1_fo_volume = props.globals.initNode("/controls/audio/acp[1]/adf1-volume", 1, "DOUBLE");
var adf2_fo_receive = props.globals.initNode("/controls/audio/acp[1]/adf2-recive", 0, "BOOL");
var adf2_fo_volume = props.globals.initNode("/controls/audio/acp[1]/adf2-volume", 1, "DOUBLE");
var vor1_fo_receive = props.globals.initNode("/controls/audio/acp[1]/vor1-recive", 0, "BOOL");
var vor1_fo_volume = props.globals.initNode("/controls/audio/acp[1]/vor1-volume", 1, "DOUBLE");
var vor2_fo_receive = props.globals.initNode("/controls/audio/acp[1]/vor2-recive", 0, "BOOL");
var vor2_fo_volume = props.globals.initNode("/controls/audio/acp[1]/vor2-volume", 1, "DOUBLE");
var com1_volume = props.globals.getNode("instrumentation/comm[0]/volume"); var com1_volume = props.globals.getNode("instrumentation/comm[0]/volume");
var com2_volume = props.globals.getNode("instrumentation/comm[1]/volume"); var com2_volume = props.globals.getNode("instrumentation/comm[1]/volume");

View file

@ -97,6 +97,7 @@ var sel_crs_rmp1 = props.globals.initNode("/systems/radio/rmp[0]/select-crs", 1,
var sel_crs_rmp2 = props.globals.initNode("/systems/radio/rmp[1]/select-crs", 1, "BOOL"); var sel_crs_rmp2 = props.globals.initNode("/systems/radio/rmp[1]/select-crs", 1, "BOOL");
var vhf3_data_mode = props.globals.initNode("/systems/radio/vhf3-data-mode", 1, "BOOL"); var vhf3_data_mode = props.globals.initNode("/systems/radio/vhf3-data-mode", 1, "BOOL");
var rmpNav = [props.globals.initNode("/systems/radio/rmp[0]/nav", 0, "BOOL"),props.globals.initNode("/systems/radio/rmp[1]/nav", 0, "BOOL")];
var init = func() { var init = func() {
chan_rmp1.setValue("vhf1"); chan_rmp1.setValue("vhf1");
@ -277,11 +278,11 @@ var update_displays_nav = func(nav) {
stby_display_rmp2.setValue(sprintf("%3.2f", stby_vor2.getValue())); stby_display_rmp2.setValue(sprintf("%3.2f", stby_vor2.getValue()));
} }
} else if (nav == 5 and chan1 == "adf") { } else if (nav == 5 and chan1 == "adf") {
act_display_rmp1.setValue(sprintf("%4.0f", act_adf1.getValue())); act_display_rmp1.setValue(sprintf("%4.2f", act_adf1.getValue()));
stby_display_rmp1.setValue(sprintf("%4.0f", stby_adf1.getValue())); stby_display_rmp1.setValue(sprintf("%4.2f", stby_adf1.getValue()));
} else if (nav == 6 and chan2 == "adf") { } else if (nav == 6 and chan2 == "adf") {
act_display_rmp2.setValue(sprintf("%4.0f", act_adf2.getValue())); act_display_rmp2.setValue(sprintf("%4.2f", act_adf2.getValue()));
stby_display_rmp2.setValue(sprintf("%4.0f", stby_adf2.getValue())); stby_display_rmp2.setValue(sprintf("%4.2f", stby_adf2.getValue()));
} }
} }
@ -478,19 +479,19 @@ var change_nav_mode = func(rmp_nr, nav_mode) {
if (rmp_nr == 2 and (chan_rmp2.getValue() == "vor" or chan_rmp2.getValue() == "ls" or chan_rmp2.getValue() == "adf")) { if (rmp_nr == 2 and (chan_rmp2.getValue() == "vor" or chan_rmp2.getValue() == "ls" or chan_rmp2.getValue() == "adf")) {
chan_rmp2.setValue("vhf2"); chan_rmp2.setValue("vhf2");
} }
setprop("/FMGC/internal/ils1freq-set", 1); fmgc.FMGCInternal.ILS.freqSet = 1;
setprop("/FMGC/internal/ils1crs-set", 1); fmgc.FMGCInternal.ILS.crsSet = 1;
setprop("/FMGC/internal/vor1freq-set", 1); fmgc.FMGCInternal.VOR1.freqSet = 1;
setprop("/FMGC/internal/vor1crs-set", 1); fmgc.FMGCInternal.VOR1.crsSet = 1;
setprop("/FMGC/internal/vor2freq-set", 1); fmgc.FMGCInternal.VOR2.freqSet = 1;
setprop("/FMGC/internal/vor2crs-set", 1); fmgc.FMGCInternal.VOR2.crsSet = 1;
setprop("/FMGC/internal/adf1freq-set", 1); fmgc.FMGCInternal.ADF1.freqSet = 1;
setprop("/FMGC/internal/adf2freq-set", 1); fmgc.FMGCInternal.ADF2.freqSet = 1;
} }
} }
# ADF Radio: Implement BFO such that you will hear audio # ADF Radio: Implement BFO such that you will hear audio
var BFOActive = [props.globals.getNode("/systems/radio/rmp[0]/bfo-active"),props.globals.getNode("/systems/radio/rmp[1]/bfo-active")]; var BFOActive = [props.globals.initNode("/systems/radio/rmp[0]/bfo-active", 0, "BOOL"),props.globals.initNode("/systems/radio/rmp[1]/bfo-active", 0, "BOOL")];
var ADFIdent = [props.globals.getNode("/instrumentation/adf[0]/ident-audible"),props.globals.getNode("/instrumentation/adf[1]/ident-audible")]; var ADFIdent = [props.globals.getNode("/instrumentation/adf[0]/ident-audible"),props.globals.getNode("/instrumentation/adf[1]/ident-audible")];
var ADFMode = [props.globals.getNode("/instrumentation/adf[0]/mode"),props.globals.getNode("/instrumentation/adf[1]/mode")]; var ADFMode = [props.globals.getNode("/instrumentation/adf[0]/mode"),props.globals.getNode("/instrumentation/adf[1]/mode")];

View file

@ -49,8 +49,6 @@ var ELEC = {
tr2Fault: props.globals.getNode("/systems/failures/electrical/tr-2"), tr2Fault: props.globals.getNode("/systems/failures/electrical/tr-2"),
}, },
Generic: { Generic: {
adf: props.globals.initNode("/systems/electrical/outputs/adf", 0, "DOUBLE"),
dme: props.globals.initNode("/systems/electrical/outputs/dme", 0, "DOUBLE"),
efis: props.globals.initNode("/systems/electrical/outputs/efis", 0, "DOUBLE"), efis: props.globals.initNode("/systems/electrical/outputs/efis", 0, "DOUBLE"),
fcpPower: props.globals.initNode("/systems/electrical/outputs/fcp-power", 0, "DOUBLE"), fcpPower: props.globals.initNode("/systems/electrical/outputs/fcp-power", 0, "DOUBLE"),
fuelPump0: props.globals.initNode("/systems/electrical/outputs/fuel-pump[0]", 0, "DOUBLE"), fuelPump0: props.globals.initNode("/systems/electrical/outputs/fuel-pump[0]", 0, "DOUBLE"),
@ -58,10 +56,6 @@ var ELEC = {
fuelPump2: props.globals.initNode("/systems/electrical/outputs/fuel-pump[2]", 0, "DOUBLE"), fuelPump2: props.globals.initNode("/systems/electrical/outputs/fuel-pump[2]", 0, "DOUBLE"),
gps: props.globals.initNode("/systems/electrical/outputs/gps", 0, "DOUBLE"), gps: props.globals.initNode("/systems/electrical/outputs/gps", 0, "DOUBLE"),
mkViii: props.globals.initNode("/systems/electrical/outputs/mk-viii", 0, "DOUBLE"), mkViii: props.globals.initNode("/systems/electrical/outputs/mk-viii", 0, "DOUBLE"),
nav0: props.globals.initNode("/systems/electrical/outputs/nav[0]", 0, "DOUBLE"),
nav1: props.globals.initNode("/systems/electrical/outputs/nav[1]", 0, "DOUBLE"),
nav2: props.globals.initNode("/systems/electrical/outputs/nav[2]", 0, "DOUBLE"),
nav3: props.globals.initNode("/systems/electrical/outputs/nav[3]", 0, "DOUBLE"),
tacan: props.globals.initNode("/systems/electrical/outputs/tacan", 0, "DOUBLE"), tacan: props.globals.initNode("/systems/electrical/outputs/tacan", 0, "DOUBLE"),
transponder: props.globals.initNode("/systems/electrical/outputs/transponder", 0, "DOUBLE"), transponder: props.globals.initNode("/systems/electrical/outputs/transponder", 0, "DOUBLE"),
turnCoordinator: props.globals.initNode("/systems/electrical/outputs/turn-coordinator", 0, "DOUBLE"), turnCoordinator: props.globals.initNode("/systems/electrical/outputs/turn-coordinator", 0, "DOUBLE"),

View file

@ -2242,12 +2242,23 @@
<output>/systems/electrical/outputs/fuel-pump[0]</output> <output>/systems/electrical/outputs/fuel-pump[0]</output>
<output>/systems/electrical/outputs/fuel-pump[1]</output> <output>/systems/electrical/outputs/fuel-pump[1]</output>
<output>/systems/electrical/outputs/fuel-pump[2]</output> <output>/systems/electrical/outputs/fuel-pump[2]</output>
<output>/systems/electrical/outputs/gps</output>
<output>/systems/electrical/outputs/mk-viii</output> <output>/systems/electrical/outputs/mk-viii</output>
<output>/systems/electrical/outputs/tacan</output> <output>/systems/electrical/outputs/tacan</output>
<output>/systems/electrical/outputs/turn-coordinator</output> <output>/systems/electrical/outputs/turn-coordinator</output>
</switch> </switch>
<switch name="/systems/electrical/generic-ac-pwr">
<description>This makes the FG stuff work because we killed the generic electrical</description>
<default value="0"/>
<test value="/systems/electrical/bus/ac-ess">
/systems/electrical/bus/ac-ess ge 25
</test>
<test value="/systems/electrical/bus/ac-2">
/systems/electrical/bus/ac-2 ge 25
</test>
<output>/systems/electrical/outputs/gps</output>
</switch>
<switch name="/instrumentation/comm[0]/power-btn"> <switch name="/instrumentation/comm[0]/power-btn">
<default value="0"/> <default value="0"/>
<test logic="AND" value="1"> <test logic="AND" value="1">

View file

@ -39,6 +39,352 @@
</channel> </channel>
<channel name="ADF" execrate="8">
<switch name="/instrumentation/adf[0]/power-supply">
<default value="0"/>
<test logic="AND" value="1">
/systems/electrical/bus/ac-ess-shed ge 110
</test>
</switch>
<actuator name="/instrumentation/adf[0]/power-supply-bite-enable">
<input>/instrumentation/adf[0]/power-supply</input>
<rate_limit sense="incr">100</rate_limit>
<rate_limit sense="decr">0.5</rate_limit>
</actuator>
<actuator name="/instrumentation/adf[0]/power-supply-bite-timer">
<input>/instrumentation/adf[0]/power-supply</input>
<rate_limit sense="incr">0.5</rate_limit>
<rate_limit sense="decr">100</rate_limit>
</actuator>
<switch name="/instrumentation/adf[0]/power-supply-was-off">
<default value="/instrumentation/adf[0]/power-supply-was-off"/>
<test logic="AND" value="0">
/instrumentation/adf[0]/power-supply-bite-timer eq 1
</test>
<test logic="AND" value="1">
/instrumentation/adf[0]/power-supply-bite-enable eq 0
</test>
</switch>
<switch name="/instrumentation/adf[0]/power-supply-node">
<default value="0"/>
<test logic="OR" value="/systems/electrical/bus/ac-ess-shed">
/instrumentation/adf[0]/power-supply-was-off eq 0
/instrumentation/adf[0]/power-supply-bite-timer eq 1
</test>
</switch>
<switch name="/instrumentation/adf[1]/power-supply">
<default value="0"/>
<test logic="AND" value="1">
/systems/electrical/bus/ac-2 ge 110
</test>
</switch>
<actuator name="/instrumentation/adf[1]/power-supply-bite-enable">
<input>/instrumentation/adf[1]/power-supply</input>
<rate_limit sense="incr">100</rate_limit>
<rate_limit sense="decr">0.5</rate_limit>
</actuator>
<actuator name="/instrumentation/adf[1]/power-supply-bite-timer">
<input>/instrumentation/adf[1]/power-supply</input>
<rate_limit sense="incr">0.5</rate_limit>
<rate_limit sense="decr">100</rate_limit>
</actuator>
<switch name="/instrumentation/adf[1]/power-supply-was-off">
<default value="/instrumentation/adf[1]/power-supply-was-off"/>
<test logic="AND" value="0">
/instrumentation/adf[1]/power-supply-bite-timer eq 1
</test>
<test logic="AND" value="1">
/instrumentation/adf[1]/power-supply-bite-enable eq 0
</test>
</switch>
<switch name="/instrumentation/adf[1]/power-supply-node">
<default value="0"/>
<test logic="OR" value="/systems/electrical/bus/ac-2">
/instrumentation/adf[1]/power-supply-was-off eq 0
/instrumentation/adf[1]/power-supply-bite-timer eq 1
</test>
</switch>
</channel>
<channel name="VOR" execrate="8">
<switch name="/instrumentation/nav[2]/power-supply">
<default value="0"/>
<test logic="AND" value="1">
/systems/electrical/bus/ac-ess ge 110
</test>
</switch>
<actuator name="/instrumentation/nav[2]/power-supply-bite-enable">
<input>/instrumentation/nav[2]/power-supply</input>
<rate_limit sense="incr">100</rate_limit>
<rate_limit sense="decr">0.333</rate_limit>
</actuator>
<actuator name="/instrumentation/nav[2]/power-supply-bite-timer">
<input>/instrumentation/nav[2]/power-supply</input>
<rate_limit sense="incr">0.333</rate_limit>
<rate_limit sense="decr">100</rate_limit>
</actuator>
<switch name="/instrumentation/nav[2]/power-supply-was-off">
<default value="/instrumentation/nav[2]/power-supply-was-off"/>
<test logic="AND" value="0">
/instrumentation/nav[2]/power-supply-bite-timer eq 1
</test>
<test logic="AND" value="1">
/instrumentation/nav[2]/power-supply-bite-enable eq 0
</test>
</switch>
<switch name="/instrumentation/nav[2]/power-supply-node">
<default value="0"/>
<test logic="OR" value="/systems/electrical/bus/ac-ess">
/instrumentation/nav[2]/power-supply-was-off eq 0
/instrumentation/nav[2]/power-supply-bite-timer eq 1
</test>
</switch>
<switch name="/instrumentation/nav[3]/power-supply">
<default value="0"/>
<test logic="AND" value="1">
/systems/electrical/bus/ac-2 ge 110
</test>
</switch>
<actuator name="/instrumentation/nav[3]/power-supply-bite-enable">
<input>/instrumentation/nav[3]/power-supply</input>
<rate_limit sense="incr">100</rate_limit>
<rate_limit sense="decr">0.333</rate_limit>
</actuator>
<actuator name="/instrumentation/nav[3]/power-supply-bite-timer">
<input>/instrumentation/nav[3]/power-supply</input>
<rate_limit sense="incr">0.333</rate_limit>
<rate_limit sense="decr">100</rate_limit>
</actuator>
<switch name="/instrumentation/nav[3]/power-supply-was-off">
<default value="/instrumentation/nav[3]/power-supply-was-off"/>
<test logic="AND" value="0">
/instrumentation/nav[3]/power-supply-bite-timer eq 1
</test>
<test logic="AND" value="1">
/instrumentation/nav[3]/power-supply-bite-enable eq 0
</test>
</switch>
<switch name="/instrumentation/nav[3]/power-supply-node">
<default value="0"/>
<test logic="OR" value="/systems/electrical/bus/ac-2">
/instrumentation/nav[3]/power-supply-was-off eq 0
/instrumentation/nav[3]/power-supply-bite-timer eq 1
</test>
</switch>
</channel>
<channel name="DME" execrate="8">
<switch name="/instrumentation/dme[0]/power-supply">
<default value="0"/>
<test logic="AND" value="1">
/systems/electrical/bus/ac-ess-shed ge 110
</test>
</switch>
<actuator name="/instrumentation/dme[0]/power-supply-bite-enable">
<input>/instrumentation/dme[0]/power-supply</input>
<rate_limit sense="incr">100</rate_limit>
<rate_limit sense="decr">0.5</rate_limit>
</actuator>
<actuator name="/instrumentation/dme[0]/power-supply-bite-timer">
<input>/instrumentation/dme[0]/power-supply</input>
<rate_limit sense="incr">0.5</rate_limit>
<rate_limit sense="decr">100</rate_limit>
</actuator>
<switch name="/instrumentation/dme[0]/power-supply-was-off">
<default value="/instrumentation/dme[0]/power-supply-was-off"/>
<test logic="AND" value="0">
/instrumentation/dme[0]/power-supply-bite-timer eq 1
</test>
<test logic="AND" value="1">
/instrumentation/dme[0]/power-supply-bite-enable eq 0
</test>
</switch>
<switch name="/instrumentation/dme[0]/power-supply-node">
<default value="0"/>
<test logic="OR" value="/systems/electrical/bus/ac-ess-shed">
/instrumentation/dme[0]/power-supply-was-off eq 0
/instrumentation/dme[0]/power-supply-bite-timer eq 1
</test>
</switch>
<switch name="/instrumentation/dme[1]/power-supply">
<default value="0"/>
<test logic="AND" value="1">
/systems/electrical/bus/ac-2 ge 110
</test>
</switch>
<actuator name="/instrumentation/dme[1]/power-supply-bite-enable">
<input>/instrumentation/dme[1]/power-supply</input>
<rate_limit sense="incr">100</rate_limit>
<rate_limit sense="decr">0.5</rate_limit>
</actuator>
<actuator name="/instrumentation/dme[1]/power-supply-bite-timer">
<input>/instrumentation/dme[1]/power-supply</input>
<rate_limit sense="incr">0.5</rate_limit>
<rate_limit sense="decr">100</rate_limit>
</actuator>
<switch name="/instrumentation/dme[1]/power-supply-was-off">
<default value="/instrumentation/dme[1]/power-supply-was-off"/>
<test logic="AND" value="0">
/instrumentation/dme[1]/power-supply-bite-timer eq 1
</test>
<test logic="AND" value="1">
/instrumentation/dme[1]/power-supply-bite-enable eq 0
</test>
</switch>
<switch name="/instrumentation/dme[1]/power-supply-node">
<default value="0"/>
<test logic="OR" value="/systems/electrical/bus/ac-2">
/instrumentation/dme[1]/power-supply-was-off eq 0
/instrumentation/dme[1]/power-supply-bite-timer eq 1
</test>
</switch>
</channel>
<channel name="ACP" execrate="8">
<switch name="/instrumentation/adf[0]/volume-norm">
<default value="0"/>
<test logic="AND" value="/controls/audio/acp[0]/adf1-volume">
/controls/audio/acp[0]/adf1-recive eq 1
<test logic="OR">
/controls/audio/acp[1]/adf1-recive eq 0
/controls/audio/acp[0]/adf1-volume ge /controls/audio/acp[1]/adf1-volume
</test>
</test>
<test logic="AND" value="/controls/audio/acp[1]/adf1-volume">
/controls/audio/acp[1]/adf1-recive eq 1
<test logic="OR">
/controls/audio/acp[0]/adf1-recive eq 0
/controls/audio/acp[0]/adf1-volume lt /controls/audio/acp[1]/adf1-volume
</test>
</test>
</switch>
<switch name="/instrumentation/adf[1]/volume-norm">
<default value="0"/>
<test logic="AND" value="/controls/audio/acp[0]/adf2-volume">
/controls/audio/acp[0]/adf2-recive eq 1
<test logic="OR">
/controls/audio/acp[1]/adf2-recive eq 0
/controls/audio/acp[0]/adf2-volume ge /controls/audio/acp[1]/adf2-volume
</test>
</test>
<test logic="AND" value="/controls/audio/acp[1]/adf2-volume">
/controls/audio/acp[1]/adf2-recive eq 1
<test logic="OR">
/controls/audio/acp[0]/adf2-recive eq 0
/controls/audio/acp[0]/adf2-volume lt /controls/audio/acp[1]/adf2-volume
</test>
</test>
</switch>
<switch name="/instrumentation/marker-beacon/volume">
<default value="0"/>
<test logic="AND" value="/controls/audio/acp[0]/mkr-volume">
/controls/audio/acp[0]/mkr-recive eq 1
<test logic="OR">
/controls/audio/acp[1]/mkr-recive eq 0
/controls/audio/acp[0]/mkr-volume ge /controls/audio/acp[1]/mkr-volume
</test>
</test>
<test logic="AND" value="/controls/audio/acp[1]/mkr-volume">
/controls/audio/acp[1]/mkr-recive eq 1
<test logic="OR">
/controls/audio/acp[0]/mkr-recive eq 0
/controls/audio/acp[0]/mkr-volume lt /controls/audio/acp[1]/mkr-volume
</test>
</test>
</switch>
<switch name="/instrumentation/nav[0]/volume">
<default value="0"/>
<test logic="AND" value="/controls/audio/acp[0]/ils-volume">
/controls/audio/acp[0]/ils-recive eq 1
<test logic="OR">
/controls/audio/acp[1]/ils-recive eq 0
/controls/audio/acp[0]/ils-volume ge /controls/audio/acp[1]/ils-volume
</test>
</test>
<test logic="AND" value="/controls/audio/acp[1]/ils-volume">
/controls/audio/acp[1]/ils-recive eq 1
<test logic="OR">
/controls/audio/acp[0]/ils-recive eq 0
/controls/audio/acp[0]/ils-volume lt /controls/audio/acp[1]/ils-volume
</test>
</test>
</switch>
<switch name="/instrumentation/nav[2]/volume">
<default value="0"/>
<test logic="AND" value="/controls/audio/acp[0]/vor1-volume">
/controls/audio/acp[0]/vor1-recive eq 1
<test logic="OR">
/controls/audio/acp[1]/vor1-recive eq 0
/controls/audio/acp[0]/vor1-volume ge /controls/audio/acp[1]/vor1-volume
</test>
</test>
<test logic="AND" value="/controls/audio/acp[1]/vor1-volume">
/controls/audio/acp[1]/vor1-recive eq 1
<test logic="OR">
/controls/audio/acp[0]/vor1-recive eq 0
/controls/audio/acp[0]/vor1-volume lt /controls/audio/acp[1]/vor1-volume
</test>
</test>
</switch>
<switch name="/instrumentation/nav[3]/volume">
<default value="0"/>
<test logic="AND" value="/controls/audio/acp[0]/vor2-volume">
/controls/audio/acp[0]/vor2-recive eq 1
<test logic="OR">
/controls/audio/acp[1]/vor2-recive eq 0
/controls/audio/acp[0]/vor2-volume ge /controls/audio/acp[1]/vor2-volume
</test>
</test>
<test logic="AND" value="/controls/audio/acp[1]/vor2-volume">
/controls/audio/acp[1]/vor2-recive eq 1
<test logic="OR">
/controls/audio/acp[0]/vor2-recive eq 0
/controls/audio/acp[0]/vor2-volume lt /controls/audio/acp[1]/vor2-volume
</test>
</test>
</switch>
</channel>
<channel name="System Display" execrate="8"> <channel name="System Display" execrate="8">
<switch name="/ECAM/Lower/g-force-display-cmd"> <switch name="/ECAM/Lower/g-force-display-cmd">

View file

@ -9,14 +9,14 @@
<adf> <adf>
<name>adf</name> <name>adf</name>
<number>0</number> <number>0</number>
<power-supply>/systems/electrical/bus/ac-ess-shed</power-supply> <power-supply>/instrumentation/adf[0]/power-supply-node</power-supply>
<minimum-supply-volts>109.9</minimum-supply-volts> <minimum-supply-volts>109.9</minimum-supply-volts>
</adf> </adf>
<adf> <adf>
<name>adf</name> <name>adf</name>
<number>1</number> <number>1</number>
<power-supply>/systems/electrical/bus/ac-2</power-supply> <power-supply>/instrumentation/adf[1]/power-supply-node</power-supply>
<minimum-supply-volts>109.9</minimum-supply-volts> <minimum-supply-volts>109.9</minimum-supply-volts>
</adf> </adf>
@ -126,10 +126,10 @@
<eight-point-three>1</eight-point-three> <eight-point-three>1</eight-point-three>
</comm-radio> </comm-radio>
<dme> <dme> <!-- fake extra dme units for the ILS -->
<name>dme</name> <name>dme</name>
<number>0</number> <number>0</number>
<power-supply>/systems/electrical/bus/ac-ess-shed</power-supply> <power-supply>/systems/electrical/bus/ac-ess</power-supply>
<minimum-supply-volts>109.9</minimum-supply-volts> <minimum-supply-volts>109.9</minimum-supply-volts>
</dme> </dme>
@ -140,17 +140,17 @@
<minimum-supply-volts>109.9</minimum-supply-volts> <minimum-supply-volts>109.9</minimum-supply-volts>
</dme> </dme>
<dme> <!-- fake extra dme units for the ILS --> <dme> <!-- VOR DME -->
<name>dme</name> <name>dme</name>
<number>2</number> <number>2</number>
<power-supply>/systems/electrical/bus/ac-ess</power-supply> <power-supply>/instrumentation/dme[0]/power-supply-node</power-supply>
<minimum-supply-volts>109.9</minimum-supply-volts> <minimum-supply-volts>109.9</minimum-supply-volts>
</dme> </dme>
<dme> <dme>
<name>dme</name> <name>dme</name>
<number>3</number> <number>3</number>
<power-supply>/systems/electrical/bus/ac-2</power-supply> <power-supply>/instrumentation/dme[1]/power-supply-node</power-supply>
<minimum-supply-volts>109.9</minimum-supply-volts> <minimum-supply-volts>109.9</minimum-supply-volts>
</dme> </dme>
@ -181,11 +181,11 @@
<marker-beacon> <!-- part of VOR1 unit --> <marker-beacon> <!-- part of VOR1 unit -->
<name>marker-beacon</name> <name>marker-beacon</name>
<number>0</number> <number>0</number>
<power-supply>/systems/electrical/bus/ac-ess</power-supply> <power-supply>/instrumentation/nav[2]/power-supply-node</power-supply>
<minimum-supply-volts>109.9</minimum-supply-volts> <minimum-supply-volts>109.9</minimum-supply-volts>
</marker-beacon> </marker-beacon>
<nav-radio> <!-- VOR unit --> <nav-radio> <!-- ILS unit -->
<name>nav</name> <name>nav</name>
<number>0</number> <number>0</number>
<power-supply>/systems/electrical/bus/ac-ess</power-supply> <power-supply>/systems/electrical/bus/ac-ess</power-supply>
@ -199,17 +199,17 @@
<minimum-supply-volts>109.9</minimum-supply-volts> <minimum-supply-volts>109.9</minimum-supply-volts>
</nav-radio> </nav-radio>
<nav-radio> <!-- ILS unit --> <nav-radio> <!-- VOR unit -->
<name>nav</name> <name>nav</name>
<number>2</number> <number>2</number>
<power-supply>/systems/electrical/bus/ac-ess</power-supply> <power-supply>/instrumentation/nav[2]/power-supply-node</power-supply>
<minimum-supply-volts>109.9</minimum-supply-volts> <minimum-supply-volts>109.9</minimum-supply-volts>
</nav-radio> </nav-radio>
<nav-radio> <nav-radio>
<name>nav</name> <name>nav</name>
<number>3</number> <number>3</number>
<power-supply>/systems/electrical/bus/ac-2</power-supply> <power-supply>/instrumentation/nav[3]/power-supply-node</power-supply>
<minimum-supply-volts>109.9</minimum-supply-volts> <minimum-supply-volts>109.9</minimum-supply-volts>
</nav-radio> </nav-radio>

View file

@ -909,13 +909,27 @@
<condition> <condition>
<and> <and>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/dc-ess</property> <property>/systems/electrical/bus/ac-ess</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
<equals> <or>
<and>
<property>/systems/navigation/aligned-1</property> <property>/systems/navigation/aligned-1</property>
<value>1</value> <not>
</equals> <!-- TODO ATT HDG SWITCH --> <equals>
<property>/controls/navigation/switching/att-hdg</property>
<value>-1</value>
</equals>
</not>
</and>
<and>
<property>/systems/navigation/aligned-3</property>
<equals>
<property>/controls/navigation/switching/att-hdg</property>
<value>-1</value>
</equals>
</and>
</or>
</and> </and>
</condition> </condition>
</enable> </enable>
@ -950,8 +964,8 @@
<condition> <condition>
<and> <and>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/dc-ess</property> <property>/systems/electrical/bus/ac-ess</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
<equals> <equals>
<property>/instrumentation/ddrmi/vor-adf-1</property> <property>/instrumentation/ddrmi/vor-adf-1</property>
@ -961,10 +975,24 @@
<property>/instrumentation/nav[2]/in-range</property> <property>/instrumentation/nav[2]/in-range</property>
<value>1</value> <value>1</value>
</equals> </equals>
<equals> <or>
<and>
<property>/systems/navigation/aligned-1</property> <property>/systems/navigation/aligned-1</property>
<value>1</value> <not>
<equals>
<property>/controls/navigation/switching/att-hdg</property>
<value>-1</value>
</equals> </equals>
</not>
</and>
<and>
<property>/systems/navigation/aligned-3</property>
<equals>
<property>/controls/navigation/switching/att-hdg</property>
<value>-1</value>
</equals>
</and>
</or>
</and> </and>
</condition> </condition>
<property>/instrumentation/ddrmi/vor-1-error</property> <property>/instrumentation/ddrmi/vor-1-error</property>
@ -974,27 +1002,43 @@
<condition> <condition>
<and> <and>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/dc-ess</property> <property>/systems/electrical/bus/ac-ess</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
<equals> <equals>
<property>/instrumentation/ddrmi/vor-adf-1</property> <property>/instrumentation/ddrmi/vor-adf-1</property>
<value>-1</value> <value>0</value>
</equals> </equals>
<equals> <equals>
<property>/instrumentation/adf[0]/in-range</property> <property>/instrumentation/adf[0]/in-range</property>
<value>1</value> <value>1</value>
</equals> </equals>
<equals> <or>
<and>
<property>/systems/navigation/aligned-1</property> <property>/systems/navigation/aligned-1</property>
<value>1</value> <not>
<equals>
<property>/controls/navigation/switching/att-hdg</property>
<value>-1</value>
</equals> </equals>
</not>
</and>
<and>
<property>/systems/navigation/aligned-3</property>
<equals>
<property>/controls/navigation/switching/att-hdg</property>
<value>-1</value>
</equals>
</and>
</or>
</and> </and>
</condition> </condition>
<property>/instrumentation/adf[0]/indicated-bearing-deg</property> <property>/instrumentation/adf[0]/indicated-bearing-deg</property>
<scale>-1.0</scale> <scale>-1.0</scale>
</input> </input>
<input>-90</input> <input>
<property>/instrumentation/ddrmi/needle-1</property>
</input>
<output>/instrumentation/ddrmi/needle-1</output> <output>/instrumentation/ddrmi/needle-1</output>
</filter> </filter>
@ -1025,8 +1069,8 @@
<condition> <condition>
<and> <and>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/dc-ess</property> <property>/systems/electrical/bus/ac-ess</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
<equals> <equals>
<property>/instrumentation/ddrmi/vor-adf-2</property> <property>/instrumentation/ddrmi/vor-adf-2</property>
@ -1036,10 +1080,24 @@
<property>/instrumentation/nav[3]/in-range</property> <property>/instrumentation/nav[3]/in-range</property>
<value>1</value> <value>1</value>
</equals> </equals>
<equals> <or>
<and>
<property>/systems/navigation/aligned-1</property> <property>/systems/navigation/aligned-1</property>
<value>1</value> <not>
<equals>
<property>/controls/navigation/switching/att-hdg</property>
<value>-1</value>
</equals> </equals>
</not>
</and>
<and>
<property>/systems/navigation/aligned-3</property>
<equals>
<property>/controls/navigation/switching/att-hdg</property>
<value>-1</value>
</equals>
</and>
</or>
</and> </and>
</condition> </condition>
<property>/instrumentation/ddrmi/vor-2-error</property> <property>/instrumentation/ddrmi/vor-2-error</property>
@ -1049,27 +1107,43 @@
<condition> <condition>
<and> <and>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/dc-ess</property> <property>/systems/electrical/bus/ac-ess</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
<equals> <equals>
<property>/instrumentation/ddrmi/vor-adf-2</property> <property>/instrumentation/ddrmi/vor-adf-2</property>
<value>-1</value> <value>0</value>
</equals> </equals>
<equals> <equals>
<property>/instrumentation/adf[1]/in-range</property> <property>/instrumentation/adf[1]/in-range</property>
<value>1</value> <value>1</value>
</equals> </equals>
<equals> <or>
<and>
<property>/systems/navigation/aligned-1</property> <property>/systems/navigation/aligned-1</property>
<value>1</value> <not>
<equals>
<property>/controls/navigation/switching/att-hdg</property>
<value>-1</value>
</equals> </equals>
</not>
</and>
<and>
<property>/systems/navigation/aligned-3</property>
<equals>
<property>/controls/navigation/switching/att-hdg</property>
<value>-1</value>
</equals>
</and>
</or>
</and> </and>
</condition> </condition>
<property>/instrumentation/adf[1]/indicated-bearing-deg</property> <property>/instrumentation/adf[1]/indicated-bearing-deg</property>
<scale>-1.0</scale> <scale>-1.0</scale>
</input> </input>
<input>-90</input> <input>
<property>/instrumentation/ddrmi/needle-2</property>
</input>
<output>/instrumentation/ddrmi/needle-2</output> <output>/instrumentation/ddrmi/needle-2</output>
</filter> </filter>
@ -1081,13 +1155,27 @@
<condition> <condition>
<and> <and>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/dc-ess</property> <property>/systems/electrical/bus/ac-ess</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
<equals> <or>
<and>
<property>/systems/navigation/aligned-1</property> <property>/systems/navigation/aligned-1</property>
<value>1</value> <not>
<equals>
<property>/controls/navigation/switching/att-hdg</property>
<value>-1</value>
</equals> </equals>
</not>
</and>
<and>
<property>/systems/navigation/aligned-3</property>
<equals>
<property>/controls/navigation/switching/att-hdg</property>
<value>-1</value>
</equals>
</and>
</or>
<or> <or>
<and> <and>
<equals> <equals>
@ -1102,7 +1190,7 @@
<and> <and>
<equals> <equals>
<property>/instrumentation/ddrmi/vor-adf-1</property> <property>/instrumentation/ddrmi/vor-adf-1</property>
<value>-1</value> <value>0</value>
</equals> </equals>
<equals> <equals>
<property>/instrumentation/adf[0]/in-range</property> <property>/instrumentation/adf[0]/in-range</property>
@ -1127,13 +1215,27 @@
<condition> <condition>
<and> <and>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/dc-ess</property> <property>/systems/electrical/bus/ac-ess</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
<equals> <or>
<and>
<property>/systems/navigation/aligned-1</property> <property>/systems/navigation/aligned-1</property>
<value>1</value> <not>
<equals>
<property>/controls/navigation/switching/att-hdg</property>
<value>-1</value>
</equals> </equals>
</not>
</and>
<and>
<property>/systems/navigation/aligned-3</property>
<equals>
<property>/controls/navigation/switching/att-hdg</property>
<value>-1</value>
</equals>
</and>
</or>
<or> <or>
<and> <and>
<equals> <equals>
@ -1148,7 +1250,7 @@
<and> <and>
<equals> <equals>
<property>/instrumentation/ddrmi/vor-adf-2</property> <property>/instrumentation/ddrmi/vor-adf-2</property>
<value>-1</value> <value>0</value>
</equals> </equals>
<equals> <equals>
<property>/instrumentation/adf[1]/in-range</property> <property>/instrumentation/adf[1]/in-range</property>

View file

@ -0,0 +1,342 @@
<!DOCTYPE html>
<html lang="en" translate="no">
<head>
<title>A320 MCDU</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="manifest" href="mcdu_manifest.json" />
<meta name="apple-mobile-web-app-status-bar" content="#db4938" />
<meta name="theme-color" content="#db4938" />
<script>
let screen;
let screen_src;
let blank_src;
let loading = 0;
let scheduled_load = 0;
function refresh_screen(force) {
if (loading && !force) {
scheduled_load = 1;
}
else {
loading = 1;
screen.src = screen_src + '&random=' + (new Date).getTime()
}
}
function press_button(type, text) {
let request = new XMLHttpRequest;
request.open(
"POST",
window.location.protocol + "//" + window.location.host + "/run.cgi?value=nasal"
);
request.setRequestHeader("Content-Type", "application/json");
let body = JSON.stringify({
"name": "",
"children": [
{
"name": "script",
"index": 0,
"value": "mcdu." + type + "(\"" + text + "\", 0);"
}
]
});
request.send(body);
request.addEventListener('load', function () {
refresh_screen();
}, true);
}
var preventzoomaction = function(e) { //https://exceptionshub.com/disable-double-tap-zoom-option-in-browser-on-touch-devices.html
var t2 = e.timeStamp;
var t1 = e.currentTarget.dataset.lastTouch || t2;
var dt = t2 - t1;
var fingers = e.touches.length;
e.currentTarget.dataset.lastTouch = t2;
if (!dt || dt > 500 || fingers > 1) return; // not double-tap
e.preventDefault();
e.target.click();
};
window.addEventListener('load', function () {
let tds = document.querySelectorAll('.input td');
for (const td of tds) {
td.addEventListener('click', function () {
if (td.className == "disabled") return;
press_button("button", td.textContent);
}, true);
td.addEventListener('touchstart', preventzoomaction, true);
}
tds = document.querySelectorAll('.enter td');
for (const td of tds) {
td.addEventListener('click', function () {
press_button(td.getAttribute("button-side") == "l" ? "lskbutton" : "rskbutton", td.getAttribute("button-id"));
}, true);
td.addEventListener('touchstart', preventzoomaction, true);
}
tds = document.querySelectorAll('.menu td');
for (const td of tds) {
td.addEventListener('click', function () {
press_button("pagebutton", td.className);
}, true);
td.addEventListener('touchstart', preventzoomaction, true);
}
tds = document.querySelectorAll('.arrows td');
for (const td of tds) {
td.addEventListener('click', function () {
press_button(td.className == 'airport' ? "pagebutton" : "arrowbutton", td.className);
}, true);
td.addEventListener('touchstart', preventzoomaction, true);
}
screen = document.querySelector('img');
screen.addEventListener('load', function () {
loading = 0;
if (scheduled_load) {
scheduled_load = 0;
refresh_screen();
}
});
blank_src = screen_src;
screen_src = "/screenshot?canvasindex=10&type=png";
screen.addEventListener('error', function () {
loading = 0;
if (scheduled_load) {
refresh_screen();
}
});
screen.addEventListener('abort', function () {
loading = 0;
if (scheduled_load) {
refresh_screen();
}
});
setInterval(function () { refresh_screen(true); }, 1000);
}, true);
</script>
<style>
body {
font-size: 5rem;
margin: 0;
padding: 0;
background-color: black;
color: white;
font-family: sans-serif;
}
table {
margin: 0;
padding: 0;
word-wrap: normal;
overflow-wrap: normal;
}
tr {
margin: 0;
padding: 0;
}
td {
margin: 0;
padding: 0;
text-align: center;
outline: 1px solid gray;
-ms-user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
-webkit-touch-callout: none;
-khtml-user-select: none;
user-select: none;
overflow: hidden;
text-overflow: clip;
}
td:active {
background-color: white;
color: black;
}
.enter {
font-size: 60%;
}
.enter tr:first-child {
font-size: 70%;
}
.enter tr:last-child {
font-size: 50%;
}
.enter td:first-child,
.enter td:last-child {
padding: 0 0.55em;
}
.menu,
.arrows .airport {
font-size: 40%;
line-height: 1em;
}
.menu td {
height: 2.5em;
}
.arrows td {
width: 50%;
padding: 0;
font-size: 60%;
}
img {
display: block;
}
</style>
</head>
<body style="width: 100%" oncontextmenu="return false;">
<table class="enter" style="width: 100%">
<tr>
<td><br></td>
<td rowspan="8" style="vertical-align: top"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABAAAAANgAQMAAACIgIgUAAAAA1BMVEUAAACnej3aAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAgklEQVR42u3BAQEAAACCIP+vbkhAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7wazbwABRxu5owAAAABJRU5ErkJggg=="
style="width: 100%" /></td>
<td><br></td>
</tr>
<tr>
<td button-id="1" button-side="l"></td>
<td button-id="1" button-side="r"></td>
</tr>
<tr>
<td button-id="2" button-side="l"></td>
<td button-id="2" button-side="r"></td>
</tr>
<tr>
<td button-id="3" button-side="l"></td>
<td button-id="3" button-side="r"></td>
</tr>
<tr>
<td button-id="4" button-side="l"></td>
<td button-id="4" button-side="r"></td>
</tr>
<tr>
<td button-id="5" button-side="l"></td>
<td button-id="5" button-side="r"></td>
</tr>
<tr>
<td button-id="6" button-side="l"></td>
<td button-id="6" button-side="r"></td>
</tr>
<tr>
<td><br></td>
<td><br></td>
</tr>
</table>
<table class="menu" style="width: 100%">
<tr>
<td class="dirto">DIR</td>
<td class="prog">PROG</td>
<td class="perf">PERF</td>
<td class="init">INIT</td>
<td class="data">DATA</td>
<td></td>
<td>BRT</td>
</tr>
<tr>
<td class="f-pln">F-PLN</td>
<td class="radnav">RAD<br>NAV</td>
<td class="fuel-pred">FUEL<br>PRED</td>
<td>SEC<br>F-PLN</td>
<td class="atc">ATC<br>COMM</td>
<td class="mcdu">MCDU<br>MENU</td>
<td>DIM</td>
</tr>
</table>
<table class="input" style="float: right; width: 62.5%">
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
<td>D</td>
<td>E</td>
</tr>
<tr>
<td>F</td>
<td>G</td>
<td>H</td>
<td>I</td>
<td>J</td>
</tr>
<tr>
<td>K</td>
<td>L</td>
<td>M</td>
<td>N</td>
<td>O</td>
</tr>
<tr>
<td>P</td>
<td>Q</td>
<td>R</td>
<td>S</td>
<td>T</td>
</tr>
<tr>
<td>U</td>
<td>V</td>
<td>W</td>
<td>X</td>
<td>Y</td>
</tr>
<tr>
<td>Z</td>
<td>/</td>
<td style="font-size: 50%">SP</td>
<td style="font-size: 33%" class="disabled">OVFY<br></td>
<td style="font-size: 33%">CLR</td>
</tr>
</table>
<table class="arrows" style="width: 29.5%">
<tr>
<td class="airport">AIR<br>PORT</td>
<td></td>
</tr>
<tr>
<td class="left"></td>
<td class="up"></td>
</tr>
<tr>
<td class="right"></td>
<td class="down"></td>
</tr>
</table>
<table class="input" style="width: 30%">
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>4</td>
<td>5</td>
<td>6</td>
</tr>
<tr>
<td>7</td>
<td>8</td>
<td>9</td>
</tr>
<tr>
<td>.</td>
<td>0</td>
<td
style="font-size: 3vw; width: 33.333333333333333333333333333333333333333333333333333333333333333333333%; /* :) */" class="disabled">
+/-
</td>
</tr>
</table>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

View file

@ -0,0 +1,281 @@
* {
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-text-size-adjust: none;
text-size-adjust: none;
-webkit-user-select: none;
user-select: none;
}
html, body {
overscroll-behavior-y: none;
position: fixed;
overflow: hidden;
}
body {
width: calc(100vw - 2px);
height: calc(100vh - 2px);
margin-left: 1px;
overflow: hidden;
background-color: #000;
}
.mcdu {
width: 100vw;
height: calc(100vw / .6);
max-height: 100vh;
max-width: calc(100vh * .6);
position: absolute;
margin: auto;
top: 0;
left: 0;
right: 0;
}
.mcdu_case {
display: block;
width: 100%;
height: auto;
}
.mcdu-glass {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
overflow: hidden;
}
.mcdu-glass--dust {
display: none;
position: absolute;
top: 6%;
left: 13%;
width: 73.5%;
opacity: 0.5;
transform: scale(1, -1);
filter: blur(0.1vh);
}
[data-used-universe="1"] .mcdu-glass--dust {
display: inline-block;
}
.screen-img,
.screen-glow {
position: absolute;
top: 7.5%;
left: 13.4%;
width: 72.8%;
}
.screen-glow {
display: none;
}
[data-used-universe="1"] .screen-glow {
display: inline-block;
filter: brightness(50) blur(0.2vh);
opacity: 0.15;
}
.mcdu-fg {
position: absolute;
top: 0.3%;
left: 0;
width: 100%;
height: 100%;
}
[data-button] {
position: absolute;
cursor: pointer;
}
[data-showbuttons="1"] [data-button] {
background-color: red;
opacity: 0.5;
}
.glassbutton {
top: 6%;
left: 13%;
width: 73.5%;
height: 40%
}
.skbutton {
width: 7.7%;
height: 3.3%;
border-radius: 0.2vh;
}
.menubutton {
width: 9.8%;
height: 4%;
border-radius: 0.2vh;
}
.numberbutton {
width: 7.5%;
padding-bottom: 7.5%;
border-radius: 50%;
}
.alphabutton {
width: 7.4%;
padding-bottom: 7.4%;
border-radius: 0.2vh;
}
.skbuttons-left .skbutton {
left: 1.6%;
}
.skbuttons-right .skbutton {
right: 2.1%;
}
.sk-1 {
top: 12.3%;
}
.sk-2 {
top: 17.34%;
}
.sk-3 {
top: 22.4%;
}
.sk-4 {
top: 27.4%;
}
.sk-5 {
top: 32.5%;
}
.sk-6 {
top: 37.6%;
}
.menu-row1 .menubutton {
top: 48.2%;
}
.menu-row2 .menubutton {
top: 53.04%;
}
.menu-row3 .menubutton {
top: 57.9%;
}
.menu-row4 .menubutton {
top: 62.8%;
}
.menu-row5 .menubutton {
top: 67.6%;
}
.menu-col1 {
left: 11.3%;
}
.menu-col2 {
left: 23.2%;
}
.menu-col3 {
left: 35.1%;
}
.menu-col4 {
left: 47%;
}
.menu-col5 {
left: 59%;
}
.menu-col6 {
left: 70.95%;
}
.number-row1 .numberbutton {
top: 73.9%;
}
.number-row2 .numberbutton {
top: 79.6%;
}
.number-row3 .numberbutton {
top: 85.3%;
}
.number-row4 .numberbutton {
top: 91%;
}
.number-col1 {
left: 11.5%;
}
.number-col2 {
left: 21.1%;
}
.number-col3 {
left: 30.6%;
}
.alphabutton-row1 .alphabutton {
top: 59.5%;
}
.alphabutton-row2 .alphabutton {
top: 65.8%;
}
.alphabutton-row3 .alphabutton {
top: 72.1%;
}
.alphabutton-row4 .alphabutton {
top: 78.4%;
}
.alphabutton-row5 .alphabutton {
top: 84.8%;
}
.alphabutton-row6 .alphabutton {
top: 91.1%;
}
.alphabutton-col1 {
left: 40.6%;
}
.alphabutton-col2 {
left: 50.7%;
}
.alphabutton-col3 {
left: 60.7%;
}
.alphabutton-col4 {
left: 70.7%;
}
.alphabutton-col5 {
left: 80.7%;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 773 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

View file

@ -0,0 +1,146 @@
<!DOCTYPE html>
<html>
<head>
<title>A320 MCDU</title>
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar" content="#333333" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="css/mcdu.css" />
</head>
<body data-used-universe="1" data-showbuttons="0">
<div class="mcdu">
<img src="img/mcdu-bg.png" class="mcdu_case" />
<div class="mcdu-glass">
<img src="" data-element="lcdimage" class="screen-img" />
<img src="" data-element="lcdimage" class="screen-glow" />
<img src="img/dust2.png" class="mcdu-glass--dust" />
</div>
<div class="mcdu-fg">
<div class="skbuttons-left">
<div data-button="lskbutton:1" class="skbutton sk-1"></div>
<div data-button="lskbutton:2" class="skbutton sk-2"></div>
<div data-button="lskbutton:3" class="skbutton sk-3"></div>
<div data-button="lskbutton:4" class="skbutton sk-4"></div>
<div data-button="lskbutton:5" class="skbutton sk-5"></div>
<div data-button="lskbutton:6" class="skbutton sk-6"></div>
</div>
<div class="skbuttons-right">
<div data-button="rskbutton:1" class="skbutton sk-1"></div>
<div data-button="rskbutton:2" class="skbutton sk-2"></div>
<div data-button="rskbutton:3" class="skbutton sk-3"></div>
<div data-button="rskbutton:4" class="skbutton sk-4"></div>
<div data-button="rskbutton:5" class="skbutton sk-5"></div>
<div data-button="rskbutton:6" class="skbutton sk-6"></div>
</div>
<div class="menu-row1">
<div data-button="pagebutton:dirto" class="menubutton menu-col1"></div>
<div data-button="pagebutton:prog" class="menubutton menu-col2"></div>
<div data-button="pagebutton:perf" class="menubutton menu-col3"></div>
<div data-button="pagebutton:init" class="menubutton menu-col4"></div>
<div data-button="pagebutton:data" class="menubutton menu-col5"></div>
</div>
<div class="menu-row2">
<div data-button="pagebutton:f-pln" class="menubutton menu-col1"></div>
<div data-button="pagebutton:radnav" class="menubutton menu-col2"></div>
<div data-button="pagebutton:fuel-pred" class="menubutton menu-col3"></div>
<div data-button="" class="menubutton menu-col4"></div>
<div data-button="pagebutton:atc" class="menubutton menu-col5"></div>
<div data-button="pagebutton:mcdu" class="menubutton menu-col6"></div>
</div>
<div class="menu-row3">
<div data-button="pagebutton:airport" class="menubutton menu-col1"></div>
</div>
<div class="menu-row4">
<div data-button="arrowbutton:left" class="menubutton menu-col1"></div>
<div data-button="arrowbutton:up" class="menubutton menu-col2"></div>
</div>
<div class="menu-row5">
<div data-button="arrowbutton:right" class="menubutton menu-row5 menu-col1"></div>
<div data-button="arrowbutton:down" class="menubutton menu-row5 menu-col2"></div>
</div>
<div class="number-row1">
<div data-button="button:1" class="numberbutton number-col1"></div>
<div data-button="button:2" class="numberbutton number-col2"></div>
<div data-button="button:3" class="numberbutton number-col3"></div>
</div>
<div class="number-row2">
<div data-button="button:4" class="numberbutton number-col1"></div>
<div data-button="button:5" class="numberbutton number-col2"></div>
<div data-button="button:6" class="numberbutton number-col3"></div>
</div>
<div class="number-row3">
<div data-button="button:7" class="numberbutton number-col1"></div>
<div data-button="button:8" class="numberbutton number-col2"></div>
<div data-button="button:9" class="numberbutton number-col3"></div>
</div>
<div class="number-row4">
<div data-button="button:." class="numberbutton number-col1"></div>
<div data-button="button:0" class="numberbutton number-col2"></div>
<div data-button="button:-" class="numberbutton number-col3"></div>
</div>
<div class="alphabutton-row1">
<div data-button="button:A" class="alphabutton alphabutton-col1"></div>
<div data-button="button:B" class="alphabutton alphabutton-col2"></div>
<div data-button="button:C" class="alphabutton alphabutton-col3"></div>
<div data-button="button:D" class="alphabutton alphabutton-col4"></div>
<div data-button="button:E" class="alphabutton alphabutton-col5"></div>
</div>
<div class="alphabutton-row2">
<div data-button="button:F" class="alphabutton alphabutton-col1"></div>
<div data-button="button:G" class="alphabutton alphabutton-col2"></div>
<div data-button="button:H" class="alphabutton alphabutton-col3"></div>
<div data-button="button:I" class="alphabutton alphabutton-col4"></div>
<div data-button="button:J" class="alphabutton alphabutton-col5"></div>
</div>
<div class="alphabutton-row3">
<div data-button="button:K" class="alphabutton alphabutton-col1"></div>
<div data-button="button:L" class="alphabutton alphabutton-col2"></div>
<div data-button="button:M" class="alphabutton alphabutton-col3"></div>
<div data-button="button:N" class="alphabutton alphabutton-col4"></div>
<div data-button="button:O" class="alphabutton alphabutton-col5"></div>
</div>
<div class="alphabutton-row4">
<div data-button="button:P" class="alphabutton alphabutton-col1"></div>
<div data-button="button:Q" class="alphabutton alphabutton-col2"></div>
<div data-button="button:R" class="alphabutton alphabutton-col3"></div>
<div data-button="button:S" class="alphabutton alphabutton-col4"></div>
<div data-button="button:T" class="alphabutton alphabutton-col5"></div>
</div>
<div class="alphabutton-row5">
<div data-button="button:U" class="alphabutton alphabutton-col1"></div>
<div data-button="button:V" class="alphabutton alphabutton-col2"></div>
<div data-button="button:W" class="alphabutton alphabutton-col3"></div>
<div data-button="button:X" class="alphabutton alphabutton-col4"></div>
<div data-button="button:Y" class="alphabutton alphabutton-col5"></div>
</div>
<div class="alphabutton-row6">
<div data-button="button:Z" class="alphabutton alphabutton-col1"></div>
<div data-button="button:/" class="alphabutton alphabutton-col2"></div>
<div data-button="button:SP" class="alphabutton alphabutton-col3"></div>
<div data-button="button:OVFY" class="alphabutton alphabutton-col4"></div>
<div data-button="button:CLR" class="alphabutton alphabutton-col5"></div>
</div>
<div data-button="toggleUsedUniverse" class="glassbutton">
</div>
</div>
</div>
<script src="js/mcdu.js">
</script>
</body>
</html>

View file

@ -0,0 +1,185 @@
const MCDU = (function () {
const screenImageBaseUrl = '/screenshot?canvasindex=10&type=jpg';
const refreshInterval = 2000;
const body = document.body;
let currentCacheBust = 0;
let lastSentText = '';
init();
return {
toggleUsedUniverse
}
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
function init()
{
body.dataset.lastTouch = 0;
body.addEventListener('touchstart', preventZoomAction, { passive: false });
registerButtons();
registerKeyboardInput();
setInterval(refreshScreen, refreshInterval);
refreshScreen();
}
function refreshScreen() {
loadScreenImage(screenImageBaseUrl)
.then(setScreenSrc)
.catch(setScreenSrc);
}
function setScreenSrc(url) {
url = typeof url === 'string' ? url : '';
showScreenImageLoadState(url !== '');
document.querySelectorAll('[data-element="lcdimage"]').forEach((imageElement) => {
imageElement.src = url;
});
}
function loadScreenImage(baseUrl) {
currentCacheBust = new Date().getTime();
return new Promise((resolve, reject) => {
const url = baseUrl + '?cacheBust=' + currentCacheBust;
const img = new Image;
img.addEventListener('error', reject);
img.addEventListener('load', (event) => {
showScreenImageLoadState(true);
resolve(url);
});
img.src = url;
});
}
function showScreenImageLoadState(isOK) {
if (!isOK) {
console.log('fail');
}
}
function toggleUsedUniverse() {
body.setAttribute('data-used-universe', body.getAttribute('data-used-universe') === '1' ? '0' : '1');
}
function registerButtons() {
document.querySelectorAll('[data-button]').forEach((buttonElement) => {
const buttonFunction = getButtonFunction(buttonElement);
if (!(typeof buttonFunction === 'function')) {
return;
}
buttonElement.addEventListener('click', buttonFunction);
buttonElement.addEventListener('touchstart', preventZoomAction, true);
});
}
function registerKeyboardInput() {
const keyTranslation = {
BACKSPACE: 'CLR'
};
body.addEventListener('keyup', (event) => {
const key = event.key.toUpperCase();
if (key.match(/^[A-Z0-9/\-+.\ ]$/)) {
if (key === '+' || key === '-') {
return sendPlusMinusKey();
}
return sendButtonpress('button', key);
}
const translatedKey = keyTranslation[key];
if (translatedKey) {
return sendButtonpress('button', translatedKey);
}
});
}
function getButtonFunction(buttonElement) {
const buttonActions = buttonElement.getAttribute('data-button').split(':');
const actionKey = buttonActions[0];
const actionValue = buttonActions[1];
if(!actionKey) {
return;
}
if (actionKey === 'toggleUsedUniverse') {
return toggleUsedUniverse;
}
if (actionKey === 'button' && actionValue === '-') {
return sendPlusMinusKey;
}
return function () {
sendButtonpress(actionKey, actionValue);
};
}
function sendPlusMinusKey() {
if (lastSentText === '-') {
sendButtonpress('button', 'CLR')
.then(() => {
sendButtonpress('button', '+');
})
return;
}
if (lastSentText === '+') {
sendButtonpress('button', 'CLR')
.then(() => {
sendButtonpress('button', '-');
})
return;
}
sendButtonpress('button', '-');
}
function sendButtonpress(type, text) {
// console.log({ type, text });
let request = new XMLHttpRequest;
request.open("POST", "/run.cgi?value=nasal");
request.setRequestHeader("Content-Type", "application/json");
let body = JSON.stringify({
"name": "",
"children": [
{
"name": "script",
"index": 0,
"value": "mcdu." + type + "(\"" + text + "\", 0);"
}
]
});
request.send(body);
return new Promise((resolve) => {
request.addEventListener('load', () => {
lastSentText = text;
refreshScreen();
resolve();
}, true);
});
}
//https://exceptionshub.com/disable-double-tap-zoom-option-in-browser-on-touch-devices.html
function preventZoomAction(event) {
const t2 = event.timeStamp;
const touchedElement = event.currentTarget;
const t1 = touchedElement.dataset.lastTouch || t2;
const dt = t2 - t1;
const fingers = event.touches.length;
touchedElement.dataset.lastTouch = t2;
if (!dt || dt > 500 || fingers > 1) {
// no double-tap
return;
}
event.preventDefault();
event.target.click();
}
})();

View file

@ -1,342 +1,116 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en" translate="no"> <html>
<head> <head>
<title>A320 MCDU</title> <title>A320 MCDU</title>
<meta charset="utf-8"> <meta name="mobile-web-app-capable" content="yes">
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> <meta name="apple-mobile-web-app-capable" content="yes">
<link rel="manifest" href="mcdu_manifest.json" /> <meta name="apple-mobile-web-app-status-bar" content="#333333" />
<meta name="apple-mobile-web-app-status-bar" content="#db4938" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
<meta name="theme-color" content="#db4938" />
<script>
let screen;
let screen_src;
let blank_src;
let loading = 0;
let scheduled_load = 0;
function refresh_screen(force) {
if (loading && !force) {
scheduled_load = 1;
}
else {
loading = 1;
screen.src = screen_src + '&random=' + (new Date).getTime()
}
}
function press_button(type, text) {
let request = new XMLHttpRequest;
request.open(
"POST",
window.location.protocol + "//" + window.location.host + "/run.cgi?value=nasal"
);
request.setRequestHeader("Content-Type", "application/json");
let body = JSON.stringify({
"name": "",
"children": [
{
"name": "script",
"index": 0,
"value": "mcdu." + type + "(\"" + text + "\", 0);"
}
]
});
request.send(body);
request.addEventListener('load', function () {
refresh_screen();
}, true);
}
var preventzoomaction = function(e) { //https://exceptionshub.com/disable-double-tap-zoom-option-in-browser-on-touch-devices.html
var t2 = e.timeStamp;
var t1 = e.currentTarget.dataset.lastTouch || t2;
var dt = t2 - t1;
var fingers = e.touches.length;
e.currentTarget.dataset.lastTouch = t2;
if (!dt || dt > 500 || fingers > 1) return; // not double-tap
e.preventDefault();
e.target.click();
};
window.addEventListener('load', function () {
let tds = document.querySelectorAll('.input td');
for (const td of tds) {
td.addEventListener('click', function () {
if (td.className == "disabled") return;
press_button("button", td.textContent);
}, true);
td.addEventListener('touchstart', preventzoomaction, true);
}
tds = document.querySelectorAll('.enter td');
for (const td of tds) {
td.addEventListener('click', function () {
press_button(td.getAttribute("button-side") == "l" ? "lskbutton" : "rskbutton", td.getAttribute("button-id"));
}, true);
td.addEventListener('touchstart', preventzoomaction, true);
}
tds = document.querySelectorAll('.menu td');
for (const td of tds) {
td.addEventListener('click', function () {
press_button("pagebutton", td.className);
}, true);
td.addEventListener('touchstart', preventzoomaction, true);
}
tds = document.querySelectorAll('.arrows td');
for (const td of tds) {
td.addEventListener('click', function () {
press_button(td.className == 'airport' ? "pagebutton" : "arrowbutton", td.className);
}, true);
td.addEventListener('touchstart', preventzoomaction, true);
}
screen = document.querySelector('img');
screen.addEventListener('load', function () {
loading = 0;
if (scheduled_load) {
scheduled_load = 0;
refresh_screen();
}
});
blank_src = screen_src;
screen_src = "/screenshot?canvasindex=10&type=png";
screen.addEventListener('error', function () {
loading = 0;
if (scheduled_load) {
refresh_screen();
}
});
screen.addEventListener('abort', function () {
loading = 0;
if (scheduled_load) {
refresh_screen();
}
});
setInterval(function () { refresh_screen(true); }, 1000);
}, true);
</script>
<style> <style>
* {
font-family: Helvetica, 'Segoe UI';
}
html,
body { body {
font-size: 5rem; background-color: #005670;
margin: 0;
padding: 0;
background-color: black;
color: white;
font-family: sans-serif;
}
table {
margin: 0;
padding: 0;
word-wrap: normal;
overflow-wrap: normal;
}
tr {
margin: 0;
padding: 0;
}
td {
margin: 0;
padding: 0;
text-align: center; text-align: center;
outline: 1px solid gray; color: #e4e4e4;
-ms-user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
-webkit-touch-callout: none;
-khtml-user-select: none;
user-select: none;
overflow: hidden;
text-overflow: clip;
} }
td:active { body {
background-color: white; height: 100vh;
color: black; width: 100vw;
color: #8db9ca;
} }
.enter { h1 {
font-size: 60%; font-size: 3rem;
margin: 0;
} }
.enter tr:first-child { h2 {
font-size: 70%; font-size: 1.5rem;
margin: 0;
} }
.enter tr:last-child {
font-size: 50%; .content {
position: relative;
margin-top: 5rem;
} }
.enter td:first-child, .chooser {
.enter td:last-child { width: 100%;
padding: 0 0.55em; height: 100%;
max-width: 86vh;
position: absolute;
top: 0;
left: 0;
right: 0;
margin: auto;
} }
.menu, .choice {
.arrows .airport { display: inline-block;
font-size: 40%; position: relative;
width: calc(49% - 2vw);
padding: 1vh 1vw 75% 1vw;
color: inherit;
text-decoration: none;
border: 1px solid transparent;
margin-bottom: 3rem;
}
.choice:hover .button {
transform: scale(1.2);
}
.choice img {
position: absolute;
top: 0;
left: 0;
right: 0;
margin: auto;
max-height: 100%;
border-radius: 8px;
box-shadow: 4px 4px 6px #00000063;
}
.choice .button {
position: relative;
top: -3rem;
line-height: 1em; line-height: 1em;
} background-color: #74d2e7;
color: #333;
.menu td { padding: 0.5em 1em;
height: 2.5em; border-radius: 3px;
} box-shadow: 2px 2px 5px #00000063;
display: inline-block;
.arrows td {
width: 50%;
padding: 0;
font-size: 60%;
}
img {
display: block;
} }
</style> </style>
</head> </head>
<body style="width: 100%" oncontextmenu="return false;"> <body>
<table class="enter" style="width: 100%"> <h1>Web MCDU</h1>
<tr> <h2>Please choose:</h2>
<td><br></td> <div class="content">
<td rowspan="8" style="vertical-align: top"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABAAAAANgAQMAAACIgIgUAAAAA1BMVEUAAACnej3aAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAgklEQVR42u3BAQEAAACCIP+vbkhAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7wazbwABRxu5owAAAABJRU5ErkJggg==" <div class="chooser">
style="width: 100%" /></td> <a href="WebPanel1/index.html" class="choice choice--1">
<td><br></td> <span class="button">
</tr> abstract
<tr> </span>
<td button-id="1" button-side="l"></td> <img src="WebPanel1/screenshot.jpg">
<td button-id="1" button-side="r"></td> </a>
</tr> <a href="WebPanel2/index.html" class="choice choice--2">
<tr> <span class="button">
<td button-id="2" button-side="l"></td> realistic
<td button-id="2" button-side="r"></td> </span>
</tr> <img src="WebPanel2/img/screenshot.jpg">
<tr> </a>
<td button-id="3" button-side="l"></td> </div>
<td button-id="3" button-side="r"></td> </div>
</tr>
<tr>
<td button-id="4" button-side="l"></td>
<td button-id="4" button-side="r"></td>
</tr>
<tr>
<td button-id="5" button-side="l"></td>
<td button-id="5" button-side="r"></td>
</tr>
<tr>
<td button-id="6" button-side="l"></td>
<td button-id="6" button-side="r"></td>
</tr>
<tr>
<td><br></td>
<td><br></td>
</tr>
</table>
<table class="menu" style="width: 100%">
<tr>
<td class="dirto">DIR</td>
<td class="prog">PROG</td>
<td class="perf">PERF</td>
<td class="init">INIT</td>
<td class="data">DATA</td>
<td></td>
<td>BRT</td>
</tr>
<tr>
<td class="f-pln">F-PLN</td>
<td class="radnav">RAD<br>NAV</td>
<td class="fuel-pred">FUEL<br>PRED</td>
<td>SEC<br>F-PLN</td>
<td class="atc">ATC<br>COMM</td>
<td class="mcdu">MCDU<br>MENU</td>
<td>DIM</td>
</tr>
</table>
<table class="input" style="float: right; width: 62.5%">
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
<td>D</td>
<td>E</td>
</tr>
<tr>
<td>F</td>
<td>G</td>
<td>H</td>
<td>I</td>
<td>J</td>
</tr>
<tr>
<td>K</td>
<td>L</td>
<td>M</td>
<td>N</td>
<td>O</td>
</tr>
<tr>
<td>P</td>
<td>Q</td>
<td>R</td>
<td>S</td>
<td>T</td>
</tr>
<tr>
<td>U</td>
<td>V</td>
<td>W</td>
<td>X</td>
<td>Y</td>
</tr>
<tr>
<td>Z</td>
<td>/</td>
<td style="font-size: 50%">SP</td>
<td style="font-size: 33%" class="disabled">OVFY<br></td>
<td style="font-size: 33%">CLR</td>
</tr>
</table>
<table class="arrows" style="width: 29.5%">
<tr>
<td class="airport">AIR<br>PORT</td>
<td></td>
</tr>
<tr>
<td class="left"></td>
<td class="up"></td>
</tr>
<tr>
<td class="right"></td>
<td class="down"></td>
</tr>
</table>
<table class="input" style="width: 30%">
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>4</td>
<td>5</td>
<td>6</td>
</tr>
<tr>
<td>7</td>
<td>8</td>
<td>9</td>
</tr>
<tr>
<td>.</td>
<td>0</td>
<td
style="font-size: 3vw; width: 33.333333333333333333333333333333333333333333333333333333333333333333333%; /* :) */" class="disabled">
+/-
</td>
</tr>
</table>
</body> </body>
</html> </html>