From 0933ca4f4751110c10a02beed37cea233bf74129 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R <legoboyvdlp@gmail.com> Date: Fri, 4 Sep 2020 20:56:22 +0100 Subject: [PATCH 01/16] Allow MCDU display in KGS --- Models/Instruments/MCDU/MCDU.nas | 158 +++++++++++++++++++++++++------ 1 file changed, 130 insertions(+), 28 deletions(-) diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index 08ace4a8..353397db 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -72,6 +72,7 @@ var MAGENTA = [0.6902,0.3333,0.7541]; # Fetch nodes: var mcdu_keyboard_left = props.globals.getNode("/FMGC/keyboard-left", 0); var mcdu_keyboard_right = props.globals.getNode("/FMGC/keyboard-right", 0); +var acconfig_weight_kgs = props.globals.getNode("/systems/acconfig/options/weight-kgs", 1); #ACCONFIG var mcdu1_lgt = props.globals.getNode("/controls/lighting/DU/mcdu1", 1); @@ -157,6 +158,10 @@ var pageProp = [props.globals.getNode("/MCDU[0]/page", 1), props.globals.getNode var active = [props.globals.getNode("/MCDU[0]/active", 1), props.globals.getNode("/MCDU[1]/active", 1)]; var activeAtsu = [props.globals.getNode("/MCDU[0]/atsu-active", 1), props.globals.getNode("/MCDU[1]/atsu-active", 1)]; +# Conversion factor pounds to kilogram +LBS2KGS = 0.4535924; + + # Create Nodes: var pageSwitch = [props.globals.initNode("/MCDU[0]/internal/switch", 0, "BOOL"), props.globals.initNode("/MCDU[1]/internal/switch", 0, "BOOL")]; @@ -1454,7 +1459,7 @@ var canvas_MCDU_base = { me["Simple_L5"].setText("[ ]"); - me["Simple_L6"].setText("+4.0/+0.0"); + me["Simple_L6"].setText("+0.0/+1.0"); me["Simple_L1S"].setText(" ENG"); me["Simple_L2S"].setText(" ACTIVE NAV DATA BASE"); me["Simple_L3S"].setText(" SECOND NAV DATA BASE"); @@ -2252,7 +2257,11 @@ var canvas_MCDU_base = { } me["Simple_L1S"].setText("TAXI"); - me["Simple_L1"].setText(sprintf("%2.1f", fmgc.FMGCInternal.taxiFuel)); + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_L1"].setText(sprintf("%2.1f", fmgc.FMGCInternal.taxiFuel * LBS2KGS)); + } else { + me["Simple_L1"].setText(sprintf("%2.1f", fmgc.FMGCInternal.taxiFuel)); + } me["Simple_L2S"].setText("TRIP/TIME"); me["Simple_L3S"].setText("RTE RSV/PCT"); me["Simple_L4S"].setText("ALTN/TIME"); @@ -2278,7 +2287,11 @@ var canvas_MCDU_base = { if (fmgc.FMGCInternal.blockSet) { me["Simple_R2"].show(); me["INITB_Block"].hide(); - me["Simple_R2"].setText(sprintf("%3.1f", fmgc.FMGCInternal.block)); + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_R2"].setText(sprintf("%3.1f", fmgc.FMGCInternal.block * LBS2KGS)); + } else { + me["Simple_R2"].setText(sprintf("%3.1f", fmgc.FMGCInternal.block)); + } } else { me["Simple_R2"].hide(); me["INITB_Block"].show(); @@ -2346,7 +2359,11 @@ var canvas_MCDU_base = { me["Simple_L6"].setText("---.-"); me["Simple_R2"].show(); me["INITB_Block"].hide(); - me["Simple_R2"].setText(sprintf("%3.1f", fmgc.FMGCInternal.block)); + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_R2"].setText(sprintf("%3.1f", fmgc.FMGCInternal.block * LBS2KGS)); + } else { + me["Simple_R2"].setText(sprintf("%3.1f", fmgc.FMGCInternal.block)); + } me["Simple_R3S"].show(); me["Simple_R3"].show(); me["Simple_R3S"].setText("BLOCK"); @@ -2355,9 +2372,17 @@ var canvas_MCDU_base = { me["Simple_R3_Arrow"].setColor(AMBER); me["Simple_C4B"].show(); if (num(fmgc.FMGCInternal.tow) >= 100.0) { - me["Simple_C4B"].setText(sprintf(" %4.1f/", fmgc.FMGCInternal.tow)); + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_C4B"].setText(sprintf(" %4.1f/", fmgc.FMGCInternal.tow * LBS2KGS)); + } else { + me["Simple_C4B"].setText(sprintf(" %4.1f/", fmgc.FMGCInternal.tow)); + } } else { - me["Simple_C4B"].setText(sprintf(" %4.1f/", fmgc.FMGCInternal.tow)); + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_C4B"].setText(sprintf(" %4.1f/", fmgc.FMGCInternal.tow * LBS2KGS)); + } else { + me["Simple_C4B"].setText(sprintf(" %4.1f/", fmgc.FMGCInternal.tow)); + } } me["Simple_R4"].setText("---.-"); me["Simple_R6"].setText("---.-/----"); @@ -2391,15 +2416,27 @@ var canvas_MCDU_base = { me["Simple_L6"].setText("---.-"); me["Simple_R2"].show(); me["INITB_Block"].hide(); - me["Simple_R2"].setText(sprintf("%3.1f", fmgc.FMGCInternal.block)); + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_R2"].setText(sprintf("%3.1f", fmgc.FMGCInternal.block * LBS2KGS)); + } else { + me["Simple_R2"].setText(sprintf("%3.1f", fmgc.FMGCInternal.block)); + } me["Simple_R3S"].hide(); me["Simple_R3"].hide(); me["Simple_R3_Arrow"].hide(); me["Simple_C4B"].show(); if (num(fmgc.FMGCInternal.tow) >= 100.0) { - me["Simple_C4B"].setText(sprintf(" %4.1f/", fmgc.FMGCInternal.tow)); + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_C4B"].setText(sprintf(" %4.1f/", fmgc.FMGCInternal.tow * LBS2KGS)); + } else { + me["Simple_C4B"].setText(sprintf(" %4.1f/", fmgc.FMGCInternal.tow)); + } } else { - me["Simple_C4B"].setText(sprintf(" %4.1f/", fmgc.FMGCInternal.tow)); + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_C4B"].setText(sprintf(" %4.1f/", fmgc.FMGCInternal.tow * LBS2KGS)); + } else { + me["Simple_C4B"].setText(sprintf(" %4.1f/", fmgc.FMGCInternal.tow)); + } } me["Simple_R4"].setText("---.-"); me["Simple_R6"].setText("---.-/----"); @@ -2407,8 +2444,16 @@ var canvas_MCDU_base = { me.colorLeft("ack", "wht", "wht", "wht", "wht", "wht"); me.colorRight("ack", "blu", "ack", "wht", "ack", "wht"); } else { - me["Simple_L2"].setText(sprintf("%.1f/" ~ fmgc.FMGCInternal.tripTime, fmgc.FMGCInternal.tripFuel)); - me["Simple_L3"].setText(sprintf("%.1f", fmgc.FMGCInternal.rteRsv)); + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_L2"].setText(sprintf("%.1f/" ~ fmgc.FMGCInternal.tripTime, fmgc.FMGCInternal.tripFuel * LBS2KGS)); + } else { + me["Simple_L2"].setText(sprintf("%.1f/" ~ fmgc.FMGCInternal.tripTime, fmgc.FMGCInternal.tripFuel)); + } + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_L3"].setText(sprintf("%.1f", fmgc.FMGCInternal.rteRsv * LBS2KGS)); + } else { + me["Simple_L3"].setText(sprintf("%.1f", fmgc.FMGCInternal.rteRsv)); + } if (fmgc.FMGCInternal.rteRsvSet) { if (num(fmgc.FMGCInternal.rteRsv) > 9.9 and num(fmgc.FMGCInternal.rtePercent) > 9.9) { me["Simple_C3"].setText(sprintf("/%.1f ", fmgc.FMGCInternal.rtePercent)); @@ -2441,7 +2486,11 @@ var canvas_MCDU_base = { } } if (fmgc.FMGCInternal.altAirportSet) { - me["Simple_L4"].setText(sprintf("%.1f", fmgc.FMGCInternal.altFuel)); + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_L4"].setText(sprintf("%.1f", fmgc.FMGCInternal.altFuel * LBS2KGS)); + } else { + me["Simple_L4"].setText(sprintf("%.1f", fmgc.FMGCInternal.altFuel)); + } me["Simple_L4"].setColor(BLUE); me["Simple_C4"].show(); if (fmgc.FMGCInternal.altFuelSet) { @@ -2462,7 +2511,11 @@ var canvas_MCDU_base = { me["Simple_L4"].setColor(WHITE); me["Simple_C4"].hide(); } - me["Simple_L5"].setText(sprintf("%.1f", fmgc.FMGCInternal.finalFuel)); + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_L5"].setText(sprintf("%.1f", fmgc.FMGCInternal.finalFuel * LBS2KGS)); + } else { + me["Simple_L5"].setText(sprintf("%.1f", fmgc.FMGCInternal.finalFuel)); + } if (fmgc.FMGCInternal.finalTimeSet and fmgc.FMGCInternal.finalFuelSet) { if (num(fmgc.FMGCInternal.finalFuel) > 9.9) { me["Simple_C5"].setText(sprintf("/%s ", fmgc.FMGCInternal.finalTime)); @@ -2488,16 +2541,30 @@ var canvas_MCDU_base = { me["Simple_C5"].setText(sprintf("/%s ", fmgc.FMGCInternal.finalTime)); } } - me["Simple_L6"].setText(sprintf("%.1f", fmgc.FMGCInternal.minDestFob)); + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_L6"].setText(sprintf("%.1f", fmgc.FMGCInternal.minDestFob * LBS2KGS)); + } else { + me["Simple_L6"].setText(sprintf("%.1f", fmgc.FMGCInternal.minDestFob)); + } me["Simple_R2"].show(); me["INITB_Block"].hide(); - me["Simple_R2"].setText(sprintf("%3.1f", fmgc.FMGCInternal.block)); + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_R2"].setText(sprintf("%3.1f", fmgc.FMGCInternal.block * LBS2KGS)); + } else { + me["Simple_R2"].setText(sprintf("%3.1f", fmgc.FMGCInternal.block)); + } me["Simple_R3S"].hide(); me["Simple_R3"].hide(); me["Simple_R3_Arrow"].hide(); me["Simple_C4B"].hide(); - me["Simple_R4"].setText(sprintf("%4.1f/", fmgc.FMGCInternal.tow) ~ sprintf("%4.1f", fmgc.FMGCInternal.lw)); - me["Simple_R6"].setText(sprintf("%.1f/" ~ fmgc.FMGCInternal.extraTime, fmgc.FMGCInternal.extraFuel)); + + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_R4"].setText(sprintf("%4.1f/", fmgc.FMGCInternal.tow * LBS2KGS) ~ sprintf("%4.1f", fmgc.FMGCInternal.lw * LBS2KGS)); + me["Simple_R6"].setText(sprintf("%.1f/" ~ fmgc.FMGCInternal.extraTime, fmgc.FMGCInternal.extraFuel * LBS2KGS)); + } else { + me["Simple_R4"].setText(sprintf("%4.1f/", fmgc.FMGCInternal.tow) ~ sprintf("%4.1f", fmgc.FMGCInternal.lw)); + me["Simple_R6"].setText(sprintf("%.1f/" ~ fmgc.FMGCInternal.extraTime, fmgc.FMGCInternal.extraFuel)); + } me.colorLeft("ack", "grn", "blu", "ack", "blu", "blu"); me.colorRight("ack", "blu", "ack", "grn", "ack", "grn"); @@ -2519,9 +2586,17 @@ var canvas_MCDU_base = { if (fmgc.FMGCInternal.zfwSet) { if (fmgc.FMGCInternal.zfw < 100) { - me["Simple_C1"].setText(" " ~ sprintf("%3.1f", fmgc.FMGCInternal.zfw)); + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_C1"].setText(" " ~ sprintf("%3.1f", fmgc.FMGCInternal.zfw * LBS2KGS)); + } else { + me["Simple_C1"].setText(" " ~ sprintf("%3.1f", fmgc.FMGCInternal.zfw)); + } } else { - me["Simple_C1"].setText(" " ~ sprintf("%3.1f", fmgc.FMGCInternal.zfw)); + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_C1"].setText(" " ~ sprintf("%3.1f", fmgc.FMGCInternal.zfw * LBS2KGS)); + } else { + me["Simple_C1"].setText(" " ~ sprintf("%3.1f", fmgc.FMGCInternal.zfw)); + } } me["Simple_C1"].show(); me["INITB_ZFW"].hide(); @@ -2688,7 +2763,11 @@ var canvas_MCDU_base = { me.colorLeft("ack", "ack", "wht", "wht", "wht", "wht"); me.colorRight("ack", "ack", "ack", "wht", "wht", "wht"); } else { - me["Simple_L3"].setText(sprintf("%.1f", fmgc.FMGCInternal.rteRsv)); + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_L3"].setText(sprintf("%.1f", fmgc.FMGCInternal.rteRsv * LBS2KGS)); + } else { + me["Simple_L3"].setText(sprintf("%.1f", fmgc.FMGCInternal.rteRsv)); + } if (fmgc.FMGCInternal.rteRsvSet) { if (num(fmgc.FMGCInternal.rteRsv) > 9.9 and num(fmgc.FMGCInternal.rtePercent) > 9.9) { me["Simple_C3B"].setText(sprintf("/%.1f ", fmgc.FMGCInternal.rtePercent)); @@ -2721,7 +2800,11 @@ var canvas_MCDU_base = { } } if (fmgc.FMGCInternal.altAirportSet) { - me["Simple_L4"].setText(sprintf("%.1f", fmgc.FMGCInternal.altFuel)); + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_L4"].setText(sprintf("%.1f", fmgc.FMGCInternal.altFuel * LBS2KGS)); + } else { + me["Simple_L4"].setText(sprintf("%.1f", fmgc.FMGCInternal.altFuel)); + } me["Simple_L4"].setColor(BLUE); me["Simple_C4"].show(); if (fmgc.FMGCInternal.altFuelSet) { @@ -2742,7 +2825,11 @@ var canvas_MCDU_base = { me["Simple_L4"].setColor(WHITE); me["Simple_C4"].hide(); } - me["Simple_L5"].setText(sprintf("%.1f", fmgc.FMGCInternal.finalFuel)); + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_L5"].setText(sprintf("%.1f", fmgc.FMGCInternal.finalFuel * LBS2KGS)); + } else { + me["Simple_L5"].setText(sprintf("%.1f", fmgc.FMGCInternal.finalFuel)); + } if (fmgc.FMGCInternal.finalTimeSet and fmgc.FMGCInternal.finalFuelSet) { if (num(fmgc.FMGCInternal.finalFuel) > 9.9) { me["Simple_C5"].setText(sprintf("/%s ", fmgc.FMGCInternal.finalTime)); @@ -2768,10 +2855,17 @@ var canvas_MCDU_base = { me["Simple_C5"].setText(sprintf("/%s ", fmgc.FMGCInternal.finalTime)); } } - me["Simple_L6"].setText(sprintf("%.1f", fmgc.FMGCInternal.minDestFob)); - me["Simple_R4"].setText(sprintf("%4.1f/" ~ fmgc.FMGCInternal.fffqSensor, fmgc.FMGCInternal.fob)); - me["Simple_R5"].setText(sprintf("%4.1f/", fmgc.FMGCInternal.fuelPredGw) ~ sprintf("%4.1f", fmgc.FMGCInternal.cg)); - me["Simple_R6"].setText(sprintf("%4.1f/" ~ fmgc.FMGCInternal.extraTime, fmgc.FMGCInternal.extraFuel)); + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_L6"].setText(sprintf("%.1f", fmgc.FMGCInternal.minDestFob * LBS2KGS)); + me["Simple_R4"].setText(sprintf("%4.1f/" ~ fmgc.FMGCInternal.fffqSensor, fmgc.FMGCInternal.fob * LBS2KGS)); + me["Simple_R5"].setText(sprintf("%4.1f/", fmgc.FMGCInternal.fuelPredGw * LBS2KGS) ~ sprintf("%4.1f", fmgc.FMGCInternal.cg)); + me["Simple_R6"].setText(sprintf("%4.1f/" ~ fmgc.FMGCInternal.extraTime, fmgc.FMGCInternal.extraFuel * LBS2KGS)); + } else { + me["Simple_L6"].setText(sprintf("%.1f", fmgc.FMGCInternal.minDestFob)); + me["Simple_R4"].setText(sprintf("%4.1f/" ~ fmgc.FMGCInternal.fffqSensor, fmgc.FMGCInternal.fob)); + me["Simple_R5"].setText(sprintf("%4.1f/", fmgc.FMGCInternal.fuelPredGw) ~ sprintf("%4.1f", fmgc.FMGCInternal.cg)); + me["Simple_R6"].setText(sprintf("%4.1f/" ~ fmgc.FMGCInternal.extraTime, fmgc.FMGCInternal.extraFuel)); + } me.colorLeft("ack", "ack", "blu", "ack", "blu", "blu"); me.colorRight("ack", "ack", "blu", "grn", "grn", "grn"); @@ -2790,9 +2884,17 @@ var canvas_MCDU_base = { if (fmgc.FMGCInternal.zfwSet) { if (fmgc.FMGCInternal.zfw < 100) { - me["Simple_C3"].setText(" " ~ sprintf("%3.1f", fmgc.FMGCInternal.zfw)); + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_C3"].setText(" " ~ sprintf("%3.1f", fmgc.FMGCInternal.zfw * LBS2KGS)); + } else { + me["Simple_C3"].setText(" " ~ sprintf("%3.1f", fmgc.FMGCInternal.zfw)); + } } else { - me["Simple_C3"].setText(" " ~ sprintf("%3.1f", fmgc.FMGCInternal.zfw)); + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_C3"].setText(" " ~ sprintf("%3.1f", fmgc.FMGCInternal.zfw * LBS2KGS)); + } else { + me["Simple_C3"].setText(" " ~ sprintf("%3.1f", fmgc.FMGCInternal.zfw)); + } } me["Simple_C3"].show(); me["FUELPRED_ZFW"].hide(); From 6f0114457d0d1866b1ff1eb2bb7f8d62c280ea17 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R <legoboyvdlp@gmail.com> Date: Sat, 19 Sep 2020 14:43:44 +0100 Subject: [PATCH 02/16] Accept MCDU input in KG --- AircraftConfig/main.xml | 4 ++-- Models/Instruments/MCDU/MCDU.nas | 2 +- Nasal/MCDU/FUELPRED.nas | 21 +++++++++++++++++++ Nasal/MCDU/INITB.nas | 35 ++++++++++++++++++++++++++++++-- 4 files changed, 57 insertions(+), 5 deletions(-) diff --git a/AircraftConfig/main.xml b/AircraftConfig/main.xml index d7edd304..c97e3d27 100644 --- a/AircraftConfig/main.xml +++ b/AircraftConfig/main.xml @@ -243,7 +243,7 @@ </checkbox> <!-- TODO Comment back in, when fully implemented --> - <!-- checkbox> + <checkbox> <label>Weight in KG</label> <halign>left</halign> <property>/options/system/weight-kgs</property> @@ -261,7 +261,7 @@ </script> </binding> <live>true</live> - </checkbox --> + </checkbox> <checkbox> <label>ADIRS Aligns Instantly</label> diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index 353397db..0b15f0ff 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -159,7 +159,7 @@ var active = [props.globals.getNode("/MCDU[0]/active", 1), props.globals.getNode var activeAtsu = [props.globals.getNode("/MCDU[0]/atsu-active", 1), props.globals.getNode("/MCDU[1]/atsu-active", 1)]; # Conversion factor pounds to kilogram -LBS2KGS = 0.4535924; +var LBS2KGS = 0.4535924; # Create Nodes: diff --git a/Nasal/MCDU/FUELPRED.nas b/Nasal/MCDU/FUELPRED.nas index 59646a87..a899e351 100644 --- a/Nasal/MCDU/FUELPRED.nas +++ b/Nasal/MCDU/FUELPRED.nas @@ -15,6 +15,9 @@ var fuelPredInput = func(key, i) { mcdu_scratchpad.scratchpads[i].empty(); } else if (fmgc.FMGCInternal.tripFuel != 0) { var tf = num(scratchpad); + if (acconfig_weight_kgs.getValue() == 1) { + tf = tf / LBS2KGS; + } var tfs = size(scratchpad); if (tfs >= 2 and tfs <= 5 and find("/", scratchpad) == 0) { var perc = num(split("/", scratchpad)[1]); @@ -52,6 +55,9 @@ var fuelPredInput = func(key, i) { mcdu_scratchpad.scratchpads[i].empty(); } else if (find(".", scratchpad) != -1) { var tf = num(scratchpad); + if (acconfig_weight_kgs.getValue() == 1) { + tf = tf / LBS2KGS; + } var tfs = size(scratchpad); if (tfs >= 3 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 10.0) { fmgc.FMGCInternal.altFuel = tf; @@ -75,6 +81,9 @@ var fuelPredInput = func(key, i) { mcdu_scratchpad.scratchpads[i].empty(); } else if (find(".", scratchpad) != -1) { var tf = num(scratchpad); + if (acconfig_weight_kgs.getValue() == 1) { + tf = tf / LBS2KGS; + } var tfs = size(scratchpad); if (tfs >= 3 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 10.0) { fmgc.FMGCInternal.finalFuel = tf; @@ -86,6 +95,9 @@ var fuelPredInput = func(key, i) { } } else { var tf = num(scratchpad); + if (acconfig_weight_kgs.getValue() == 1) { + tf = tf / LBS2KGS; + } var tfs = size(scratchpad); if (tfs == 4 and tf != nil and ((tf >= 0 and tf <= 59) or (tf >= 100 and tf <= 130))) { fmgc.FMGCInternal.finalTime = scratchpad; @@ -104,6 +116,9 @@ var fuelPredInput = func(key, i) { mcdu_scratchpad.scratchpads[i].empty(); } else if (find(".", scratchpad) != -1) { var tf = num(scratchpad); + if (acconfig_weight_kgs.getValue() == 1) { + tf = tf / LBS2KGS; + } var tfs = size(scratchpad); if (tfs >= 3 and tfs <= 5 and tf != nil and tf >= 0 and tf <= 80.0) { fmgc.FMGCInternal.minDestFob = tf; @@ -142,6 +157,9 @@ var fuelPredInput = func(key, i) { } mcdu_scratchpad.scratchpads[i].empty(); } else if (find("/", scratchpad) != -1) { + if (acconfig_weight_kgs.getValue() == 1) { + scratchpad = scratchpad / LBS2KGS; + } var zfwi = split("/", scratchpad); var zfw = num(zfwi[0]); var zfwcg = num(zfwi[1]); @@ -180,6 +198,9 @@ var fuelPredInput = func(key, i) { mcdu_message(i, "NOT ALLOWED"); } } else if (num(scratchpad) != nil and size(scratchpad) > 0 and size(scratchpad) <= 5 and (find(".", scratchpad) == -1 or size(split(".", scratchpad)[1]) <= 1)) { + if (acconfig_weight_kgs.getValue() == 1) { + scratchpad = scratchpad / LBS2KGS; + } if (scratchpad >= zfw_min and scratchpad <= zfw_max) { fmgc.FMGCInternal.zfw = scratchpad; fmgc.FMGCInternal.zfwSet = 1; diff --git a/Nasal/MCDU/INITB.nas b/Nasal/MCDU/INITB.nas index 1694d1f4..2fc500c8 100644 --- a/Nasal/MCDU/INITB.nas +++ b/Nasal/MCDU/INITB.nas @@ -2,6 +2,10 @@ # Copyright (c) 2020 Matthew Maring (mattmaring) +var acconfig_weight_kgs = props.globals.getNode("/systems/acconfig/options/weight-kgs", 1); +# Conversion factor pounds to kilogram +var LBS2KGS = 0.4535924; + var initInputB = func(key, i) { var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad; if (key == "L1" and !getprop("/FMGC/internal/fuel-calculating")) { @@ -14,8 +18,11 @@ var initInputB = func(key, i) { setprop("/FMGC/internal/block-calculating", 1); } mcdu_scratchpad.scratchpads[i].empty(); - } else { + } else { var tfs = size(scratchpad); + if (acconfig_weight_kgs.getValue() == 1) { + scratchpad = scratchpad / LBS2KGS; + } if (tfs >= 1 and tfs <= 4) { if (num(scratchpad) != nil and scratchpad >= 0.0 and scratchpad <= 9.9) { fmgc.FMGCInternal.taxiFuel = scratchpad; @@ -43,6 +50,9 @@ var initInputB = func(key, i) { mcdu_scratchpad.scratchpads[i].empty(); } else if (fmgc.FMGCInternal.tripFuel != 0) { var tf = num(scratchpad); + if (acconfig_weight_kgs.getValue() == 1) { + tf = tf / LBS2KGS; + } var tfs = size(scratchpad); if (tfs >= 2 and tfs <= 5 and find("/", scratchpad) == 0) { var perc = num(split("/", scratchpad)[1]); @@ -80,6 +90,9 @@ var initInputB = func(key, i) { mcdu_scratchpad.scratchpads[i].empty(); } else if (find(".", scratchpad) != -1) { var tf = num(scratchpad); + if (acconfig_weight_kgs.getValue() == 1) { + tf = tf / LBS2KGS; + } var tfs = size(scratchpad); if (tfs >= 3 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 10.0) { fmgc.FMGCInternal.altFuel = tf; @@ -103,6 +116,9 @@ var initInputB = func(key, i) { mcdu_scratchpad.scratchpads[i].empty(); } else if (find(".", scratchpad) != -1) { var tf = num(scratchpad); + if (acconfig_weight_kgs.getValue() == 1) { + tf = tf / LBS2KGS; + } var tfs = size(scratchpad); if (tfs >= 3 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 10.0) { fmgc.FMGCInternal.finalFuel = tf; @@ -132,6 +148,9 @@ var initInputB = func(key, i) { mcdu_scratchpad.scratchpads[i].empty(); } else if (find(".", scratchpad) != -1) { var tf = num(scratchpad); + if (acconfig_weight_kgs.getValue() == 1) { + tf = tf / LBS2KGS; + } var tfs = size(scratchpad); if (tfs >= 3 and tfs <= 5 and tf != nil and tf >= 0 and tf <= 80.0) { fmgc.FMGCInternal.minDestFob = tf; @@ -153,6 +172,7 @@ var initInputB = func(key, i) { } else { var zfw_min = 80.6; #make based on performance var zfw_max = 134.5; #61,000 kg, make based on performance + if (size(scratchpad) == 0) { var zfw = getprop("/fdm/jsbsim/inertia/weight-lbs") - getprop("/consumables/fuel/total-fuel-lbs"); fmgc.FMGCInternal.zfw = sprintf("%3.1f", math.round(zfw / 1000, 0.1)); @@ -170,6 +190,9 @@ var initInputB = func(key, i) { } mcdu_scratchpad.scratchpads[i].empty(); } else if (find("/", scratchpad) != -1) { + if (acconfig_weight_kgs.getValue() == 1) { + scratchpad = scratchpad / LBS2KGS; + } var zfwi = split("/", scratchpad); var zfw = num(zfwi[0]); var zfwcg = num(zfwi[1]); @@ -208,6 +231,9 @@ var initInputB = func(key, i) { mcdu_message(i, "NOT ALLOWED"); } } else if (num(scratchpad) != nil and size(scratchpad) > 0 and size(scratchpad) <= 5 and (find(".", scratchpad) == -1 or size(split(".", scratchpad)[1]) <= 1)) { + if (acconfig_weight_kgs.getValue() == 1) { + scratchpad = scratchpad / LBS2KGS; + } if (scratchpad >= zfw_min and scratchpad <= zfw_max) { fmgc.FMGCInternal.zfw = scratchpad; fmgc.FMGCInternal.zfwSet = 1; @@ -274,7 +300,8 @@ var initInputB = func(key, i) { var tfs = size(scratchpad); var maxblock = getprop("/options/maxblock"); if (tfs == 0) { - fmgc.FMGCInternal.block = sprintf("%3.1f", math.round(getprop("/consumables/fuel/total-fuel-lbs") / 1000, 0.1)); + var block = math.round(getprop("/consumables/fuel/total-fuel-lbs") / 1000, 0.1); + fmgc.FMGCInternal.block = sprintf("%3.1f", block); fmgc.FMGCInternal.blockSet = 1; if (fmgc.FMGCInternal.zfwSet) { fmgc.FMGCInternal.tow = num(fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel); @@ -284,6 +311,10 @@ var initInputB = func(key, i) { setprop("/FMGC/internal/block-confirmed", 1); } } else if (tfs >= 1 and tfs <= 5) { + if (acconfig_weight_kgs.getValue() == 1) { + scratchpad = scratchpad / LBS2KGS; + } + if (num(scratchpad) != nil and scratchpad >= 1.0 and scratchpad <= maxblock) { fmgc.FMGCInternal.block = scratchpad; fmgc.FMGCInternal.blockSet = 1; From 4e13f3fa0582df990bf1365dfa16a82331ab8e47 Mon Sep 17 00:00:00 2001 From: fly <merspieler@airmail.cc> Date: Thu, 24 Sep 2020 15:48:16 +1000 Subject: [PATCH 03/16] Fix Refuel panel Signed-off-by: fly <merspieler@airmail.cc> --- gui/dialogs/refuel.nas | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/gui/dialogs/refuel.nas b/gui/dialogs/refuel.nas index 0085ebc6..63495a6e 100644 --- a/gui/dialogs/refuel.nas +++ b/gui/dialogs/refuel.nas @@ -6,7 +6,7 @@ # Distribute under the terms of GPLv2. # Conversion factor pounds to kilogram -LBS2KGS = 0.4535924; +var LBS2KGS = 0.4535924; if (pts.Sim.aero.getValue() == "A320-200-CFM") { max_fuel = 42.8; @@ -590,25 +590,45 @@ var refuelClass = { _fuelAdjustDn: func() { target = amount.getValue(); if (target > 0) { - amount.setValue(target - 0.1); - if (target - 0.1 >= 10.0) { - me._FQI_pre.setText(sprintf("%2.1f", target - 0.1)); + if (acconfig_weight_kgs.getValue() == 1) { + amount.setValue(target - 0.1 * LBS2KGS); + if ((target - 0.1) * LBS2KGS >= 10.0) { + me._FQI_pre.setText(sprintf("%2.1f", (target - 0.1) * LBS2KGS)); + } else { + me._FQI_pre.setText(sprintf("%2.2f", (target - 0.1) * LBS2KGS)); + } + systems.fuelSvc.Nodes.requestLbs.setValue((((target - 0.1) * LBS2KGS) - math.round(pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000, 0.1)) * 1000); } else { - me._FQI_pre.setText(sprintf("%2.2f", target - 0.1)); + amount.setValue(target - 0.1); + if (target - 0.1 >= 10.0) { + me._FQI_pre.setText(sprintf("%2.1f", target - 0.1)); + } else { + me._FQI_pre.setText(sprintf("%2.2f", target - 0.1)); + } + systems.fuelSvc.Nodes.requestLbs.setValue(((target - 0.1) - math.round(pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000, 0.1)) * 1000); } - systems.fuelSvc.Nodes.requestLbs.setValue(((target - 0.1) - math.round(pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000, 0.1)) * 1000); } }, _fuelAdjustUp: func() { target = amount.getValue(); if (target < max_fuel) { - amount.setValue(target + 0.1); - if (target + 0.1 >= 10.0) { - me._FQI_pre.setText(sprintf("%2.1f", target + 0.1)); + if (acconfig_weight_kgs.getValue() == 1) { + amount.setValue(target + 0.1); + if ((target + 0.1) * LBS2KGS >= 10.0) { + me._FQI_pre.setText(sprintf("%2.1f", (target + 0.1) * LBS2KGS)); + } else { + me._FQI_pre.setText(sprintf("%2.2f", (target + 0.1) * LBS2KGS)); + } + systems.fuelSvc.Nodes.requestLbs.setValue((((target + 0.1) * LBS2KGS) - math.round(pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000, 0.1)) * 1000); } else { - me._FQI_pre.setText(sprintf("%2.2f", target + 0.1)); + amount.setValue(target + 0.1); + if (target + 0.1 >= 10.0) { + me._FQI_pre.setText(sprintf("%2.1f", target + 0.1)); + } else { + me._FQI_pre.setText(sprintf("%2.2f", target + 0.1)); + } + systems.fuelSvc.Nodes.requestLbs.setValue(((target + 0.1) - math.round(pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000, 0.1)) * 1000); } - systems.fuelSvc.Nodes.requestLbs.setValue(((target + 0.1) - math.round(pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000, 0.1)) * 1000); } }, _onClose: func() { From f86c4901c667f057b191b6dffac4d4d0e2408388 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R <legoboyvdlp@gmail.com> Date: Sun, 27 Sep 2020 18:08:34 +0100 Subject: [PATCH 04/16] UPPER ECAM: Efficientize. Remove old code that isn't needed, and make the ECAM color switching faster --- Models/Instruments/Upper-ECAM/Upper-ECAM.nas | 632 ++++++------------ .../Instruments/Upper-ECAM/res/cfm-eis2.svg | 485 +------------- .../Instruments/Upper-ECAM/res/iae-eis2.svg | 483 +------------ Nasal/ECAM/ECAM-main.nas | 4 - Nasal/Libraries/property-tree-setup.nas | 4 + 5 files changed, 204 insertions(+), 1404 deletions(-) diff --git a/Models/Instruments/Upper-ECAM/Upper-ECAM.nas b/Models/Instruments/Upper-ECAM/Upper-ECAM.nas index 0a94ee83..a633a18f 100644 --- a/Models/Instruments/Upper-ECAM/Upper-ECAM.nas +++ b/Models/Instruments/Upper-ECAM/Upper-ECAM.nas @@ -6,18 +6,11 @@ var upperECAM_cfm_eis2 = nil; var upperECAM_iae_eis2 = nil; var upperECAM_test = nil; var upperECAM_display = nil; -var elapsedtime = 0; -var leftmsg = "XX"; -var rightmsg = "XX"; # Conversion factor pounds to kilogram LBS2KGS = 0.4535924; -var flapsPos = 0; - # Create Nodes: -var fuel_1 = props.globals.initNode("/engines/engine[0]/fuel-flow_actual", 0); -var fuel_2 = props.globals.initNode("/engines/engine[1]/fuel-flow_actual", 0); var EPR_1 = props.globals.initNode("/ECAM/Upper/EPR[0]", 0, "DOUBLE"); var EPR_2 = props.globals.initNode("/ECAM/Upper/EPR[1]", 0, "DOUBLE"); var EPR_thr_1 = props.globals.initNode("/ECAM/Upper/EPRthr[0]", 0); @@ -38,29 +31,10 @@ var slatLockFlash = props.globals.initNode("/instrumentation/du/slat-lock-flash" # Fetch nodes: var acconfig_weight_kgs = props.globals.getNode("/systems/acconfig/options/weight-kgs", 1); -var et = props.globals.getNode("/sim/time/elapsed-sec", 1); var acconfig = props.globals.getNode("/systems/acconfig/autoconfig-running", 1); var eng_option = props.globals.getNode("/options/eng", 1); var du3_lgt = props.globals.getNode("/controls/lighting/DU/du3", 1); -var rev_1 = props.globals.getNode("/engines/engine[0]/reverser-pos-norm", 1); -var rev_2 = props.globals.getNode("/engines/engine[1]/reverser-pos-norm", 1); -var fuel = props.globals.getNode("/consumables/fuel/total-fuel-lbs", 1); -var modeautobrake = props.globals.getNode("/controls/autobrake/mode", 1); -var speedbrakearm = props.globals.getNode("/controls/flight/speedbrake-arm", 1); -var ECAMtoconfig = props.globals.getNode("/ECAM/to-config", 1); -var gear = props.globals.getNode("/gear/gear[1]/position-norm", 1); -var smoke = props.globals.getNode("/controls/lighting/no-smoking-sign", 1); -var seatbelt = props.globals.getNode("/controls/lighting/seatbelt-sign", 1); var flaps3_ovr = props.globals.getNode("/instrumentation/mk-viii/inputs/discretes/momentary-flap-3-override", 1); -var wow0 = props.globals.getNode("/gear/gear[0]/wow"); -var eng1_n1 = props.globals.getNode("/engines/engine[0]/n1-actual", 1); -var eng2_n1 = props.globals.getNode("/engines/engine[1]/n1-actual", 1); -var eng1_n2 = props.globals.getNode("/engines/engine[0]/n2-actual", 1); -var eng2_n2 = props.globals.getNode("/engines/engine[1]/n2-actual", 1); -var eng1_epr = props.globals.getNode("/engines/engine[0]/epr-actual", 1); -var eng2_epr = props.globals.getNode("/engines/engine[1]/epr-actual", 1); -var eng1_egt = props.globals.getNode("/engines/engine[0]/egt-actual", 1); -var eng2_egt = props.globals.getNode("/engines/engine[1]/egt-actual", 1); var fadecpower_1 = props.globals.getNode("/systems/fadec/powered1", 1); var fadecpower_2 = props.globals.getNode("/systems/fadec/powered2", 1); var fadecpowerup = props.globals.getNode("/systems/fadec/powerup", 1); @@ -83,11 +57,57 @@ var ECAM_line5c = props.globals.getNode("/ECAM/msg/linec5", 1); var ECAM_line6c = props.globals.getNode("/ECAM/msg/linec6", 1); var ECAM_line7c = props.globals.getNode("/ECAM/msg/linec7", 1); var ECAM_line8c = props.globals.getNode("/ECAM/msg/linec8", 1); -var ECAMleft = props.globals.getNode("/ECAM/left-msg", 1); -var ECAMright = props.globals.getNode("/ECAM/right-msg", 1); -var slatsLocked = props.globals.getNode("/fdm/jsbsim/fcs/slat-locked", 1); +var ECAM_line1r = props.globals.getNode("/ECAM/rightmsg/line1", 1); +var ECAM_line2r = props.globals.getNode("/ECAM/rightmsg/line2", 1); +var ECAM_line3r = props.globals.getNode("/ECAM/rightmsg/line3", 1); +var ECAM_line4r = props.globals.getNode("/ECAM/rightmsg/line4", 1); +var ECAM_line5r = props.globals.getNode("/ECAM/rightmsg/line5", 1); +var ECAM_line6r = props.globals.getNode("/ECAM/rightmsg/line6", 1); +var ECAM_line7r = props.globals.getNode("/ECAM/rightmsg/line7", 1); +var ECAM_line8r = props.globals.getNode("/ECAM/rightmsg/line8", 1); +var ECAM_line1rc = props.globals.getNode("/ECAM/rightmsg/linec1", 1); +var ECAM_line2rc = props.globals.getNode("/ECAM/rightmsg/linec2", 1); +var ECAM_line3rc = props.globals.getNode("/ECAM/rightmsg/linec3", 1); +var ECAM_line4rc = props.globals.getNode("/ECAM/rightmsg/linec4", 1); +var ECAM_line5rc = props.globals.getNode("/ECAM/rightmsg/linec5", 1); +var ECAM_line6rc = props.globals.getNode("/ECAM/rightmsg/linec6", 1); +var ECAM_line7rc = props.globals.getNode("/ECAM/rightmsg/linec7", 1); +var ECAM_line8rc = props.globals.getNode("/ECAM/rightmsg/linec8", 1); var rate = props.globals.getNode("/systems/acconfig/options/uecam-rate", 1); +# Temporary variables +var cur_eng_option = 0; +var elapsedtime = 0; +var EGT_1_cur = 0; +var EGT_2_cur = 0; +var eprLimit = 0; +var EPR_1_cur = 0; +var EPR_2_cur = 0; +var EPR_1_act = 0; +var EPR_2_act = 0; +var EPR_lim_cur = 0; +var EPR_thr_1_act = 0; +var EPR_thr_2_act = 0; +var flapsPos = 0; +var fuel1 = 0; +var fuel2 = 0; +var fadecPower1 = 0; +var fadecPower2 = 0; +var fadecPowerStart = 0; +var n1Limit = 0; +var N1_1_cur = 0; +var N1_2_cur = 0; +var N1_1_act = 0; +var N1_2_act = 0; +var N1_lim_cur = 0; +var n2cur_1 = 0; +var n2cur_2 = 0; +var rev_1_act = 0; +var rev_2_act = 0; +var rev_1_cur = 0; +var rev_2_cur = 0; +var thrLimit = 0; + var canvas_upperECAM_base = { init: func(canvas_group, file) { var font_mapper = func(family, weight) { @@ -128,16 +148,16 @@ var canvas_upperECAM_base = { return []; }, updateDu3: func() { - var elapsedtime = et.getValue(); + elapsedtime = pts.Sim.Time.elapsedSec.getValue(); if (systems.ELEC.Bus.acEss.getValue() >= 110) { if (du3_offtime.getValue() + 3 < elapsedtime) { - if (wow0.getValue() == 1) { + if (pts.Gear.wow[0].getValue()) { if (acconfig.getValue() != 1 and du3_test.getValue() != 1) { du3_test.setValue(1); du3_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1)); du3_test_time.setValue(elapsedtime); - } else if (acconfig.getValue() == 1 and du3_test.getValue() != 1) { + } else if (acconfig.getValue() and du3_test.getValue() != 1) { du3_test.setValue(1); du3_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1)); du3_test_time.setValue(elapsedtime - 30); @@ -154,9 +174,9 @@ var canvas_upperECAM_base = { } }, update: func() { - var elapsedtime = et.getValue(); - + elapsedtime = pts.Sim.Time.elapsedSec.getValue(); cur_eng_option = eng_option.getValue(); + if (systems.ELEC.Bus.acEss.getValue() >= 110 and du3_lgt.getValue() > 0.01) { if (du3_test_time.getValue() + du3_test_amount.getValue() >= elapsedtime) { upperECAM_cfm_eis2.page.hide(); @@ -181,10 +201,27 @@ var canvas_upperECAM_base = { upperECAM_iae_eis2.page.hide(); } }, + getColorString: func(color) { + if (color == "w") { + return [0.8078,0.8039,0.8078]; + } else if (color == "m") { + return [0.6901,0.3333,0.7450]; + } else if (color == "c") { + return [0.0901,0.6039,0.7176]; + } else if (color == "g") { + return [0.0509,0.7529,0.2941]; + } else if (color == "a") { + return [0.7333,0.3803,0]; + } else if (color == "r") { + return [1,0,0]; + } else { + return [1,1,1]; + } + }, updateBase: func() { # Reversers - rev_1_cur = rev_1.getValue(); - rev_2_cur = rev_2.getValue(); + rev_1_cur = pts.Engines.Engine.reverser[0].getValue(); + rev_2_cur = pts.Engines.Engine.reverser[1].getValue(); cur_eng_option = eng_option.getValue(); if (rev_1_cur >= 0.01 and fadec.FADEC.Eng1.n1 == 1 and cur_eng_option == "CFM") { me["REV1"].show(); @@ -242,13 +279,13 @@ var canvas_upperECAM_base = { me["FlapDots"].hide(); } - if (slatsLocked.getValue() == 1) { + if (pts.Fdm.JSBsim.Fcs.slatLocked.getValue()) { if (slatLockGoing == 0) { slatLockGoing = 1; } if (slatLockGoing == 1) { slatLockTimer.start(); - if (slatLockFlash.getValue() == 1) { + if (slatLockFlash.getValue()) { me["SlatAlphaLock"].show(); } else { me["SlatAlphaLock"].hide(); @@ -261,362 +298,38 @@ var canvas_upperECAM_base = { } # FOB - if (acconfig_weight_kgs.getValue() == 1) + if (acconfig_weight_kgs.getValue()) { - me["FOB-LBS"].setText(sprintf("%s", math.round(fuel.getValue() * LBS2KGS, 10))); + me["FOB-LBS"].setText(sprintf("%s", math.round(pts.Consumables.Fuel.totalFuelLbs.getValue() * LBS2KGS, 10))); me["FOB-weight-unit"].setText("KG"); } else { - me["FOB-LBS"].setText(sprintf("%s", math.round(fuel.getValue(), 10))); + me["FOB-LBS"].setText(sprintf("%s", math.round(pts.Consumables.Fuel.totalFuelLbs.getValue(), 10))); me["FOB-weight-unit"].setText("LBS"); } - # Left ECAM Messages - line1c = ECAM_line1c.getValue(); - line2c = ECAM_line2c.getValue(); - line3c = ECAM_line3c.getValue(); - line4c = ECAM_line4c.getValue(); - line5c = ECAM_line5c.getValue(); - line6c = ECAM_line6c.getValue(); - line7c = ECAM_line7c.getValue(); - line8c = ECAM_line8c.getValue(); - leftmsg = ECAMleft.getValue(); - rightmsg = ECAMright.getValue(); + # ECAM Messages - if (leftmsg == "MSG") { - me["ECAML1"].setText(sprintf("%s", ECAM_line1.getValue())); - me["ECAML2"].setText(sprintf("%s", ECAM_line2.getValue())); - me["ECAML3"].setText(sprintf("%s", ECAM_line3.getValue())); - me["ECAML4"].setText(sprintf("%s", ECAM_line4.getValue())); - me["ECAML5"].setText(sprintf("%s", ECAM_line5.getValue())); - me["ECAML6"].setText(sprintf("%s", ECAM_line6.getValue())); - me["ECAML7"].setText(sprintf("%s", ECAM_line7.getValue())); - me["ECAML8"].setText(sprintf("%s", ECAM_line8.getValue())); + me["ECAML1"].setText(sprintf("%s", ECAM_line1.getValue())); + me["ECAML2"].setText(sprintf("%s", ECAM_line2.getValue())); + me["ECAML3"].setText(sprintf("%s", ECAM_line3.getValue())); + me["ECAML4"].setText(sprintf("%s", ECAM_line4.getValue())); + me["ECAML5"].setText(sprintf("%s", ECAM_line5.getValue())); + me["ECAML6"].setText(sprintf("%s", ECAM_line6.getValue())); + me["ECAML7"].setText(sprintf("%s", ECAM_line7.getValue())); + me["ECAML8"].setText(sprintf("%s", ECAM_line8.getValue())); - if (line1c == "w") { - me["ECAML1"].setColor(0.8078,0.8039,0.8078); - } else if (line1c == "c") { - me["ECAML1"].setColor(0.0901,0.6039,0.7176); - } else if (line1c == "g") { - me["ECAML1"].setColor(0.0509,0.7529,0.2941); - } else if (line1c == "a") { - me["ECAML1"].setColor(0.7333,0.3803,0); - } else if (line1c == "r") { - me["ECAML1"].setColor(1,0,0); - } - - if (line2c == "w") { - me["ECAML2"].setColor(0.8078,0.8039,0.8078); - } else if (line2c == "c") { - me["ECAML2"].setColor(0.0901,0.6039,0.7176); - } else if (line2c == "g") { - me["ECAML2"].setColor(0.0509,0.7529,0.2941); - } else if (line2c == "a") { - me["ECAML2"].setColor(0.7333,0.3803,0); - } else if (line2c == "r") { - me["ECAML2"].setColor(1,0,0); - } - - if (line3c == "w") { - me["ECAML3"].setColor(0.8078,0.8039,0.8078); - } else if (line3c == "c") { - me["ECAML3"].setColor(0.0901,0.6039,0.7176); - } else if (line3c == "g") { - me["ECAML3"].setColor(0.0509,0.7529,0.2941); - } else if (line3c == "a") { - me["ECAML3"].setColor(0.7333,0.3803,0); - } else if (line3c == "r") { - me["ECAML3"].setColor(1,0,0); - } - - if (line4c == "w") { - me["ECAML4"].setColor(0.8078,0.8039,0.8078); - } else if (line4c == "c") { - me["ECAML4"].setColor(0.0901,0.6039,0.7176); - } else if (line4c == "g") { - me["ECAML4"].setColor(0.0509,0.7529,0.2941); - } else if (line4c == "a") { - me["ECAML4"].setColor(0.7333,0.3803,0); - } else if (line4c == "r") { - me["ECAML4"].setColor(1,0,0); - } - - if (line5c == "w") { - me["ECAML5"].setColor(0.8078,0.8039,0.8078); - } else if (line5c == "c") { - me["ECAML5"].setColor(0.0901,0.6039,0.7176); - } else if (line5c == "g") { - me["ECAML5"].setColor(0.0509,0.7529,0.2941); - } else if (line5c == "a") { - me["ECAML5"].setColor(0.7333,0.3803,0); - } else if (line5c == "r") { - me["ECAML5"].setColor(1,0,0); - } - - if (line6c == "w") { - me["ECAML6"].setColor(0.8078,0.8039,0.8078); - } else if (line6c == "c") { - me["ECAML6"].setColor(0.0901,0.6039,0.7176); - } else if (line6c == "g") { - me["ECAML6"].setColor(0.0509,0.7529,0.2941); - } else if (line6c == "a") { - me["ECAML6"].setColor(0.7333,0.3803,0); - } else if (line6c == "r") { - me["ECAML6"].setColor(1,0,0); - } - - if (line7c == "w") { - me["ECAML7"].setColor(0.8078,0.8039,0.8078); - } else if (line7c == "c") { - me["ECAML7"].setColor(0.0901,0.6039,0.7176); - } else if (line7c == "g") { - me["ECAML7"].setColor(0.0509,0.7529,0.2941); - } else if (line7c == "a") { - me["ECAML7"].setColor(0.7333,0.3803,0); - } else if (line7c == "r") { - me["ECAML7"].setColor(1,0,0); - } - - if (line8c == "w") { - me["ECAML8"].setColor(0.8078,0.8039,0.8078); - } else if (line8c == "c") { - me["ECAML8"].setColor(0.0901,0.6039,0.7176); - } else if (line8c == "g") { - me["ECAML8"].setColor(0.0509,0.7529,0.2941); - } else if (line8c == "a") { - me["ECAML8"].setColor(0.7333,0.3803,0); - } else if (line8c == "r") { - me["ECAML8"].setColor(1,0,0); - } - - me["TO_Memo"].hide(); - me["LDG_Memo"].hide(); - me["ECAM_Left"].show(); - } else if (leftmsg == "TO-MEMO") { - modebrk = modeautobrake.getValue(); - if (modebrk == 3) { - me["TO_Autobrake"].setText("AUTO BRK MAX"); - me["TO_Autobrake_B"].hide(); - } else { - me["TO_Autobrake"].setText("AUTO BRK"); - me["TO_Autobrake_B"].show(); - } - - if (smoke.getValue() == 1 and seatbelt.getValue() == 1) { - me["TO_Signs"].setText("SIGNS ON"); - me["TO_Signs_B"].hide(); - } else { - me["TO_Signs"].setText("SIGNS"); - me["TO_Signs_B"].show(); - } - - if (speedbrakearm.getValue() == 1) { - me["TO_Spoilers"].setText("SPLRS ARM"); - me["TO_Spoilers_B"].hide(); - } else { - me["TO_Spoilers"].setText("SPLRS"); - me["TO_Spoilers_B"].show(); - } - - if (flapsPos > 0 and flapsPos < 5) { - me["TO_Flaps"].setText("FLAPS T.O"); - me["TO_Flaps_B"].hide(); - } else { - me["TO_Flaps"].setText("FLAPS"); - me["TO_Flaps_B"].show(); - } - - if (ECAMtoconfig.getValue() == 1) { - me["TO_Config"].setText("T.O CONFIG NORMAL"); - me["TO_Config_B"].hide(); - } else { - me["TO_Config"].setText("T.O CONFIG"); - me["TO_Config_B"].show(); - } - - me["ECAM_Left"].hide(); - me["LDG_Memo"].hide(); - me["TO_Memo"].show(); - } else if (leftmsg == "LDG-MEMO") { - if (gear.getValue() == 1) { - me["LDG_Gear"].setText("LDG GEAR DN"); - me["LDG_Gear_B"].hide(); - } else { - me["LDG_Gear"].setText("LDG GEAR"); - me["LDG_Gear_B"].show(); - } - - if (smoke.getValue() == 1 and seatbelt.getValue() == 1) { - me["LDG_Signs"].setText("SIGNS ON"); - me["LDG_Signs_B"].hide(); - } else { - me["LDG_Signs"].setText("SIGNS"); - me["LDG_Signs_B"].show(); - } - - if (speedbrakearm.getValue() == 1) { - me["LDG_Spoilers"].setText("SPLRS ARM"); - me["LDG_Spoilers_B"].hide(); - } else { - me["LDG_Spoilers"].setText("SPLRS"); - me["LDG_Spoilers_B"].show(); - } - - flaps3 = flaps3_ovr.getValue(); - if (flaps3 != 1 and flapsPos == 5) { - me["LDG_Flaps"].setText("FLAPS FULL"); - me["LDG_Flaps_B"].hide(); - me["LDG_Flaps_B3"].hide(); - } else if (flaps3 == 1 and flapsPos >= 4) { - me["LDG_Flaps"].setText("FLAPS 3"); - me["LDG_Flaps_B"].hide(); - me["LDG_Flaps_B3"].hide(); - } else { - me["LDG_Flaps"].setText("FLAPS"); - if (flaps3 == 1) { - me["LDG_Flaps_B"].hide(); - me["LDG_Flaps_B3"].show(); - } else { - me["LDG_Flaps_B3"].hide(); - me["LDG_Flaps_B"].show(); - } - } - - me["ECAM_Left"].hide(); - me["TO_Memo"].hide(); - me["LDG_Memo"].show(); - } else { - me["ECAM_Left"].hide(); - me["TO_Memo"].hide(); - me["LDG_Memo"].hide(); - } + me["ECAM_Left"].show(); - # Right ECAM Messages - if (rightmsg == "MSG") { - me["ECAMR1"].setText(sprintf("%s", getprop("/ECAM/rightmsg/line1"))); - me["ECAMR2"].setText(sprintf("%s", getprop("/ECAM/rightmsg/line2"))); - me["ECAMR3"].setText(sprintf("%s", getprop("/ECAM/rightmsg/line3"))); - me["ECAMR4"].setText(sprintf("%s", getprop("/ECAM/rightmsg/line4"))); - me["ECAMR5"].setText(sprintf("%s", getprop("/ECAM/rightmsg/line5"))); - me["ECAMR6"].setText(sprintf("%s", getprop("/ECAM/rightmsg/line6"))); - me["ECAMR7"].setText(sprintf("%s", getprop("/ECAM/rightmsg/line7"))); - me["ECAMR8"].setText(sprintf("%s", getprop("/ECAM/rightmsg/line8"))); + me["ECAMR1"].setText(sprintf("%s", ECAM_line1r.getValue())); + me["ECAMR2"].setText(sprintf("%s", ECAM_line2r.getValue())); + me["ECAMR3"].setText(sprintf("%s", ECAM_line3r.getValue())); + me["ECAMR4"].setText(sprintf("%s", ECAM_line4r.getValue())); + me["ECAMR5"].setText(sprintf("%s", ECAM_line5r.getValue())); + me["ECAMR6"].setText(sprintf("%s", ECAM_line6r.getValue())); + me["ECAMR7"].setText(sprintf("%s", ECAM_line7r.getValue())); + me["ECAMR8"].setText(sprintf("%s", ECAM_line8r.getValue())); - if (getprop("/ECAM/rightmsg/linec1") == "w") { - me["ECAMR1"].setColor(0.8078,0.8039,0.8078); - } else if (getprop("/ECAM/rightmsg/linec1") == "c") { - me["ECAMR1"].setColor(0.0901,0.6039,0.7176); - } else if (getprop("/ECAM/rightmsg/linec1") == "g") { - me["ECAMR1"].setColor(0.0509,0.7529,0.2941); - } else if (getprop("/ECAM/rightmsg/linec1") == "a") { - me["ECAMR1"].setColor(0.7333,0.3803,0); - } else if (getprop("/ECAM/rightmsg/linec1") == "r") { - me["ECAMR1"].setColor(1,0,0); - } else if (getprop("/ECAM/rightmsg/linec1") == "m") { - me["ECAMR1"].setColor(0.6901,0.3333,0.7450); - } - - if (getprop("/ECAM/rightmsg/linec2") == "w") { - me["ECAMR2"].setColor(0.8078,0.8039,0.8078); - } else if (getprop("/ECAM/rightmsg/linec2") == "c") { - me["ECAMR2"].setColor(0.0901,0.6039,0.7176); - } else if (getprop("/ECAM/rightmsg/linec2") == "g") { - me["ECAMR2"].setColor(0.0509,0.7529,0.2941); - } else if (getprop("/ECAM/rightmsg/linec2") == "a") { - me["ECAMR2"].setColor(0.7333,0.3803,0); - } else if (getprop("/ECAM/rightmsg/linec2") == "r") { - me["ECAMR2"].setColor(1,0,0); - } else if (getprop("/ECAM/rightmsg/linec2") == "m") { - me["ECAMR2"].setColor(0.6901,0.3333,0.7450); - } - - if (getprop("/ECAM/rightmsg/linec3") == "w") { - me["ECAMR3"].setColor(0.8078,0.8039,0.8078); - } else if (getprop("/ECAM/rightmsg/linec3") == "c") { - me["ECAMR3"].setColor(0.0901,0.6039,0.7176); - } else if (getprop("/ECAM/rightmsg/linec3") == "g") { - me["ECAMR3"].setColor(0.0509,0.7529,0.2941); - } else if (getprop("/ECAM/rightmsg/linec3") == "a") { - me["ECAMR3"].setColor(0.7333,0.3803,0); - } else if (getprop("/ECAM/rightmsg/linec3") == "r") { - me["ECAMR3"].setColor(1,0,0); - } else if (getprop("/ECAM/rightmsg/linec3") == "m") { - me["ECAMR3"].setColor(0.6901,0.3333,0.7450); - } - - if (getprop("/ECAM/rightmsg/linec4") == "w") { - me["ECAMR4"].setColor(0.8078,0.8039,0.8078); - } else if (getprop("/ECAM/rightmsg/linec4") == "c") { - me["ECAMR4"].setColor(0.0901,0.6039,0.7176); - } else if (getprop("/ECAM/rightmsg/linec4") == "g") { - me["ECAMR4"].setColor(0.0509,0.7529,0.2941); - } else if (getprop("/ECAM/rightmsg/linec4") == "a") { - me["ECAMR4"].setColor(0.7333,0.3803,0); - } else if (getprop("/ECAM/rightmsg/linec4") == "r") { - me["ECAMR4"].setColor(1,0,0); - } else if (getprop("/ECAM/rightmsg/linec4") == "m") { - me["ECAMR4"].setColor(0.6901,0.3333,0.7450); - } - - if (getprop("/ECAM/rightmsg/linec5") == "w") { - me["ECAMR5"].setColor(0.8078,0.8039,0.8078); - } else if (getprop("/ECAM/rightmsg/linec5") == "c") { - me["ECAMR5"].setColor(0.0901,0.6039,0.7176); - } else if (getprop("/ECAM/rightmsg/linec5") == "g") { - me["ECAMR5"].setColor(0.0509,0.7529,0.2941); - } else if (getprop("/ECAM/rightmsg/linec5") == "a") { - me["ECAMR5"].setColor(0.7333,0.3803,0); - } else if (getprop("/ECAM/rightmsg/linec5") == "r") { - me["ECAMR5"].setColor(1,0,0); - } else if (getprop("/ECAM/rightmsg/linec5") == "m") { - me["ECAMR5"].setColor(0.6901,0.3333,0.7450); - } - - if (getprop("/ECAM/rightmsg/linec6") == "w") { - me["ECAMR6"].setColor(0.8078,0.8039,0.8078); - } else if (getprop("/ECAM/rightmsg/linec6") == "c") { - me["ECAMR6"].setColor(0.0901,0.6039,0.7176); - } else if (getprop("/ECAM/rightmsg/linec6") == "g") { - me["ECAMR6"].setColor(0.0509,0.7529,0.2941); - } else if (getprop("/ECAM/rightmsg/linec6") == "a") { - me["ECAMR6"].setColor(0.7333,0.3803,0); - } else if (getprop("/ECAM/rightmsg/linec6") == "r") { - me["ECAMR6"].setColor(1,0,0); - } else if (getprop("/ECAM/rightmsg/linec6") == "m") { - me["ECAMR6"].setColor(0.6901,0.3333,0.7450); - } - - if (getprop("/ECAM/rightmsg/linec7") == "w") { - me["ECAMR7"].setColor(0.8078,0.8039,0.8078); - } else if (getprop("/ECAM/rightmsg/linec7") == "c") { - me["ECAMR7"].setColor(0.0901,0.6039,0.7176); - } else if (getprop("/ECAM/rightmsg/linec7") == "g") { - me["ECAMR7"].setColor(0.0509,0.7529,0.2941); - } else if (getprop("/ECAM/rightmsg/linec7") == "a") { - me["ECAMR7"].setColor(0.7333,0.3803,0); - } else if (getprop("/ECAM/rightmsg/linec7") == "r") { - me["ECAMR7"].setColor(1,0,0); - } else if (getprop("/ECAM/rightmsg/linec7") == "m") { - me["ECAMR7"].setColor(0.6901,0.3333,0.7450); - } - - if (getprop("/ECAM/rightmsg/linec8") == "w") { - me["ECAMR8"].setColor(0.8078,0.8039,0.8078); - } else if (getprop("/ECAM/rightmsg/linec8") == "c") { - me["ECAMR8"].setColor(0.0901,0.6039,0.7176); - } else if (getprop("/ECAM/rightmsg/linec8") == "g") { - me["ECAMR8"].setColor(0.0509,0.7529,0.2941); - } else if (getprop("/ECAM/rightmsg/linec8") == "a") { - me["ECAMR8"].setColor(0.7333,0.3803,0); - } else if (getprop("/ECAM/rightmsg/linec8") == "r") { - me["ECAMR8"].setColor(1,0,0); - } else if (getprop("/ECAM/rightmsg/linec8") == "m") { - me["ECAMR8"].setColor(0.6901,0.3333,0.7450); - } - - me["ECAM_Right"].show(); - } else { - me["ECAM_Right"].hide(); - } + me["ECAM_Right"].show(); }, }; @@ -631,25 +344,24 @@ var canvas_upperECAM_cfm_eis2 = { return ["N11-needle","N11-thr","N11-ylim","N11","N11-decpnt","N11-decimal","N11-box","N11-scale","N11-scale2","N11-scaletick","N11-scalenum","N11-XX","N11-XX2","N11-XX-box","EGT1-needle","EGT1","EGT1-scale","EGT1-box","EGT1-scale2","EGT1-scaletick", "EGT1-XX","N21","N21-decpnt","N21-decimal","N21-XX","FF1","FF1-XX","N12-needle","N12-thr","N12-ylim","N12","N12-decpnt","N12-decimal","N12-box","N12-scale","N12-scale2","N12-scaletick","N12-scalenum","N12-XX","N12-XX2","N12-XX-box","EGT2-needle","EGT2", "EGT2-scale","EGT2-box","EGT2-scale2","EGT2-scaletick","EGT2-XX","N22","N22-decpnt","N22-decimal","N22-XX","FF2","FF2-XX","FOB-LBS","FlapTxt","FlapDots","N1Lim-mode","N1Lim","N1Lim-decpnt","N1Lim-decimal","N1Lim-percent","N1Lim-XX","N1Lim-XX2","REV1", - "REV1-box","REV2","REV2-box","ECAM_Left","ECAML1","ECAML2","ECAML3","ECAML4","ECAML5","ECAML6","ECAML7","ECAML8","ECAMR1", "ECAMR2", "ECAMR3", "ECAMR4", "ECAMR5", "ECAMR6", "ECAMR7", "ECAMR8", "ECAM_Right", "TO_Memo","TO_Autobrake","TO_Signs","TO_Spoilers","TO_Flaps","TO_Config","TO_Autobrake_B","TO_Signs_B","TO_Spoilers_B","TO_Flaps_B", - "TO_Config_B","LDG_Memo","LDG_Gear","LDG_Signs","LDG_Spoilers","LDG_Flaps","LDG_Gear_B","LDG_Signs_B","LDG_Spoilers_B","LDG_Flaps_B","LDG_Flaps_B3", + "REV1-box","REV2","REV2-box","ECAM_Left","ECAML1","ECAML2","ECAML3","ECAML4","ECAML5","ECAML6","ECAML7","ECAML8","ECAMR1", "ECAMR2", "ECAMR3", "ECAMR4", "ECAMR5", "ECAMR6", "ECAMR7", "ECAMR8", "ECAM_Right", "FOB-weight-unit","FFlow-weight-unit","SlatAlphaLock"]; }, update: func() { # N1 N1_1_cur = N1_1.getValue(); N1_2_cur = N1_2.getValue(); - N1_1_act = eng1_n1.getValue(); - N1_2_act = eng2_n1.getValue(); + N1_1_act = pts.Engines.Engine.n1Actual[0].getValue(); + N1_2_act = pts.Engines.Engine.n1Actual[1].getValue(); N1_lim_cur = N1_lim.getValue(); N1_thr_1_act = N1_thr_1.getValue(); N1_thr_2_act = N1_thr_2.getValue(); - rev_1_act = rev_1.getValue(); - rev_2_act = rev_2.getValue(); + rev_1_act = pts.Engines.Engine.reverser[0].getValue(); + rev_2_act = pts.Engines.Engine.reverser[1].getValue(); EGT_1_cur = EGT_1.getValue(); EGT_2_cur = EGT_2.getValue(); - n2cur_1 = eng1_n2.getValue(); - n2cur_2 = eng2_n2.getValue(); + n2cur_1 = pts.Engines.Engine.n2Actual[0].getValue(); + n2cur_2 = pts.Engines.Engine.n2Actual[1].getValue(); me["N11"].setText(sprintf("%s", math.floor(N1_1_act + 0.05))); me["N11-decimal"].setText(sprintf("%s", int(10 * math.mod(N1_1_act + 0.05, 1)))); @@ -738,8 +450,8 @@ var canvas_upperECAM_cfm_eis2 = { } # EGT - me["EGT1"].setText(sprintf("%s", math.round(eng1_egt.getValue()))); - me["EGT2"].setText(sprintf("%s", math.round(eng2_egt.getValue()))); + me["EGT1"].setText(sprintf("%s", math.round(pts.Engines.Engine.egtActual[0].getValue()))); + me["EGT2"].setText(sprintf("%s", math.round(pts.Engines.Engine.egtActual[1].getValue()))); me["EGT1-needle"].setRotation((EGT_1_cur + 90) * D2R); me["EGT2-needle"].setRotation((EGT_2_cur + 90) * D2R); @@ -812,13 +524,16 @@ var canvas_upperECAM_cfm_eis2 = { } # FF - if (acconfig_weight_kgs.getValue() == 1) { - me["FF1"].setText(sprintf("%s", math.round(fuel_1.getValue() * LBS2KGS, 10))); - me["FF2"].setText(sprintf("%s", math.round(fuel_2.getValue() * LBS2KGS, 10))); + fuel1 = pts.Engines.Engine.fuelFlow[0].getValue(); + fuel2 = pts.Engines.Engine.fuelFlow[1].getValue(); + + if (acconfig_weight_kgs.getValue()) { + me["FF1"].setText(sprintf("%s", math.round(fuel1 * LBS2KGS, 10))); + me["FF2"].setText(sprintf("%s", math.round(fuel2 * LBS2KGS, 10))); me["FFlow-weight-unit"].setText("KG/H"); } else { - me["FF1"].setText(sprintf("%s", math.round(fuel_1.getValue(), 10))); - me["FF2"].setText(sprintf("%s", math.round(fuel_2.getValue(), 10))); + me["FF1"].setText(sprintf("%s", math.round(fuel1, 10))); + me["FF2"].setText(sprintf("%s", math.round(fuel2, 10))); me["FFlow-weight-unit"].setText("LBS/H"); } @@ -839,11 +554,18 @@ var canvas_upperECAM_cfm_eis2 = { } # N1 Limit - me["N1Lim-mode"].setText(sprintf("%s", thr_limit.getValue())); - me["N1Lim"].setText(sprintf("%s", math.floor(n1_limit.getValue() + 0.05))); - me["N1Lim-decimal"].setText(sprintf("%s", int(10 * math.mod(n1_limit.getValue() + 0.05, 1)))); + thrLimit = thr_limit.getValue(); + n1Limit = n1_limit.getValue(); - if (fadecpower_1.getValue() == 1 or fadecpower_2.getValue() == 1 or fadecpowerup.getValue()) { + me["N1Lim-mode"].setText(sprintf("%s", thrLimit)); + me["N1Lim"].setText(sprintf("%s", math.floor(n1Limit + 0.05))); + me["N1Lim-decimal"].setText(sprintf("%s", int(10 * math.mod(n1Limit + 0.05, 1)))); + + fadecPower1 = fadecpower_1.getValue(); + fadecPower2 = fadecpower_2.getValue(); + fadecPowerStart = fadecpowerup.getValue(); + + if (fadecPower1 or fadecPower2 or fadecPowerStart) { me["N1Lim-mode"].show(); me["N1Lim-XX"].hide(); me["N1Lim-XX2"].hide(); @@ -853,7 +575,7 @@ var canvas_upperECAM_cfm_eis2 = { me["N1Lim-XX2"].show(); } - if ((fadecpower_1.getValue() == 1 or fadecpower_2.getValue() == 1 or fadecpowerup.getValue()) and thr_limit.getValue() != "MREV") { + if ((fadecPower1 or fadecPower2 or fadecPowerStart) and thrLimit != "MREV") { me["N1Lim"].show(); me["N1Lim-decpnt"].show(); me["N1Lim-decimal"].show(); @@ -881,28 +603,28 @@ var canvas_upperECAM_iae_eis2 = { "N11-needle","N11-thr","N11-ylim","N11","N11-decpnt","N11-decimal","N11-scale","N11-scale2","N11-scaletick","N11-scalenum","N11-XX","N21","N21-decpnt","N21-decimal","N21-XX","FF1","FF1-XX","EPR2-needle","EPR2-thr","EPR2-ylim","EPR2","EPR2-decpnt", "EPR2-decimal","EPR2-box","EPR2-scale","EPR2-scaletick","EPR2-scalenum","EPR2-XX","EPR2-XX2","EGT2-needle","EGT2","EGT2-scale","EGT2-scale2","EGT2-box","EGT2-scaletick","EGT2-XX","N12-needle","N12-thr","N12-ylim","N12","N12-decpnt","N12-decimal", "N12-scale","N12-scale2","N12-scaletick","N12-scalenum","N12-XX","N22","N22-decpnt","N22-decimal","N22-XX","FF2","FF2-XX","FOB-LBS","FlapTxt","FlapDots","EPRLim-mode","EPRLim","EPRLim-decpnt","EPRLim-decimal","EPRLim-XX","EPRLim-XX2","REV1","REV1-box", - "REV2","REV2-box","ECAM_Left","ECAML1","ECAML2","ECAML3","ECAML4","ECAML5","ECAML6","ECAML7","ECAML8", "ECAMR1", "ECAMR2", "ECAMR3", "ECAMR4", "ECAMR5", "ECAMR6", "ECAMR7", "ECAMR8", "ECAM_Right", "TO_Memo","TO_Autobrake","TO_Signs","TO_Spoilers","TO_Flaps","TO_Config","TO_Autobrake_B","TO_Signs_B","TO_Spoilers_B","TO_Flaps_B","TO_Config_B", - "LDG_Memo","LDG_Gear","LDG_Signs","LDG_Spoilers","LDG_Flaps","LDG_Gear_B","LDG_Signs_B","LDG_Spoilers_B","LDG_Flaps_B","LDG_Flaps_B3", "FFlow1-weight-unit", "FFlow2-weight-unit", "FOB-weight-unit","SlatAlphaLock"]; + "REV2","REV2-box","ECAM_Left","ECAML1","ECAML2","ECAML3","ECAML4","ECAML5","ECAML6","ECAML7","ECAML8", "ECAMR1", "ECAMR2", "ECAMR3", "ECAMR4", "ECAMR5", "ECAMR6", "ECAMR7", "ECAMR8", "ECAM_Right", + "FFlow1-weight-unit", "FFlow2-weight-unit", "FOB-weight-unit","SlatAlphaLock"]; }, update: func() { N1_1_cur = N1_1.getValue(); N1_2_cur = N1_2.getValue(); - N1_1_act = eng1_n1.getValue(); - N1_2_act = eng2_n1.getValue(); + N1_1_act = pts.Engines.Engine.n1Actual[0].getValue(); + N1_2_act = pts.Engines.Engine.n1Actual[1].getValue(); N1_lim_cur = N1_lim.getValue(); EPR_1_cur = EPR_1.getValue(); EPR_2_cur = EPR_2.getValue(); - EPR_1_act = eng1_epr.getValue(); - EPR_2_act = eng2_epr.getValue(); + EPR_1_act = pts.Engines.Engine.eprActual[0].getValue(); + EPR_2_act = pts.Engines.Engine.eprActual[1].getValue(); EPR_lim_cur = EPR_lim.getValue(); EPR_thr_1_act = EPR_thr_1.getValue(); EPR_thr_2_act = EPR_thr_2.getValue(); - rev_1_act = rev_1.getValue(); - rev_2_act = rev_2.getValue(); + rev_1_act = pts.Engines.Engine.reverser[0].getValue(); + rev_2_act = pts.Engines.Engine.reverser[1].getValue(); EGT_1_cur = EGT_1.getValue(); EGT_2_cur = EGT_2.getValue(); - n2cur_1 = eng1_n2.getValue(); - n2cur_2 = eng2_n2.getValue(); + n2cur_1 = pts.Engines.Engine.n2Actual[0].getValue(); + n2cur_2 = pts.Engines.Engine.n2Actual[1].getValue(); # EPR me["EPR1"].setText(sprintf("%1.0f", math.floor(EPR_1_act))); @@ -982,8 +704,8 @@ var canvas_upperECAM_iae_eis2 = { } # EGT - me["EGT1"].setText(sprintf("%s", math.round(eng1_egt.getValue()))); - me["EGT2"].setText(sprintf("%s", math.round(eng2_egt.getValue()))); + me["EGT1"].setText(sprintf("%s", math.round(pts.Engines.Engine.egtActual[0].getValue()))); + me["EGT2"].setText(sprintf("%s", math.round(pts.Engines.Engine.egtActual[1].getValue()))); me["EGT1-needle"].setRotation((EGT_1_cur + 90) * D2R); me["EGT2-needle"].setRotation((EGT_2_cur + 90) * D2R); @@ -1025,11 +747,11 @@ var canvas_upperECAM_iae_eis2 = { } # N1 - me["N11"].setText(sprintf("%s", math.floor(eng1_n1.getValue() + 0.05))); - me["N11-decimal"].setText(sprintf("%s", int(10 * math.mod(eng1_n1.getValue() + 0.05, 1)))); + me["N11"].setText(sprintf("%s", math.floor(pts.Engines.Engine.n1Actual[0].getValue() + 0.05))); + me["N11-decimal"].setText(sprintf("%s", int(10 * math.mod(pts.Engines.Engine.n1Actual[0].getValue() + 0.05, 1)))); - me["N12"].setText(sprintf("%s", math.floor(eng2_n1.getValue() + 0.05))); - me["N12-decimal"].setText(sprintf("%s", int(10 * math.mod(eng2_n1.getValue() + 0.05, 1)))); + me["N12"].setText(sprintf("%s", math.floor(pts.Engines.Engine.n1Actual[1].getValue() + 0.05))); + me["N12-decimal"].setText(sprintf("%s", int(10 * math.mod(pts.Engines.Engine.n1Actual[1].getValue() + 0.05, 1)))); me["N11-needle"].setRotation((N1_1_cur + 90) * D2R); me["N11-thr"].setRotation((N1_thr_1.getValue() + 90) * D2R); @@ -1083,7 +805,7 @@ var canvas_upperECAM_iae_eis2 = { me["N12-XX"].show(); } - if (fadec.FADEC.Eng1.n1 == 1 and fadec.Fadec.n1Mode[0].getValue() == 1) { + if (fadec.FADEC.Eng1.n1 == 1 and fadec.Fadec.n1Mode[0].getValue()) { me["N11-thr"].show(); me["N11-ylim"].hide(); # Keep it hidden, since N1 mode limit calculation is not done yet } else { @@ -1091,7 +813,7 @@ var canvas_upperECAM_iae_eis2 = { me["N11-ylim"].hide(); } - if (fadec.FADEC.Eng2.n1 == 1 and fadec.Fadec.n1Mode[1].getValue() == 1) { + if (fadec.FADEC.Eng2.n1 == 1 and fadec.Fadec.n1Mode[1].getValue()) { me["N12-thr"].show(); me["N12-ylim"].hide(); # Keep it hidden, since N1 mode limit calculation is not done yet } else { @@ -1100,10 +822,10 @@ var canvas_upperECAM_iae_eis2 = { } # N2 - me["N21"].setText(sprintf("%s", math.floor(eng1_n2.getValue() + 0.05))); - me["N21-decimal"].setText(sprintf("%s", int(10 * math.mod(eng1_n2.getValue() + 0.05, 1)))); - me["N22"].setText(sprintf("%s", math.floor(eng2_n2.getValue() + 0.05))); - me["N22-decimal"].setText(sprintf("%s", int(10 * math.mod(eng2_n2.getValue() + 0.05, 1)))); + me["N21"].setText(sprintf("%s", math.floor(pts.Engines.Engine.n2Actual[0].getValue() + 0.05))); + me["N21-decimal"].setText(sprintf("%s", int(10 * math.mod(pts.Engines.Engine.n2Actual[0].getValue() + 0.05, 1)))); + me["N22"].setText(sprintf("%s", math.floor(pts.Engines.Engine.n2Actual[1].getValue() + 0.05))); + me["N22-decimal"].setText(sprintf("%s", int(10 * math.mod(pts.Engines.Engine.n2Actual[1].getValue() + 0.05, 1)))); if (fadec.FADEC.Eng1.n2 == 1) { me["N21"].show(); @@ -1130,14 +852,14 @@ var canvas_upperECAM_iae_eis2 = { } # FF - if (acconfig_weight_kgs.getValue() == 1) { - me["FF1"].setText(sprintf("%s", math.round(fuel_1.getValue() * LBS2KGS, 10))); - me["FF2"].setText(sprintf("%s", math.round(fuel_2.getValue() * LBS2KGS, 10))); + if (acconfig_weight_kgs.getValue()) { + me["FF1"].setText(sprintf("%s", math.round(fuel1 * LBS2KGS, 10))); + me["FF2"].setText(sprintf("%s", math.round(fuel2 * LBS2KGS, 10))); me["FFlow1-weight-unit"].setText("KG/H"); me["FFlow2-weight-unit"].setText("KG/H"); } else { - me["FF1"].setText(sprintf("%s", math.round(fuel_1.getValue(), 10))); - me["FF2"].setText(sprintf("%s", math.round(fuel_2.getValue(), 10))); + me["FF1"].setText(sprintf("%s", math.round(fuel1, 10))); + me["FF2"].setText(sprintf("%s", math.round(fuel2, 10))); me["FFlow1-weight-unit"].setText("LBS/H"); me["FFlow2-weight-unit"].setText("LBS/H"); } @@ -1159,11 +881,18 @@ var canvas_upperECAM_iae_eis2 = { } # EPR Limit - me["EPRLim-mode"].setText(sprintf("%s", thr_limit.getValue())); - me["EPRLim"].setText(sprintf("%1.0f", math.floor(epr_limit.getValue()))); - me["EPRLim-decimal"].setText(sprintf("%03d", (epr_limit.getValue() - int(epr_limit.getValue())) * 1000)); + thrLimit = thr_limit.getValue(); + eprLimit = epr_limit.getValue(); - if (fadecpower_1.getValue() == 1 or fadecpower_2.getValue() == 1 or fadecpowerup.getValue()) { + me["EPRLim-mode"].setText(sprintf("%s", thrLimit)); + me["EPRLim"].setText(sprintf("%1.0f", math.floor(eprLimit))); + me["EPRLim-decimal"].setText(sprintf("%03d", (eprLimit - int(eprLimit)) * 1000)); + + fadecPower1 = fadecpower_1.getValue(); + fadecPower2 = fadecpower_2.getValue(); + fadecPowerStart = fadecpowerup.getValue(); + + if (fadecPower1 or fadecPower2 or fadecPowerStart) { me["EPRLim-mode"].show(); me["EPRLim-XX"].hide(); me["EPRLim-XX2"].hide(); @@ -1173,7 +902,7 @@ var canvas_upperECAM_iae_eis2 = { me["EPRLim-XX2"].show(); } - if ((fadecpower_1.getValue() == 1 or fadecpower_2.getValue() == 1 or fadecpowerup.getValue()) and thr_limit.getValue() != "MREV") { + if ((fadecPower1 or fadecPower2 or fadecPowerStart) and thrLimit != "MREV") { me["EPRLim"].show(); me["EPRLim-decpnt"].show(); me["EPRLim-decimal"].show(); @@ -1214,7 +943,7 @@ var canvas_upperECAM_test = { return ["Test_white","Test_text"]; }, update: func() { - var elapsedtime = et.getValue(); + elapsedtime = pts.Sim.Time.elapsedSec.getValue(); if (du3_test_time.getValue() + 1 >= elapsedtime) { me["Test_white"].show(); me["Test_text"].hide(); @@ -1225,6 +954,17 @@ var canvas_upperECAM_test = { }, }; +var createListenerForLine = func(prop, node, key) { + setlistener(prop, func() { + if (eng_option.getValue() == "IAE") { + upperECAM_iae_eis2[key].setColor(upperECAM_iae_eis2.getColorString(node.getValue())); + } else { + upperECAM_cfm_eis2[key].setColor(upperECAM_cfm_eis2.getColorString(node.getValue())); + } + }, 0, 0); +}; + + setlistener("sim/signals/fdm-initialized", func { upperECAM_display = canvas.new({ "name": "upperECAM", @@ -1241,6 +981,24 @@ setlistener("sim/signals/fdm-initialized", func { upperECAM_iae_eis2 = canvas_upperECAM_iae_eis2.new(group_iae_eis2, "Aircraft/A320-family/Models/Instruments/Upper-ECAM/res/iae-eis2.svg"); upperECAM_test = canvas_upperECAM_test.new(group_test, "Aircraft/A320-family/Models/Instruments/Common/res/du-test.svg"); + createListenerForLine("/ECAM/msg/linec1", ECAM_line1c, "ECAML1"); + createListenerForLine("/ECAM/msg/linec2", ECAM_line2c, "ECAML2"); + createListenerForLine("/ECAM/msg/linec3", ECAM_line3c, "ECAML3"); + createListenerForLine("/ECAM/msg/linec4", ECAM_line4c, "ECAML4"); + createListenerForLine("/ECAM/msg/linec5", ECAM_line5c, "ECAML5"); + createListenerForLine("/ECAM/msg/linec6", ECAM_line6c, "ECAML6"); + createListenerForLine("/ECAM/msg/linec7", ECAM_line7c, "ECAML7"); + createListenerForLine("/ECAM/msg/linec8", ECAM_line8c, "ECAML8"); + + createListenerForLine("/ECAM/rightmsg/linec1", ECAM_line1rc, "ECAMR1"); + createListenerForLine("/ECAM/rightmsg/linec2", ECAM_line2rc, "ECAMR2"); + createListenerForLine("/ECAM/rightmsg/linec3", ECAM_line3rc, "ECAMR3"); + createListenerForLine("/ECAM/rightmsg/linec4", ECAM_line4rc, "ECAMR4"); + createListenerForLine("/ECAM/rightmsg/linec5", ECAM_line5rc, "ECAMR5"); + createListenerForLine("/ECAM/rightmsg/linec6", ECAM_line6rc, "ECAMR6"); + createListenerForLine("/ECAM/rightmsg/linec7", ECAM_line7rc, "ECAMR7"); + createListenerForLine("/ECAM/rightmsg/linec8", ECAM_line8rc, "ECAMR8"); + upperECAM_update.start(); if (rate.getValue() > 1) { u_rateApply(); diff --git a/Models/Instruments/Upper-ECAM/res/cfm-eis2.svg b/Models/Instruments/Upper-ECAM/res/cfm-eis2.svg index ddb88681..78585ba0 100644 --- a/Models/Instruments/Upper-ECAM/res/cfm-eis2.svg +++ b/Models/Instruments/Upper-ECAM/res/cfm-eis2.svg @@ -41,9 +41,9 @@ inkscape:window-height="705" id="namedview371" showgrid="true" - inkscape:zoom="1.4142136" - inkscape:cx="832.32702" - inkscape:cy="561.61738" + inkscape:zoom="0.50000001" + inkscape:cx="419.64115" + inkscape:cy="1000.4352" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" @@ -1264,485 +1264,6 @@ y="943.73566" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#cecdce">LINE 8</tspan></text> </g> - <g - id="TO_Memo" - inkscape:label="#g4517"> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="text4412" - y="686.0564" - x="14.033532" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1" - y="686.0564" - x="14.033532" - id="tspan4414" - sodipodi:role="line">T.O</tspan></text> - <path - style="fill:none;stroke:#0dc04b;stroke-width:2.4000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 13.8216,741.99564 77.932201,0" - id="path4556" - inkscape:connector-curvature="0" - sodipodi:nodetypes="cc" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="104.6523" - y="686.0564" - id="TO_Autobrake" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4421" - x="104.6523" - y="686.0564" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1">AUTO BRK</tspan></text> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="TO_Signs" - y="722.50458" - x="104.6523" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1" - y="722.50458" - x="104.6523" - id="tspan4425" - sodipodi:role="line">SIGNS</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="104.6523" - y="759.67883" - id="TO_Spoilers" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4429" - x="104.6523" - y="759.67883" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1">SPLRS</tspan></text> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="TO_Flaps" - y="796.12726" - x="104.6523" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1" - y="796.12726" - x="104.6523" - id="tspan4436" - sodipodi:role="line">FLAPS </tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="104.6523" - y="833.30151" - id="TO_Config" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4440" - x="104.6523" - y="833.30151" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1">T.O CONFIG</tspan></text> - <g - inkscape:label="#g4487" - id="TO_Autobrake_B"> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="489.9281" - y="686.41925" - id="text4442" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4444" - x="489.9281" - y="686.41925" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1">MAX</tspan></text> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="text4462" - y="686.41925" - x="403.6488" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1" - y="686.41925" - x="403.6488" - id="tspan4465" - sodipodi:role="line">. . . . .</tspan></text> - </g> - <g - inkscape:label="#g4493" - id="TO_Signs_B"> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="text4446" - y="722.50458" - x="489.9281" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1" - y="722.50458" - x="489.9281" - id="tspan4448" - sodipodi:role="line"> ON</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="424.27417" - y="722.86768" - id="text4471" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)" - inkscape:transform-center-y="-46.367479"><tspan - sodipodi:role="line" - id="tspan4473" - x="424.27417" - y="722.86768" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1">. . . . . . . . . .</tspan></text> - </g> - <g - inkscape:label="#g4499" - id="TO_Spoilers_B"> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="489.9281" - y="760.04193" - id="text4450" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4452" - x="489.9281" - y="760.04193" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1">ARM</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="403.6488" - y="760.04193" - id="text4475" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4477" - x="403.6488" - y="760.04193" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1">. . . . . . . . .</tspan></text> - </g> - <g - inkscape:label="#g4505" - id="TO_Flaps_B"> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="text4454" - y="796.12726" - x="489.9281" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1" - y="796.12726" - x="489.9281" - id="tspan4456" - sodipodi:role="line">T.O</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="424.27417" - y="796.49036" - id="text4479" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4481" - x="424.27417" - y="796.49036" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1">. . . . . . . . . .</tspan></text> - </g> - <g - inkscape:label="#g4511" - id="TO_Config_B"> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="489.9281" - y="833.30151" - id="text4458" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4460" - x="489.9281" - y="833.30151" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1">TEST</tspan></text> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="text4483" - y="833.66461" - x="383.02429" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1" - y="833.66461" - x="383.02429" - id="tspan4485" - sodipodi:role="line">. . .</tspan></text> - </g> - </g> - <g - inkscape:label="#g4517" - id="LDG_Memo"> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="14.033532" - y="686.0564" - id="text4418" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan233" - x="14.033532" - y="686.0564" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1">LDG</tspan></text> - <path - sodipodi:nodetypes="cc" - inkscape:connector-curvature="0" - id="path4424" - d="M 13.8216,741.99564 H 91.753801" - style="fill:none;stroke:#0dc04b;stroke-width:2.4000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="LDG_Gear" - y="686.0564" - x="104.6523" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1" - y="686.0564" - x="104.6523" - id="tspan4428" - sodipodi:role="line">LDG GEAR</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="104.6523" - y="722.50458" - id="LDG_Signs" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4432" - x="104.6523" - y="722.50458" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1">SIGNS</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="104.6523" - y="759.37872" - id="LDG_Cabin" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan241" - x="104.6523" - y="759.37872" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1">CABIN READY</tspan></text> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="LDG_Spoilers" - y="796.12726" - x="104.6523" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1" - y="796.12726" - x="104.6523" - id="tspan4438" - sodipodi:role="line">SPLRS</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="104.6523" - y="833.30151" - id="LDG_Flaps" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4442" - x="104.6523" - y="833.30151" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1">FLAPS </tspan></text> - <g - id="LDG_Gear_B" - inkscape:label="#g4487"> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="text4451" - y="686.41925" - x="489.9281" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1" - y="686.41925" - x="489.9281" - id="tspan4453" - sodipodi:role="line">DN</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="424.27417" - y="686.41925" - id="text4455" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4457" - x="424.27417" - y="686.41925" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1">. . . . . .</tspan></text> - </g> - <g - id="LDG_Signs_B" - inkscape:label="#g4493"> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="489.9281" - y="722.50458" - id="text4461" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4463" - x="489.9281" - y="722.50458" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1"> ON</tspan></text> - <text - inkscape:transform-center-y="-46.367479" - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="text4465" - y="722.86768" - x="424.27417" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1" - y="722.86768" - x="424.27417" - id="tspan4467" - sodipodi:role="line">. . . . . . . . . .</tspan></text> - </g> - <g - id="LDG_Spoilers_B" - inkscape:label="#g4499"> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="text4472" - y="796.49036" - x="489.9281" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1" - y="796.49036" - x="489.9281" - id="tspan4474" - sodipodi:role="line">ARM</tspan></text> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="text4476" - y="796.49036" - x="403.6488" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1" - y="796.49036" - x="403.6488" - id="tspan4478" - sodipodi:role="line">. . . . . . . . .</tspan></text> - </g> - <g - id="LDG_Flaps_B" - inkscape:label="#g4505" - transform="translate(0,39.990378)"> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="489.9281" - y="796.12726" - id="text4482" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4484" - x="489.9281" - y="796.12726" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1">FULL</tspan></text> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="text4486" - y="796.49036" - x="383.02411" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1" - y="796.49036" - x="383.02411" - id="tspan4488" - sodipodi:role="line">. . . . . . . .</tspan></text> - </g> - <g - inkscape:label="#g4505" - id="LDG_Flaps_B3"> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="text5125" - y="833.30151" - x="489.9281" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1" - y="833.30151" - x="489.9281" - id="tspan5127" - sodipodi:role="line">3</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="465.52426" - y="833.66461" - id="text5129" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan5131" - x="465.52426" - y="833.66461" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1">. . . . . . . . . . . .</tspan></text> - </g> - </g> <g inkscape:label="#g4376" id="ECAM_Right" diff --git a/Models/Instruments/Upper-ECAM/res/iae-eis2.svg b/Models/Instruments/Upper-ECAM/res/iae-eis2.svg index 9adb1a60..547e0e60 100644 --- a/Models/Instruments/Upper-ECAM/res/iae-eis2.svg +++ b/Models/Instruments/Upper-ECAM/res/iae-eis2.svg @@ -12,7 +12,7 @@ viewBox="0 0 1024 1024" version="1.1" id="svg2" - inkscape:version="0.92.2 (5c3e80d, 2017-08-06)" + inkscape:version="0.92.4 (5da689c313, 2019-01-14)" sodipodi:docname="iae-eis2.svg"> <metadata id="metadata375"> @@ -42,7 +42,7 @@ id="namedview371" showgrid="false" inkscape:zoom="0.43942712" - inkscape:cx="568.82143" + inkscape:cx="180.81625" inkscape:cy="433.53356" inkscape:window-x="-8" inkscape:window-y="-8" @@ -1632,485 +1632,6 @@ y="943.73566" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#cecdce">LINE 8</tspan></text> </g> - <g - id="TO_Memo" - inkscape:label="#g4517"> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="text4412" - y="686.0564" - x="14.033532" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1" - y="686.0564" - x="14.033532" - id="tspan4414" - sodipodi:role="line">T.O</tspan></text> - <path - style="fill:none;stroke:#0dc04b;stroke-width:2.4000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 13.8216,741.99564 77.932201,0" - id="path4556" - inkscape:connector-curvature="0" - sodipodi:nodetypes="cc" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="104.6523" - y="686.0564" - id="TO_Autobrake" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4421" - x="104.6523" - y="686.0564" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1">AUTO BRK</tspan></text> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="TO_Signs" - y="722.50458" - x="104.6523" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1" - y="722.50458" - x="104.6523" - id="tspan4425" - sodipodi:role="line">SIGNS</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="104.6523" - y="759.67883" - id="TO_Spoilers" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4429" - x="104.6523" - y="759.67883" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1">SPLRS</tspan></text> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="TO_Flaps" - y="796.12726" - x="104.6523" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1" - y="796.12726" - x="104.6523" - id="tspan4436" - sodipodi:role="line">FLAPS </tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="104.6523" - y="833.30151" - id="TO_Config" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4440" - x="104.6523" - y="833.30151" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1">T.O CONFIG</tspan></text> - <g - inkscape:label="#g4487" - id="TO_Autobrake_B"> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="489.9281" - y="686.41925" - id="text4442" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4444" - x="489.9281" - y="686.41925" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1">MAX</tspan></text> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="text4462" - y="686.41925" - x="403.6488" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1" - y="686.41925" - x="403.6488" - id="tspan4465" - sodipodi:role="line">. . . . .</tspan></text> - </g> - <g - inkscape:label="#g4493" - id="TO_Signs_B"> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="text4446" - y="722.50458" - x="489.9281" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1" - y="722.50458" - x="489.9281" - id="tspan4448" - sodipodi:role="line"> ON</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="424.27417" - y="722.86768" - id="text4471" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)" - inkscape:transform-center-y="-46.367479"><tspan - sodipodi:role="line" - id="tspan4473" - x="424.27417" - y="722.86768" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1">. . . . . . . . . .</tspan></text> - </g> - <g - inkscape:label="#g4499" - id="TO_Spoilers_B"> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="489.9281" - y="760.04193" - id="text4450" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4452" - x="489.9281" - y="760.04193" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1">ARM</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="403.6488" - y="760.04193" - id="text4475" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4477" - x="403.6488" - y="760.04193" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1">. . . . . . . . .</tspan></text> - </g> - <g - inkscape:label="#g4505" - id="TO_Flaps_B"> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="text4454" - y="796.12726" - x="489.9281" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1" - y="796.12726" - x="489.9281" - id="tspan4456" - sodipodi:role="line">T.O</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="424.27417" - y="796.49036" - id="text4479" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4481" - x="424.27417" - y="796.49036" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1">. . . . . . . . . .</tspan></text> - </g> - <g - inkscape:label="#g4511" - id="TO_Config_B"> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="489.9281" - y="833.30151" - id="text4458" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4460" - x="489.9281" - y="833.30151" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1">TEST</tspan></text> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="text4483" - y="833.66461" - x="383.02429" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1" - y="833.66461" - x="383.02429" - id="tspan4485" - sodipodi:role="line">. . .</tspan></text> - </g> - </g> - <g - inkscape:label="#g4517" - id="LDG_Memo"> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="14.033532" - y="686.0564" - id="text4418" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4422" - x="14.033532" - y="686.0564" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1">LDG</tspan></text> - <path - sodipodi:nodetypes="cc" - inkscape:connector-curvature="0" - id="path4424" - d="m 13.8216,741.99564 77.932201,0" - style="fill:none;stroke:#0dc04b;stroke-width:2.4000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="LDG_Gear" - y="686.0564" - x="104.6523" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1" - y="686.0564" - x="104.6523" - id="tspan4428" - sodipodi:role="line">LDG GEAR</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="104.6523" - y="722.50458" - id="LDG_Signs" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4432" - x="104.6523" - y="722.50458" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1">SIGNS</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="104.6523" - y="759.37872" - id="LDG_Cabin" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4455" - x="104.6523" - y="759.37872" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1">CABIN READY</tspan></text> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="LDG_Spoilers" - y="796.12726" - x="104.6523" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1" - y="796.12726" - x="104.6523" - id="tspan4438" - sodipodi:role="line">SPLRS</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="104.6523" - y="833.30151" - id="LDG_Flaps" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4442" - x="104.6523" - y="833.30151" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1">FLAPS </tspan></text> - <g - id="LDG_Gear_B" - inkscape:label="#g4487"> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="text4451" - y="686.41925" - x="489.9281" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1" - y="686.41925" - x="489.9281" - id="tspan4453" - sodipodi:role="line">DN</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="424.27417" - y="686.41925" - id="text4455" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4457" - x="424.27417" - y="686.41925" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1">. . . . . .</tspan></text> - </g> - <g - id="LDG_Signs_B" - inkscape:label="#g4493"> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="489.9281" - y="722.50458" - id="text4461" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4463" - x="489.9281" - y="722.50458" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1"> ON</tspan></text> - <text - inkscape:transform-center-y="-46.367479" - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="text4465" - y="722.86768" - x="424.27417" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1" - y="722.86768" - x="424.27417" - id="tspan4467" - sodipodi:role="line">. . . . . . . . . .</tspan></text> - </g> - <g - id="LDG_Spoilers_B" - inkscape:label="#g4499"> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="text4472" - y="796.49036" - x="489.9281" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1" - y="796.49036" - x="489.9281" - id="tspan4474" - sodipodi:role="line">ARM</tspan></text> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="text4476" - y="796.49036" - x="403.6488" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1" - y="796.49036" - x="403.6488" - id="tspan4478" - sodipodi:role="line">. . . . . . . . .</tspan></text> - </g> - <g - id="LDG_Flaps_B" - inkscape:label="#g4505" - transform="translate(0,39.990378)"> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="489.9281" - y="796.12726" - id="text4482" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan4484" - x="489.9281" - y="796.12726" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1">FULL</tspan></text> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="text4486" - y="796.49036" - x="383.02411" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1" - y="796.49036" - x="383.02411" - id="tspan4488" - sodipodi:role="line">. . . . . . . .</tspan></text> - </g> - <g - inkscape:label="#g4505" - id="LDG_Flaps_B3"> - <text - transform="scale(0.92957935,1.0757554)" - inkscape:label="#text4314" - id="text5125" - y="833.30151" - x="489.9281" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1" - y="833.30151" - x="489.9281" - id="tspan5127" - sodipodi:role="line">3</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="465.52426" - y="833.66461" - id="text5129" - inkscape:label="#text4314" - transform="scale(0.92957935,1.0757554)"><tspan - sodipodi:role="line" - id="tspan5131" - x="465.52426" - y="833.66461" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.1831665px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#179ab7;fill-opacity:1">. . . . . . . . . . . .</tspan></text> - </g> - </g> <g inkscape:label="#g4376" id="ECAM_Right" diff --git a/Nasal/ECAM/ECAM-main.nas b/Nasal/ECAM/ECAM-main.nas index db1b2dc8..9a622d21 100644 --- a/Nasal/ECAM/ECAM-main.nas +++ b/Nasal/ECAM/ECAM-main.nas @@ -20,8 +20,6 @@ var apOffTime = 0; var athrOffTime = 0; var apWarnNode = 0; var athrWarnNode = 0; -var leftMsg = 0; -var rightMsg = 0; var engStrtTimeSw = 0; var engStrtTime = 0; var page = 0; @@ -61,8 +59,6 @@ var ECAM = { phase = props.globals.initNode("/ECAM/warning-phase", 0, "INT"); apOffTime = props.globals.initNode("/ECAM/ap-off-time", 0, "INT"); athrOffTime = props.globals.initNode("/ECAM/athr-off-time", 0, "INT"); - leftMsg = props.globals.initNode("/ECAM/left-msg", "MSG", "STRING"); - rightMsg = props.globals.initNode("/ECAM/right-msg", "MSG", "STRING"); engStrtTimeSw = props.globals.initNode("/ECAM/engine-start-time-switch", 0, "BOOL"); engStrtTime = props.globals.initNode("/ECAM/engine-start-time", 0.0, "DOUBLE"); apWarnNode = props.globals.initNode("/it-autoflight/output/ap-warning", 0, "INT"); diff --git a/Nasal/Libraries/property-tree-setup.nas b/Nasal/Libraries/property-tree-setup.nas index 9899445c..2e74f277 100644 --- a/Nasal/Libraries/property-tree-setup.nas +++ b/Nasal/Libraries/property-tree-setup.nas @@ -58,11 +58,14 @@ var ECAM = { var Engines = { Engine: { + egtActual: [props.globals.getNode("/engines/engine[0]/egt-actual"), props.globals.getNode("/engines/engine[1]/egt-actual")], eprActual: [props.globals.getNode("/engines/engine[0]/epr-actual"), props.globals.getNode("/engines/engine[1]/epr-actual")], + fuelFlow: [props.globals.getNode("/engines/engine[0]/fuel-flow_actual"), props.globals.getNode("/engines/engine[1]/fuel-flow_actual")], n1Actual: [props.globals.getNode("/engines/engine[0]/n1-actual"), props.globals.getNode("/engines/engine[1]/n1-actual")], n2Actual: [props.globals.getNode("/engines/engine[0]/n2-actual"), props.globals.getNode("/engines/engine[1]/n2-actual")], oilPsi: [props.globals.getNode("/engines/engine[0]/oil-psi-actual"), props.globals.getNode("/engines/engine[1]/oil-psi-actual")], thrust: [props.globals.getNode("/engines/engine[0]/thrust-lb"), props.globals.getNode("/engines/engine[1]/thrust-lb")], + reverser: [props.globals.getNode("/engines/engine[0]/reverser-pos-norm"), props.globals.getNode("/engines/engine[1]/reverser-pos-norm")], state: [props.globals.getNode("/engines/engine[0]/state"), props.globals.getNode("/engines/engine[1]/state")], }, }; @@ -81,6 +84,7 @@ var Fdm = { brake: [props.globals.getNode("/fdm/jsbsim/fcs/left-brake-cmd-norm"),props.globals.getNode("/fdm/jsbsim/fcs/right-brake-cmd-norm")], flapDeg: props.globals.getNode("/fdm/jsbsim/fcs/flap-pos-deg"), slatDeg: props.globals.getNode("/fdm/jsbsim/fcs/slat-pos-deg"), + slatLocked: props.globals.getNode("/fdm/jsbsim/fcs/slat-locked"), }, Fbw: { aileron: props.globals.getNode("/fdm/jsbsim/fbw/aileron-sidestick"), From d38496f196482692e3d385ca3fa2d3e696509395 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R <legoboyvdlp@gmail.com> Date: Sun, 27 Sep 2020 19:00:46 +0100 Subject: [PATCH 05/16] More Nasal improvements (remove getprop more etc) --- Nasal/ECAM/ECAM-logic.nas | 288 +++++++++++++++++++------------------- Nasal/FMGC/FCU.nas | 4 +- Nasal/FMGC/FMGC-b.nas | 8 +- Nasal/FMGC/FMGC.nas | 2 +- 4 files changed, 151 insertions(+), 151 deletions(-) diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index f16b9cca..2f4fcc71 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -44,7 +44,7 @@ var messages_priority_3 = func { # Stall # todo - altn law and emer cancel flipflops page 2440 - if (phaseVar3 >= 5 and phaseVar3 <= 7 and (getprop("fdm/jsbsim/fcs/slat-pos-deg") <= 15 and (getprop("systems/navigation/adr/output/aoa-1") > 15 or getprop("systems/navigation/adr/output/aoa-2") > 15 or getprop("systems/navigation/adr/output/aoa-3") > 15)) or (getprop("fdm/jsbsim/fcs/slat-pos-deg") > 15 and (getprop("systems/navigation/adr/output/aoa-1") > 23 or getprop("systems/navigation/adr/output/aoa-2") > 23 or getprop("systems/navigation/adr/output/aoa-3") > 23))) { + if (phaseVar3 >= 5 and phaseVar3 <= 7 and (getprop("/fdm/jsbsim/fcs/slat-pos-deg") <= 15 and (getprop("/systems/navigation/adr/output/aoa-1") > 15 or getprop("/systems/navigation/adr/output/aoa-2") > 15 or getprop("/systems/navigation/adr/output/aoa-3") > 15)) or (getprop("/fdm/jsbsim/fcs/slat-pos-deg") > 15 and (getprop("/systems/navigation/adr/output/aoa-1") > 23 or getprop("/systems/navigation/adr/output/aoa-2") > 23 or getprop("/systems/navigation/adr/output/aoa-3") > 23))) { stall.active = 1; } else { ECAM_controller.warningReset(stall); @@ -56,21 +56,21 @@ var messages_priority_3 = func { stallVoice.setValue(0); } - if ((phaseVar3 == 1 or (phaseVar3 >= 5 and phaseVar3 <= 7)) and getprop("systems/navigation/adr/output/overspeed")) { + if ((phaseVar3 == 1 or (phaseVar3 >= 5 and phaseVar3 <= 7)) and getprop("/systems/navigation/adr/output/overspeed")) { overspeed.active = 1; - if (getprop("systems/navigation/adr/computation/overspeed-vmo") or getprop("systems/navigation/adr/computation/overspeed-mmo")) { + if (getprop("/systems/navigation/adr/computation/overspeed-vmo") or getprop("/systems/navigation/adr/computation/overspeed-mmo")) { overspeedVMO.active = 1; } else { ECAM_controller.warningReset(overspeedVMO); } - if (getprop("systems/navigation/adr/computation/overspeed-vle")) { + if (getprop("/systems/navigation/adr/computation/overspeed-vle")) { overspeedGear.active = 1; } else { ECAM_controller.warningReset(overspeedGear); } - if (getprop("systems/navigation/adr/computation/overspeed-vfe")) { + if (getprop("/systems/navigation/adr/computation/overspeed-vfe")) { overspeedFlap.active = 1; overspeedFlap.msg = "-VFE................" ~ (systems.ADIRS.overspeedVFE.getValue() - 4); } else { @@ -86,7 +86,7 @@ var messages_priority_3 = func { } # FCTL FLAPS NOT ZERO - if ((flap_not_zero.clearFlag == 0) and phaseVar3 == 6 and getprop("controls/flight/flaps-input") != 0 and getprop("instrumentation/altimeter/indicated-altitude-ft") > 22000) { + if ((flap_not_zero.clearFlag == 0) and phaseVar3 == 6 and getprop("/controls/flight/flaps-input") != 0 and getprop("instrumentation/altimeter/indicated-altitude-ft") > 22000) { flap_not_zero.active = 1; } else { ECAM_controller.warningReset(flap_not_zero); @@ -101,13 +101,13 @@ var messages_priority_3 = func { } if (dualFail.active == 1) { - if (getprop("controls/engines/engine-start-switch") != 2 and dualFailModeSel.clearFlag == 0) { + if (getprop("/controls/engines/engine-start-switch") != 2 and dualFailModeSel.clearFlag == 0) { dualFailModeSel.active = 1; } else { ECAM_controller.warningReset(dualFailModeSel); } - if (getprop("fdm/jsbsim/fcs/throttle-lever[0]") > 0.01 and getprop("fdm/jsbsim/fcs/throttle-lever[1]") > 0.01 and dualFailLevers.clearFlag == 0) { + if (getprop("/fdm/jsbsim/fcs/throttle-lever[0]") > 0.01 and getprop("/fdm/jsbsim/fcs/throttle-lever[1]") > 0.01 and dualFailLevers.clearFlag == 0) { dualFailLevers.active = 1; } else { ECAM_controller.warningReset(dualFailLevers); @@ -274,19 +274,19 @@ var messages_priority_3 = func { } # ENG FIRE - if ((eng1FireFlAgent2.clearFlag == 0 and getprop("systems/fire/engine1/warning-active") == 1 and phaseVar3 >= 5 and phaseVar3 <= 7) or (eng1FireGnevacBat.clearFlag == 0 and getprop("systems/fire/engine1/warning-active") == 1 and (phaseVar3 < 5 or phaseVar3 > 7))) { + if ((eng1FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine1/warning-active") == 1 and phaseVar3 >= 5 and phaseVar3 <= 7) or (eng1FireGnevacBat.clearFlag == 0 and getprop("/systems/fire/engine1/warning-active") == 1 and (phaseVar3 < 5 or phaseVar3 > 7))) { eng1Fire.active = 1; } else { ECAM_controller.warningReset(eng1Fire); } - if ((eng2FireFlAgent2.clearFlag == 0 and getprop("systems/fire/engine2/warning-active") == 1 and phaseVar3 >= 5 and phaseVar3 <= 7) or (eng2FireGnevacBat.clearFlag == 0 and getprop("systems/fire/engine2/warning-active") == 1 and (phaseVar3 < 5 or phaseVar3 > 7))) { + if ((eng2FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine2/warning-active") == 1 and phaseVar3 >= 5 and phaseVar3 <= 7) or (eng2FireGnevacBat.clearFlag == 0 and getprop("/systems/fire/engine2/warning-active") == 1 and (phaseVar3 < 5 or phaseVar3 > 7))) { eng2Fire.active = 1; } else { ECAM_controller.warningReset(eng2Fire); } - if (apuFireMaster.clearFlag == 0 and getprop("systems/fire/apu/warning-active")) { + if (apuFireMaster.clearFlag == 0 and getprop("/systems/fire/apu/warning-active")) { apuFire.active = 1; } else { ECAM_controller.warningReset(apuFire); @@ -294,35 +294,35 @@ var messages_priority_3 = func { if (eng1Fire.active == 1) { if (phaseVar3 >= 5 and phaseVar3 <= 7) { - if (eng1FireFllever.clearFlag == 0 and getprop("fdm/jsbsim/fcs/throttle-lever[0]") > 0.01) { + if (eng1FireFllever.clearFlag == 0 and getprop("/fdm/jsbsim/fcs/throttle-lever[0]") > 0.01) { eng1FireFllever.active = 1; } else { ECAM_controller.warningReset(eng1FireFllever); } - if (eng1FireFlmaster.clearFlag == 0 and getprop("controls/engines/engine[0]/cutoff-switch") == 0) { + if (eng1FireFlmaster.clearFlag == 0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) { eng1FireFlmaster.active = 1; } else { ECAM_controller.warningReset(eng1FireFlmaster); } - if (eng1FireFlPB.clearFlag == 0 and getprop("controls/engines/engine[0]/fire-btn") == 0) { + if (eng1FireFlPB.clearFlag == 0 and getprop("/controls/engines/engine[0]/fire-btn") == 0) { eng1FireFlPB.active = 1; } else { ECAM_controller.warningReset(eng1FireFlPB); } - if (getprop("systems/fire/engine1/agent1-timer") != 0 and getprop("systems/fire/engine1/agent1-timer") != 99) { - eng1FireFlAgent1Timer.msg = " -AGENT AFT " ~ getprop("systems/fire/engine1/agent1-timer") ~ " S...DISCH"; + if (getprop("/systems/fire/engine1/agent1-timer") != 0 and getprop("/systems/fire/engine1/agent1-timer") != 99) { + eng1FireFlAgent1Timer.msg = " -AGENT AFT " ~ getprop("/systems/fire/engine1/agent1-timer") ~ " S...DISCH"; } - if (eng1FireFlAgent1.clearFlag == 0 and getprop("controls/engines/engine[0]/fire-btn") == 1 and !getprop("systems/fire/engine1/disch1") and getprop("systems/fire/engine1/agent1-timer") != 0 and getprop("systems/fire/engine1/agent1-timer") != 99) { + if (eng1FireFlAgent1.clearFlag == 0 and getprop("/controls/engines/engine[0]/fire-btn") == 1 and !getprop("/systems/fire/engine1/disch1") and getprop("/systems/fire/engine1/agent1-timer") != 0 and getprop("/systems/fire/engine1/agent1-timer") != 99) { eng1FireFlAgent1Timer.active = 1; } else { ECAM_controller.warningReset(eng1FireFlAgent1Timer); } - if (eng1FireFlAgent1.clearFlag == 0 and !getprop("systems/fire/engine1/disch1") and (getprop("systems/fire/engine1/agent1-timer") == 0 or getprop("systems/fire/engine1/agent1-timer") == 99)) { + if (eng1FireFlAgent1.clearFlag == 0 and !getprop("/systems/fire/engine1/disch1") and (getprop("/systems/fire/engine1/agent1-timer") == 0 or getprop("/systems/fire/engine1/agent1-timer") == 99)) { eng1FireFlAgent1.active = 1; } else { ECAM_controller.warningReset(eng1FireFlAgent1); @@ -334,17 +334,17 @@ var messages_priority_3 = func { ECAM_controller.warningReset(eng1FireFlATC); } - if (getprop("systems/fire/engine1/agent2-timer") != 0 and getprop("systems/fire/engine1/agent2-timer") != 99) { - eng1FireFl30Sec.msg = "•IF FIRE AFTER " ~ getprop("systems/fire/engine1/agent2-timer") ~ " S:"; + if (getprop("/systems/fire/engine1/agent2-timer") != 0 and getprop("/systems/fire/engine1/agent2-timer") != 99) { + eng1FireFl30Sec.msg = "•IF FIRE AFTER " ~ getprop("/systems/fire/engine1/agent2-timer") ~ " S:"; } - if (eng1FireFlAgent2.clearFlag == 0 and getprop("systems/fire/engine1/disch1") and !getprop("systems/fire/engine1/disch2") and getprop("systems/fire/engine1/agent2-timer") > 0) { + if (eng1FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine1/disch1") and !getprop("/systems/fire/engine1/disch2") and getprop("/systems/fire/engine1/agent2-timer") > 0) { eng1FireFl30Sec.active = 1; } else { ECAM_controller.warningReset(eng1FireFl30Sec); } - if (eng1FireFlAgent2.clearFlag == 0 and getprop("systems/fire/engine1/disch1") and !getprop("systems/fire/engine1/disch2")) { + if (eng1FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine1/disch1") and !getprop("/systems/fire/engine1/disch2")) { eng1FireFlAgent2.active = 1; } else { ECAM_controller.warningReset(eng1FireFlAgent2); @@ -360,13 +360,13 @@ var messages_priority_3 = func { } if (phaseVar3 < 5 or phaseVar3 > 7) { - if (eng1FireGnlever.clearFlag == 0 and getprop("fdm/jsbsim/fcs/throttle-lever[0]") > 0.01 and getprop("fdm/jsbsim/fcs/throttle-lever[1]") > 0.01) { + if (eng1FireGnlever.clearFlag == 0 and getprop("/fdm/jsbsim/fcs/throttle-lever[0]") > 0.01 and getprop("/fdm/jsbsim/fcs/throttle-lever[1]") > 0.01) { eng1FireGnlever.active = 1; } else { ECAM_controller.warningReset(eng1FireGnlever); } - if (eng1FireGnparkbrk.clearFlag == 0 and getprop("controls/gear/brake-parking") == 0) { + if (eng1FireGnparkbrk.clearFlag == 0 and getprop("/controls/gear/brake-parking") == 0) { eng1FireGnstopped.active = 1; eng1FireGnparkbrk.active = 1; } else { @@ -374,31 +374,31 @@ var messages_priority_3 = func { ECAM_controller.warningReset(eng1FireGnparkbrk); } - if (eng1FireGnmaster.clearFlag == 0 and getprop("controls/engines/engine[0]/cutoff-switch") == 0) { + if (eng1FireGnmaster.clearFlag == 0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) { eng1FireGnmaster.active = 1; } else { ECAM_controller.warningReset(eng1FireGnmaster); } - if (eng1FireGnPB.clearFlag == 0 and getprop("controls/engines/engine[0]/fire-btn") == 0) { + if (eng1FireGnPB.clearFlag == 0 and getprop("/controls/engines/engine[0]/fire-btn") == 0) { eng1FireGnPB.active = 1; } else { ECAM_controller.warningReset(eng1FireGnPB); } - if (eng1FireGnAgent1.clearFlag == 0 and !getprop("systems/fire/engine1/disch1")) { + if (eng1FireGnAgent1.clearFlag == 0 and !getprop("/systems/fire/engine1/disch1")) { eng1FireGnAgent1.active = 1; } else { ECAM_controller.warningReset(eng1FireGnAgent1); } - if (eng1FireGnAgent2.clearFlag == 0 and !getprop("systems/fire/engine1/disch2")) { + if (eng1FireGnAgent2.clearFlag == 0 and !getprop("/systems/fire/engine1/disch2")) { eng1FireGnAgent2.active = 1; } else { ECAM_controller.warningReset(eng1FireGnAgent2); } - if (eng1FireGnmaster2.clearFlag == 0 and getprop("controls/engines/engine[1]/cutoff-switch") == 0) { + if (eng1FireGnmaster2.clearFlag == 0 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) { eng1FireGnmaster2.active = 1; } else { ECAM_controller.warningReset(eng1FireGnmaster2); @@ -424,7 +424,7 @@ var messages_priority_3 = func { ECAM_controller.warningReset(eng1FireGnevacSw); } - if (eng1FireGnevacApu.clearFlag == 0 and getprop("controls/apu/master") and getprop("engines/engine[2]/n1") > 99) { + if (eng1FireGnevacApu.clearFlag == 0 and getprop("/controls/apu/master") and getprop("/engines/engine[2]/n1") > 99) { eng1FireGnevacApu.active = 1; } else { ECAM_controller.warningReset(eng1FireGnevacApu); @@ -477,35 +477,35 @@ var messages_priority_3 = func { if (eng2Fire.active == 1) { if (phaseVar3 >= 5 and phaseVar3 <= 7) { - if (eng2FireFllever.clearFlag == 0 and getprop("fdm/jsbsim/fcs/throttle-lever[1]") > 0.01) { + if (eng2FireFllever.clearFlag == 0 and getprop("/fdm/jsbsim/fcs/throttle-lever[1]") > 0.01) { eng2FireFllever.active = 1; } else { ECAM_controller.warningReset(eng2FireFllever); } - if (eng2FireFlmaster.clearFlag == 0 and getprop("controls/engines/engine[1]/cutoff-switch") == 0) { + if (eng2FireFlmaster.clearFlag == 0 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) { eng2FireFlmaster.active = 1; } else { ECAM_controller.warningReset(eng2FireFlmaster); } - if (eng2FireFlPB.clearFlag == 0 and getprop("controls/engines/engine[1]/fire-btn") == 0) { + if (eng2FireFlPB.clearFlag == 0 and getprop("/controls/engines/engine[1]/fire-btn") == 0) { eng2FireFlPB.active = 1; } else { ECAM_controller.warningReset(eng2FireFlPB); } - if (getprop("systems/fire/engine2/agent1-timer") != 0 and getprop("systems/fire/engine2/agent1-timer") != 99) { - eng2FireFlAgent1Timer.msg = " -AGENT AFT " ~ getprop("systems/fire/engine2/agent1-timer") ~ " S...DISCH"; + if (getprop("/systems/fire/engine2/agent1-timer") != 0 and getprop("/systems/fire/engine2/agent1-timer") != 99) { + eng2FireFlAgent1Timer.msg = " -AGENT AFT " ~ getprop("/systems/fire/engine2/agent1-timer") ~ " S...DISCH"; } - if (eng2FireFlAgent1.clearFlag == 0 and getprop("controls/engines/engine[1]/fire-btn") == 1 and !getprop("systems/fire/engine2/disch1") and getprop("systems/fire/engine2agent1-timer") != 0 and getprop("systems/fire/engine2/agent1-timer") != 99) { + if (eng2FireFlAgent1.clearFlag == 0 and getprop("/controls/engines/engine[1]/fire-btn") == 1 and !getprop("/systems/fire/engine2/disch1") and getprop("/systems/fire/engine2agent1-timer") != 0 and getprop("/systems/fire/engine2/agent1-timer") != 99) { eng2FireFlAgent1Timer.active = 1; } else { ECAM_controller.warningReset(eng2FireFlAgent1Timer); } - if (eng2FireFlAgent1.clearFlag == 0 and !getprop("systems/fire/engine2/disch1") and (getprop("systems/fire/engine2/agent1-timer") == 0 or getprop("systems/fire/engine2/agent1-timer") == 99)) { + if (eng2FireFlAgent1.clearFlag == 0 and !getprop("/systems/fire/engine2/disch1") and (getprop("/systems/fire/engine2/agent1-timer") == 0 or getprop("/systems/fire/engine2/agent1-timer") == 99)) { eng2FireFlAgent1.active = 1; } else { ECAM_controller.warningReset(eng2FireFlAgent1); @@ -517,17 +517,17 @@ var messages_priority_3 = func { ECAM_controller.warningReset(eng2FireFlATC); } - if (getprop("systems/fire/engine2/agent2-timer") != 0 and getprop("systems/fire/engine2/agent2-timer") != 99) { - eng2FireFl30Sec.msg = "•IF FIRE AFTER " ~ getprop("systems/fire/engine2/agent2-timer") ~ " S:"; + if (getprop("/systems/fire/engine2/agent2-timer") != 0 and getprop("/systems/fire/engine2/agent2-timer") != 99) { + eng2FireFl30Sec.msg = "•IF FIRE AFTER " ~ getprop("/systems/fire/engine2/agent2-timer") ~ " S:"; } - if (eng2FireFlAgent2.clearFlag == 0 and getprop("systems/fire/engine2/disch1") and !getprop("systems/fire/engine2/disch2") and getprop("systems/fire/engine2/agent2-timer") > 0) { + if (eng2FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine2/disch1") and !getprop("/systems/fire/engine2/disch2") and getprop("/systems/fire/engine2/agent2-timer") > 0) { eng2FireFl30Sec.active = 1; } else { ECAM_controller.warningReset(eng2FireFl30Sec); } - if (eng2FireFlAgent2.clearFlag == 0 and getprop("systems/fire/engine2/disch1") and !getprop("systems/fire/engine2/disch2")) { + if (eng2FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine2/disch1") and !getprop("/systems/fire/engine2/disch2")) { eng2FireFlAgent2.active = 1; } else { ECAM_controller.warningReset(eng2FireFlAgent2); @@ -543,13 +543,13 @@ var messages_priority_3 = func { } if (phaseVar3 < 5 or phaseVar3 > 7) { - if (eng2FireGnlever.clearFlag == 0 and getprop("fdm/jsbsim/fcs/throttle-lever[0]") > 0.01 and getprop("fdm/jsbsim/fcs/throttle-lever[1]") > 0.01) { + if (eng2FireGnlever.clearFlag == 0 and getprop("/fdm/jsbsim/fcs/throttle-lever[0]") > 0.01 and getprop("/fdm/jsbsim/fcs/throttle-lever[1]") > 0.01) { eng2FireGnlever.active = 1; } else { ECAM_controller.warningReset(eng2FireGnlever); } - if (eng2FireGnparkbrk.clearFlag == 0 and getprop("controls/gear/brake-parking") == 0) { + if (eng2FireGnparkbrk.clearFlag == 0 and getprop("/controls/gear/brake-parking") == 0) { eng2FireGnstopped.active = 1; eng2FireGnparkbrk.active = 1; } else { @@ -557,31 +557,31 @@ var messages_priority_3 = func { ECAM_controller.warningReset(eng2FireGnparkbrk); } - if (eng2FireGnmaster.clearFlag == 0 and getprop("controls/engines/engine[1]/cutoff-switch") == 0) { + if (eng2FireGnmaster.clearFlag == 0 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) { eng2FireGnmaster.active = 1; } else { ECAM_controller.warningReset(eng2FireGnmaster); } - if (eng2FireGnPB.clearFlag == 0 and getprop("controls/engines/engine[1]/fire-btn") == 0) { + if (eng2FireGnPB.clearFlag == 0 and getprop("/controls/engines/engine[1]/fire-btn") == 0) { eng2FireGnPB.active = 1; } else { ECAM_controller.warningReset(eng2FireGnPB); } - if (eng2FireGnAgent1.clearFlag == 0 and !getprop("systems/fire/engine2/disch1")) { + if (eng2FireGnAgent1.clearFlag == 0 and !getprop("/systems/fire/engine2/disch1")) { eng2FireGnAgent1.active = 1; } else { ECAM_controller.warningReset(eng2FireGnAgent1); } - if (eng2FireGnAgent2.clearFlag == 0 and !getprop("systems/fire/engine2/disch2")) { + if (eng2FireGnAgent2.clearFlag == 0 and !getprop("/systems/fire/engine2/disch2")) { eng2FireGnAgent2.active = 1; } else { ECAM_controller.warningReset(eng2FireGnAgent2); } - if (eng2FireGnmaster2.clearFlag == 0 and getprop("controls/engines/engine[0]/cutoff-switch") == 0) { + if (eng2FireGnmaster2.clearFlag == 0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) { eng2FireGnmaster2.active = 1; } else { ECAM_controller.warningReset(eng2FireGnmaster2); @@ -607,7 +607,7 @@ var messages_priority_3 = func { ECAM_controller.warningReset(eng2FireGnevacSw); } - if (eng2FireGnevacApu.clearFlag == 0 and getprop("controls/apu/master") and getprop("engines/engine[2]/n1") > 99) { + if (eng2FireGnevacApu.clearFlag == 0 and getprop("/controls/apu/master") and getprop("/engines/engine[2]/n1") > 99) { eng2FireGnevacApu.active = 1; } else { ECAM_controller.warningReset(eng2FireGnevacApu); @@ -660,29 +660,29 @@ var messages_priority_3 = func { # APU Fire if (apuFire.active == 1) { - if (apuFirePB.clearFlag == 0 and !getprop("controls/apu/fire-btn")) { + if (apuFirePB.clearFlag == 0 and !getprop("/controls/apu/fire-btn")) { apuFirePB.active = 1; } else { ECAM_controller.warningReset(apuFirePB); } - if (getprop("systems/fire/apu/agent-timer") != 0 and getprop("systems/fire/apu/agent-timer") != 99) { - apuFireAgentTimer.msg = " -AGENT AFT " ~ getprop("systems/fire/apu/agent-timer") ~ " S...DISCH"; + if (getprop("/systems/fire/apu/agent-timer") != 0 and getprop("/systems/fire/apu/agent-timer") != 99) { + apuFireAgentTimer.msg = " -AGENT AFT " ~ getprop("/systems/fire/apu/agent-timer") ~ " S...DISCH"; } - if (apuFireAgent.clearFlag == 0 and getprop("controls/apu/fire-btn") and !getprop("systems/fire/apu/disch") and getprop("systems/fire/apu/agent-timer") != 0) { + if (apuFireAgent.clearFlag == 0 and getprop("/controls/apu/fire-btn") and !getprop("/systems/fire/apu/disch") and getprop("/systems/fire/apu/agent-timer") != 0) { apuFireAgentTimer.active = 1; } else { ECAM_controller.warningReset(apuFireAgentTimer); } - if (apuFireAgent.clearFlag == 0 and getprop("controls/apu/fire-btn") and !getprop("systems/fire/apu/disch") and getprop("systems/fire/apu/agent-timer") == 0) { + if (apuFireAgent.clearFlag == 0 and getprop("/controls/apu/fire-btn") and !getprop("/systems/fire/apu/disch") and getprop("/systems/fire/apu/agent-timer") == 0) { apuFireAgent.active = 1; } else { ECAM_controller.warningReset(apuFireAgent); } - if (apuFireMaster.clearFlag == 0 and getprop("controls/apu/master")) { + if (apuFireMaster.clearFlag == 0 and getprop("/controls/apu/master")) { apuFireMaster.active = 1; } else { ECAM_controller.warningReset(apuFireMaster); @@ -695,7 +695,7 @@ var messages_priority_3 = func { } # CONFIG - if ((slats_config.clearFlag == 0) and (getprop("controls/flight/flaps-input") == 0 or getprop("controls/flight/flaps-input")) == 4 and phaseVar3 >= 3 and phaseVar3 <= 4) { + if ((slats_config.clearFlag == 0) and (getprop("/controls/flight/flaps-input") == 0 or getprop("/controls/flight/flaps-input")) == 4 and phaseVar3 >= 3 and phaseVar3 <= 4) { slats_config.active = 1; slats_config_1.active = 1; } else { @@ -703,7 +703,7 @@ var messages_priority_3 = func { ECAM_controller.warningReset(slats_config_1); } - if ((flaps_config.clearFlag == 0) and (getprop("controls/flight/flaps-input") == 0 or getprop("controls/flight/flaps-input") == 4) and phaseVar3 >= 3 and phaseVar3 <= 4) { + if ((flaps_config.clearFlag == 0) and (getprop("/controls/flight/flaps-input") == 0 or getprop("/controls/flight/flaps-input") == 4) and phaseVar3 >= 3 and phaseVar3 <= 4) { flaps_config.active = 1; flaps_config_1.active = 1; } else { @@ -711,7 +711,7 @@ var messages_priority_3 = func { ECAM_controller.warningReset(flaps_config_1); } - if ((spd_brk_config.clearFlag == 0) and getprop("controls/flight/speedbrake") != 0 and phaseVar3 >= 3 and phaseVar3 <= 4) { + if ((spd_brk_config.clearFlag == 0) and getprop("/controls/flight/speedbrake") != 0 and phaseVar3 >= 3 and phaseVar3 <= 4) { spd_brk_config.active = 1; spd_brk_config_1.active = 1; } else { @@ -719,7 +719,7 @@ var messages_priority_3 = func { ECAM_controller.warningReset(spd_brk_config_1); } - if ((pitch_trim_config.clearFlag == 0) and (getprop("fdm/jsbsim/hydraulics/elevator-trim/final-deg") > 1.75 or getprop("fdm/jsbsim/hydraulics/elevator-trim/final-deg") < -3.65) and phaseVar3 >= 3 and phaseVar3 <= 4) { + if ((pitch_trim_config.clearFlag == 0) and (getprop("/fdm/jsbsim/hydraulics/elevator-trim/final-deg") > 1.75 or getprop("/fdm/jsbsim/hydraulics/elevator-trim/final-deg") < -3.65) and phaseVar3 >= 3 and phaseVar3 <= 4) { pitch_trim_config.active = 1; pitch_trim_config_1.active = 1; } else { @@ -727,7 +727,7 @@ var messages_priority_3 = func { ECAM_controller.warningReset(pitch_trim_config_1); } - if ((rud_trim_config.clearFlag == 0) and (getprop("fdm/jsbsim/hydraulics/rudder/trim-cmd-deg") < -3.55 or getprop("fdm/jsbsim/hydraulics/rudder/trim-cmd-deg") > 3.55) and phaseVar3 >= 3 and phaseVar3 <= 4) { + if ((rud_trim_config.clearFlag == 0) and (getprop("/fdm/jsbsim/hydraulics/rudder/trim-cmd-deg") < -3.55 or getprop("/fdm/jsbsim/hydraulics/rudder/trim-cmd-deg") > 3.55) and phaseVar3 >= 3 and phaseVar3 <= 4) { rud_trim_config.active = 1; rud_trim_config_1.active = 1; } else { @@ -735,7 +735,7 @@ var messages_priority_3 = func { ECAM_controller.warningReset(rud_trim_config_1); } - if ((park_brk_config.clearFlag == 0) and getprop("controls/gear/brake-parking") == 1 and phaseVar3 >= 3 and phaseVar3 <= 4) { + if ((park_brk_config.clearFlag == 0) and getprop("/controls/gear/brake-parking") == 1 and phaseVar3 >= 3 and phaseVar3 <= 4) { park_brk_config.active = 1; } else { ECAM_controller.warningReset(park_brk_config); @@ -749,19 +749,19 @@ var messages_priority_3 = func { } # C-Chord - if ((pts.Instrumentation.Altimeter.std.getValue() and abs(fcu.altSet.getValue() - getprop("systems/navigation/adr/output/baro-alt-1-capt")) < 200) or !pts.Instrumentation.Altimeter.std.getValue() and abs(fcu.altSet.getValue() - getprop("systems/navigation/adr/output/baro-alt-corrected-1-capt")) < 200) { + if ((pts.Instrumentation.Altimeter.std.getValue() and abs(fcu.altSet.getValue() - getprop("/systems/navigation/adr/output/baro-alt-1-capt")) < 200) or !pts.Instrumentation.Altimeter.std.getValue() and abs(fcu.altSet.getValue() - getprop("/systems/navigation/adr/output/baro-alt-corrected-1-capt")) < 200) { alt200 = 1; } else { alt200 = 0; } - if ((pts.Instrumentation.Altimeter.std.getValue() and abs(fcu.altSet.getValue() - getprop("systems/navigation/adr/output/baro-alt-1-capt")) < 750) or !pts.Instrumentation.Altimeter.std.getValue() and abs(fcu.altSet.getValue() - getprop("systems/navigation/adr/output/baro-alt-corrected-1-capt")) < 750) { + if ((pts.Instrumentation.Altimeter.std.getValue() and abs(fcu.altSet.getValue() - getprop("/systems/navigation/adr/output/baro-alt-1-capt")) < 750) or !pts.Instrumentation.Altimeter.std.getValue() and abs(fcu.altSet.getValue() - getprop("/systems/navigation/adr/output/baro-alt-corrected-1-capt")) < 750) { alt750 = 1; } else { alt750 = 0; } - if (FWC.altChg.getValue() or pts.Gear.position[0].getValue() == 1 or (getprop("controls/gear/gear-down") and pts.Fdm.JSBsim.Fcs.slatDeg.getValue() > 4) or fmgc.Output.vert.getValue() == 2) { + if (FWC.altChg.getValue() or pts.Gear.position[0].getValue() == 1 or (getprop("/controls/gear/gear-down") and pts.Fdm.JSBsim.Fcs.slatDeg.getValue() > 4) or fmgc.Output.vert.getValue() == 2) { altAlertInhibit = 1; } else { altAlertInhibit = 0; @@ -785,26 +785,26 @@ var messages_priority_3 = func { setprop("ECAM/flipflop/alt-alert-2-rs-set", 0); } - if (getprop("ECAM/flipflop/alt-alert-rs-reset") or (!alt750 and !alt200 and !altAlertInhibit)) { + if (getprop("/ECAM/flipflop/alt-alert-rs-reset") or (!alt750 and !alt200 and !altAlertInhibit)) { setprop("ECAM/flipflop/alt-alert-2-rs-reset", 1); } else { setprop("ECAM/flipflop/alt-alert-2-rs-reset", 0); } - if (alt750 and !alt200 and !altAlertInhibit and getprop("ECAM/flipflop/alt-alert-2-rs-output")) { + if (alt750 and !alt200 and !altAlertInhibit and getprop("/ECAM/flipflop/alt-alert-2-rs-output")) { setprop("ECAM/flipflop/alt-alert-3-rs-set", 1); } else { setprop("ECAM/flipflop/alt-alert-3-rs-set", 0); } - if ((!alt750 and !alt200 and !altAlertInhibit and getprop("ECAM/flipflop/alt-alert-rs-output")) or (!alt750 and !alt200 and !altAlertInhibit and getprop("ECAM/flipflop/alt-alert-3-rs-output")) or getprop("ECAM/flipflop/alt-alert-3-rs-set")) { + if ((!alt750 and !alt200 and !altAlertInhibit and getprop("/ECAM/flipflop/alt-alert-rs-output")) or (!alt750 and !alt200 and !altAlertInhibit and getprop("/ECAM/flipflop/alt-alert-3-rs-output")) or getprop("/ECAM/flipflop/alt-alert-3-rs-set")) { bigThree = 1; } else { bigThree = 0; } if (FWC.Timer.gnd.getValue() != 1 and (FWC.Monostable.altAlert1Output.getValue() or bigThree)) { - if (!getprop("sim/sound/warnings/cchord-inhibit")) { + if (!getprop("/sim/sound/warnings/cchord-inhibit")) { setprop("sim/sound/warnings/cchord", 1); } else { setprop("sim/sound/warnings/cchord", 0); @@ -814,7 +814,7 @@ var messages_priority_3 = func { setprop("sim/sound/warnings/cchord-inhibit", 0); } - if (FWC.Timer.gnd.getValue() != 1 and getprop("ECAM/flipflop/alt-alert-3-rs-set") != 1 and alt750 and !alt200 and !altAlertInhibit) { + if (FWC.Timer.gnd.getValue() != 1 and getprop("/ECAM/flipflop/alt-alert-3-rs-set") != 1 and alt750 and !alt200 and !altAlertInhibit) { setprop("ECAM/alt-alert-steady", 1); } else { setprop("ECAM/alt-alert-steady", 0); @@ -834,7 +834,7 @@ var messages_priority_3 = func { cargoSmokeFwd.isMainMsg = 1; } - if (cargoSmokeFwdAgent.clearFlag == 0 and cargoSmokeFwd.active == 1 and !getprop("systems/fire/cargo/disch")) { + if (cargoSmokeFwdAgent.clearFlag == 0 and cargoSmokeFwd.active == 1 and !getprop("/systems/fire/cargo/disch")) { cargoSmokeFwdAgent.active = 1; } else { ECAM_controller.warningReset(cargoSmokeFwdAgent); @@ -849,7 +849,7 @@ var messages_priority_3 = func { systems.cargoTestBtnOff.setBoolValue(0); } - if (cargoSmokeAftAgent.clearFlag == 0 and cargoSmokeAft.active == 1 and !getprop("systems/fire/cargo/disch")) { + if (cargoSmokeAftAgent.clearFlag == 0 and cargoSmokeAft.active == 1 and !getprop("/systems/fire/cargo/disch")) { cargoSmokeAftAgent.active = 1; } else { ECAM_controller.warningReset(cargoSmokeAftAgent); @@ -870,7 +870,7 @@ var messages_priority_3 = func { } # ESS on BAT - if ((!gear.getValue() or !getprop("controls/gear/gear-down")) and getprop("systems/electrical/some-electric-thingie/static-inverter-timer") == 1 and phaseVar3 >= 5 and phaseVar3 <= 7) { + if ((!gear.getValue() or !getprop("/controls/gear/gear-down")) and getprop("/systems/electrical/some-electric-thingie/static-inverter-timer") == 1 and phaseVar3 >= 5 and phaseVar3 <= 7) { essBusOnBat.active = 1; essBusOnBatLGUplock.active = 1; essBusOnBatManOn.active = 1; @@ -887,24 +887,24 @@ var messages_priority_3 = func { } # EMER CONFIG - if (getprop("systems/electrical/some-electric-thingie/emer-elec-config") and !dualFailNode.getBoolValue() and phaseVar3 != 4 and phaseVar3 != 8 and emerconfig.clearFlag == 0 and !getprop("systems/acconfig/autoconfig-running")) { + if (getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and !dualFailNode.getBoolValue() and phaseVar3 != 4 and phaseVar3 != 8 and emerconfig.clearFlag == 0 and !getprop("/systems/acconfig/autoconfig-running")) { emerconfig.active = 1; - if (getprop("systems/hydraulic/sources/rat/position") != 0 and emerconfigMinRat.clearFlag == 0) { + if (getprop("/systems/hydraulic/sources/rat/position") != 0 and emerconfigMinRat.clearFlag == 0) { emerconfigMinRat.active = 1; } else { ECAM_controller.warningReset(emerconfigMinRat); } - if (!(getprop("systems/electrical/some-electric-thingie/generator-1-reset") and getprop("systems/electrical/some-electric-thingie/generator-2-reset")) and emerconfigGen.clearFlag == 0) { + if (!(getprop("/systems/electrical/some-electric-thingie/generator-1-reset") and getprop("/systems/electrical/some-electric-thingie/generator-2-reset")) and emerconfigGen.clearFlag == 0) { emerconfigGen.active = 1; # EGEN12R TRUE } else { ECAM_controller.warningReset(emerconfigGen); } - if (!(getprop("systems/electrical/some-electric-thingie/generator-1-reset-bustie") and getprop("systems/electrical/some-electric-thingie/generator-2-reset-bustie")) and emerconfigGen2.clearFlag == 0) { + if (!(getprop("/systems/electrical/some-electric-thingie/generator-1-reset-bustie") and getprop("/systems/electrical/some-electric-thingie/generator-2-reset-bustie")) and emerconfigGen2.clearFlag == 0) { emerconfigGen2.active = 1; - if (getprop("controls/electrical/switches/bus-tie")) { + if (getprop("/controls/electrical/switches/bus-tie")) { emerconfigBusTie.active = 1; } else { ECAM_controller.warningReset(emerconfigBusTie); @@ -916,13 +916,13 @@ var messages_priority_3 = func { ECAM_controller.warningReset(emerconfigGen3); } - if (getprop("systems/electrical/relay/emer-glc/contact-pos") == 0 and emerconfigManOn.clearFlag == 0) { + if (getprop("/systems/electrical/relay/emer-glc/contact-pos") == 0 and emerconfigManOn.clearFlag == 0) { emerconfigManOn.active = 1; } else { ECAM_controller.warningReset(emerconfigManOn); } - if (getprop("controls/engines/engine-start-switch") != 2 and emerconfigEngMode.clearFlag == 0) { + if (getprop("/controls/engines/engine-start-switch") != 2 and emerconfigEngMode.clearFlag == 0) { emerconfigEngMode.active = 1; } else { ECAM_controller.warningReset(emerconfigEngMode); @@ -958,7 +958,7 @@ var messages_priority_3 = func { ECAM_controller.warningReset(emerconfigFAC); } - if (!getprop("controls/electrical/switches/bus-tie") and emerconfigBusTie2.clearFlag == 0) { + if (!getprop("/controls/electrical/switches/bus-tie") and emerconfigBusTie2.clearFlag == 0) { emerconfigBusTie2.active = 1; } else { ECAM_controller.warningReset(emerconfigBusTie2); @@ -1019,7 +1019,7 @@ var messages_priority_3 = func { var messages_priority_2 = func { phaseVar2 = phaseNode.getValue(); # DC EMER CONFIG - if (!getprop("systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.dcEss.getValue() < 25 and systems.ELEC.Bus.dc1.getValue() < 25 and systems.ELEC.Bus.dc2.getValue() < 25 and phaseVar2 != 4 and phaseVar2 != 8 and dcEmerconfig.clearFlag == 0) { + if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.dcEss.getValue() < 25 and systems.ELEC.Bus.dc1.getValue() < 25 and systems.ELEC.Bus.dc2.getValue() < 25 and phaseVar2 != 4 and phaseVar2 != 8 and dcEmerconfig.clearFlag == 0) { dcEmerconfig.active = 1; dcEmerconfigManOn.active = 1; } else { @@ -1027,7 +1027,7 @@ var messages_priority_2 = func { ECAM_controller.warningReset(dcEmerconfigManOn); } - if (!getprop("systems/electrical/some-electric-thingie/emer-elec-config") and !dcEmerconfig.active and systems.ELEC.Bus.dc1.getValue() < 25 and systems.ELEC.Bus.dc2.getValue() < 25 and phaseVar2 != 4 and phaseVar2 != 8 and dcBus12Fault.clearFlag == 0) { + if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and !dcEmerconfig.active and systems.ELEC.Bus.dc1.getValue() < 25 and systems.ELEC.Bus.dc2.getValue() < 25 and phaseVar2 != 4 and phaseVar2 != 8 and dcBus12Fault.clearFlag == 0) { dcBus12Fault.active = 1; dcBus12FaultBlower.active = 1; dcBus12FaultExtract.active = 1; @@ -1043,7 +1043,7 @@ var messages_priority_2 = func { ECAM_controller.warningReset(dcBus12FaultBrking); } - if (!getprop("systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.acEss.getValue() < 110 and phaseVar2 != 4 and phaseVar2 != 8 and AcBusEssFault.clearFlag == 0) { + if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.acEss.getValue() < 110 and phaseVar2 != 4 and phaseVar2 != 8 and AcBusEssFault.clearFlag == 0) { AcBusEssFault.active = 1; if (!systems.ELEC.Switch.acEssFeed.getBoolValue()) { AcBusEssFaultFeed.active = 1; @@ -1057,7 +1057,7 @@ var messages_priority_2 = func { ECAM_controller.warningReset(AcBusEssFaultAtc); } - if (!getprop("systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.ac1.getValue() < 110 and phaseVar2 != 4 and phaseVar2 != 8 and AcBus1Fault.clearFlag == 0) { + if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.ac1.getValue() < 110 and phaseVar2 != 4 and phaseVar2 != 8 and AcBus1Fault.clearFlag == 0) { AcBus1Fault.active = 1; AcBus1FaultBlower.active = 1; } else { @@ -1079,7 +1079,7 @@ var messages_priority_2 = func { ECAM_controller.warningReset(DcEssBusFaultGPWS); } - if (!getprop("systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.ac2.getValue() < 110 and phaseVar2 != 4 and phaseVar2 != 8 and AcBus2Fault.clearFlag == 0) { + if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.ac2.getValue() < 110 and phaseVar2 != 4 and phaseVar2 != 8 and AcBus2Fault.clearFlag == 0) { AcBus2Fault.active = 1; AcBus2FaultExtract.active = 1; } else { @@ -1087,7 +1087,7 @@ var messages_priority_2 = func { ECAM_controller.warningReset(AcBus2FaultExtract); } - if (!getprop("systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.dc1.getValue() < 25 and systems.ELEC.Bus.dc2.getValue() >= 25 and phaseVar2 != 4 and phaseVar2 != 8 and dcBus1Fault.clearFlag == 0) { + if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.dc1.getValue() < 25 and systems.ELEC.Bus.dc2.getValue() >= 25 and phaseVar2 != 4 and phaseVar2 != 8 and dcBus1Fault.clearFlag == 0) { dcBus1Fault.active = 1; dcBus1FaultBlower.active = 1; dcBus1FaultExtract.active = 1; @@ -1097,7 +1097,7 @@ var messages_priority_2 = func { ECAM_controller.warningReset(dcBus1FaultExtract); } - if (!getprop("systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.dc1.getValue() >= 25 and systems.ELEC.Bus.dc2.getValue() <= 25 and phaseVar2 != 4 and phaseVar2 != 8 and dcBus2Fault.clearFlag == 0) { + if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.dc1.getValue() >= 25 and systems.ELEC.Bus.dc2.getValue() <= 25 and phaseVar2 != 4 and phaseVar2 != 8 and dcBus2Fault.clearFlag == 0) { dcBus2Fault.active = 1; dcBus2FaultAirData.active = 1; dcBus2FaultBaro.active = 1; @@ -1107,13 +1107,13 @@ var messages_priority_2 = func { ECAM_controller.warningReset(dcBus2FaultBaro); } - if (!getprop("systems/electrical/some-electric-thingie/emer-elec-config") and !dcEmerconfig.active and systems.ELEC.Bus.dcBat.getValue() < 25 and phaseVar2 != 4 and phaseVar2 != 5 and phaseVar2 != 7 and phaseVar2 != 8 and dcBusBatFault.clearFlag == 0) { + if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and !dcEmerconfig.active and systems.ELEC.Bus.dcBat.getValue() < 25 and phaseVar2 != 4 and phaseVar2 != 5 and phaseVar2 != 7 and phaseVar2 != 8 and dcBusBatFault.clearFlag == 0) { dcBusBatFault.active = 1; } else { ECAM_controller.warningReset(dcBusBatFault); } - if (!(getprop("systems/electrical/some-electric-thingie/emer-elec-config") and !getprop("systems/electrical/relay/emer-glc/contact-pos")) and systems.ELEC.Bus.dcEssShed.getValue() < 25 and systems.ELEC.Bus.dcEss.getValue() >= 25 and phaseVar2 != 4 and phaseVar2 != 8 and dcBusEssShed.clearFlag == 0) { + if (!(getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and !getprop("/systems/electrical/relay/emer-glc/contact-pos")) and systems.ELEC.Bus.dcEssShed.getValue() < 25 and systems.ELEC.Bus.dcEss.getValue() >= 25 and phaseVar2 != 4 and phaseVar2 != 8 and dcBusEssShed.clearFlag == 0) { dcBusEssShed.active = 1; dcBusEssShedExtract.active = 1; dcBusEssShedIcing.active = 1; @@ -1123,9 +1123,9 @@ var messages_priority_2 = func { ECAM_controller.warningReset(dcBusEssShedIcing); } - if (!(getprop("systems/electrical/some-electric-thingie/emer-elec-config") and !getprop("systems/electrical/relay/emer-glc/contact-pos")) and systems.ELEC.Bus.acEssShed.getValue() < 110 and systems.ELEC.Bus.acEss.getValue() >= 110 and phaseVar2 != 4 and phaseVar2 != 8 and acBusEssShed.clearFlag == 0) { + if (!(getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and !getprop("/systems/electrical/relay/emer-glc/contact-pos")) and systems.ELEC.Bus.acEssShed.getValue() < 110 and systems.ELEC.Bus.acEss.getValue() >= 110 and phaseVar2 != 4 and phaseVar2 != 8 and acBusEssShed.clearFlag == 0) { acBusEssShed.active = 1; - if (!getprop("systems/electrical/some-electric-thingie/emer-elec-config")) { + if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config")) { acBusEssShedAtc.active = 1; } else { ECAM_controller.warningReset(acBusEssShed); @@ -1143,8 +1143,8 @@ var messages_priority_2 = func { ECAM_controller.warningReset(athr_offw_1); } - if ((athr_lock.clearFlag == 0) and phaseVar2 >= 5 and phaseVar2 <= 7 and getprop("systems/thrust/thr-locked-alert") == 1) { - if (getprop("systems/thrust/thr-locked-flash") == 0) { + if ((athr_lock.clearFlag == 0) and phaseVar2 >= 5 and phaseVar2 <= 7 and getprop("/systems/thrust/thr-locked-alert") == 1) { + if (getprop("/systems/thrust/thr-locked-flash") == 0) { athr_lock.msg = " "; } else { athr_lock.msg = msgSave @@ -1157,7 +1157,7 @@ var messages_priority_2 = func { } - if ((athr_lim.clearFlag == 0) and getprop("it-autoflight/output/athr") == 1 and ((getprop("systems/thrust/eng-out") != 1 and (getprop("systems/thrust/state1") == "MAN" or getprop("systems/thrust/state2") == "MAN")) or (getprop("systems/thrust/eng-out") == 1 and (getprop("systems/thrust/state1") == "MAN" or getprop("systems/thrust/state2") == "MAN" or (getprop("systems/thrust/state1") == "MAN THR" and getprop("controls/engines/engine[0]/throttle-pos") <= 0.83) or (getprop("systems/thrust/state2") == "MAN THR" and getprop("controls/engines/engine[0]/throttle-pos") <= 0.83)))) and (phaseVar2 >= 5 and phaseVar2 <= 7)) { + if ((athr_lim.clearFlag == 0) and getprop("it-autoflight/output/athr") == 1 and ((getprop("/systems/thrust/eng-out") != 1 and (getprop("/systems/thrust/state1") == "MAN" or getprop("/systems/thrust/state2") == "MAN")) or (getprop("/systems/thrust/eng-out") == 1 and (getprop("/systems/thrust/state1") == "MAN" or getprop("/systems/thrust/state2") == "MAN" or (getprop("/systems/thrust/state1") == "MAN THR" and getprop("/controls/engines/engine[0]/throttle-pos") <= 0.83) or (getprop("/systems/thrust/state2") == "MAN THR" and getprop("/controls/engines/engine[0]/throttle-pos") <= 0.83)))) and (phaseVar2 >= 5 and phaseVar2 <= 7)) { athr_lim.active = 1; athr_lim_1.active = 1; } else { @@ -1289,20 +1289,20 @@ var messages_priority_2 = func { } # APU EMER SHUT DOWN - if (apuEmerShutdown.clearFlag == 0 and systems.APUController.APU.signals.autoshutdown and systems.APUController.APU.signals.emer and !getprop("systems/fire/apu/warning-active") and (phaseVar2 == 6 or phaseVar2 >= 9 or phaseVar2 <= 2)) { + if (apuEmerShutdown.clearFlag == 0 and systems.APUController.APU.signals.autoshutdown and systems.APUController.APU.signals.emer and !getprop("/systems/fire/apu/warning-active") and (phaseVar2 == 6 or phaseVar2 >= 9 or phaseVar2 <= 2)) { apuEmerShutdown.active = 1; } elsif (apuEmerShutdown.clearFlag == 1) { ECAM_controller.warningReset(apuEmerShutdown); } - if (apuEmerShutdownMast.clearFlag == 0 and getprop("controls/apu/master") and apuEmerShutdown.active == 1) { + if (apuEmerShutdownMast.clearFlag == 0 and getprop("/controls/apu/master") and apuEmerShutdown.active == 1) { apuEmerShutdownMast.active = 1; } else { ECAM_controller.warningReset(apuEmerShutdownMast); } # APU AUTO SHUT DOWN - if (apuAutoShutdown.clearFlag == 0 and systems.APUController.APU.signals.autoshutdown and !systems.APUController.APU.signals.emer and !getprop("systems/fire/apu/warning-active") and (phaseVar2 == 6 or phaseVar2 >= 9 or phaseVar2 <= 2)) { + if (apuAutoShutdown.clearFlag == 0 and systems.APUController.APU.signals.autoshutdown and !systems.APUController.APU.signals.emer and !getprop("/systems/fire/apu/warning-active") and (phaseVar2 == 6 or phaseVar2 >= 9 or phaseVar2 <= 2)) { apuAutoShutdown.active = 1; } elsif (apuAutoShutdown.clearFlag == 1) { ECAM_controller.warningReset(apuAutoShutdown); @@ -2024,25 +2024,25 @@ var messages_priority_0 = func { var messages_config_memo = func { phaseVarMemo = phaseNode.getValue(); - if (getprop("controls/flight/flaps-input") == 0 or getprop("controls/flight/flaps-input") == 4 or getprop("controls/flight/speedbrake") != 0 or getprop("fdm/jsbsim/hydraulics/elevator-trim/final-deg") > 1.75 or getprop("fdm/jsbsim/hydraulics/elevator-trim/final-deg") < -3.65 or getprop("fdm/jsbsim/hydraulics/rudder/trim-cmd-deg") < -3.55 or getprop("fdm/jsbsim/hydraulics/rudder/trim-cmd-deg") > 3.55) { + if (getprop("/controls/flight/flaps-input") == 0 or getprop("/controls/flight/flaps-input") == 4 or getprop("/controls/flight/speedbrake") != 0 or getprop("/fdm/jsbsim/hydraulics/elevator-trim/final-deg") > 1.75 or getprop("/fdm/jsbsim/hydraulics/elevator-trim/final-deg") < -3.65 or getprop("/fdm/jsbsim/hydraulics/rudder/trim-cmd-deg") < -3.55 or getprop("/fdm/jsbsim/hydraulics/rudder/trim-cmd-deg") > 3.55) { setprop("ECAM/to-config-normal", 0); } else { setprop("ECAM/to-config-normal", 1); } - if (getprop("ECAM/to-config-test") and (phaseVarMemo == 2 or phaseVarMemo == 9)) { + if (getprop("/ECAM/to-config-test") and (phaseVarMemo == 2 or phaseVarMemo == 9)) { setprop("ECAM/to-config-set", 1); } else { setprop("ECAM/to-config-set", 0); } - if (!getprop("ECAM/to-config-normal") or phaseVarMemo == 6) { + if (!getprop("/ECAM/to-config-normal") or phaseVarMemo == 6) { setprop("ECAM/to-config-reset", 1); } else { setprop("ECAM/to-config-reset", 0); } - if (getprop("controls/autobrake/mode") == 3) { + if (getprop("/controls/autobrake/mode") == 3) { toMemoLine1.msg = "T.O AUTO BRK MAX"; toMemoLine1.colour = "g"; } else { @@ -2050,7 +2050,7 @@ var messages_config_memo = func { toMemoLine1.colour = "c"; } - if (getprop("controls/switches/seatbelt-sign") and getprop("controls/switches/no-smoking-sign")) { + if (getprop("/controls/switches/seatbelt-sign") and getprop("/controls/switches/no-smoking-sign")) { toMemoLine2.msg = " SIGNS ON"; toMemoLine2.colour = "g"; } else { @@ -2058,7 +2058,7 @@ var messages_config_memo = func { toMemoLine2.colour = "c"; } - if (getprop("controls/flight/speedbrake-arm")) { + if (getprop("/controls/flight/speedbrake-arm")) { toMemoLine3.msg = " SPLRS ARM"; toMemoLine3.colour = "g"; } else { @@ -2066,7 +2066,7 @@ var messages_config_memo = func { toMemoLine3.colour = "c"; } - if (getprop("controls/flight/flaps-pos") > 0 and getprop("controls/flight/flaps-pos") < 5) { + if (getprop("/controls/flight/flaps-pos") > 0 and getprop("/controls/flight/flaps-pos") < 5) { toMemoLine4.msg = " FLAPS T.O"; toMemoLine4.colour = "g"; } else { @@ -2074,7 +2074,7 @@ var messages_config_memo = func { toMemoLine4.colour = "c"; } - if (getprop("ECAM/to-config-flipflop") and getprop("ECAM/to-config-normal")) { + if (getprop("/ECAM/to-config-flipflop") and getprop("/ECAM/to-config-normal")) { toMemoLine5.msg = " T.O CONFIG NORMAL"; toMemoLine5.colour = "g"; } else { @@ -2082,7 +2082,7 @@ var messages_config_memo = func { toMemoLine5.colour = "c"; } - if (getprop("ECAM/to-config-test") and (phaseVarMemo == 2 or phaseVarMemo == 9)) { + if (getprop("/ECAM/to-config-test") and (phaseVarMemo == 2 or phaseVarMemo == 9)) { setprop("ECAM/to-memo-set", 1); } else { setprop("ECAM/to-memo-set", 0); @@ -2094,7 +2094,7 @@ var messages_config_memo = func { setprop("ECAM/to-memo-reset", 0); } - if ((phaseVarMemo == 2 and getprop("ECAM/engine-start-time") != 0 and getprop("ECAM/engine-start-time") + 120 < getprop("sim/time/elapsed-sec")) or getprop("ECAM/to-memo-flipflop")) { + if ((phaseVarMemo == 2 and getprop("/ECAM/engine-start-time") != 0 and getprop("/ECAM/engine-start-time") + 120 < getprop("/sim/time/elapsed-sec")) or getprop("/ECAM/to-memo-flipflop")) { toMemoLine1.active = 1; toMemoLine2.active = 1; toMemoLine3.active = 1; @@ -2108,7 +2108,7 @@ var messages_config_memo = func { ECAM_controller.warningReset(toMemoLine5); } - if (getprop("fdm/jsbsim/gear/gear-pos-norm") == 1) { + if (getprop("/fdm/jsbsim/gear/gear-pos-norm") == 1) { ldgMemoLine1.msg = "LDG LDG GEAR DN"; ldgMemoLine1.colour = "g"; } else { @@ -2116,7 +2116,7 @@ var messages_config_memo = func { ldgMemoLine1.colour = "c"; } - if (getprop("controls/switches/seatbelt-sign") and getprop("controls/switches/no-smoking-sign")) { + if (getprop("/controls/switches/seatbelt-sign") and getprop("/controls/switches/no-smoking-sign")) { ldgMemoLine2.msg = " SIGNS ON"; ldgMemoLine2.colour = "g"; } else { @@ -2124,7 +2124,7 @@ var messages_config_memo = func { ldgMemoLine2.colour = "c"; } - if (getprop("controls/flight/speedbrake-arm")) { + if (getprop("/controls/flight/speedbrake-arm")) { ldgMemoLine3.msg = " SPLRS ARM"; ldgMemoLine3.colour = "g"; } else { @@ -2133,7 +2133,7 @@ var messages_config_memo = func { } if (getprop("it-fbw/law") == 1 or getprop("instrumentation/mk-viii/inputs/discretes/momentary-flap-3-override")) { - if (getprop("controls/flight/flaps-pos") == 4) { + if (getprop("/controls/flight/flaps-pos") == 4) { ldgMemoLine4.msg = " FLAPS CONF 3"; ldgMemoLine4.colour = "g"; } else { @@ -2141,7 +2141,7 @@ var messages_config_memo = func { ldgMemoLine4.colour = "c"; } } else { - if (getprop("controls/flight/flaps-pos") == 5) { + if (getprop("/controls/flight/flaps-pos") == 5) { ldgMemoLine4.msg = " FLAPS FULL"; ldgMemoLine4.colour = "g"; } else { @@ -2175,7 +2175,7 @@ var messages_config_memo = func { setprop("ECAM/ldg-memo-2200-reset", 0); } - if ((phaseVarMemo == 6 and getprop("ECAM/ldg-memo-flipflop") and getprop("ECAM/ldg-memo-2200-flipflop")) or phaseVarMemo == 7 or phaseVarMemo == 8) { + if ((phaseVarMemo == 6 and getprop("/ECAM/ldg-memo-flipflop") and getprop("/ECAM/ldg-memo-2200-flipflop")) or phaseVarMemo == 7 or phaseVarMemo == 8) { ldgMemoLine1.active = 1; ldgMemoLine2.active = 1; ldgMemoLine3.active = 1; @@ -2190,7 +2190,7 @@ var messages_config_memo = func { var messages_memo = func { phaseVarMemo2 = phaseNode.getValue(); - if (getprop("services/fuel-truck/enable") == 1 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) { + if (getprop("/services/fuel-truck/enable") == 1 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) { refuelg.active = 1; } else { refuelg.active = 0; @@ -2204,7 +2204,7 @@ var messages_memo = func { if ((phaseVarMemo2 == 1 or phaseVarMemo2 == 2) and toMemoLine1.active != 1 and ldgMemoLine1.active != 1 and (systems.ADIRS.ADIRunits[0].inAlign == 1 or systems.ADIRS.ADIRunits[1].inAlign == 1 or systems.ADIRS.ADIRunits[2].inAlign == 1)) { irs_in_align.active = 1; - if (getprop("ECAM/phases/timer/eng1or2-output")) { + if (getprop("/ECAM/phases/timer/eng1or2-output")) { irs_in_align.colour = "a"; } else { irs_in_align.colour = "g"; @@ -2235,25 +2235,25 @@ var messages_memo = func { } } - if (getprop("controls/flight/speedbrake-arm") == 1 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) { + if (getprop("/controls/flight/speedbrake-arm") == 1 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) { gnd_splrs.active = 1; } else { gnd_splrs.active = 0; } - if (getprop("controls/lighting/seatbelt-sign") == 1 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) { + if (getprop("/controls/lighting/seatbelt-sign") == 1 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) { seatbelts.active = 1; } else { seatbelts.active = 0; } - if (getprop("controls/lighting/no-smoking-sign") == 1 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) { # should go off after takeoff assuming switch is in auto due to old logic from the days when smoking was allowed! + if (getprop("/controls/lighting/no-smoking-sign") == 1 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) { # should go off after takeoff assuming switch is in auto due to old logic from the days when smoking was allowed! nosmoke.active = 1; } else { nosmoke.active = 0; } - if (getprop("controls/lighting/strobe") == 0 and getprop("gear/gear[1]/wow") == 0 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) { # todo: use gear branch properties + if (getprop("/controls/lighting/strobe") == 0 and !pts.Gear.wow[1].getValue() and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) { # todo: use gear branch properties strobe_lt_off.active = 1; } else { strobe_lt_off.active = 0; @@ -2265,7 +2265,7 @@ var messages_memo = func { outr_tk_fuel_xfrd.active = 0; } - if (getprop("consumables/fuel/total-fuel-lbs") < 6000 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) { # assuming US short ton 2000lb + if (getprop("/consumables/fuel/total-fuel-lbs") < 6000 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) { # assuming US short ton 2000lb fob_3T.active = 1; } else { fob_3T.active = 0; @@ -2293,14 +2293,14 @@ var messages_right_memo = func { ldg_inhibit.active = 0; } - if ((getprop("gear/gear[1]/wow") == 0) and (getprop("systems/electrical/some-electric-thingie/emer-elec-config") or getprop("systems/fire/engine1/warning-active") == 1 or getprop("systems/fire/engine2/warning-active") == 1 or getprop("systems/fire/apu/warning-active") == 1 or getprop("systems/failures/cargo-aft-fire") == 1 or getprop("systems/failures/cargo-fwd-fire") == 1) or (((getprop("systems/hydraulic/green-psi") < 1500 and getprop("engines/engine[0]/state") == 3) and (getprop("systems/hydraulic/yellow-psi") < 1500 and getprop("engines/engine[1]/state") == 3)) or ((getprop("systems/hydraulic/green-psi") < 1500 or getprop("systems/hydraulic/yellow-psi") < 1500) and getprop("engines/engine[0]/state") == 3 and getprop("engines/engine[1]/state") == 3) and phaseVarMemo3 >= 3 and phaseVarMemo3 <= 8)) { + if ((!pts.Gear.wow[1].getValue()) and (getprop("/systems/electrical/some-electric-thingie/emer-elec-config") or getprop("/systems/fire/engine1/warning-active") == 1 or getprop("/systems/fire/engine2/warning-active") == 1 or getprop("/systems/fire/apu/warning-active") == 1 or getprop("/systems/failures/cargo-aft-fire") == 1 or getprop("/systems/failures/cargo-fwd-fire") == 1) or (((getprop("/systems/hydraulic/green-psi") < 1500 and getprop("/engines/engine[0]/state") == 3) and (getprop("/systems/hydraulic/yellow-psi") < 1500 and getprop("/engines/engine[1]/state") == 3)) or ((getprop("/systems/hydraulic/green-psi") < 1500 or getprop("/systems/hydraulic/yellow-psi") < 1500) and getprop("/engines/engine[0]/state") == 3 and getprop("/engines/engine[1]/state") == 3) and phaseVarMemo3 >= 3 and phaseVarMemo3 <= 8)) { # todo: emer elec land_asap_r.active = 1; } else { land_asap_r.active = 0; } - if (land_asap_r.active == 0 and getprop("gear/gear[1]/wow") == 0 and ((getprop("fdm/jsbsim/propulsion/tank[0]/contents-lbs") < 1650 and getprop("fdm/jsbsim/propulsion/tank[1]/contents-lbs") < 1650) or ((getprop("systems/electrical/bus/dc-2") < 25 and (getprop("systems/failures/fctl/elac1") == 1 or getprop("systems/failures/fctl/sec1") == 1)) or (getprop("systems/hydraulic/green-psi") < 1500 and (getprop("systems/failures/fctl/elac1") == 1 and getprop("systems/failures/fctl/sec1") == 1)) or (getprop("systems/hydraulic/yellow-psi") < 1500 and (getprop("systems/failures/fctl/elac1") == 1 and getprop("systems/failures/fctl/sec1") == 1)) or (getprop("systems/hydraulic/blue-psi") < 1500 and (getprop("systems/failures/fctl/elac2") == 1 and getprop("systems/failures/fctl/sec2") == 1))) or (phaseVarMemo3 >= 3 and phaseVarMemo3 <= 8 and (getprop("engines/engine[0]/state") != 3 or getprop("engines/engine[1]/state") != 3)))) { + if (land_asap_r.active == 0 and !pts.Gear.wow[1].getValue() and ((getprop("/fdm/jsbsim/propulsion/tank[0]/contents-lbs") < 1650 and getprop("/fdm/jsbsim/propulsion/tank[1]/contents-lbs") < 1650) or ((getprop("/systems/electrical/bus/dc-2") < 25 and (getprop("/systems/failures/fctl/elac1") == 1 or getprop("/systems/failures/fctl/sec1") == 1)) or (getprop("/systems/hydraulic/green-psi") < 1500 and (getprop("/systems/failures/fctl/elac1") == 1 and getprop("/systems/failures/fctl/sec1") == 1)) or (getprop("/systems/hydraulic/yellow-psi") < 1500 and (getprop("/systems/failures/fctl/elac1") == 1 and getprop("/systems/failures/fctl/sec1") == 1)) or (getprop("/systems/hydraulic/blue-psi") < 1500 and (getprop("/systems/failures/fctl/elac2") == 1 and getprop("/systems/failures/fctl/sec2") == 1))) or (phaseVarMemo3 >= 3 and phaseVarMemo3 <= 8 and (getprop("/engines/engine[0]/state") != 3 or getprop("/engines/engine[1]/state") != 3)))) { land_asap_a.active = 1; } else { land_asap_a.active = 0; @@ -2318,19 +2318,19 @@ var messages_right_memo = func { athr_off.active = 0; } - if ((phaseVarMemo3 >= 2 and phaseVarMemo3 <= 7) and getprop("controls/flight/speedbrake") != 0) { + if ((phaseVarMemo3 >= 2 and phaseVarMemo3 <= 7) and getprop("/controls/flight/speedbrake") != 0) { spd_brk.active = 1; } else { spd_brk.active = 0; } - if (getprop("systems/thrust/state1") == "IDLE" and getprop("systems/thrust/state2") == "IDLE" and phaseVarMemo3 >= 6 and phaseVarMemo3 <= 7) { + if (getprop("/systems/thrust/state1") == "IDLE" and getprop("/systems/thrust/state2") == "IDLE" and phaseVarMemo3 >= 6 and phaseVarMemo3 <= 7) { spd_brk.colour = "g"; - } else if ((phaseVarMemo3 >= 2 and phaseVarMemo3 <= 5) or ((getprop("systems/thrust/state1") != "IDLE" or getprop("systems/thrust/state2") != "IDLE") and (phaseVarMemo3 >= 6 and phaseVarMemo3 <= 7))) { + } else if ((phaseVarMemo3 >= 2 and phaseVarMemo3 <= 5) or ((getprop("/systems/thrust/state1") != "IDLE" or getprop("/systems/thrust/state2") != "IDLE") and (phaseVarMemo3 >= 6 and phaseVarMemo3 <= 7))) { spd_brk.colour = "a"; } - if (getprop("controls/gear/brake-parking") == 1 and phaseVarMemo3 != 3) { + if (getprop("/controls/gear/brake-parking") == 1 and phaseVarMemo3 != 3) { park_brk.active = 1; } else { park_brk.active = 0; @@ -2341,19 +2341,19 @@ var messages_right_memo = func { park_brk.colour = "g"; } - if (getprop("controls/gear/brake-fans") == 1) { + if (getprop("/controls/gear/brake-fans") == 1) { brk_fan.active = 1; } else { brk_fan.active = 0; } - if (getprop("controls/hydraulic/ptu") == 1 and ((getprop("systems/hydraulic/yellow-psi") < 1450 and getprop("systems/hydraulic/green-psi") > 1450 and getprop("controls/hydraulic/elec-pump-yellow") == 0) or (getprop("systems/hydraulic/yellow-psi") > 1450 and getprop("systems/hydraulic/green-psi") < 1450))) { + if (getprop("/controls/hydraulic/ptu") == 1 and ((getprop("/systems/hydraulic/yellow-psi") < 1450 and getprop("/systems/hydraulic/green-psi") > 1450 and getprop("/controls/hydraulic/elec-pump-yellow") == 0) or (getprop("/systems/hydraulic/yellow-psi") > 1450 and getprop("/systems/hydraulic/green-psi") < 1450))) { ptu.active = 1; } else { ptu.active = 0; } - if (getprop("systems/hydraulic/sources/rat/position") != 0) { + if (getprop("/systems/hydraulic/sources/rat/position") != 0) { rat.active = 1; } else { rat.active = 0; @@ -2365,31 +2365,31 @@ var messages_right_memo = func { rat.colour = "g"; } - if (getprop("systems/electrical/relay/emer-glc/contact-pos") == 1 and getprop("systems/hydraulic/sources/rat/position") != 0 and getprop("gear/gear[1]/wow") == 0) { + if (getprop("/systems/electrical/relay/emer-glc/contact-pos") == 1 and getprop("/systems/hydraulic/sources/rat/position") != 0 and !pts.Gear.wow[1].getValue()) { emer_gen.active = 1; } else { emer_gen.active = 0; } - if (getprop("sim/model/autopush/enabled") == 1) { # this message is only on when towing - not when disc with switch + if (getprop("/sim/model/autopush/enabled") == 1) { # this message is only on when towing - not when disc with switch nw_strg_disc.active = 1; } else { nw_strg_disc.active = 0; } - if (getprop("engines/engine[0]/state") == 3 or getprop("engines/engine[1]/state") == 3) { + if (getprop("/engines/engine[0]/state") == 3 or getprop("/engines/engine[1]/state") == 3) { nw_strg_disc.colour = "a"; } else { nw_strg_disc.colour = "g"; } - if (getprop("controls/pneumatics/switches/ram-air") == 1) { + if (getprop("/controls/pneumatics/switches/ram-air") == 1) { ram_air.active = 1; } else { ram_air.active = 0; } - if (getprop("controls/engines/engine[0]/igniter-a") == 1 or getprop("controls/engines/engine[0]/igniter-b") == 1 or getprop("controls/engines/engine[1]/igniter-a") == 1 or getprop("controls/engines/engine[1]/igniter-b") == 1) { + if (getprop("/controls/engines/engine[0]/igniter-a") == 1 or getprop("/controls/engines/engine[0]/igniter-b") == 1 or getprop("/controls/engines/engine[1]/igniter-a") == 1 or getprop("/controls/engines/engine[1]/igniter-b") == 1) { ignition.active = 1; } else { ignition.active = 0; @@ -2401,31 +2401,31 @@ var messages_right_memo = func { company_call.active = 0; } - if (getprop("controls/pneumatics/switches/apu") == 1 and getprop("engines/engine[2]/n1") >= 95) { + if (getprop("/controls/pneumatics/switches/apu") == 1 and getprop("/engines/engine[2]/n1") >= 95) { apu_bleed.active = 1; } else { apu_bleed.active = 0; } - if (apu_bleed.active == 0 and getprop("engines/engine[2]/n1") >= 95) { + if (apu_bleed.active == 0 and getprop("/engines/engine[2]/n1") >= 95) { apu_avail.active = 1; } else { apu_avail.active = 0; } - if (getprop("controls/lighting/landing-lights[1]") > 0 or getprop("controls/lighting/landing-lights[2]") > 0) { + if (getprop("/controls/lighting/landing-lights[1]") > 0 or getprop("/controls/lighting/landing-lights[2]") > 0) { ldg_lt.active = 1; } else { ldg_lt.active = 0; } - if (getprop("controls/ice-protection/leng") == 1 or getprop("controls/ice-protection/reng") == 1 or getprop("systems/electrical/bus/dc-1") == 0 or getprop("systems/electrical/bus/dc-2") == 0) { + if (getprop("/controls/ice-protection/leng") == 1 or getprop("/controls/ice-protection/reng") == 1 or getprop("/systems/electrical/bus/dc-1") == 0 or getprop("/systems/electrical/bus/dc-2") == 0) { eng_aice.active = 1; } else { eng_aice.active = 0; } - if (getprop("controls/ice-protection/wing") == 1) { + if (getprop("/controls/ice-protection/wing") == 1) { wing_aice.active = 1; } else { wing_aice.active = 0; @@ -2437,25 +2437,25 @@ var messages_right_memo = func { vhf3_voice.active = 0; } - if (getprop("controls/autobrake/mode") == 1 and (phaseVarMemo3 == 7 or phaseVarMemo3 == 8)) { + if (getprop("/controls/autobrake/mode") == 1 and (phaseVarMemo3 == 7 or phaseVarMemo3 == 8)) { auto_brk_lo.active = 1; } else { auto_brk_lo.active = 0; } - if (getprop("controls/autobrake/mode") == 2 and (phaseVarMemo3 == 7 or phaseVarMemo3 == 8)) { + if (getprop("/controls/autobrake/mode") == 2 and (phaseVarMemo3 == 7 or phaseVarMemo3 == 8)) { auto_brk_med.active = 1; } else { auto_brk_med.active = 0; } - if (getprop("controls/autobrake/mode") == 3 and (phaseVarMemo3 == 7 or phaseVarMemo3 == 8)) { + if (getprop("/controls/autobrake/mode") == 3 and (phaseVarMemo3 == 7 or phaseVarMemo3 == 8)) { auto_brk_max.active = 1; } else { auto_brk_max.active = 0; } - if (getprop("systems/fuel/valves/crossfeed-valve") != 0 and getprop("controls/fuel/switches/crossfeed") == 1) { + if (getprop("/systems/fuel/valves/crossfeed-valve") != 0 and getprop("/controls/fuel/switches/crossfeed") == 1) { fuelx.active = 1; } else { fuelx.active = 0; @@ -2473,7 +2473,7 @@ var messages_right_memo = func { gpws_flap3.active = 0; } - if (phaseVarMemo3 >= 2 and phaseVarMemo3 <= 9 and systems.ELEC.Bus.ac1.getValue() >= 110 and systems.ELEC.Bus.ac2.getValue() >= 110 and (getprop("systems/fuel/feed-center-1") or getprop("systems/fuel/feed-center-2"))) { + if (phaseVarMemo3 >= 2 and phaseVarMemo3 <= 9 and systems.ELEC.Bus.ac1.getValue() >= 110 and systems.ELEC.Bus.ac2.getValue() >= 110 and (getprop("/systems/fuel/feed-center-1") or getprop("/systems/fuel/feed-center-2"))) { ctr_tk_feedg.active = 1; } else { ctr_tk_feedg.active = 0; diff --git a/Nasal/FMGC/FCU.nas b/Nasal/FMGC/FCU.nas index ad7e12e9..f53e8ccc 100644 --- a/Nasal/FMGC/FCU.nas +++ b/Nasal/FMGC/FCU.nas @@ -523,7 +523,7 @@ var athrOff = func(type) { var hdgInput = func { if (latMode.getValue() != 0) { showHDG.setBoolValue(1); - var hdgnow = getprop("/it-autoflight/input/hdg"); - setprop("/modes/fcu/hdg-time", pts.Sim.Time.elapsedSec.getValue()); + var hdgnow = fmgc.Input.hdg.getValue(); + fmgc.Custom.hdgTime.setValue(pts.Sim.Time.elapsedSec.getValue()); } } diff --git a/Nasal/FMGC/FMGC-b.nas b/Nasal/FMGC/FMGC-b.nas index 81ce43ac..32ab417d 100644 --- a/Nasal/FMGC/FMGC-b.nas +++ b/Nasal/FMGC/FMGC-b.nas @@ -1027,12 +1027,12 @@ setlistener("/sim/signals/fdm-initialized", func { # For Canvas Nav Display. setlistener("/it-autoflight/input/hdg", func { - setprop("autopilot/settings/heading-bug-deg", getprop("it-autoflight/input/hdg")); -}); + setprop("/autopilot/settings/heading-bug-deg", Input.hdg.getValue()); +}, 0, 0); setlistener("/it-autoflight/internal/alt", func { - setprop("autopilot/settings/target-altitude-ft", getprop("it-autoflight/internal/alt")); -}); + setprop("/autopilot/settings/target-altitude-ft", Internal.alt.getValue()); +}, 0, 0); var loopTimer = maketimer(0.1, ITAF, ITAF.loop); var slowLoopTimer = maketimer(1, ITAF, ITAF.slowLoop); diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index 9ad82b9f..d67a823e 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -1171,7 +1171,7 @@ setlistener("/gear/gear[1]/wow", func() { setprop("/FMGC/internal/landing-time", -99); } - if (getprop("/gear/gear[1]/wow") == 1 and getprop("/FMGC/internal/landing-time") == -99) { + if (pts.Gear.wow[1].getValue() and getprop("/FMGC/internal/landing-time") == -99) { timer30secLanding.start(); setprop("/FMGC/internal/landing-time", pts.Sim.Time.elapsedSec.getValue()); } From e236de2f69388c140c17e14c96fcd46c2134e198 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R <legoboyvdlp@gmail.com> Date: Mon, 28 Sep 2020 20:15:19 +0100 Subject: [PATCH 06/16] Refactor version checks. Improve altitude alerter code so it uses less properties. FMGC: use less properties --- Models/Instruments/MCDU/MCDU.nas | 12 ++--- Models/Instruments/PFD/PFD.nas | 20 ++++----- Nasal/ECAM/ECAM-logic.nas | 59 +++++++++++++------------ Nasal/FMGC/FMGC.nas | 14 +++--- Nasal/Libraries/property-tree-setup.nas | 1 + Nasal/MCDU/ARRIVAL.nas | 22 ++++++--- Nasal/MCDU/MCDU.nas | 8 ++-- Nasal/MCDU/PERFAPPR.nas | 26 +++++------ 8 files changed, 86 insertions(+), 76 deletions(-) diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index 08ace4a8..86c22e10 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -142,13 +142,9 @@ var activate_twice = props.globals.getNode("/FMGC/internal/activate-twice", 1); # APPR PERF var dest_qnh = props.globals.getNode("/FMGC/internal/dest-qnh", 1); var dest_temp = props.globals.getNode("/FMGC/internal/dest-temp", 1); -var vapp_speed_set = props.globals.getNode("/FMGC/internal/vapp-speed-set", 1); var final = props.globals.getNode("/FMGC/internal/final", 1); var radio = props.globals.getNode("/FMGC/internal/radio", 1); var baro = props.globals.getNode("/FMGC/internal/baro", 1); -var radio_no = props.globals.getNode("/FMGC/internal/radio-no", 1); -var ldg_config_3_set = props.globals.getNode("/FMGC/internal/ldg-config-3-set", 1); -var ldg_config_f_set = props.globals.getNode("/FMGC/internal/ldg-config-f-set", 1); # GA PERF @@ -3730,7 +3726,7 @@ var canvas_MCDU_base = { me["Simple_R3"].setText(sprintf("%.0f", getprop("/FMGC/internal/radio"))); me.fontRight(0, 0, default, 0, 0, 0); me.fontSizeRight(0, 0, normal, 0, 0, 0); - } else if (getprop("/FMGC/internal/radio-no")) { + } else if (fmgc.FMGCInternal.radioNo) { me["Simple_R3"].setText("NO"); me.fontRight(0, 0, default, 0, 0, 0); me.fontSizeRight(0, 0, normal, 0, 0, 0); @@ -3743,7 +3739,7 @@ var canvas_MCDU_base = { me["Simple_R4S"].setText("LDG CONF "); me["Simple_R4"].setText("CONF3 "); me["Simple_R5"].setText("FULL "); - if (ldg_config_3_set.getValue() == 1 and ldg_config_f_set.getValue() == 0) { + if (fmgc.FMGCInternal.ldgConfig3 == 1 and fmgc.FMGCInternal.ldgConfigFull == 0) { me["PERFAPPR_LDG_3"].hide(); me["PERFAPPR_LDG_F"].show(); me.fontSizeRight(0, 0, 0, normal, small, 0); @@ -3767,7 +3763,7 @@ var canvas_MCDU_base = { me["Simple_C5"].setText(sprintf("%3.0f", fmgc.FMGCInternal.vls_appr)); me["Simple_L5"].setText(sprintf("%3.0f", fmgc.FMGCInternal.vapp_appr)); me.fontLeft(0, 0, 0, 0, default, 0); - if (vapp_speed_set.getValue()) { + if (fmgc.FMGCInternal.vappSpeedSet) { me.fontSizeLeft(0, 0, 0, 0, normal, 0); } else { me.fontSizeLeft(0, 0, 0, 0, small, 0); @@ -3777,7 +3773,7 @@ var canvas_MCDU_base = { me["Simple_C2"].setText(" ---"); me["Simple_C3"].setText(" ---"); me["Simple_C5"].setText(" ---"); - if (vapp_speed_set.getValue()) { + if (fmgc.FMGCInternal.vappSpeedSet) { me["Simple_L5"].setText(sprintf("%3.0f", fmgc.FMGCInternal.vapp_appr)); me.fontLeft(0, 0, 0, 0, default, 0); me.fontSizeLeft(0, 0, 0, 0, normal, 0); diff --git a/Models/Instruments/PFD/PFD.nas b/Models/Instruments/PFD/PFD.nas index 29bdb447..7bd65670 100644 --- a/Models/Instruments/PFD/PFD.nas +++ b/Models/Instruments/PFD/PFD.nas @@ -794,7 +794,7 @@ var canvas_PFD_base = { } else { me["AI_agl"].setColor(0.0509,0.7529,0.2941); } - } else if (getprop("/FMGC/internal/radio-no")) { + } else if (fmgc.FMGCInternal.radioNo) { me["FMA_dh"].setText("BARO"); me["FMA_dh"].show(); me["FMA_dhn"].setText("100"); @@ -835,7 +835,7 @@ var canvas_PFD_base = { me["FMA_dhn"].setText(sprintf("%.0f", getprop("/FMGC/internal/baro"))); me["FMA_dhn"].show(); me["FMA_nodh"].hide(); - } else if (getprop("/FMGC/internal/radio-no")) { + } else if (fmgc.FMGCInternal.radioNo) { me["FMA_dh"].setText("BARO"); me["FMA_dh"].show(); me["FMA_dhn"].setText("100"); @@ -1259,7 +1259,7 @@ var canvas_PFD_1 = { if (managed_spd.getValue() == 1) { if (getprop("/FMGC/internal/decel") == 1) { - if (getprop("/FMGC/internal/vapp-speed-set")) { + if (fmgc.FMGCInternal.vappSpeedSet) { vapp = fmgc.FMGCInternal.vapp_appr; } else { vapp = fmgc.FMGCInternal.vapp; @@ -1690,13 +1690,13 @@ var canvas_PFD_1 = { me["ground"].hide(); } - if (!getprop("/ECAM/alt-alert-flash") and !getprop("/ECAM/alt-alert-steady")) { + if (!ecam.altAlertFlash and !ecam.altAlertSteady) { alt_going1 = 0; amber_going1 = 0; me["ALT_box_flash"].hide(); me["ALT_box_amber"].hide(); } else { - if (getprop("/ECAM/alt-alert-flash")) { + if (ecam.altAlertFlash) { if (alt_going1 == 1) { me["ALT_box_flash"].hide(); altTimer1.stop(); @@ -1714,7 +1714,7 @@ var canvas_PFD_1 = { } else { me["ALT_box_amber"].show(); } - } elsif (getprop("/ECAM/alt-alert-steady")) { + } elsif (ecam.altAlertSteady) { if (amber_going1 == 1) { me["ALT_box"].show(); me["ALT_box_amber"].hide(); @@ -1997,7 +1997,7 @@ var canvas_PFD_2 = { if (managed_spd.getValue() == 1) { if (getprop("/FMGC/internal/decel") == 1) { - if (getprop("/FMGC/internal/vapp-speed-set")) { + if (fmgc.FMGCInternal.vappSpeedSet) { vapp = fmgc.FMGCInternal.vapp_appr; } else { vapp = fmgc.FMGCInternal.vapp; @@ -2428,13 +2428,13 @@ var canvas_PFD_2 = { me["ground"].hide(); } - if (!getprop("/ECAM/alt-alert-flash") and !getprop("/ECAM/alt-alert-steady")) { + if (!ecam.altAlertFlash and !ecam.altAlertSteady) { alt_going2 = 0; amber_going2 = 0; me["ALT_box_flash"].hide(); me["ALT_box_amber"].hide(); } else { - if (getprop("/ECAM/alt-alert-flash")) { + if (ecam.altAlertFlash) { if (alt_going2 == 1) { me["ALT_box_flash"].hide(); altTimer2.stop(); @@ -2452,7 +2452,7 @@ var canvas_PFD_2 = { } else { me["ALT_box_amber"].hide(); } - } elsif (getprop("/ECAM/alt-alert-steady")) { + } elsif (ecam.altAlertSteady) { if (amber_going2 == 1) { me["ALT_box"].show(); me["ALT_box_amber"].hide(); diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index 2f4fcc71..b89792a1 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -39,6 +39,9 @@ var alt200 = nil; var alt750 = nil; var bigThree = nil; +var altAlertSteady = 0; +var altAlertFlash = 0; + var messages_priority_3 = func { phaseVar3 = phaseNode.getValue(); @@ -780,21 +783,21 @@ var messages_priority_3 = func { } if (alt750 and alt200 and !altAlertInhibit) { - setprop("ECAM/flipflop/alt-alert-2-rs-set", 1); + setprop("/ECAM/flipflop/alt-alert-2-rs-set", 1); } else { - setprop("ECAM/flipflop/alt-alert-2-rs-set", 0); + setprop("/ECAM/flipflop/alt-alert-2-rs-set", 0); } if (getprop("/ECAM/flipflop/alt-alert-rs-reset") or (!alt750 and !alt200 and !altAlertInhibit)) { - setprop("ECAM/flipflop/alt-alert-2-rs-reset", 1); + setprop("/ECAM/flipflop/alt-alert-2-rs-reset", 1); } else { - setprop("ECAM/flipflop/alt-alert-2-rs-reset", 0); + setprop("/ECAM/flipflop/alt-alert-2-rs-reset", 0); } if (alt750 and !alt200 and !altAlertInhibit and getprop("/ECAM/flipflop/alt-alert-2-rs-output")) { - setprop("ECAM/flipflop/alt-alert-3-rs-set", 1); + setprop("/ECAM/flipflop/alt-alert-3-rs-set", 1); } else { - setprop("ECAM/flipflop/alt-alert-3-rs-set", 0); + setprop("/ECAM/flipflop/alt-alert-3-rs-set", 0); } if ((!alt750 and !alt200 and !altAlertInhibit and getprop("/ECAM/flipflop/alt-alert-rs-output")) or (!alt750 and !alt200 and !altAlertInhibit and getprop("/ECAM/flipflop/alt-alert-3-rs-output")) or getprop("/ECAM/flipflop/alt-alert-3-rs-set")) { @@ -815,15 +818,15 @@ var messages_priority_3 = func { } if (FWC.Timer.gnd.getValue() != 1 and getprop("/ECAM/flipflop/alt-alert-3-rs-set") != 1 and alt750 and !alt200 and !altAlertInhibit) { - setprop("ECAM/alt-alert-steady", 1); + altAlertSteady = 1; } else { - setprop("ECAM/alt-alert-steady", 0); + altAlertSteady = 0; } if (FWC.Timer.gnd.getValue() != 1 and bigThree) { - setprop("ECAM/alt-alert-flash", 1); + altAlertFlash = 1; } else { - setprop("ECAM/alt-alert-flash", 0); + altAlertFlash = 0; } if (!systems.cargoTestBtn.getBoolValue()) { @@ -2025,21 +2028,21 @@ var messages_priority_0 = func { var messages_config_memo = func { phaseVarMemo = phaseNode.getValue(); if (getprop("/controls/flight/flaps-input") == 0 or getprop("/controls/flight/flaps-input") == 4 or getprop("/controls/flight/speedbrake") != 0 or getprop("/fdm/jsbsim/hydraulics/elevator-trim/final-deg") > 1.75 or getprop("/fdm/jsbsim/hydraulics/elevator-trim/final-deg") < -3.65 or getprop("/fdm/jsbsim/hydraulics/rudder/trim-cmd-deg") < -3.55 or getprop("/fdm/jsbsim/hydraulics/rudder/trim-cmd-deg") > 3.55) { - setprop("ECAM/to-config-normal", 0); + setprop("/ECAM/to-config-normal", 0); } else { - setprop("ECAM/to-config-normal", 1); + setprop("/ECAM/to-config-normal", 1); } if (getprop("/ECAM/to-config-test") and (phaseVarMemo == 2 or phaseVarMemo == 9)) { - setprop("ECAM/to-config-set", 1); + setprop("/ECAM/to-config-set", 1); } else { - setprop("ECAM/to-config-set", 0); + setprop("/ECAM/to-config-set", 0); } if (!getprop("/ECAM/to-config-normal") or phaseVarMemo == 6) { - setprop("ECAM/to-config-reset", 1); + setprop("/ECAM/to-config-reset", 1); } else { - setprop("ECAM/to-config-reset", 0); + setprop("/ECAM/to-config-reset", 0); } if (getprop("/controls/autobrake/mode") == 3) { @@ -2083,15 +2086,15 @@ var messages_config_memo = func { } if (getprop("/ECAM/to-config-test") and (phaseVarMemo == 2 or phaseVarMemo == 9)) { - setprop("ECAM/to-memo-set", 1); + setprop("/ECAM/to-memo-set", 1); } else { - setprop("ECAM/to-memo-set", 0); + setprop("/ECAM/to-memo-set", 0); } if (phaseVarMemo == 1 or phaseVarMemo == 3 or phaseVarMemo == 6 or phaseVarMemo == 10) { - setprop("ECAM/to-memo-reset", 1); + setprop("/ECAM/to-memo-reset", 1); } else { - setprop("ECAM/to-memo-reset", 0); + setprop("/ECAM/to-memo-reset", 0); } if ((phaseVarMemo == 2 and getprop("/ECAM/engine-start-time") != 0 and getprop("/ECAM/engine-start-time") + 120 < getprop("/sim/time/elapsed-sec")) or getprop("/ECAM/to-memo-flipflop")) { @@ -2152,27 +2155,27 @@ var messages_config_memo = func { gear_agl_cur = pts.Position.gearAglFt.getValue(); if (gear_agl_cur < 2000) { - setprop("ECAM/ldg-memo-set", 1); + setprop("/ECAM/ldg-memo-set", 1); } else { - setprop("ECAM/ldg-memo-set", 0); + setprop("/ECAM/ldg-memo-set", 0); } if (gear_agl_cur > 2200) { - setprop("ECAM/ldg-memo-reset", 1); + setprop("/ECAM/ldg-memo-reset", 1); } else { - setprop("ECAM/ldg-memo-reset", 0); + setprop("/ECAM/ldg-memo-reset", 0); } if (gear_agl_cur > 2200) { - setprop("ECAM/ldg-memo-2200-set", 1); + setprop("/ECAM/ldg-memo-2200-set", 1); } else { - setprop("ECAM/ldg-memo-2200-set", 0); + setprop("/ECAM/ldg-memo-2200-set", 0); } if (phaseVarMemo != 6 and phaseVarMemo != 7 and phaseVarMemo != 8) { - setprop("ECAM/ldg-memo-2200-reset", 1); + setprop("/ECAM/ldg-memo-2200-reset", 1); } else { - setprop("ECAM/ldg-memo-2200-reset", 0); + setprop("/ECAM/ldg-memo-2200-reset", 0); } if ((phaseVarMemo == 6 and getprop("/ECAM/ldg-memo-flipflop") and getprop("/ECAM/ldg-memo-2200-flipflop")) or phaseVarMemo == 7 or phaseVarMemo == 8) { diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index d67a823e..c39b5ead 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -170,6 +170,7 @@ var FMGCInternal = { flap2_appr: 0, vls_appr: 0, vapp_appr: 0, + vappSpeedSet: 0, # PERF transAlt: 18000, @@ -188,6 +189,9 @@ var FMGCInternal = { destMagSet: 0, destWind: 0, destWindSet: 0, + radioNo: 0, + ldgConfig3: 0, + ldgConfigFull: 0, # INIT A altAirport: "", @@ -774,7 +778,7 @@ var masterFMGC = maketimer(0.2, func { FMGCInternal.slat = FMGCInternal.vs1g_clean * 1.23; FMGCInternal.flap2 = FMGCInternal.vs1g_conf_2 * 1.47; FMGCInternal.flap3 = FMGCInternal.vs1g_conf_3 * 1.36; - if (getprop("/FMGC/internal/ldg-config-3-set")) { + if (FMGCInternal.ldgConfig3) { FMGCInternal.vls = FMGCInternal.vs1g_conf_3 * 1.23; } else { FMGCInternal.vls = FMGCInternal.vs1g_conf_full * 1.23 @@ -782,7 +786,7 @@ var masterFMGC = maketimer(0.2, func { if (FMGCInternal.vls < 113) { FMGCInternal.vls = 113; } - if (!getprop("/FMGC/internal/vapp-speed-set")) { + if (!fmgc.FMGCInternal.vappSpeedSet) { if (FMGCInternal.destWind < 5) { FMGCInternal.vapp = FMGCInternal.vls + 5; } else if (FMGCInternal.destWind > 15) { @@ -824,7 +828,7 @@ var masterFMGC = maketimer(0.2, func { FMGCInternal.slat_appr = FMGCInternal.slat; FMGCInternal.flap2_appr = FMGCInternal.flap2; FMGCInternal.vls_appr = FMGCInternal.vls; - if (!getprop("/FMGC/internal/vapp-speed-set")) { + if (!fmgc.FMGCInternal.vappSpeedSet) { FMGCInternal.vapp_appr = FMGCInternal.vapp; } } else { @@ -838,7 +842,7 @@ var masterFMGC = maketimer(0.2, func { FMGCInternal.vs1g_conf_full_appr = -0.0007 * FMGCInternal.lw * FMGCInternal.lw + 0.6002 * FMGCInternal.lw + 38.479; FMGCInternal.slat_appr = FMGCInternal.vs1g_clean_appr * 1.23; FMGCInternal.flap2_appr = FMGCInternal.vs1g_conf_2_appr * 1.47; - if (getprop("/FMGC/internal/ldg-config-3-set")) { + if (FMGCInternal.ldgConfig3) { FMGCInternal.vls_appr = FMGCInternal.vs1g_conf_3_appr * 1.23; } else { FMGCInternal.vls_appr = FMGCInternal.vs1g_conf_full_appr * 1.23 @@ -846,7 +850,7 @@ var masterFMGC = maketimer(0.2, func { if (FMGCInternal.vls_appr < 113) { FMGCInternal.vls_appr = 113; } - if (!getprop("/FMGC/internal/vapp-speed-set")) { + if (!fmgc.FMGCInternal.vappSpeedSet) { if (FMGCInternal.destWind < 5) { FMGCInternal.vapp_appr = FMGCInternal.vls_appr + 5; } else if (FMGCInternal.destWind > 15) { diff --git a/Nasal/Libraries/property-tree-setup.nas b/Nasal/Libraries/property-tree-setup.nas index 2e74f277..77fb5db5 100644 --- a/Nasal/Libraries/property-tree-setup.nas +++ b/Nasal/Libraries/property-tree-setup.nas @@ -190,6 +190,7 @@ var Sim = { deltaRealtimeSec: props.globals.getNode("/sim/time/delta-realtime-sec"), elapsedSec: props.globals.getNode("/sim/time/elapsed-sec"), }, + Version: props.globals.getNode("/sim/version/flightgear"), }; var Systems = { diff --git a/Nasal/MCDU/ARRIVAL.nas b/Nasal/MCDU/ARRIVAL.nas index 2e8dffa8..d5343a17 100644 --- a/Nasal/MCDU/ARRIVAL.nas +++ b/Nasal/MCDU/ARRIVAL.nas @@ -2,6 +2,8 @@ var isNoStar = [0, 0, 0]; var isNoTransArr = [0, 0, 0]; var isNoVia = [0, 0, 0]; +var version = nil; + var arrivalPage = { title: [nil, nil, nil], subtitle: [nil, nil], @@ -74,7 +76,8 @@ var arrivalPage = { if (fmgc.flightPlanController.flightplans[2].approach != nil) { me.selectedApproach = fmgc.flightPlanController.flightplans[2].approach; - if (getprop("/sim/version/flightgear") == "2020.2.0" or getprop("/sim/version/flightgear") == "2020.2.1" or getprop("/sim/version/flightgear") == "2020.3.0") { + version = pts.Sim.Version.getValue(); + if (version == "2020.2.0" or version == "2020.2.1" or version == "2020.3.0") { if (fmgc.flightPlanController.flightplans[2].approach_trans != nil) { me.selectedVIA = fmgc.flightPlanController.flightplans[2].approach_trans; } elsif (isNoVia[2] == 1) { @@ -98,7 +101,8 @@ var arrivalPage = { } else { if (fmgc.flightPlanController.flightplans[me.computer].approach != nil) { me.selectedApproach = fmgc.flightPlanController.flightplans[me.computer].approach; - if (getprop("/sim/version/flightgear") == "2020.2.0" or getprop("/sim/version/flightgear") == "2020.2.1" or getprop("/sim/version/flightgear") == "2020.3.0") { + version = pts.Sim.Version.getValue(); + if (version == "2020.2.0" or version == "2020.2.1" or version == "2020.3.0") { if (fmgc.flightPlanController.flightplans[me.computer].approach_trans != nil) { me.selectedVIA = fmgc.flightPlanController.flightplans[me.computer].approach_trans; } elsif (isNoVia[me.computer] == 1) { @@ -107,7 +111,8 @@ var arrivalPage = { } } elsif (fmgc.flightPlanController.flightplans[2].approach != nil) { me.selectedApproach = fmgc.flightPlanController.flightplans[2].approach; - if (getprop("/sim/version/flightgear") == "2020.2.0" or getprop("/sim/version/flightgear") == "2020.2.1" or getprop("/sim/version/flightgear") == "2020.3.0") { + version = pts.Sim.Version.getValue(); + if (version == "2020.2.0" or version == "2020.2.1" or version == "2020.3.0") { if (fmgc.flightPlanController.flightplans[2].approach_trans != nil) { me.selectedVIA = fmgc.flightPlanController.flightplans[2].approach_trans; } @@ -232,7 +237,8 @@ var arrivalPage = { }, updateActiveVIAs: func() { - if (getprop("/sim/version/flightgear") != "2020.2.0" and getprop("/sim/version/flightgear") != "2020.2.1" and getprop("/sim/version/flightgear") != "2020.3.0") { return; } + version = pts.Sim.Version.getValue(); + if (version != "2020.2.0" and version != "2020.2.1" and version != "2020.3.0") { return; } if (me.selectedVIA == "NO VIA") { if (!fmgc.flightPlanController.temporaryFlag[me.computer]) { @@ -503,7 +509,8 @@ var arrivalPage = { canvas_mcdu.pageSwitch[me.computer].setBoolValue(0); }, updateVIAs: func() { - if (getprop("/sim/version/flightgear") != "2020.2.0" and getprop("/sim/version/flightgear") != "2020.2.1" and getprop("/sim/version/flightgear") != "2020.3.0") { return; } + version = pts.Sim.Version.getValue(); + if (version != "2020.2.0" and version != "2020.2.1" and version != "2020.3.0") { return; } if (me.selectedApproach == nil or me.activePage != 2) { me.clearVias(); return; @@ -746,7 +753,8 @@ var arrivalPage = { }, arrPushbuttonLeft: func(index) { if (index == 2 and me.activePage == 1 and me.selectedApproach != nil) { - if (getprop("/sim/version/flightgear") != "2020.2.0" and getprop("/sim/version/flightgear") != "2020.2.1" and getprop("/sim/version/flightgear") != "2020.3.0") { return; } + version = pts.Sim.Version.getValue(); + if (version != "2020.2.0" and version != "2020.2.1" and version != "2020.3.0") { return; } me.oldPage = me.activePage; me.activePage = 2; me.updatePage(); @@ -778,7 +786,7 @@ var arrivalPage = { } setprop("FMGC/internal/baro", 99999); setprop("FMGC/internal/radio", 99999); - setprop("FMGC/internal/radio-no", 0); + fmgc.FMGCInternal.radioNo = 0; me.updateApproaches(); me.updatePage(); fmgc.flightPlanController.flightPlanChanged(me.computer); diff --git a/Nasal/MCDU/MCDU.nas b/Nasal/MCDU/MCDU.nas index 1a5f73f2..15c3a096 100644 --- a/Nasal/MCDU/MCDU.nas +++ b/Nasal/MCDU/MCDU.nas @@ -175,14 +175,14 @@ var MCDU_reset = func(i) { fmgc.FMGCInternal.destMagSet = 0; fmgc.FMGCInternal.destWind = 0; fmgc.FMGCInternal.destWindSet = 0; - setprop("/FMGC/internal/vapp-speed-set", 0); + fmgc.FMGCInternal.vappSpeedSet = 0; setprop("/FMGC/internal/final", ""); setprop("/FMGC/internal/baro", 99999); setprop("/FMGC/internal/radio", 99999); - setprop("/FMGC/internal/radio-no", 0); + fmgc.FMGCInternal.radioNo = 0; setprop("/FMGC/internal/ldg-elev", 0); - setprop("/FMGC/internal/ldg-config-3-set", 0); - setprop("/FMGC/internal/ldg-config-f-set", 1); + fmgc.FMGCInternal.ldgConfig3 = 0; + fmgc.FMGCInternal.ldgConfigFull = 1; # GA PERF } diff --git a/Nasal/MCDU/PERFAPPR.nas b/Nasal/MCDU/PERFAPPR.nas index 5486c0a7..95c48e45 100644 --- a/Nasal/MCDU/PERFAPPR.nas +++ b/Nasal/MCDU/PERFAPPR.nas @@ -1,8 +1,6 @@ # Copyright (c) 2020 Matthew Maring (mattmaring) # APPR PERF -var ldg_config_3_set = props.globals.getNode("/FMGC/internal/ldg-config-3-set", 1); -var ldg_config_f_set = props.globals.getNode("/FMGC/internal/ldg-config-f-set", 1); var perfAPPRInput = func(key, i) { var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad; @@ -77,10 +75,10 @@ var perfAPPRInput = func(key, i) { } } else if (key == "L5") { if (scratchpad == "CLR") { - setprop("/FMGC/internal/vapp-speed-set", 0); + fmgc.FMGCInternal.vappSpeedSet = 0; mcdu_scratchpad.scratchpads[i].empty(); } else if (int(scratchpad) != nil and scratchpad >= 100 and scratchpad <= 350) { - setprop("/FMGC/internal/vapp-speed-set", 1); + fmgc.FMGCInternal.vappSpeedSet = 1; fmgc.FMGCInternal.vapp_appr = scratchpad; mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -93,7 +91,7 @@ var perfAPPRInput = func(key, i) { setprop("/FMGC/internal/baro", 99999); mcdu_scratchpad.scratchpads[i].empty(); } else if (int(scratchpad) != nil and scratchpad >= getprop("/FMGC/internal/ldg-elev") and scratchpad <= 5000 + getprop("/FMGC/internal/ldg-elev")) { - if (getprop("/FMGC/internal/radio-no") == 0) { + if (!fmgc.FMGCInternal.radioNo) { setprop("/FMGC/internal/radio", 99999); } setprop("/FMGC/internal/baro", scratchpad); @@ -104,31 +102,31 @@ var perfAPPRInput = func(key, i) { } else if (key == "R3") { if (scratchpad == "CLR") { setprop("/FMGC/internal/radio", 99999); - setprop("/FMGC/internal/radio-no", 0); + fmgc.FMGCInternal.radioNo = 0; mcdu_scratchpad.scratchpads[i].empty(); } else if (scratchpad == "NO") { setprop("/FMGC/internal/radio", 99999); - setprop("/FMGC/internal/radio-no", 1); + fmgc.FMGCInternal.radioNo = 1; mcdu_scratchpad.scratchpads[i].empty(); } else if (int(scratchpad) != nil and scratchpad >= 0 and scratchpad <= 700) { setprop("/FMGC/internal/baro", 99999); - setprop("/FMGC/internal/radio-no", 0); + fmgc.FMGCInternal.radioNo = 0; setprop("/FMGC/internal/radio", scratchpad); mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); } } else if (key == "R4") { - if (scratchpad == "" and ldg_config_f_set.getValue() == 1 and ldg_config_3_set.getValue() == 0) { - setprop("/FMGC/internal/ldg-config-3-set", 1); - setprop("/FMGC/internal/ldg-config-f-set", 0); + if (scratchpad == "" and fmgc.FMGCInternal.ldgConfigFull == 1 and fmgc.FMGCInternal.ldgConfig3 == 0) { + fmgc.FMGCInternal.ldgConfig3 = 1; + fmgc.FMGCInternal.ldgConfigFull = 0; } else { mcdu_message(i, "NOT ALLOWED"); } } else if (key == "R5") { - if (scratchpad == "" and ldg_config_3_set.getValue() == 1 and ldg_config_f_set.getValue() == 0) { - setprop("/FMGC/internal/ldg-config-3-set", 0); - setprop("/FMGC/internal/ldg-config-f-set", 1); + if (scratchpad == "" and fmgc.FMGCInternal.ldgConfig3 == 1 and fmgc.FMGCInternal.ldgConfigFull == 0) { + fmgc.FMGCInternal.ldgConfig3 = 0; + fmgc.FMGCInternal.ldgConfigFull = 1; } else { mcdu_message(i, "NOT ALLOWED"); } From 40b90a2bdb98cf8104381095948dca6e846e1a6f Mon Sep 17 00:00:00 2001 From: legoboyvdlp R <legoboyvdlp@gmail.com> Date: Wed, 30 Sep 2020 18:16:57 +0100 Subject: [PATCH 07/16] Lower ECAM: correction for Nasal error --- Models/Instruments/Lower-ECAM/Lower-ECAM.nas | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index f033b0c4..fdafabba 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -94,8 +94,6 @@ var bmc1working = props.globals.getNode("/systems/pneumatics/indicating/bmc1-wor var bmc2working = props.globals.getNode("/systems/pneumatics/indicating/bmc2-working", 1); var gs_kt = props.globals.getNode("/velocities/groundspeed-kt", 1); var switch_wing_aice = props.globals.getNode("/controls/ice-protection/wing", 1); -var eng1_n2_actual = props.globals.getNode("/engines/engine[0]/n2-actual", 1); -var eng2_n2_actual = props.globals.getNode("/engines/engine[1]/n2-actual", 1); var pack1_bypass = props.globals.getNode("/systems/pneumatics/pack-1-bypass", 1); var pack2_bypass = props.globals.getNode("/systems/pneumatics/pack-2-bypass", 1); var oil_qt1_actual = props.globals.getNode("/engines/engine[0]/oil-qt-actual", 1); @@ -846,14 +844,14 @@ var canvas_lowerECAM_bleed = { } # ENG 1 label - if (eng1_n2_actual.getValue() >= 59) { + if (pts.Engines.Engine.n2Actual[0].getValue() >= 59) { me["BLEED-ENG-1-label"].setColor(0.8078,0.8039,0.8078); } else { me["BLEED-ENG-1-label"].setColor(0.7333,0.3803,0); } # ENG 2 label - if (eng2_n2_actual.getValue() >= 59) { + if (pts.Engines.Engine.n2Actual[1].getValue() >= 59) { me["BLEED-ENG-2-label"].setColor(0.8078,0.8039,0.8078); } else { me["BLEED-ENG-2-label"].setColor(0.7333,0.3803,0); @@ -2732,13 +2730,13 @@ var canvas_lowerECAM_hyd = { me["PTU-Auto-or-off"].show(); } - if (eng1_n2.getValue() >= 59) { + if (pts.Engines.Engine.n2Actual[0].getValue() >= 59) { me["Pump-Green-label"].setColor(0.8078,0.8039,0.8078); } else { me["Pump-Green-label"].setColor(0.7333,0.3803,0); } - if (eng2_n2.getValue() >= 59) { + if (pts.Engines.Engine.n2Actual[1].getValue() >= 59) { me["Pump-Yellow-label"].setColor(0.8078,0.8039,0.8078); } else { me["Pump-Yellow-label"].setColor(0.7333,0.3803,0); From e30c76694e1812fdf94bfd82ebb1e57c4f6e68a0 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R <legoboyvdlp@gmail.com> Date: Fri, 2 Oct 2020 17:59:04 +0100 Subject: [PATCH 08/16] Try to fix case-sensitivity by creating a new file --- .../res/{ECAM_glare.png => ecam_glare_tex.png} | Bin Models/FlightDeck/res/fd_complete.ac | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename Models/FlightDeck/res/{ECAM_glare.png => ecam_glare_tex.png} (100%) diff --git a/Models/FlightDeck/res/ECAM_glare.png b/Models/FlightDeck/res/ecam_glare_tex.png similarity index 100% rename from Models/FlightDeck/res/ECAM_glare.png rename to Models/FlightDeck/res/ecam_glare_tex.png diff --git a/Models/FlightDeck/res/fd_complete.ac b/Models/FlightDeck/res/fd_complete.ac index 1876e386..4311168d 100644 --- a/Models/FlightDeck/res/fd_complete.ac +++ b/Models/FlightDeck/res/fd_complete.ac @@ -72761,7 +72761,7 @@ name "ecam_glare_down" data 15 CU1_curve_.1252 crease 40.0 -texture "ECAM_glare.png" +texture "ecam_glare_tex.png" texrep 1 1 numvert 8 -0.40392 -0.06108 -0.10745 @@ -72793,7 +72793,7 @@ name "ecam_glare_up" data 15 CU1_curve_.1253 crease 40.0 -texture "ECAM_glare.png" +texture "ecam_glare_tex.png" texrep 1 1 numvert 4 -0.40892 -0.06801 0.10755 From 830617bebcf713a3052c1d8bed34c7634778d8ae Mon Sep 17 00:00:00 2001 From: legoboyvdlp R <legoboyvdlp@gmail.com> Date: Sat, 3 Oct 2020 10:29:57 +0100 Subject: [PATCH 09/16] FMA: update Nasal to be more efficient, remove all getprop, logic changes so that things go faster --- Nasal/ECAM/ECAM-logic.nas | 2 +- Nasal/FMGC/FMGC-c.nas | 621 +++++++++++++----------- Nasal/Libraries/property-tree-setup.nas | 4 + 3 files changed, 348 insertions(+), 279 deletions(-) diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index b89792a1..270df6c6 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -2097,7 +2097,7 @@ var messages_config_memo = func { setprop("/ECAM/to-memo-reset", 0); } - if ((phaseVarMemo == 2 and getprop("/ECAM/engine-start-time") != 0 and getprop("/ECAM/engine-start-time") + 120 < getprop("/sim/time/elapsed-sec")) or getprop("/ECAM/to-memo-flipflop")) { + if ((phaseVarMemo == 2 and getprop("/ECAM/engine-start-time") != 0 and getprop("/ECAM/engine-start-time") + 120 < pts.Sim.Time.elapsedSec.getValue()) or getprop("/ECAM/to-memo-flipflop")) { toMemoLine1.active = 1; toMemoLine2.active = 1; toMemoLine3.active = 1; diff --git a/Nasal/FMGC/FMGC-c.nas b/Nasal/FMGC/FMGC-c.nas index 44eecee4..3eee58e5 100644 --- a/Nasal/FMGC/FMGC-c.nas +++ b/Nasal/FMGC/FMGC-c.nas @@ -3,91 +3,167 @@ # Copyright (c) 2020 Josh Davidson (Octal450) -setprop("/it-autoflight/internal/alt", 10000); -setprop("/modes/pfd/fma/throttle-mode", " "); -setprop("/modes/pfd/fma/pitch-mode", " "); -setprop("/modes/pfd/fma/pitch-mode-armed", " "); -setprop("/modes/pfd/fma/pitch-mode2-armed", " "); -setprop("/modes/pfd/fma/roll-mode", " "); -setprop("/modes/pfd/fma/roll-mode-armed", " "); -setprop("/modes/pfd/fma/ap-mode", " "); -setprop("/modes/pfd/fma/fd-mode", " "); -setprop("/modes/pfd/fma/at-mode", " "); -setprop("/modes/pfd/fma/athr-armed", 0); -setprop("/modes/pfd/fma/throttle-mode-box", 0); -setprop("/modes/pfd/fma/pitch-mode-box", 0); -setprop("/modes/pfd/fma/pitch-mode-armed-box", 0); -setprop("/modes/pfd/fma/pitch-mode2-armed-box", 0); -setprop("/modes/pfd/fma/roll-mode-box", 0); -setprop("/modes/pfd/fma/roll-mode-armed-box", 0); -setprop("/modes/pfd/fma/ap-mode-box", 0); -setprop("/modes/pfd/fma/fd-mode-box", 0); -setprop("/modes/pfd/fma/athr-mode-box", 0); -setprop("/modes/pfd/fma/throttle-mode-time", 0); -setprop("/modes/pfd/fma/pitch-mode-time", 0); -setprop("/modes/pfd/fma/pitch-mode-armed-time", 0); -setprop("/modes/pfd/fma/pitch-mode2-armed-time", 0); -setprop("/modes/pfd/fma/roll-mode-time", 0); -setprop("/modes/pfd/fma/roll-mode-armed-time", 0); -setprop("/modes/pfd/fma/ap-mode-time", 0); -setprop("/modes/pfd/fma/fd-mode-time", 0); -setprop("/modes/pfd/fma/athr-mode-time", 0); -setprop("/modes/fcu/hdg-time", -45); +var at = nil; +var athr = nil; +var ap1 = nil; +var ap2 = nil; +var elapsedtime = nil; +var engout = nil; +var engstate1 = nil; +var engstate2 = nil; +var fd1 = nil; +var fd2 = nil; +var flx = nil; +var gear1 = nil; +var gear2 = nil; +var gs_defl = nil; +var lat = nil; +var latText = nil; +var MCPalt = nil; +var nav_defl = nil; +var newfd = nil; +var newarm = nil; +var newap = nil; +var newlat = nil; +var newvert = nil; +var newvert2arm = nil; +var newvertarm = nil; +var newthr = nil; +var state1 = nil; +var state2 = nil; +var thr = nil; +var thr1 = nil; +var thr2 = nil; +var trk = nil; +var vert = nil; +var vertText = nil; -setlistener("sim/signals/fdm-initialized", func { + +var Modes = { + FCU: { + hdgTime: props.globals.initNode("/modes/fcu/hdg-time", -45, "DOUBLE") + }, + PFD: { + FMA: { + athr: props.globals.initNode("/modes/pfd/fma/athr-armed", 0, "BOOL"), + athrBox: props.globals.initNode("/modes/pfd/fma/athr-armed-box", 0, "BOOL"), + athrMode: props.globals.initNode("/modes/pfd/fma/at-mode", " ", "STRING"), + athrModeBox: props.globals.initNode("/modes/pfd/fma/athr-mode-box", 0, "BOOL"), + apMode: props.globals.initNode("/modes/pfd/fma/ap-mode", " ", "STRING"), + apModeBox: props.globals.initNode("/modes/pfd/fma/ap-mode-box", 0, "BOOL"), + apModeTime: props.globals.initNode("/modes/pfd/fma/ap-mode-time", 0, "DOUBLE"), + athrModeTime: props.globals.initNode("/modes/pfd/fma/athr-mode-time", 0, "DOUBLE"), + fdMode: props.globals.initNode("/modes/pfd/fma/fd-mode", " ", "STRING"), + fdModeBox: props.globals.initNode("/modes/pfd/fma/fd-mode-box", 0, "BOOL"), + fdModeTime: props.globals.initNode("/modes/pfd/fma/fd-mode-time", 0, "DOUBLE"), + rollMode: props.globals.initNode("/modes/pfd/fma/roll-mode", " ", "STRING"), + rollModeBox: props.globals.initNode("/modes/pfd/fma/roll-mode-box", 0, "BOOL"), + rollModeArmed: props.globals.initNode("/modes/pfd/fma/roll-mode-armed", " ", "STRING"), + rollModeArmedBox: props.globals.initNode("/modes/pfd/fma/roll-mode-armed-box", 0, "BOOL"), + rollModeTime: props.globals.initNode("/modes/pfd/fma/roll-mode-time", 0, "DOUBLE"), + rollModeArmedTime: props.globals.initNode("/modes/pfd/fma/roll-mode-armed-time", 0, "DOUBLE"), + pitchMode: props.globals.initNode("/modes/pfd/fma/pitch-mode", " ", "STRING"), + pitchModeBox: props.globals.initNode("/modes/pfd/fma/pitch-mode-box", 0, "BOOL"), + pitchModeArmed: props.globals.initNode("/modes/pfd/fma/pitch-mode-armed", " ", "STRING"), + pitchModeArmedBox: props.globals.initNode("/modes/pfd/fma/pitch-mode-armed-box", 0, "BOOL"), + pitchMode2Armed: props.globals.initNode("/modes/pfd/fma/pitch-mode2-armed", " ", "STRING"), + pitchModeTime: props.globals.initNode("/modes/pfd/fma/pitch-mode-time", 0, "DOUBLE"), + pitchModeArmedTime: props.globals.initNode("/modes/pfd/fma/pitch-mode-armed-time", 0, "DOUBLE"), + pitchMode2ArmedTime: props.globals.initNode("/modes/pfd/fma/pitch-mode2-armed-time", 0, "DOUBLE"), + pitchMode2ArmedBox: props.globals.initNode("/modes/pfd/fma/pitch-mode2-armed-box", 0, "BOOL"), + throttle: props.globals.initNode("/modes/pfd/fma/throttle-mode", " ", "STRING"), + throttleModeBox: props.globals.initNode("/modes/pfd/fma/throttle-mode-box", 0, "BOOL"), + throttleModeTime: props.globals.initNode("/modes/pfd/fma/throttle-mode-time", 0, "DOUBLE"), + }, + }, +}; + +var init = func() { + Internal.alt.setValue(10000); + Modes.PFD.FMA.throttle.setValue(" "); + Modes.PFD.FMA.pitchMode.setValue(" "); + Modes.PFD.FMA.pitchModeArmed.setValue(" "); + Modes.PFD.FMA.pitchMode2Armed.setValue(" "); + Modes.PFD.FMA.rollMode.setValue(" "); + Modes.PFD.FMA.rollModeArmed.setValue(" "); + Modes.PFD.FMA.apMode.setValue(" "); + Modes.PFD.FMA.fdMode.setValue(" "); + Modes.PFD.FMA.athrMode.setValue(" "); + Modes.PFD.FMA.athr.setValue(0); + Modes.PFD.FMA.throttleModeBox.setValue(0); + Modes.PFD.FMA.pitchModeBox.setValue(0); + Modes.PFD.FMA.pitchModeArmedBox.setValue(0); + Modes.PFD.FMA.pitchMode2ArmedBox.setValue(0); + Modes.PFD.FMA.rollModeBox.setValue(0); + Modes.PFD.FMA.rollModeArmedBox.setValue(0); + Modes.PFD.FMA.apModeBox.setValue(0); + Modes.PFD.FMA.fdModeBox.setValue(0); + Modes.PFD.FMA.athrModeBox.setValue(0); + Modes.PFD.FMA.throttleModeTime.setValue(0); + Modes.PFD.FMA.pitchModeTime.setValue(0); + Modes.PFD.FMA.pitchModeArmedTime.setValue(0); + Modes.PFD.FMA.pitchMode2ArmedTime.setValue(0); + Modes.PFD.FMA.rollModeTime.setValue(0); + Modes.PFD.FMA.rollModeArmedTime.setValue(0); + Modes.PFD.FMA.apModeTime.setValue(0); + Modes.PFD.FMA.fdModeTime.setValue(0); + Modes.PFD.FMA.athrModeTime.setValue(0); loopFMA.start(); -}); +}; # Master Thrust var loopFMA = maketimer(0.05, func { - var state1 = getprop("systems/thrust/state1"); - var state2 = getprop("systems/thrust/state2"); - var newthr = getprop("/modes/pfd/fma/throttle-mode"); - var thr1 = getprop("controls/engines/engine[0]/throttle-pos"); - var thr2 = getprop("controls/engines/engine[1]/throttle-pos"); + state1 = pts.Systems.Thrust.state[0].getValue(); + state2 = pts.Systems.Thrust.state[1].getValue(); + thr1 = pts.Controls.Engines.Engine.throttlePos[0].getValue(); + thr2 = pts.Controls.Engines.Engine.throttlePos[1].getValue(); + newthr = Modes.PFD.FMA.throttle.getValue(); + engout = pts.Systems.Thrust.engOut.getValue(); + if (state1 == "TOGA" or state2 == "TOGA") { if (newthr != " ") { - setprop("/modes/pfd/fma/throttle-mode", " "); + Modes.PFD.FMA.throttle.setValue(" "); } } else if ((state1 == "MAN THR" and thr1 >= 0.83) or (state2 == "MAN THR" and thr2 >= 0.83)) { if (newthr != " ") { - setprop("/modes/pfd/fma/throttle-mode", " "); + Modes.PFD.FMA.throttle.setValue(" "); } - } else if ((state1 == "MCT" or state2 == "MCT") and getprop("systems/thrust/eng-out") != 1) { + } else if ((state1 == "MCT" or state2 == "MCT") and !engout) { if (newthr != " ") { - setprop("/modes/pfd/fma/throttle-mode", " "); + Modes.PFD.FMA.throttle.setValue(" "); } - } else if (((state1 == "MAN THR" and thr1 < 0.83) or (state2 == "MAN THR" and thr2 < 0.83)) and getprop("systems/thrust/eng-out") != 1) { + } else if (((state1 == "MAN THR" and thr1 < 0.83) or (state2 == "MAN THR" and thr2 < 0.83)) and !engout) { if (newthr != " ") { - setprop("/modes/pfd/fma/throttle-mode", " "); + Modes.PFD.FMA.throttle.setValue(" "); } } else { - if ((getprop("/it-autoflight/output/vert") == 4) or (getprop("/it-autoflight/output/vert") == 6) or (getprop("/it-autoflight/output/vert") == 7) or (getprop("/it-autoflight/output/vert") == 8)) { - if (getprop("/it-autoflight/output/fd1") == 0 and getprop("/it-autoflight/output/fd2") == 0 and getprop("/it-autoflight/output/ap1") == 0 and getprop("/it-autoflight/output/ap2") == 0) { - loopFMA_b(); - } else { - var thr = getprop("/it-autoflight/output/thr-mode"); + vert = Output.vert.getValue(); + if (vert == 4 or vert >= 6 or vert <= 8) { + if (Output.ap1.getBoolValue() or Output.ap2.getBoolValue() or Output.fd1.getBoolValue() or Output.fd2.getBoolValue()) { + thr = Output.thrMode.getValue(); if (thr == 0) { loopFMA_b(); } else if (thr == 1) { if (newthr != "THR IDLE") { - setprop("/modes/pfd/fma/throttle-mode", "THR IDLE"); + Modes.PFD.FMA.throttle.setValue("THR IDLE"); } } else if (thr == 2) { - if (state1 == "MCT" or state2 == "MCT" and getprop("systems/thrust/eng-out") == 1) { + if (state1 == "MCT" or state2 == "MCT" and engout) { if (newthr != "THR MCT") { - setprop("/modes/pfd/fma/throttle-mode", "THR MCT"); + Modes.PFD.FMA.throttle.setValue("THR MCT"); } } else if (state1 == "CL" or state2 == "CL") { if (newthr != "THR CLB") { - setprop("/modes/pfd/fma/throttle-mode", "THR CLB"); + Modes.PFD.FMA.throttle.setValue("THR CLB"); } } else { if (newthr != "THR LVR") { - setprop("/modes/pfd/fma/throttle-mode", "THR LVR"); + Modes.PFD.FMA.throttle.setValue("THR LVR"); } } } + } else { + loopFMA_b(); } } else { loopFMA_b(); @@ -95,164 +171,161 @@ var loopFMA = maketimer(0.05, func { } # A/THR Armed/Active - if (getprop("/it-autoflight/output/athr") == 1 and (state1 == "MAN THR" or state2 == "MAN THR" or state1 == "MCT" or state2 == "MCT" or state1 == "TOGA" or state2 == "TOGA") and getprop("systems/thrust/eng-out") != 1) { - if (getprop("/modes/pfd/fma/athr-armed") != 1) { - setprop("/modes/pfd/fma/athr-armed", 1); + athr = Output.athr.getValue(); + + if (athr and (state1 == "MAN THR" or state2 == "MAN THR" or state1 == "MCT" or state2 == "MCT" or state1 == "TOGA" or state2 == "TOGA") and engout != 1) { + if (!Modes.PFD.FMA.athr.getValue()) { + Modes.PFD.FMA.athr.setValue(1); } - } else if (getprop("/it-autoflight/output/athr") == 1 and ((state1 == "MAN THR" and thr1 >= 0.83) or (state2 == "MAN THR" and thr2 >= 0.83) or (state1 == "MCT" and getprop("controls/engines/thrust-limit") == "FLX") or - (state2 == "MCT" and getprop("controls/engines/thrust-limit") == "FLX") or state1 == "TOGA" or state2 == "TOGA") and getprop("systems/thrust/eng-out") == 1) { - if (getprop("/modes/pfd/fma/athr-armed") != 1) { - setprop("/modes/pfd/fma/athr-armed", 1); + } else if (athr and ((state1 == "MAN THR" and thr1 >= 0.83) or (state2 == "MAN THR" and thr2 >= 0.83) or (fadec.Thrust.thrustLimit.getValue() == "FLX" and (state1 == "MCT" or state2 == "MCT")) + or state1 == "TOGA" or state2 == "TOGA") and engout) { + if (!Modes.PFD.FMA.athr.getValue()) { + Modes.PFD.FMA.athr.setValue(1); } } else { - if (getprop("/modes/pfd/fma/athr-armed") != 0) { - setprop("/modes/pfd/fma/athr-armed", 0); + if (Modes.PFD.FMA.athr.getValue()) { + Modes.PFD.FMA.athr.setValue(0); } } # SRS RWY Engagement - var flx = getprop("systems/thrust/lim-flex"); - var lat = getprop("/it-autoflight/mode/lat"); - var newlat = getprop("/modes/pfd/fma/roll-mode"); - var vert = getprop("/it-autoflight/mode/vert"); - var newvert = getprop("/modes/pfd/fma/pitch-mode"); - var newvertarm = getprop("/modes/pfd/fma/pitch-mode2-armed"); - var thr1 = getprop("controls/engines/engine[0]/throttle-pos"); - var thr2 = getprop("controls/engines/engine[1]/throttle-pos"); - var wow = getprop("gear/gear[0]/wow"); - var engstate1 = getprop("engines/engine[0]/state"); - var engstate2 = getprop("engines/engine[1]/state"); + flx = fadec.Thrust.limFlex.getValue(); + newlat = Modes.PFD.FMA.rollMode.getValue(); + engstate1 = pts.Engines.Engine.state[0].getValue(); + engstate2 = pts.Engines.Engine.state[1].getValue(); if (((state1 == "TOGA" or state2 == "TOGA") or (flx == 1 and (state1 == "MCT" or state2 == "MCT")) or (flx == 1 and ((state1 == "MAN THR" and thr1 >= 0.83) or (state2 == "MAN THR" and thr2 >= 0.83)))) and (engstate1 == 3 or engstate2 == 3)) { # RWY Engagement would go here, but automatic ILS selection is not simulated yet. - if (wow and FMGCInternal.v2set and getprop("/it-autoflight/output/vert") != 7) { + gear1 = pts.Gear.wow[0].getValue(); + if (gear1 and FMGCInternal.v2set and Output.vert.getValue() != 7) { ITAF.setVertMode(7); - setprop("/it-autoflight/mode/vert", "T/O CLB"); + Text.vert.setValue("T/O CLB"); } } else { - var gear1 = getprop("gear/gear[1]/wow"); - var gear2 = getprop("gear/gear[2]/wow"); - if (getprop("/it-autoflight/input/lat") == 5 and (gear1 or gear2)) { + gear1 = pts.Gear.wow[0].getValue(); + gear2 = pts.Gear.wow[2].getValue(); + if (Input.lat.getValue() == 5 and (gear1 or gear2)) { ITAF.setLatMode(9); } - if (getprop("/it-autoflight/output/vert") == 7 and (gear1 or gear2)) { + if (Input.vert.getValue() == 7 and (gear1 or gear2)) { ITAF.setVertMode(9); } } - var trk = getprop("/it-autoflight/custom/trk-fpa"); - if (lat == "HDG" and trk == 0) { + trk = Custom.trkFpa.getValue(); + latText = Text.lat.getValue(); + if (latText == "HDG" and trk == 0) { if (newlat != "HDG") { - setprop("/modes/pfd/fma/roll-mode", "HDG"); + Modes.PFD.FMA.rollMode.setValue("HDG"); } - } else if (lat == "HDG" and trk == 1) { + } else if (latText == "HDG" and trk == 1) { if (newlat != "TRACK") { - setprop("/modes/pfd/fma/roll-mode", "TRACK"); + Modes.PFD.FMA.rollMode.setValue("TRACK"); } } # Boxes - var elapsedtime = getprop("sim/time/elapsed-sec"); - if (getprop("/modes/pfd/fma/ap-mode-time") + 10 >= elapsedtime) { - setprop("/modes/pfd/fma/ap-mode-box", 1); + elapsedtime = pts.Sim.Time.elapsedSec.getValue(); + if (Modes.PFD.FMA.apModeTime.getValue() + 10 >= elapsedtime) { + Modes.PFD.FMA.apModeBox.setValue(1); } else { - setprop("/modes/pfd/fma/ap-mode-box", 0); + Modes.PFD.FMA.apModeBox.setValue(0); } - if (getprop("/modes/pfd/fma/fd-mode-time") + 10 >= elapsedtime) { - setprop("/modes/pfd/fma/fd-mode-box", 1); + if (Modes.PFD.FMA.fdModeTime.getValue() + 10 >= elapsedtime) { + Modes.PFD.FMA.fdModeBox.setValue(1); } else { - setprop("/modes/pfd/fma/fd-mode-box", 0); + Modes.PFD.FMA.fdModeBox.setValue(0); } - if (getprop("/modes/pfd/fma/athr-mode-time") + 10 >= elapsedtime) { - setprop("/modes/pfd/fma/athr-mode-box", 1); + if (Modes.PFD.FMA.athrModeTime.getValue() + 10 >= elapsedtime) { + Modes.PFD.FMA.athrModeBox.setValue(1); } else { - setprop("/modes/pfd/fma/athr-mode-box", 0); + Modes.PFD.FMA.athrModeBox.setValue(0); } - if (getprop("/modes/pfd/fma/throttle-mode-time") + 10 >= elapsedtime) { - setprop("/modes/pfd/fma/throttle-mode-box", 1); + if (Modes.PFD.FMA.throttleModeTime.getValue() + 10 >= elapsedtime) { + Modes.PFD.FMA.throttleModeBox.setValue(1); } else { - setprop("/modes/pfd/fma/throttle-mode-box", 0); + Modes.PFD.FMA.throttleModeBox.setValue(0); } - if (getprop("/modes/pfd/fma/roll-mode-time") + 10 >= elapsedtime) { - setprop("/modes/pfd/fma/roll-mode-box", 1); + if (Modes.PFD.FMA.rollModeTime.getValue() + 10 >= elapsedtime) { + Modes.PFD.FMA.rollModeBox.setValue(1); } else { - setprop("/modes/pfd/fma/roll-mode-box", 0); + Modes.PFD.FMA.rollModeBox.setValue(0); } - if (getprop("/modes/pfd/fma/pitch-mode-time") + 10 >= elapsedtime) { - setprop("/modes/pfd/fma/pitch-mode-box", 1); + if (Modes.PFD.FMA.pitchModeTime.getValue() + 10 >= elapsedtime) { + Modes.PFD.FMA.pitchModeBox.setValue(1); } else { - setprop("/modes/pfd/fma/pitch-mode-box", 0); + Modes.PFD.FMA.pitchModeBox.setValue(0); } - if (getprop("/modes/pfd/fma/roll-mode-armed-time") + 10 >= elapsedtime) { - setprop("/modes/pfd/fma/roll-mode-armed-box", 1); + if (Modes.PFD.FMA.rollModeArmedTime.getValue() + 10 >= elapsedtime) { + Modes.PFD.FMA.rollModeArmedBox.setValue(1); } else { - setprop("/modes/pfd/fma/roll-mode-armed-box", 0); + Modes.PFD.FMA.rollModeArmedBox.setValue(0); } - if (getprop("/modes/pfd/fma/pitch-mode-armed-time") + 10 >= elapsedtime) { - setprop("/modes/pfd/fma/pitch-mode-armed-box", 1); + if (Modes.PFD.FMA.pitchModeArmedTime.getValue() + 10 >= elapsedtime) { + Modes.PFD.FMA.pitchModeArmedBox.setValue(1); } else { - setprop("/modes/pfd/fma/pitch-mode-armed-box", 0); + Modes.PFD.FMA.pitchModeArmedBox.setValue(0); } - if (getprop("/modes/pfd/fma/pitch-mode2-armed-time") + 10 >= elapsedtime) { - setprop("/modes/pfd/fma/pitch-mode2-armed-box", 1); + if (Modes.PFD.FMA.pitchMode2ArmedTime.getValue() + 10 >= elapsedtime) { + Modes.PFD.FMA.pitchMode2ArmedBox.setValue(1); } else { - setprop("/modes/pfd/fma/pitch-mode2-armed-box", 0); + Modes.PFD.FMA.pitchMode2ArmedBox.setValue(0); } }); var loopFMA_b = func { - var newthr = getprop("/modes/pfd/fma/throttle-mode"); - if (getprop("/it-autoflight/input/kts-mach") == 0) { + newthr = Modes.PFD.FMA.throttle.getValue(); + if (!Input.ktsMach.getValue()) { if (newthr != "SPEED") { - setprop("/modes/pfd/fma/throttle-mode", "SPEED"); + Modes.PFD.FMA.throttle.setValue("SPEED"); } - } else if (getprop("/it-autoflight/input/kts-mach") == 1) { + } else { if (newthr != "MACH") { - setprop("/modes/pfd/fma/throttle-mode", "MACH"); + Modes.PFD.FMA.throttle.setValue("MACH"); } } } # Master Lateral setlistener("/it-autoflight/mode/lat", func { - var lat = getprop("/it-autoflight/mode/lat"); - var newlat = getprop("/modes/pfd/fma/roll-mode"); - if (lat == "LNAV") { + latText = Text.lat.getValue(); + newlat = Modes.PFD.FMA.rollMode.getValue(); + if (latText == "LNAV") { if (newlat != "NAV") { - setprop("/modes/pfd/fma/roll-mode", "NAV"); + Modes.PFD.FMA.rollMode.setValue("NAV"); } - } else if (lat == "LOC") { + } else if (latText == "LOC") { if (newlat != "LOC*" and newlat != "LOC") { - setprop("/modes/pfd/fma/roll-mode", "LOC*"); + Modes.PFD.FMA.rollMode.setValue("LOC*"); locupdate.start(); } - } else if (lat == "ALGN") { + } else if (latText == "ALGN") { if (newlat != " ") { - setprop("/modes/pfd/fma/roll-mode", " "); + Modes.PFD.FMA.rollMode.setValue(" "); } - } else if (lat == "RLOU") { + } else if (latText == "RLOU") { if (newlat != " ") { - setprop("/modes/pfd/fma/roll-mode", " "); + Modes.PFD.FMA.rollMode.setValue(" "); } - } else if (lat == "T/O") { + } else if (latText == "T/O") { if (newlat != "RWY") { - setprop("/modes/pfd/fma/roll-mode", "RWY"); + Modes.PFD.FMA.rollMode.setValue("RWY"); } - } else if (lat == " ") { + } else if (latText == " ") { if (newlat != " ") { - setprop("/modes/pfd/fma/roll-mode", " "); + Modes.PFD.FMA.rollMode.setValue(" "); } } }); var locupdate = maketimer(0.5, func { - var lat = getprop("/it-autoflight/mode/lat"); - var newlat = getprop("/modes/pfd/fma/roll-mode"); - var nav_defl = getprop("/instrumentation/nav[0]/heading-needle-deflection-norm"); - if (lat == "LOC") { + latText = Text.lat.getValue(); + newlat = Modes.PFD.FMA.rollMode.getValue(); + nav_defl = pts.Instrumentation.Nav.locDeflection.getValue(); + if (latText == "LOC") { if (nav_defl > -0.06 and nav_defl < 0.06) { locupdate.stop(); if (newlat != "LOC") { - setprop("/modes/pfd/fma/roll-mode", "LOC"); + Modes.PFD.FMA.rollMode.setValue("LOC"); } } } @@ -260,82 +333,82 @@ var locupdate = maketimer(0.5, func { # Master Vertical setlistener("/it-autoflight/mode/vert", func { - var vert = getprop("/it-autoflight/mode/vert"); - var newvert = getprop("/modes/pfd/fma/pitch-mode"); - var newvertarm = getprop("/modes/pfd/fma/pitch-mode2-armed"); - if (vert == "ALT HLD") { + vertText = Text.vert.getValue(); + newvert = Modes.PFD.FMA.pitchMode.getValue(); + newvertarm = Modes.PFD.FMA.pitchMode2Armed.getValue(); + if (vertText == "ALT HLD") { altvert(); if (newvertarm != " ") { - setprop("/modes/pfd/fma/pitch-mode2-armed", " "); + Modes.PFD.FMA.pitchMode2Armed.setValue(" "); } - } else if (vert == "ALT CAP") { + } else if (vertText == "ALT CAP") { altvert(); if (newvertarm != " ") { - setprop("/modes/pfd/fma/pitch-mode2-armed", " "); + Modes.PFD.FMA.pitchMode2Armed.setValue(" "); } - } else if (vert == "V/S") { + } else if (vertText == "V/S") { if (newvert != "V/S") { - setprop("/modes/pfd/fma/pitch-mode", "V/S"); + Modes.PFD.FMA.pitchMode.setValue("V/S"); } if (newvertarm != "ALT") { - setprop("/modes/pfd/fma/pitch-mode2-armed", "ALT"); + Modes.PFD.FMA.pitchMode2Armed.setValue("ALT"); } - } else if (vert == "G/S") { + } else if (vertText == "G/S") { if (newvert != "G/S*" and newvert != "G/S") { - setprop("/modes/pfd/fma/pitch-mode", "G/S*"); + Modes.PFD.FMA.pitchMode.setValue("G/S*"); gsupdate.start(); } if (newvertarm != " ") { - setprop("/modes/pfd/fma/pitch-mode2-armed", " "); + Modes.PFD.FMA.pitchMode2Armed.setValue(" "); } - } else if (vert == "SPD CLB") { + } else if (vertText == "SPD CLB") { if (newvert != "OP CLB") { - setprop("/modes/pfd/fma/pitch-mode", "OP CLB"); + Modes.PFD.FMA.pitchMode.setValue("OP CLB"); } if (newvertarm != "ALT") { - setprop("/modes/pfd/fma/pitch-mode2-armed", "ALT"); + Modes.PFD.FMA.pitchMode2Armed.setValue("ALT"); } - } else if (vert == "SPD DES") { + } else if (vertText == "SPD DES") { if (newvert != "OP DES") { - setprop("/modes/pfd/fma/pitch-mode", "OP DES"); + Modes.PFD.FMA.pitchMode.setValue("OP DES"); } if (newvertarm != "ALT") { - setprop("/modes/pfd/fma/pitch-mode2-armed", "ALT"); + Modes.PFD.FMA.pitchMode2Armed.setValue("ALT"); } - } else if (vert == "FPA") { + } else if (vertText == "FPA") { if (newvert != "FPA") { - setprop("/modes/pfd/fma/pitch-mode", "FPA"); + Modes.PFD.FMA.pitchMode.setValue("FPA"); } if (newvertarm != "ALT") { - setprop("/modes/pfd/fma/pitch-mode2-armed", "ALT"); + Modes.PFD.FMA.pitchMode2Armed.setValue("ALT"); } - } else if (vert == "LAND") { + } else if (vertText == "LAND") { if (newvert != "LAND") { - setprop("/modes/pfd/fma/pitch-mode", "LAND"); + Modes.PFD.FMA.pitchMode.setValue("LAND"); } - } else if (vert == "FLARE") { + } else if (vertText == "FLARE") { if (newvert != "FLARE") { - setprop("/modes/pfd/fma/pitch-mode", "FLARE"); + Modes.PFD.FMA.pitchMode.setValue("FLARE"); } - } else if (vert == "ROLLOUT") { + } else if (vertText == "ROLLOUT") { if (newvert != "ROLL OUT") { - setprop("/modes/pfd/fma/pitch-mode", "ROLL OUT"); + Modes.PFD.FMA.pitchMode.setValue("ROLL OUT"); } - } else if (vert == "T/O CLB") { + } else if (vertText == "T/O CLB") { if (newvert != "SRS") { - setprop("/modes/pfd/fma/pitch-mode", "SRS"); + Modes.PFD.FMA.pitchMode.setValue("SRS"); } updatePitchArm2(); - } else if (vert == "G/A CLB") { + } else if (vertText == "G/A CLB") { if (newvert != "SRS") { - setprop("/modes/pfd/fma/pitch-mode", "SRS"); + Modes.PFD.FMA.pitchMode.setValue("SRS"); } if (newvertarm != "ALT") { - setprop("/modes/pfd/fma/pitch-mode2-armed", "ALT"); + Modes.PFD.FMA.pitchMode2Armed.setValue("ALT"); } - } else if (vert == " ") { + } else if (vertText == " ") { if (newvert != " ") { - setprop("/modes/pfd/fma/pitch-mode", " "); + Modes.PFD.FMA.pitchMode.setValue(" "); } updatePitchArm2(); } @@ -343,51 +416,51 @@ setlistener("/it-autoflight/mode/vert", func { }); var updatePitchArm2 = func { - var newvertarm = getprop("/modes/pfd/fma/pitch-mode2-armed"); + newvertarm = Modes.PFD.FMA.pitchMode2Armed.getValue(); if (newvertarm != "CLB" and FMGCInternal.v2set) { - setprop("/modes/pfd/fma/pitch-mode2-armed", "CLB"); - } else if (newvertarm != " " and FMGCInternal.v2set != 1) { - setprop("/modes/pfd/fma/pitch-mode2-armed", " "); + Modes.PFD.FMA.pitchMode2Armed.setValue("CLB"); + } else if (newvertarm != " " and !FMGCInternal.v2set) { + Modes.PFD.FMA.pitchMode2Armed.setValue(" "); } } var gsupdate = maketimer(0.5, func { - var vert = getprop("/it-autoflight/mode/vert"); - var newvert = getprop("/modes/pfd/fma/pitch-mode"); - var gs_defl = getprop("/instrumentation/nav[0]/gs-needle-deflection-norm"); - if (vert == "G/S") { + vertText = Text.vert.getValue(); + newvert = Modes.PFD.FMA.pitchMode.getValue(); + gs_defl = pts.Instrumentation.Nav.gsDeflection.getValue(); + if (vertText == "G/S") { if (gs_defl > -0.06 and gs_defl < 0.06) { gsupdate.stop(); if (newvert != "G/S") { - setprop("/modes/pfd/fma/pitch-mode", "G/S"); + Modes.PFD.FMA.pitchMode.setValue("G/S"); } } } }); var altvert = func { - var MCPalt = getprop("/it-autoflight/internal/alt"); - var ALTdif = abs(fmgc.FMGCInternal.crzFt - MCPalt); - var vert = getprop("/it-autoflight/mode/vert"); - var newvert = getprop("/modes/pfd/fma/pitch-mode"); - if (ALTdif <= 20) { - if (vert == "ALT HLD") { + MCPalt = Internal.alt.getValue(); + vertText = Text.vert.getValue(); + newvert = Modes.PFD.FMA.pitchMode.getValue(); + + if (abs(fmgc.FMGCInternal.crzFt - MCPalt) <= 20) { + if (vertText == "ALT HLD") { if (newvert != "ALT CRZ") { - setprop("/modes/pfd/fma/pitch-mode", "ALT CRZ"); + Modes.PFD.FMA.pitchMode.setValue("ALT CRZ"); } - } else if (vert == "ALT CAP") { + } else if (vertText == "ALT CAP") { if (newvert != "ALT CRZ*") { - setprop("/modes/pfd/fma/pitch-mode", "ALT CRZ*"); + Modes.PFD.FMA.pitchMode.setValue("ALT CRZ*"); } } } else { - if (vert == "ALT HLD") { + if (vertText == "ALT HLD") { if (newvert != "ALT") { - setprop("/modes/pfd/fma/pitch-mode", "ALT"); + Modes.PFD.FMA.pitchMode.setValue("ALT"); } - } else if (vert == "ALT CAP") { + } else if (vertText == "ALT CAP") { if (newvert != "ALT*") { - setprop("/modes/pfd/fma/pitch-mode", "ALT*"); + Modes.PFD.FMA.pitchMode.setValue("ALT*"); } } } @@ -395,123 +468,115 @@ var altvert = func { # Arm HDG or NAV setlistener("/it-autoflight/mode/arm", func { - var arm = getprop("/it-autoflight/mode/arm"); - var newarm = getprop("/modes/pfd/fma/roll-mode-armed"); + arm = Text.arm.getValue(); + newarm = Modes.PFD.FMA.rollModeArmed.getValue(); if (arm == "HDG") { if (newarm != "HDG") { - setprop("/modes/pfd/fma/roll-mode-armed", " "); + Modes.PFD.FMA.rollModeArmed.setValue(" "); } } else if (arm == "LNV") { if (newarm != "NAV") { - setprop("/modes/pfd/fma/roll-mode-armed", "NAV"); + Modes.PFD.FMA.rollModeArmed.setValue("NAV"); } } else if (arm == " ") { if (newarm != " ") { - setprop("/modes/pfd/fma/roll-mode-armed", " "); + Modes.PFD.FMA.rollModeArmed.setValue(" "); } } }); # Arm LOC setlistener("/it-autoflight/output/loc-armed", func { - var loca = getprop("/it-autoflight/output/loc-armed"); - var newarm = getprop("/modes/pfd/fma/roll-mode-armed"); - if (loca) { + newarm = Modes.PFD.FMA.rollModeArmed.getValue(); + if (Output.locArm.getValue()) { if (newarm != "LOC") { - setprop("/modes/pfd/fma/roll-mode-armed", "LOC"); + Modes.PFD.FMA.rollModeArmed.setValue("LOC"); } } else { if (newarm != " ") { - setprop("/modes/pfd/fma/roll-mode-armed", " "); + Modes.PFD.FMA.rollModeArmed.setValue(" "); } } }); # Arm G/S setlistener("/it-autoflight/output/appr-armed", func { - var appa = getprop("/it-autoflight/output/appr-armed"); - var newvert2arm = getprop("/modes/pfd/fma/pitch-mode-armed"); - if (appa) { + newvert2arm = Modes.PFD.FMA.pitchModeArmed.getValue(); + if (Output.apprArm.getValue()) { if (newvert2arm != "G/S") { - setprop("/modes/pfd/fma/pitch-mode-armed", "G/S"); + Modes.PFD.FMA.pitchModeArmed.setValue("G/S"); } } else { if (newvert2arm != " ") { - setprop("/modes/pfd/fma/pitch-mode-armed", " "); + Modes.PFD.FMA.pitchModeArmed.setValue(" "); } } }); # AP var ap = func { - var ap1 = getprop("/it-autoflight/output/ap1"); - var ap2 = getprop("/it-autoflight/output/ap2"); - var newap = getprop("/modes/pfd/fma/ap-mode"); + ap1 = Output.ap1.getValue(); + ap2 = Output.ap2.getValue(); + newap = Modes.PFD.FMA.apMode.getValue(); if (ap1 and ap2 and newap != "AP1+2") { - setprop("/modes/pfd/fma/ap-mode", "AP 1+2"); + Modes.PFD.FMA.apMode.setValue("AP 1+2"); } else if (ap1 and !ap2 and newap != "AP 1") { - setprop("/modes/pfd/fma/ap-mode", "AP 1"); + Modes.PFD.FMA.apMode.setValue("AP 1"); } else if (ap2 and !ap1 and newap != "AP 2") { - setprop("/modes/pfd/fma/ap-mode", "AP 2"); + Modes.PFD.FMA.apMode.setValue("AP 2"); } else if (!ap1 and !ap2) { - setprop("/modes/pfd/fma/ap-mode", " "); + Modes.PFD.FMA.apMode.setValue(" "); } } # FD var fd = func { - var fd1 = getprop("/it-autoflight/output/fd1"); - var fd2 = getprop("/it-autoflight/output/fd2"); - var newfd = getprop("/modes/pfd/fma/fd-mode"); + fd1 = Output.fd1.getValue(); + fd2 = Output.fd2.getValue(); + newfd = Modes.PFD.FMA.fdMode.getValue(); if (fd1 and fd2 and newfd != "1FD2") { - setprop("/modes/pfd/fma/fd-mode", "1 FD 2"); + Modes.PFD.FMA.fdMode.setValue("1 FD 2"); } else if (fd1 and !fd2 and newfd != "1 FD -") { - setprop("/modes/pfd/fma/fd-mode", "1 FD -"); + Modes.PFD.FMA.fdMode.setValue("1 FD -"); } else if (fd2 and !fd1 and newfd != "- FD 2") { - setprop("/modes/pfd/fma/fd-mode", "- FD 2"); + Modes.PFD.FMA.fdMode.setValue("- FD 2"); } else if (!fd1 and !fd2) { - setprop("/modes/pfd/fma/fd-mode", " "); + Modes.PFD.FMA.fdMode.setValue(" "); } } # AT -var at = func { - var at = getprop("/it-autoflight/output/athr"); - var newat = getprop("/modes/pfd/fma/at-mode"); - if (at and newat != "A/THR") { - setprop("/modes/pfd/fma/at-mode", "A/THR"); +var atMode = func { + at = Output.athr.getValue(); + if (at and Modes.PFD.FMA.athrMode.getValue() != "A/THR") { + Modes.PFD.FMA.athrMode.setValue("A/THR"); } else if (!at) { - setprop("/modes/pfd/fma/at-mode", " "); + Modes.PFD.FMA.athrMode.setValue(" "); } } var boxchk = func { - if ((getprop("/it-autoflight/output/ap1") or getprop("/it-autoflight/output/ap2") or getprop("/it-autoflight/output/fd1") or getprop("/it-autoflight/output/fd2")) and getprop("/it-autoflight/output/fma-pwr") == 0) { - setprop("/it-autoflight/input/lat", 3); + if ((Output.ap1.getValue() or Output.ap2.getValue() or Output.fd1.getValue() or Output.fd2.getValue()) and !Custom.Output.fmaPower.getValue()) { + Input.lat.setValue(3); boxchk_b(); } } var boxchk_b = func { - var newlat = getprop("/modes/pfd/fma/roll-mode"); - if (newlat != " ") { - setprop("/modes/pfd/fma/roll-mode-time", getprop("sim/time/elapsed-sec")); + if (Modes.PFD.FMA.rollMode.getValue() != " ") { + Modes.PFD.FMA.rollModeTime.setValue(pts.Sim.Time.elapsedSec.getValue()); } - var newvert = getprop("/modes/pfd/fma/pitch-mode"); - if (newvert != " ") { - setprop("/modes/pfd/fma/pitch-mode-time", getprop("sim/time/elapsed-sec")); + if (Modes.PFD.FMA.pitchMode.getValue() != " ") { + Modes.PFD.FMA.pitchModeTime.setValue(pts.Sim.Time.elapsedSec.getValue()); } - var newarmr = getprop("/modes/pfd/fma/roll-mode-armed"); - if (newarmr != " ") { - setprop("/modes/pfd/fma/roll-mode-armed-time", getprop("sim/time/elapsed-sec")); + if (Modes.PFD.FMA.rollModeArmed.getValue() != " ") { + Modes.PFD.FMA.rollModeArmedTime.setValue(pts.Sim.Time.elapsedSec.getValue()); } - var newarmp = getprop("/modes/pfd/fma/pitch-mode-armed"); - if (newarmp != " ") { - setprop("/modes/pfd/fma/pitch-mode-armed-time", getprop("sim/time/elapsed-sec")); + if (Modes.PFD.FMA.pitchModeArmed.getValue() != " ") { + Modes.PFD.FMA.pitchModeArmedTime.setValue(pts.Sim.Time.elapsedSec.getValue()); } - var newarmp2 = getprop("/modes/pfd/fma/pitch-mode2-armed"); - if (newarmp2 != " ") { - setprop("/modes/pfd/fma/pitch-mode2-armed-time", getprop("sim/time/elapsed-sec")); + if (Modes.PFD.FMA.pitchMode2Armed.getValue() != " ") { + Modes.PFD.FMA.pitchMode2ArmedTime.setValue(pts.Sim.Time.elapsedSec.getValue()); } } @@ -533,79 +598,79 @@ setlistener("/it-autoflight/output/fd2", func { boxchk(); }); setlistener("/it-autoflight/output/athr", func { - at(); + atMode(); }); # Boxes setlistener("/modes/pfd/fma/ap-mode", func { - if (getprop("/modes/pfd/fma/ap-mode") != " ") { - setprop("/modes/pfd/fma/ap-mode-time", getprop("sim/time/elapsed-sec")); + if (Modes.PFD.FMA.apMode.getValue() != " ") { + Modes.PFD.FMA.apModeTime.setValue(pts.Sim.Time.elapsedSec.getValue()); } }); setlistener("/modes/pfd/fma/fd-mode", func { - if (getprop("/modes/pfd/fma/fd-mode") != " ") { - setprop("/modes/pfd/fma/fd-mode-time", getprop("sim/time/elapsed-sec")); + if (Modes.PFD.FMA.fdMode.getValue() != " ") { + Modes.PFD.FMA.fdModeTime.setValue(pts.Sim.Time.elapsedSec.getValue()); } }); setlistener("/modes/pfd/fma/at-mode", func { - if (getprop("/modes/pfd/fma/at-mode") != " ") { - setprop("/modes/pfd/fma/throttle-mode-time", getprop("sim/time/elapsed-sec")); - setprop("/modes/pfd/fma/athr-mode-time", getprop("sim/time/elapsed-sec")); + if (Modes.PFD.FMA.athrMode.getValue() != " ") { + Modes.PFD.FMA.throttleModeTime.setValue(pts.Sim.Time.elapsedSec.getValue()); + Modes.PFD.FMA.athrModeTime.setValue(pts.Sim.Time.elapsedSec.getValue()); } }); setlistener("/modes/pfd/fma/athr-armed", func { - if (getprop("/modes/pfd/fma/at-mode") != " ") { - setprop("/modes/pfd/fma/athr-mode-time", getprop("sim/time/elapsed-sec")); + if (Modes.PFD.FMA.athrMode.getValue() != " ") { + Modes.PFD.FMA.athrModeTime.setValue(pts.Sim.Time.elapsedSec.getValue()); } }); setlistener("/modes/pfd/fma/throttle-mode", func { - var state1 = getprop("systems/thrust/state1"); - var state2 = getprop("systems/thrust/state2"); - if (getprop("/it-autoflight/output/athr") == 1 and state1 != "MCT" and state2 != "MCT" and state1 != "MAN THR" and state2 != "MAN THR" and state1 != "TOGA" and state2 != "TOGA" and state1 != "IDLE" and state2 != "IDLE" and - getprop("systems/thrust/eng-out") != 1) { - setprop("/modes/pfd/fma/throttle-mode-time", getprop("sim/time/elapsed-sec")); - } else if (getprop("/it-autoflight/output/athr") == 1 and state1 != "TOGA" and state2 != "TOGA" and state1 != "IDLE" and state2 != "IDLE" and getprop("systems/thrust/eng-out") == 1) { - if (getprop("controls/engines/engine[0]/throttle-pos") < 0.83 and getprop("controls/engines/engine[1]/throttle-pos") < 0.83) { - setprop("/modes/pfd/fma/throttle-mode-time", getprop("sim/time/elapsed-sec")); + state1 = pts.Systems.Thrust.state[0].getValue(); + state2 = pts.Systems.Thrust.state[1].getValue(); + athr = Output.athr.getValue(); + if (athr == 1 and state1 != "MCT" and state2 != "MCT" and state1 != "MAN THR" and state2 != "MAN THR" and state1 != "TOGA" and state2 != "TOGA" and state1 != "IDLE" and state2 != "IDLE" and + !pts.Systems.Thrust.engOut.getValue()) { + Modes.PFD.FMA.throttleModeTime.setValue(pts.Sim.Time.elapsedSec.getValue()); + } else if (athr == 1 and state1 != "TOGA" and state2 != "TOGA" and state1 != "IDLE" and state2 != "IDLE" and pts.Systems.Thrust.engOut.getValue()) { + if (pts.Controls.Engines.Engine.throttlePos[0].getValue() < 0.83 and pts.Controls.Engines.Engine.throttlePos[1].getValue() < 0.83) { + Modes.PFD.FMA.throttleModeTime.setValue(pts.Sim.Time.elapsedSec.getValue()); } } }); setlistener("/modes/pfd/fma/roll-mode", func { - var newlat = getprop("/modes/pfd/fma/roll-mode"); - if (newlat != " ") { - setprop("/modes/pfd/fma/roll-mode-time", getprop("sim/time/elapsed-sec")); + if (Modes.PFD.FMA.rollMode.getValue() != " ") { + Modes.PFD.FMA.rollModeTime.setValue(pts.Sim.Time.elapsedSec.getValue()); } }); setlistener("/modes/pfd/fma/pitch-mode", func { - var newvert = getprop("/modes/pfd/fma/pitch-mode"); - if (newvert != " ") { - setprop("/modes/pfd/fma/pitch-mode-time", getprop("sim/time/elapsed-sec")); + if (Modes.PFD.FMA.pitchMode.getValue() != " ") { + Modes.PFD.FMA.pitchModeTime.setValue(pts.Sim.Time.elapsedSec.getValue()); } }); setlistener("/modes/pfd/fma/roll-mode-armed", func { - var newarm = getprop("/modes/pfd/fma/roll-mode-armed"); - if (newarm != " ") { - setprop("/modes/pfd/fma/roll-mode-armed-time", getprop("sim/time/elapsed-sec")); + if (Modes.PFD.FMA.rollModeArmed.getValue() != " ") { + Modes.PFD.FMA.rollModeArmedTime.setValue(pts.Sim.Time.elapsedSec.getValue()); } }); setlistener("/modes/pfd/fma/pitch-mode-armed", func { - var newarm = getprop("/modes/pfd/fma/pitch-mode-armed"); - if (newarm != " ") { - setprop("/modes/pfd/fma/pitch-mode-armed-time", getprop("sim/time/elapsed-sec")); + if (Modes.PFD.FMA.pitchModeArmed.getValue() != " ") { + Modes.PFD.FMA.pitchModeArmedTime.setValue(pts.Sim.Time.elapsedSec.getValue()); } }); setlistener("/modes/pfd/fma/pitch-mode2-armed", func { - var newarm = getprop("/modes/pfd/fma/pitch-mode2-armed"); - if (newarm != " ") { - setprop("/modes/pfd/fma/pitch-mode2-armed-time", getprop("sim/time/elapsed-sec")); + if (Modes.PFD.FMA.pitchMode2Armed != " ") { + Modes.PFD.FMA.pitchMode2ArmedTime.setValue(pts.Sim.Time.elapsedSec.getValue()); } }); + +setlistener("sim/signals/fdm-initialized", func { + init(); +}); diff --git a/Nasal/Libraries/property-tree-setup.nas b/Nasal/Libraries/property-tree-setup.nas index 77fb5db5..63003361 100644 --- a/Nasal/Libraries/property-tree-setup.nas +++ b/Nasal/Libraries/property-tree-setup.nas @@ -148,6 +148,10 @@ var Instrumentation = { pnlModeNum: [props.globals.initNode("/instrumentation/efis[0]/mfd/pnl_mode-num", 2, "INT"), props.globals.initNode("/instrumentation/efis[1]/mfd/pnl_mode-num", 2, "INT")], }, }, + Nav: { + gsDeflection: props.globals.getNode("/instrumentation/nav[0]/gs-needle-deflection-norm"), + locDeflection: props.globals.getNode("/instrumentation/nav[0]/heading-needle-deflection-norm"), + }, TCAS: { Inputs: { mode: props.globals.getNode("/instrumentation/tcas/inputs/mode"), From 6dce8486d561da6f826492b39f7b4dbd97897ae2 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R <legoboyvdlp@gmail.com> Date: Sat, 3 Oct 2020 10:33:38 +0100 Subject: [PATCH 10/16] Remove un-needed variable --- Nasal/FMGC/FMGC-c.nas | 1 - 1 file changed, 1 deletion(-) diff --git a/Nasal/FMGC/FMGC-c.nas b/Nasal/FMGC/FMGC-c.nas index 3eee58e5..e9282207 100644 --- a/Nasal/FMGC/FMGC-c.nas +++ b/Nasal/FMGC/FMGC-c.nas @@ -17,7 +17,6 @@ var flx = nil; var gear1 = nil; var gear2 = nil; var gs_defl = nil; -var lat = nil; var latText = nil; var MCPalt = nil; var nav_defl = nil; From 1b9f31c72629b1f301240e62d1899079ea5603a3 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R <legoboyvdlp@gmail.com> Date: Sat, 3 Oct 2020 10:59:43 +0100 Subject: [PATCH 11/16] MCDU: stop calling getprop(page) literally dozens of times when a button is pushed. In addition, we switch more stuff to PTS. Slowly getting faster! --- Nasal/ECAM/ECAM-logic.nas | 2 +- Nasal/FMGC/FMGC.nas | 26 +- Nasal/FMGC/SimbriefParser.nas | 8 +- Nasal/FMGC/flightplan.nas | 6 +- Nasal/Libraries/property-tree-setup.nas | 7 + Nasal/MCDU/F-PLN.nas | 12 +- Nasal/MCDU/FUELPRED.nas | 74 +-- Nasal/MCDU/INITA.nas | 44 +- Nasal/MCDU/INITB.nas | 162 +++--- Nasal/MCDU/MCDU.nas | 728 ++++++++++++------------ Nasal/MCDU/WINDCLB.nas | 12 +- Nasal/MCDU/WINDCRZ.nas | 12 +- Nasal/MCDU/WINDDES.nas | 28 +- Nasal/Systems/FADEC/engines-cfm.nas | 16 +- Nasal/Systems/FADEC/engines-iae.nas | 16 +- 15 files changed, 588 insertions(+), 565 deletions(-) diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index 270df6c6..0e7431cc 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -2268,7 +2268,7 @@ var messages_memo = func { outr_tk_fuel_xfrd.active = 0; } - if (getprop("/consumables/fuel/total-fuel-lbs") < 6000 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) { # assuming US short ton 2000lb + if (pts.Consumables.Fuel.totalFuelLbs.getValue() < 6000 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) { # assuming US short ton 2000lb fob_3T.active = 1; } else { fob_3T.active = 0; diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index c39b5ead..bbf2cf03 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -221,6 +221,10 @@ var FMGCInternal = { zfwcgSet: 0, block: 0.0, blockSet: 0, + blockCalculating: 0, + blockConfirmed: 0, + fuelCalculating: 0, + fuelRequest: 0, taxiFuel: 0.4, taxiFuelSet: 0, tripFuel: 0, @@ -281,8 +285,8 @@ setlistener("/gear/gear[0]/wow", func { }, 0, 0); var trimReset = func { - flaps = getprop("/controls/flight/flaps-pos"); - if (pts.Gear.wow[0].getBoolValue() and !FMGCInternal.takeoffState and (flaps >= 5 or (flaps >= 4 and getprop("/instrumentation/mk-viii/inputs/discretes/momentary-flap3-override") == 1))) { + flaps = pts.Controls.Flight.flapsPos.getValue(); + if (pts.Gear.wow[0].getBoolValue() and !FMGCInternal.takeoffState and (flaps >= 5 or (flaps >= 4 and pts.Instrumentation.MKVII.Inputs.Discretes.flap3Override.getValue() == 1))) { interpolate("/controls/flight/elevator-trim", 0.0, 1.5); } } @@ -486,16 +490,16 @@ var updateFuel = func { } # Misc fuel claclulations - if (getprop("/FMGC/internal/block-calculating")) { + if (fmgc.FMGCInternal.blockCalculating) { FMGCInternal.block = num(FMGCInternal.altFuel + FMGCInternal.finalFuel + FMGCInternal.tripFuel + FMGCInternal.rteRsv + FMGCInternal.taxiFuel); FMGCInternal.blockSet = 1; } - fmgc.FMGCInternal.fob = num(getprop("/consumables/fuel/total-fuel-lbs") / 1000); - fmgc.FMGCInternal.fuelPredGw = num(getprop("/fdm/jsbsim/inertia/weight-lbs") / 1000); + fmgc.FMGCInternal.fob = num(pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000); + fmgc.FMGCInternal.fuelPredGw = num(pts.Fdm.JSBsim.Inertia.weightLbs.getValue() / 1000); fmgc.FMGCInternal.cg = fmgc.FMGCInternal.zfwcg; # Calcualte extra fuel - if (num(getprop("/engines/engine[0]/n1-actual")) > 0 or num(getprop("/engines/engine[1]/n1-actual")) > 0) { + if (num(pts.Engines.Engine.n1Actual[0].getValue()) > 0 or num(pts.Engines.Engine.n1Actual[1].getValue()) > 0) { extra_fuel = 1000 * num(FMGCInternal.fob - FMGCInternal.tripFuel - FMGCInternal.minDestFob - FMGCInternal.taxiFuel - FMGCInternal.rteRsv); } else { extra_fuel = 1000 * num(FMGCInternal.block - FMGCInternal.tripFuel - FMGCInternal.minDestFob - FMGCInternal.taxiFuel - FMGCInternal.rteRsv); @@ -614,8 +618,8 @@ var radios = maketimer(1, func() { }); var masterFMGC = maketimer(0.2, func { - n1_left = getprop("/engines/engine[0]/n1-actual"); - n1_right = getprop("/engines/engine[1]/n1-actual"); + n1_left = pts.Engines.Engine.n1Actual[0].getValue(); + n1_right = pts.Engines.Engine.n1Actual[1].getValue(); flaps = getprop("/controls/flight/flaps-pos"); modelat = getprop("/modes/pfd/fma/roll-mode"); mode = getprop("/modes/pfd/fma/pitch-mode"); @@ -761,7 +765,7 @@ var masterFMGC = maketimer(0.2, func { # calculate speeds ############################ flap = getprop("/controls/flight/flaps-pos"); - weight_lbs = getprop("/fdm/jsbsim/inertia/weight-lbs") / 1000; + weight_lbs = pts.Fdm.JSBsim.Inertia.weightLbs.getValue() / 1000; altitude = getprop("/instrumentation/altimeter/indicated-altitude-ft"); # current speeds @@ -1286,7 +1290,7 @@ var timer48gpsAlign3 = maketimer(1, func() { var timer3blockFuel = maketimer(1, func() { if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/block-fuel-time") + 3) { #updateFuel(); - setprop("/FMGC/internal/block-calculating", 0); + fmgc.FMGCInternal.blockCalculating = 0; setprop("/FMGC/internal/block-fuel-time", -99); timer3blockFuel.stop(); } @@ -1295,7 +1299,7 @@ var timer3blockFuel = maketimer(1, func() { var timer5fuelPred = maketimer(1, func() { if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/fuel-pred-time") + 5) { #updateFuel(); - setprop("/FMGC/internal/fuel-calculating", 0); + fmgc.FMGCInternal.fuelCalculating = 0; setprop("/FMGC/internal/fuel-pred-time", -99); timer5fuelPred.stop(); } diff --git a/Nasal/FMGC/SimbriefParser.nas b/Nasal/FMGC/SimbriefParser.nas index f75a56e6..11a9aabf 100644 --- a/Nasal/FMGC/SimbriefParser.nas +++ b/Nasal/FMGC/SimbriefParser.nas @@ -173,10 +173,10 @@ var SimbriefParser = { fmgc.FMGCInternal.zfw = me.store2.getChild("est_zfw").getValue() / 1000; fmgc.FMGCInternal.zfwSet = 1; fmgc.FMGCInternal.tow = fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel; - setprop("/FMGC/internal/fuel-request-set", 1); - setprop("/FMGC/internal/fuel-calculating", 1); - setprop("/FMGC/internal/block-calculating", 0); - setprop("/FMGC/internal/block-confirmed", 1); + fmgc.FMGCInternal.fuelRequest = 1; + fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.FMGCInternal.blockCalculating = 0; + fmgc.FMGCInternal.blockConfirmed = 1; }, }; \ No newline at end of file diff --git a/Nasal/FMGC/flightplan.nas b/Nasal/FMGC/flightplan.nas index e4018ba7..874d5dbc 100644 --- a/Nasal/FMGC/flightplan.nas +++ b/Nasal/FMGC/flightplan.nas @@ -758,9 +758,9 @@ var flightPlanController = { fmgc.windController.updatePlans(); # push update to fuel - if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 0); - setprop("/FMGC/internal/fuel-calculating", 1); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.FMGCInternal.fuelCalculating = 1; } canvas_nd.A3XXRouteDriver.triggerSignal("fp-added"); }, diff --git a/Nasal/Libraries/property-tree-setup.nas b/Nasal/Libraries/property-tree-setup.nas index 63003361..82b79e67 100644 --- a/Nasal/Libraries/property-tree-setup.nas +++ b/Nasal/Libraries/property-tree-setup.nas @@ -148,6 +148,13 @@ var Instrumentation = { pnlModeNum: [props.globals.initNode("/instrumentation/efis[0]/mfd/pnl_mode-num", 2, "INT"), props.globals.initNode("/instrumentation/efis[1]/mfd/pnl_mode-num", 2, "INT")], }, }, + MKVII: { + Inputs: { + Discretes: { + flap3Override: props.globals.getNode("/instrumentation/mk-viii/inputs/discretes/momentary-flap3-override"), + }, + }, + }, Nav: { 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/F-PLN.nas b/Nasal/MCDU/F-PLN.nas index 19f4d5c5..fb7f6d68 100644 --- a/Nasal/MCDU/F-PLN.nas +++ b/Nasal/MCDU/F-PLN.nas @@ -436,9 +436,9 @@ var fplnPage = { # this one is only created once, and then updated - remember th if (fmgc.flightPlanController.temporaryFlag[me.computer]) { fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 0); # push update to fuel - if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 0); - setprop("/FMGC/internal/fuel-calculating", 1); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.FMGCInternal.fuelCalculating = 1; } } else { if (canvas_mcdu.myLatRev[me.computer] != nil) { @@ -477,9 +477,9 @@ var fplnPage = { # this one is only created once, and then updated - remember th if (dirToFlag) { dirToFlag = 0; } fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 1); # push update to fuel - if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 0); - setprop("/FMGC/internal/fuel-calculating", 1); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.FMGCInternal.fuelCalculating = 1; } } else { mcdu_message(me.computer, "NOT ALLOWED"); diff --git a/Nasal/MCDU/FUELPRED.nas b/Nasal/MCDU/FUELPRED.nas index 59646a87..1749ce32 100644 --- a/Nasal/MCDU/FUELPRED.nas +++ b/Nasal/MCDU/FUELPRED.nas @@ -5,13 +5,13 @@ # From INIT-B var fuelPredInput = func(key, i) { var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad; - if (key == "L3" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) { + if (key == "L3" and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating) { if (scratchpad == "CLR") { fmgc.FMGCInternal.rteRsv = 0.05 * fmgc.FMGCInternal.tripFuel; fmgc.FMGCInternal.rteRsvSet = 0; fmgc.FMGCInternal.rtePercent = 5.0; fmgc.FMGCInternal.rtePercentSet = 0; - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelCalculating = 1; mcdu_scratchpad.scratchpads[i].empty(); } else if (fmgc.FMGCInternal.tripFuel != 0) { var tf = num(scratchpad); @@ -23,7 +23,7 @@ var fuelPredInput = func(key, i) { fmgc.FMGCInternal.rteRsvSet = 0; fmgc.FMGCInternal.rtePercent = perc; fmgc.FMGCInternal.rtePercentSet = 1; - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelCalculating = 1; mcdu_scratchpad.scratchpads[i].empty(); } } else if (tfs >= 1 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 21.7) { @@ -35,7 +35,7 @@ var fuelPredInput = func(key, i) { fmgc.FMGCInternal.rtePercent = 15.0; # need reasearch on this value } fmgc.FMGCInternal.rtePercentSet = 0; - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelCalculating = 1; mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); @@ -43,12 +43,12 @@ var fuelPredInput = func(key, i) { } else { mcdu_message(i, "NOT ALLOWED"); } - } else if (key == "L4" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating") and fmgc.FMGCInternal.altAirportSet) { + } else if (key == "L4" and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating and fmgc.FMGCInternal.altAirportSet) { if (scratchpad == "CLR") { fmgc.FMGCInternal.altFuel = 0.0; fmgc.FMGCInternal.altTime = "0000"; fmgc.FMGCInternal.altFuelSet = 0; - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelCalculating = 1; mcdu_scratchpad.scratchpads[i].empty(); } else if (find(".", scratchpad) != -1) { var tf = num(scratchpad); @@ -57,7 +57,7 @@ var fuelPredInput = func(key, i) { fmgc.FMGCInternal.altFuel = tf; fmgc.FMGCInternal.altTime = "0000"; fmgc.FMGCInternal.altFuelSet = 1; - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelCalculating = 1; mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); @@ -65,13 +65,13 @@ var fuelPredInput = func(key, i) { } else { mcdu_message(i, "NOT ALLOWED"); } - } else if (key == "L5" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) { + } else if (key == "L5" and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating) { if (scratchpad == "CLR") { fmgc.FMGCInternal.finalFuel = 0.0; fmgc.FMGCInternal.finalTime = "0030"; fmgc.FMGCInternal.finalFuelSet = 0; fmgc.FMGCInternal.finalTimeSet = 0; - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelCalculating = 1; mcdu_scratchpad.scratchpads[i].empty(); } else if (find(".", scratchpad) != -1) { var tf = num(scratchpad); @@ -79,7 +79,7 @@ var fuelPredInput = func(key, i) { if (tfs >= 3 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 10.0) { fmgc.FMGCInternal.finalFuel = tf; fmgc.FMGCInternal.finalFuelSet = 1; - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelCalculating = 1; mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); @@ -90,17 +90,17 @@ var fuelPredInput = func(key, i) { if (tfs == 4 and tf != nil and ((tf >= 0 and tf <= 59) or (tf >= 100 and tf <= 130))) { fmgc.FMGCInternal.finalTime = scratchpad; fmgc.FMGCInternal.finalTimeSet = 1; - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelCalculating = 1; mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); } } - } else if (key == "L6" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) { + } else if (key == "L6" and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating) { if (scratchpad == "CLR") { fmgc.FMGCInternal.minDestFob = 0; fmgc.FMGCInternal.minDestFobSet = 0; - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelCalculating = 1; mcdu_scratchpad.scratchpads[i].empty(); } else if (find(".", scratchpad) != -1) { var tf = num(scratchpad); @@ -108,7 +108,7 @@ var fuelPredInput = func(key, i) { if (tfs >= 3 and tfs <= 5 and tf != nil and tf >= 0 and tf <= 80.0) { fmgc.FMGCInternal.minDestFob = tf; fmgc.FMGCInternal.minDestFobSet = 1; - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelCalculating = 1; mcdu_scratchpad.scratchpads[i].empty(); if (fmgc.FMGCInternal.minDestFob < fmgc.FMGCInternal.finalFuel + fmgc.FMGCInternal.altFuel) { mcdu_message(i, "CHECK MIN DEST FOB"); @@ -119,26 +119,26 @@ var fuelPredInput = func(key, i) { } else { mcdu_message(i, "NOT ALLOWED"); } - } else if (key == "R3" and !getprop("/FMGC/internal/fuel-calculating")) { + } else if (key == "R3" and !fmgc.FMGCInternal.fuelCalculating) { if (scratchpad == "CLR") { mcdu_message(i, "NOT ALLOWED"); } else { var zfw_min = 80.6; #make based on performance var zfw_max = 134.5; #61,000 kg, make based on performance if (size(scratchpad) == 0) { - var zfw = getprop("/fdm/jsbsim/inertia/weight-lbs") - getprop("/consumables/fuel/total-fuel-lbs"); + var zfw = pts.Fdm.JSBsim.Inertia.weightLbs.getValue() - pts.Consumables.Fuel.totalFuelLbs.getValue(); fmgc.FMGCInternal.zfw = sprintf("%3.1f", math.round(zfw / 1000, 0.1)); fmgc.FMGCInternal.zfwSet = 1; if (fmgc.FMGCInternal.blockSet != 1) { - fmgc.FMGCInternal.block = getprop("consumables/fuel/total-fuel-lbs") / 1000; + fmgc.FMGCInternal.block = pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000; fmgc.FMGCInternal.blockSet = 1; fmgc.FMGCInternal.tow = fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel; - setprop("/FMGC/internal/fuel-request-set", 1); - setprop("/FMGC/internal/fuel-calculating", 1); - setprop("/FMGC/internal/block-calculating", 0); - setprop("/FMGC/internal/block-confirmed", 1); - } else if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelRequest = 1; + fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.FMGCInternal.blockCalculating = 0; + fmgc.FMGCInternal.blockConfirmed = 1; + } else if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 1; } mcdu_scratchpad.scratchpads[i].empty(); } else if (find("/", scratchpad) != -1) { @@ -154,15 +154,15 @@ var fuelPredInput = func(key, i) { fmgc.FMGCInternal.zfwcg = zfwcg; fmgc.FMGCInternal.zfwcgSet = 1; if (fmgc.FMGCInternal.blockSet != 1) { - fmgc.FMGCInternal.block = getprop("consumables/fuel/total-fuel-lbs") / 1000; + fmgc.FMGCInternal.block = pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000; fmgc.FMGCInternal.blockSet = 1; fmgc.FMGCInternal.tow = fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel; - setprop("/FMGC/internal/fuel-request-set", 1); - setprop("/FMGC/internal/fuel-calculating", 1); - setprop("/FMGC/internal/block-calculating", 0); - setprop("/FMGC/internal/block-confirmed", 1); - } else if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelRequest = 1; + fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.FMGCInternal.blockCalculating = 0; + fmgc.FMGCInternal.blockConfirmed = 1; + } else if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 1; } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -184,15 +184,15 @@ var fuelPredInput = func(key, i) { fmgc.FMGCInternal.zfw = scratchpad; fmgc.FMGCInternal.zfwSet = 1; if (fmgc.FMGCInternal.blockSet != 1) { - fmgc.FMGCInternal.block = getprop("consumables/fuel/total-fuel-lbs") / 1000; + fmgc.FMGCInternal.block = pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000; fmgc.FMGCInternal.blockSet = 1; fmgc.FMGCInternal.tow = fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel; - setprop("/FMGC/internal/fuel-request-set", 1); - setprop("/FMGC/internal/fuel-calculating", 1); - setprop("/FMGC/internal/block-calculating", 0); - setprop("/FMGC/internal/block-confirmed", 1); - } else if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelRequest = 1; + fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.FMGCInternal.blockCalculating = 0; + fmgc.FMGCInternal.blockConfirmed = 1; + } else if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 1; } mcdu_scratchpad.scratchpads[i].empty(); } else { diff --git a/Nasal/MCDU/INITA.nas b/Nasal/MCDU/INITA.nas index 3fffc6f9..b47f4d08 100644 --- a/Nasal/MCDU/INITA.nas +++ b/Nasal/MCDU/INITA.nas @@ -10,9 +10,9 @@ var initInputA = func(key, i) { fmgc.FMGCInternal.altAirport = ""; fmgc.FMGCInternal.altAirportSet = 0; fmgc.windController.updatePlans(); - if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 0); - setprop("/FMGC/internal/fuel-calculating", 1); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.FMGCInternal.fuelCalculating = 1; } mcdu_scratchpad.scratchpads[i].empty(); fmgc.updateARPT(); @@ -26,9 +26,9 @@ var initInputA = func(key, i) { fmgc.FMGCInternal.altAirport = scratchpad; fmgc.FMGCInternal.altAirportSet = 1; fmgc.windController.updatePlans(); - if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 0); - setprop("/FMGC/internal/fuel-calculating", 1); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.FMGCInternal.fuelCalculating = 1; } mcdu_scratchpad.scratchpads[i].empty(); fmgc.updateARPT(); @@ -90,9 +90,9 @@ var initInputA = func(key, i) { updateCrzLvlCallback(); fmgc.FMGCInternal.crzTemp = 15; fmgc.FMGCInternal.crzTempSet = 0; - if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 0); - setprop("/FMGC/internal/fuel-calculating", 1); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.FMGCInternal.fuelCalculating = 1; } mcdu_scratchpad.scratchpads[i].empty(); } else if (find("/", scratchpad) != -1) { @@ -110,9 +110,9 @@ var initInputA = func(key, i) { if (temp >= -99 and temp <= 99) { fmgc.FMGCInternal.crzTemp = temp; fmgc.FMGCInternal.crzTempSet = 1; - if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 0); - setprop("/FMGC/internal/fuel-calculating", 1); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.FMGCInternal.fuelCalculating = 1; } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -129,9 +129,9 @@ var initInputA = func(key, i) { fmgc.FMGCInternal.crzTemp = temp; fmgc.FMGCInternal.crzTempSet = 1; fmgc.FMGCInternal.crzProg = crz; - if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 0); - setprop("/FMGC/internal/fuel-calculating", 1); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.FMGCInternal.fuelCalculating = 1; } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -157,9 +157,9 @@ var initInputA = func(key, i) { fmgc.FMGCInternal.crzSet = 1; updateCrzLvlCallback(); fmgc.FMGCInternal.crzProg = crz; - if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 0); - setprop("/FMGC/internal/fuel-calculating", 1); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.FMGCInternal.fuelCalculating = 1; } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -180,9 +180,9 @@ var initInputA = func(key, i) { setprop("/FMGC/internal/align-ref-long", 0); setprop("/FMGC/internal/align-ref-lat-edit", 0); setprop("/FMGC/internal/align-ref-long-edit", 0); - if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 0); - setprop("/FMGC/internal/fuel-calculating", 1); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.FMGCInternal.fuelCalculating = 1; } fmgc.flightPlanController.reset(2); fmgc.flightPlanController.init(); @@ -224,7 +224,7 @@ var initInputA = func(key, i) { } } } else if (key == "R2") { - if (getprop("engines/engine[0]/state") != 3 and getprop("engines/engine[1]/state") != 3) { + if (pts.Engines.Engine.state[0].getValue() != 3 and pts.Engines.Engine.state[1].getValue() != 3) { if (!ecam.vhf3_voice.active) { if (atsu.ATSU.working) { if (getprop("/FMGC/simbrief-username") == "") { diff --git a/Nasal/MCDU/INITB.nas b/Nasal/MCDU/INITB.nas index 1694d1f4..8b75ec65 100644 --- a/Nasal/MCDU/INITB.nas +++ b/Nasal/MCDU/INITB.nas @@ -4,14 +4,14 @@ var initInputB = func(key, i) { var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad; - if (key == "L1" and !getprop("/FMGC/internal/fuel-calculating")) { + if (key == "L1" and !fmgc.FMGCInternal.fuelCalculating) { if (scratchpad == "CLR") { fmgc.FMGCInternal.taxiFuel = 0.4; fmgc.FMGCInternal.taxiFuelSet = 0; - if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 1); - } else if (getprop("/FMGC/internal/fuel-request-set")) { - setprop("/FMGC/internal/block-calculating", 1); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 1; + } else if (fmgc.FMGCInternal.fuelRequest) { + fmgc.FMGCInternal.blockCalculating = 1; } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -20,10 +20,10 @@ var initInputB = func(key, i) { if (num(scratchpad) != nil and scratchpad >= 0.0 and scratchpad <= 9.9) { fmgc.FMGCInternal.taxiFuel = scratchpad; fmgc.FMGCInternal.taxiFuelSet = 1; - if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 1); - } else if (getprop("/FMGC/internal/fuel-request-set")) { - setprop("/FMGC/internal/block-calculating", 1); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 1; + } else if (fmgc.FMGCInternal.fuelRequest) { + fmgc.FMGCInternal.blockCalculating = 1; } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -33,13 +33,13 @@ var initInputB = func(key, i) { mcdu_message(i, "NOT ALLOWED"); } } - } else if (key == "L3" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) { + } else if (key == "L3" and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating) { if (scratchpad == "CLR") { fmgc.FMGCInternal.rteRsv = 0.05 * fmgc.FMGCInternal.tripFuel; fmgc.FMGCInternal.rteRsvSet = 0; fmgc.FMGCInternal.rtePercent = 5.0; fmgc.FMGCInternal.rtePercentSet = 0; - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelCalculating = 1; mcdu_scratchpad.scratchpads[i].empty(); } else if (fmgc.FMGCInternal.tripFuel != 0) { var tf = num(scratchpad); @@ -51,7 +51,7 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.rteRsvSet = 0; fmgc.FMGCInternal.rtePercent = perc; fmgc.FMGCInternal.rtePercentSet = 1; - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelCalculating = 1; mcdu_scratchpad.scratchpads[i].empty(); } } else if (tfs >= 1 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 21.7) { @@ -63,7 +63,7 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.rtePercent = 15.0; # need reasearch on this value } fmgc.FMGCInternal.rtePercentSet = 0; - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelCalculating = 1; mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); @@ -71,12 +71,12 @@ var initInputB = func(key, i) { } else { mcdu_message(i, "NOT ALLOWED"); } - } else if (key == "L4" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating") and fmgc.FMGCInternal.altAirportSet) { + } else if (key == "L4" and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating and fmgc.FMGCInternal.altAirportSet) { if (scratchpad == "CLR") { fmgc.FMGCInternal.altFuel = 0.0; fmgc.FMGCInternal.altTime = "0000"; fmgc.FMGCInternal.altFuelSet = 0; - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelCalculating = 1; mcdu_scratchpad.scratchpads[i].empty(); } else if (find(".", scratchpad) != -1) { var tf = num(scratchpad); @@ -85,7 +85,7 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.altFuel = tf; fmgc.FMGCInternal.altTime = "0000"; fmgc.FMGCInternal.altFuelSet = 1; - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelCalculating = 1; mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); @@ -93,13 +93,13 @@ var initInputB = func(key, i) { } else { mcdu_message(i, "NOT ALLOWED"); } - } else if (key == "L5" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) { + } else if (key == "L5" and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating) { if (scratchpad == "CLR") { fmgc.FMGCInternal.finalFuel = 0.0; fmgc.FMGCInternal.finalTime = "0030"; fmgc.FMGCInternal.finalFuelSet = 0; fmgc.FMGCInternal.finalTimeSet = 0; - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelCalculating = 1; mcdu_scratchpad.scratchpads[i].empty(); } else if (find(".", scratchpad) != -1) { var tf = num(scratchpad); @@ -107,7 +107,7 @@ var initInputB = func(key, i) { if (tfs >= 3 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 10.0) { fmgc.FMGCInternal.finalFuel = tf; fmgc.FMGCInternal.finalFuelSet = 1; - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelCalculating = 1; mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); @@ -118,17 +118,17 @@ var initInputB = func(key, i) { if (tfs == 4 and tf != nil and ((tf >= 0 and tf <= 59) or (tf >= 100 and tf <= 130))) { fmgc.FMGCInternal.finalTime = scratchpad; fmgc.FMGCInternal.finalTimeSet = 1; - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelCalculating = 1; mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); } } - } else if (key == "L6" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) { + } else if (key == "L6" and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating) { if (scratchpad == "CLR") { fmgc.FMGCInternal.minDestFob = 0; fmgc.FMGCInternal.minDestFobSet = 0; - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelCalculating = 1; mcdu_scratchpad.scratchpads[i].empty(); } else if (find(".", scratchpad) != -1) { var tf = num(scratchpad); @@ -136,7 +136,7 @@ var initInputB = func(key, i) { if (tfs >= 3 and tfs <= 5 and tf != nil and tf >= 0 and tf <= 80.0) { fmgc.FMGCInternal.minDestFob = tf; fmgc.FMGCInternal.minDestFobSet = 1; - setprop("/FMGC/internal/fuel-calculating", 1); + fmgc.FMGCInternal.fuelCalculating = 1; mcdu_scratchpad.scratchpads[i].empty(); if (fmgc.FMGCInternal.minDestFob < fmgc.FMGCInternal.finalFuel + fmgc.FMGCInternal.altFuel) { mcdu_message(i, "CHECK MIN DEST FOB"); @@ -147,26 +147,26 @@ var initInputB = func(key, i) { } else { mcdu_message(i, "NOT ALLOWED"); } - } else if (key == "R1" and !getprop("/FMGC/internal/fuel-calculating")) { + } else if (key == "R1" and !fmgc.FMGCInternal.fuelCalculating) { if (scratchpad == "CLR") { mcdu_message(i, "NOT ALLOWED"); } else { var zfw_min = 80.6; #make based on performance var zfw_max = 134.5; #61,000 kg, make based on performance if (size(scratchpad) == 0) { - var zfw = getprop("/fdm/jsbsim/inertia/weight-lbs") - getprop("/consumables/fuel/total-fuel-lbs"); + var zfw = pts.Fdm.JSBsim.Inertia.weightLbs.getValue() - pts.Consumables.Fuel.totalFuelLbs.getValue(); fmgc.FMGCInternal.zfw = sprintf("%3.1f", math.round(zfw / 1000, 0.1)); fmgc.FMGCInternal.zfwSet = 1; - if (!getprop("/FMGC/internal/block-confirmed") and fmgc.FMGCInternal.blockSet) { + if (!fmgc.FMGCInternal.blockConfirmed and fmgc.FMGCInternal.blockSet) { fmgc.FMGCInternal.tow = fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel; - setprop("/FMGC/internal/fuel-request-set", 1); - setprop("/FMGC/internal/fuel-calculating", 1); - setprop("/FMGC/internal/block-calculating", 0); - setprop("/FMGC/internal/block-confirmed", 1); - } else if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 1); - } else if (getprop("/FMGC/internal/fuel-request-set")) { - setprop("/FMGC/internal/block-calculating", 1); + fmgc.FMGCInternal.fuelRequest = 1; + fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.FMGCInternal.blockCalculating = 0; + fmgc.FMGCInternal.blockConfirmed = 1; + } else if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 1; + } else if (fmgc.FMGCInternal.fuelRequest) { + fmgc.FMGCInternal.blockCalculating = 1; } mcdu_scratchpad.scratchpads[i].empty(); } else if (find("/", scratchpad) != -1) { @@ -181,16 +181,16 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.zfwSet = 1; fmgc.FMGCInternal.zfwcg = zfwcg; fmgc.FMGCInternal.zfwcgSet = 1; - if (!getprop("/FMGC/internal/block-confirmed") and fmgc.FMGCInternal.blockSet) { + if (!fmgc.FMGCInternal.blockConfirmed and fmgc.FMGCInternal.blockSet) { fmgc.FMGCInternal.tow = fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel; - setprop("/FMGC/internal/fuel-request-set", 1); - setprop("/FMGC/internal/fuel-calculating", 1); - setprop("/FMGC/internal/block-calculating", 0); - setprop("/FMGC/internal/block-confirmed", 1); - } else if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 1); - } else if (getprop("/FMGC/internal/fuel-request-set")) { - setprop("/FMGC/internal/block-calculating", 1); + fmgc.FMGCInternal.fuelRequest = 1; + fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.FMGCInternal.blockCalculating = 0; + fmgc.FMGCInternal.blockConfirmed = 1; + } else if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 1; + } else if (fmgc.FMGCInternal.fuelRequest) { + fmgc.FMGCInternal.blockCalculating = 1; } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -211,16 +211,16 @@ var initInputB = func(key, i) { if (scratchpad >= zfw_min and scratchpad <= zfw_max) { fmgc.FMGCInternal.zfw = scratchpad; fmgc.FMGCInternal.zfwSet = 1; - if (!getprop("/FMGC/internal/block-confirmed") and fmgc.FMGCInternal.blockSet) { + if (!fmgc.FMGCInternal.blockConfirmed and fmgc.FMGCInternal.blockSet) { fmgc.FMGCInternal.tow = fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel; - setprop("/FMGC/internal/fuel-request-set", 1); - setprop("/FMGC/internal/fuel-calculating", 1); - setprop("/FMGC/internal/block-calculating", 0); - setprop("/FMGC/internal/block-confirmed", 1); - } else if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 1); - } else if (getprop("/FMGC/internal/fuel-request-set")) { - setprop("/FMGC/internal/block-calculating", 1); + fmgc.FMGCInternal.fuelRequest = 1; + fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.FMGCInternal.blockCalculating = 0; + fmgc.FMGCInternal.blockConfirmed = 1; + } else if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 1; + } else if (fmgc.FMGCInternal.fuelRequest) { + fmgc.FMGCInternal.blockCalculating = 1; } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -237,7 +237,7 @@ var initInputB = func(key, i) { fmgc.FMGCNodes.costIndex.setValue(fmgc.FMGCInternal.costIndex); } } - } else if (key == "R2" and !getprop("/FMGC/internal/fuel-calculating")) { + } else if (key == "R2" and !fmgc.FMGCInternal.fuelCalculating) { if (scratchpad == "CLR") { fmgc.FMGCInternal.block = 0.0; fmgc.FMGCInternal.blockSet = 0; @@ -265,23 +265,23 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.fffqSensor = "FF+FQ"; fmgc.FMGCInternal.extraFuel = 0; fmgc.FMGCInternal.extraTime = "0000"; - setprop("/FMGC/internal/fuel-request-set", 0); - setprop("/FMGC/internal/fuel-calculating", 0); - setprop("/FMGC/internal/block-calculating", 0); - setprop("/FMGC/internal/block-confirmed", 0); + fmgc.FMGCInternal.fuelRequest = 0; + fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.FMGCInternal.blockCalculating = 0; + fmgc.FMGCInternal.blockConfirmed = 0; mcdu_scratchpad.scratchpads[i].empty(); } else { var tfs = size(scratchpad); var maxblock = getprop("/options/maxblock"); if (tfs == 0) { - fmgc.FMGCInternal.block = sprintf("%3.1f", math.round(getprop("/consumables/fuel/total-fuel-lbs") / 1000, 0.1)); + fmgc.FMGCInternal.block = sprintf("%3.1f", math.round(pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000, 0.1)); fmgc.FMGCInternal.blockSet = 1; if (fmgc.FMGCInternal.zfwSet) { fmgc.FMGCInternal.tow = num(fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel); - setprop("/FMGC/internal/fuel-request-set", 1); - setprop("/FMGC/internal/fuel-calculating", 1); - setprop("/FMGC/internal/block-calculating", 0); - setprop("/FMGC/internal/block-confirmed", 1); + fmgc.FMGCInternal.fuelRequest = 1; + fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.FMGCInternal.blockCalculating = 0; + fmgc.FMGCInternal.blockConfirmed = 1; } } else if (tfs >= 1 and tfs <= 5) { if (num(scratchpad) != nil and scratchpad >= 1.0 and scratchpad <= maxblock) { @@ -289,10 +289,10 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.blockSet = 1; if (fmgc.FMGCInternal.zfwSet) { fmgc.FMGCInternal.tow = num(fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel); - setprop("/FMGC/internal/fuel-request-set", 1); - setprop("/FMGC/internal/fuel-calculating", 1); - setprop("/FMGC/internal/block-calculating", 0); - setprop("/FMGC/internal/block-confirmed", 1); + fmgc.FMGCInternal.fuelRequest = 1; + fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.FMGCInternal.blockCalculating = 0; + fmgc.FMGCInternal.blockConfirmed = 1; } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -303,21 +303,21 @@ var initInputB = func(key, i) { } } } else if (key == "R3") { - if (scratchpad == "" and fmgc.FMGCInternal.zfwSet and !getprop("/FMGC/internal/fuel-request-set")) { - setprop("/FMGC/internal/fuel-request-set", 1); - setprop("/FMGC/internal/block-calculating", 1); - } else if (scratchpad == "" and fmgc.FMGCInternal.zfwSet and getprop("/FMGC/internal/fuel-request-set") and !getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/block-calculating")) { - setprop("/FMGC/internal/block-confirmed", 1); - setprop("/FMGC/internal/fuel-calculating", 1); + if (scratchpad == "" and fmgc.FMGCInternal.zfwSet and !fmgc.FMGCInternal.fuelRequest) { + fmgc.FMGCInternal.fuelRequest = 1; + fmgc.FMGCInternal.blockCalculating = 1; + } else if (scratchpad == "" and fmgc.FMGCInternal.zfwSet and fmgc.FMGCInternal.fuelRequest and !fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.blockCalculating) { + fmgc.FMGCInternal.blockConfirmed = 1; + fmgc.FMGCInternal.fuelCalculating = 1; } else { mcdu_message(i, "NOT ALLOWED"); } - } else if (key == "R5" and !getprop("/FMGC/internal/fuel-calculating")) { + } else if (key == "R5" and !fmgc.FMGCInternal.fuelCalculating) { if (scratchpad == "CLR") { fmgc.FMGCInternal.tripWind = "HD000"; fmgc.FMGCInternal.tripWindValue = 0; - if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 1); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 1; } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -326,8 +326,8 @@ var initInputB = func(key, i) { if (int(effwind) != nil and effwind >= 0 and effwind <= 500) { fmgc.FMGCInternal.tripWind = scratchpad; fmgc.FMGCInternal.tripWindValue = effwind; - if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 1); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 1; } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -338,8 +338,8 @@ var initInputB = func(key, i) { if (int(effwind) != nil and effwind >= 0 and effwind <= 500) { fmgc.FMGCInternal.tripWind = scratchpad; fmgc.FMGCInternal.tripWindValue = effwind; - if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 1); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 1; } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -349,8 +349,8 @@ var initInputB = func(key, i) { if (num(scratchpad) != nil and scratchpad >= 0 and scratchpad <= 500) { fmgc.FMGCInternal.tripWind = scratchpad; fmgc.FMGCInternal.tripWindValue = scratchpad; - if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 1); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 1; } mcdu_scratchpad.scratchpads[i].empty(); } else { diff --git a/Nasal/MCDU/MCDU.nas b/Nasal/MCDU/MCDU.nas index 15c3a096..beb00ce8 100644 --- a/Nasal/MCDU/MCDU.nas +++ b/Nasal/MCDU/MCDU.nas @@ -3,6 +3,9 @@ # Copyright (c) 2020 Josh Davidson (Octal450) # Copyright (c) 2020 Matthew Maring (mattmaring) +var pageNode = [props.globals.getNode("/MCDU[0]/page"), props.globals.getNode("/MCDU[1]/page")]; +var page = nil; + var scratchpadNode = [nil, nil]; var MCDU_init = func(i) { MCDU_reset(i); @@ -14,7 +17,7 @@ var MCDU_reset = func(i) { setprop("it-autoflight/settings/togaspd", 157); #aka v2 clone setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", "STATUS"); setprop("/MCDU[" ~ i ~ "]/last-atsu-page", "ATSUDLINK"); - setprop("/MCDU[" ~ i ~ "]/page", "MCDU"); + pageNode[i].setValue("MCDU"); setprop("/FMGC/keyboard-left", 0); setprop("/FMGC/keyboard-right", 0); @@ -122,10 +125,10 @@ var MCDU_reset = func(i) { fmgc.FMGCInternal.fffqSensor = "FF+FQ"; fmgc.FMGCInternal.extraFuel = 0; fmgc.FMGCInternal.extraTime = "0000"; - setprop("/FMGC/internal/fuel-request-set", 0); - setprop("/FMGC/internal/block-calculating", 0); - setprop("/FMGC/internal/block-confirmed", 0); - setprop("/FMGC/internal/fuel-calculating", 0); + fmgc.FMGCInternal.fuelRequest = 0; + fmgc.FMGCInternal.blockCalculating = 0; + fmgc.FMGCInternal.blockConfirmed = 0; + fmgc.FMGCInternal.fuelCalculating = 0; # FUELPRED fmgc.FMGCInternal.priUtc = "0000"; @@ -197,8 +200,9 @@ var setMode = func(will) { } var lskbutton = func(btn, i) { + page = pageNode[i].getValue(); if (btn == "1") { - if (getprop("/MCDU[" ~ i ~ "]/page") == "MCDU") { + if (page == "MCDU") { if (getprop("/MCDU[" ~ i ~ "]/atsu-active") == 1) { mcdu_message(i, "NOT ALLOWED"); } else { @@ -206,84 +210,84 @@ var lskbutton = func(btn, i) { mcdu_message(i, "WAIT FOR SYSTEM RESPONSE"); setprop("/MCDU[" ~ i ~ "]/active", 1); settimer(func(){ - setprop("/MCDU[" ~ i ~ "]/page", getprop("/MCDU[" ~ i ~ "]/last-fmgc-page")); + pageNode[i].setValue(getprop("/MCDU[" ~ i ~ "]/last-fmgc-page")); mcdu_scratchpad.scratchpads[i].empty(); setprop("/MCDU[" ~ i ~ "]/active", 2); }, 2); } else { - setprop("/MCDU[" ~ i ~ "]/page", getprop("/MCDU[" ~ i ~ "]/last-fmgc-page")); + pageNode[i].setValue(getprop("/MCDU[" ~ i ~ "]/last-fmgc-page")); mcdu_scratchpad.scratchpads[i].empty(); } } - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "IRSINIT") { + } else if (page == "IRSINIT") { initInputIRS("L1",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB") { + } else if (page == "INITB") { initInputB("L1",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") { + } else if (page == "WINDCLB") { canvas_mcdu.myCLBWIND[i].pushButtonLeft(1); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") { + } else if (page == "WINDCRZ") { canvas_mcdu.myCRZWIND[i].pushButtonLeft(1); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") { + } else if (page == "WINDDES") { canvas_mcdu.myDESWIND[i].pushButtonLeft(1); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PROGTO") { + } else if (page == "PROGTO") { progTOInput("L1",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PROGCLB") { + } else if (page == "PROGCLB") { progCLBInput("L1",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PROGCRZ") { + } else if (page == "PROGCRZ") { progCRZInput("L1",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PROGDES") { + } else if (page == "PROGDES") { progDESInput("L1",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFTO") { + } else if (page == "PERFTO") { perfTOInput("L1",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") { + } else if (page == "PERFAPPR") { perfAPPRInput("L1",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") { + } else if (page == "RADNAV") { radnavInput("L1",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA") { + } else if (page == "DATA") { dataInput("L1",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") { + } else if (page == "PRINTFUNC") { printInput("L1",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") { + } else if (page == "PRINTFUNC2") { printInput2("L1",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "LATREV") { + } else if (page == "LATREV") { if (canvas_mcdu.myLatRev[i].type == 0) { if (canvas_mcdu.myDeparture[i] != nil) { canvas_mcdu.myDeparture[i].del(); } canvas_mcdu.myDeparture[i] = nil; canvas_mcdu.myDeparture[i] = departurePage.new(canvas_mcdu.myLatRev[i].title[2], i); - setprop("/MCDU[" ~ i ~ "]/page", "DEPARTURE"); + pageNode[i].setValue("DEPARTURE"); } else { mcdu_message(i, "NOT ALLOWED"); } - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") { + } else if (page == "F-PLNA" or page == "F-PLNB") { canvas_mcdu.myFpln[i].pushButtonLeft(1); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DIRTO") { + } else if (page == "DIRTO") { canvas_mcdu.myDirTo[i].fieldL1(mcdu_scratchpad.scratchpads[i].scratchpad); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") { + } else if (page == "DUPLICATENAMES") { canvas_mcdu.myDuplicate[i].pushButtonLeft(1); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATSUDLINK") { - setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMMMENU") { - setprop("/MCDU[" ~ i ~ "]/page", "COMMINIT"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMPANYCALL") { + } else if (page == "ATSUDLINK") { + pageNode[i].setValue("ATCMENU"); + } else if (page == "COMMMENU") { + pageNode[i].setValue("COMMINIT"); + } else if (page == "COMPANYCALL") { if (atsu.CompanyCall.frequency != 999.99) { atsu.CompanyCall.tune(); } else { mcdu_message(i, "NOT ALLOWED"); } - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WEATHERREQ") { - setprop("/MCDU[" ~ i ~ "]/page", "WEATHERTYPE"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WEATHERTYPE") { + } else if (page == "WEATHERREQ") { + pageNode[i].setValue("WEATHERTYPE"); + } else if (page == "WEATHERTYPE") { atsu.AOC.selectedType = "HOURLY WX"; - setprop("/MCDU[" ~ i ~ "]/page", "WEATHERREQ"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "RECEIVEDMSGS") { + pageNode[i].setValue("WEATHERREQ"); + } else if (page == "RECEIVEDMSGS") { canvas_mcdu.myReceivedMessages[i].leftKey(1); } else { mcdu_message(i, "NOT ALLOWED"); } } else if (btn == "2") { - if (getprop("/MCDU[" ~ i ~ "]/page") == "MCDU") { + if (page == "MCDU") { if (getprop("/MCDU[" ~ i ~ "]/active") == 1) { mcdu_message(i, "NOT ALLOWED"); } else { @@ -291,52 +295,52 @@ var lskbutton = func(btn, i) { mcdu_message(i, "WAIT FOR SYSTEM RESPONSE"); setprop("/MCDU[" ~ i ~ "]/atsu-active", 1); settimer(func(){ - setprop("/MCDU[" ~ i ~ "]/page", getprop("/MCDU[" ~ i ~ "]/last-atsu-page")); + pageNode[i].setValue(getprop("/MCDU[" ~ i ~ "]/last-atsu-page")); mcdu_scratchpad.scratchpads[i].empty(); setprop("/MCDU[" ~ i ~ "]/atsu-active", 2); }, 2); } else { - setprop("/MCDU[" ~ i ~ "]/page", getprop("/MCDU[" ~ i ~ "]/last-atsu-page")); + pageNode[i].setValue(getprop("/MCDU[" ~ i ~ "]/last-atsu-page")); mcdu_scratchpad.scratchpads[i].empty(); } } - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") { + } else if (page == "INITA") { initInputA("L2",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") { + } else if (page == "WINDCLB") { canvas_mcdu.myCLBWIND[i].pushButtonLeft(2); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") { + } else if (page == "WINDCRZ") { canvas_mcdu.myCRZWIND[i].pushButtonLeft(2); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") { + } else if (page == "WINDDES") { canvas_mcdu.myDESWIND[i].pushButtonLeft(2); - } else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFTO") { + } else if (page == "PERFTO") { perfTOInput("L2",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") { + } else if (page == "PERFAPPR") { perfAPPRInput("L2",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") { + } else if (page == "RADNAV") { radnavInput("L2",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFCLB") { + } else if (page == "PERFCLB") { perfCLBInput("L2",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFCRZ") { + } else if (page == "PERFCRZ") { perfCRZInput("L2",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFDES") { + } else if (page == "PERFDES") { perfDESInput("L2",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA") { + } else if (page == "DATA") { dataInput("L2",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") { + } else if (page == "PRINTFUNC") { printInput("L2",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") { + } else if (page == "PRINTFUNC2") { printInput2("L2",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") { + } else if (page == "F-PLNA" or page == "F-PLNB") { canvas_mcdu.myFpln[i].pushButtonLeft(2); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") { + } else if (page == "DEPARTURE") { canvas_mcdu.myDeparture[i].depPushbuttonLeft(2); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") { + } else if (page == "ARRIVAL") { canvas_mcdu.myArrival[i].arrPushbuttonLeft(2); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DIRTO") { + } else if (page == "DIRTO") { canvas_mcdu.myDirTo[i].leftFieldBtn(2); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") { + } else if (page == "DUPLICATENAMES") { canvas_mcdu.myDuplicate[i].pushButtonLeft(2); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "NOTIFICATION") { + } else if (page == "NOTIFICATION") { var result = atsu.notificationSystem.inputAirport(mcdu_scratchpad.scratchpads[i].scratchpad); if (result == 1) { mcdu_message(i, "NOT ALLOWED"); @@ -345,236 +349,236 @@ var lskbutton = func(btn, i) { } else { mcdu_scratchpad.scratchpads[i].empty(); } - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMMMENU") { - setprop("/MCDU[" ~ i ~ "]/page", "DATAMODE"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "RECEIVEDMSGS") { + } else if (page == "COMMMENU") { + pageNode[i].setValue("DATAMODE"); + } else if (page == "RECEIVEDMSGS") { canvas_mcdu.myReceivedMessages[i].leftKey(2); } else { mcdu_message(i, "NOT ALLOWED"); } } else if (btn == "3") { - if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") { + if (page == "INITA") { initInputA("L3",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB") { + } else if (page == "INITB") { initInputB("L3",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "FUELPRED") { + } else if (page == "FUELPRED") { fuelPredInput("L3",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") { + } else if (page == "WINDCLB") { canvas_mcdu.myCLBWIND[i].pushButtonLeft(3); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") { + } else if (page == "WINDCRZ") { canvas_mcdu.myCRZWIND[i].pushButtonLeft(3); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") { + } else if (page == "WINDDES") { canvas_mcdu.myDESWIND[i].pushButtonLeft(3); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFTO") { + } else if (page == "PERFTO") { perfTOInput("L3",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") { + } else if (page == "PERFAPPR") { perfAPPRInput("L3",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "STATUS") { + } else if (page == "STATUS") { statusInput("L3",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") { + } else if (page == "RADNAV") { radnavInput("L3",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") { + } else if (page == "PRINTFUNC") { printInput("L3",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") { + } else if (page == "PRINTFUNC2") { printInput2("L3",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") { + } else if (page == "F-PLNA" or page == "F-PLNB") { canvas_mcdu.myFpln[i].pushButtonLeft(3); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") { + } else if (page == "DEPARTURE") { canvas_mcdu.myDeparture[i].depPushbuttonLeft(3); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") { + } else if (page == "ARRIVAL") { canvas_mcdu.myArrival[i].arrPushbuttonLeft(3); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DIRTO") { + } else if (page == "DIRTO") { canvas_mcdu.myDirTo[i].leftFieldBtn(3); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "LATREV") { + } else if (page == "LATREV") { if (canvas_mcdu.myLatRev[i].type != 0 and canvas_mcdu.myLatRev[i].type != 1) { if (canvas_mcdu.myHold[i] != nil) { canvas_mcdu.myHold[i].del(); } canvas_mcdu.myHold[i] = nil; canvas_mcdu.myHold[i] = holdPage.new(i, canvas_mcdu.myLatRev[i].wpt); - setprop("/MCDU[" ~ i ~ "]/page", "HOLD"); + pageNode[i].setValue("HOLD"); } else { mcdu_message(i, "NOT ALLOWED"); } - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") { + } else if (page == "DUPLICATENAMES") { canvas_mcdu.myDuplicate[i].pushButtonLeft(3); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMMMENU") { - setprop("/MCDU[" ~ i ~ "]/page", "VOICEDIRECTORY"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "RECEIVEDMSGS") { + } else if (page == "COMMMENU") { + pageNode[i].setValue("VOICEDIRECTORY"); + } else if (page == "RECEIVEDMSGS") { canvas_mcdu.myReceivedMessages[i].leftKey(3); } else { mcdu_message(i, "NOT ALLOWED"); } } else if (btn == "4") { - if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA") { - setprop("/MCDU[" ~ i ~ "]/page", "STATUS"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB") { + if (page == "DATA") { + pageNode[i].setValue("STATUS"); + } else if (page == "INITB") { initInputB("L4",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "FUELPRED") { + } else if (page == "FUELPRED") { fuelPredInput("L4",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") { + } else if (page == "WINDCLB") { canvas_mcdu.myCLBWIND[i].pushButtonLeft(4); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") { + } else if (page == "WINDCRZ") { canvas_mcdu.myCRZWIND[i].pushButtonLeft(4); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") { + } else if (page == "WINDDES") { canvas_mcdu.myDESWIND[i].pushButtonLeft(4); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFTO") { + } else if (page == "PERFTO") { perfTOInput("L4",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") { + } else if (page == "PERFAPPR") { perfAPPRInput("L4",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") { + } else if (page == "RADNAV") { radnavInput("L4",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") { + } else if (page == "PRINTFUNC2") { printInput2("L4",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") { + } else if (page == "F-PLNA" or page == "F-PLNB") { canvas_mcdu.myFpln[i].pushButtonLeft(4); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") { + } else if (page == "DEPARTURE") { canvas_mcdu.myDeparture[i].depPushbuttonLeft(4); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") { + } else if (page == "ARRIVAL") { canvas_mcdu.myArrival[i].arrPushbuttonLeft(4); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DIRTO") { + } else if (page == "DIRTO") { canvas_mcdu.myDirTo[i].leftFieldBtn(4); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") { + } else if (page == "DUPLICATENAMES") { canvas_mcdu.myDuplicate[i].pushButtonLeft(4); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "CONNECTSTATUS") { + } else if (page == "CONNECTSTATUS") { if (atsu.ADS.state != 0) { atsu.ADS.setState(0); } else { atsu.ADS.setState(1); } - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "VOICEDIRECTORY") { + } else if (page == "VOICEDIRECTORY") { if (atsu.CompanyCall.frequency != 999.99) { atsu.CompanyCall.tune(); } else { mcdu_message(i, "NOT ALLOWED"); } - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "RECEIVEDMSGS") { + } else if (page == "RECEIVEDMSGS") { canvas_mcdu.myReceivedMessages[i].leftKey(4); } else { mcdu_message(i, "NOT ALLOWED"); } } else if (btn == "5") { - if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") { + if (page == "INITA") { initInputA("L5",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB") { + } else if (page == "INITB") { initInputB("L5",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "FUELPRED") { + } else if (page == "FUELPRED") { fuelPredInput("L5",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") { + } else if (page == "WINDCLB") { canvas_mcdu.myCLBWIND[i].pushButtonLeft(5); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") { + } else if (page == "WINDCRZ") { canvas_mcdu.myCRZWIND[i].pushButtonLeft(5); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") { + } else if (page == "WINDDES") { canvas_mcdu.myDESWIND[i].pushButtonLeft(5); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFTO") { + } else if (page == "PERFTO") { perfTOInput("L5",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFCLB") { + } else if (page == "PERFCLB") { perfCLBInput("L5",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFCRZ") { + } else if (page == "PERFCRZ") { perfCRZInput("L5",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFDES") { + } else if (page == "PERFDES") { perfDESInput("L5",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") { + } else if (page == "PERFAPPR") { perfAPPRInput("L5",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFGA") { + } else if (page == "PERFGA") { perfGAInput("L5",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") { + } else if (page == "RADNAV") { radnavInput("L5",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") { + } else if (page == "PRINTFUNC") { printInput("L5",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") { + } else if (page == "PRINTFUNC2") { printInput2("L5",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA") { + } else if (page == "DATA") { dataInput("L5",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA2") { + } else if (page == "DATA2") { data2Input("L5",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") { + } else if (page == "F-PLNA" or page == "F-PLNB") { canvas_mcdu.myFpln[i].pushButtonLeft(5); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") { + } else if (page == "DEPARTURE") { canvas_mcdu.myDeparture[i].depPushbuttonLeft(5); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") { + } else if (page == "ARRIVAL") { canvas_mcdu.myArrival[i].arrPushbuttonLeft(5); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "VERTREV") { + } else if (page == "VERTREV") { canvas_mcdu.myVertRev[i].pushButtonLeft(5); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DIRTO") { + } else if (page == "DIRTO") { canvas_mcdu.myDirTo[i].leftFieldBtn(5); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") { + } else if (page == "DUPLICATENAMES") { canvas_mcdu.myDuplicate[i].pushButtonLeft(5); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "CLOSESTAIRPORT") { + } else if (page == "CLOSESTAIRPORT") { canvas_mcdu.myClosestAirport[i].manAirportCall(mcdu_scratchpad.scratchpads[i].scratchpad); mcdu_scratchpad.scratchpads[i].empty(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU") { - setprop("/MCDU[" ~ i ~ "]/page", "NOTIFICATION"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "RECEIVEDMSGS") { + } else if (page == "ATCMENU") { + pageNode[i].setValue("NOTIFICATION"); + } else if (page == "RECEIVEDMSGS") { canvas_mcdu.myReceivedMessages[i].leftKey(5); } else { mcdu_message(i, "NOT ALLOWED"); } } else if (btn == "6") { - if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") { + if (page == "INITA") { initInputA("L6",i); - } else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") { + } else if (page == "INITB") { initInputB("L6",i); - } else if (getprop("MCDU[" ~ i ~ "]/page") == "FUELPRED") { + } else if (page == "FUELPRED") { fuelPredInput("L6",i); - } else if (getprop("MCDU[" ~ i ~ "]/page") == "IRSINIT") { + } else if (page == "IRSINIT") { initInputIRS("L6",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") { + } else if (page == "WINDCLB") { canvas_mcdu.myCLBWIND[i].pushButtonLeft(6); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") { + } else if (page == "WINDCRZ") { canvas_mcdu.myCRZWIND[i].pushButtonLeft(6); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") { + } else if (page == "WINDDES") { canvas_mcdu.myDESWIND[i].pushButtonLeft(6); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDHIST") { + } else if (page == "WINDHIST") { if (canvas_mcdu.myCLBWIND[i] == nil) { canvas_mcdu.myCLBWIND[i] = windCLBPage.new(i); } else { canvas_mcdu.myCLBWIND[i].reload(); } - setprop("MCDU[" ~ i ~ "]/page", "WINDCLB"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ROUTESELECTION") { + pageNode[i].setValue("WINDCLB"); + } else if (page == "ROUTESELECTION") { initInputROUTESEL("L6",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFCLB") { + } else if (page == "PERFCLB") { perfCLBInput("L6",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFCRZ") { + } else if (page == "PERFCRZ") { perfCRZInput("L6",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFDES") { + } else if (page == "PERFDES") { perfDESInput("L6",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") { + } else if (page == "PERFAPPR") { perfAPPRInput("L6",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFGA") { + } else if (page == "PERFGA") { perfGAInput("L6",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") { + } else if (page == "PRINTFUNC2") { printInput2("L6",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") { + } else if (page == "F-PLNA" or page == "F-PLNB") { canvas_mcdu.myFpln[i].pushButtonLeft(6); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "LATREV" or getprop("/MCDU[" ~ i ~ "]/page") == "VERTREV" or getprop("/MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") { - setprop("/MCDU[" ~ i ~ "]/page", "F-PLNA"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") { + } else if (page == "LATREV" or page == "VERTREV" or page == "DUPLICATENAMES") { + pageNode[i].setValue("F-PLNA"); + } else if (page == "ARRIVAL") { canvas_mcdu.myArrival[i].arrPushbuttonLeft(6); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE" or getprop("/MCDU[" ~ i ~ "]/page") == "HOLD" or getprop("/MCDU[" ~ i ~ "]/page") == "AIRWAYS") { + } else if (page == "DEPARTURE" or page == "HOLD" or page == "AIRWAYS") { if (fmgc.flightPlanController.temporaryFlag[i]) { - setprop("/MCDU[" ~ i ~ "]/page", "F-PLNA"); + pageNode[i].setValue("F-PLNA"); } else { - setprop("/MCDU[" ~ i ~ "]/page", "LATREV"); + pageNode[i].setValue("LATREV"); } - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DIRTO") { + } else if (page == "DIRTO") { canvas_mcdu.myDirTo[i].fieldL6(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "CLOSESTAIRPORT") { + } else if (page == "CLOSESTAIRPORT") { canvas_mcdu.myClosestAirport[i].freeze(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "AOCMENU" or getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU" or getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU2") { - setprop("/MCDU[" ~ i ~ "]/page", "ATSUDLINK"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "NOTIFICATION" or getprop("/MCDU[" ~ i ~ "]/page") == "CONNECTSTATUS") { - setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WEATHERREQ" or getprop("/MCDU[" ~ i ~ "]/page") == "RECEIVEDMSGS") { - setprop("/MCDU[" ~ i ~ "]/page", "AOCMENU"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "RECEIVEDMSG") { - setprop("/MCDU[" ~ i ~ "]/page", "RECEIVEDMSGS"); + } else if (page == "AOCMENU" or page == "ATCMENU" or page == "ATCMENU2") { + pageNode[i].setValue("ATSUDLINK"); + } else if (page == "NOTIFICATION" or page == "CONNECTSTATUS") { + pageNode[i].setValue("ATCMENU"); + } else if (page == "WEATHERREQ" or page == "RECEIVEDMSGS") { + pageNode[i].setValue("AOCMENU"); + } else if (page == "RECEIVEDMSG") { + pageNode[i].setValue("RECEIVEDMSGS"); canvas_mcdu.myReceivedMessages[i].update(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMMMENU") { - setprop("/MCDU[" ~ i ~ "]/page", "ATSUDLINK"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMMINIT" or getprop("/MCDU[" ~ i ~ "]/page") == "VOICEDIRECTORY" or getprop("/MCDU[" ~ i ~ "]/page") == "DATAMODE" or getprop("/MCDU[" ~ i ~ "]/page") == "COMMSTATUS" or getprop("/MCDU[" ~ i ~ "]/page") == "COMPANYCALL") { - setprop("/MCDU[" ~ i ~ "]/page", "COMMMENU"); + } else if (page == "COMMMENU") { + pageNode[i].setValue("ATSUDLINK"); + } else if (page == "COMMINIT" or page == "VOICEDIRECTORY" or page == "DATAMODE" or page == "COMMSTATUS" or page == "COMPANYCALL") { + pageNode[i].setValue("COMMMENU"); } else { mcdu_message(i, "NOT ALLOWED"); } @@ -582,33 +586,34 @@ var lskbutton = func(btn, i) { } var rskbutton = func(btn, i) { + page = pageNode[i].getValue(); if (btn == "1") { - if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") { + if (page == "INITA") { initInputA("R1",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "IRSINIT") { + } else if (page == "IRSINIT") { initInputIRS("R1",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB") { + } else if (page == "INITB") { initInputB("R1",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") { + } else if (page == "WINDCLB") { if (fmgc.FMGCInternal.phase == 0) { if (canvas_mcdu.myHISTWIND[i] == nil) { canvas_mcdu.myHISTWIND[i] = windHISTPage.new(i); } else { canvas_mcdu.myHISTWIND[i].reload(); } - setprop("MCDU[" ~ i ~ "]/page", "WINDHIST"); + pageNode[i].setValue("WINDHIST"); } else { mcdu_message(i, "NOT ALLOWED"); } - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") { + } else if (page == "WINDDES") { canvas_mcdu.myDESWIND[i].pushButtonRight(1); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") { + } else if (page == "RADNAV") { radnavInput("R1",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") { + } else if (page == "PRINTFUNC") { printInput("R1",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") { + } else if (page == "PRINTFUNC2") { printInput2("R1",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "LATREV") { + } else if (page == "LATREV") { if (canvas_mcdu.myLatRev[i].type == 1) { if (canvas_mcdu.myArrival[i] != nil) { canvas_mcdu.myArrival[i].del(); @@ -616,34 +621,34 @@ var rskbutton = func(btn, i) { canvas_mcdu.myArrival[i] = nil; canvas_mcdu.myArrival[i] = arrivalPage.new(canvas_mcdu.myLatRev[i].title[2], i); canvas_mcdu.myArrival[i]._setupPageWithData(); - setprop("/MCDU[" ~ i ~ "]/page", "ARRIVAL"); + pageNode[i].setValue("ARRIVAL"); } else { mcdu_message(i, "NOT ALLOWED"); } - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") { + } else if (page == "F-PLNA" or page == "F-PLNB") { canvas_mcdu.myFpln[i].pushButtonRight(1); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA2") { + } else if (page == "DATA2") { if (fmgc.WaypointDatabase.getCount() > 0) { if (canvas_mcdu.myPilotWP[i] != nil) { canvas_mcdu.myPilotWP[i].del(); } canvas_mcdu.myPilotWP[i] = nil; canvas_mcdu.myPilotWP[i] = pilotWaypointPage.new(i); - setprop("/MCDU[" ~ i ~ "]/page", "PILOTWP"); + pageNode[i].setValue("PILOTWP"); } else { mcdu_message(i, "NOT ALLOWED"); # todo spawn new waypoints page } - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMMMENU") { - setprop("/MCDU[" ~ i ~ "]/page", "COMMSTATUS"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMPANYCALL") { + } else if (page == "COMMMENU") { + pageNode[i].setValue("COMMSTATUS"); + } else if (page == "COMPANYCALL") { if (atsu.CompanyCall.frequency != 999.99) { atsu.CompanyCall.ack(); } else { mcdu_message(i, "NOT ALLOWED"); } - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATSUDLINK") { - setprop("/MCDU[" ~ i ~ "]/page", "AOCMENU"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WEATHERREQ") { + } else if (page == "ATSUDLINK") { + pageNode[i].setValue("AOCMENU"); + } else if (page == "WEATHERREQ") { var result = atsu.AOC.newStation(mcdu_scratchpad.scratchpads[i].scratchpad, i); if (result == 1) { mcdu_message(i, "NOT ALLOWED"); @@ -652,93 +657,93 @@ var rskbutton = func(btn, i) { } else { mcdu_scratchpad.scratchpads[i].empty(); } - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WEATHERTYPE") { + } else if (page == "WEATHERTYPE") { atsu.AOC.selectedType = "TERM FCST"; - setprop("/MCDU[" ~ i ~ "]/page", "WEATHERREQ"); + pageNode[i].setValue("WEATHERREQ"); } else { mcdu_message(i, "NOT ALLOWED"); } } else if (btn == "2") { - if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") { + if (page == "INITA") { initInputA("R2",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB") { + } else if (page == "INITB") { initInputB("R2",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") { + } else if (page == "PERFAPPR") { perfAPPRInput("R2",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") { + } else if (page == "RADNAV") { radnavInput("R2",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") { + } else if (page == "PRINTFUNC") { printInput("R2",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") { + } else if (page == "PRINTFUNC2") { printInput2("R2",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") { + } else if (page == "DEPARTURE") { canvas_mcdu.myDeparture[i].depPushbuttonRight(2); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") { + } else if (page == "ARRIVAL") { canvas_mcdu.myArrival[i].arrPushbuttonRight(2); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") { + } else if (page == "F-PLNA" or page == "F-PLNB") { canvas_mcdu.myFpln[i].pushButtonRight(2); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "NOTIFICATION") { + } else if (page == "NOTIFICATION") { var result = atsu.notificationSystem.notify(); if (result == 1) { mcdu_message(i, "NOT ALLOWED"); } - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMMMENU") { - setprop("/MCDU[" ~ i ~ "]/page", "COMPANYCALL"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "AOCMENU") { - setprop("/MCDU[" ~ i ~ "]/page", "WEATHERREQ"); + } else if (page == "COMMMENU") { + pageNode[i].setValue("COMPANYCALL"); + } else if (page == "AOCMENU") { + pageNode[i].setValue("WEATHERREQ"); } else { mcdu_message(i, "NOT ALLOWED"); } } else if (btn == "3") { - if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") { + if (page == "INITA") { initInputA("R3",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB") { + } else if (page == "INITB") { initInputB("R3",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "FUELPRED") { + } else if (page == "FUELPRED") { fuelPredInput("R3",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFTO") { + } else if (page == "PERFTO") { perfTOInput("R3",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") { + } else if (page == "PERFAPPR") { perfAPPRInput("R3",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") { + } else if (page == "PRINTFUNC") { printInput("R3",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") { + } else if (page == "PRINTFUNC2") { printInput2("R3",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") { + } else if (page == "DEPARTURE") { canvas_mcdu.myDeparture[i].depPushbuttonRight(3); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") { + } else if (page == "ARRIVAL") { canvas_mcdu.myArrival[i].arrPushbuttonRight(3); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "LATREV") { + } else if (page == "LATREV") { if (canvas_mcdu.myLatRev[i].type != 2) { canvas_mcdu.myLatRev[i].nextWpt(); } else { mcdu_message(i, "NOT ALLOWED"); } - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") { + } else if (page == "F-PLNA" or page == "F-PLNB") { canvas_mcdu.myFpln[i].pushButtonRight(3); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "AOCMENU") { + } else if (page == "AOCMENU") { if (canvas_mcdu.myReceivedMessages[i] != nil) { canvas_mcdu.myReceivedMessages[i].del(); } canvas_mcdu.myReceivedMessages[i] = nil; canvas_mcdu.myReceivedMessages[i] = receivedMessagesPage.new(i); - setprop("/MCDU[" ~ i ~ "]/page", "RECEIVEDMSGS"); + pageNode[i].setValue("RECEIVEDMSGS"); } else { mcdu_message(i, "NOT ALLOWED"); } } else if (btn == "4") { - if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") { + if (page == "INITA") { initInputA("R4",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "FUELPRED") { + } else if (page == "FUELPRED") { fuelPredInput("R4",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") { + } else if (page == "WINDCRZ") { if (canvas_mcdu.myCLBWIND[i] == nil) { canvas_mcdu.myCLBWIND[i] = windCLBPage.new(i); } else { canvas_mcdu.myCLBWIND[i].reload(); } - setprop("MCDU[" ~ i ~ "]/page", "WINDCLB"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") { + pageNode[i].setValue("WINDCLB"); + } else if (page == "WINDDES") { if (fmgc.flightPlanController.temporaryFlag[i]) { if (fmgc.FMGCInternal.toFromSet and size(fmgc.windController.nav_indicies[i]) > 0) { if (canvas_mcdu.myCRZWIND[i] != nil) { @@ -768,30 +773,30 @@ var rskbutton = func(btn, i) { } } } - setprop("MCDU[" ~ i ~ "]/page", "WINDCRZ"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFTO") { + pageNode[i].setValue("WINDCRZ"); + } else if (page == "PERFTO") { perfTOInput("R4",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") { + } else if (page == "PERFAPPR") { perfAPPRInput("R4",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") { + } else if (page == "RADNAV") { radnavInput("R4",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") { + } else if (page == "PRINTFUNC2") { printInput2("R4",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") { + } else if (page == "DEPARTURE") { canvas_mcdu.myDeparture[i].depPushbuttonRight(4); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") { + } else if (page == "ARRIVAL") { canvas_mcdu.myArrival[i].arrPushbuttonRight(4); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") { + } else if (page == "F-PLNA" or page == "F-PLNB") { canvas_mcdu.myFpln[i].pushButtonRight(4); } else { mcdu_message(i, "NOT ALLOWED"); } } else if (btn == "5") { - if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") { + if (page == "INITA") { initInputA("R5",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB") { + } else if (page == "INITB") { initInputB("R5",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") { + } else if (page == "WINDCLB") { if (fmgc.flightPlanController.temporaryFlag[i]) { if (fmgc.FMGCInternal.toFromSet and size(fmgc.windController.nav_indicies[i]) > 0) { if (canvas_mcdu.myCRZWIND[i] != nil) { @@ -821,46 +826,46 @@ var rskbutton = func(btn, i) { } } } - setprop("MCDU[" ~ i ~ "]/page", "WINDCRZ"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") { + pageNode[i].setValue("WINDCRZ"); + } else if (page == "WINDCRZ") { if (canvas_mcdu.myDESWIND[i] == nil) { canvas_mcdu.myDESWIND[i] = windDESPage.new(i, ""); } else { canvas_mcdu.myDESWIND[i].reload(); } - setprop("MCDU[" ~ i ~ "]/page", "WINDDES"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "STATUS") { + pageNode[i].setValue("WINDDES"); + } else if (page == "STATUS") { statusInput("R5",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFTO") { + } else if (page == "PERFTO") { perfTOInput("R5",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") { + } else if (page == "PERFAPPR") { perfAPPRInput("R5",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFGA") { + } else if (page == "PERFGA") { perfGAInput("R5",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") { + } else if (page == "RADNAV") { radnavInput("R5",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA") { + } else if (page == "DATA") { dataInput("R5",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") { + } else if (page == "DEPARTURE") { canvas_mcdu.myDeparture[i].depPushbuttonRight(5); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") { + } else if (page == "ARRIVAL") { canvas_mcdu.myArrival[i].arrPushbuttonRight(5); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") { + } else if (page == "F-PLNA" or page == "F-PLNB") { canvas_mcdu.myFpln[i].pushButtonRight(5); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "LATREV") { + } else if (page == "LATREV") { if (canvas_mcdu.myLatRev[i].type == 3) { if (canvas_mcdu.myAirways[i] != nil) { canvas_mcdu.myAirways[i].del(); } canvas_mcdu.myAirways[i] = nil; canvas_mcdu.myAirways[i] = airwaysPage.new(i, canvas_mcdu.myLatRev[i].wpt); - setprop("/MCDU[" ~ i ~ "]/page", "AIRWAYS"); + pageNode[i].setValue("AIRWAYS"); } else { mcdu_message(i, "NOT ALLOWED"); } - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU") { - setprop("/MCDU[" ~ i ~ "]/page", "CONNECTSTATUS"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WEATHERREQ") { + } else if (page == "ATCMENU") { + pageNode[i].setValue("CONNECTSTATUS"); + } else if (page == "WEATHERREQ") { var result = atsu.AOC.sendReq(i); if (result == 1) { mcdu_message(i, "NOT ALLOWED"); @@ -871,7 +876,7 @@ var rskbutton = func(btn, i) { } else { mcdu_scratchpad.scratchpads[i].empty(); } - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "VOICEDIRECTORY") { + } else if (page == "VOICEDIRECTORY") { for (var i = 0; i < 3; i = i + 1) { if (getprop("/systems/radio/rmp[" ~ i ~ "]/sel_chan") == "vhf3") { rmp.transfer(i + 1); @@ -881,39 +886,39 @@ var rskbutton = func(btn, i) { mcdu_message(i, "NOT ALLOWED"); } } else if (btn == "6") { - if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") { + if (page == "INITA") { initInputA("R6",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "IRSINIT") { + } else if (page == "IRSINIT") { initInputIRS("R6",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") { + } else if (page == "WINDCLB") { canvas_mcdu.myCLBWIND[i].pushButtonRight(6); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") { + } else if (page == "WINDCRZ") { canvas_mcdu.myCRZWIND[i].pushButtonRight(6); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") { + } else if (page == "WINDDES") { canvas_mcdu.myDESWIND[i].pushButtonRight(6); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDHIST") { + } else if (page == "WINDHIST") { canvas_mcdu.myHISTWIND[i].pushButtonRight(6); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFTO") { + } else if (page == "PERFTO") { perfTOInput("R6",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFCLB") { + } else if (page == "PERFCLB") { perfCLBInput("R6",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFCRZ") { + } else if (page == "PERFCRZ") { perfCRZInput("R6",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFDES") { + } else if (page == "PERFDES") { perfDESInput("R6",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") { + } else if (page == "PERFAPPR") { perfAPPRInput("R6",i); - } else if ((getprop("/MCDU[" ~ i ~ "]/page") == "DATA") or (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") or (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2")) { + } else if ((page == "DATA") or (page == "PRINTFUNC") or (page == "PRINTFUNC2")) { mcdu_message(i, "AOC DISABLED"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") { + } else if (page == "INITA") { initInputA("R6",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") { + } else if (page == "F-PLNA" or page == "F-PLNB") { canvas_mcdu.myFpln[i].pushButtonRight(6); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "VERTREV") { - setprop("/MCDU[" ~ i ~ "]/page", "F-PLNA"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DIRTO") { + } else if (page == "VERTREV") { + pageNode[i].setValue("F-PLNA"); + } else if (page == "DIRTO") { canvas_mcdu.myDirTo[i].fieldR6(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PILOTWP") { + } else if (page == "PILOTWP") { if (canvas_mcdu.myPilotWP[i] != nil) { if (fmgc.WaypointDatabase.confirm[i]) { fmgc.WaypointDatabase.confirm[i] = 0; @@ -923,12 +928,12 @@ var rskbutton = func(btn, i) { canvas_mcdu.myPilotWP[i].deleteCmd(); } } - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "NOTIFICATION") { - setprop("/MCDU[" ~ i ~ "]/page", "CONNECTSTATUS"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATSUDLINK") { - setprop("/MCDU[" ~ i ~ "]/page", "COMMMENU"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "CONNECTSTATUS") { - setprop("/MCDU[" ~ i ~ "]/page", "NOTIFICATION"); + } else if (page == "NOTIFICATION") { + pageNode[i].setValue("CONNECTSTATUS"); + } else if (page == "ATSUDLINK") { + pageNode[i].setValue("COMMMENU"); + } else if (page == "CONNECTSTATUS") { + pageNode[i].setValue("NOTIFICATION"); } else { mcdu_message(i, "NOT ALLOWED"); } @@ -936,129 +941,131 @@ var rskbutton = func(btn, i) { } var arrowbutton = func(btn, i) { + page = pageNode[i].getValue(); if (btn == "left") { - if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA") { - setprop("/MCDU[" ~ i ~ "]/page", "DATA2"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA2") { - setprop("/MCDU[" ~ i ~ "]/page", "DATA"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") { - if (getprop("engines/engine[0]/state") != 3 and getprop("engines/engine[1]/state") != 3) { - setprop("/MCDU[" ~ i ~ "]/page", "INITB"); + if (page == "DATA") { + pageNode[i].setValue("DATA2"); + } else if (page == "DATA2") { + pageNode[i].setValue("DATA"); + } else if (page == "INITA") { + if (pts.Engines.Engine.state[0].getValue() != 3 and pts.Engines.Engine.state[1].getValue() != 3) { + pageNode[i].setValue("INITB"); } else { - setprop("/MCDU[" ~ i ~ "]/page", "FUELPRED"); + pageNode[i].setValue("FUELPRED"); } - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB" or getprop("/MCDU[" ~ i ~ "]/page") == "FUELPRED") { - setprop("/MCDU[" ~ i ~ "]/page", "INITA"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") { - setprop("/MCDU[" ~ i ~ "]/page", "PRINTFUNC2"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") { - setprop("/MCDU[" ~ i ~ "]/page", "PRINTFUNC"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") { + } else if (page == "INITB" or page == "FUELPRED") { + pageNode[i].setValue("INITA"); + } else if (page == "PRINTFUNC") { + pageNode[i].setValue("PRINTFUNC2"); + } else if (page == "PRINTFUNC2") { + pageNode[i].setValue("PRINTFUNC"); + } else if (page == "DEPARTURE") { canvas_mcdu.myDeparture[i].scrollLeft(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") { + } else if (page == "ARRIVAL") { canvas_mcdu.myArrival[i].scrollLeft(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PILOTWP") { + } else if (page == "PILOTWP") { canvas_mcdu.myPilotWP[i].scrollLeft(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "RECEIVEDMSGS") { + } else if (page == "RECEIVEDMSGS") { canvas_mcdu.myReceivedMessages[i].scrollLeft(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "RECEIVEDMSG") { + } else if (page == "RECEIVEDMSG") { canvas_mcdu.myReceivedMessage[i].scrollLeft(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU") { - setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU2"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU2") { - setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU"); + } else if (page == "ATCMENU") { + pageNode[i].setValue("ATCMENU2"); + } else if (page == "ATCMENU2") { + pageNode[i].setValue("ATCMENU"); } } else if (btn == "right") { - if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA") { - setprop("/MCDU[" ~ i ~ "]/page", "DATA2"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA2") { - setprop("/MCDU[" ~ i ~ "]/page", "DATA"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") { - if (getprop("engines/engine[0]/state") != 3 and getprop("engines/engine[1]/state") != 3) { - setprop("/MCDU[" ~ i ~ "]/page", "INITB"); + if (page == "DATA") { + pageNode[i].setValue("DATA2"); + } else if (page == "DATA2") { + pageNode[i].setValue("DATA"); + } else if (page == "INITA") { + if (pts.Engines.Engine.state[0].getValue() != 3 and pts.Engines.Engine.state[1].getValue() != 3) { + pageNode[i].setValue("INITB"); } else { - setprop("/MCDU[" ~ i ~ "]/page", "FUELPRED"); + pageNode[i].setValue("FUELPRED"); } - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB" or getprop("/MCDU[" ~ i ~ "]/page") == "FUELPRED") { - setprop("/MCDU[" ~ i ~ "]/page", "INITA"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") { - setprop("/MCDU[" ~ i ~ "]/page", "PRINTFUNC2"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") { - setprop("/MCDU[" ~ i ~ "]/page", "PRINTFUNC"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") { + } else if (page == "INITB" or page == "FUELPRED") { + pageNode[i].setValue("INITA"); + } else if (page == "PRINTFUNC") { + pageNode[i].setValue("PRINTFUNC2"); + } else if (page == "PRINTFUNC2") { + pageNode[i].setValue("PRINTFUNC"); + } else if (page == "DEPARTURE") { canvas_mcdu.myDeparture[i].scrollRight(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") { + } else if (page == "ARRIVAL") { canvas_mcdu.myArrival[i].scrollRight(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PILOTWP") { + } else if (page == "PILOTWP") { canvas_mcdu.myPilotWP[i].scrollRight(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "RECEIVEDMSGS") { + } else if (page == "RECEIVEDMSGS") { canvas_mcdu.myReceivedMessages[i].scrollRight(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "RECEIVEDMSG") { + } else if (page == "RECEIVEDMSG") { canvas_mcdu.myReceivedMessage[i].scrollRight(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU") { - setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU2"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU2") { - setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU"); + } else if (page == "ATCMENU") { + pageNode[i].setValue("ATCMENU2"); + } else if (page == "ATCMENU2") { + pageNode[i].setValue("ATCMENU"); } } else if (btn == "up") { - if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") { + if (page == "F-PLNA" or page == "F-PLNB") { canvas_mcdu.myFpln[i].scrollUp(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") { + } else if (page == "DEPARTURE") { canvas_mcdu.myDeparture[i].scrollUp(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") { + } else if (page == "ARRIVAL") { canvas_mcdu.myArrival[i].scrollUp(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DIRTO") { + } else if (page == "DIRTO") { canvas_mcdu.myDirTo[i].scrollUp(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "IRSINIT") { + } else if (page == "IRSINIT") { initInputIRS("up",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") { + } else if (page == "WINDCRZ") { canvas_mcdu.myCRZWIND[i].pushButtonUp(); } } else if (btn == "down") { - if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") { + if (page == "F-PLNA" or page == "F-PLNB") { canvas_mcdu.myFpln[i].scrollDn(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") { + } else if (page == "DEPARTURE") { canvas_mcdu.myDeparture[i].scrollDn(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") { + } else if (page == "ARRIVAL") { canvas_mcdu.myArrival[i].scrollDn(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DIRTO") { + } else if (page == "DIRTO") { canvas_mcdu.myDirTo[i].scrollDn(); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "IRSINIT") { + } else if (page == "IRSINIT") { initInputIRS("down",i); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") { + } else if (page == "WINDCRZ") { canvas_mcdu.myCRZWIND[i].pushButtonDown(); } } } var pagebutton = func(btn, i) { + page = pageNode[i].getValue(); setprop("/MCDU[" ~ i ~ "]/scratchpad-color", "wht"); - if (getprop("/MCDU[" ~ i ~ "]/page") != "MCDU") { + if (page != "MCDU") { if (btn == "radnav") { - setprop("/MCDU[" ~ i ~ "]/page", "RADNAV"); + pageNode[i].setValue("RADNAV"); } else if (btn == "prog") { if (fmgc.FMGCInternal.phase == 0 or fmgc.FMGCInternal.phase == 1) { - setprop("MCDU[" ~ i ~ "]/page", "PROGTO"); + pageNode[i].setValue("PROGTO"); } else if (fmgc.FMGCInternal.phase == 2) { - setprop("MCDU[" ~ i ~ "]/page", "PROGCLB"); + pageNode[i].setValue("PROGCLB"); } else if (fmgc.FMGCInternal.phase == 3) { - setprop("MCDU[" ~ i ~ "]/page", "PROGCRZ"); + pageNode[i].setValue("PROGCRZ"); } else if (fmgc.FMGCInternal.phase == 4 or fmgc.FMGCInternal.phase == 5 or fmgc.FMGCInternal.phase == 6) { - setprop("MCDU[" ~ i ~ "]/page", "PROGDES"); + pageNode[i].setValue("PROGDES"); } } else if (btn == "perf") { if (fmgc.FMGCInternal.phase == 0 or fmgc.FMGCInternal.phase == 1) { - setprop("MCDU[" ~ i ~ "]/page", "PERFTO"); + pageNode[i].setValue("PERFTO"); } else if (fmgc.FMGCInternal.phase == 2) { - setprop("MCDU[" ~ i ~ "]/page", "PERFCLB"); + pageNode[i].setValue("PERFCLB"); } else if (fmgc.FMGCInternal.phase == 3) { - setprop("MCDU[" ~ i ~ "]/page", "PERFCRZ"); + pageNode[i].setValue("PERFCRZ"); } else if (fmgc.FMGCInternal.phase == 4) { - setprop("MCDU[" ~ i ~ "]/page", "PERFDES"); + pageNode[i].setValue("PERFDES"); } else if (fmgc.FMGCInternal.phase == 5) { - setprop("MCDU[" ~ i ~ "]/page", "PERFAPPR"); + pageNode[i].setValue("PERFAPPR"); } else if (fmgc.FMGCInternal.phase == 6) { - setprop("MCDU[" ~ i ~ "]/page", "PERFGA"); + pageNode[i].setValue("PERFGA"); } else if (fmgc.FMGCInternal.phase == 7) { fmgc.reset_FMGC(); } @@ -1066,18 +1073,18 @@ var pagebutton = func(btn, i) { if (fmgc.FMGCInternal.phase == 7) { fmgc.reset_FMGC(); } - setprop("/MCDU[" ~ i ~ "]/page", "INITA"); + pageNode[i].setValue("INITA"); } else if (btn == "data") { - setprop("/MCDU[" ~ i ~ "]/page", "DATA"); + pageNode[i].setValue("DATA"); } else if (btn == "mcdu") { - var page = getprop("/MCDU[" ~ i ~ "]/page"); + var page = page; if (page != "ATSUDLINK" and page != "AOCMENU" and page != "WEATHERREQ" and page != "WEATHERTYPE" and page != "RECEIVEDMSGS" and page != "RECEIVEDMSG" and page != "ATCMENU" and page != "ATCMENU2" and page != "NOTIFICATION" and page != "CONNECTSTATUS" and page != "COMPANYCALL" and page != "VOICEDIRECTORY" and page != "DATAMODE" and page != "COMMMENU" and page != "COMMSTATUS" and page != "COMMINIT") { - setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", getprop("/MCDU[" ~ i ~ "]/page")); + setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", page); } else { - setprop("/MCDU[" ~ i ~ "]/last-atsu-page", getprop("/MCDU[" ~ i ~ "]/page")); + setprop("/MCDU[" ~ i ~ "]/last-atsu-page", page); } mcdu_message(i, "SELECT DESIRED SYSTEM"); - setprop("/MCDU[" ~ i ~ "]/page", "MCDU"); + pageNode[i].setValue("MCDU"); } else if (btn == "f-pln" or btn == "airport") { if (canvas_mcdu.myFpln[i] == nil) { canvas_mcdu.myFpln[i] = fplnPage.new(2, i); @@ -1095,10 +1102,10 @@ var pagebutton = func(btn, i) { } else { canvas_mcdu.myFpln[i].scroll = 0; } - setprop("/MCDU[" ~ i ~ "]/page", "F-PLNA"); + pageNode[i].setValue("F-PLNA"); } else if (btn == "fuel-pred") { - setprop("/MCDU[" ~ i ~ "]/page", "FUELPRED"); + pageNode[i].setValue("FUELPRED"); } else if (btn == "dirto") { if (fmgc.flightPlanController.temporaryFlag[i] and !dirToFlag) { mcdu_message(i, "INSERT/ERASE TMPY FIRST"); @@ -1106,25 +1113,26 @@ var pagebutton = func(btn, i) { } elsif (canvas_mcdu.myDirTo[i] == nil) { canvas_mcdu.myDirTo[i] = dirTo.new(i); } - setprop("/MCDU[" ~ i ~ "]/page", "DIRTO"); + pageNode[i].setValue("DIRTO"); } else if (btn == "atc") { if (getprop("/MCDU[" ~ i ~ "]/atsu-active") != 2) { mcdu_message(i, "WAIT FOR SYSTEM RESPONSE"); setprop("/MCDU[" ~ i ~ "]/atsu-active", 1); settimer(func(){ - setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU"); + pageNode[i].setValue("ATCMENU"); mcdu_scratchpad.scratchpads[i].empty(); setprop("/MCDU[" ~ i ~ "]/atsu-active", 2); }, 2); } else { - setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU"); + pageNode[i].setValue("ATCMENU"); } } } } var button = func(btn, i) { - if (getprop("/MCDU[" ~ i ~ "]/page") != "MCDU") { + page = pageNode[i].getValue(); + if (page != "MCDU") { var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad; if (btn == "SLASH") { mcdu_scratchpad.scratchpads[i].addChar("/"); @@ -1153,9 +1161,9 @@ var mcdu_message = func(i, string, overrideStr = "") { } var screenFlash = func(time, i) { - var page = getprop("/MCDU[" ~ i ~ "]/page"); - setprop("/MCDU[" ~ i ~ "]/page", "NONE"); + page = pageNode[i].getValue(); + pageNode[i].setValue("NONE"); settimer(func { - setprop("/MCDU[" ~ i ~ "]/page", page); + pageNode[i].setValue(page); }, time); } \ No newline at end of file diff --git a/Nasal/MCDU/WINDCLB.nas b/Nasal/MCDU/WINDCLB.nas index a3b574dc..ac1eb6a1 100644 --- a/Nasal/MCDU/WINDCLB.nas +++ b/Nasal/MCDU/WINDCLB.nas @@ -178,9 +178,9 @@ var windCLBPage = { } else { fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 0); # push update to fuel - if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 0); - setprop("/FMGC/internal/fuel-calculating", 1); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.FMGCInternal.fuelCalculating = 1; } } me.reload(); @@ -316,9 +316,9 @@ var windCLBPage = { } else { fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 1); # push update to fuel - if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 0); - setprop("/FMGC/internal/fuel-calculating", 1); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.FMGCInternal.fuelCalculating = 1; } } me.reload(); diff --git a/Nasal/MCDU/WINDCRZ.nas b/Nasal/MCDU/WINDCRZ.nas index f33366c8..9fa99331 100644 --- a/Nasal/MCDU/WINDCRZ.nas +++ b/Nasal/MCDU/WINDCRZ.nas @@ -269,9 +269,9 @@ var windCRZPage = { } else { fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 0); # push update to fuel - if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 0); - setprop("/FMGC/internal/fuel-calculating", 1); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.FMGCInternal.fuelCalculating = 1; } } me.reload(); @@ -504,9 +504,9 @@ var windCRZPage = { } else { fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 1); # push update to fuel - if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 0); - setprop("/FMGC/internal/fuel-calculating", 1); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.FMGCInternal.fuelCalculating = 1; } } me.reload(); diff --git a/Nasal/MCDU/WINDDES.nas b/Nasal/MCDU/WINDDES.nas index 3ae5f763..980156b7 100644 --- a/Nasal/MCDU/WINDDES.nas +++ b/Nasal/MCDU/WINDDES.nas @@ -2,6 +2,9 @@ # Copyright (c) 2020 Matthew Maring (mattmaring) +var wind = nil; +var magVar = nil; + var windDESPage = { title: nil, titleColour: "wht", @@ -188,17 +191,18 @@ var windDESPage = { me.updateTmpy(); }, returnGRND: func() { - var wind = fmgc.windController.des_winds[2]; + wind = fmgc.windController.des_winds[2]; + magVar = pts.Environment.magVar.getValue(); if (wind.wind5.altitude == "GRND") { - return [geo.normdeg(wind.wind5.heading - getprop("/environment/magnetic-variation-deg")), wind.wind5.magnitude]; + return [geo.normdeg(wind.wind5.heading - magVar), wind.wind5.magnitude]; } else if (wind.wind4.altitude == "GRND") { - return [geo.normdeg(wind.wind4.heading - getprop("/environment/magnetic-variation-deg")), wind.wind4.magnitude]; + return [geo.normdeg(wind.wind4.heading - magVar), wind.wind4.magnitude]; } else if (wind.wind3.altitude == "GRND") { - return [geo.normdeg(wind.wind3.heading - getprop("/environment/magnetic-variation-deg")), wind.wind3.magnitude]; + return [geo.normdeg(wind.wind3.heading - magVar), wind.wind3.magnitude]; } else if (wind.wind2.altitude == "GRND") { - return [geo.normdeg(wind.wind2.heading - getprop("/environment/magnetic-variation-deg")), wind.wind2.magnitude]; + return [geo.normdeg(wind.wind2.heading - magVar), wind.wind2.magnitude]; } else if (wind.wind1.altitude == "GRND") { - return [geo.normdeg(wind.wind1.heading - getprop("/environment/magnetic-variation-deg")), wind.wind1.magnitude]; + return [geo.normdeg(wind.wind1.heading - magVar), wind.wind1.magnitude]; } else { return nil; } @@ -210,9 +214,9 @@ var windDESPage = { } else { fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 0); # push update to fuel - if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 0); - setprop("/FMGC/internal/fuel-calculating", 1); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.FMGCInternal.fuelCalculating = 1; } } me.reload(); @@ -382,9 +386,9 @@ var windDESPage = { } else { fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 1); # push update to fuel - if (getprop("/FMGC/internal/block-confirmed")) { - setprop("/FMGC/internal/fuel-calculating", 0); - setprop("/FMGC/internal/fuel-calculating", 1); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.FMGCInternal.fuelCalculating = 1; } } me.reload(); diff --git a/Nasal/Systems/FADEC/engines-cfm.nas b/Nasal/Systems/FADEC/engines-cfm.nas index e8749cbd..83a13e1f 100644 --- a/Nasal/Systems/FADEC/engines-cfm.nas +++ b/Nasal/Systems/FADEC/engines-cfm.nas @@ -199,7 +199,7 @@ var auto_start_one = func { } var eng_one_auto_start = maketimer(0.5, func { - if (getprop("/engines/engine[0]/n2-actual") >= 22) { + if (pts.Engines.Engine.n2Actual[0].getValue() >= 22) { eng_one_auto_start.stop(); setprop("/engines/engine[0]/state", 2); setprop("/controls/engines/engine[0]/cutoff", 0); @@ -219,7 +219,7 @@ var eng_one_auto_start = maketimer(0.5, func { }); var eng_one_man_start = maketimer(0.5, func { - if (getprop("/engines/engine[0]/n2-actual") >= 16.7) { + if (pts.Engines.Engine.n2Actual[0].getValue() >= 16.7) { eng_one_man_start.stop(); setprop("/engines/engine[0]/state", 2); setprop("/controls/engines/engine[0]/cutoff", 0); @@ -239,7 +239,7 @@ var eng_one_egt_check = maketimer(0.5, func { }); var eng_one_n2_check = maketimer(0.5, func { - if (getprop("/engines/engine[0]/n2-actual") >= 43.0) { + if (pts.Engines.Engine.n2Actual[0].getValue() >= 43.0) { if (getprop("/controls/engines/engine[0]/igniter-a") != 0) { setprop("/controls/engines/engine[0]/igniter-a", 0); } @@ -247,7 +247,7 @@ var eng_one_n2_check = maketimer(0.5, func { setprop("/controls/engines/engine[0]/igniter-b", 0); } } - if (getprop("/engines/engine[0]/n2-actual") >= 57.0) { + if (pts.Engines.Engine.n2Actual[0].getValue() >= 57.0) { eng_one_n2_check.stop(); setprop("/systems/pneumatics/valves/starter-valve-1", 0); setprop("/engines/engine[0]/state", 3); @@ -262,7 +262,7 @@ var auto_start_two = func { } var eng_two_auto_start = maketimer(0.5, func { - if (getprop("/engines/engine[1]/n2-actual") >= 22) { + if (pts.Engines.Engine.n2Actual[1].getValue() >= 22) { eng_two_auto_start.stop(); setprop("/engines/engine[1]/state", 2); setprop("/controls/engines/engine[1]/cutoff", 0); @@ -282,7 +282,7 @@ var eng_two_auto_start = maketimer(0.5, func { }); var eng_two_man_start = maketimer(0.5, func { - if (getprop("/engines/engine[1]/n2-actual") >= 16.7) { + if (pts.Engines.Engine.n2Actual[1].getValue() >= 16.7) { eng_two_man_start.stop(); setprop("/engines/engine[1]/state", 2); setprop("/controls/engines/engine[1]/cutoff", 0); @@ -302,7 +302,7 @@ var eng_two_egt_check = maketimer(0.5, func { }); var eng_two_n2_check = maketimer(0.5, func { - if (getprop("/engines/engine[1]/n2-actual") >= 50.0) { + if (pts.Engines.Engine.n2Actual[1].getValue() >= 50.0) { if (getprop("/controls/engines/engine[1]/igniter-a") != 0) { setprop("/controls/engines/engine[1]/igniter-a", 0); } @@ -310,7 +310,7 @@ var eng_two_n2_check = maketimer(0.5, func { setprop("/controls/engines/engine[1]/igniter-b", 0); } } - if (getprop("/engines/engine[1]/n2-actual") >= 57.0) { + if (pts.Engines.Engine.n2Actual[1].getValue() >= 57.0) { eng_two_n2_check.stop(); setprop("/systems/pneumatics/valves/starter-valve-2", 0); setprop("/engines/engine[1]/state", 3); diff --git a/Nasal/Systems/FADEC/engines-iae.nas b/Nasal/Systems/FADEC/engines-iae.nas index 41c8ccd2..09716355 100644 --- a/Nasal/Systems/FADEC/engines-iae.nas +++ b/Nasal/Systems/FADEC/engines-iae.nas @@ -199,7 +199,7 @@ var auto_start_one = func { } var eng_one_auto_start = maketimer(0.5, func { - if (getprop("/engines/engine[0]/n1-actual") >= 4.7) { + if (pts.Engines.Engine.n1Actual[0].getValue() >= 4.7) { eng_one_auto_start.stop(); setprop("/engines/engine[0]/state", 2); setprop("/controls/engines/engine[0]/cutoff", 0); @@ -219,7 +219,7 @@ var eng_one_auto_start = maketimer(0.5, func { }); var eng_one_man_start = maketimer(0.5, func { - if (getprop("/engines/engine[0]/n2-actual") >= 16.7) { + if (pts.Engines.Engine.n2Actual[0].getValue() >= 16.7) { eng_one_man_start.stop(); setprop("/engines/engine[0]/state", 2); setprop("/controls/engines/engine[0]/cutoff", 0); @@ -239,7 +239,7 @@ var eng_one_egt_check = maketimer(0.5, func { }); var eng_one_n2_check = maketimer(0.5, func { - if (getprop("/engines/engine[0]/n2-actual") >= 43.0) { + if (pts.Engines.Engine.n2Actual[0].getValue() >= 43.0) { if (getprop("/controls/engines/engine[0]/igniter-a") != 0) { setprop("/controls/engines/engine[0]/igniter-a", 0); } @@ -247,7 +247,7 @@ var eng_one_n2_check = maketimer(0.5, func { setprop("/controls/engines/engine[0]/igniter-b", 0); } } - if (getprop("/engines/engine[0]/n2-actual") >= 57.0) { + if (pts.Engines.Engine.n2Actual[0].getValue() >= 57.0) { eng_one_n2_check.stop(); setprop("/systems/pneumatics/valves/starter-valve-1", 0); setprop("/engines/engine[0]/state", 3); @@ -262,7 +262,7 @@ var auto_start_two = func { } var eng_two_auto_start = maketimer(0.5, func { - if (getprop("/engines/engine[1]/n1-actual") >= 4.7) { + if (pts.Engines.Engine.n1Actual[1].getValue() >= 4.7) { eng_two_auto_start.stop(); setprop("/engines/engine[1]/state", 2); setprop("/controls/engines/engine[1]/cutoff", 0); @@ -282,7 +282,7 @@ var eng_two_auto_start = maketimer(0.5, func { }); var eng_two_man_start = maketimer(0.5, func { - if (getprop("/engines/engine[1]/n2-actual") >= 16.7) { + if (pts.Engines.Engine.n2Actual[1].getValue() >= 16.7) { eng_two_man_start.stop(); setprop("/engines/engine[1]/state", 2); setprop("/controls/engines/engine[1]/cutoff", 0); @@ -302,7 +302,7 @@ var eng_two_egt_check = maketimer(0.5, func { }); var eng_two_n2_check = maketimer(0.5, func { - if (getprop("/engines/engine[1]/n2-actual") >= 43.0) { + if (pts.Engines.Engine.n2Actual[1].getValue() >= 43.0) { if (getprop("/controls/engines/engine[1]/igniter-a") != 0) { setprop("/controls/engines/engine[1]/igniter-a", 0); } @@ -310,7 +310,7 @@ var eng_two_n2_check = maketimer(0.5, func { setprop("/controls/engines/engine[1]/igniter-b", 0); } } - if (getprop("/engines/engine[1]/n2-actual") >= 57.0) { + if (pts.Engines.Engine.n2Actual[1].getValue() >= 57.0) { eng_two_n2_check.stop(); setprop("/systems/pneumatics/valves/starter-valve-2", 0); setprop("/engines/engine[1]/state", 3); From 3d046eea3012e4576305fa7266399152ba3f9750 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R <legoboyvdlp@gmail.com> Date: Sat, 3 Oct 2020 12:34:29 +0100 Subject: [PATCH 12/16] Corect very serious error in the block / fuel calculations --- Models/Instruments/MCDU/MCDU.nas | 10 ++++----- Nasal/FMGC/FMGC.nas | 5 +++++ Nasal/FMGC/SimbriefParser.nas | 2 ++ Nasal/FMGC/flightplan.nas | 2 ++ Nasal/MCDU/F-PLN.nas | 4 ++++ Nasal/MCDU/FUELPRED.nas | 19 ++++++++++++++++ Nasal/MCDU/INITA.nas | 14 ++++++++++++ Nasal/MCDU/INITB.nas | 38 ++++++++++++++++++++++++++++++++ Nasal/MCDU/MCDU.nas | 2 ++ Nasal/MCDU/WINDCLB.nas | 4 ++++ Nasal/MCDU/WINDCRZ.nas | 4 ++++ Nasal/MCDU/WINDDES.nas | 4 ++++ revision.txt | 2 +- 13 files changed, 104 insertions(+), 6 deletions(-) diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index 86c22e10..bb97b5da 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -2262,7 +2262,7 @@ var canvas_MCDU_base = { me["Simple_Title"].setColor(1, 1, 1); - if (!getprop("/FMGC/internal/fuel-request-set")) { + if (!fmgc.FMGCInternal.fuelRequest) { me["Simple_L2"].setText("---.-/----"); me["Simple_L3"].setText("---.-"); me["Simple_C3"].setText(sprintf("/%.1f ", fmgc.FMGCInternal.rtePercent)); @@ -2305,7 +2305,7 @@ var canvas_MCDU_base = { me["Simple_Title"].setText("INIT FUEL PREDICTION "); - if (getprop("/FMGC/internal/block-calculating")) { + if (fmgc.FMGCInternal.blockCalculating) { me["Simple_L2"].setText("---.-/----"); me["Simple_L3"].setText("---.-"); me["Simple_C3"].setText(sprintf("/%.1f ", fmgc.FMGCInternal.rtePercent)); @@ -2331,7 +2331,7 @@ var canvas_MCDU_base = { me.colorRight("ack", "wht", "grn", "wht", "ack", "wht"); me["Simple_R3S"].setColor(GREEN); } else { - if (!getprop("/FMGC/internal/block-confirmed")) { + if (!fmgc.FMGCInternal.blockConfirmed) { me["Simple_L2"].setText("---.-/----"); me["Simple_L3"].setText("---.-"); me["Simple_C3"].setText(sprintf("/%.1f ", fmgc.FMGCInternal.rtePercent)); @@ -2362,7 +2362,7 @@ var canvas_MCDU_base = { me.colorRight("ack", "blu", "amb", "wht", "ack", "wht"); me["Simple_R3S"].setColor(AMBER); } else { - if (getprop("/FMGC/internal/fuel-calculating")) { + if (fmgc.FMGCInternal.fuelCalculating) { me["Simple_L2"].setText("---.-/----"); me["Simple_L3"].setText("---.-"); if (fmgc.FMGCInternal.rteRsvSet) { @@ -2658,7 +2658,7 @@ var canvas_MCDU_base = { me["Simple_R5S"].setText(" GW/ CG"); me["Simple_R6S"].setText("EXTRA/TIME"); - if (!getprop("/FMGC/internal/fuel-request-set") or !getprop("/FMGC/internal/block-confirmed") or getprop("/FMGC/internal/fuel-calculating")) { + if (!fmgc.FMGCInternal.fuelRequest or !fmgc.FMGCInternal.blockConfirmed or fmgc.FMGCInternal.fuelCalculating) { me["Simple_L3"].setText("---.-"); if (fmgc.FMGCInternal.rteRsvSet) { me["Simple_C3B"].setText(sprintf("/%.1f ", fmgc.FMGCInternal.rtePercent)); diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index bbf2cf03..81faa7d3 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -108,6 +108,9 @@ 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 blockCalculating = props.globals.initNode("/FMGC/internal/block-calculating", 0, "BOOL"); +var fuelCalculating = props.globals.initNode("/FMGC/internal/fuel-calculating", 0, "BOOL"); + var FMGCinit = func { FMGCInternal.takeoffState = 0; FMGCInternal.minspeed = 0; @@ -1291,6 +1294,7 @@ var timer3blockFuel = maketimer(1, func() { if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/block-fuel-time") + 3) { #updateFuel(); fmgc.FMGCInternal.blockCalculating = 0; + fmgc.blockCalculating.setValue(0); setprop("/FMGC/internal/block-fuel-time", -99); timer3blockFuel.stop(); } @@ -1300,6 +1304,7 @@ var timer5fuelPred = maketimer(1, func() { if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/fuel-pred-time") + 5) { #updateFuel(); fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.fuelCalculating.setValue(0); setprop("/FMGC/internal/fuel-pred-time", -99); timer5fuelPred.stop(); } diff --git a/Nasal/FMGC/SimbriefParser.nas b/Nasal/FMGC/SimbriefParser.nas index 11a9aabf..2fecf4b1 100644 --- a/Nasal/FMGC/SimbriefParser.nas +++ b/Nasal/FMGC/SimbriefParser.nas @@ -175,7 +175,9 @@ var SimbriefParser = { fmgc.FMGCInternal.tow = fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel; fmgc.FMGCInternal.fuelRequest = 1; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); fmgc.FMGCInternal.blockCalculating = 0; + fmgc.blockCalculating.setValue(0); fmgc.FMGCInternal.blockConfirmed = 1; }, diff --git a/Nasal/FMGC/flightplan.nas b/Nasal/FMGC/flightplan.nas index 874d5dbc..b98e0dbb 100644 --- a/Nasal/FMGC/flightplan.nas +++ b/Nasal/FMGC/flightplan.nas @@ -760,7 +760,9 @@ var flightPlanController = { # push update to fuel if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.fuelCalculating.setValue(0); fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } canvas_nd.A3XXRouteDriver.triggerSignal("fp-added"); }, diff --git a/Nasal/MCDU/F-PLN.nas b/Nasal/MCDU/F-PLN.nas index fb7f6d68..f086d6fd 100644 --- a/Nasal/MCDU/F-PLN.nas +++ b/Nasal/MCDU/F-PLN.nas @@ -438,7 +438,9 @@ var fplnPage = { # this one is only created once, and then updated - remember th # push update to fuel if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.fuelCalculating.setValue(0); fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } } else { if (canvas_mcdu.myLatRev[me.computer] != nil) { @@ -479,7 +481,9 @@ var fplnPage = { # this one is only created once, and then updated - remember th # push update to fuel if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.fuelCalculating.setValue(0); fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } } else { mcdu_message(me.computer, "NOT ALLOWED"); diff --git a/Nasal/MCDU/FUELPRED.nas b/Nasal/MCDU/FUELPRED.nas index 1749ce32..fbdc1693 100644 --- a/Nasal/MCDU/FUELPRED.nas +++ b/Nasal/MCDU/FUELPRED.nas @@ -12,6 +12,7 @@ var fuelPredInput = func(key, i) { fmgc.FMGCInternal.rtePercent = 5.0; fmgc.FMGCInternal.rtePercentSet = 0; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); mcdu_scratchpad.scratchpads[i].empty(); } else if (fmgc.FMGCInternal.tripFuel != 0) { var tf = num(scratchpad); @@ -24,6 +25,7 @@ var fuelPredInput = func(key, i) { fmgc.FMGCInternal.rtePercent = perc; fmgc.FMGCInternal.rtePercentSet = 1; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); mcdu_scratchpad.scratchpads[i].empty(); } } else if (tfs >= 1 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 21.7) { @@ -36,6 +38,7 @@ var fuelPredInput = func(key, i) { } fmgc.FMGCInternal.rtePercentSet = 0; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); @@ -49,6 +52,7 @@ var fuelPredInput = func(key, i) { fmgc.FMGCInternal.altTime = "0000"; fmgc.FMGCInternal.altFuelSet = 0; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); mcdu_scratchpad.scratchpads[i].empty(); } else if (find(".", scratchpad) != -1) { var tf = num(scratchpad); @@ -58,6 +62,7 @@ var fuelPredInput = func(key, i) { fmgc.FMGCInternal.altTime = "0000"; fmgc.FMGCInternal.altFuelSet = 1; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); @@ -72,6 +77,7 @@ var fuelPredInput = func(key, i) { fmgc.FMGCInternal.finalFuelSet = 0; fmgc.FMGCInternal.finalTimeSet = 0; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); mcdu_scratchpad.scratchpads[i].empty(); } else if (find(".", scratchpad) != -1) { var tf = num(scratchpad); @@ -80,6 +86,7 @@ var fuelPredInput = func(key, i) { fmgc.FMGCInternal.finalFuel = tf; fmgc.FMGCInternal.finalFuelSet = 1; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); @@ -91,6 +98,7 @@ var fuelPredInput = func(key, i) { fmgc.FMGCInternal.finalTime = scratchpad; fmgc.FMGCInternal.finalTimeSet = 1; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); @@ -101,6 +109,7 @@ var fuelPredInput = func(key, i) { fmgc.FMGCInternal.minDestFob = 0; fmgc.FMGCInternal.minDestFobSet = 0; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); mcdu_scratchpad.scratchpads[i].empty(); } else if (find(".", scratchpad) != -1) { var tf = num(scratchpad); @@ -109,6 +118,7 @@ var fuelPredInput = func(key, i) { fmgc.FMGCInternal.minDestFob = tf; fmgc.FMGCInternal.minDestFobSet = 1; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); mcdu_scratchpad.scratchpads[i].empty(); if (fmgc.FMGCInternal.minDestFob < fmgc.FMGCInternal.finalFuel + fmgc.FMGCInternal.altFuel) { mcdu_message(i, "CHECK MIN DEST FOB"); @@ -135,10 +145,13 @@ var fuelPredInput = func(key, i) { fmgc.FMGCInternal.tow = fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel; fmgc.FMGCInternal.fuelRequest = 1; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); fmgc.FMGCInternal.blockCalculating = 0; + fmgc.blockCalculating.setValue(0); fmgc.FMGCInternal.blockConfirmed = 1; } else if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } mcdu_scratchpad.scratchpads[i].empty(); } else if (find("/", scratchpad) != -1) { @@ -159,10 +172,13 @@ var fuelPredInput = func(key, i) { fmgc.FMGCInternal.tow = fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel; fmgc.FMGCInternal.fuelRequest = 1; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); fmgc.FMGCInternal.blockCalculating = 0; + fmgc.blockCalculating.setValue(0); fmgc.FMGCInternal.blockConfirmed = 1; } else if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -189,10 +205,13 @@ var fuelPredInput = func(key, i) { fmgc.FMGCInternal.tow = fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel; fmgc.FMGCInternal.fuelRequest = 1; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); fmgc.FMGCInternal.blockCalculating = 0; + fmgc.blockCalculating.setValue(0); fmgc.FMGCInternal.blockConfirmed = 1; } else if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } mcdu_scratchpad.scratchpads[i].empty(); } else { diff --git a/Nasal/MCDU/INITA.nas b/Nasal/MCDU/INITA.nas index b47f4d08..e5cb5104 100644 --- a/Nasal/MCDU/INITA.nas +++ b/Nasal/MCDU/INITA.nas @@ -12,7 +12,9 @@ var initInputA = func(key, i) { fmgc.windController.updatePlans(); if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.fuelCalculating.setValue(0); fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } mcdu_scratchpad.scratchpads[i].empty(); fmgc.updateARPT(); @@ -28,7 +30,9 @@ var initInputA = func(key, i) { fmgc.windController.updatePlans(); if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.fuelCalculating.setValue(0); fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } mcdu_scratchpad.scratchpads[i].empty(); fmgc.updateARPT(); @@ -92,7 +96,9 @@ var initInputA = func(key, i) { fmgc.FMGCInternal.crzTempSet = 0; if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.fuelCalculating.setValue(0); fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } mcdu_scratchpad.scratchpads[i].empty(); } else if (find("/", scratchpad) != -1) { @@ -112,7 +118,9 @@ var initInputA = func(key, i) { fmgc.FMGCInternal.crzTempSet = 1; if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.fuelCalculating.setValue(0); fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -131,7 +139,9 @@ var initInputA = func(key, i) { fmgc.FMGCInternal.crzProg = crz; if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.fuelCalculating.setValue(0); fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -159,7 +169,9 @@ var initInputA = func(key, i) { fmgc.FMGCInternal.crzProg = crz; if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.fuelCalculating.setValue(0); fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -182,7 +194,9 @@ var initInputA = func(key, i) { setprop("/FMGC/internal/align-ref-long-edit", 0); if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.fuelCalculating.setValue(0); fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } fmgc.flightPlanController.reset(2); fmgc.flightPlanController.init(); diff --git a/Nasal/MCDU/INITB.nas b/Nasal/MCDU/INITB.nas index 8b75ec65..246dddb9 100644 --- a/Nasal/MCDU/INITB.nas +++ b/Nasal/MCDU/INITB.nas @@ -10,8 +10,10 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.taxiFuelSet = 0; if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } else if (fmgc.FMGCInternal.fuelRequest) { fmgc.FMGCInternal.blockCalculating = 1; + fmgc.blockCalculating.setValue(1); } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -22,8 +24,10 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.taxiFuelSet = 1; if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } else if (fmgc.FMGCInternal.fuelRequest) { fmgc.FMGCInternal.blockCalculating = 1; + fmgc.blockCalculating.setValue(1); } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -40,6 +44,7 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.rtePercent = 5.0; fmgc.FMGCInternal.rtePercentSet = 0; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); mcdu_scratchpad.scratchpads[i].empty(); } else if (fmgc.FMGCInternal.tripFuel != 0) { var tf = num(scratchpad); @@ -52,6 +57,7 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.rtePercent = perc; fmgc.FMGCInternal.rtePercentSet = 1; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); mcdu_scratchpad.scratchpads[i].empty(); } } else if (tfs >= 1 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 21.7) { @@ -64,6 +70,7 @@ var initInputB = func(key, i) { } fmgc.FMGCInternal.rtePercentSet = 0; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); @@ -77,6 +84,7 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.altTime = "0000"; fmgc.FMGCInternal.altFuelSet = 0; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); mcdu_scratchpad.scratchpads[i].empty(); } else if (find(".", scratchpad) != -1) { var tf = num(scratchpad); @@ -86,6 +94,7 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.altTime = "0000"; fmgc.FMGCInternal.altFuelSet = 1; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); @@ -100,6 +109,7 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.finalFuelSet = 0; fmgc.FMGCInternal.finalTimeSet = 0; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); mcdu_scratchpad.scratchpads[i].empty(); } else if (find(".", scratchpad) != -1) { var tf = num(scratchpad); @@ -108,6 +118,7 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.finalFuel = tf; fmgc.FMGCInternal.finalFuelSet = 1; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); @@ -119,6 +130,7 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.finalTime = scratchpad; fmgc.FMGCInternal.finalTimeSet = 1; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); @@ -129,6 +141,7 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.minDestFob = 0; fmgc.FMGCInternal.minDestFobSet = 0; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); mcdu_scratchpad.scratchpads[i].empty(); } else if (find(".", scratchpad) != -1) { var tf = num(scratchpad); @@ -137,6 +150,7 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.minDestFob = tf; fmgc.FMGCInternal.minDestFobSet = 1; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); mcdu_scratchpad.scratchpads[i].empty(); if (fmgc.FMGCInternal.minDestFob < fmgc.FMGCInternal.finalFuel + fmgc.FMGCInternal.altFuel) { mcdu_message(i, "CHECK MIN DEST FOB"); @@ -161,12 +175,16 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.tow = fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel; fmgc.FMGCInternal.fuelRequest = 1; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); fmgc.FMGCInternal.blockCalculating = 0; + fmgc.blockCalculating.setValue(0); fmgc.FMGCInternal.blockConfirmed = 1; } else if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } else if (fmgc.FMGCInternal.fuelRequest) { fmgc.FMGCInternal.blockCalculating = 1; + fmgc.blockCalculating.setValue(1); } mcdu_scratchpad.scratchpads[i].empty(); } else if (find("/", scratchpad) != -1) { @@ -185,12 +203,16 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.tow = fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel; fmgc.FMGCInternal.fuelRequest = 1; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); fmgc.FMGCInternal.blockCalculating = 0; + fmgc.blockCalculating.setValue(0); fmgc.FMGCInternal.blockConfirmed = 1; } else if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } else if (fmgc.FMGCInternal.fuelRequest) { fmgc.FMGCInternal.blockCalculating = 1; + fmgc.blockCalculating.setValue(1); } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -215,12 +237,16 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.tow = fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel; fmgc.FMGCInternal.fuelRequest = 1; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); fmgc.FMGCInternal.blockCalculating = 0; + fmgc.blockCalculating.setValue(0); fmgc.FMGCInternal.blockConfirmed = 1; } else if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } else if (fmgc.FMGCInternal.fuelRequest) { fmgc.FMGCInternal.blockCalculating = 1; + fmgc.blockCalculating.setValue(1); } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -267,7 +293,9 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.extraTime = "0000"; fmgc.FMGCInternal.fuelRequest = 0; fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.fuelCalculating.setValue(0); fmgc.FMGCInternal.blockCalculating = 0; + fmgc.blockCalculating.setValue(0); fmgc.FMGCInternal.blockConfirmed = 0; mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -280,7 +308,9 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.tow = num(fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel); fmgc.FMGCInternal.fuelRequest = 1; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); fmgc.FMGCInternal.blockCalculating = 0; + fmgc.blockCalculating.setValue(0); fmgc.FMGCInternal.blockConfirmed = 1; } } else if (tfs >= 1 and tfs <= 5) { @@ -291,7 +321,9 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.tow = num(fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel); fmgc.FMGCInternal.fuelRequest = 1; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); fmgc.FMGCInternal.blockCalculating = 0; + fmgc.blockCalculating.setValue(0); fmgc.FMGCInternal.blockConfirmed = 1; } mcdu_scratchpad.scratchpads[i].empty(); @@ -306,9 +338,11 @@ var initInputB = func(key, i) { if (scratchpad == "" and fmgc.FMGCInternal.zfwSet and !fmgc.FMGCInternal.fuelRequest) { fmgc.FMGCInternal.fuelRequest = 1; fmgc.FMGCInternal.blockCalculating = 1; + fmgc.blockCalculating.setValue(1); } else if (scratchpad == "" and fmgc.FMGCInternal.zfwSet and fmgc.FMGCInternal.fuelRequest and !fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.blockCalculating) { fmgc.FMGCInternal.blockConfirmed = 1; fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } else { mcdu_message(i, "NOT ALLOWED"); } @@ -318,6 +352,7 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.tripWindValue = 0; if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -328,6 +363,7 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.tripWindValue = effwind; if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -340,6 +376,7 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.tripWindValue = effwind; if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } mcdu_scratchpad.scratchpads[i].empty(); } else { @@ -351,6 +388,7 @@ var initInputB = func(key, i) { fmgc.FMGCInternal.tripWindValue = scratchpad; if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } mcdu_scratchpad.scratchpads[i].empty(); } else { diff --git a/Nasal/MCDU/MCDU.nas b/Nasal/MCDU/MCDU.nas index beb00ce8..3e3eb097 100644 --- a/Nasal/MCDU/MCDU.nas +++ b/Nasal/MCDU/MCDU.nas @@ -127,8 +127,10 @@ var MCDU_reset = func(i) { fmgc.FMGCInternal.extraTime = "0000"; fmgc.FMGCInternal.fuelRequest = 0; fmgc.FMGCInternal.blockCalculating = 0; + fmgc.blockCalculating.setValue(0); fmgc.FMGCInternal.blockConfirmed = 0; fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.fuelCalculating.setValue(0); # FUELPRED fmgc.FMGCInternal.priUtc = "0000"; diff --git a/Nasal/MCDU/WINDCLB.nas b/Nasal/MCDU/WINDCLB.nas index ac1eb6a1..88923868 100644 --- a/Nasal/MCDU/WINDCLB.nas +++ b/Nasal/MCDU/WINDCLB.nas @@ -180,7 +180,9 @@ var windCLBPage = { # push update to fuel if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.fuelCalculating.setValue(0); fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } } me.reload(); @@ -318,7 +320,9 @@ var windCLBPage = { # push update to fuel if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.fuelCalculating.setValue(0); fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } } me.reload(); diff --git a/Nasal/MCDU/WINDCRZ.nas b/Nasal/MCDU/WINDCRZ.nas index 9fa99331..3ff01aba 100644 --- a/Nasal/MCDU/WINDCRZ.nas +++ b/Nasal/MCDU/WINDCRZ.nas @@ -271,7 +271,9 @@ var windCRZPage = { # push update to fuel if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.fuelCalculating.setValue(0); fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } } me.reload(); @@ -506,7 +508,9 @@ var windCRZPage = { # push update to fuel if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.fuelCalculating.setValue(0); fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } } me.reload(); diff --git a/Nasal/MCDU/WINDDES.nas b/Nasal/MCDU/WINDDES.nas index 980156b7..ad7ced64 100644 --- a/Nasal/MCDU/WINDDES.nas +++ b/Nasal/MCDU/WINDDES.nas @@ -216,7 +216,9 @@ var windDESPage = { # push update to fuel if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.fuelCalculating.setValue(0); fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } } me.reload(); @@ -388,7 +390,9 @@ var windDESPage = { # push update to fuel if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.fuelCalculating.setValue(0); fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); } } me.reload(); diff --git a/revision.txt b/revision.txt index c24b6ae7..72f523f3 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -38 \ No newline at end of file +39 \ No newline at end of file From 8793cdda358187c5b5f795b80dffa19ec6e4d36e Mon Sep 17 00:00:00 2001 From: legoboyvdlp R <legoboyvdlp@gmail.com> Date: Sat, 3 Oct 2020 16:48:31 +0100 Subject: [PATCH 13/16] Fix Simbrief parser to respect Simbrief weight option --- Nasal/FMGC/SimbriefParser.nas | 62 +++++++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 18 deletions(-) diff --git a/Nasal/FMGC/SimbriefParser.nas b/Nasal/FMGC/SimbriefParser.nas index f75a56e6..5454566c 100644 --- a/Nasal/FMGC/SimbriefParser.nas +++ b/Nasal/FMGC/SimbriefParser.nas @@ -1,6 +1,8 @@ # A3XX Simbrief Parser # Copyright (c) 2020 Jonathan Redpath (legoboyvdlp) +var LBS2KGS = 0.4535924; + var SimbriefParser = { node: nil, OFP: nil, @@ -37,6 +39,9 @@ var SimbriefParser = { me.store1 = nil; me.store2 = nil; + me.store1 = me.OFP.getChild("params"); + var units = me.store1.getChild("units").getValue(); + me.store1 = me.OFP.getChild("general"); me.store2 = me.OFP.getChild("alternate"); fmgc.FMGCInternal.flightNum = (me.store1.getChild("icao_airline").getValue() or "") ~ (me.store1.getChild("flight_number").getValue() or ""); @@ -154,29 +159,50 @@ var SimbriefParser = { # INITB me.store1 = me.OFP.getChild("fuel"); me.store2 = me.OFP.getChild("weights"); - fmgc.FMGCInternal.taxiFuel = me.store1.getChild("taxi").getValue() / 1000; - fmgc.FMGCInternal.taxiFuelSet = 1; - fmgc.FMGCInternal.altFuel = me.store1.getChild("alternate_burn").getValue() / 1000; - fmgc.FMGCInternal.altFuelSet = 1; - fmgc.FMGCInternal.finalFuel = me.store1.getChild("reserve").getValue() / 1000; - fmgc.FMGCInternal.finalFuelSet = 1; - fmgc.FMGCInternal.rteRsv = me.store1.getChild("contingency").getValue() / 1000; - fmgc.FMGCInternal.rteRsvSet = 1; - if ((me.store1.getChild("contingency").getValue() / 1000) / num(fmgc.FMGCInternal.tripFuel) * 100 <= 15.0) { - fmgc.FMGCInternal.rtePercent = (me.store1.getChild("contingency").getValue() / 1000) / num(fmgc.FMGCInternal.tripFuel) * 100; + if (units == "lbs") { + fmgc.FMGCInternal.taxiFuel = me.store1.getChild("taxi").getValue() / 1000; + fmgc.FMGCInternal.taxiFuelSet = 1; + fmgc.FMGCInternal.altFuel = me.store1.getChild("alternate_burn").getValue() / 1000; + fmgc.FMGCInternal.altFuelSet = 1; + fmgc.FMGCInternal.finalFuel = me.store1.getChild("reserve").getValue() / 1000; + fmgc.FMGCInternal.finalFuelSet = 1; + fmgc.FMGCInternal.rteRsv = me.store1.getChild("contingency").getValue() / 1000; + fmgc.FMGCInternal.rteRsvSet = 1; + if ((me.store1.getChild("contingency").getValue() / 1000) / num(fmgc.FMGCInternal.tripFuel) * 100 <= 15.0) { + fmgc.FMGCInternal.rtePercent = (me.store1.getChild("contingency").getValue() / 1000) / num(fmgc.FMGCInternal.tripFuel) * 100; + } else { + fmgc.FMGCInternal.rtePercent = 15.0 + } + fmgc.FMGCInternal.rtePercentSet = 0; + fmgc.FMGCInternal.block = me.store1.getChild("plan_ramp").getValue() / 1000; + fmgc.FMGCInternal.blockSet = 1; + fmgc.FMGCInternal.zfw = me.store2.getChild("est_zfw").getValue() / 1000; + fmgc.FMGCInternal.zfwSet = 1; + fmgc.FMGCInternal.tow = fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel; } else { - fmgc.FMGCInternal.rtePercent = 15.0 + fmgc.FMGCInternal.taxiFuel = (me.store1.getChild("taxi").getValue() / LBS2KGS) / 1000; + fmgc.FMGCInternal.taxiFuelSet = 1; + fmgc.FMGCInternal.altFuel = (me.store1.getChild("alternate_burn").getValue() / LBS2KGS) / 1000; + fmgc.FMGCInternal.altFuelSet = 1; + fmgc.FMGCInternal.finalFuel = (me.store1.getChild("reserve").getValue() / LBS2KGS) / 1000; + fmgc.FMGCInternal.finalFuelSet = 1; + fmgc.FMGCInternal.rteRsv = (me.store1.getChild("contingency").getValue() / LBS2KGS) / 1000; + fmgc.FMGCInternal.rteRsvSet = 1; + if (((me.store1.getChild("contingency").getValue() / LBS2KGS) / 1000) / num(fmgc.FMGCInternal.tripFuel) * 100 <= 15.0) { + fmgc.FMGCInternal.rtePercent = ((me.store1.getChild("contingency").getValue() / LBS2KGS) / 1000) / num(fmgc.FMGCInternal.tripFuel) * 100; + } else { + fmgc.FMGCInternal.rtePercent = 15.0 + } + fmgc.FMGCInternal.rtePercentSet = 0; + fmgc.FMGCInternal.block = (me.store1.getChild("plan_ramp").getValue() / LBS2KGS) / 1000; + fmgc.FMGCInternal.blockSet = 1; + fmgc.FMGCInternal.zfw = (me.store2.getChild("est_zfw").getValue() / LBS2KGS) / 1000; + fmgc.FMGCInternal.zfwSet = 1; + fmgc.FMGCInternal.tow = fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel; } - fmgc.FMGCInternal.rtePercentSet = 0; - fmgc.FMGCInternal.block = me.store1.getChild("plan_ramp").getValue() / 1000; - fmgc.FMGCInternal.blockSet = 1; - fmgc.FMGCInternal.zfw = me.store2.getChild("est_zfw").getValue() / 1000; - fmgc.FMGCInternal.zfwSet = 1; - fmgc.FMGCInternal.tow = fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel; setprop("/FMGC/internal/fuel-request-set", 1); setprop("/FMGC/internal/fuel-calculating", 1); setprop("/FMGC/internal/block-calculating", 0); setprop("/FMGC/internal/block-confirmed", 1); - }, }; \ No newline at end of file From b9f2593c82380ae4dec8beca5abdf0e8da490200 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R <legoboyvdlp@gmail.com> Date: Sat, 3 Oct 2020 16:59:06 +0100 Subject: [PATCH 14/16] Fix bug with wind component in simbrief parser --- Nasal/FMGC/SimbriefParser.nas | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Nasal/FMGC/SimbriefParser.nas b/Nasal/FMGC/SimbriefParser.nas index bcedfc5a..4141153e 100644 --- a/Nasal/FMGC/SimbriefParser.nas +++ b/Nasal/FMGC/SimbriefParser.nas @@ -59,12 +59,12 @@ var SimbriefParser = { fmgc.FMGCInternal.crzTemp = (((me.store1.getChild("initial_altitude").getValue() / 1000) * -2) + 15) + me.store1.getChild("avg_temp_dev").getValue(); fmgc.FMGCInternal.crzTempSet = 1; fmgc.FMGCInternal.crzProg = me.store1.getChild("initial_altitude").getValue() / 100; - if (me.store1.getChild("avg_wind_comp").getValue() >= 0) { - fmgc.FMGCInternal.tripWind = "TL" ~ me.store1.getChild("avg_wind_comp").getValue(); + if (num(me.store1.getChild("avg_wind_comp").getValue()) >= 0) { + fmgc.FMGCInternal.tripWind = "TL" ~ abs(me.store1.getChild("avg_wind_comp").getValue()); } else { - fmgc.FMGCInternal.tripWind = "HD" ~ me.store1.getChild("avg_wind_comp").getValue(); + fmgc.FMGCInternal.tripWind = "HD" ~ abs(me.store1.getChild("avg_wind_comp").getValue()); } - fmgc.FMGCInternal.tripWindValue = me.store1.getChild("avg_wind_comp").getValue(); + fmgc.FMGCInternal.tripWindValue = abs(me.store1.getChild("avg_wind_comp").getValue()); fmgc.FMGCInternal.altAirport = me.store2.getChild("icao_code").getValue(); fmgc.FMGCInternal.altAirportSet = 1; From 2b6e1520e3a351e7e18433faac2e62d0d2b06ebf Mon Sep 17 00:00:00 2001 From: legoboyvdlp R <legoboyvdlp@gmail.com> Date: Sun, 4 Oct 2020 15:18:22 +0100 Subject: [PATCH 15/16] Improve rudder trim / clock code to be faster / use no getprop or setprop --- Nasal/Libraries/property-tree-setup.nas | 17 ++ Nasal/Panels/clock.nas | 274 ++++++++++++++---------- 2 files changed, 176 insertions(+), 115 deletions(-) diff --git a/Nasal/Libraries/property-tree-setup.nas b/Nasal/Libraries/property-tree-setup.nas index 82b79e67..956150c0 100644 --- a/Nasal/Libraries/property-tree-setup.nas +++ b/Nasal/Libraries/property-tree-setup.nas @@ -50,6 +50,9 @@ var Controls = { parkingBrake: props.globals.getNode("/controls/gear/brake-parking"), chocks: props.globals.getNode("/services/chocks/enable"), }, + Switches: { + annunTest: props.globals.getNode("/controls/switches/annun-test"), + }, }; var ECAM = { @@ -90,6 +93,11 @@ var Fdm = { aileron: props.globals.getNode("/fdm/jsbsim/fbw/aileron-sidestick"), elevator: props.globals.getNode("/fdm/jsbsim/fbw/elevator-sidestick"), }, + Hydraulics: { + Rudder: { + trimDeg: props.globals.getNode("fdm/jsbsim/hydraulics/rudder/trim-deg"), + }, + }, Inertia: { weightLbs: props.globals.getNode("/fdm/jsbsim/inertia/weight-lbs"), }, @@ -130,6 +138,10 @@ var Instrumentation = { settingInhg: props.globals.getNode("/instrumentation/altimeter[0]/setting-inhg"), std: props.globals.getNode("/instrumentation/altimeter[0]/std"), }, + Clock: { + indicatedString: props.globals.getNode("/instrumentation/clock/indicated-string"), + indicatedStringShort: props.globals.getNode("/instrumentation/clock/indicated-short-string"), + }, Efis: { Inputs: { arpt: [props.globals.initNode("/instrumentation/efis[0]/inputs/arpt", 0, "BOOL"), props.globals.initNode("/instrumentation/efis[1]/inputs/arpt", 0, "BOOL")], @@ -200,6 +212,11 @@ var Sim = { Time: { deltaRealtimeSec: props.globals.getNode("/sim/time/delta-realtime-sec"), elapsedSec: props.globals.getNode("/sim/time/elapsed-sec"), + UTC: { + day: props.globals.getNode("/sim/time/utc/day"), + month: props.globals.getNode("/sim/time/utc/month"), + year: props.globals.getNode("/sim/time/utc/year"), + }, }, Version: props.globals.getNode("/sim/version/flightgear"), }; diff --git a/Nasal/Panels/clock.nas b/Nasal/Panels/clock.nas index 87c7b3cb..558cac2c 100644 --- a/Nasal/Panels/clock.nas +++ b/Nasal/Panels/clock.nas @@ -4,200 +4,244 @@ var chr = aircraft.timer.new("instrumentation/chrono[0]/elapsetime-sec",1); var clk = aircraft.timer.new("instrumentation/clock/elapsetime-sec",1); +var chr_min = nil; +var chr_sec = nil; +var chr_tmp = nil; +var clock2_1 = nil; +var clock2_2 = nil; +var day = nil; +var et_hr = nil; +var et_min = nil; +var et_tmp = nil; +var month = nil; +var rudder_val = nil; +var tmp = nil; +var tmp1 = nil; +var UTC_date = nil; +var UTC_date1 = nil; +var UTC_date2 = nil; +var UTC_date3 = nil; +var year = nil; + +var et_selector = props.globals.initNode("/instrumentation/clock/et-selector", 1, "INT"); +var utc_selector = props.globals.initNode("/instrumentation/clock/utc-selector",0,"INT"); +var set_knob = props.globals.initNode("/instrumentation/clock/set-knob",0,"INT"); + +var clock = { + elapsedHour: props.globals.initNode("/instrumentation/clock/et-hr", 0, "INT"), + elapsedMin: props.globals.initNode("/instrumentation/clock/et-min", 0, "INT"), + elapsedString: props.globals.initNode("/instrumentation/clock/elapsed-string", 0, "STRING"), + elapsedSec: props.globals.initNode("/instrumentation/clock/elapsetime-sec", 0, "INT"), + indicatedSec: props.globals.getNode("/instrumentation/clock/indicated-seconds"), + hhMM: props.globals.initNode("/instrumentation/clock/clock_hh_mm", 0, "STRING"), + utcDate: [props.globals.initNode("/instrumentation/clock/utc-date", "", "STRING"), props.globals.initNode("/instrumentation/clock/utc-date1", "", "STRING"), + props.globals.initNode("/instrumentation/clock/utc-date2", "", "STRING"),props.globals.initNode("/instrumentation/clock/utc-date3", "", "STRING")], + +}; + +var chrono = { + chronoReset: props.globals.initNode("/instrumentation/chrono[0]/chrono-reset", 1, "INT"), + elapseTime: props.globals.initNode("/instrumentation/chrono[0]/elapsetime-sec", 0, "INT"), + etMin: props.globals.initNode("/instrumentation/chrono[0]/chr-et-min", 0, "INT"), + etSec: props.globals.initNode("/instrumentation/chrono[0]/chr-et-sec", 0, "INT"), + etString: props.globals.initNode("/instrumentation/chrono[0]/chr-et-string", 0, "STRING"), + paused: props.globals.getNode("/instrumentation/chrono[0]/paused"), + started: props.globals.getNode("/instrumentation/chrono[0]/started"), +}; + +var rudderTrim = { + rudderTrimDisplay: props.globals.initNode("/controls/flight/rudder-trim-display", 0, "STRING"), + rudderTrimDisplayLetter: props.globals.initNode("/controls/flight/rudder-trim-letter-display", "", "STRING"), +}; + setlistener("sim/signals/fdm-initialized", func { chr.stop(); chr.reset(); clk.stop(); clk.reset(); - props.globals.initNode("instrumentation/clock/clock_hh_mm", 0,"STRING"); - props.globals.initNode("instrumentation/clock/indicated-string",0,"STRING"); - props.globals.initNode("instrumentation/clock/elapsed-string",0,"STRING"); - props.globals.initNode("instrumentation/clock/elapsetime-sec",0,"INT"); - props.globals.initNode("instrumentation/clock/et-selector",1,"INT"); - props.globals.initNode("instrumentation/clock/utc-selector",0,"INT"); - props.globals.initNode("instrumentation/clock/set-knob",0,"INT"); - props.globals.initNode("instrumentation/clock/et-hr",0,"INT"); - props.globals.initNode("instrumentation/clock/et-min",0,"INT"); - props.globals.initNode("instrumentation/chrono[0]/chr-et-string",0,"STRING"); - props.globals.initNode("instrumentation/chrono[0]/elapsetime-sec",0,"INT"); - props.globals.initNode("instrumentation/chrono[0]/chrono-reset",1,"INT"); - props.globals.initNode("instrumentation/chrono[0]/chr-et-min",0,"INT"); - props.globals.initNode("instrumentation/chrono[0]/chr-et-sec",0,"INT"); - props.globals.initNode("controls/flight/rudder-trim-display",0,"STRING"); - setprop("/controls/flight/rudder-trim-display", sprintf("%2.1f", getprop("fdm/jsbsim/hydraulics/rudder/trim-deg"))); + rudderTrim.rudderTrimDisplay.setValue(sprintf("%2.1f", pts.Fdm.JSBsim.Hydraulics.Rudder.trimDeg.getValue())); start_loop.start(); }); -setlistener("instrumentation/chrono[0]/chrono-reset", func(et){ - var tmp = et.getValue(); +setlistener("/instrumentation/chrono[0]/chrono-reset", func(et){ + tmp = et.getValue(); if (tmp == 2) { - if (getprop("instrumentation/chrono[0]/started") == 1) { - if (getprop("instrumentation/chrono[0]/paused") == 0) { - setprop("/instrumentation/chrono[0]/elapsetime-sec", 0); - setprop("/instrumentation/chrono[0]/chrono-reset", 0); + if (chrono.started.getBoolValue()) { + if (!chrono.paused.getBoolValue()) { + chrono.elapseTime.setValue(0); + chrono.chronoReset.setBoolValue(0); } else { chr.stop(); chr.reset(); - setprop("/instrumentation/chrono[0]/chrono-reset", 1); - setprop("/instrumentation/chrono[0]/started", 0); - setprop("/instrumentation/chrono[0]/paused", 0); + chrono.chronoReset.setBoolValue(1); + chrono.started.setBoolValue(0); + chrono.paused.setBoolValue(0); }; } else { - if (getprop("instrumentation/chrono[0]/paused") == 0) { + if (!chrono.paused.getBoolValue()) { # No action required } else { - setprop("/instrumentation/chrono[0]/paused", 0); + chrono.paused.setBoolValue(0); }; }; } elsif (tmp == 1) { - if (getprop("instrumentation/chrono[0]/started") == 1) { - if (getprop("instrumentation/chrono[0]/paused") == 0) { + if (chrono.started.getBoolValue()) { + if (!chrono.paused.getBoolValue()) { chr.stop(); - setprop("/instrumentation/chrono[0]/paused", 1); + chrono.paused.setBoolValue(1); } else { chr.stop(); }; } else { - if (getprop("instrumentation/chrono[0]/paused") == 0) { + if (!chrono.paused.getBoolValue()) { chr.stop(); } else { chr.stop(); - setprop("/instrumentation/chrono[0]/paused", 0); + chrono.paused.setBoolValue(0); }; }; } elsif (tmp == 0) { - if (getprop("instrumentation/chrono[0]/started") == 0) { - if (getprop("instrumentation/chrono[0]/paused") == 0) { + if (!chrono.started.getBoolValue()) { + if (!chrono.paused.getBoolValue()) { chr.start(); - setprop("/instrumentation/chrono[0]/started", 1); + chrono.started.setBoolValue(1); } else { chr.start(); - setprop("/instrumentation/chrono[0]/paused", 0); + chrono.paused.setBoolValue(0); }; } else { - if (getprop("instrumentation/chrono[0]/paused") == 0) { + if (!chrono.paused.getBoolValue()) { # No action required } else { chr.start(); - setprop("/instrumentation/chrono[0]/paused", 0); + chrono.paused.setBoolValue(0); }; }; }; -},0,0); +}, 0, 0); setlistener("instrumentation/clock/et-selector", func(et){ - var tmp1 = et.getValue(); - if(tmp1 == 2){ + tmp1 = et.getValue(); + if (tmp1 == 2){ clk.reset(); - }elsif(tmp1==1){ + } elsif (tmp1 == 1){ clk.stop(); - }elsif(tmp1==0){ + } elsif (tmp1 == 0){ clk.start(); } -},0,0); +}, 0, 0); var start_loop = maketimer(0.1, func { if (systems.ELEC.Bus.dcEss.getValue() < 25) { return; } + # Annun-test - if (getprop("controls/switches/annun-test") == 1) { - var UTC_date = sprintf("%02d %02d %02d", "88", "88", "88"); - var UTC_date1 = sprintf("%02d", "88"); - var UTC_date2 = sprintf("%02d", "88"); - var UTC_date3 = sprintf("%02d", "88"); - var clock2_1 = "88:88"; - var clock2_2 = sprintf("%02d", 88); - setprop("/instrumentation/clock/clock_hh_mm", clock2_1); - setprop("/instrumentation/clock/indicated-seconds", clock2_2); - setprop("/instrumentation/clock/utc-date", UTC_date); - setprop("/instrumentation/clock/utc-date1", UTC_date1); - setprop("/instrumentation/clock/utc-date2", UTC_date2); - setprop("/instrumentation/clock/utc-date3", UTC_date3); - setprop("/instrumentation/chrono[0]/chr-et-string", "88 88"); - setprop("/instrumentation/clock/elapsed-string", "88:88"); + if (pts.Controls.Switches.annunTest.getBoolValue()) { + UTC_date = sprintf("%02d %02d %02d", "88", "88", "88"); + UTC_date1 = sprintf("%02d", "88"); + UTC_date2 = sprintf("%02d", "88"); + UTC_date3 = sprintf("%02d", "88"); + clock2_1 = "88:88"; + clock2_2 = sprintf("%02d", 88); + + clock.hhMM.setValue(clock2_1); + clock.indicatedSec.setValue(clock2_2); + clock.utcDate[0].setValue(UTC_date); + clock.utcDate[1].setValue(UTC_date1); + clock.utcDate[2].setValue(UTC_date2); + clock.utcDate[3].setValue(UTC_date3); + + chrono.etString.setValue("88 88"); + clock.elapsedString.setValue("88:88"); } else { + day = pts.Sim.Time.UTC.day.getValue(); + month = pts.Sim.Time.UTC.month.getValue(); + year = pts.Sim.Time.UTC.year.getValue(); + # Clock - var UTC_date = sprintf("%02d %02d %02d", getprop("sim/time/utc/month"), getprop("sim/time/utc/day"), substr(sprintf("%2d", getprop("sim/time/utc/year")),1,2)); - setprop("/instrumentation/clock/utc-date", UTC_date); - var UTC_date1 = sprintf("%02d", getprop("sim/time/utc/month")); - var UTC_date2 = sprintf("%02d", getprop("sim/time/utc/day")); - var UTC_date3 = substr(sprintf("%2d", getprop("sim/time/utc/year")),2,2); - var clock2_1 = getprop("instrumentation/clock/indicated-short-string"); - var clock2_2 = sprintf("%02d", substr(getprop("instrumentation/clock/indicated-string"),6,2)); - setprop("/instrumentation/clock/clock_hh_mm", clock2_1); - setprop("/instrumentation/clock/indicated-seconds", clock2_2); - setprop("/instrumentation/clock/utc-date", UTC_date); - setprop("/instrumentation/clock/utc-date1", UTC_date1); - setprop("/instrumentation/clock/utc-date2", UTC_date2); - setprop("/instrumentation/clock/utc-date3", UTC_date3); - if (getprop("instrumentation/clock/set-knob") == "") { - setprop("/instrumentation/clock/set-knob", 0); - }; - if (getprop("instrumentation/clock/utc-selector") == "") { - setprop("/instrumentation/clock/utc-selector", 0); - }; -# if (getprop("instrumentation/clock/utc-selector") == 0) { + UTC_date = sprintf("%02d %02d %02d", month, day, substr(sprintf("%2d", year),1,2)); + UTC_date1 = sprintf("%02d", month); + UTC_date2 = sprintf("%02d", day); + UTC_date3 = substr(sprintf("%2d", year),2,2); + clock2_1 = pts.Instrumentation.Clock.indicatedStringShort.getValue(); + clock2_2 = sprintf("%02d", substr(pts.Instrumentation.Clock.indicatedString.getValue(),6,2)); + + clock.hhMM.setValue(clock2_1); + clock.indicatedSec.setValue(clock2_2); + clock.utcDate[0].setValue(UTC_date); + clock.utcDate[1].setValue(UTC_date1); + clock.utcDate[2].setValue(UTC_date2); + clock.utcDate[3].setValue(UTC_date3); + + if (set_knob.getValue() == "") { + set_knob.setValue(0); + } + + if (utc_selector.getValue() == "") { + utc_selector.setValue(0); + } + +# if (getprop("/instrumentation/clock/utc-selector") == 0) { # # To do - GPS mode # }; -# if (getprop("instrumentation/clock/utc-selector") == 1) { +# if (getprop("/instrumentation/clock/utc-selector") == 1) { # # To do - INT mode # }; -# if (getprop("instrumentation/clock/utc-selector") == 2) { +# if (getprop("/instrumentation/clock/utc-selector") == 2) { # # To do - SET mode # }; # Chrono - var chr_tmp = getprop("instrumentation/chrono[0]/elapsetime-sec"); + chr_tmp = chrono.elapseTime.getValue(); if (chr_tmp >= 6000) { - setprop("/instrumentation/chrono[0]/elapsetime-sec", chr_tmp-6000); - }; - var chr_min = int(chr_tmp * 0.0166666666667); + chrono.elapseTime.setValue(chr_tmp - 6000); + } + + chr_min = int(chr_tmp * 0.0166666666667); if (chr_tmp >= 60) { - var chr_sec = int(chr_tmp - (chr_min * 60)); + chr_sec = int(chr_tmp - (chr_min * 60)); } else { - var chr_sec = int(chr_tmp); - }; - setprop("/instrumentation/chrono[0]/chr-et-min",chr_min); - setprop("/instrumentation/chrono[0]/chr-et-sec",chr_sec); - chr_tmp = sprintf("%02d:%02d", chr_min, chr_sec); - setprop("/instrumentation/chrono[0]/chr-et-string", chr_tmp); + chr_sec = int(chr_tmp); + } + + chrono.etMin.setValue(chr_min); + chrono.etSec.setValue(chr_sec); + chrono.etString.setValue(sprintf("%02d:%02d", chr_min, chr_sec)); # ET clock - var et_tmp = getprop("instrumentation/clock/elapsetime-sec"); + et_tmp = clock.elapsedSec.getValue(); if (et_tmp >= 360000) { - setprop("/instrumentation/clock/elapsetime-sec", et_tmp-360000); - }; - var et_min = int(et_tmp * 0.0166666666667); - var et_hr = int(et_min * 0.0166666666667); + clock.elapsedSec.setValue(et_tmp - 360000); + } + + et_min = int(et_tmp * 0.0166666666667); + et_hr = int(et_min * 0.0166666666667); et_min = et_min - (et_hr * 60); - setprop("/instrumentation/clock/et-hr",et_hr); - setprop("/instrumentation/clock/et-min",et_min); - et_tmp = sprintf("%02d:%02d", et_hr, et_min); - setprop("/instrumentation/clock/elapsed-string", et_tmp); + + clock.elapsedHour.setValue(et_hr); + clock.elapsedMin.setValue(et_min); + clock.elapsedString.setValue(sprintf("%02d:%02d", et_hr, et_min)); foreach (item; update_items) { item.update(nil); } - }; + } }); var updateRudderTrim = func() { - var rudder_val = getprop("fdm/jsbsim/hydraulics/rudder/trim-deg"); - if (getprop("/controls/switches/annun-test") == 1) { - setprop("/controls/flight/rudder-trim-display", sprintf("%3.1f", "88.8")); - setprop("/controls/flight/rudder-trim-letter-display", sprintf("%1.0f", "8")); + if (pts.Controls.Switches.annunTest.getBoolValue()) { + rudderTrim.rudderTrimDisplay.setValue(sprintf("%3.1f", "88.8")); + rudderTrim.rudderTrimDisplayLetter.setValue(sprintf("%1.0f", "8")); } else { + rudder_val = pts.Fdm.JSBsim.Hydraulics.Rudder.trimDeg.getValue(); if (rudder_val > -0.05 and rudder_val < 0.05) { - setprop("/controls/flight/rudder-trim-display", sprintf("%2.1f", abs(rudder_val))); - setprop("/controls/flight/rudder-trim-letter-display", ""); + rudderTrim.rudderTrimDisplay.setValue(sprintf("%2.1f", abs(rudder_val))); + rudderTrim.rudderTrimDisplayLetter.setValue(""); } else { + rudderTrim.rudderTrimDisplay.setValue(sprintf("%2.1f", abs(rudder_val))); if (rudder_val >= 0.05) { - setprop("/controls/flight/rudder-trim-display", sprintf("%2.1f", abs(rudder_val))); - setprop("/controls/flight/rudder-trim-letter-display", "R"); - } else { - if (rudder_val <= -0.05) { - setprop("/controls/flight/rudder-trim-display", sprintf("%2.1f", abs(rudder_val))); - setprop("/controls/flight/rudder-trim-letter-display", "L"); - } + rudderTrim.rudderTrimDisplayLetter.setValue("R"); + } elsif (rudder_val <= -0.05) { + rudderTrim.rudderTrimDisplayLetter.setValue("L"); } } } From 23dabc4b6709931428681aaca18d455f0fd17e81 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R <legoboyvdlp@gmail.com> Date: Sun, 4 Oct 2020 15:23:37 +0100 Subject: [PATCH 16/16] Formatting --- Nasal/Autopush/autopush.nas | 68 +++++++-------- Nasal/Autopush/autopush_driver.nas | 32 +++---- Nasal/Autopush/autopush_route.nas | 36 ++++---- Nasal/Displays/DMC.nas | 12 +-- Nasal/ECAM/ECAM-controller.nas | 2 +- Nasal/ECAM/ECAM-logic.nas | 8 +- Nasal/ECAM/ECAM-main.nas | 2 +- Nasal/ECAM/ECAM-phases.nas | 4 +- Nasal/Effects/icing.nas | 2 +- Nasal/Effects/light-manager.nas | 132 ++++++++++++++--------------- Nasal/Effects/thunder-effects.nas | 18 ++-- Nasal/FMGC/FMGC.nas | 46 +++++----- Nasal/Libraries/libraries.nas | 18 ++-- Nasal/Libraries/zoom-views.nas | 28 +++--- Nasal/MCDU/IRSINIT.nas | 6 +- Nasal/MCDU/PERFGA.nas | 4 +- Nasal/MCDU/PERFTO.nas | 6 +- Nasal/MCDU/RADNAV.nas | 2 +- Nasal/Panels/SwitchingPanel.nas | 6 +- Nasal/Panels/acp.nas | 4 +- Nasal/Panels/atc.nas | 12 +-- Nasal/Panels/rmp.nas | 20 ++--- Nasal/Systems/electrical.nas | 28 +++--- Nasal/Systems/ground_services.nas | 26 +++--- Nasal/Systems/payload.nas | 12 +-- 25 files changed, 267 insertions(+), 267 deletions(-) diff --git a/Nasal/Autopush/autopush.nas b/Nasal/Autopush/autopush.nas index bef82294..7000abd6 100644 --- a/Nasal/Autopush/autopush.nas +++ b/Nasal/Autopush/autopush.nas @@ -26,7 +26,7 @@ var _unitconv = M2FT / 3.6; var _debug = nil; var _loop = func() { - if (!getprop("sim/model/autopush/available")) { + if (!getprop("/sim/model/autopush/available")) { _stop(); return; } @@ -37,9 +37,9 @@ var _loop = func() { # Rollspeed is only adequate if the wheel is touching the ground. if (getprop("gear/gear[0]/wow")) { var V = getprop("gear/gear[0]/rollspeed-ms") * 3.6; - var deltaV = getprop("sim/model/autopush/target-speed-km_h") - V; + var deltaV = getprop("/sim/model/autopush/target-speed-km_h") - V; var minus_dV = _V - V; - var time = getprop("sim/time/elapsed-sec"); + var time = getprop("/sim/time/elapsed-sec"); var prop = math.min(math.max(_K_p * deltaV, -_F_p), _F_p); var dt = time - _time; var deriv = 0.0; @@ -63,24 +63,24 @@ var _loop = func() { } else { force = accel * getprop("fdm/yasim/gross-weight-lbs") * _unitconv; } - var pitch = getprop("sim/model/autopush/pitch-deg") * D2R; + var pitch = getprop("/sim/model/autopush/pitch-deg") * D2R; z = math.sin(pitch); var pz = math.cos(pitch); - var yaw = getprop("sim/model/autopush/yaw") * _K_yaw; + var yaw = getprop("/sim/model/autopush/yaw") * _K_yaw; x = math.cos(yaw) * pz; y = math.sin(yaw) * pz; - setprop("sim/model/autopush/force-x", x); - setprop("sim/model/autopush/force-y", y); + setprop("/sim/model/autopush/force-x", x); + setprop("/sim/model/autopush/force-y", y); # JSBSim force's z is down. - setprop("sim/model/autopush/force-z", -z); + setprop("/sim/model/autopush/force-z", -z); } - setprop("sim/model/autopush/force-lbf", force); + setprop("/sim/model/autopush/force-lbf", force); if (_yasim) { # The force is divided by YASim thrust="100000.0" setting. - setprop("sim/model/autopush/force-x-yasim", x * force * 0.00001); + setprop("/sim/model/autopush/force-x-yasim", x * force * 0.00001); # YASim force's y is to the left. - setprop("sim/model/autopush/force-y-yasim", -y * force * 0.00001); - setprop("sim/model/autopush/force-z-yasim", z * force * 0.00001); + setprop("/sim/model/autopush/force-y-yasim", -y * force * 0.00001); + setprop("/sim/model/autopush/force-z-yasim", z * force * 0.00001); } } @@ -89,26 +89,26 @@ var _timer = maketimer(0.0167, func{_loop()}); var _start = func() { # Else overwritten by dialog. settimer(func() { - setprop("sim/model/autopush/target-speed-km_h", 0.0) + setprop("/sim/model/autopush/target-speed-km_h", 0.0) }, 0.1); - _K_p = getprop("sim/model/autopush/K_p"); - _F_p = getprop("sim/model/autopush/F_p"); - _K_i = getprop("sim/model/autopush/K_i"); - _F_i = getprop("sim/model/autopush/F_i"); - _K_d = getprop("sim/model/autopush/K_d"); - _F_d = getprop("sim/model/autopush/F_d"); - _F = getprop("sim/model/autopush/F"); - _T_f = getprop("sim/model/autopush/T_f"); - _K_yaw = getprop("sim/model/autopush/yaw-mult") * D2R; - _yasim = (getprop("sim/flight-model") == "yasim"); - _debug = getprop("sim/model/autopush/debug") or 0; + _K_p = getprop("/sim/model/autopush/K_p"); + _F_p = getprop("/sim/model/autopush/F_p"); + _K_i = getprop("/sim/model/autopush/K_i"); + _F_i = getprop("/sim/model/autopush/F_i"); + _K_d = getprop("/sim/model/autopush/K_d"); + _F_d = getprop("/sim/model/autopush/F_d"); + _F = getprop("/sim/model/autopush/F"); + _T_f = getprop("/sim/model/autopush/T_f"); + _K_yaw = getprop("/sim/model/autopush/yaw-mult") * D2R; + _yasim = (getprop("/sim/flight-model") == "yasim"); + _debug = getprop("/sim/model/autopush/debug") or 0; _int = 0.0; _V = 0.0; - _time = getprop("sim/time/elapsed-sec"); - setprop("sim/model/autopush/connected", 1); + _time = getprop("/sim/time/elapsed-sec"); + setprop("/sim/model/autopush/connected", 1); if (!_timer.isRunning) { - if (getprop("sim/model/autopush/chocks")) { - setprop("sim/model/autopush/chocks", 0); + if (getprop("/sim/model/autopush/chocks")) { + setprop("/sim/model/autopush/chocks", 0); screen.log.write("(pushback): Pushback connected, chocks removed. Please release brakes."); } else { screen.log.write("(pushback): Pushback connected, please release brakes."); @@ -122,18 +122,18 @@ var _stop = func() { screen.log.write("(pushback): Pushback and bypass pin removed."); } _timer.stop(); - setprop("sim/model/autopush/force-lbf", 0.0); + setprop("/sim/model/autopush/force-lbf", 0.0); if (_yasim) { - setprop("sim/model/autopush/force-x-yasim", 0.0); - setprop("sim/model/autopush/force-y-yasim", 0.0); + setprop("/sim/model/autopush/force-x-yasim", 0.0); + setprop("/sim/model/autopush/force-y-yasim", 0.0); } - setprop("sim/model/autopush/connected", 0); - setprop("sim/model/autopush/enabled", 0); + setprop("/sim/model/autopush/connected", 0); + setprop("/sim/model/autopush/enabled", 0); } setlistener("/sim/model/autopush/enabled", func(p) { var enabled = p.getValue(); - if ((enabled) and getprop("sim/model/autopush/available")) { + if ((enabled) and getprop("/sim/model/autopush/available")) { _start(); } else { _stop(); diff --git a/Nasal/Autopush/autopush_driver.nas b/Nasal/Autopush/autopush_driver.nas index dc277ff9..6c4e46f7 100644 --- a/Nasal/Autopush/autopush_driver.nas +++ b/Nasal/Autopush/autopush_driver.nas @@ -46,7 +46,7 @@ var _advance_wp = func(flip_sign = 0) { } var _loop = func() { - if (!getprop("sim/model/autopush/connected")) { + if (!getprop("/sim/model/autopush/connected")) { stop(); return; } @@ -56,7 +56,7 @@ var _loop = func() { var deltapsi = geo.normdeg180(A - psi_leg); var psi = getprop("orientation/heading-deg") + _push * 180.0; var deltaA = math.min(math.max(_K_psi * geo.normdeg180(A - psi), -_F_psi), _F_psi); - var time = getprop("sim/time/elapsed-sec"); + var time = getprop("/sim/time/elapsed-sec"); var dt = time - _time; var minus_psidot = (dt > 0.002) * math.min(math.max(_K_psidot * (_psi - psi) / dt, -_F_psidot), _F_psidot); _psi = psi; @@ -83,8 +83,8 @@ var _loop = func() { if (_debug > 1) { print("autopush_driver to_wp " ~ _to_wp ~ ", A " ~ geo.normdeg(A) ~ ", deltaA " ~ deltaA ~ ", minus_psidot " ~ minus_psidot); } - setprop("sim/model/autopush/target-speed-km_h", _sign * V); - setprop("sim/model/autopush/steer-cmd-norm", steering); + setprop("/sim/model/autopush/target-speed-km_h", _sign * V); + setprop("/sim/model/autopush/steer-cmd-norm", steering); } var _timer = maketimer(0.051, func{_loop()}); @@ -100,7 +100,7 @@ var start = func() { gui.popupTip("Already moving"); return; } - if (!getprop("sim/model/autopush/connected")) { + if (!getprop("/sim/model/autopush/connected")) { gui.popupTip("Pushback not connected"); return; } @@ -112,15 +112,15 @@ var start = func() { } else { autopush_route.done(); } - _K_V = getprop("sim/model/autopush/driver/K_V"); - _F_V = getprop("sim/model/autopush/driver/F_V"); - _R_turn_min = getprop("sim/model/autopush/min-turn-radius-m"); - _D_stop = getprop("sim/model/autopush/stopping-distance-m"); - _K_psi = getprop("sim/model/autopush/driver/K_psi"); - _F_psi = getprop("sim/model/autopush/driver/F_psi"); - _K_psidot = getprop("sim/model/autopush/driver/K_psidot"); - _F_psidot = getprop("sim/model/autopush/driver/F_psidot"); - _debug = getprop("sim/model/autopush/debug") or 0; + _K_V = getprop("/sim/model/autopush/driver/K_V"); + _F_V = getprop("/sim/model/autopush/driver/F_V"); + _R_turn_min = getprop("/sim/model/autopush/min-turn-radius-m"); + _D_stop = getprop("/sim/model/autopush/stopping-distance-m"); + _K_psi = getprop("/sim/model/autopush/driver/K_psi"); + _F_psi = getprop("/sim/model/autopush/driver/F_psi"); + _K_psidot = getprop("/sim/model/autopush/driver/K_psidot"); + _F_psidot = getprop("/sim/model/autopush/driver/F_psidot"); + _debug = getprop("/sim/model/autopush/debug") or 0; if (!_to_wp) { var (psi_park, D_park) = courseAndDistance(_route[0], _route[1]); _push = (abs(geo.normdeg180(getprop("orientation/heading-deg") - psi_park)) > 90.0); @@ -128,7 +128,7 @@ var start = func() { _advance_wp(); _psi = 0.0; } - _time = getprop("sim/time/elapsed-sec"); + _time = getprop("/sim/time/elapsed-sec"); _timer.start(); var endsign = _sign; for (ii = _to_wp; ii < size(_route_reverse); ii += 1) { @@ -146,7 +146,7 @@ var start = func() { var pause = func() { _timer.stop(); - setprop("sim/model/autopush/target-speed-km_h", 0.0); + setprop("/sim/model/autopush/target-speed-km_h", 0.0); } var stop = func() { diff --git a/Nasal/Autopush/autopush_route.nas b/Nasal/Autopush/autopush_route.nas index 20ca5894..5dd54c8c 100644 --- a/Nasal/Autopush/autopush_route.nas +++ b/Nasal/Autopush/autopush_route.nas @@ -29,7 +29,7 @@ var _R_turn_min = 0; var _invalid = 0; # Make top-down view point north in old FG. -var __fg_version = num(string.replace(getprop("sim/version/flightgear"),".","")); +var __fg_version = num(string.replace(getprop("/sim/version/flightgear"),".","")); if (__fg_version < 201920) { _top_view_heading_offset_deg = 94.5; } @@ -144,14 +144,14 @@ var top_view = func() { return; } _top_view_index = view.indexof("Chase View Without Yaw"); - _reset_view_index = getprop("sim/current-view/view-number"); - setprop("sim/current-view/view-number", _top_view_index); - _view_pitch_offset_deg = getprop("sim/current-view/pitch-offset-deg"); - _view_heading_offset_deg = getprop("sim/current-view/heading-offset-deg"); - _view_z_offset = getprop("sim/current-view/z-offset-m"); - setprop("sim/current-view/z-offset-m", -500.0); - setprop("sim/current-view/heading-offset-deg", _top_view_heading_offset_deg); - setprop("sim/current-view/pitch-offset-deg", 90.0); + _reset_view_index = getprop("/sim/current-view/view-number"); + setprop("/sim/current-view/view-number", _top_view_index); + _view_pitch_offset_deg = getprop("/sim/current-view/pitch-offset-deg"); + _view_heading_offset_deg = getprop("/sim/current-view/heading-offset-deg"); + _view_z_offset = getprop("/sim/current-view/z-offset-m"); + setprop("/sim/current-view/z-offset-m", -500.0); + setprop("/sim/current-view/heading-offset-deg", _top_view_heading_offset_deg); + setprop("/sim/current-view/pitch-offset-deg", 90.0); _view_listener = setlistener("/sim/current-view/name", func { _finalize_top_view(); }, 0, 0); @@ -164,11 +164,11 @@ var _finalize_top_view = func() { removelistener(_view_listener); _view_listener = nil; # Go back to the view to restore settings, in case user has switched away. - setprop("sim/current-view/view-number", _top_view_index); - setprop("sim/current-view/z-offset-m", _view_z_offset); - setprop("sim/current-view/heading-offset-deg", _view_heading_offset_deg); - setprop("sim/current-view/pitch-offset-deg", _view_pitch_offset_deg); - setprop("sim/current-view/view-number", _reset_view_index); + setprop("/sim/current-view/view-number", _top_view_index); + setprop("/sim/current-view/z-offset-m", _view_z_offset); + setprop("/sim/current-view/heading-offset-deg", _view_heading_offset_deg); + setprop("/sim/current-view/pitch-offset-deg", _view_pitch_offset_deg); + setprop("/sim/current-view/view-number", _reset_view_index); if (!_show) { _clear_user_point_models(); _clear_waypoint_models(); @@ -330,7 +330,7 @@ var _check_turn_radius = func() { } } - setprop("sim/model/autopush/route/invalid", _invalid); + setprop("/sim/model/autopush/route/invalid", _invalid); } setlistener("/sim/model/autopush/route/show", func(p) { @@ -351,7 +351,7 @@ setlistener("/sim/model/autopush/route/show", func(p) { var enter = func() { clear(); top_view(); - _R_turn_min = getprop("sim/model/autopush/min-turn-radius-m"); + _R_turn_min = getprop("/sim/model/autopush/min-turn-radius-m"); var wp = geo.aircraft_position(); var H = geo.elevation(wp.lat(), wp.lon()); if (H != nil) { @@ -362,7 +362,7 @@ var enter = func() { _add(geo.click_position()); }); # This property can be overridden manually, if needed. - var wingspan = getprop("sim/model/autopush/route/wingspan-m"); + var wingspan = getprop("/sim/model/autopush/route/wingspan-m"); if ((wingspan == nil) or (wingspan == 0.0)) { # JSBSim wingspan = getprop("fdm/jsbsim/metrics/bw-ft"); @@ -372,7 +372,7 @@ var enter = func() { # YAsim wingspan = getprop("fdm/yasim/model/wings/wing/wing-span"); } - setprop("sim/model/autopush/route/wingspan-m", wingspan); + setprop("/sim/model/autopush/route/wingspan-m", wingspan); } } diff --git a/Nasal/Displays/DMC.nas b/Nasal/Displays/DMC.nas index 4963deb6..6b555bf9 100644 --- a/Nasal/Displays/DMC.nas +++ b/Nasal/Displays/DMC.nas @@ -10,12 +10,12 @@ var DMC = { new: func(num) { var d = { parents:[DMC] }; d.activeADIRS = num; - d.airspeeds = [props.globals.getNode("systems/navigation/adr/output/cas-1", 1), props.globals.getNode("systems/navigation/adr/output/cas-2", 1), props.globals.getNode("systems/navigation/adr/output/cas-3", 1)]; - d.altitudes = [props.globals.getNode("systems/navigation/adr/output/baro-alt-corrected-1-capt", 1), props.globals.getNode("systems/navigation/adr/output/baro-alt-corrected-2-capt", 1), props.globals.getNode("systems/navigation/adr/output/baro-alt-corrected-3-capt", 1)]; - d.machs = [props.globals.getNode("systems/navigation/adr/output/mach-1", 1), props.globals.getNode("systems/navigation/adr/output/mach-2", 1), props.globals.getNode("systems/navigation/adr/output/mach-3", 1)]; + d.airspeeds = [props.globals.getNode("/systems/navigation/adr/output/cas-1", 1), props.globals.getNode("/systems/navigation/adr/output/cas-2", 1), props.globals.getNode("/systems/navigation/adr/output/cas-3", 1)]; + d.altitudes = [props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-1-capt", 1), props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-2-capt", 1), props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-3-capt", 1)]; + d.machs = [props.globals.getNode("/systems/navigation/adr/output/mach-1", 1), props.globals.getNode("/systems/navigation/adr/output/mach-2", 1), props.globals.getNode("/systems/navigation/adr/output/mach-3", 1)]; d.altitudesPfd = [props.globals.getNode("instrumentation/altimeter[0]/indicated-altitude-ft-pfd", 1), props.globals.getNode("instrumentation/altimeter[1]/indicated-altitude-ft-pfd", 1), props.globals.getNode("instrumentation/altimeter[2]/indicated-altitude-ft-pfd", 1)]; - d.sats = [props.globals.getNode("systems/navigation/adr/output/sat-1", 1), props.globals.getNode("systems/navigation/adr/output/sat-2", 1), props.globals.getNode("systems/navigation/adr/output/sat-3", 1)]; - d.tats = [props.globals.getNode("systems/navigation/adr/output/tat-1", 1), props.globals.getNode("systems/navigation/adr/output/tat-2", 1), props.globals.getNode("systems/navigation/adr/output/tat-3", 1)]; + d.sats = [props.globals.getNode("/systems/navigation/adr/output/sat-1", 1), props.globals.getNode("/systems/navigation/adr/output/sat-2", 1), props.globals.getNode("/systems/navigation/adr/output/sat-3", 1)]; + d.tats = [props.globals.getNode("/systems/navigation/adr/output/tat-1", 1), props.globals.getNode("/systems/navigation/adr/output/tat-2", 1), props.globals.getNode("/systems/navigation/adr/output/tat-3", 1)]; d.trends = [props.globals.getNode("instrumentation/pfd/speed-lookahead-1", 1), props.globals.getNode("instrumentation/pfd/speed-lookahead-2", 1), props.globals.getNode("instrumentation/pfd/speed-lookahead-3", 1)]; d.outputs = [nil, nil, nil, nil, nil, nil, nil]; # airspeed, altitude, mach, pfd altitude, sat, tat, speed trend return d; @@ -70,7 +70,7 @@ var DMController = { me.DMCs = [DMC.new(0), DMC.new(1), DMC.new(2)]; # update DMC2 to correct properties for first officer PFD - me.DMCs[1].altitudes = [props.globals.getNode("systems/navigation/adr/output/baro-alt-corrected-1-fo", 1), props.globals.getNode("systems/navigation/adr/output/baro-alt-corrected-2-fo", 1), props.globals.getNode("systems/navigation/adr/output/baro-alt-corrected-3-fo", 1)]; + me.DMCs[1].altitudes = [props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-1-fo", 1), props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-2-fo", 1), props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-3-fo", 1)]; me.DMCs[1].altitudesPfd = [props.globals.getNode("instrumentation/altimeter[3]/indicated-altitude-ft-pfd", 1), props.globals.getNode("instrumentation/altimeter[4]/indicated-altitude-ft-pfd", 1), props.globals.getNode("instrumentation/altimeter[5]/indicated-altitude-ft-pfd", 1)]; me._init = 1; diff --git a/Nasal/ECAM/ECAM-controller.nas b/Nasal/ECAM/ECAM-controller.nas index d4fca234..09832bdd 100644 --- a/Nasal/ECAM/ECAM-controller.nas +++ b/Nasal/ECAM/ECAM-controller.nas @@ -12,7 +12,7 @@ var leftOverflow = props.globals.initNode("/ECAM/warnings/overflow-left", 0, "B var rightOverflow = props.globals.initNode("/ECAM/warnings/overflow-right", 0, "BOOL"); var overflow = props.globals.initNode("/ECAM/warnings/overflow", 0, "BOOL"); -var dc_ess = props.globals.getNode("systems/electrical/bus/dc-ess", 1); +var dc_ess = props.globals.getNode("/systems/electrical/bus/dc-ess", 1); var lights = [props.globals.initNode("/ECAM/warnings/master-warning-light", 0, "BOOL"), props.globals.initNode("/ECAM/warnings/master-caution-light", 0, "BOOL")]; var aural = [props.globals.initNode("/sim/sound/warnings/crc", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/chime", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/cricket", 0, "BOOL")]; diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index 0e7431cc..86ca53b6 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -808,13 +808,13 @@ var messages_priority_3 = func { if (FWC.Timer.gnd.getValue() != 1 and (FWC.Monostable.altAlert1Output.getValue() or bigThree)) { if (!getprop("/sim/sound/warnings/cchord-inhibit")) { - setprop("sim/sound/warnings/cchord", 1); + setprop("/sim/sound/warnings/cchord", 1); } else { - setprop("sim/sound/warnings/cchord", 0); + setprop("/sim/sound/warnings/cchord", 0); } } else { - setprop("sim/sound/warnings/cchord", 0); - setprop("sim/sound/warnings/cchord-inhibit", 0); + setprop("/sim/sound/warnings/cchord", 0); + setprop("/sim/sound/warnings/cchord-inhibit", 0); } if (FWC.Timer.gnd.getValue() != 1 and getprop("/ECAM/flipflop/alt-alert-3-rs-set") != 1 and alt750 and !alt200 and !altAlertInhibit) { diff --git a/Nasal/ECAM/ECAM-main.nas b/Nasal/ECAM/ECAM-main.nas index 9a622d21..535544b3 100644 --- a/Nasal/ECAM/ECAM-main.nas +++ b/Nasal/ECAM/ECAM-main.nas @@ -40,7 +40,7 @@ var clrLight = 0; var ECAM = { _cachePage: "", init: func() { - setprop("systems/gear/landing-gear-warning-light", 0); + setprop("/systems/gear/landing-gear-warning-light", 0); page = props.globals.initNode("/ECAM/Lower/page", "door", "STRING"); apuLight = props.globals.initNode("/ECAM/Lower/light/apu", 0, "BOOL"); bleedLight = props.globals.initNode("/ECAM/Lower/light/bleed", 0, "BOOL"); diff --git a/Nasal/ECAM/ECAM-phases.nas b/Nasal/ECAM/ECAM-phases.nas index eb653a00..a0188197 100644 --- a/Nasal/ECAM/ECAM-phases.nas +++ b/Nasal/ECAM/ECAM-phases.nas @@ -115,14 +115,14 @@ var phaseLoop = func() { } if (eng == "IAE") { - eprlim = getprop("controls/engines/epr-limit"); + eprlim = getprop("/controls/engines/epr-limit"); if ((!pts.Controls.Engines.Engine.reverser[0].getBoolValue() and !pts.Controls.Engines.Engine.reverser[1].getBoolValue()) and (((pts.Controls.Engines.Engine.throttle[0].getValue() >= 0.78 or pts.Controls.Engines.Engine.throttle[1].getValue() >= 0.779) and fadec.Thrust.limFlex.getBoolValue()) or (pts.Controls.Engines.Engine.throttle[0].getValue() >= 0.99 or pts.Controls.Engines.Engine.throttle[1].getValue() >= 0.99))) { FWC.toPower.setBoolValue(1); } else { FWC.toPower.setBoolValue(0); } } else { - n1lim = getprop("controls/engines/n1-limit"); + n1lim = getprop("/controls/engines/n1-limit"); if ((!pts.Controls.Engines.Engine.reverser[0].getBoolValue() and !pts.Controls.Engines.Engine.reverser[1].getBoolValue()) and (((pts.Controls.Engines.Engine.throttle[0].getValue() >= 0.78 or pts.Controls.Engines.Engine.throttle[1].getValue() >= 0.779) and fadec.Thrust.limFlex.getBoolValue()) or (pts.Controls.Engines.Engine.throttle[0].getValue() >= 0.99 or pts.Controls.Engines.Engine.throttle[1].getValue() >= 0.99))) { FWC.toPower.setBoolValue(1); } else { diff --git a/Nasal/Effects/icing.nas b/Nasal/Effects/icing.nas index 22b946a1..ac417807 100644 --- a/Nasal/Effects/icing.nas +++ b/Nasal/Effects/icing.nas @@ -120,7 +120,7 @@ var PitotIcing = [props.globals.getNode("/systems/pitot[0]/icing"),props.globals var PitotServicable = [props.globals.getNode("/systems/pitot[0]/serviceable", 1),props.globals.getNode("/systems/pitot[1]/serviceable", 1),props.globals.getNode("/systems/pitot[2]/serviceable"), 1]; var icingInit = func { - iceables = props.globals.getNode("sim/model/icing", 1).getChildren("iceable"); + iceables = props.globals.getNode("/sim/model/icing", 1).getChildren("iceable"); forindex(var i; iceables) { iceables[i] = Iceable.new(iceables[i]); } diff --git a/Nasal/Effects/light-manager.nas b/Nasal/Effects/light-manager.nas index 31e7b085..3e59a4ed 100644 --- a/Nasal/Effects/light-manager.nas +++ b/Nasal/Effects/light-manager.nas @@ -3,7 +3,7 @@ # Thanks to BAWV12 / Thorsten -var als_on = props.globals.getNode("sim/rendering/shaders/skydome"); +var als_on = props.globals.getNode("/sim/rendering/shaders/skydome"); var alt_agl = props.globals.getNode("position/gear-agl-ft"); var cur_alt = 0; @@ -67,30 +67,30 @@ var light_manager = { flcpt: 0, prev_view : 1, - nd_ref_light1_x: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-x-m", 1), - nd_ref_light1_y: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-y-m", 1), - nd_ref_light1_z: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-z-m", 1), - nd_ref_light1_dir: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/dir", 1), + nd_ref_light1_x: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-x-m", 1), + nd_ref_light1_y: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-y-m", 1), + nd_ref_light1_z: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-z-m", 1), + nd_ref_light1_dir: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/dir", 1), - nd_ref_light2_x: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[1]", 1), - nd_ref_light2_y: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[1]", 1), - nd_ref_light2_z: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[1]", 1), - nd_ref_light2_dir: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/dir[1]", 1), + nd_ref_light2_x: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[1]", 1), + nd_ref_light2_y: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[1]", 1), + nd_ref_light2_z: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[1]", 1), + nd_ref_light2_dir: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/dir[1]", 1), - nd_ref_light3_x: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[2]", 1), - nd_ref_light3_y: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[2]", 1), - nd_ref_light3_z: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[2]", 1), - nd_ref_light3_dir: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/dir[2]", 1), + nd_ref_light3_x: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[2]", 1), + nd_ref_light3_y: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[2]", 1), + nd_ref_light3_z: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[2]", 1), + nd_ref_light3_dir: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/dir[2]", 1), - nd_ref_light4_x: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[3]", 1), - nd_ref_light4_y: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[3]", 1), - nd_ref_light4_z: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[3]", 1), - nd_ref_light4_dir: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/dir[3]", 1), + nd_ref_light4_x: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[3]", 1), + nd_ref_light4_y: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[3]", 1), + nd_ref_light4_z: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[3]", 1), + nd_ref_light4_dir: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/dir[3]", 1), - nd_ref_light5_x: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[4]", 1), - nd_ref_light5_y: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[4]", 1), - nd_ref_light5_z: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[4]", 1), - nd_ref_light5_dir: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/dir[4]", 1), + nd_ref_light5_x: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[4]", 1), + nd_ref_light5_y: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[4]", 1), + nd_ref_light5_z: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[4]", 1), + nd_ref_light5_dir: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/dir[4]", 1), init: func { # define your lights here @@ -146,22 +146,22 @@ var light_manager = { me.light5_size = 5; - setprop("sim/rendering/als-secondary-lights/flash-radius", 13); + setprop("/sim/rendering/als-secondary-lights/flash-radius", 13); me.start(); }, start: func { - setprop("sim/rendering/als-secondary-lights/num-lightspots", 5); + setprop("/sim/rendering/als-secondary-lights/num-lightspots", 5); - setprop("sim/rendering/als-secondary-lights/lightspot/size", me.light1_size); - setprop("sim/rendering/als-secondary-lights/lightspot/size[1]", me.light2_size); - setprop("sim/rendering/als-secondary-lights/lightspot/size[2]", me.light3_size); - setprop("sim/rendering/als-secondary-lights/lightspot/size[3]", me.light4_size); - setprop("sim/rendering/als-secondary-lights/lightspot/size[4]", me.light5_size); + setprop("/sim/rendering/als-secondary-lights/lightspot/size", me.light1_size); + setprop("/sim/rendering/als-secondary-lights/lightspot/size[1]", me.light2_size); + setprop("/sim/rendering/als-secondary-lights/lightspot/size[2]", me.light3_size); + setprop("/sim/rendering/als-secondary-lights/lightspot/size[3]", me.light4_size); + setprop("/sim/rendering/als-secondary-lights/lightspot/size[4]", me.light5_size); - setprop("sim/rendering/als-secondary-lights/lightspot/stretch", me.light1_stretch); - setprop("sim/rendering/als-secondary-lights/lightspot/stretch[1]", me.light2_stretch); + setprop("/sim/rendering/als-secondary-lights/lightspot/stretch", me.light1_stretch); + setprop("/sim/rendering/als-secondary-lights/lightspot/stretch[1]", me.light2_stretch); me.run = 1; me.update(); @@ -178,10 +178,10 @@ var light_manager = { cur_alt = alt_agl.getValue(); if (als_on.getValue() == 1 and alt_agl.getValue() < 100.0) { - ll1 = getprop("controls/lighting/landing-lights[1]"); - ll2 = getprop("controls/lighting/landing-lights[2]"); - ll3 = getprop("sim/model/lights/nose-lights"); - nav = getprop("sim/model/lights/nav-lights"); + ll1 = getprop("/controls/lighting/landing-lights[1]"); + ll2 = getprop("/controls/lighting/landing-lights[2]"); + ll3 = getprop("/sim/model/lights/nose-lights"); + nav = getprop("/sim/model/lights/nav-lights"); var apos = geo.aircraft_position(); var vpos = geo.viewer_position(); @@ -320,89 +320,89 @@ var light_manager = { light1_on : func { if (me.light1_is_on == 1) {return;} - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r", me.light1_r); - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g", me.light1_g); - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b", me.light1_b); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r", me.light1_r); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g", me.light1_g); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b", me.light1_b); me.light1_is_on = 1; }, light1_off : func { if (me.light1_is_on == 0) {return;} - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r", 0.0); - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g", 0.0); - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b", 0.0); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r", 0.0); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g", 0.0); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b", 0.0); me.light1_is_on = 0; }, light1_setSize : func(size) { - setprop("sim/rendering/als-secondary-lights/lightspot/size[0]", size); + setprop("/sim/rendering/als-secondary-lights/lightspot/size[0]", size); }, light2_on : func { if (me.light2_is_on == 1) {return;} - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[1]", me.light2_r); - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[1]", me.light2_g); - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[1]", me.light2_b); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[1]", me.light2_r); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[1]", me.light2_g); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[1]", me.light2_b); me.light2_is_on = 1; }, light2_off : func { if (me.light2_is_on == 0) {return;} - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[1]", 0.0); - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[1]", 0.0); - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[1]", 0.0); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[1]", 0.0); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[1]", 0.0); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[1]", 0.0); me.light2_is_on = 0; }, light2_setSize : func(size) { - setprop("sim/rendering/als-secondary-lights/lightspot/size[1]", size); + setprop("/sim/rendering/als-secondary-lights/lightspot/size[1]", size); }, light3_on : func { if (me.light3_is_on == 1) {return;} - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[2]", me.light3_r); - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[2]", me.light3_g); - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[2]", me.light3_b); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[2]", me.light3_r); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[2]", me.light3_g); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[2]", me.light3_b); me.light3_is_on = 1; }, light3_off : func { if (me.light3_is_on == 0) {return;} - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[2]", 0.0); - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[2]", 0.0); - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[2]", 0.0); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[2]", 0.0); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[2]", 0.0); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[2]", 0.0); me.light3_is_on = 0; }, light4_on : func { if (me.light4_is_on == 1) {return;} - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[3]", me.light4_r); - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[3]", me.light4_g); - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[3]", me.light4_b); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[3]", me.light4_r); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[3]", me.light4_g); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[3]", me.light4_b); me.light4_is_on = 1; }, light4_off : func { if (me.light4_is_on == 0) {return;} - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[3]", 0.0); - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[3]", 0.0); - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[3]", 0.0); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[3]", 0.0); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[3]", 0.0); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[3]", 0.0); me.light4_is_on = 0; }, light5_on : func { if (me.light5_is_on == 1) {return;} - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[4]", me.light5_r); - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[4]", me.light5_g); - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[4]", me.light5_b); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[4]", me.light5_r); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[4]", me.light5_g); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[4]", me.light5_b); me.light5_is_on = 1; }, light5_off : func { if (me.light5_is_on == 0) {return;} - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[4]", 0.0); - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[4]", 0.0); - setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[4]", 0.0); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[4]", 0.0); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[4]", 0.0); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[4]", 0.0); me.light5_is_on = 0; }, }; \ No newline at end of file diff --git a/Nasal/Effects/thunder-effects.nas b/Nasal/Effects/thunder-effects.nas index affe1a18..1d090c54 100644 --- a/Nasal/Effects/thunder-effects.nas +++ b/Nasal/Effects/thunder-effects.nas @@ -38,26 +38,26 @@ var thunder_listener = func { var lightning_distance_norm = std.min(1.0, 1 / math.pow(lightning_distance / 5000.0, 2)); settimer(func { - var thunder1 = getprop("sim/sound/thunder1"); - var thunder2 = getprop("sim/sound/thunder2"); - var thunder3 = getprop("sim/sound/thunder3"); - var thunder4 = getprop("sim/sound/thunder4"); - var vol = getprop("sim/current-view/internal"); + var thunder1 = getprop("/sim/sound/thunder1"); + var thunder2 = getprop("/sim/sound/thunder2"); + var thunder3 = getprop("/sim/sound/thunder3"); + var thunder4 = getprop("/sim/sound/thunder4"); + var vol = getprop("/sim/current-view/internal"); if (!thunder1) { thunderCalls = 1; - setprop("sim/sound/dist-thunder1", lightning_distance_norm * vol * 1.75); + setprop("/sim/sound/dist-thunder1", lightning_distance_norm * vol * 1.75); } else if (!thunder2) { thunderCalls = 2; - setprop("sim/sound/dist-thunder2", lightning_distance_norm * vol * 1.75); + setprop("/sim/sound/dist-thunder2", lightning_distance_norm * vol * 1.75); } else if (!thunder3) { thunderCalls = 3; - setprop("sim/sound/dist-thunder3", lightning_distance_norm * vol * 1.75); + setprop("/sim/sound/dist-thunder3", lightning_distance_norm * vol * 1.75); } else if (!thunder4) { thunderCalls = 4; - setprop("sim/sound/dist-thunder4", lightning_distance_norm * vol * 1.75); + setprop("/sim/sound/dist-thunder4", lightning_distance_norm * vol * 1.75); } else return; diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index 81faa7d3..c2c579e0 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -659,33 +659,33 @@ var masterFMGC = maketimer(0.2, func { if ((n1_left < 85 or n1_right < 85) and gs < 90 and mode == " " and gear0 and FMGCInternal.phase == 1) { # rejected takeoff FMGCInternal.phase = 0; - setprop("systems/pressurization/mode", "GN"); + setprop("/systems/pressurization/mode", "GN"); } if (gear0 and FMGCInternal.phase == 0 and ((n1_left >= 85 and n1_right >= 85 and mode == "SRS") or gs >= 90)) { FMGCInternal.phase = 1; - setprop("systems/pressurization/mode", "TO"); + setprop("/systems/pressurization/mode", "TO"); } if (FMGCInternal.phase == 1 and ((mode != "SRS" and mode != " ") or alt >= accel_agl_ft)) { FMGCInternal.phase = 2; - setprop("systems/pressurization/mode", "TO"); + setprop("/systems/pressurization/mode", "TO"); } if (FMGCInternal.phase == 2 and (mode == "ALT CRZ" or mode == "ALT CRZ*")) { FMGCInternal.phase = 3; - setprop("systems/pressurization/mode", "CR"); + setprop("/systems/pressurization/mode", "CR"); } if (FMGCInternal.crzFl >= 200) { if (FMGCInternal.phase == 3 and (flightPlanController.arrivalDist <= 200 or altSel < 20000)) { FMGCInternal.phase = 4; - setprop("systems/pressurization/mode", "DE"); + setprop("/systems/pressurization/mode", "DE"); } } else { if (FMGCInternal.phase == 3 and (flightPlanController.arrivalDist <= 200 or altSel < (FMGCInternal.crzFl * 100))) { # todo - not sure about crzFl condition, investigate what happens! FMGCInternal.phase = 4; - setprop("systems/pressurization/mode", "DE"); + setprop("/systems/pressurization/mode", "DE"); } } @@ -701,7 +701,7 @@ var masterFMGC = maketimer(0.2, func { if ((FMGCInternal.phase == 5) and state1 == "TOGA" and state2 == "TOGA") { FMGCInternal.phase = 6; - setprop("systems/pressurization/mode", "TO"); + setprop("/systems/pressurization/mode", "TO"); setprop("/it-autoflight/input/toga", 1); } @@ -1012,23 +1012,23 @@ var reset_FMGC = func { setprop("it-autoflight/input/kts", spd); setprop("it-autoflight/input/hdg", hdg); setprop("it-autoflight/input/alt", alt); - setprop("systems/pressurization/mode", "GN"); - setprop("systems/pressurization/vs", "0"); - setprop("systems/pressurization/targetvs", "0"); - setprop("systems/pressurization/vs-norm", "0"); - setprop("systems/pressurization/auto", 1); - setprop("systems/pressurization/deltap", "0"); - setprop("systems/pressurization/outflowpos", "0"); - setprop("systems/pressurization/deltap-norm", "0"); - setprop("systems/pressurization/outflowpos-norm", "0"); + setprop("/systems/pressurization/mode", "GN"); + setprop("/systems/pressurization/vs", "0"); + setprop("/systems/pressurization/targetvs", "0"); + setprop("/systems/pressurization/vs-norm", "0"); + setprop("/systems/pressurization/auto", 1); + setprop("/systems/pressurization/deltap", "0"); + setprop("/systems/pressurization/outflowpos", "0"); + setprop("/systems/pressurization/deltap-norm", "0"); + setprop("/systems/pressurization/outflowpos-norm", "0"); altitude = getprop("/instrumentation/altimeter/indicated-altitude-ft"); - setprop("systems/pressurization/cabinalt", altitude); - setprop("systems/pressurization/targetalt", altitude); - setprop("systems/pressurization/diff-to-target", "0"); - setprop("systems/pressurization/ditchingpb", 0); - setprop("systems/pressurization/targetvs", "0"); - setprop("systems/pressurization/ambientpsi", "0"); - setprop("systems/pressurization/cabinpsi", "0"); + setprop("/systems/pressurization/cabinalt", altitude); + setprop("/systems/pressurization/targetalt", altitude); + setprop("/systems/pressurization/diff-to-target", "0"); + setprop("/systems/pressurization/ditchingpb", 0); + setprop("/systems/pressurization/targetvs", "0"); + setprop("/systems/pressurization/ambientpsi", "0"); + setprop("/systems/pressurization/cabinpsi", "0"); mcdu.ReceivedMessagesDatabase.clearDatabase(); } diff --git a/Nasal/Libraries/libraries.nas b/Nasal/Libraries/libraries.nas index cfd910db..e66f8abb 100644 --- a/Nasal/Libraries/libraries.nas +++ b/Nasal/Libraries/libraries.nas @@ -50,7 +50,7 @@ setlistener("/sim/sounde/btn1", func { return; } settimer(func { - props.globals.getNode("sim/sounde/btn1").setBoolValue(0); + props.globals.getNode("/sim/sounde/btn1").setBoolValue(0); }, 0.05); }); @@ -59,7 +59,7 @@ setlistener("/sim/sounde/oh-btn", func { return; } settimer(func { - props.globals.getNode("sim/sounde/oh-btn").setBoolValue(0); + props.globals.getNode("/sim/sounde/oh-btn").setBoolValue(0); }, 0.05); }); @@ -68,7 +68,7 @@ setlistener("/sim/sounde/btn3", func { return; } settimer(func { - props.globals.getNode("sim/sounde/btn3").setBoolValue(0); + props.globals.getNode("/sim/sounde/btn3").setBoolValue(0); }, 0.05); }); @@ -77,7 +77,7 @@ setlistener("/sim/sounde/knb1", func { return; } settimer(func { - props.globals.getNode("sim/sounde/knb1").setBoolValue(0); + props.globals.getNode("/sim/sounde/knb1").setBoolValue(0); }, 0.05); }); @@ -86,21 +86,21 @@ setlistener("/sim/sounde/switch1", func { return; } settimer(func { - props.globals.getNode("sim/sounde/switch1").setBoolValue(0); + props.globals.getNode("/sim/sounde/switch1").setBoolValue(0); }, 0.05); }); setlistener("/controls/lighting/seatbelt-sign", func { - props.globals.getNode("sim/sounde/seatbelt-sign").setBoolValue(1); + props.globals.getNode("/sim/sounde/seatbelt-sign").setBoolValue(1); settimer(func { - props.globals.getNode("sim/sounde/seatbelt-sign").setBoolValue(0); + props.globals.getNode("/sim/sounde/seatbelt-sign").setBoolValue(0); }, 2); }, 0, 0); setlistener("/controls/lighting/no-smoking-sign", func { - props.globals.getNode("sim/sounde/no-smoking-sign").setBoolValue(1); + props.globals.getNode("/sim/sounde/no-smoking-sign").setBoolValue(1); settimer(func { - props.globals.getNode("sim/sounde/no-smoking-sign").setBoolValue(0); + props.globals.getNode("/sim/sounde/no-smoking-sign").setBoolValue(0); }, 1); }, 0, 0); diff --git a/Nasal/Libraries/zoom-views.nas b/Nasal/Libraries/zoom-views.nas index 861e2388..42b11124 100644 --- a/Nasal/Libraries/zoom-views.nas +++ b/Nasal/Libraries/zoom-views.nas @@ -11,16 +11,16 @@ var incStep = 1; var viewName = "XX"; var fovZoom = func(d) { - viewName = getprop("sim/current-view/name"); - canChangeZOffset = getprop("sim/current-view/type") == "lookat" and viewName != "Tower View" and viewName != "Tower View AGL" and viewName != "Fly-By View" and viewName != "Chase View" and viewName != "Chase View Without Yaw" and viewName != "Walk View" and viewName != "Walker Orbit View"; + viewName = getprop("/sim/current-view/name"); + canChangeZOffset = getprop("/sim/current-view/type") == "lookat" and viewName != "Tower View" and viewName != "Tower View AGL" and viewName != "Fly-By View" and viewName != "Chase View" and viewName != "Chase View Without Yaw" and viewName != "Walk View" and viewName != "Walker Orbit View"; - if (getprop("sim/current-view/z-offset-m") <= -20) { + if (getprop("/sim/current-view/z-offset-m") <= -20) { decStep = -2; } else { decStep = -1; } - if (getprop("sim/current-view/z-offset-m") < -20) { # Not a typo, the conditions are different + if (getprop("/sim/current-view/z-offset-m") < -20) { # Not a typo, the conditions are different incStep = 2; } else { incStep = 1; @@ -28,11 +28,11 @@ var fovZoom = func(d) { if (d == -1) { if (canChangeZOffset) { - distance = getprop("sim/current-view/z-offset-m"); - min_dist = getprop("sim/current-view/z-offset-min-m"); + distance = getprop("/sim/current-view/z-offset-m"); + min_dist = getprop("/sim/current-view/z-offset-min-m"); distance = math.round(std.min(-min_dist, distance + incStep) / incStep, 0.1) * incStep; - setprop("sim/current-view/z-offset-m", distance); + setprop("/sim/current-view/z-offset-m", distance); gui.popupTip(sprintf("%d meters", abs(distance))); } else { @@ -40,11 +40,11 @@ var fovZoom = func(d) { } } else if (d == 1) { if (canChangeZOffset) { - distance = getprop("sim/current-view/z-offset-m"); - max_dist = getprop("sim/current-view/z-offset-max-m"); + distance = getprop("/sim/current-view/z-offset-m"); + max_dist = getprop("/sim/current-view/z-offset-max-m"); distance = math.round(std.max(-max_dist, distance + decStep) / decStep, 0.1) * decStep; - setprop("sim/current-view/z-offset-m", distance); + setprop("/sim/current-view/z-offset-m", distance); gui.popupTip(sprintf("%d meters", abs(distance))); } else { @@ -52,11 +52,11 @@ var fovZoom = func(d) { } } else if (d == 0) { if (canChangeZOffset) { - setprop("sim/current-view/z-offset-m", getprop("sim/current-view/z-offset-default") * -1); - gui.popupTip(sprintf("%d meters", getprop("sim/current-view/z-offset-default"))); + setprop("/sim/current-view/z-offset-m", getprop("/sim/current-view/z-offset-default") * -1); + gui.popupTip(sprintf("%d meters", getprop("/sim/current-view/z-offset-default"))); } else { - setprop("sim/current-view/field-of-view", getprop("sim/view/config/default-field-of-view-deg")); - gui.popupTip(sprintf("FOV: %.1f", getprop("sim/current-view/field-of-view"))) + setprop("/sim/current-view/field-of-view", getprop("/sim/view/config/default-field-of-view-deg")); + gui.popupTip(sprintf("FOV: %.1f", getprop("/sim/current-view/field-of-view"))) } } } diff --git a/Nasal/MCDU/IRSINIT.nas b/Nasal/MCDU/IRSINIT.nas index baabec0b..794773b7 100644 --- a/Nasal/MCDU/IRSINIT.nas +++ b/Nasal/MCDU/IRSINIT.nas @@ -82,17 +82,17 @@ var initInputIRS = func(key, i) { } else if (key == "R6") { setprop("FMGC/internal/align-ref-lat-edit", 0); setprop("FMGC/internal/align-ref-long-edit", 0); - if (fmgc.FMGCInternal.toFromSet and getprop("systems/navigation/adr/any-adr-on") == 1) { + if (fmgc.FMGCInternal.toFromSet and getprop("/systems/navigation/adr/any-adr-on") == 1) { if (getprop("FMGC/internal/align-set") == 0) { setprop("FMGC/internal/align-set", 1); } else { - setprop("controls/adirs/mcducbtn", 1); + setprop("/controls/adirs/mcducbtn", 1); setprop("FMGC/internal/align-set", 0); setprop("MCDU[" ~ i ~ "]/page", "INITA"); } } else if (!fmgc.FMGCInternal.toFromSet) { # setprop("MCDU[" ~ i ~ "]/scratchpad", "SELECT REFERENCE"); - } else if (getprop("systems/navigation/adr/any-adr-on") == 0) { + } else if (getprop("/systems/navigation/adr/any-adr-on") == 0) { # setprop("MCDU[" ~ i ~ "]/scratchpad", "IRS NOT ALIGNED"); } else { mcdu_message(i, "NOT ALLOWED"); diff --git a/Nasal/MCDU/PERFGA.nas b/Nasal/MCDU/PERFGA.nas index 3b799120..78073231 100644 --- a/Nasal/MCDU/PERFGA.nas +++ b/Nasal/MCDU/PERFGA.nas @@ -6,7 +6,7 @@ var perfGAInput = func(key, i) { var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad; if (key == "L5") { if (scratchpad == "CLR") { - setprop("systems/thrust/clbreduc-ft", 1500); + setprop("/systems/thrust/clbreduc-ft", 1500); setprop("/FMGC/internal/accel-agl-ft", 1500); setprop("MCDUC/thracc-set", 0); mcdu_scratchpad.scratchpads[i].empty(); @@ -17,7 +17,7 @@ var perfGAInput = func(key, i) { var thrred = size(thracc[0]); var acc = size(thracc[1]); if (int(thrred) != nil and int(acc) != nil and (thrred >= 3 and thrred <= 5) and (acc >= 3 and acc <= 5)) { - setprop("systems/thrust/clbreduc-ft", thracc[0]); + setprop("/systems/thrust/clbreduc-ft", thracc[0]); setprop("/FMGC/internal/accel-agl-ft", thracc[1]); setprop("MCDUC/thracc-set", 1); mcdu_scratchpad.scratchpads[i].empty(); diff --git a/Nasal/MCDU/PERFTO.nas b/Nasal/MCDU/PERFTO.nas index 7d8cb645..fc0d92dc 100644 --- a/Nasal/MCDU/PERFTO.nas +++ b/Nasal/MCDU/PERFTO.nas @@ -100,7 +100,7 @@ var perfTOInput = func(key, i) { } } else if (key == "L5") { if (scratchpad == "CLR") { - setprop("systems/thrust/clbreduc-ft", 1500); + setprop("/systems/thrust/clbreduc-ft", 1500); setprop("/FMGC/internal/accel-agl-ft", 1500); setprop("MCDUC/thracc-set", 0); mcdu_scratchpad.scratchpads[i].empty(); @@ -113,7 +113,7 @@ var perfTOInput = func(key, i) { var acc = thracc[1]; var accs = size(acc); if (int(thrred) != nil and (thrreds >= 3 and thrreds <= 5) and thrred >= 400 and thrred <= 39000 and int(acc) != nil and (accs == 3 or accs == 4 or accs == 5) and acc >= 400 and acc <= 39000) { - setprop("systems/thrust/clbreduc-ft", int(thrred / 10) * 10); + setprop("/systems/thrust/clbreduc-ft", int(thrred / 10) * 10); setprop("/FMGC/internal/accel-agl-ft", int(acc / 10) * 10); setprop("MCDUC/thracc-set", 1); mcdu_scratchpad.scratchpads[i].empty(); @@ -124,7 +124,7 @@ var perfTOInput = func(key, i) { mcdu_message(i, "NOT ALLOWED"); } } else if (num(scratchpad) != nil and (tfs >= 3 and tfs <= 5) and scratchpad >= 400 and scratchpad <= 39000) { - setprop("systems/thrust/clbreduc-ft", int(scratchpad / 10) * 10); + setprop("/systems/thrust/clbreduc-ft", int(scratchpad / 10) * 10); mcdu_scratchpad.scratchpads[i].empty(); } else { mcdu_message(i, "NOT ALLOWED"); diff --git a/Nasal/MCDU/RADNAV.nas b/Nasal/MCDU/RADNAV.nas index 4e73a397..316fb799 100644 --- a/Nasal/MCDU/RADNAV.nas +++ b/Nasal/MCDU/RADNAV.nas @@ -4,7 +4,7 @@ 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")) { + if (!getprop("/systems/radio/rmp[0]/nav") and !getprop("/systems/radio/rmp[1]/nav")) { if (key == "L1") { if (scratchpad == "CLR") { setprop("/FMGC/internal/vor1freq-set", 0); diff --git a/Nasal/Panels/SwitchingPanel.nas b/Nasal/Panels/SwitchingPanel.nas index aafe4e01..96066a20 100644 --- a/Nasal/Panels/SwitchingPanel.nas +++ b/Nasal/Panels/SwitchingPanel.nas @@ -5,9 +5,9 @@ var SwitchingPanel = { Switches: { - attHdg: props.globals.getNode("controls/navigation/switching/att-hdg"), - airData: props.globals.getNode("controls/navigation/switching/air-data"), - eisDmc: props.globals.getNode("controls/navigation/switching/eis-dmc"), + attHdg: props.globals.getNode("/controls/navigation/switching/att-hdg"), + airData: props.globals.getNode("/controls/navigation/switching/air-data"), + eisDmc: props.globals.getNode("/controls/navigation/switching/eis-dmc"), }, doAirData: func(newAirData) { diff --git a/Nasal/Panels/acp.nas b/Nasal/Panels/acp.nas index 58cb7e4d..6aa3b5bf 100644 --- a/Nasal/Panels/acp.nas +++ b/Nasal/Panels/acp.nas @@ -32,7 +32,7 @@ var init = func() { } var update_com1 = func() { - if (getprop("systems/acconfig/options/fo-view") == 1) { + if (getprop("/systems/acconfig/options/fo-view") == 1) { if (vhf1_fo_recive.getValue()) { com1_volume.setValue(vhf1_fo_volume.getValue()); } else { @@ -48,7 +48,7 @@ var update_com1 = func() { } var update_com2 = func() { - if (getprop("systems/acconfig/options/fo-view") == 1) { + if (getprop("/systems/acconfig/options/fo-view") == 1) { if (vhf2_fo_recive.getValue()) { com2_volume.setValue(vhf2_fo_volume.getValue()); } else { diff --git a/Nasal/Panels/atc.nas b/Nasal/Panels/atc.nas index d1f3d267..99e5778c 100644 --- a/Nasal/Panels/atc.nas +++ b/Nasal/Panels/atc.nas @@ -6,7 +6,7 @@ var idCode = props.globals.getNode("instrumentation/transponder/id-code", 1); var guiModes = ['OFF', 'STANDBY', 'TEST', 'GROUND', 'ON', 'ALTITUDE']; -var guiNode = props.globals.getNode("sim/gui/dialogs/radios/transponder-mode", 1); +var guiNode = props.globals.getNode("/sim/gui/dialogs/radios/transponder-mode", 1); var forLoopFlag = 0; var altimeter = props.globals.initNode("/instrumentation/transponder/altimeter-input-src", 0, "INT"); @@ -24,10 +24,10 @@ var Transponder = { serviceableNode: props.globals.getNode("instrumentation/transponder/serviceable", 1), knobNode: props.globals.getNode("instrumentation/transponder/inputs/knob-mode", 1), identNode: props.globals.getNode("instrumentation/transponder/inputs/ident-btn", 1), - ac1Node: props.globals.getNode("systems/electrical/bus/ac-1", 1), + ac1Node: props.globals.getNode("/systems/electrical/bus/ac-1", 1), tcasNode: props.globals.getNode("instrumentation/tcas/inputs/mode"), aglNode: props.globals.getNode("position/gear-agl-ft", 1), - electricNode: props.globals.getNode("systems/electrical/outputs/transponder", 1), # communicate to generic systems + electricNode: props.globals.getNode("/systems/electrical/outputs/transponder", 1), # communicate to generic systems new: func(elecSrc, ADIRS) { var t = {parents:[Transponder]}; t.mode = 1; @@ -145,7 +145,7 @@ var transponderPanel = { failLight: 0, clearFlag: 0, keypad: func(keyNum) { - if (props.globals.getNode("controls/switches/annun-test", 1).getBoolValue() or props.globals.getNode("systems/electrical/bus/dc-ess", 1).getValue() < 25) { + if (props.globals.getNode("/controls/switches/annun-test", 1).getBoolValue() or props.globals.getNode("/systems/electrical/bus/dc-ess", 1).getValue() < 25) { return; } if (keyNum < 0 or keyNum > 7) { @@ -163,7 +163,7 @@ var transponderPanel = { } }, clearKey: func() { - if (props.globals.getNode("controls/switches/annun-test", 1).getBoolValue() or props.globals.getNode("systems/electrical/bus/dc-ess", 1).getValue() < 25) { + if (props.globals.getNode("/controls/switches/annun-test", 1).getBoolValue() or props.globals.getNode("/systems/electrical/bus/dc-ess", 1).getValue() < 25) { return; } if (me.codeDisp != "") { @@ -215,7 +215,7 @@ var transponderPanel = { return; } me.failLight = newFail; - props.globals.getNode("systems/atc/failed").setBoolValue(me.failLight); + props.globals.getNode("/systems/atc/failed").setBoolValue(me.failLight); }, identSwitch: func() { Transponders.vector[me.atcSel - 1].ident(); diff --git a/Nasal/Panels/rmp.nas b/Nasal/Panels/rmp.nas index f546a631..06b77d17 100644 --- a/Nasal/Panels/rmp.nas +++ b/Nasal/Panels/rmp.nas @@ -395,23 +395,23 @@ var update_chan_sel = func(rmp_no) { var transfer = func(rmp_no) { rmp_no = rmp_no - 1; - var sel_chan = getprop("systems/radio/rmp[" ~ rmp_no ~ "]/sel_chan"); - var sel_crs = getprop("systems/radio/rmp[" ~ rmp_no ~ "]/select-crs"); + var sel_chan = getprop("/systems/radio/rmp[" ~ rmp_no ~ "]/sel_chan"); + var sel_crs = getprop("/systems/radio/rmp[" ~ rmp_no ~ "]/select-crs"); if (string.match(sel_chan, "vhf[1-3]")) { var mod1 = int(string.replace(sel_chan, "vhf", "")); var mod = mod1 - 1; var mem = getprop("instrumentation/comm[" ~ mod ~ "]/frequencies/selected-mhz"); - setprop("instrumentation/comm[" ~ mod ~ "]/frequencies/selected-mhz", getprop("systems/radio/rmp[" ~ rmp_no ~ "]/vhf" ~ mod1 ~ "-standby")); - setprop("systems/radio/rmp[" ~ rmp_no ~ "]/vhf" ~ mod1 ~ "-standby", mem); + setprop("instrumentation/comm[" ~ mod ~ "]/frequencies/selected-mhz", getprop("/systems/radio/rmp[" ~ rmp_no ~ "]/vhf" ~ mod1 ~ "-standby")); + setprop("/systems/radio/rmp[" ~ rmp_no ~ "]/vhf" ~ mod1 ~ "-standby", mem); } elsif (string.match(sel_chan, "hf[1-2]")) { var mod1 = int(string.replace(sel_chan, "hf", "")); var mod = mod1 - 1; var mem = systems.HFS[mod].selectedChannelKhz; - systems.HFS[mod].selectChannel(getprop("systems/radio/rmp[" ~ rmp_no ~ "]/hf" ~ mod1 ~ "-standby")); - setprop("systems/radio/rmp[" ~ rmp_no ~ "]/hf" ~ mod1 ~ "-standby", mem); + systems.HFS[mod].selectChannel(getprop("/systems/radio/rmp[" ~ rmp_no ~ "]/hf" ~ mod1 ~ "-standby")); + setprop("/systems/radio/rmp[" ~ rmp_no ~ "]/hf" ~ mod1 ~ "-standby", mem); } elsif (sel_chan == "adf") { var mem = getprop("instrumentation/adf[" ~ rmp_no ~ "]/frequencies/selected-khz"); setprop("instrumentation/adf[" ~ rmp_no ~ "]/frequencies/selected-khz", getprop("instrumentation/adf[" ~ rmp_no ~ "]/frequencies/standby-khz")); @@ -420,21 +420,21 @@ var transfer = func(rmp_no) { } elsif (sel_chan == "vor") { if (sel_crs) { setprop("instrumentation/nav[" ~ (rmp_no + 2) ~ "]/frequencies/standby-mhz", getprop("instrumentation/nav[" ~ (rmp_no + 2) ~ "]/frequencies/selected-mhz")); - setprop("systems/radio/rmp[" ~ rmp_no ~ "]/select-crs", 0); + setprop("/systems/radio/rmp[" ~ rmp_no ~ "]/select-crs", 0); update_displays_nav(rmp_no + 3); } else { setprop("instrumentation/nav[" ~ (rmp_no + 2) ~ "]/frequencies/selected-mhz", getprop("instrumentation/nav[" ~ (rmp_no + 2) ~ "]/frequencies/standby-mhz")); - setprop("systems/radio/rmp[" ~ rmp_no ~ "]/select-crs", 1); + setprop("/systems/radio/rmp[" ~ rmp_no ~ "]/select-crs", 1); update_displays_nav(rmp_no + 3); } } elsif (sel_chan == "ls") { if (sel_crs) { setprop("instrumentation/nav[0]/frequencies/standby-mhz", getprop("instrumentation/nav[0]/frequencies/selected-mhz")); - setprop("systems/radio/rmp[" ~ rmp_no ~ "]/select-crs", 0); + setprop("/systems/radio/rmp[" ~ rmp_no ~ "]/select-crs", 0); update_displays_nav(1); } else { setprop("instrumentation/nav[0]/frequencies/selected-mhz", getprop("instrumentation/nav[0]/frequencies/standby-mhz")); - setprop("systems/radio/rmp[" ~ rmp_no ~ "]/select-crs", 1); + setprop("/systems/radio/rmp[" ~ rmp_no ~ "]/select-crs", 1); update_displays_nav(1); } } diff --git a/Nasal/Systems/electrical.nas b/Nasal/Systems/electrical.nas index 6b95c723..4e295ea7 100644 --- a/Nasal/Systems/electrical.nas +++ b/Nasal/Systems/electrical.nas @@ -152,20 +152,20 @@ var ELEC = { }, }, Switch: { - acEssFeed: props.globals.getNode("controls/electrical/switches/ac-ess-feed"), - busTie: props.globals.getNode("controls/electrical/switches/bus-tie"), - bat1: props.globals.getNode("controls/electrical/switches/bat-1"), - bat2: props.globals.getNode("controls/electrical/switches/bat-2"), - emerGenTest: props.globals.getNode("controls/electrical/switches/emer-gen-test"), - extPwr: props.globals.getNode("controls/electrical/switches/ext-pwr"), - galley: props.globals.getNode("controls/electrical/switches/galley"), - gen1: props.globals.getNode("controls/electrical/switches/gen-1"), - gen2: props.globals.getNode("controls/electrical/switches/gen-2"), - genApu: props.globals.getNode("controls/electrical/switches/apu"), - gen1Line: props.globals.getNode("controls/electrical/switches/gen-1-line-contactor"), - idg1Disc: props.globals.getNode("controls/electrical/switches/idg-1-disc"), - idg2Disc: props.globals.getNode("controls/electrical/switches/idg-2-disc"), - emerElecManOn: props.globals.getNode("controls/electrical/switches/emer-elec-man-on"), # non-reset + acEssFeed: props.globals.getNode("/controls/electrical/switches/ac-ess-feed"), + busTie: props.globals.getNode("/controls/electrical/switches/bus-tie"), + bat1: props.globals.getNode("/controls/electrical/switches/bat-1"), + bat2: props.globals.getNode("/controls/electrical/switches/bat-2"), + emerGenTest: props.globals.getNode("/controls/electrical/switches/emer-gen-test"), + extPwr: props.globals.getNode("/controls/electrical/switches/ext-pwr"), + galley: props.globals.getNode("/controls/electrical/switches/galley"), + gen1: props.globals.getNode("/controls/electrical/switches/gen-1"), + gen2: props.globals.getNode("/controls/electrical/switches/gen-2"), + genApu: props.globals.getNode("/controls/electrical/switches/apu"), + gen1Line: props.globals.getNode("/controls/electrical/switches/gen-1-line-contactor"), + idg1Disc: props.globals.getNode("/controls/electrical/switches/idg-1-disc"), + idg2Disc: props.globals.getNode("/controls/electrical/switches/idg-2-disc"), + emerElecManOn: props.globals.getNode("/controls/electrical/switches/emer-elec-man-on"), # non-reset }, init: func() { me.resetFail(); diff --git a/Nasal/Systems/ground_services.nas b/Nasal/Systems/ground_services.nas index 88541e28..8d000458 100644 --- a/Nasal/Systems/ground_services.nas +++ b/Nasal/Systems/ground_services.nas @@ -11,31 +11,31 @@ var ground_services = { me.ice_time = 0; # Catering Truck - setprop("services/catering/scissor-deg", 0); - setprop("services/catering/position-norm", 0); + setprop("/services/catering/scissor-deg", 0); + setprop("/services/catering/position-norm", 0); # De-icing Truck - setprop("services/deicing_truck/enable", 0); - setprop("services/deicing_truck/de-ice", 0); + setprop("/services/deicing_truck/enable", 0); + setprop("/services/deicing_truck/de-ice", 0); # Set them all to 0 if the aircraft is not stationary if (getprop("velocities/groundspeed-kt") >= 2) { - setprop("services/chocks/enable", 0); - setprop("services/fuel-truck/enable", 0); - setprop("services/deicing_truck/enable", 0); - setprop("services/catering/enable", 0); + setprop("/services/chocks/enable", 0); + setprop("/services/fuel-truck/enable", 0); + setprop("/services/deicing_truck/enable", 0); + setprop("/services/catering/enable", 0); } me.reset(); }, update : func { # Catering Truck Controls - var cater_pos = getprop("services/catering/position-norm"); + var cater_pos = getprop("/services/catering/position-norm"); var scissor_deg = 3.325 * (1/D2R) * math.asin(cater_pos / (2 * 3.6612)); - setprop("services/catering/scissor-deg", scissor_deg); + setprop("/services/catering/scissor-deg", scissor_deg); # De-icing Truck - if (getprop("services/deicing_truck/enable") and getprop("services/deicing_truck/de-ice")) { + if (getprop("/services/deicing_truck/enable") and getprop("/services/deicing_truck/de-ice")) { if (me.ice_time == 2) { door.move(1); ground_message ("Lifting De-icing Crane..."); @@ -58,7 +58,7 @@ var ground_services = { if (me.ice_time == 900) { ground_message("De-icing Completed!", 1, 1, 1); - setprop("services/deicing_truck/de-ice", 0); + setprop("/services/deicing_truck/de-ice", 0); } } else { @@ -79,7 +79,7 @@ var ground_services = { }; var ground_message = func (string) { - setprop("sim/messages/ground", string); + setprop("/sim/messages/ground", string); } setlistener("sim/signals/fdm-initialized", func { diff --git a/Nasal/Systems/payload.nas b/Nasal/Systems/payload.nas index 7d0ec8ad..888be098 100644 --- a/Nasal/Systems/payload.nas +++ b/Nasal/Systems/payload.nas @@ -3,13 +3,13 @@ var fuelSvc = { _needCenter: 0, - enable: props.globals.getNode("services/fuel-truck/enable"), - connect: props.globals.getNode("services/fuel-truck/connect"), - operate: props.globals.getNode("services/fuel-truck/operate"), + enable: props.globals.getNode("/services/fuel-truck/enable"), + connect: props.globals.getNode("/services/fuel-truck/connect"), + operate: props.globals.getNode("/services/fuel-truck/operate"), Nodes: { - requestLbs: props.globals.getNode("services/fuel-truck/request-lbs"), - requestTotalLbs: props.globals.getNode("services/fuel-truck/request-total-lbs"), - requestFuelLbs: props.globals.initNode("services/fuel-truck/fuel-on-board-at-request", pts.Consumables.Fuel.totalFuelLbs.getValue(), "DOUBLE"), + requestLbs: props.globals.getNode("/services/fuel-truck/request-lbs"), + requestTotalLbs: props.globals.getNode("/services/fuel-truck/request-total-lbs"), + requestFuelLbs: props.globals.initNode("/services/fuel-truck/fuel-on-board-at-request", pts.Consumables.Fuel.totalFuelLbs.getValue(), "DOUBLE"), }, newRequest: func() {