diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index e8b760d5..8a889ac2 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -111,6 +111,7 @@ rotate ddrmi_hdg instrumentation/ddrmi/heading + -1 ddrmi_hdg.axis @@ -121,6 +122,7 @@ ddrmi_pointer_1 rotate instrumentation/ddrmi/needle-1 + -1 ddrmi_hdg.axis @@ -131,6 +133,7 @@ ddrmi_pointer_2 rotate instrumentation/ddrmi/needle-2 + -1 ddrmi_hdg.axis @@ -148,7 +151,7 @@ property-adjust instrumentation/ddrmi/vor-adf-1 - -1 + 0 1 @@ -160,8 +163,7 @@ ddrmi_vor_adf_select_1 instrumentation/ddrmi/vor-adf-1 - -190 - 045 + 090 1 0 @@ -180,7 +182,7 @@ property-adjust instrumentation/ddrmi/vor-adf-2 - -1 + 0 1 @@ -192,8 +194,7 @@ ddrmi_vor_adf_select_2 instrumentation/ddrmi/vor-adf-2 - -1-90 - 0-45 + 0-90 1 0 @@ -9096,8 +9097,6 @@ default - - dme1_0 @@ -9160,14 +9159,74 @@ default + + dme_flag + + -0.529 + -0.149 + 0.1305 + 90 + 72.81 + + right-center + xy-plane + literal + ---- + false + left-to-right + true + false + false + led.txf + 0.007 + 1.0 + 0.012 + 0.040 + + 32 + 32 + + default + + + + dme1_flag + + -0.529 + -0.116 + 0.1305 + 90 + 72.81 + + right-center + xy-plane + literal + ---- + false + left-to-right + true + false + false + led.txf + 0.007 + 1.0 + 0.012 + 0.040 + + 32 + 32 + + default + + material dme_0 dme - + dme_flag dme1_0 dme1 - + dme1_flag 1.00 0.355 @@ -9208,8 +9267,8 @@ - systems/electrical/bus/dc-ess - 25 + systems/electrical/bus/ac-ess + 110 instrumentation/ddrmi/vor-adf-1 @@ -9235,8 +9294,8 @@ 20 - systems/electrical/bus/dc-ess - 25 + systems/electrical/bus/ac-ess + 110 instrumentation/ddrmi/vor-adf-1 @@ -9264,8 +9323,8 @@ - systems/electrical/bus/dc-ess - 25 + systems/electrical/bus/ac-ess + 110 instrumentation/ddrmi/vor-adf-2 @@ -9291,8 +9350,46 @@ 20.0 - systems/electrical/bus/dc-ess - 25.0 + systems/electrical/bus/ac-ess + 110.0 + + + instrumentation/ddrmi/vor-adf-2 + 1 + + + + + + + select + dme_flag + + + instrumentation/dme[2]/operable + instrumentation/dme[2]/in-range + + systems/electrical/bus/ac-ess + 110.0 + + + instrumentation/ddrmi/vor-adf-1 + 1 + + + + + + + select + dme1_flag + + + instrumentation/dme[3]/operable + instrumentation/dme[3]/in-range + + systems/electrical/bus/ac-ess + 110.0 instrumentation/ddrmi/vor-adf-2 diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index 7ebcb0be..a3e42ac2 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -82,23 +82,7 @@ var perfFactor = props.globals.getNode("/options/company-options/perf-factor", 1 var database1 = props.globals.getNode("/FMGC/internal/navdatabase", 1); var database2 = props.globals.getNode("/FMGC/internal/navdatabase2", 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 var ADIRSMCDUBTN = props.globals.getNode("/controls/adirs/mcducbtn", 1); # IRSINIT variables @@ -2865,8 +2849,8 @@ var canvas_MCDU_base = { me["Simple_L0S"].hide(); showLeftS(me,1, 1, 1, 1, 1, -1); showLeftArrow(me,-1, -1, -1, -1, -1, -1); - showRight(me,1, 1, 1, 1, 1, -1); - showRightS(me,1, 1, 1, 1, 1, -1); + showRight(me,1, 1, -1, -1, 1, -1); + showRightS(me,1, 1, -1, -1, 1, -1); showRightArrow(me,-1, -1, -1, -1, -1, -1); me["Simple_C3B"].hide(); me["Simple_C4B"].hide(); @@ -2881,86 +2865,107 @@ var canvas_MCDU_base = { me.colorLeft("blu", "blu", "blu", "blu", "blu", "blu"); 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.colorCenterS("wht", "wht", "wht", "wht", "wht", "wht"); me.colorRight("blu", "blu", "blu", "blu", "blu", "blu"); 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); } - if (vor1FreqSet.getValue() == 1) { + if (fmgc.FMGCInternal.VOR1.freqSet) { me["Simple_L1"].setFontSize(normal); } else { me["Simple_L1"].setFontSize(small); } - if (vor1CRSSet.getValue() == 1) { + if (fmgc.FMGCInternal.VOR1.crsSet) { me["Simple_L2"].setFontSize(normal); } else { me["Simple_L2"].setFontSize(small); } - if (ils1FreqSet.getValue() == 1) { + if (fmgc.FMGCInternal.ILS.freqSet) { me["Simple_L3"].setFontSize(normal); } else { me["Simple_L3"].setFontSize(small); } - if (ils1CRSSet.getValue() == 1) { + if (fmgc.FMGCInternal.ILS.crsSet) { me["Simple_L4"].setFontSize(normal); } else { 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"].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 { me["Simple_L5"].setFont(symbol); 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); } else { me["Simple_R1"].setFontSize(small); } - if (vor2CRSSet.getValue() == 1) { + if (fmgc.FMGCInternal.VOR2.crsSet) { me["Simple_R2"].setFontSize(normal); } else { me["Simple_R2"].setFontSize(small); } - if (adf2FreqSet.getValue() == 1) { + + if (fmgc.FMGCInternal.ADF2.freqSet) { me["Simple_R5"].setFont(default); 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 { me["Simple_R5"].setFont(symbol); 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_L2"].setText(sprintf("%3.0f", vor1CRS.getValue())); - me["Simple_L3"].setText(" " ~ ils1.getValue()); - me["Simple_L4"].setText(sprintf("%3.0f", ils1CRS.getValue())); + me["Simple_L1"].setText(" " ~ fmgc.FMGCInternal.VOR1.mcdu); + me["Simple_L2"].setText(sprintf("%03.0f", pts.Instrumentation.Nav.Radials.selectedDeg[2].getValue())); + me["Simple_L3"].setText(" " ~ fmgc.FMGCInternal.ILS.mcdu); + me["Simple_L4"].setText(sprintf("%03.0f", pts.Instrumentation.Nav.Radials.selectedDeg[0].getValue())); me["Simple_L1S"].setText("VOR1/FREQ"); me["Simple_L2S"].setText("CRS"); me["Simple_L3S"].setText("ILS /FREQ"); me["Simple_L4S"].setText("CRS"); me["Simple_L5S"].setText("ADF1/FREQ"); - me["Simple_R1"].setText(" " ~ vor2.getValue()); - me["Simple_R2"].setText(sprintf("%3.0f", vor2CRS.getValue())); - me["Simple_R3"].setText("[ ]/[ ]"); - me["Simple_R4"].setText("-.- [ ]"); + me["Simple_R1"].setText(" " ~ fmgc.FMGCInternal.VOR2.mcdu); + me["Simple_R2"].setText(sprintf("%03.0f", pts.Instrumentation.Nav.Radials.selectedDeg[3].getValue())); me["Simple_R1S"].setText("FREQ/VOR2"); me["Simple_R2S"].setText("CRS"); - me["Simple_R3S"].setText("CHAN/ MLS"); - me["Simple_R4S"].setText("SLOPE CRS"); 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_L2"].hide(); me["Simple_L3"].hide(); @@ -2968,8 +2973,6 @@ var canvas_MCDU_base = { me["Simple_L5"].hide(); me["Simple_R1"].hide(); me["Simple_R2"].hide(); - me["Simple_R3"].hide(); - me["Simple_R4"].hide(); me["Simple_R5"].hide(); } else { me["Simple_L1"].show(); @@ -2979,8 +2982,6 @@ var canvas_MCDU_base = { me["Simple_L5"].show(); me["Simple_R1"].show(); me["Simple_R2"].show(); - me["Simple_R3"].show(); - me["Simple_R4"].show(); me["Simple_R5"].show(); } } else if (page == "INITA") { diff --git a/Models/Instruments/ND/canvas/framework/navdisplay.nas b/Models/Instruments/ND/canvas/framework/navdisplay.nas index 9c884708..6e3243b1 100644 --- a/Models/Instruments/ND/canvas/framework/navdisplay.nas +++ b/Models/Instruments/ND/canvas/framework/navdisplay.nas @@ -593,7 +593,7 @@ canvas.NavDisplay.update = func() # FIXME: This stuff is still too aircraft spec me.symbols.dmeR.setColor(0,0.6,0.85); if((var navident=getprop("/instrumentation/adf[1]/ident")) != "") 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.dmeRDist.setText(""); me.symbols.dmeRDist.setColor(0,0.6,0.85); diff --git a/Models/Instruments/ND/canvas/style.nas b/Models/Instruments/ND/canvas/style.nas index b3dc678d..01085a97 100644 --- a/Models/Instruments/ND/canvas/style.nas +++ b/Models/Instruments/ND/canvas/style.nas @@ -1387,9 +1387,9 @@ canvas.NDStyles["Airbus"] = { is_true: func(nd) { nd.symbols.vorCrsPtr.show(); 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 { - 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); } }, @@ -1407,9 +1407,10 @@ canvas.NDStyles["Airbus"] = { var type = (is_ils ? "ils" : "vor"); var path = nd.get_nav_path(type, 0); 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 { - 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"); if(!is_ils){ @@ -1499,9 +1500,7 @@ canvas.NDStyles["Airbus"] = { }, is_true: func(nd) { nd.symbols.locTrkPointer.show(); - var crs = getprop("/instrumentation/nav/radials/selected-deg"); - var rotation = (crs - nd.aircraft_source.get_hdg_tru())*D2R; - nd.symbols.locTrkPointer.setRotation(rotation); + nd.symbols.locTrkPointer.setRotation( (pts.Instrumentation.Nav.Radials.selectedDeg[0].getValue() - nd.aircraft_source.get_hdg_tru()) * D2R); }, is_false: func(nd) nd.symbols.locTrkPointer.hide(), }, diff --git a/Models/Instruments/PFD/PFD.nas b/Models/Instruments/PFD/PFD.nas index 446e12a0..f5a50f35 100644 --- a/Models/Instruments/PFD/PFD.nas +++ b/Models/Instruments/PFD/PFD.nas @@ -515,42 +515,6 @@ var canvas_pfd = { 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) { 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(); @@ -625,50 +589,6 @@ var canvas_pfd = { 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) { if (val.altimeterInhgMode == 0) { obj["QNH_setting"].setText(sprintf("%4.0f", val.altimeterHpa)); @@ -1735,6 +1655,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) { update_item.update(notification); @@ -2000,7 +1996,6 @@ var input = { pfdILS1: "/modes/pfd/ILS1", pfdILS2: "/modes/pfd/ILS2", - pfdILSMcdu: "/FMGC/internal/ils1-mcdu", markerO: "/instrumentation/marker-beacon/outer", markerM: "/instrumentation/marker-beacon/middle", diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index 7e627df5..dc132773 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -32,24 +32,6 @@ var alt = 0; var altitude = 0; var flap = 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 mach = 0; var ktsmach = 0; @@ -66,18 +48,12 @@ var windSpeed = 0; var windsDidChange = 0; 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/internal/vert-speed-fpm", 0); setprop("/it-autoflight/output/fma-pwr", 0); setprop("/instrumentation/nav[0]/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 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")]; @@ -243,6 +219,32 @@ var FMGCInternal = { mngKtsMach: 0, mngSpd: 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() { @@ -519,88 +521,53 @@ var updateFuel = func { ############################ # Flight Phase and Various # ############################ - +var freqnav0 = nil; var nav0 = func { - var freqnav0uf = getprop("/instrumentation/nav[0]/frequencies/selected-mhz"); - var freqnav0 = sprintf("%.2f", freqnav0uf); - var namenav0 = getprop("/instrumentation/nav[0]/nav-id") or ""; + freqnav0 = sprintf("%.2f", pts.Instrumentation.Nav.Frequencies.selectedMhz[0].getValue()); if (freqnav0 >= 108.10 and freqnav0 <= 111.95) { - if (namenav0 != "") { - setprop("/FMGC/internal/ils1-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 namenav0 = getprop("/instrumentation/nav[0]/nav-id") or " "; + fmgc.FMGCInternal.ILS.mcdu = namenav0 ~ "/" ~ freqnav0; } } +var freqnav2 = nil; var nav2 = func { - var freqnav2uf = getprop("/instrumentation/nav[2]/frequencies/selected-mhz"); - var freqnav2 = sprintf("%.2f", freqnav2uf); - var namenav2 = getprop("/instrumentation/nav[2]/nav-id") or ""; + freqnav2 = sprintf("%.2f", pts.Instrumentation.Nav.Frequencies.selectedMhz[2].getValue()); if (freqnav2 >= 108.00 and freqnav2 <= 117.95) { - if (namenav2 != "") { - setprop("/FMGC/internal/vor1-mcdu", namenav2 ~ "/" ~ freqnav2); - } else { - setprop("/FMGC/internal/vor1-mcdu", freqnav2); - } + var namenav2 = getprop("/instrumentation/nav[2]/nav-id") or " "; + fmgc.FMGCInternal.VOR1.mcdu = namenav2 ~ "/" ~ freqnav2; } } +var freqnav3 = nil; var nav3 = func { - var freqnav3uf = getprop("/instrumentation/nav[3]/frequencies/selected-mhz"); - var freqnav3 = sprintf("%.2f", freqnav3uf); - var namenav3 = getprop("/instrumentation/nav[3]/nav-id") or ""; + freqnav3 = sprintf("%.2f", pts.Instrumentation.Nav.Frequencies.selectedMhz[3].getValue()); if (freqnav3 >= 108.00 and freqnav3 <= 117.95) { - if (namenav3 != "") { - setprop("/FMGC/internal/vor2-mcdu", freqnav3 ~ "/" ~ namenav3); - } else { - setprop("/FMGC/internal/vor2-mcdu", freqnav3); - } + var namenav3 = getprop("/instrumentation/nav[3]/nav-id") or " "; + fmgc.FMGCInternal.VOR2.mcdu = freqnav3 ~ "/" ~ namenav3; } } +var freqadf0 = nil; var adf0 = func { - var freqadf0uf = getprop("/instrumentation/adf[0]/frequencies/selected-khz"); - var freqadf0 = sprintf("%.2f", freqadf0uf); - var nameadf0 = getprop("/instrumentation/adf[0]/ident") or ""; - if (freqadf0 >= 190 and freqadf0 <= 1750) { - if (nameadf0 != "") { - setprop("/FMGC/internal/adf1-mcdu", nameadf0 ~ "/" ~ freqadf0); - } else { - setprop("/FMGC/internal/adf1-mcdu", freqadf0); - } + freqadf0 = sprintf("%.1f", pts.Instrumentation.Adf.Frequencies.selectedKhz[0].getValue()); + if (freqadf0 >= 190 and freqadf0 <= 1799) { + var nameadf0 = pts.Instrumentation.Adf.ident[0].getValue() or " "; + fmgc.FMGCInternal.ADF1.mcdu = nameadf0 ~ "/" ~ freqadf0; } } +var freqadf1 = nil; var adf1 = func { - var freqadf1uf = getprop("/instrumentation/adf[1]/frequencies/selected-khz"); - var freqadf1 = sprintf("%.2f", freqadf1uf); - var nameadf1 = getprop("/instrumentation/adf[1]/ident") or ""; - if (freqadf1 >= 190 and freqadf1 <= 1750) { - if (nameadf1 != "") { - setprop("/FMGC/internal/adf2-mcdu", freqadf1 ~ "/" ~ nameadf1); - } else { - setprop("/FMGC/internal/adf2-mcdu", freqadf1); - } + freqadf1 = sprintf("%.1f", pts.Instrumentation.Adf.Frequencies.selectedKhz[1].getValue()); + if (freqadf1 >= 190 and freqadf1 <= 1799) { + var nameadf1 = pts.Instrumentation.Adf.ident[1].getValue() or " "; + fmgc.FMGCInternal.ADF2.mcdu = freqadf1 ~ "/" ~ nameadf1; } } var radios = maketimer(1, func() { nav0(); - nav1(); nav2(); nav3(); adf0(); @@ -957,28 +924,28 @@ var updateAirportRadios = func { 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")); runway_ils = destination_rwy.ils_frequency_mhz; - if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set") and !getprop("/FMGC/internal/ils1crs-set")) { - setprop("/FMGC/internal/ils1freq-calculated", runway_ils); - setprop("/instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); - setprop("/instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); - } elsif (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set")) { - setprop("/FMGC/internal/ils1freq-calculated", runway_ils); - setprop("/instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); - } elsif (!getprop("/FMGC/internal/ils1crs-set")) { - setprop("/instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); + if (runway_ils != nil and !fmgc.FMGCInternal.ILS.freqSet and !fmgc.FMGCInternal.ILS.crsSet) { + fmgc.FMGCInternal.ILS.freqCalculated = runway_ils; + pts.Instrumentation.Nav.Frequencies.selectedMhz[0].setValue(runway_ils); + pts.Instrumentation.Nav.Radials.selectedDeg[0].setValue(magnetic_hdg); + } elsif (runway_ils != nil and !fmgc.FMGCInternal.ILS.freqSet) { + fmgc.FMGCInternal.ILS.freqCalculated = runway_ils; + pts.Instrumentation.Nav.Frequencies.selectedMhz[0].setValue(runway_ils); + } elsif (!fmgc.FMGCInternal.ILS.crsSet) { + pts.Instrumentation.Nav.Radials.selectedDeg[0].setValue(magnetic_hdg); } } elsif (airportRadiosPhase <= 1 and departure_rwy != nil) { magnetic_hdg = geo.normdeg(departure_rwy.heading - getprop("/environment/magnetic-variation-deg")); runway_ils = departure_rwy.ils_frequency_mhz; - if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set") and !getprop("/FMGC/internal/ils1crs-set")) { - setprop("/FMGC/internal/ils1freq-calculated", runway_ils); - setprop("/instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); - setprop("/instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); - } elsif (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set")) { - setprop("/FMGC/internal/ils1freq-calculated", runway_ils); - setprop("/instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); - } elsif (!getprop("/FMGC/internal/ils1crs-set")) { - setprop("/instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); + if (runway_ils != nil and !fmgc.FMGCInternal.ILS.freqSet and !fmgc.FMGCInternal.ILS.crsSet) { + fmgc.FMGCInternal.ILS.freqCalculated = runway_ils; + pts.Instrumentation.Nav.Frequencies.selectedMhz[0].setValue(runway_ils); + pts.Instrumentation.Nav.Radials.selectedDeg[0].setValue(magnetic_hdg); + } elsif (runway_ils != nil and !fmgc.FMGCInternal.ILS.freqSet) { + fmgc.FMGCInternal.ILS.freqCalculated = runway_ils; + pts.Instrumentation.Nav.Frequencies.selectedMhz[0].setValue(runway_ils); + } elsif (!fmgc.FMGCInternal.ILS.crsSet) { + pts.Instrumentation.Nav.Radials.selectedDeg[0].setValue(magnetic_hdg); } } @@ -1243,6 +1210,7 @@ setlistener("/FMGC/internal/fuel-calculating", func() { var timer30secLanding = maketimer(1, func() { if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/landing-time") + 30) { FMGCInternal.phase = 7; + if (FMGCInternal.costIndexSet) { setprop("/FMGC/internal/last-cost-index", FMGCInternal.costIndex); } else { diff --git a/Nasal/Libraries/property-tree-setup.nas b/Nasal/Libraries/property-tree-setup.nas index c4d88c04..d398238e 100644 --- a/Nasal/Libraries/property-tree-setup.nas +++ b/Nasal/Libraries/property-tree-setup.nas @@ -156,6 +156,12 @@ var Gear = { }; 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: { indicatedSpdKt: props.globals.getNode("/instrumentation/airspeed-indicator/indicated-speed-kt"), indicatedMach: props.globals.getNode("/instrumentation/airspeed-indicator/indicated-mach"), @@ -225,6 +231,12 @@ var Instrumentation = { }, }, 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"), locDeflection: props.globals.getNode("/instrumentation/nav[0]/heading-needle-deflection-norm"), }, diff --git a/Nasal/MCDU/MCDU.nas b/Nasal/MCDU/MCDU.nas index c9ae3efb..a8a69542 100644 --- a/Nasal/MCDU/MCDU.nas +++ b/Nasal/MCDU/MCDU.nas @@ -45,15 +45,15 @@ var MCDU_reset = func(i) { setprop("/FMGC/print/mcdu/page2/R4req", 0); #RADNAV - setprop("/FMGC/internal/ils1freq-set", 0); - setprop("/FMGC/internal/ils1crs-set", 0); - setprop("/FMGC/internal/ils1freq-calculated", 0); - setprop("/FMGC/internal/vor1freq-set", 0); - setprop("/FMGC/internal/vor1crs-set", 0); - setprop("/FMGC/internal/vor2freq-set", 0); - setprop("/FMGC/internal/vor2crs-set", 0); - setprop("/FMGC/internal/adf1freq-set", 0); - setprop("/FMGC/internal/adf2freq-set", 0); + fmgc.FMGCInternal.ILS.freqSet = 0; + fmgc.FMGCInternal.ILS.freqCalculated = 0; + fmgc.FMGCInternal.ILS.crsSet = 0; + fmgc.FMGCInternal.VOR1.freqSet = 0; + fmgc.FMGCInternal.VOR1.crsSet = 0; + fmgc.FMGCInternal.VOR2.freqSet = 0; + fmgc.FMGCInternal.VOR2.crsSet = 0; + fmgc.FMGCInternal.ADF1.freqSet = 0; + fmgc.FMGCInternal.ADF2.freqSet = 0; # INT-A fmgc.FMGCInternal.altAirport = ""; @@ -847,6 +847,8 @@ var lskbutton = func(btn, i) { pageNode[i].setValue("WINDCLB"); } else if (page == "ROUTESELECTION") { initInputROUTESEL("L6",i); + } else if (page == "RADNAV") { + radnavInput("L6",i); } else if (page == "PERFCLB") { perfCLBInput("L6",i); } else if (page == "PERFCRZ") { @@ -1303,6 +1305,8 @@ var rskbutton = func(btn, i) { mcdu_message(i, "AOC DISABLED"); } else if (page == "INITA") { initInputA("R6",i); + } else if (page == "RADNAV") { + radnavInput("R6",i); } else if (page == "F-PLNA" or page == "F-PLNB") { canvas_mcdu.myFpln[i].pushButtonRight(6); } else if (page == "VERTREV") { diff --git a/Nasal/MCDU/RADNAV.nas b/Nasal/MCDU/RADNAV.nas index 3ff1d756..9f0a7e96 100644 --- a/Nasal/MCDU/RADNAV.nas +++ b/Nasal/MCDU/RADNAV.nas @@ -1,31 +1,33 @@ # A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring) - # Copyright (c) 2021 Josh Davidson (Octal450) +var radNavScratchpad = nil; +var radNavScratchpadSize = nil; + var radnavInput = func(key, i) { - var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad; - if (!getprop("/systems/radio/rmp[0]/nav") and !getprop("/systems/radio/rmp[1]/nav")) { + radNavScratchpad = mcdu_scratchpad.scratchpads[i].scratchpad; + radNavScratchpadSize = size(radNavScratchpad); + if (!rmp.rmpNav[0].getValue() and !rmp.rmpNav[1].getValue()) { if (key == "L1") { - if (scratchpad == "CLR") { - setprop("/FMGC/internal/vor1freq-set", 0); + if (radNavScratchpad == "CLR") { + fmgc.FMGCInternal.VOR1.freqSet = 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.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 == 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) { + if (radNavScratchpadSize == 3 or radNavScratchpadSize == 5 or radNavScratchpadSize == 6) { + if (radNavScratchpad >= 108.00 and radNavScratchpad <= 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 + 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 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 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) { mcdu_message(i, "NOT ALLOWED"); } else { - setprop("instrumentation/nav[2]/frequencies/selected-mhz", scratchpad); - setprop("/FMGC/internal/vor1freq-set", 1); + pts.Instrumentation.Nav.Frequencies.selectedMhz[2].setValue(radNavScratchpad); + fmgc.FMGCInternal.VOR1.freqSet = 1; mcdu_scratchpad.scratchpads[i].empty(); } - } else if (scratchpad >= 112.00 and scratchpad <= 117.95) { - setprop("instrumentation/nav[2]/frequencies/selected-mhz", scratchpad); - setprop("/FMGC/internal/vor1freq-set", 1); + } else if (radNavScratchpad >= 112.00 and radNavScratchpad <= 117.95) { + pts.Instrumentation.Nav.Frequencies.selectedMhz[2].setValue(radNavScratchpad); + fmgc.FMGCInternal.VOR1.freqSet = 1; mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); @@ -35,15 +37,14 @@ var radnavInput = func(key, i) { } } } else if (key == "L2") { - if (scratchpad == "CLR") { - setprop("/FMGC/internal/vor1crs-set", 0); + if (radNavScratchpad == "CLR") { + fmgc.FMGCInternal.VOR1.crsSet = 0; mcdu_scratchpad.scratchpads[i].empty(); } else { - var tfs = size(scratchpad); - if (tfs >= 1 and tfs <= 3) { - if (scratchpad >= 0 and scratchpad <= 360) { - setprop("instrumentation/nav[2]/radials/selected-deg", scratchpad); - setprop("/FMGC/internal/vor1crs-set", 1); + if (radNavScratchpadSize >= 1 and radNavScratchpadSize <= 3) { + if (radNavScratchpad >= 0 and radNavScratchpad <= 360) { + pts.Instrumentation.Nav.Radials.selectedDeg[2].setValue(radNavScratchpad); + fmgc.FMGCInternal.VOR1.crsSet = 1; mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); @@ -53,21 +54,20 @@ var radnavInput = func(key, i) { } } } else if (key == "L3") { - if (scratchpad == "CLR") { - setprop("/FMGC/internal/ils1freq-set", 0); + if (radNavScratchpad == "CLR") { + fmgc.FMGCInternal.ILS.freqSet = 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.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 == 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) { - setprop("instrumentation/nav[0]/frequencies/selected-mhz", scratchpad); - setprop("/FMGC/internal/ils1freq-set", 1); + if (radNavScratchpadSize == 3 or radNavScratchpadSize == 5 or radNavScratchpadSize == 6) { + if (radNavScratchpad >= 108.00 and radNavScratchpad <= 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 + 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 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 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) { + pts.Instrumentation.Nav.Frequencies.selectedMhz[0].setValue(radNavScratchpad); + fmgc.FMGCInternal.ILS.freqSet = 1; 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"); } } else { @@ -81,15 +81,14 @@ var radnavInput = func(key, i) { } } } else if (key == "L4") { - if (scratchpad == "CLR") { - setprop("/FMGC/internal/ils1crs-set", 0); + if (radNavScratchpad == "CLR") { + fmgc.FMGCInternal.ILS.crsSet = 0; mcdu_scratchpad.scratchpads[i].empty(); } else { - var tfs = size(scratchpad); - if (tfs >= 1 and tfs <= 3) { - if (scratchpad >= 0 and scratchpad <= 360) { - setprop("instrumentation/nav[0]/radials/selected-deg", scratchpad); - setprop("/FMGC/internal/ils1crs-set", 1); + if (radNavScratchpadSize >= 1 and radNavScratchpadSize <= 3) { + if (radNavScratchpad >= 0 and radNavScratchpad <= 360) { + pts.Instrumentation.Nav.Radials.selectedDeg[0].setValue(radNavScratchpad); + fmgc.FMGCInternal.ILS.crsSet = 1; mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); @@ -99,16 +98,26 @@ var radnavInput = func(key, i) { } } } else if (key == "L5") { - if (scratchpad == "CLR") { - setprop("/FMGC/internal/adf1freq-set", 0); + if (radNavScratchpad == "CLR") { + fmgc.FMGCInternal.ADF1.freqSet = 0; mcdu_scratchpad.scratchpads[i].empty(); } else { - var tfs = size(scratchpad); - if (tfs == 3 or tfs == 4) { - if (scratchpad >= 190 and scratchpad <= 1750) { - setprop("instrumentation/adf[0]/frequencies/selected-khz", scratchpad); - setprop("/FMGC/internal/adf1freq-set", 1); - mcdu_scratchpad.scratchpads[i].empty(); + if (radNavScratchpadSize >= 3 and radNavScratchpadSize <= 6) { + if (radNavScratchpad >= 190 and radNavScratchpad <= 1799) { + if (radNavScratchpad != int(radNavScratchpad)) { + var splitradNavScratchpad = split(".",radNavScratchpad); + if (size(splitradNavScratchpad) != 2 or splitradNavScratchpad[1] != "5") { + mcdu_message(i, "NOT ALLOWED"); + } else { + pts.Instrumentation.Adf.Frequencies.selectedKhz[0].setValue(radNavScratchpad); + fmgc.FMGCInternal.ADF1.freqSet = 1; + mcdu_scratchpad.scratchpads[i].empty(); + } + } else { + pts.Instrumentation.Adf.Frequencies.selectedKhz[0].setValue(radNavScratchpad); + fmgc.FMGCInternal.ADF1.freqSet = 1; + mcdu_scratchpad.scratchpads[i].empty(); + } } else { mcdu_message(i, "NOT ALLOWED"); } @@ -116,27 +125,41 @@ var radnavInput = func(key, i) { mcdu_message(i, "NOT ALLOWED"); } } + } 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 { + mcdu_message(i, "NOT ALLOWED"); + } + } + } else { + mcdu_message(i, "NOT ALLOWED"); + } } else if (key == "R1") { - if (scratchpad == "CLR") { - setprop("/FMGC/internal/vor2freq-set", 0); + if (radNavScratchpad == "CLR") { + fmgc.FMGCInternal.VOR2.freqSet = 0; mcdu_scratchpad.scratchpads[i].empty(); } else { - var tfs = size(scratchpad); - if (tfs == 3 or tfs == 5 or tfs == 6) { - if (scratchpad >= 108.10 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 - 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) { + if (radNavScratchpadSize == 3 or radNavScratchpadSize == 5 or radNavScratchpadSize == 6) { + if (radNavScratchpad >= 108.10 and radNavScratchpad <= 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 + 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 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 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) { mcdu_message(i, "NOT ALLOWED"); } else { - setprop("instrumentation/nav[3]/frequencies/selected-mhz", scratchpad); - setprop("/FMGC/internal/vor2freq-set", 1); + pts.Instrumentation.Nav.Frequencies.selectedMhz[3].setValue(radNavScratchpad); + fmgc.FMGCInternal.VOR2.freqSet = 1; 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 (radNavScratchpad >= 112.00 and radNavScratchpad <= 117.95) { + pts.Instrumentation.Nav.Frequencies.selectedMhz[3].setValue(radNavScratchpad); + fmgc.FMGCInternal.VOR2.freqSet = 1; mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); @@ -146,15 +169,14 @@ var radnavInput = func(key, i) { } } } else if (key == "R2") { - if (scratchpad == "CLR") { - setprop("/FMGC/internal/vor2crs-set", 0); + if (radNavScratchpad == "CLR") { + fmgc.FMGCInternal.VOR2.crsSet = 0; mcdu_scratchpad.scratchpads[i].empty(); } else { - var tfs = size(scratchpad); - if (tfs >= 1 and tfs <= 3) { - if (scratchpad >= 0 and scratchpad <= 360) { - setprop("instrumentation/nav[3]/radials/selected-deg", scratchpad); - setprop("/FMGC/internal/vor2crs-set", 1); + if (radNavScratchpadSize >= 1 and radNavScratchpadSize <= 3) { + if (radNavScratchpad >= 0 and radNavScratchpad <= 360) { + pts.Instrumentation.Nav.Radials.selectedDeg[3].setValue(radNavScratchpad); + fmgc.FMGCInternal.VOR2.crsSet = 1; mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); @@ -164,16 +186,26 @@ var radnavInput = func(key, i) { } } } else if (key == "R5") { - if (scratchpad == "CLR") { - setprop("/FMGC/internal/adf2freq-set", 0); + if (radNavScratchpad == "CLR") { + fmgc.FMGCInternal.ADF2.freqSet = 0; mcdu_scratchpad.scratchpads[i].empty(); } else { - var tfs = size(scratchpad); - if (tfs == 3 or tfs == 4) { - if (scratchpad >= 190 and scratchpad <= 1750) { - setprop("instrumentation/adf[1]/frequencies/selected-khz", scratchpad); - setprop("/FMGC/internal/adf2freq-set", 1); - mcdu_scratchpad.scratchpads[i].empty(); + if (radNavScratchpadSize >= 3 and radNavScratchpadSize <= 6) { + if (radNavScratchpad >= 190 and radNavScratchpad <= 1799) { + if (radNavScratchpad != int(radNavScratchpad)) { + var splitradNavScratchpad = split(".",radNavScratchpad); + if (size(splitradNavScratchpad) != 2 or splitradNavScratchpad[1] != "5") { + mcdu_message(i, "NOT ALLOWED"); + } else { + pts.Instrumentation.Adf.Frequencies.selectedKhz[1].setValue(radNavScratchpad); + fmgc.FMGCInternal.ADF2.freqSet = 1; + mcdu_scratchpad.scratchpads[i].empty(); + } + } else { + pts.Instrumentation.Adf.Frequencies.selectedKhz[1].setValue(radNavScratchpad); + fmgc.FMGCInternal.ADF2.freqSet = 1; + mcdu_scratchpad.scratchpads[i].empty(); + } } else { mcdu_message(i, "NOT ALLOWED"); } @@ -181,8 +213,23 @@ var radnavInput = func(key, i) { mcdu_message(i, "NOT ALLOWED"); } } + } 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(); + } else { + if (radNavScratchpadSize == 0 and !rmp.BFOActive[1].getValue()) { + rmp.BFOActive[1].setValue(1); + } else { + mcdu_message(i, "NOT ALLOWED"); + } + } + } else { + mcdu_message(i, "NOT ALLOWED"); + } + } else { + mcdu_message(i, "NOT ALLOWED"); } - } else { - mcdu_message(i, "NOT ALLOWED"); } } diff --git a/Nasal/Panels/acp.nas b/Nasal/Panels/acp.nas index bade1ce6..ac336502 100644 --- a/Nasal/Panels/acp.nas +++ b/Nasal/Panels/acp.nas @@ -7,15 +7,40 @@ # 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 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 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 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 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 com2_volume = props.globals.getNode("instrumentation/comm[1]/volume"); diff --git a/Nasal/Panels/rmp.nas b/Nasal/Panels/rmp.nas index 0615a7b7..b24eb124 100644 --- a/Nasal/Panels/rmp.nas +++ b/Nasal/Panels/rmp.nas @@ -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 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() { chan_rmp1.setValue("vhf1"); @@ -277,11 +278,11 @@ var update_displays_nav = func(nav) { stby_display_rmp2.setValue(sprintf("%3.2f", stby_vor2.getValue())); } } else if (nav == 5 and chan1 == "adf") { - act_display_rmp1.setValue(sprintf("%4.0f", act_adf1.getValue())); - stby_display_rmp1.setValue(sprintf("%4.0f", stby_adf1.getValue())); + act_display_rmp1.setValue(sprintf("%4.2f", act_adf1.getValue())); + stby_display_rmp1.setValue(sprintf("%4.2f", stby_adf1.getValue())); } else if (nav == 6 and chan2 == "adf") { - act_display_rmp2.setValue(sprintf("%4.0f", act_adf2.getValue())); - stby_display_rmp2.setValue(sprintf("%4.0f", stby_adf2.getValue())); + act_display_rmp2.setValue(sprintf("%4.2f", act_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")) { chan_rmp2.setValue("vhf2"); } - setprop("/FMGC/internal/ils1freq-set", 1); - setprop("/FMGC/internal/ils1crs-set", 1); - setprop("/FMGC/internal/vor1freq-set", 1); - setprop("/FMGC/internal/vor1crs-set", 1); - setprop("/FMGC/internal/vor2freq-set", 1); - setprop("/FMGC/internal/vor2crs-set", 1); - setprop("/FMGC/internal/adf1freq-set", 1); - setprop("/FMGC/internal/adf2freq-set", 1); + fmgc.FMGCInternal.ILS.freqSet = 1; + fmgc.FMGCInternal.ILS.crsSet = 1; + fmgc.FMGCInternal.VOR1.freqSet = 1; + fmgc.FMGCInternal.VOR1.crsSet = 1; + fmgc.FMGCInternal.VOR2.freqSet = 1; + fmgc.FMGCInternal.VOR2.crsSet = 1; + fmgc.FMGCInternal.ADF1.freqSet = 1; + fmgc.FMGCInternal.ADF2.freqSet = 1; } } # 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 ADFMode = [props.globals.getNode("/instrumentation/adf[0]/mode"),props.globals.getNode("/instrumentation/adf[1]/mode")]; diff --git a/Nasal/Systems/electrical.nas b/Nasal/Systems/electrical.nas index 43b83e06..057c0814 100644 --- a/Nasal/Systems/electrical.nas +++ b/Nasal/Systems/electrical.nas @@ -49,8 +49,6 @@ var ELEC = { tr2Fault: props.globals.getNode("/systems/failures/electrical/tr-2"), }, 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"), fcpPower: props.globals.initNode("/systems/electrical/outputs/fcp-power", 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"), gps: props.globals.initNode("/systems/electrical/outputs/gps", 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"), transponder: props.globals.initNode("/systems/electrical/outputs/transponder", 0, "DOUBLE"), turnCoordinator: props.globals.initNode("/systems/electrical/outputs/turn-coordinator", 0, "DOUBLE"), diff --git a/Systems/a320-electrical.xml b/Systems/a320-electrical.xml index d8a779a0..9f837d12 100644 --- a/Systems/a320-electrical.xml +++ b/Systems/a320-electrical.xml @@ -2242,12 +2242,23 @@ /systems/electrical/outputs/fuel-pump[0] /systems/electrical/outputs/fuel-pump[1] /systems/electrical/outputs/fuel-pump[2] - /systems/electrical/outputs/gps /systems/electrical/outputs/mk-viii /systems/electrical/outputs/tacan /systems/electrical/outputs/turn-coordinator + + This makes the FG stuff work because we killed the generic electrical + + + /systems/electrical/bus/ac-ess ge 25 + + + /systems/electrical/bus/ac-2 ge 25 + + /systems/electrical/outputs/gps + + diff --git a/Systems/a320-misc.xml b/Systems/a320-misc.xml index 4468404e..05248eb8 100644 --- a/Systems/a320-misc.xml +++ b/Systems/a320-misc.xml @@ -39,6 +39,352 @@ + + + + + + /systems/electrical/bus/ac-ess-shed ge 110 + + + + + /instrumentation/adf[0]/power-supply + 100 + 0.5 + + + + /instrumentation/adf[0]/power-supply + 0.5 + 100 + + + + + + /instrumentation/adf[0]/power-supply-bite-timer eq 1 + + + /instrumentation/adf[0]/power-supply-bite-enable eq 0 + + + + + + + /instrumentation/adf[0]/power-supply-was-off eq 0 + /instrumentation/adf[0]/power-supply-bite-timer eq 1 + + + + + + + /systems/electrical/bus/ac-2 ge 110 + + + + + /instrumentation/adf[1]/power-supply + 100 + 0.5 + + + + /instrumentation/adf[1]/power-supply + 0.5 + 100 + + + + + + /instrumentation/adf[1]/power-supply-bite-timer eq 1 + + + /instrumentation/adf[1]/power-supply-bite-enable eq 0 + + + + + + + /instrumentation/adf[1]/power-supply-was-off eq 0 + /instrumentation/adf[1]/power-supply-bite-timer eq 1 + + + + + + + + + + + /systems/electrical/bus/ac-ess ge 110 + + + + + /instrumentation/nav[2]/power-supply + 100 + 0.333 + + + + /instrumentation/nav[2]/power-supply + 0.333 + 100 + + + + + + /instrumentation/nav[2]/power-supply-bite-timer eq 1 + + + /instrumentation/nav[2]/power-supply-bite-enable eq 0 + + + + + + + /instrumentation/nav[2]/power-supply-was-off eq 0 + /instrumentation/nav[2]/power-supply-bite-timer eq 1 + + + + + + + /systems/electrical/bus/ac-2 ge 110 + + + + + /instrumentation/nav[3]/power-supply + 100 + 0.333 + + + + /instrumentation/nav[3]/power-supply + 0.333 + 100 + + + + + + /instrumentation/nav[3]/power-supply-bite-timer eq 1 + + + /instrumentation/nav[3]/power-supply-bite-enable eq 0 + + + + + + + /instrumentation/nav[3]/power-supply-was-off eq 0 + /instrumentation/nav[3]/power-supply-bite-timer eq 1 + + + + + + + + + + + /systems/electrical/bus/ac-ess-shed ge 110 + + + + + /instrumentation/dme[0]/power-supply + 100 + 0.5 + + + + /instrumentation/dme[0]/power-supply + 0.5 + 100 + + + + + + /instrumentation/dme[0]/power-supply-bite-timer eq 1 + + + /instrumentation/dme[0]/power-supply-bite-enable eq 0 + + + + + + + /instrumentation/dme[0]/power-supply-was-off eq 0 + /instrumentation/dme[0]/power-supply-bite-timer eq 1 + + + + + + + /systems/electrical/bus/ac-2 ge 110 + + + + + /instrumentation/dme[1]/power-supply + 100 + 0.5 + + + + /instrumentation/dme[1]/power-supply + 0.5 + 100 + + + + + + /instrumentation/dme[1]/power-supply-bite-timer eq 1 + + + /instrumentation/dme[1]/power-supply-bite-enable eq 0 + + + + + + + /instrumentation/dme[1]/power-supply-was-off eq 0 + /instrumentation/dme[1]/power-supply-bite-timer eq 1 + + + + + + + + + + + /controls/audio/acp[0]/adf1-recive eq 1 + + /controls/audio/acp[1]/adf1-recive eq 0 + /controls/audio/acp[0]/adf1-volume ge /controls/audio/acp[1]/adf1-volume + + + + /controls/audio/acp[1]/adf1-recive eq 1 + + /controls/audio/acp[0]/adf1-recive eq 0 + /controls/audio/acp[0]/adf1-volume lt /controls/audio/acp[1]/adf1-volume + + + + + + + + /controls/audio/acp[0]/adf2-recive eq 1 + + /controls/audio/acp[1]/adf2-recive eq 0 + /controls/audio/acp[0]/adf2-volume ge /controls/audio/acp[1]/adf2-volume + + + + /controls/audio/acp[1]/adf2-recive eq 1 + + /controls/audio/acp[0]/adf2-recive eq 0 + /controls/audio/acp[0]/adf2-volume lt /controls/audio/acp[1]/adf2-volume + + + + + + + + /controls/audio/acp[0]/mkr-recive eq 1 + + /controls/audio/acp[1]/mkr-recive eq 0 + /controls/audio/acp[0]/mkr-volume ge /controls/audio/acp[1]/mkr-volume + + + + /controls/audio/acp[1]/mkr-recive eq 1 + + /controls/audio/acp[0]/mkr-recive eq 0 + /controls/audio/acp[0]/mkr-volume lt /controls/audio/acp[1]/mkr-volume + + + + + + + + /controls/audio/acp[0]/ils-recive eq 1 + + /controls/audio/acp[1]/ils-recive eq 0 + /controls/audio/acp[0]/ils-volume ge /controls/audio/acp[1]/ils-volume + + + + /controls/audio/acp[1]/ils-recive eq 1 + + /controls/audio/acp[0]/ils-recive eq 0 + /controls/audio/acp[0]/ils-volume lt /controls/audio/acp[1]/ils-volume + + + + + + + + /controls/audio/acp[0]/vor1-recive eq 1 + + /controls/audio/acp[1]/vor1-recive eq 0 + /controls/audio/acp[0]/vor1-volume ge /controls/audio/acp[1]/vor1-volume + + + + /controls/audio/acp[1]/vor1-recive eq 1 + + /controls/audio/acp[0]/vor1-recive eq 0 + /controls/audio/acp[0]/vor1-volume lt /controls/audio/acp[1]/vor1-volume + + + + + + + + /controls/audio/acp[0]/vor2-recive eq 1 + + /controls/audio/acp[1]/vor2-recive eq 0 + /controls/audio/acp[0]/vor2-volume ge /controls/audio/acp[1]/vor2-volume + + + + /controls/audio/acp[1]/vor2-recive eq 1 + + /controls/audio/acp[0]/vor2-recive eq 0 + /controls/audio/acp[0]/vor2-volume lt /controls/audio/acp[1]/vor2-volume + + + + + + diff --git a/Systems/instrumentation.xml b/Systems/instrumentation.xml index 12974b01..28ee398d 100644 --- a/Systems/instrumentation.xml +++ b/Systems/instrumentation.xml @@ -9,14 +9,14 @@ adf 0 - /systems/electrical/bus/ac-ess-shed + /instrumentation/adf[0]/power-supply-node 109.9 adf 1 - /systems/electrical/bus/ac-2 + /instrumentation/adf[1]/power-supply-node 109.9 @@ -126,10 +126,10 @@ 1 - + dme 0 - /systems/electrical/bus/ac-ess-shed + /systems/electrical/bus/ac-ess 109.9 @@ -140,17 +140,17 @@ 109.9 - + dme 2 - /systems/electrical/bus/ac-ess + /instrumentation/dme[0]/power-supply-node 109.9 dme 3 - /systems/electrical/bus/ac-2 + /instrumentation/dme[1]/power-supply-node 109.9 @@ -176,11 +176,11 @@ marker-beacon 0 - /systems/electrical/bus/ac-ess + /instrumentation/nav[2]/power-supply-node 109.9 - + nav 0 /systems/electrical/bus/ac-ess @@ -194,17 +194,17 @@ 109.9 - + nav 2 - /systems/electrical/bus/ac-ess + /instrumentation/nav[2]/power-supply-node 109.9 nav 3 - /systems/electrical/bus/ac-2 + /instrumentation/nav[3]/power-supply-node 109.9 diff --git a/Systems/libraries.xml b/Systems/libraries.xml index 588157ee..72768fd8 100644 --- a/Systems/libraries.xml +++ b/Systems/libraries.xml @@ -878,13 +878,27 @@ - /systems/electrical/bus/dc-ess - 25 + /systems/electrical/bus/ac-ess + 110 - - /systems/navigation/aligned-1 - 1 - + + + /systems/navigation/aligned-1 + + + /controls/navigation/switching/att-hdg + -1 + + + + + /systems/navigation/aligned-3 + + /controls/navigation/switching/att-hdg + -1 + + + @@ -919,8 +933,8 @@ - /systems/electrical/bus/dc-ess - 25 + /systems/electrical/bus/ac-ess + 110 /instrumentation/ddrmi/vor-adf-1 @@ -930,10 +944,24 @@ /instrumentation/nav[2]/in-range 1 - - /systems/navigation/aligned-1 - 1 - + + + /systems/navigation/aligned-1 + + + /controls/navigation/switching/att-hdg + -1 + + + + + /systems/navigation/aligned-3 + + /controls/navigation/switching/att-hdg + -1 + + + /instrumentation/ddrmi/vor-1-error @@ -943,27 +971,43 @@ - /systems/electrical/bus/dc-ess - 25 + /systems/electrical/bus/ac-ess + 110 /instrumentation/ddrmi/vor-adf-1 - -1 + 0 /instrumentation/adf[0]/in-range 1 - - /systems/navigation/aligned-1 - 1 - + + + /systems/navigation/aligned-1 + + + /controls/navigation/switching/att-hdg + -1 + + + + + /systems/navigation/aligned-3 + + /controls/navigation/switching/att-hdg + -1 + + + /instrumentation/adf[0]/indicated-bearing-deg -1.0 - -90 + + /instrumentation/ddrmi/needle-1 + /instrumentation/ddrmi/needle-1 @@ -994,8 +1038,8 @@ - /systems/electrical/bus/dc-ess - 25 + /systems/electrical/bus/ac-ess + 110 /instrumentation/ddrmi/vor-adf-2 @@ -1005,10 +1049,24 @@ /instrumentation/nav[3]/in-range 1 - - /systems/navigation/aligned-1 - 1 - + + + /systems/navigation/aligned-1 + + + /controls/navigation/switching/att-hdg + -1 + + + + + /systems/navigation/aligned-3 + + /controls/navigation/switching/att-hdg + -1 + + + /instrumentation/ddrmi/vor-2-error @@ -1018,27 +1076,43 @@ - /systems/electrical/bus/dc-ess - 25 + /systems/electrical/bus/ac-ess + 110 /instrumentation/ddrmi/vor-adf-2 - -1 + 0 /instrumentation/adf[1]/in-range 1 - - /systems/navigation/aligned-1 - 1 - + + + /systems/navigation/aligned-1 + + + /controls/navigation/switching/att-hdg + -1 + + + + + /systems/navigation/aligned-3 + + /controls/navigation/switching/att-hdg + -1 + + + /instrumentation/adf[1]/indicated-bearing-deg -1.0 - -90 + + /instrumentation/ddrmi/needle-2 + /instrumentation/ddrmi/needle-2 @@ -1050,13 +1124,27 @@ - /systems/electrical/bus/dc-ess - 25 + /systems/electrical/bus/ac-ess + 110 - - /systems/navigation/aligned-1 - 1 - + + + /systems/navigation/aligned-1 + + + /controls/navigation/switching/att-hdg + -1 + + + + + /systems/navigation/aligned-3 + + /controls/navigation/switching/att-hdg + -1 + + + @@ -1071,7 +1159,7 @@ /instrumentation/ddrmi/vor-adf-1 - -1 + 0 /instrumentation/adf[0]/in-range @@ -1096,13 +1184,27 @@ - /systems/electrical/bus/dc-ess - 25 + /systems/electrical/bus/ac-ess + 110 - - /systems/navigation/aligned-1 - 1 - + + + /systems/navigation/aligned-1 + + + /controls/navigation/switching/att-hdg + -1 + + + + + /systems/navigation/aligned-3 + + /controls/navigation/switching/att-hdg + -1 + + + @@ -1117,7 +1219,7 @@ /instrumentation/ddrmi/vor-adf-2 - -1 + 0 /instrumentation/adf[1]/in-range