From 1f109377135e8dbd4f4875eda67def74721f7d78 Mon Sep 17 00:00:00 2001 From: Inuyaksa Date: Mon, 22 Mar 2021 00:06:33 +0100 Subject: [PATCH 01/96] Some optimization with peak calc --- Models/Instruments/ND/canvas/map/TERRAIN.symbol | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Models/Instruments/ND/canvas/map/TERRAIN.symbol b/Models/Instruments/ND/canvas/map/TERRAIN.symbol index 6d226040..dca0c272 100644 --- a/Models/Instruments/ND/canvas/map/TERRAIN.symbol +++ b/Models/Instruments/ND/canvas/map/TERRAIN.symbol @@ -87,7 +87,7 @@ var updateTerrain = func { #var proj_lat = pos_lat + ((col * (range/30) * math.cos(DEG2RAD * (heading - 90))) / 40); # if me.tileradiusw == 20 - var range_20f = range / 18.75; + var range_20f = range / 19.70; #18.75; var heading_sin = math.sin(DEG2RAD * heading); var heading_cos = math.cos(DEG2RAD * heading); @@ -184,7 +184,7 @@ var update_altitudes = func { else me.terrain_maxcol.setValue(1); } - if (me.min_altitude == 9999) { + if (me.avg_maxalt == -9999) { me.avg_minalt = me.min_altitude; me.avg_maxalt = me.max_altitude; } else { @@ -197,9 +197,10 @@ var update_altitudes = func { me.avg_peakalt = me.avg_maxalt - me.avg_minalt; if (me.onground == 0 and (me.max_altitude + 250) < me.refaltitudeft) { # 250 ft tollerance - me.hialtmode = 1; - var range = math.min(2400,(me.avg_maxalt - me.avg_minalt)) - 400; - if (range < 400) { # min elev number + me.hialtmode = 1; + var mxrange = math.max(2400,int(me.avg_peakalt*0.25)); + var range = math.min(mxrange,(me.avg_maxalt - me.avg_minalt)) - 250; + if (range < 360) { # min elev number me.bands_range = 0; } else { me.bands_range = int(range / 4); @@ -350,7 +351,7 @@ var draw = func { if (me.min_altitude != 9999) me.update_altitudes(); - var flatalt = (me.avg_peakalt != nil and me.avg_peakalt>499) ? 400 : 140; + var flatalt = (me.avg_peakalt == nil or me.avg_peakalt>499) ? 400 : 140; var vspeed30s = int(getprop("velocities/vertical-speed-fps") * 30); if (vspeed30s<-500) me.refaltitudeft = math.max(me.avg_minalt , me.refaltitudeft + vspeed30s); From ec7850ba370000c0a9eb68a0fb6db605a23db5f9 Mon Sep 17 00:00:00 2001 From: Inuyaksa Date: Mon, 22 Mar 2021 00:07:20 +0100 Subject: [PATCH 02/96] VOR frequency change detection --- .../ND/canvas/framework/navdisplay.nas | 103 +++++++++++++----- 1 file changed, 74 insertions(+), 29 deletions(-) diff --git a/Models/Instruments/ND/canvas/framework/navdisplay.nas b/Models/Instruments/ND/canvas/framework/navdisplay.nas index 01569ad3..031ba7a6 100644 --- a/Models/Instruments/ND/canvas/framework/navdisplay.nas +++ b/Models/Instruments/ND/canvas/framework/navdisplay.nas @@ -25,58 +25,98 @@ var easeArrow = { m.duration = 0; m.startval = 0; m.diffval = 0; + m.nav = ""; + m.mhz = 0; + m.changed = 1; return m; }, setVisible: func(v) { - if (v == 1 and me.last_rot_deg == nil) me.reset(); + if (v == 1 and me.last_rot_deg == nil) me.setzero(); me.element.setVisible(v); }, hide: func { me.element.hide(); }, reset: func { + #me.element.hide(); + me.duration = 0; + me.changed = 1; + print("VOR reset"); + }, + setzero: func { + me.duration = 0; me.last_rot_deg = 360 - getprop("orientation/heading-deg"); me.last_rot_rad = me.last_rot_deg * D2R; - me.duration = 0; - print("VOR reset"); + me.req_rot_rad = me.last_rot_rad; + me.element.setRotation(me.last_rot_rad); + }, + listen: func (path) { + me.nav = path ~ "/frequencies/selected-mhz"; + setlistener(me.nav, func { + var freq = getprop(me.nav); + if (me.mhz != freq) { + me.mhz = freq; + me.reset(); + } + }); }, setRotation: func(rad) { var deg = 0; var gap = 0; + if (me.last_rot_deg == nil) me.setzero(); + rad = math.round(rad * 1000) / 1000; gap = math.abs(rad - me.req_rot_rad); - if (gap>0.001) { - if (me.duration>0) gap = math.abs(rad - me.last_rot_rad); - if (gap>=180*D2R) gap = 360*D2R - gap; + #if (gap>=180*D2R) gap = 360*D2R - gap; + if (gap>0.0009) { + #print("VOR rotation"); + #else if (me.duration>0) gap = math.abs(rad - me.last_rot_rad); deg = rad * 57.29578; - me.req_rot_rad = rad; - me.req_rot_deg = deg; - me.duration = 0; - if (gap>0.2) { - if (me.last_rot_deg == nil) me.reset(); + #me.duration = 0; + if (me.duration > 0) { + var add = deg - me.req_rot_deg; + if (add>=180) add = add - 360; + me.diffval += add; + me.duration = math.abs( math.round(me.diffval * 0.19) ); # rad 36/3 + } + else if (me.changed == 1) { + #if (me.last_rot_deg == nil) me.reset(); me.startval = me.last_rot_deg; me.diffval = deg - me.last_rot_deg; - if (me.diffval<0) me.diffval += 360; - me.time = 0; - me.duration = math.round(me.diffval * 0.21); # rad 36/3 + while (me.diffval<0) me.diffval += 360; + if (me.changed == 1 and me.diffval < 180) me.diffval += 360; + #print("VOR animation:" ~ me.diffval); + #me.time = 0; + me.duration = math.abs( math.round(me.diffval * 0.19) ); # rad 36/3 + } else { + me.duration = 0; } if (me.duration < 2) { me.last_rot_rad = rad; me.last_rot_deg = deg; me.element.setRotation(rad); me.duration = 0; + me.time = 0; + me.changed = 0; } + me.req_rot_rad = rad; + me.req_rot_deg = deg; } if (me.duration > 0) { var tx = me.time / me.duration; + if (tx>1) tx = 1; #thanks to https://easings.net/#easeOutCubic deg = (1 - math.pow(1 - tx, 3)) * me.diffval + me.startval; deg = math.mod(deg,360); #print("DEG: " ~ deg); - me.last_rot_deg = deg; - me.last_rot_rad = deg * D2R; - me.element.setRotation(me.last_rot_rad); + me.element.setRotation(deg * D2R); me.time += 1; - if (tx>=1) me.duration = 0; + if (tx>=1) { + me.duration = 0; + me.time = 0; + me.changed = 0; + me.last_rot_deg = deg; + me.last_rot_rad = rad; + } } } @@ -193,7 +233,7 @@ canvas.NavDisplay.newMFD = func(canvas_group, parent=nil, nd_options=nil, update foreach(var element; ["staArrowL2","staArrowR2","staArrowL","staArrowR"] ) me.symbols[element] = easeArrow.new( me.nd.getElementById(element).updateCenter() ); - + me.map = me.nd.createChild("map","map") .set("clip", "rect(124, 1024, 1024, 0)") .set("screen-range", 700) @@ -213,6 +253,12 @@ canvas.NavDisplay.newMFD = func(canvas_group, parent=nil, nd_options=nil, update return 0; } + # listen for (VOR) NAV frequency change + me.symbols.staArrowL.listen(vor1_path); + me.symbols.staArrowL2.listen(vor1_path); + me.symbols.staArrowR.listen(vor2_path); + me.symbols.staArrowR2.listen(vor2_path); + # another predicate for the draw controller var get_course_by_freq = func(freq) { if (freq == getprop(vor1_path~ "frequencies/selected-mhz")) @@ -610,36 +656,35 @@ canvas.NavDisplay.update = func() # FIXME: This stuff is still too aircraft spec } var adf0hdg = getprop("/instrumentation/adf/indicated-bearing-deg"); var adf1hdg = getprop("/instrumentation/adf[1]/indicated-bearing-deg"); - if(!me.get_switch("toggle_centered")) - { + if(!me.get_switch("toggle_centered")) { if(me.in_mode("toggle_display_mode", ["PLAN"]) or (me.adirs_property.getValue() != 1 or (me.change_phase == 1) and (adirs_3.getValue() != 1 or att_switch.getValue() != me.attitude_heading_setting))) me.symbols.trkInd.hide(); else me.symbols.trkInd.show(); if((getprop("/instrumentation/nav[2]/in-range") and me.get_switch("toggle_lh_vor_adf") == 1)) { - me.symbols.staArrowL.setVisible(staPtrVis); me.symbols.staToL.setColor(0.195,0.96,0.097); me.symbols.staFromL.setColor(0.195,0.96,0.097); me.symbols.staArrowL.setRotation(nav0hdg*D2R); + me.symbols.staArrowL.setVisible(staPtrVis); } elsif(getprop("/instrumentation/adf/in-range") and (me.get_switch("toggle_lh_vor_adf") == -1)) { - me.symbols.staArrowL.setVisible(staPtrVis); me.symbols.staToL.setColor(0,0.6,0.85); me.symbols.staFromL.setColor(0,0.6,0.85); me.symbols.staArrowL.setRotation(adf0hdg*D2R); + me.symbols.staArrowL.setVisible(staPtrVis); } else { me.symbols.staArrowL.hide(); } if((getprop("/instrumentation/nav[3]/in-range") and me.get_switch("toggle_rh_vor_adf") == 1)) { - me.symbols.staArrowR.setVisible(staPtrVis); me.symbols.staToR.setColor(0.195,0.96,0.097); me.symbols.staFromR.setColor(0.195,0.96,0.097); me.symbols.staArrowR.setRotation(nav1hdg*D2R); - } elsif(getprop("/instrumentation/adf[1]/in-range") and (me.get_switch("toggle_rh_vor_adf") == -1)) { me.symbols.staArrowR.setVisible(staPtrVis); + } elsif(getprop("/instrumentation/adf[1]/in-range") and (me.get_switch("toggle_rh_vor_adf") == -1)) { me.symbols.staToR.setColor(0,0.6,0.85); me.symbols.staFromR.setColor(0,0.6,0.85); me.symbols.staArrowR.setRotation(adf1hdg*D2R); + me.symbols.staArrowR.setVisible(staPtrVis); } else { me.symbols.staArrowR.hide(); } @@ -671,28 +716,28 @@ canvas.NavDisplay.update = func() # FIXME: This stuff is still too aircraft spec } else { me.symbols.trkInd.hide(); if((getprop("/instrumentation/nav[2]/in-range") and me.get_switch("toggle_lh_vor_adf") == 1)) { - me.symbols.staArrowL2.setVisible(staPtrVis); me.symbols.staFromL2.setColor(0.195,0.96,0.097); me.symbols.staToL2.setColor(0.195,0.96,0.097); me.symbols.staArrowL2.setRotation(nav0hdg*D2R); - } elsif(getprop("/instrumentation/adf/in-range") and (me.get_switch("toggle_lh_vor_adf") == -1)) { me.symbols.staArrowL2.setVisible(staPtrVis); + } elsif(getprop("/instrumentation/adf/in-range") and (me.get_switch("toggle_lh_vor_adf") == -1)) { me.symbols.staFromL2.setColor(0,0.6,0.85); me.symbols.staToL2.setColor(0,0.6,0.85); me.symbols.staArrowL2.setRotation(adf0hdg*D2R); + me.symbols.staArrowL2.setVisible(staPtrVis); } else { me.symbols.staArrowL2.hide(); } if((getprop("/instrumentation/nav[3]/in-range") and me.get_switch("toggle_rh_vor_adf") == 1)) { - me.symbols.staArrowR2.setVisible(staPtrVis); me.symbols.staFromR2.setColor(0.195,0.96,0.097); me.symbols.staToR2.setColor(0.195,0.96,0.097); me.symbols.staArrowR2.setRotation(nav1hdg*D2R); - } elsif(getprop("/instrumentation/adf[1]/in-range") and (me.get_switch("toggle_rh_vor_adf") == -1)) { me.symbols.staArrowR2.setVisible(staPtrVis); + } elsif(getprop("/instrumentation/adf[1]/in-range") and (me.get_switch("toggle_rh_vor_adf") == -1)) { me.symbols.staFromR2.setColor(0,0.6,0.85); me.symbols.staToR2.setColor(0,0.6,0.85); me.symbols.staArrowR2.setRotation(adf1hdg*D2R); + me.symbols.staArrowR2.setVisible(staPtrVis); } else { me.symbols.staArrowR2.hide(); } From 188808ce3bb840c1547497001c49515d92f7ada9 Mon Sep 17 00:00:00 2001 From: Inuyaksa Date: Mon, 22 Mar 2021 23:01:42 +0100 Subject: [PATCH 03/96] TERR fix for mode/range change On mode/range change display TERR only, hide numbers. --- .../ND/canvas/framework/navdisplay.nas | 2 +- .../Instruments/ND/canvas/map/TERRAIN.symbol | 2 +- Models/Instruments/ND/canvas/res/airbusND.svg | 61 ++++++++++--------- Models/Instruments/ND/canvas/style.nas | 44 +++++++------ 4 files changed, 58 insertions(+), 51 deletions(-) diff --git a/Models/Instruments/ND/canvas/framework/navdisplay.nas b/Models/Instruments/ND/canvas/framework/navdisplay.nas index 031ba7a6..8c4063d8 100644 --- a/Models/Instruments/ND/canvas/framework/navdisplay.nas +++ b/Models/Instruments/ND/canvas/framework/navdisplay.nas @@ -213,7 +213,7 @@ canvas.NavDisplay.newMFD = func(canvas_group, parent=nil, nd_options=nil, update # because things are much better configurable that way # now look up all required SVG elements and initialize member fields using the same name to have a convenient handle foreach(var element; ["dmeL","dmeR","vorL","vorR","vorLId","vorRId", - "status.wxr","status.wpt","status.sta","status.arpt","terrHI","terrLO","TerrLabel","terrAhead"]) + "status.wxr","status.wpt","status.sta","status.arpt","terrHI","terrLO","TerrLabel","terrAhead","terrAltGroup"]) me.symbols[element] = me.nd.getElementById(element); foreach(var element; ["dmeLDist","dmeRDist"]) diff --git a/Models/Instruments/ND/canvas/map/TERRAIN.symbol b/Models/Instruments/ND/canvas/map/TERRAIN.symbol index dca0c272..0eeff7e9 100644 --- a/Models/Instruments/ND/canvas/map/TERRAIN.symbol +++ b/Models/Instruments/ND/canvas/map/TERRAIN.symbol @@ -18,7 +18,7 @@ var element_type = "group"; var terrain_minalt = props.globals.initNode("/instrumentation/efis[0]/nd/terrain-on-nd/min-altitude", 0,"INT"); var terrain_maxalt = props.globals.initNode("/instrumentation/efis[0]/nd/terrain-on-nd/max-altitude", -9999,"INT"); -var terrain_maxcol = props.globals.initNode("/instrumentation/efis[0]/nd/terrain-on-nd/max-color", 0,"INT"); # 0= grn, 1= yel, 2= red +var terrain_maxcol = props.globals.initNode("/instrumentation/efis[0]/nd/terrain-on-nd/max-color", -1,"INT"); # 0= grn, 1= yel, 2= red var terrain_alert = props.globals.getNode("/instrumentation/mk-viii/outputs/alert-mode"); diff --git a/Models/Instruments/ND/canvas/res/airbusND.svg b/Models/Instruments/ND/canvas/res/airbusND.svg index 8197f17a..c93d3d05 100644 --- a/Models/Instruments/ND/canvas/res/airbusND.svg +++ b/Models/Instruments/ND/canvas/res/airbusND.svg @@ -298,40 +298,41 @@ sodipodi:role="line" id="tspan1994" x="952.74292" - y="826.34009">TERRTERR000000000000 Date: Wed, 24 Mar 2021 22:04:08 +0100 Subject: [PATCH 04/96] TERR - separated values from each ND --- .../Instruments/ND/canvas/map/TERRAIN.symbol | 30 ++++++++------ Models/Instruments/ND/canvas/style.nas | 41 ++++++++++--------- 2 files changed, 40 insertions(+), 31 deletions(-) diff --git a/Models/Instruments/ND/canvas/map/TERRAIN.symbol b/Models/Instruments/ND/canvas/map/TERRAIN.symbol index 0eeff7e9..f55dba20 100644 --- a/Models/Instruments/ND/canvas/map/TERRAIN.symbol +++ b/Models/Instruments/ND/canvas/map/TERRAIN.symbol @@ -16,10 +16,6 @@ DotSym.makeinstance( name, __self__ ); var element_type = "group"; -var terrain_minalt = props.globals.initNode("/instrumentation/efis[0]/nd/terrain-on-nd/min-altitude", 0,"INT"); -var terrain_maxalt = props.globals.initNode("/instrumentation/efis[0]/nd/terrain-on-nd/max-altitude", -9999,"INT"); -var terrain_maxcol = props.globals.initNode("/instrumentation/efis[0]/nd/terrain-on-nd/max-color", -1,"INT"); # 0= grn, 1= yel, 2= red - var terrain_alert = props.globals.getNode("/instrumentation/mk-viii/outputs/alert-mode"); var tile_list = [ @@ -91,8 +87,10 @@ var updateTerrain = func { var heading_sin = math.sin(DEG2RAD * heading); var heading_cos = math.cos(DEG2RAD * heading); - var proj_lon = pos_lon + ((col * range_20f * math.sin(DEG2RAD * (heading - 90))) / 60); - var proj_lat = pos_lat + ((col * range_20f * math.cos(DEG2RAD * (heading - 90))) / 60); + var col_x_range20f = col * range_20f; + + var proj_lon = pos_lon + ((col_x_range20f * math.sin(DEG2RAD * (heading - 90))) / 60); + var proj_lat = pos_lat + ((col_x_range20f * math.cos(DEG2RAD * (heading - 90))) / 60); var elevft = []; @@ -105,8 +103,10 @@ var updateTerrain = func { continue; } - var point_lon = proj_lon + ((row * range_20f / 60) * heading_sin); - var point_lat = proj_lat + ((row * range_20f / 60) * heading_cos); + var row_x_r20f_60th = (row * range_20f / 60); + + var point_lon = proj_lon + (row_x_r20f_60th * heading_sin); + var point_lat = proj_lat + (row_x_r20f_60th * heading_cos); var elev = me.get_elevation(point_lat, point_lon); var grad = 0; #black @@ -224,7 +224,9 @@ var restart_beacon = func { }; var init = func { - #print('TERRAIN init'); + print('TERRAIN init'); + #print(me.layer.efis_path); + me.tile = 33; me.fetching = 0; me.fetchRad = me.model.fetchRad; # Radius of radar layer to fetch @@ -251,6 +253,10 @@ var init = func { me.checkarrival = 0; me.onground = 1; + me.terrain_minalt = props.globals.initNode(me.layer.efis_path ~ "/nd/terrain-on-nd/min-altitude", 0,"INT"); + me.terrain_maxalt = props.globals.initNode(me.layer.efis_path ~ "/nd/terrain-on-nd/max-altitude", -9999,"INT"); + me.terrain_maxcol = props.globals.initNode(me.layer.efis_path ~ "/nd/terrain-on-nd/max-color", -1,"INT"); # 0= grn, 1= yel, 2= red + var tile = me.tile; var gx = int(me.viewport_radius / tile); @@ -326,12 +332,12 @@ var draw = func { return; } - if (me.layer.display_changed == 1) { - me.layer.display_changed = 0; + if (me.layer.display_hidden == 1) { + me.layer.display_hidden = 0; me.clear(); me.min_altitude = 9999; me.max_altitude = -9999; - terrain_maxalt.setValue(-9999); + me.terrain_maxalt.setValue(-9999); me.reference = nil; } diff --git a/Models/Instruments/ND/canvas/style.nas b/Models/Instruments/ND/canvas/style.nas index d957c012..7f4579f9 100644 --- a/Models/Instruments/ND/canvas/style.nas +++ b/Models/Instruments/ND/canvas/style.nas @@ -12,9 +12,6 @@ var adirs_3 = props.globals.getNode("/instrumentation/efis[0]/nd/ir-3", 1); var vhdg_bug = props.globals.getNode("/it-autoflight/input/hdg",0); # ND compass position deg -var terrain_minalt = props.globals.getNode("/instrumentation/efis[0]/nd/terrain-on-nd/min-altitude", 0); -var terrain_maxalt = props.globals.getNode("/instrumentation/efis[0]/nd/terrain-on-nd/max-altitude", -9999); -var terrain_maxcol = props.globals.getNode("/instrumentation/efis[0]/nd/terrain-on-nd/max-color", -1); var terrain_alert = props.globals.getNode("/instrumentation/mk-viii/outputs/alert-mode",0); var GREEN = [0.0509,0.7529,0.2941]; @@ -97,14 +94,15 @@ canvas.NDStyles["Airbus"] = { isMapStructure: 1, update_on:[ {rate_hz: 10}, "toggle_range","toggle_display_mode","toggle_terrain"], predicate: func(nd, layer) { - #print("TERRAIN TOGGLE: " ~ nd.get_switch("toggle_terrain")); + #print("TERRAIN TOGGLE: " ~ nd.get_switch("toggle_terrain")); var visible = nd.get_switch("toggle_terrain") and nd.get_switch("toggle_display_mode") != "PLAN" and (nd.rangeNm() <= 40) and (nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting)); - if (visible) { + if (visible) { layer.update(); } else { - layer.display_changed = 1; + layer.efis_path = nd.efis_path; + layer.display_hidden = 1; } layer.group.setVisible(visible); }, # end of layer update predicate @@ -2003,6 +2001,7 @@ canvas.NDStyles["Airbus"] = { nd.get_switch("toggle_display_mode") != "PLAN" and (nd.rangeNm() <= 40) and (nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting)) ), is_true: func(nd){ + var terrain_maxalt = props.globals.initNode(nd.efis_path ~ "/nd/terrain-on-nd/max-altitude", -9999,"INT"); var alert = terrain_alert.getValue(); if (alert == 0) { nd.symbols.TerrLabel.setVisible(1); @@ -2013,24 +2012,28 @@ canvas.NDStyles["Airbus"] = { if (alert == 1) nd.symbols.terrAhead.setColor(YELLOW[0],YELLOW[1],YELLOW[2]); else nd.symbols.terrAhead.setColor(RED[0],RED[1],RED[2]); } - if (nd.change_phase != 1) { - if (terrain_maxalt.getValue() != -9999) { - nd.symbols.terrLO.setText(sprintf("%03d",math.round(terrain_minalt.getValue()/100))); - nd.symbols.terrHI.setText(sprintf("%03d",math.round(terrain_maxalt.getValue()/100))); - if (terrain_maxcol.getValue() == 0) nd.symbols.terrHI.setColor(GREEN[0],GREEN[1],GREEN[2]); - else if (terrain_maxcol.getValue() == 1) nd.symbols.terrHI.setColor(YELLOW[0],YELLOW[1],YELLOW[2]); - else nd.symbols.terrHI.setColor(RED[0],RED[1],RED[2]); - terrain_maxalt.setValue(-9999); #update visual at radar cycle - } - if (terrain_maxcol != -1) nd.symbols.terrAltGroup.show(); - else nd.symbols.terrAltGroup.hide(); - } else{ + + if (terrain_maxalt.getValue() != -9999) { + var terrain_minalt = getprop(nd.efis_path ~ "/nd/terrain-on-nd/min-altitude"); + var terrain_maxcol = getprop(nd.efis_path ~ "/nd/terrain-on-nd/max-color"); + nd.symbols.terrLO.setText(sprintf("%03d",math.round(terrain_minalt/100))); + nd.symbols.terrHI.setText(sprintf("%03d",math.round(terrain_maxalt.getValue()/100))); + if (terrain_maxcol == 0) nd.symbols.terrHI.setColor(GREEN[0],GREEN[1],GREEN[2]); + else if (terrain_maxcol == 1) nd.symbols.terrHI.setColor(YELLOW[0],YELLOW[1],YELLOW[2]); + else nd.symbols.terrHI.setColor(RED[0],RED[1],RED[2]); + terrain_maxalt.setValue(-9999); #update visual at radar cycle + nd.symbols.terrAltGroup.show(); + } + + if (nd.change_phase == 1) { nd.symbols.terrAltGroup.hide(); - } + } + nd.symbols.terrGroup.show(); }, is_false: func(nd){ nd.symbols.terrGroup.hide(); + nd.symbols.terrAltGroup.hide(); } } }, From ada64f22b76c964279c459167a51fddc22d03ac7 Mon Sep 17 00:00:00 2001 From: Inuyaksa Date: Sun, 11 Apr 2021 23:19:25 +0200 Subject: [PATCH 05/96] TERR - more consistent green areas display --- .../Instruments/ND/canvas/map/TERRAIN.symbol | 109 ++++++++++-------- 1 file changed, 61 insertions(+), 48 deletions(-) diff --git a/Models/Instruments/ND/canvas/map/TERRAIN.symbol b/Models/Instruments/ND/canvas/map/TERRAIN.symbol index f55dba20..9a652d4b 100644 --- a/Models/Instruments/ND/canvas/map/TERRAIN.symbol +++ b/Models/Instruments/ND/canvas/map/TERRAIN.symbol @@ -96,6 +96,9 @@ var updateTerrain = func { me.radar_cleared = 0; + var altmin = 9999; + var altmax = -9999; + for (var row = 0; row < len; row += 1) { if (trn[row] == nil) { @@ -111,17 +114,17 @@ var updateTerrain = func { var elev = me.get_elevation(point_lat, point_lon); var grad = 0; #black if (elev != nil) { - if (elev>me.max_altitude) me.max_altitude = elev; + if (elev>altmax) altmax = elev; if (me.is_terrain) { - if (elev=0) { grad = int(diff/1000) + 3; if (grad>5) grad = 5; - if (alert_level > 0 and a < 6 and grad > 3) { - if (alert_level == 1 and (grad == 3 or grad == 4)) grad = 12; # solid yellow + if (alert_level > 0 and a <= 6) { + if (alert_level == 1 and grad != 5) grad = 12; # solid yellow else if (alert_level == 2 and grad == 5) grad = 13; # solid red } } else { @@ -135,9 +138,13 @@ var updateTerrain = func { if (diff>=lowaltft) grad = 3; # lite yellow else { if (me.bands_range > 0 and elev > me.bands_minalt) { - grad = 9 - int((me.bands_maxalt - elev) / me.bands_range); - if (grad>9) grad = 9; # solid green - else if (grad<6) grad = 6; #light green + if (elev >= me.green_altitude) grad = 9; # solid green + else { + grad = 8 - int((me.bands_maxalt - elev) / me.bands_range); # 9 - + #if (grad>9) grad = 9; # solid green + if (grad>8) grad = 8; # high green + else if (grad<6) grad = 6; #light green + } } } } @@ -153,8 +160,6 @@ var updateTerrain = func { } - if (me.min_altitude > me.max_altitude) me.min_altitude = me.max_altitude; # occurs on sea areas - for (var r=0; r < len; r+=1) { var imgx = elevft[r]; if (imgx == -1) continue; @@ -162,6 +167,20 @@ var updateTerrain = func { else trn[r].setFile(me.imgpath ~ me.tile_list[imgx]).show(); } + if (altmax != -9999) { + + if (altmin > altmax) altmin = altmax; # occurs on sea areas + + if (me.max_altitude == -9999) { + me.min_altitude = altmin; + me.max_altitude = altmax; + } else { + if (altminme.max_altitude) me.max_altitude = altmax; + } + + } + me.radar_beacon += 1; if (me.radar_beacon >= (me.tileradiusw*2)) { me.restart_beacon(); @@ -172,48 +191,49 @@ var updateTerrain = func { var update_altitudes = func { - me.terrain_minalt.setValue(me.min_altitude); - me.terrain_maxalt.setValue(me.max_altitude); + var maxalt = int(me.max_altitude); + me.terrain_minalt.setValue(int(me.min_altitude)); + me.terrain_maxalt.setValue(maxalt); - var altdif = me.max_altitude - me.refaltitudeft; + if (me.avg_maxalt == -9999) { + me.avg_minalt = int(me.min_altitude); + me.avg_maxalt = maxalt; + } else { + me.avg_minalt = math.avg(me.avg_minalt,me.min_altitude); + me.avg_maxalt = math.avg(me.avg_maxalt,maxalt); + } + + var altdif = maxalt - me.refaltitudeft; if (altdif <= 0) { if (altdif >= me.reflowaltft) me.terrain_maxcol.setValue(1); else me.terrain_maxcol.setValue(0); } else { - if (altdif>2000) me.terrain_maxcol.setValue(2); + if (altdif>=2000) me.terrain_maxcol.setValue(2); else me.terrain_maxcol.setValue(1); } - if (me.avg_maxalt == -9999) { - me.avg_minalt = me.min_altitude; - me.avg_maxalt = me.max_altitude; - } else { - #if (me.min_altitude < me.avg_minalt) me.avg_minalt = me.min_altitude;else - me.avg_minalt = math.round((me.avg_minalt * 2 + me.min_altitude) / 3); - #if (me.max_altitude > me.avg_maxalt) me.avg_maxalt = me.max_altitude;else - me.avg_maxalt = math.round((me.avg_maxalt * 2 + me.max_altitude) / 3); - } + me.avg_diffalt = me.avg_maxalt - me.avg_minalt; - me.avg_peakalt = me.avg_maxalt - me.avg_minalt; - - if (me.onground == 0 and (me.max_altitude + 250) < me.refaltitudeft) { # 250 ft tollerance + if (me.onground == 0 and (maxalt + 200) < me.refaltitudeft) { # 200 ft tollerance me.hialtmode = 1; - var mxrange = math.max(2400,int(me.avg_peakalt*0.25)); - var range = math.min(mxrange,(me.avg_maxalt - me.avg_minalt)) - 250; - if (range < 360) { # min elev number - me.bands_range = 0; - } else { - me.bands_range = int(range / 4); + var mxrange = math.max(1600,int((me.avg_maxalt - me.basealtitudeft) * 0.3)); + var range = math.min(mxrange,me.avg_diffalt); + if (range < 160) { # min elev number + me.bands_range = 0; + } else { me.bands_maxalt = me.avg_maxalt; - me.bands_minalt = math.max( me.avg_maxalt - range, me.avg_minalt + 400 ); + me.bands_minalt = math.max( me.avg_maxalt - range, me.avg_minalt + me.basealtitudeft ); + me.bands_range = int( (me.bands_maxalt - me.bands_minalt) / 4); } + me.green_altitude = math.max(maxalt - 1200, me.avg_maxalt - me.bands_range); } else { me.hialtmode = 0; #me.avg_minalt = 9999; } me.min_altitude = 9999; - me.max_altitude = -9999; + me.max_altitude = -9999; + me.avg_maxalt = -9999; } @@ -239,9 +259,10 @@ var init = func { me.request_clear = 0; me.min_altitude = 9999; me.max_altitude = -9999; + me.green_altitude = 0; # max altitude for solid green (peak color) me.avg_minalt = 9999; me.avg_maxalt = -9999; - me.avg_peakalt = nil; + me.avg_diffalt = nil; me.maxalt_col = 0; # 0 = grn, 1 = yel, 2 = red me.bands_minalt = 0; me.bands_maxalt = 0; @@ -335,9 +356,10 @@ var draw = func { if (me.layer.display_hidden == 1) { me.layer.display_hidden = 0; me.clear(); + me.terrain_maxalt.setValue(-9999); me.min_altitude = 9999; me.max_altitude = -9999; - me.terrain_maxalt.setValue(-9999); + me.avg_maxalt = -9999; me.reference = nil; } @@ -355,9 +377,9 @@ var draw = func { me.reflowaltft = (pts.Gear.position[1].getValue()) ? -250 : -500; me.onground = pts.Gear.wow[0].getValue(); - if (me.min_altitude != 9999) me.update_altitudes(); + if (me.max_altitude != -9999) me.update_altitudes(); - var flatalt = (me.avg_peakalt == nil or me.avg_peakalt>499) ? 400 : 140; + var flatalt = (me.avg_diffalt == nil or me.avg_diffalt>499) ? 400 : 180; var vspeed30s = int(getprop("velocities/vertical-speed-fps") * 30); if (vspeed30s<-500) me.refaltitudeft = math.max(me.avg_minalt , me.refaltitudeft + vspeed30s); @@ -404,19 +426,10 @@ var draw = func { print("set REFALT [blwbase]: "~me.basealtitudeft); } } else if (fmgc.FMGCInternal.phase >= 2) { - me.basealtitudeft = math.avg(me.basealtitudeft,flatalt + me.groundaltft,int(flatalt + me.avg_minalt)); - #if (me.basealtitudeft > me.avg_maxalt) { - # if (me.avg_maxalt < 1000) me.basealtitudeft = 0; # 1000ft min elev number - # else me.basealtitudeft = int(400 + me.avg_minalt); - # print("set REFALT [blwmin]: "~me.basealtitudeft); - #} - #else if (me.basealtitudeft == 0 and me.avg_maxalt >= 1000) { # 1000ft min elev number - # me.basealtitudeft = int(400 + me.avg_minalt); - # print("set REFALT [abvmin]: "~me.basealtitudeft); - #} + if (me.avg_minalt != 9999) me.basealtitudeft = int(math.avg(me.basealtitudeft,flatalt + me.avg_minalt)); } - } + } } else { From 4b9166605d1c2645a5a454d05380f9e19fc5b775 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Tue, 18 May 2021 13:02:11 +0100 Subject: [PATCH 06/96] Leading / with setlistener --- Models/Instruments/Lower-ECAM/Lower-ECAM.nas | 2 +- Models/Instruments/MCDU/MCDU.nas | 2 +- Models/Instruments/ND/canvas/ND.nas | 2 +- Models/Instruments/PFD/PFD.nas | 2 +- Nasal/FBW/it-fbw.nas | 6 +++--- Nasal/FMGC/FMGC-c.nas | 2 +- Nasal/Panels/clock.nas | 2 +- Nasal/Panels/efis.nas | 2 +- Nasal/Systems/ground_services.nas | 2 +- Nasal/Systems/tyresmoke.nas | 6 +++--- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index feaae20f..ae1298d8 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -3560,7 +3560,7 @@ var canvas_lowerECAM_test = { }, }; -setlistener("sim/signals/fdm-initialized", func { +setlistener("/sim/signals/fdm-initialized", func { lowerECAM_display = canvas.new({ "name": "lowerECAM", "size": [1024, 1024], diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index 1142c943..f9e09f1c 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -6567,7 +6567,7 @@ var canvas_MCDU_2 = { }, }; -setlistener("sim/signals/fdm-initialized", func { +setlistener("/sim/signals/fdm-initialized", func { MCDU1_display = canvas.new({ "name": "MCDU1", "size": [1024, 864], diff --git a/Models/Instruments/ND/canvas/ND.nas b/Models/Instruments/ND/canvas/ND.nas index 5fe845d3..0cecff51 100644 --- a/Models/Instruments/ND/canvas/ND.nas +++ b/Models/Instruments/ND/canvas/ND.nas @@ -323,7 +323,7 @@ var canvas_ND_2_test = { }, }; -setlistener("sim/signals/fdm-initialized", func { +setlistener("/sim/signals/fdm-initialized", func { setprop("instrumentation/efis[0]/inputs/plan-wpt-index", -1); setprop("instrumentation/efis[1]/inputs/plan-wpt-index", -1); diff --git a/Models/Instruments/PFD/PFD.nas b/Models/Instruments/PFD/PFD.nas index 77c41c11..78e62441 100644 --- a/Models/Instruments/PFD/PFD.nas +++ b/Models/Instruments/PFD/PFD.nas @@ -2720,7 +2720,7 @@ var canvas_PFD_2_mismatch = { }, }; -setlistener("sim/signals/fdm-initialized", func { +setlistener("/sim/signals/fdm-initialized", func { PFD1_display = canvas.new({ "name": "PFD1", "size": [1024, 1024], diff --git a/Nasal/FBW/it-fbw.nas b/Nasal/FBW/it-fbw.nas index ab6fe620..18b21fec 100644 --- a/Nasal/FBW/it-fbw.nas +++ b/Nasal/FBW/it-fbw.nas @@ -338,7 +338,7 @@ var fbw_loop = func { } } -setlistener("systems/fctl/sec1", func() { +setlistener("/systems/fctl/sec1", func() { if (FBW.Computers.sec1.getBoolValue()) { FBW.Failures.spoilerl3.setBoolValue(0); FBW.Failures.spoilerr3.setBoolValue(0); @@ -352,7 +352,7 @@ setlistener("systems/fctl/sec1", func() { } }, 0, 0); -setlistener("systems/fctl/sec2", func() { +setlistener("/systems/fctl/sec2", func() { if (FBW.Computers.sec2.getBoolValue()) { FBW.Failures.spoilerl5.setBoolValue(0); FBW.Failures.spoilerr5.setBoolValue(0); @@ -362,7 +362,7 @@ setlistener("systems/fctl/sec2", func() { } }, 0, 0); -setlistener("systems/fctl/sec3", func() { +setlistener("/systems/fctl/sec3", func() { if (FBW.Computers.sec3.getBoolValue()) { FBW.Failures.spoilerl1.setBoolValue(0); FBW.Failures.spoilerr1.setBoolValue(0); diff --git a/Nasal/FMGC/FMGC-c.nas b/Nasal/FMGC/FMGC-c.nas index e9282207..f47947ab 100644 --- a/Nasal/FMGC/FMGC-c.nas +++ b/Nasal/FMGC/FMGC-c.nas @@ -670,6 +670,6 @@ setlistener("/modes/pfd/fma/pitch-mode2-armed", func { } }); -setlistener("sim/signals/fdm-initialized", func { +setlistener("/sim/signals/fdm-initialized", func { init(); }); diff --git a/Nasal/Panels/clock.nas b/Nasal/Panels/clock.nas index 30985b60..ff47f577 100644 --- a/Nasal/Panels/clock.nas +++ b/Nasal/Panels/clock.nas @@ -72,7 +72,7 @@ var rudderTrim = { rudderTrimDisplayLetter: props.globals.initNode("/controls/flight/rudder-trim-letter-display", "", "STRING"), }; -setlistener("sim/signals/fdm-initialized", func { +setlistener("/sim/signals/fdm-initialized", func { chr.stop(); chr.reset(); clk.stop(); diff --git a/Nasal/Panels/efis.nas b/Nasal/Panels/efis.nas index 218032d8..1106bfad 100644 --- a/Nasal/Panels/efis.nas +++ b/Nasal/Panels/efis.nas @@ -4,7 +4,7 @@ var mode = "NAV"; var rng = 20; -setlistener("sim/signals/fdm-initialized", func { # Fix completely retarded shit on the ND +setlistener("/sim/signals/fdm-initialized", func { # Fix completely retarded shit on the ND pts.Instrumentation.Efis.Mfd.pnlModeNum[0].setValue(2); pts.Instrumentation.Efis.Mfd.pnlModeNum[1].setValue(2); pts.Instrumentation.Efis.Nd.displayMode[0].setValue("NAV"); diff --git a/Nasal/Systems/ground_services.nas b/Nasal/Systems/ground_services.nas index 8d000458..ff82adef 100644 --- a/Nasal/Systems/ground_services.nas +++ b/Nasal/Systems/ground_services.nas @@ -82,6 +82,6 @@ var ground_message = func (string) { setprop("/sim/messages/ground", string); } -setlistener("sim/signals/fdm-initialized", func { +setlistener("/sim/signals/fdm-initialized", func { ground_services.init(); }); diff --git a/Nasal/Systems/tyresmoke.nas b/Nasal/Systems/tyresmoke.nas index d9d72aff..3da224aa 100755 --- a/Nasal/Systems/tyresmoke.nas +++ b/Nasal/Systems/tyresmoke.nas @@ -7,7 +7,7 @@ var tyresmoke_1 = aircraft.tyresmoke.new(1, 0, 0.8, 0); var tyresmoke_2 = aircraft.tyresmoke.new(2, 0, 0.8, 0); # =============================== listeners =============================== -setlistener("gear/gear[0]/position-norm", func { +setlistener("/gear/gear[0]/position-norm", func { if (pts.Gear.position[0].getValue()){ run_tyresmoke0 = 1; }else{ @@ -15,7 +15,7 @@ setlistener("gear/gear[0]/position-norm", func { } },1,0); -setlistener("gear/gear[1]/position-norm", func { +setlistener("/gear/gear[1]/position-norm", func { if (pts.Gear.position[1].getValue()){ run_tyresmoke1 = 1; }else{ @@ -23,7 +23,7 @@ setlistener("gear/gear[1]/position-norm", func { } },1,0); -setlistener("gear/gear[2]/position-norm", func { +setlistener("/gear/gear[2]/position-norm", func { if (pts.Gear.position[2].getValue()){ run_tyresmoke2 = 1; }else{ From 8ec82d6c24b5b8c76e451f3cd6cd30975a90f9dc Mon Sep 17 00:00:00 2001 From: Owen Wang Date: Fri, 21 May 2021 12:22:57 -0400 Subject: [PATCH 07/96] Update README.md to be more clear on how to connect to the Remote MCDU --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 40ac7034..dbc58375 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ It is highly reccomended to purchase a NAVIGRAPH subscription and download their To install navdata, create a folder FMSDATA, and add it to your additional scenery folders, at the top of the list. Inside that folder, place all the XXXX.procedures.xml files, in the format FMSDATA/X/X/X/XXXX.procedures.xml. For instance, FMSDATA/Airports/E/G/K/EGKK.procedures.xml. ## Remote MCDU -If you want to run the MCDU on a phone or tablet for better realism and easier input, put mcdu.html into the FGDATA/Phi folder, run FlightGear with enabled HTTP server (i.e. command line --httpd=8080) and open http://your-flightgear-computer:8080/mcdu.html in the browser on your phone or tablet. +If you want to run the MCDU on a phone or tablet for better realism and easier input, put mcdu.html into the FGDATA/Phi folder, run FlightGear with enabled HTTP server (i.e. command line --httpd=[Port; e.g. 8080]) and open http://[FlightGear Computer IP/Hostname]:[Port]/mcdu.html in the browser on your phone or tablet. ## Installation If you have issues installing, please check INSTALL.MD! From 3d058f07d22271fc77eb4bd935108e2439e6c318 Mon Sep 17 00:00:00 2001 From: Owen Wang Date: Fri, 21 May 2021 13:12:14 -0400 Subject: [PATCH 08/96] Change []s to <>s to indicate required field --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dbc58375..13a36d2f 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ It is highly reccomended to purchase a NAVIGRAPH subscription and download their To install navdata, create a folder FMSDATA, and add it to your additional scenery folders, at the top of the list. Inside that folder, place all the XXXX.procedures.xml files, in the format FMSDATA/X/X/X/XXXX.procedures.xml. For instance, FMSDATA/Airports/E/G/K/EGKK.procedures.xml. ## Remote MCDU -If you want to run the MCDU on a phone or tablet for better realism and easier input, put mcdu.html into the FGDATA/Phi folder, run FlightGear with enabled HTTP server (i.e. command line --httpd=[Port; e.g. 8080]) and open http://[FlightGear Computer IP/Hostname]:[Port]/mcdu.html in the browser on your phone or tablet. +If you want to run the MCDU on a phone or tablet for better realism and easier input, put mcdu.html into the FGDATA/Phi folder, run FlightGear with enabled HTTP server (i.e. command line --httpd=) and open http://:/mcdu.html in the browser on your phone or tablet. ## Installation If you have issues installing, please check INSTALL.MD! From 3aa4167888b0a5587efb8c700a36ba370bc800f6 Mon Sep 17 00:00:00 2001 From: Owen Wang Date: Fri, 21 May 2021 20:37:41 -0400 Subject: [PATCH 09/96] Correct ordering --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 13a36d2f..10c51281 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ It is highly reccomended to purchase a NAVIGRAPH subscription and download their To install navdata, create a folder FMSDATA, and add it to your additional scenery folders, at the top of the list. Inside that folder, place all the XXXX.procedures.xml files, in the format FMSDATA/X/X/X/XXXX.procedures.xml. For instance, FMSDATA/Airports/E/G/K/EGKK.procedures.xml. ## Remote MCDU -If you want to run the MCDU on a phone or tablet for better realism and easier input, put mcdu.html into the FGDATA/Phi folder, run FlightGear with enabled HTTP server (i.e. command line --httpd=) and open http://:/mcdu.html in the browser on your phone or tablet. +If you want to run the MCDU on a phone or tablet for better realism and easier input, put mcdu.html into the FGDATA/Phi folder, run FlightGear with enabled HTTP server (i.e. command line --httpd=) and open http://:/mcdu.html in the browser on your phone or tablet. ## Installation If you have issues installing, please check INSTALL.MD! From 439a7c7b5052a5b1cf1ef2ce23a2dd01a3012b2f Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 22 May 2021 13:18:21 +0100 Subject: [PATCH 10/96] Terrain display: only show sea level water as cyan --- Models/Instruments/ND/canvas/map/TERRAIN.symbol | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Models/Instruments/ND/canvas/map/TERRAIN.symbol b/Models/Instruments/ND/canvas/map/TERRAIN.symbol index 9a652d4b..abc358e9 100644 --- a/Models/Instruments/ND/canvas/map/TERRAIN.symbol +++ b/Models/Instruments/ND/canvas/map/TERRAIN.symbol @@ -151,7 +151,9 @@ var updateTerrain = func { } } } else { - grad = 11; #water/cyan + if (elev <= 0) { + grad = 11; #water/cyan + } } append(elevft,grad); # 0-5 } else { From 249ea57d294cca60c3f52b8a7254eb42a2e393b9 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 22 May 2021 13:41:54 +0100 Subject: [PATCH 11/96] MCDU DEPARTURE page: fix such that transitions are scrollable. Fix a couple of other bugs. To change the SID you'll have to go back to the runway page and re-select the runway. --- Nasal/MCDU/DEPARTURE.nas | 84 ++++++++++++++++++++++++++++------------ 1 file changed, 59 insertions(+), 25 deletions(-) diff --git a/Nasal/MCDU/DEPARTURE.nas b/Nasal/MCDU/DEPARTURE.nas index 47fb4fa3..0426577a 100644 --- a/Nasal/MCDU/DEPARTURE.nas +++ b/Nasal/MCDU/DEPARTURE.nas @@ -33,8 +33,10 @@ var departurePage = { computer: nil, enableScrollRwy: 0, enableScrollSids: 0, + enableScrollTrans: 0, scrollRwy: 0, scrollSids: 0, + scrollTrans: 0, activePage: 0, # runways, sids, trans _runways: nil, _sids: nil, @@ -404,8 +406,8 @@ var departurePage = { append(me.transitions, "NO TRANS"); if (size(me.transitions) >= 1) { - me.R2 = [me.transitions[0] ~ " ", "TRANS", "blu"]; - if (me.transitions[0] != me.selectedTransition) { + me.R2 = [me.transitions[0 + me.scrollTrans] ~ " ", "TRANS", "blu"]; + if (me.transitions[0 + me.scrollTrans] != me.selectedTransition) { me.arrowsMatrix[1][1] = 1; me.arrowsColour[1][1] = "blu"; } else { @@ -414,8 +416,8 @@ var departurePage = { } } if (size(me.transitions) >= 2) { - me.R3 = [me.transitions[1] ~ " ", nil, "blu"]; - if (me.transitions[1] != me.selectedTransition) { + me.R3 = [me.transitions[1 + me.scrollTrans] ~ " ", nil, "blu"]; + if (me.transitions[1 + me.scrollTrans] != me.selectedTransition) { me.arrowsMatrix[1][2] = 1; me.arrowsColour[1][2] = "blu"; } else { @@ -424,8 +426,8 @@ var departurePage = { } } if (size(me.transitions) >= 3) { - me.R4 = [me.transitions[2] ~ " ", nil, "blu"]; - if (me.transitions[2] != me.selectedTransition) { + me.R4 = [me.transitions[2 + me.scrollTrans] ~ " ", nil, "blu"]; + if (me.transitions[2 + me.scrollTrans] != me.selectedTransition) { me.arrowsMatrix[1][3] = 1; me.arrowsColour[1][3] = "blu"; } else { @@ -434,8 +436,8 @@ var departurePage = { } } if (size(me.transitions) >= 4) { - me.R5 = [me.transitions[3] ~ " ", nil, "blu"]; - if (me.transitions[3] != me.selectedTransition) { + me.R5 = [me.transitions[3 + me.scrollTrans] ~ " ", nil, "blu"]; + if (me.transitions[3 + me.scrollTrans] != me.selectedTransition) { me.arrowsMatrix[1][4] = 1; me.arrowsColour[1][4] = "blu"; } else { @@ -443,6 +445,10 @@ var departurePage = { me.arrowsColour[1][4] = "ack"; } } + + if (size(me.transitions) > 4) { + me.enableScrollTrans = 1; + } canvas_mcdu.pageSwitch[me.computer].setBoolValue(0); }, makeTmpy: func() { @@ -467,15 +473,25 @@ var departurePage = { me.updateRunways(); } } else { - if (me.enableScrollSids) { - me.scrollSids += 1; - if (me.scrollSids > size(me.sids) - 4) { - me.scrollSids = 0; + if (me.selectedSID == nil) { + if (me.enableScrollSids) { + me.scrollSids += 1; + if (me.scrollSids > size(me.sids) - 4) { + me.scrollSids = 0; + } + me.updateSIDs(); + if (me.selectedSID == nil or me.selectedSID == "NO SID") { + me.clearTransitions(); + } else { + me.updateTransitions(); + } } - me.updateSIDs(); - if (me.selectedSID == nil or me.selectedSID == "NO SID") { - me.clearTransitions(); - } else { + } else { + if (me.enableScrollTrans) { + me.scrollTrans += 1; + if (me.scrollTrans > size(me.transitions) - 4) { + me.scrollTrans = 0; + } me.updateTransitions(); } } @@ -491,15 +507,25 @@ var departurePage = { me.updateRunways(); } } else { - if (me.enableScrollSids) { - me.scrollSids -= 1; - if (me.scrollSids < 0) { - me.scrollSids = size(me.sids) - 4; + if (me.selectedSID == nil) { + if (me.enableScrollSids) { + me.scrollSids -= 1; + if (me.scrollSids < 0) { + me.scrollSids = size(me.sids) - 4; + } + me.updateSIDs(); + if (me.selectedSID == nil or me.selectedSID == "NO SID") { + me.clearTransitions(); + } else { + me.updateTransitions(); + } } - me.updateSIDs(); - if (me.selectedSID == nil or me.selectedSID == "NO SID") { - me.clearTransitions(); - } else { + } else { + if (me.enableScrollTrans) { + me.scrollTrans -= 1; + if (me.scrollTrans < 0) { + me.scrollTrans = size(me.transitions) - 4; + } me.updateTransitions(); } } @@ -518,6 +544,11 @@ var departurePage = { if (size(me.runways) >= (index - 1)) { if (!dirToFlag) { me.selectedSID = nil; + fmgc.flightPlanController.flightplans[me.computer].sid = nil; + me.scrollSids = 0; + me.selectedTransition = nil; + fmgc.flightPlanController.flightplans[me.computer].sid_trans = nil; + me.scrollTrans = 0; isNoSid[me.computer] = 0; isNoTransDep[me.computer] = 0; me.selectedRunway = me.depAirport[0].runway(me.runways[index - 2 + me.scrollRwy]); @@ -547,8 +578,11 @@ var departurePage = { fmgc.flightPlanController.insertNOSID(me.computer); } me.updateSIDs(); + me.scrollTrans = 0; if (me.selectedSID != "NO SID") { isNoTransDep[me.computer] = 0; + me.selectedTransition = nil; + fmgc.flightPlanController.flightplans[me.computer].sid_trans = nil; } else { isNoTransDep[me.computer] = 1; me.selectedTransition = "NO TRANS"; @@ -566,7 +600,7 @@ var departurePage = { depPushbuttonRight: func(index) { if (size(me.transitions) >= (index - 1)) { if (!dirToFlag) { - me.selectedTransition = me.transitions[index - 2]; + me.selectedTransition = me.transitions[index - 2 + me.scrollTrans]; me.makeTmpy(); if (me.selectedTransition != "NO TRANS") { isNoTransDep[me.computer] = 0; From 41462601476f612d121112221858d3683fe8c19e Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 22 May 2021 13:50:29 +0100 Subject: [PATCH 12/96] Misc improvements to DEPARTURE page to correct edge usecases --- Nasal/MCDU/DEPARTURE.nas | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Nasal/MCDU/DEPARTURE.nas b/Nasal/MCDU/DEPARTURE.nas index 0426577a..a4a1b0b8 100644 --- a/Nasal/MCDU/DEPARTURE.nas +++ b/Nasal/MCDU/DEPARTURE.nas @@ -401,7 +401,6 @@ var departurePage = { } else { me._transitions = me.depAirport[0].getSid(me.selectedSID).transitions; } - me._transitions = me.depAirport[0].getSid(me.selectedSID).transitions; me.transitions = sort(me._transitions,func(a,b) cmp(a,b)); append(me.transitions, "NO TRANS"); @@ -532,10 +531,18 @@ var departurePage = { } }, scrollLeft: func() { + if (me.activePage == 0 and me.selectedRunway == nil) { + mcdu_message(me.computer, "NOT ALLOWED"); + return; + } me.activePage = !me.activePage; me.updatePage(); }, scrollRight: func() { + if (me.activePage == 0 and me.selectedRunway == nil) { + mcdu_message(me.computer, "NOT ALLOWED"); + return; + } me.activePage = !me.activePage; me.updatePage(); }, From bdd2c6c9fead72fd3782ed20ef7d467130668f1b Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Wed, 26 May 2021 16:06:49 +0100 Subject: [PATCH 13/96] Fix the ARRIVAL page; remove version checks for approach VIAs --- Nasal/MCDU/ARRIVAL.nas | 121 +++++++++++++++++++++++------------------ 1 file changed, 69 insertions(+), 52 deletions(-) diff --git a/Nasal/MCDU/ARRIVAL.nas b/Nasal/MCDU/ARRIVAL.nas index d5343a17..34851938 100644 --- a/Nasal/MCDU/ARRIVAL.nas +++ b/Nasal/MCDU/ARRIVAL.nas @@ -2,8 +2,6 @@ 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], @@ -42,9 +40,11 @@ var arrivalPage = { enableScrollApproach: 0, enableScrollStars: 0, enableScrollVias: 0, + enableScrollTrans: 0, scrollApproach: 0, scrollStars: 0, scrollVias: 0, + scrollTrans: 0, activePage: 0, # runways, stars, vias oldPage: 0, _approaches: nil, @@ -76,13 +76,10 @@ var arrivalPage = { if (fmgc.flightPlanController.flightplans[2].approach != nil) { me.selectedApproach = fmgc.flightPlanController.flightplans[2].approach; - 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) { - me.selectedVIA = "NO VIA"; - } + if (fmgc.flightPlanController.flightplans[2].approach_trans != nil) { + me.selectedVIA = fmgc.flightPlanController.flightplans[2].approach_trans; + } elsif (isNoVia[2] == 1) { + me.selectedVIA = "NO VIA"; } } @@ -101,21 +98,15 @@ var arrivalPage = { } else { if (fmgc.flightPlanController.flightplans[me.computer].approach != nil) { me.selectedApproach = fmgc.flightPlanController.flightplans[me.computer].approach; - 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) { - me.selectedVIA = "NO VIA"; - } + if (fmgc.flightPlanController.flightplans[me.computer].approach_trans != nil) { + me.selectedVIA = fmgc.flightPlanController.flightplans[me.computer].approach_trans; + } elsif (isNoVia[me.computer] == 1) { + me.selectedVIA = "NO VIA"; } } elsif (fmgc.flightPlanController.flightplans[2].approach != nil) { me.selectedApproach = fmgc.flightPlanController.flightplans[2].approach; - 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; - } + if (fmgc.flightPlanController.flightplans[2].approach_trans != nil) { + me.selectedVIA = fmgc.flightPlanController.flightplans[2].approach_trans; } } if (fmgc.flightPlanController.flightplans[me.computer].star != nil) { @@ -237,9 +228,6 @@ var arrivalPage = { }, updateActiveVIAs: func() { - 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]) { me.C1 = ["NONE", "VIA", "grn"]; @@ -509,8 +497,6 @@ var arrivalPage = { canvas_mcdu.pageSwitch[me.computer].setBoolValue(0); }, updateVIAs: func() { - 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; @@ -617,8 +603,8 @@ var arrivalPage = { append(me.transitions, "NO TRANS"); if (size(me.transitions) >= 1) { - me.R3 = [me.transitions[0] ~ " ", "TRANS", "blu"]; - if (me.transitions[0] != me.selectedTransition) { + me.R3 = [me.transitions[0 + me.scrollTrans] ~ " ", "TRANS", "blu"]; + if (me.transitions[0 + me.scrollTrans] != me.selectedTransition) { me.arrowsMatrix[1][2] = 1; me.arrowsColour[1][2] = "blu"; } else { @@ -627,8 +613,8 @@ var arrivalPage = { } } if (size(me.transitions) >= 2) { - me.R4 = [me.transitions[1] ~ " ", nil, "blu"]; - if (me.transitions[1] != me.selectedTransition) { + me.R4 = [me.transitions[1 + me.scrollTrans] ~ " ", nil, "blu"]; + if (me.transitions[1 + me.scrollTrans] != me.selectedTransition) { me.arrowsMatrix[1][3] = 1; me.arrowsColour[1][3] = "blu"; } else { @@ -637,8 +623,8 @@ var arrivalPage = { } } if (size(me.transitions) >= 3) { - me.R5 = [me.transitions[2] ~ " ", nil, "blu"]; - if (me.transitions[2] != me.selectedTransition) { + me.R5 = [me.transitions[2 + me.scrollTrans] ~ " ", nil, "blu"]; + if (me.transitions[2 + me.scrollTrans] != me.selectedTransition) { me.arrowsMatrix[1][4] = 1; me.arrowsColour[1][4] = "blu"; } else { @@ -647,7 +633,9 @@ var arrivalPage = { } } - # no indication it is scrollable... + if (size(me.transitions) > 3) { + me.enableScrollTrans = 1; + } canvas_mcdu.pageSwitch[me.computer].setBoolValue(0); }, makeTmpy: func() { @@ -683,15 +671,25 @@ var arrivalPage = { me.updateApproaches(); } } elsif (me.activePage == 1) { - if (me.enableScrollStars) { - me.scrollStars += 1; - if (me.scrollStars > size(me.stars) - 3) { - me.scrollStars = 0; + if (me.selectedSTAR == nil) { + if (me.enableScrollStars) { + me.scrollStars += 1; + if (me.scrollStars > size(me.stars) - 3) { + me.scrollStars = 0; + } + me.updateSTARs(); + if (me.selectedSTAR == nil or me.selectedSTAR == "NO STAR") { + me.clearTransitions(); + } else { + me.updateTransitions(); + } } - me.updateSTARs(); - if (me.selectedSTAR == nil or me.selectedSTAR == "NO STAR") { - me.clearTransitions(); - } else { + } else { + if (me.enableScrollTrans) { + me.scrollTrans += 1; + if (me.scrollTrans > size(me.transitions) - 4) { + me.scrollTrans = 0; + } me.updateTransitions(); } } @@ -716,15 +714,25 @@ var arrivalPage = { me.updateApproaches(); } } elsif (me.activePage == 1) { - if (me.enableScrollStars) { - me.scrollStars -= 1; - if (me.scrollStars < 0) { - me.scrollStars = size(me.stars) - 3; + if (me.selectedSTAR == nil) { + if (me.enableScrollStars) { + me.scrollStars -= 1; + if (me.scrollStars < 0) { + me.scrollStars = size(me.stars) - 3; + } + me.updateSTARs(); + if (me.selectedSTAR == nil or me.selectedSTAR == "NO STAR") { + me.clearTransitions(); + } else { + me.updateTransitions(); + } } - me.updateSTARs(); - if (me.selectedSTAR == nil or me.selectedSTAR == "NO STAR") { - me.clearTransitions(); - } else { + } else { + if (me.enableScrollTrans) { + me.scrollTrans -= 1; + if (me.scrollTrans < 0) { + me.scrollTrans = size(me.transitions) - 4; + } me.updateTransitions(); } } @@ -753,8 +761,6 @@ var arrivalPage = { }, arrPushbuttonLeft: func(index) { if (index == 2 and me.activePage == 1 and me.selectedApproach != nil) { - 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(); @@ -773,6 +779,14 @@ var arrivalPage = { if (size(me.approaches) >= (index - 2) and index != 2) { # index = 3, size = 1 if (!dirToFlag) { me.selectedVIA = nil; + fmgc.flightPlanController.flightplans[me.computer].approach_trans = nil; + me.scrollVias = 0; + me.selectedSTAR = nil; + fmgc.flightPlanController.flightplans[me.computer].star = nil; + me.scrollStars = 0; + me.selectedTransition = nil; + fmgc.flightPlanController.flightplans[me.computer].star_trans = nil; + me.scrollTrans = 0; isNoTransArr[me.computer] = 0; isNoStar[me.computer] = 0; me.makeTmpy(); @@ -815,8 +829,11 @@ var arrivalPage = { } } me.updateSTARs(); + me.scrollTrans = 0; if (me.selectedSTAR != "NO STAR") { isNoTransArr[me.computer] = 0; + me.selectedTransition = nil; + fmgc.flightPlanController.flightplans[me.computer].star_trans = nil; } else { isNoTransArr[me.computer] = 1; me.selectedTransition = "NO TRANS"; @@ -857,7 +874,7 @@ var arrivalPage = { arrPushbuttonRight: func(index) { if (size(me.transitions) >= (index - 2)) { if (!dirToFlag) { - me.selectedTransition = me.transitions[index - 3]; + me.selectedTransition = me.transitions[index - 3 + me.scrollTrans]; me.makeTmpy(); if (me.selectedTransition != "NO TRANS") { isNoTransArr[me.computer] = 0; From 9b3142cb640670a9607b6797d8b92791ede8ce39 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sun, 30 May 2021 21:45:12 +0200 Subject: [PATCH 14/96] FCU: Change HDG and ALT display formatting Show select HDG always with 3 digits (if select HDG < 100 with leading 0) Show selected ALT always with 5 digits. --- Models/FlightDeck/a320.flightdeck.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index 09bc8b6f..c0e5eed8 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -4535,8 +4535,8 @@ center-center xy-plane - text-value - %s + number-value + %03.0f it-autoflight/input/hdg false led.txf @@ -4587,8 +4587,8 @@ center-center xy-plane - text-value - %s + number-value + %05.0f it-autoflight/input/alt false led.txf From b4e59e15b85c282cbecda6285cad9798009359db Mon Sep 17 00:00:00 2001 From: Inuyaksa Date: Sat, 5 Jun 2021 14:59:50 +0200 Subject: [PATCH 15/96] some logic optiomizing --- Models/Instruments/MCDU/MCDU.nas | 81 ++++++---- Nasal/FMGC/FMGC.nas | 248 ++++++++++++++++++++----------- Nasal/FMGC/flightplan.nas | 5 + 3 files changed, 214 insertions(+), 120 deletions(-) diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index f9e09f1c..44194563 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -410,9 +410,14 @@ var canvas_MCDU_base = { } } return irsstatus; + }, + onPageUpdate: func(p) { + }, updateCommon: func(i) { page = pageProp[i].getValue(); + var phase = fmgc.FMGCInternal.phase; + if (page != "NOTIFICATION") { me["NOTIFY"].hide(); me["NOTIFY_FLTNBR"].hide(); @@ -2114,7 +2119,7 @@ var canvas_MCDU_base = { me.colorRightS("wht", "wht", "wht", "wht", "grn", "wht"); me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht"); - if (fmgc.FMGCInternal.phase == 0 or fmgc.FMGCInternal.phase == 7) { # only on preflight and done phases + if (phase == 0 or phase == 7) { # only on preflight and done phases me["Simple_L5S"].setText("CHG CODE"); me["Simple_L5S"].show(); me["Simple_L5"].setText("[ ]"); @@ -2164,7 +2169,7 @@ var canvas_MCDU_base = { me["arrow5R"].setColor(getprop("/MCDUC/colors/blu/r"),getprop("/MCDUC/colors/blu/g"),getprop("/MCDUC/colors/blu/b")); } - if (fmgc.FMGCInternal.phase == 0 or fmgc.FMGCInternal.phase == 7) { + if (phase == 0 or phase == 7) { me["Simple_L5"].show(); me["Simple_L5S"].show(); } else { @@ -2476,7 +2481,7 @@ var canvas_MCDU_base = { } } - if (fmgc.FMGCInternal.phase == 7) { # DONE phase + if (phase == 7) { # DONE phase if (fmgc.FMGCInternal.arrApt != nil and fmgc.flightPlanController.flightplans[2].departure_runway != nil) { me["Simple_R1S"].setText(sprintf("DRIFT AT %7s ",fmgc.FMGCInternal.arrApt ~ fmgc.flightPlanController.flightplans[2].departure_runway.id)); } @@ -2828,7 +2833,7 @@ var canvas_MCDU_base = { } me["Simple_R6S"].setText("GND TEMP"); - if (fmgc.FMGCInternal.phase == 0 and !fmgc.FMGCInternal.gndTempSet) { + if (phase == 0 and !fmgc.FMGCInternal.gndTempSet) { fmgc.FMGCInternal.gndTemp = 15 - (2 * getprop("/position/gear-agl-ft") / 1000); me["Simple_R6"].setText(sprintf("%.0fg", fmgc.FMGCInternal.gndTemp)); me["Simple_R6"].setFontSize(small); @@ -3834,25 +3839,25 @@ var canvas_MCDU_base = { } else if (page == "PROGPREF" or page == "PROGTO" or page == "PROGCLB" or page == "PROGCRZ" or page == "PROGDES" or page == "PROGAPPR" or page == "PROGDONE") { - if (fmgc.FMGCInternal.phase == 0) { + if (phase == 0) { setprop("/MCDU[" ~ i ~ "]/page", "PROGPREF"); page = "PROGPREF"; - } else if (fmgc.FMGCInternal.phase == 1) { + } else if (phase == 1) { setprop("/MCDU[" ~ i ~ "]/page", "PROGTO"); page = "PROGTO"; - } else if (fmgc.FMGCInternal.phase == 2) { + } else if (phase == 2) { setprop("/MCDU[" ~ i ~ "]/page", "PROGCLB"); page = "PROGCLB"; - } else if (fmgc.FMGCInternal.phase == 3) { + } else if (phase == 3) { setprop("/MCDU[" ~ i ~ "]/page", "PROGCRZ"); page = "PROGCRZ"; - } else if (fmgc.FMGCInternal.phase == 4) { + } else if (phase == 4) { setprop("/MCDU[" ~ i ~ "]/page", "PROGDES"); page = "PROGDES"; - } else if (fmgc.FMGCInternal.phase == 5 or fmgc.FMGCInternal.phase == 6) { + } else if (phase == 5 or phase == 6) { setprop("/MCDU[" ~ i ~ "]/page", "PROGAPPR"); page = "PROGAPPR"; - } else if (fmgc.FMGCInternal.phase == 7) { + } else if (phase == 7) { setprop("/MCDU[" ~ i ~ "]/page", "PROGDONE"); page = "PROGDONE"; } @@ -4131,7 +4136,7 @@ var canvas_MCDU_base = { me["Simple_L4"].setFontSize(small); } - if (fmgc.FMGCInternal.phase == 0 or fmgc.FMGCInternal.phase == 7) { + if (phase == 0 or phase == 7) { me["Simple_L6_Arrow"].show(); me["Simple_L6"].show(); me["Simple_L6S"].show(); @@ -4141,7 +4146,7 @@ var canvas_MCDU_base = { me["Simple_L6S"].hide(); } - if (fmgc.FMGCInternal.phase == 1) { # GREEN title and not modifiable on TO phase + if (phase == 1) { # GREEN title and not modifiable on TO phase me["Simple_Title"].setColor(GREEN); me.colorLeft("grn", "grn", "grn", "blu", "grn", "wht"); me.colorRight("grn", "blu", "grn", "grn", "grn", "wht"); @@ -4221,7 +4226,7 @@ var canvas_MCDU_base = { me["Simple_R5"].setFontSize(small); } - if ((fmgc.FMGCInternal.zfwSet and fmgc.FMGCInternal.blockSet) or fmgc.FMGCInternal.phase == 1) { + if ((fmgc.FMGCInternal.zfwSet and fmgc.FMGCInternal.blockSet) or phase == 1) { me["Simple_C1"].setText(sprintf("%3.0f", fmgc.FMGCInternal.flap2_to)); me["Simple_C2"].setText(sprintf("%3.0f", fmgc.FMGCInternal.slat_to)); me["Simple_C3"].setText(sprintf("%3.0f", fmgc.FMGCInternal.clean_to)); @@ -4280,7 +4285,7 @@ var canvas_MCDU_base = { pageSwitch[i].setBoolValue(1); } - if (fmgc.FMGCInternal.phase == 2) { + if (phase == 2) { me["Simple_Title"].setColor(GREEN); me.showLeft(0, 0, 0, 0, 1, 0); me.showLeftS(0, 0, 0, 0, 1, 0); @@ -4310,7 +4315,7 @@ var canvas_MCDU_base = { me.colorLeft("ack", "ack", "ack", "ack", "ack", "amb"); me.colorLeftS("ack", "ack", "ack", "ack", "ack", "amb"); me.colorLeftArrow("ack", "ack", "ack", "ack", "ack", "amb"); - } else if (fmgc.FMGCInternal.phase == 5) { + } else if (phase == 5) { me["Simple_L6S"].setText(""); me["Simple_L6"].setText(""); me.colorLeft("ack", "ack", "ack", "ack", "ack", "blu"); @@ -4434,7 +4439,7 @@ var canvas_MCDU_base = { pageSwitch[i].setBoolValue(1); } - if (fmgc.FMGCInternal.phase == 3) { + if (phase == 3) { me["Simple_Title"].setColor(GREEN); if (managedSpeed.getValue() == 1) { @@ -4458,7 +4463,7 @@ var canvas_MCDU_base = { me.colorLeft("ack", "ack", "ack", "ack", "ack", "amb"); me.colorLeftS("ack", "ack", "ack", "ack", "ack", "amb"); me.colorLeftArrow("ack", "ack", "ack", "ack", "ack", "amb"); - } else if (fmgc.FMGCInternal.phase == 5) { + } else if (phase == 5) { me["Simple_L6S"].setText(""); me["Simple_L6"].setText(""); me.colorLeft("ack", "ack", "ack", "ack", "ack", "blu"); @@ -4572,7 +4577,7 @@ var canvas_MCDU_base = { pageSwitch[i].setBoolValue(1); } - if (fmgc.FMGCInternal.phase == 4) { + if (phase == 4) { me["Simple_Title"].setColor(GREEN); me.showLeft(0, 0, 0, 0, 1, 0); me.showRight(0, 1, 0, 1, 0, 0); @@ -4601,7 +4606,7 @@ var canvas_MCDU_base = { me.colorLeft("ack", "ack", "ack", "ack", "ack", "amb"); me.colorLeftS("ack", "ack", "ack", "ack", "ack", "amb"); me.colorLeftArrow("ack", "ack", "ack", "ack", "ack", "amb"); - } else if (fmgc.FMGCInternal.phase == 5) { + } else if (phase == 5) { me["Simple_L6S"].setText(""); me["Simple_L6"].setText(""); me.colorLeft("ack", "ack", "ack", "ack", "ack", "blu"); @@ -4729,7 +4734,7 @@ var canvas_MCDU_base = { pageSwitch[i].setBoolValue(1); } - if (fmgc.FMGCInternal.phase == 5) { + if (phase == 5) { me["Simple_Title"].setColor(GREEN); } else { me["Simple_Title"].setColor(WHITE); @@ -4837,7 +4842,7 @@ var canvas_MCDU_base = { me["Simple_R6"].setText("PHASE "); me["Simple_L5S"].setText(" VAPP"); - if ((fmgc.FMGCInternal.zfwSet and fmgc.FMGCInternal.blockSet) or fmgc.FMGCInternal.phase == 5) { + if ((fmgc.FMGCInternal.zfwSet and fmgc.FMGCInternal.blockSet) or phase == 5) { me["Simple_C1"].setText(sprintf("%3.0f", fmgc.FMGCInternal.flap2_appr)); me["Simple_C2"].setText(sprintf("%3.0f", fmgc.FMGCInternal.slat_appr)); me["Simple_C3"].setText(sprintf("%3.0f", fmgc.FMGCInternal.clean_appr)); @@ -4913,7 +4918,7 @@ var canvas_MCDU_base = { pageSwitch[i].setBoolValue(1); } - if (fmgc.FMGCInternal.phase == 6) { + if (phase == 6) { me["Simple_Title"].setColor(GREEN); } else { me["Simple_Title"].setColor(WHITE); @@ -4937,7 +4942,7 @@ var canvas_MCDU_base = { me["Simple_R5"].setText(sprintf("%3.0f", engOutAcc.getValue())); me["Simple_R5S"].setText("ENG OUT ACC"); - if ((fmgc.FMGCInternal.zfwSet and fmgc.FMGCInternal.blockSet) or fmgc.FMGCInternal.phase == 6) { + if ((fmgc.FMGCInternal.zfwSet and fmgc.FMGCInternal.blockSet) or phase == 6) { me["Simple_C1"].setText(sprintf("%3.0f", fmgc.FMGCInternal.flap2_appr)); me["Simple_C2"].setText(sprintf("%3.0f", fmgc.FMGCInternal.slat_appr)); me["Simple_C3"].setText(sprintf("%3.0f", fmgc.FMGCInternal.clean_appr)); @@ -6592,13 +6597,32 @@ setlistener("/sim/signals/fdm-initialized", func { mcdu.mcdu_message(0, "SELECT DESIRED SYSTEM"); mcdu.mcdu_message(1, "SELECT DESIRED SYSTEM"); - + + #setlistener("/MCDU[0]/page", func(v) { + # pageSwitch[0].setBoolValue(0); + # MCDU_1.onPageChanged(0); + #}, 1, 0); + + #setlistener("/MCDU[1]/page", func(v) { + # pageSwitch[1].setBoolValue(0); + # MCDU_2.onPageChanged(1); + #}, 1, 0); + MCDU_update.start(); + }); var MCDU_update = maketimer(0.125, func { canvas_MCDU_base.update(); }); + +var MCDU1_update = maketimer(0.125, func { + MCDU1.update(); +}); + +var MCDU2_update = maketimer(0.125, func { + MCDU2.update(); +}); var showMCDU1 = func { gui.showDialog("mcdu1"); @@ -6608,10 +6632,3 @@ var showMCDU2 = func { gui.showDialog("mcdu2"); } -setlistener("/MCDU[0]/page", func { - pageSwitch[0].setBoolValue(0); -}, 0, 0); - -setlistener("/MCDU[1]/page", func { - pageSwitch[1].setBoolValue(0); -}, 0, 0); diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index a106e8b1..96f189e5 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -84,6 +84,7 @@ var FMGCinit = func { FMGCInternal.minspeed = 0; FMGCInternal.maxspeed = 338; FMGCInternal.phase = 0; # 0 is Preflight 1 is Takeoff 2 is Climb 3 is Cruise 4 is Descent 5 is Decel/Approach 6 is Go Around 7 is Done + FMGCNodes.phase.setValue(0); FMGCInternal.mngSpd = 157; FMGCInternal.mngSpdCmd = 157; FMGCInternal.mngKtsMach = 0; @@ -257,6 +258,7 @@ var FMGCNodes = { toState: props.globals.initNode("/FMGC/internal/to-state", 0, "BOOL"), v1: props.globals.initNode("/FMGC/internal/v1", 0, "DOUBLE"), v1set: props.globals.initNode("/FMGC/internal/v1-set", 0, "BOOL"), + phase: props.globals.initNode("/FMGC/internal/phase", 0, "INT"), }; ############ @@ -601,92 +603,15 @@ var radios = maketimer(1, func() { adf1(); }); -var masterFMGC = maketimer(0.2, func { - n1_left = pts.Engines.Engine.n1Actual[0].getValue(); - n1_right = pts.Engines.Engine.n1Actual[1].getValue(); - modelat = Modes.PFD.FMA.rollMode.getValue(); - mode = Modes.PFD.FMA.pitchMode.getValue(); - gs = pts.Velocities.groundspeed.getValue(); - alt = pts.Instrumentation.Altimeter.indicatedFt.getValue(); - # cruiseft = FMGCInternal.crzFt; - # cruiseft_b = FMGCInternal.crzFt - 200; - state1 = pts.Systems.Thrust.state[0].getValue(); - state2 = pts.Systems.Thrust.state[1].getValue(); - accel_agl_ft = Setting.reducAglFt.getValue(); - gear0 = pts.Gear.wow[0].getBoolValue(); - altSel = Input.alt.getValue(); - - if ((n1_left < 85 or n1_right < 85) and gs < 90 and mode == " " and gear0 and FMGCInternal.phase == 1) { # rejected takeoff - FMGCInternal.phase = 0; - systems.PNEU.pressMode.setValue("GN"); - } - - if (gear0 and FMGCInternal.phase == 0 and ((n1_left >= 85 and n1_right >= 85 and mode == "SRS") or gs >= 90)) { - FMGCInternal.phase = 1; - systems.PNEU.pressMode.setValue("TO"); - } - - if (FMGCInternal.phase == 1 and ((mode != "SRS" and mode != " ") or alt >= accel_agl_ft)) { - FMGCInternal.phase = 2; - systems.PNEU.pressMode.setValue("TO"); - } - - if (FMGCInternal.phase == 2 and (mode == "ALT CRZ" or mode == "ALT CRZ*")) { - FMGCInternal.phase = 3; - systems.PNEU.pressMode.setValue("CR"); - } - - if (FMGCInternal.crzFl >= 200) { - if (FMGCInternal.phase == 3 and (flightPlanController.arrivalDist <= 200 or altSel < 20000)) { - FMGCInternal.phase = 4; - systems.PNEU.pressMode.setValue("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; - systems.PNEU.pressMode.setValue("DE"); - } - } - - if (FMGCInternal.phase == 4) { - if (getprop("/FMGC/internal/decel")) { - FMGCInternal.phase = 5; - } - else if (altSel == (FMGCInternal.crzFl * 100)) { # back to CRZ state - FMGCInternal.phase = 3; - systems.PNEU.pressMode.setValue("CR"); - } - } - - if (flightPlanController.num[2].getValue() > 0 and getprop("/FMGC/flightplan[2]/active") == 1 and flightPlanController.arrivalDist <= 15 and (modelat == "NAV" or modelat == "LOC" or modelat == "LOC*") and pts.Position.gearAglFt.getValue() < 9500) { #todo decel pseudo waypoint - setprop("/FMGC/internal/decel", 1); - } else if (getprop("/FMGC/internal/decel") == 1 and (FMGCInternal.phase == 0 or FMGCInternal.phase == 6)) { - setprop("/FMGC/internal/decel", 0); - } - - if ((FMGCInternal.phase == 5) and state1 == "TOGA" and state2 == "TOGA") { - FMGCInternal.phase = 6; - systems.PNEU.pressMode.setValue("TO"); - Input.toga.setValue(1); - } - - if (FMGCInternal.phase == 6 and alt >= accel_agl_ft) { # todo when insert altn or new dest - FMGCInternal.phase = 2; - } - - if (getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") != 1024) { - FMGCInternal.maxspeed = getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") - 4; - } elsif (pts.Gear.position[0].getValue() != 0 or pts.Gear.position[1].getValue() != 0 or pts.Gear.position[2].getValue() != 0) { - FMGCInternal.maxspeed = 284; - } else { - FMGCInternal.maxspeed = fmgc.FMGCInternal.vmo_mmo; - } - +var fuelUpdateFMGC = maketime(0.5, func { ############################ # fuel ############################ updateFuel(); - +}); + +var windUpdateFMGC = maketime(1, func { + ############################ # wind ############################ @@ -730,6 +655,141 @@ var masterFMGC = maketimer(0.2, func { fmgc.windController.write(); } } + +}); + +var prop_n1_left = pts.Engines.Engine.n1Actual[0]; +var prop_n1_right = pts.Engines.Engine.n1Actual[1]; +var prop_nmodelat = Modes.PFD.FMA.rollMode; +var prop_mode = Modes.PFD.FMA.pitchMode; +var prop_gs = pts.Velocities.groundspeed; +var prop_alt = pts.Instrumentation.Altimeter.indicatedFt; +var prop_state1 = pts.Systems.Thrust.state[0]; +var prop_state2 = pts.Systems.Thrust.state[1]; +var prop_accel_agl_ft = Setting.reducAglFt; +var prop_gear0 = pts.Gear.wow[0]; +var prop_altSel = Input.alt; + +var masterFMGC = maketimer(0.2, func { + n1_left = prop_n1_left.getValue(); + n1_right = prop_n1_right.getValue(); + modelat = prop_nmodelat.getValue(); + mode = prop_mode.getValue(); + gs = prop_gs.getValue(); + alt = prop_alt.getValue(); + # cruiseft = FMGCInternal.crzFt; + # cruiseft_b = FMGCInternal.crzFt - 200; + state1 = prop_state1.getValue(); + state2 = prop_state2.getValue(); + accel_agl_ft = prop_accel_agl_ft.getValue(); + gear0 = prop_gear0.getBoolValue(); + altSel = prop_altSel.getValue(); + + var phase = FMGCInternal.phase; + var newphase = phase; + + if (phase == 0) { + + if (gear0 and ((n1_left >= 85 and n1_right >= 85 and mode == "SRS") or gs >= 90)) { + newphase = 1; + systems.PNEU.pressMode.setValue("TO"); + } + + } + + else if (phase == 1) { + + if (gear0) { + + if ((n1_left < 85 or n1_right < 85) and gs < 90 and mode == " ") { # rejected takeoff + newphase = 0; + systems.PNEU.pressMode.setValue("GN"); + } + + } + else if (((mode != "SRS" and mode != " ") or alt >= accel_agl_ft)) { + newphase = 2; + systems.PNEU.pressMode.setValue("TO"); + } + + } + + else if (phase == 2) { + + if ((mode == "ALT CRZ" or mode == "ALT CRZ*")) { + newphase = 3; + systems.PNEU.pressMode.setValue("CR"); + } + + } + + else if (phase == 3) { + + if (FMGCInternal.crzFl >= 200) { + if ((flightPlanController.arrivalDist <= 200 or altSel < 20000)) { + newphase = 4; + systems.PNEU.pressMode.setValue("DE"); + } + } else { + if ((flightPlanController.arrivalDist <= 200 or altSel < (FMGCInternal.crzFl * 100))) { # todo - not sure about crzFl condition, investigate what happens! + newphase = 4; + systems.PNEU.pressMode.setValue("DE"); + } + } + + } + + else if (phase == 4) { + + if (getprop("/FMGC/internal/decel")) { + newphase = 5; + } + else if (altSel == (FMGCInternal.crzFl * 100)) { # back to CRZ state + newphase = 3; + systems.PNEU.pressMode.setValue("CR"); + } + + } + + else if (phase == 5) { + + if (state1 == "TOGA" and state2 == "TOGA") { + newphase = 6; + systems.PNEU.pressMode.setValue("TO"); + Input.toga.setValue(1); + } + + } + + else if (phase == 6) { + + if (alt >= accel_agl_ft) { # todo when insert altn or new dest + newphase = 2; + } + + } + + + if (flightPlanController.num[2].getValue() > 0 and getprop("/FMGC/flightplan[2]/active") == 1 and + flightPlanController.arrivalDist <= 15 and (modelat == "NAV" or modelat == "LOC" or modelat == "LOC*") and pts.Position.gearAglFt.getValue() < 9500) { #todo decel pseudo waypoint + setprop("/FMGC/internal/decel", 1); + } else if (getprop("/FMGC/internal/decel") == 1 and (phase == 0 or phase == 6)) { + setprop("/FMGC/internal/decel", 0); + } + + + if (getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") != 1024) { + FMGCInternal.maxspeed = getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") - 4; + } elsif (pts.Gear.position[0].getValue() != 0 or pts.Gear.position[1].getValue() != 0 or pts.Gear.position[2].getValue() != 0) { + FMGCInternal.maxspeed = 284; + } else { + FMGCInternal.maxspeed = fmgc.FMGCInternal.vmo_mmo; + } + + if (newphase != phase) { # phase changed + FMGCInternal.phase = newphase; + FMGCNodes.phase.setValue(newphase); + } ############################ # calculate speeds @@ -771,7 +831,7 @@ var masterFMGC = maketimer(0.2, func { } # predicted takeoff speeds - if (FMGCInternal.phase == 1) { + if (phase == 1) { FMGCInternal.clean_to = FMGCInternal.clean; FMGCInternal.vs1g_clean_to = FMGCInternal.vs1g_clean; FMGCInternal.vs1g_conf_2_to = FMGCInternal.vs1g_conf_2; @@ -793,7 +853,7 @@ var masterFMGC = maketimer(0.2, func { } # predicted approach (temp go-around) speeds - if (FMGCInternal.phase == 5 or FMGCInternal.phase == 6) { + if (phase == 5 or phase == 6) { FMGCInternal.clean_appr = FMGCInternal.clean; FMGCInternal.vs1g_clean_appr = FMGCInternal.vs1g_clean; FMGCInternal.vs1g_conf_2_appr = FMGCInternal.vs1g_conf_2; @@ -914,7 +974,8 @@ var masterFMGC = maketimer(0.2, func { } } - if (gear0 and pts.Controls.Flight.flapsPos.getValue() < 5 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA")) { + #if (gear0 and pts.Controls.Flight.flapsPos.getValue() < 5 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA")) { + if (gear0 and flaps < 5 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA")) { if (!FMGCInternal.takeoffState) { fmgc.FMGCNodes.toState.setValue(1); } @@ -930,9 +991,15 @@ var masterFMGC = maketimer(0.2, func { #handle radios, runways, v1/vr/v2 ############################ +}); + +var updateAirportRadios = func { + + var phase = FMGCInternal.phase; + departure_rwy = fmgc.flightPlanController.flightplans[2].departure_runway; destination_rwy = fmgc.flightPlanController.flightplans[2].destination_runway; - if (destination_rwy != nil and FMGCInternal.phase >= 2) { + if (destination_rwy != nil and phase >= 2) { var airport = airportinfo(FMGCInternal.arrApt); setprop("/FMGC/internal/ldg-elev", airport.elevation * M2FT); # eventually should be runway elevation magnetic_hdg = geo.normdeg(destination_rwy.heading - getprop("/environment/magnetic-variation-deg")); @@ -947,7 +1014,7 @@ var masterFMGC = maketimer(0.2, func { } else if (!getprop("/FMGC/internal/ils1crs-set")) { setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); } - } else if (departure_rwy != nil and FMGCInternal.phase <= 1) { + } else if (departure_rwy != nil and phase <= 1) { magnetic_hdg = geo.normdeg(departure_rwy.heading - getprop("/environment/magnetic-variation-deg")); runway_ils = departure_rwy.ils_frequency_mhz; if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set") and !getprop("/FMGC/internal/ils1crs-set")) { @@ -961,10 +1028,15 @@ var masterFMGC = maketimer(0.2, func { setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); } } -}); + +}; + +setlistener(FMGCNodes.phase, updateAirportRadios); +setlistener(flightPlanController.changed, updateAirportRadios); var reset_FMGC = func { FMGCInternal.phase = 0; + FMGCNodes.phase.serValue(0); fd1 = Input.fd1.getValue(); fd2 = Input.fd2.getValue(); spd = Input.kts.getValue(); diff --git a/Nasal/FMGC/flightplan.nas b/Nasal/FMGC/flightplan.nas index cb71f578..b072de4e 100644 --- a/Nasal/FMGC/flightplan.nas +++ b/Nasal/FMGC/flightplan.nas @@ -32,6 +32,8 @@ var flightPlanController = { # These flags are only for the main flgiht-plan active: props.globals.initNode("/FMGC/flightplan[2]/active", 0, "BOOL"), + + changed: props.globals.initNode("/FMGC/flightplan[2]/changed", 0, "BOOL"), currentToWpt: nil, # container for the current TO waypoint ghost currentToWptIndex: props.globals.initNode("/FMGC/flightplan[2]/current-wp", 0, "INT"), @@ -765,6 +767,9 @@ var flightPlanController = { fmgc.FMGCInternal.fuelCalculating = 1; fmgc.fuelCalculating.setValue(1); } + + if (n == 2) flightPlanController.changed.setBoolValue(1); + canvas_nd.A3XXRouteDriver.triggerSignal("fp-added"); }, From 69a4678e16377f811516a704abb24ab87a57ca37 Mon Sep 17 00:00:00 2001 From: Inuyaksa Date: Sun, 6 Jun 2021 22:25:52 +0200 Subject: [PATCH 16/96] Revert "some logic optiomizing" This reverts commit b4e59e15b85c282cbecda6285cad9798009359db. --- Models/Instruments/MCDU/MCDU.nas | 81 ++++------ Nasal/FMGC/FMGC.nas | 248 +++++++++++-------------------- Nasal/FMGC/flightplan.nas | 5 - 3 files changed, 120 insertions(+), 214 deletions(-) diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index 44194563..f9e09f1c 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -410,14 +410,9 @@ var canvas_MCDU_base = { } } return irsstatus; - }, - onPageUpdate: func(p) { - }, updateCommon: func(i) { page = pageProp[i].getValue(); - var phase = fmgc.FMGCInternal.phase; - if (page != "NOTIFICATION") { me["NOTIFY"].hide(); me["NOTIFY_FLTNBR"].hide(); @@ -2119,7 +2114,7 @@ var canvas_MCDU_base = { me.colorRightS("wht", "wht", "wht", "wht", "grn", "wht"); me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht"); - if (phase == 0 or phase == 7) { # only on preflight and done phases + if (fmgc.FMGCInternal.phase == 0 or fmgc.FMGCInternal.phase == 7) { # only on preflight and done phases me["Simple_L5S"].setText("CHG CODE"); me["Simple_L5S"].show(); me["Simple_L5"].setText("[ ]"); @@ -2169,7 +2164,7 @@ var canvas_MCDU_base = { me["arrow5R"].setColor(getprop("/MCDUC/colors/blu/r"),getprop("/MCDUC/colors/blu/g"),getprop("/MCDUC/colors/blu/b")); } - if (phase == 0 or phase == 7) { + if (fmgc.FMGCInternal.phase == 0 or fmgc.FMGCInternal.phase == 7) { me["Simple_L5"].show(); me["Simple_L5S"].show(); } else { @@ -2481,7 +2476,7 @@ var canvas_MCDU_base = { } } - if (phase == 7) { # DONE phase + if (fmgc.FMGCInternal.phase == 7) { # DONE phase if (fmgc.FMGCInternal.arrApt != nil and fmgc.flightPlanController.flightplans[2].departure_runway != nil) { me["Simple_R1S"].setText(sprintf("DRIFT AT %7s ",fmgc.FMGCInternal.arrApt ~ fmgc.flightPlanController.flightplans[2].departure_runway.id)); } @@ -2833,7 +2828,7 @@ var canvas_MCDU_base = { } me["Simple_R6S"].setText("GND TEMP"); - if (phase == 0 and !fmgc.FMGCInternal.gndTempSet) { + if (fmgc.FMGCInternal.phase == 0 and !fmgc.FMGCInternal.gndTempSet) { fmgc.FMGCInternal.gndTemp = 15 - (2 * getprop("/position/gear-agl-ft") / 1000); me["Simple_R6"].setText(sprintf("%.0fg", fmgc.FMGCInternal.gndTemp)); me["Simple_R6"].setFontSize(small); @@ -3839,25 +3834,25 @@ var canvas_MCDU_base = { } else if (page == "PROGPREF" or page == "PROGTO" or page == "PROGCLB" or page == "PROGCRZ" or page == "PROGDES" or page == "PROGAPPR" or page == "PROGDONE") { - if (phase == 0) { + if (fmgc.FMGCInternal.phase == 0) { setprop("/MCDU[" ~ i ~ "]/page", "PROGPREF"); page = "PROGPREF"; - } else if (phase == 1) { + } else if (fmgc.FMGCInternal.phase == 1) { setprop("/MCDU[" ~ i ~ "]/page", "PROGTO"); page = "PROGTO"; - } else if (phase == 2) { + } else if (fmgc.FMGCInternal.phase == 2) { setprop("/MCDU[" ~ i ~ "]/page", "PROGCLB"); page = "PROGCLB"; - } else if (phase == 3) { + } else if (fmgc.FMGCInternal.phase == 3) { setprop("/MCDU[" ~ i ~ "]/page", "PROGCRZ"); page = "PROGCRZ"; - } else if (phase == 4) { + } else if (fmgc.FMGCInternal.phase == 4) { setprop("/MCDU[" ~ i ~ "]/page", "PROGDES"); page = "PROGDES"; - } else if (phase == 5 or phase == 6) { + } else if (fmgc.FMGCInternal.phase == 5 or fmgc.FMGCInternal.phase == 6) { setprop("/MCDU[" ~ i ~ "]/page", "PROGAPPR"); page = "PROGAPPR"; - } else if (phase == 7) { + } else if (fmgc.FMGCInternal.phase == 7) { setprop("/MCDU[" ~ i ~ "]/page", "PROGDONE"); page = "PROGDONE"; } @@ -4136,7 +4131,7 @@ var canvas_MCDU_base = { me["Simple_L4"].setFontSize(small); } - if (phase == 0 or phase == 7) { + if (fmgc.FMGCInternal.phase == 0 or fmgc.FMGCInternal.phase == 7) { me["Simple_L6_Arrow"].show(); me["Simple_L6"].show(); me["Simple_L6S"].show(); @@ -4146,7 +4141,7 @@ var canvas_MCDU_base = { me["Simple_L6S"].hide(); } - if (phase == 1) { # GREEN title and not modifiable on TO phase + if (fmgc.FMGCInternal.phase == 1) { # GREEN title and not modifiable on TO phase me["Simple_Title"].setColor(GREEN); me.colorLeft("grn", "grn", "grn", "blu", "grn", "wht"); me.colorRight("grn", "blu", "grn", "grn", "grn", "wht"); @@ -4226,7 +4221,7 @@ var canvas_MCDU_base = { me["Simple_R5"].setFontSize(small); } - if ((fmgc.FMGCInternal.zfwSet and fmgc.FMGCInternal.blockSet) or phase == 1) { + if ((fmgc.FMGCInternal.zfwSet and fmgc.FMGCInternal.blockSet) or fmgc.FMGCInternal.phase == 1) { me["Simple_C1"].setText(sprintf("%3.0f", fmgc.FMGCInternal.flap2_to)); me["Simple_C2"].setText(sprintf("%3.0f", fmgc.FMGCInternal.slat_to)); me["Simple_C3"].setText(sprintf("%3.0f", fmgc.FMGCInternal.clean_to)); @@ -4285,7 +4280,7 @@ var canvas_MCDU_base = { pageSwitch[i].setBoolValue(1); } - if (phase == 2) { + if (fmgc.FMGCInternal.phase == 2) { me["Simple_Title"].setColor(GREEN); me.showLeft(0, 0, 0, 0, 1, 0); me.showLeftS(0, 0, 0, 0, 1, 0); @@ -4315,7 +4310,7 @@ var canvas_MCDU_base = { me.colorLeft("ack", "ack", "ack", "ack", "ack", "amb"); me.colorLeftS("ack", "ack", "ack", "ack", "ack", "amb"); me.colorLeftArrow("ack", "ack", "ack", "ack", "ack", "amb"); - } else if (phase == 5) { + } else if (fmgc.FMGCInternal.phase == 5) { me["Simple_L6S"].setText(""); me["Simple_L6"].setText(""); me.colorLeft("ack", "ack", "ack", "ack", "ack", "blu"); @@ -4439,7 +4434,7 @@ var canvas_MCDU_base = { pageSwitch[i].setBoolValue(1); } - if (phase == 3) { + if (fmgc.FMGCInternal.phase == 3) { me["Simple_Title"].setColor(GREEN); if (managedSpeed.getValue() == 1) { @@ -4463,7 +4458,7 @@ var canvas_MCDU_base = { me.colorLeft("ack", "ack", "ack", "ack", "ack", "amb"); me.colorLeftS("ack", "ack", "ack", "ack", "ack", "amb"); me.colorLeftArrow("ack", "ack", "ack", "ack", "ack", "amb"); - } else if (phase == 5) { + } else if (fmgc.FMGCInternal.phase == 5) { me["Simple_L6S"].setText(""); me["Simple_L6"].setText(""); me.colorLeft("ack", "ack", "ack", "ack", "ack", "blu"); @@ -4577,7 +4572,7 @@ var canvas_MCDU_base = { pageSwitch[i].setBoolValue(1); } - if (phase == 4) { + if (fmgc.FMGCInternal.phase == 4) { me["Simple_Title"].setColor(GREEN); me.showLeft(0, 0, 0, 0, 1, 0); me.showRight(0, 1, 0, 1, 0, 0); @@ -4606,7 +4601,7 @@ var canvas_MCDU_base = { me.colorLeft("ack", "ack", "ack", "ack", "ack", "amb"); me.colorLeftS("ack", "ack", "ack", "ack", "ack", "amb"); me.colorLeftArrow("ack", "ack", "ack", "ack", "ack", "amb"); - } else if (phase == 5) { + } else if (fmgc.FMGCInternal.phase == 5) { me["Simple_L6S"].setText(""); me["Simple_L6"].setText(""); me.colorLeft("ack", "ack", "ack", "ack", "ack", "blu"); @@ -4734,7 +4729,7 @@ var canvas_MCDU_base = { pageSwitch[i].setBoolValue(1); } - if (phase == 5) { + if (fmgc.FMGCInternal.phase == 5) { me["Simple_Title"].setColor(GREEN); } else { me["Simple_Title"].setColor(WHITE); @@ -4842,7 +4837,7 @@ var canvas_MCDU_base = { me["Simple_R6"].setText("PHASE "); me["Simple_L5S"].setText(" VAPP"); - if ((fmgc.FMGCInternal.zfwSet and fmgc.FMGCInternal.blockSet) or phase == 5) { + if ((fmgc.FMGCInternal.zfwSet and fmgc.FMGCInternal.blockSet) or fmgc.FMGCInternal.phase == 5) { me["Simple_C1"].setText(sprintf("%3.0f", fmgc.FMGCInternal.flap2_appr)); me["Simple_C2"].setText(sprintf("%3.0f", fmgc.FMGCInternal.slat_appr)); me["Simple_C3"].setText(sprintf("%3.0f", fmgc.FMGCInternal.clean_appr)); @@ -4918,7 +4913,7 @@ var canvas_MCDU_base = { pageSwitch[i].setBoolValue(1); } - if (phase == 6) { + if (fmgc.FMGCInternal.phase == 6) { me["Simple_Title"].setColor(GREEN); } else { me["Simple_Title"].setColor(WHITE); @@ -4942,7 +4937,7 @@ var canvas_MCDU_base = { me["Simple_R5"].setText(sprintf("%3.0f", engOutAcc.getValue())); me["Simple_R5S"].setText("ENG OUT ACC"); - if ((fmgc.FMGCInternal.zfwSet and fmgc.FMGCInternal.blockSet) or phase == 6) { + if ((fmgc.FMGCInternal.zfwSet and fmgc.FMGCInternal.blockSet) or fmgc.FMGCInternal.phase == 6) { me["Simple_C1"].setText(sprintf("%3.0f", fmgc.FMGCInternal.flap2_appr)); me["Simple_C2"].setText(sprintf("%3.0f", fmgc.FMGCInternal.slat_appr)); me["Simple_C3"].setText(sprintf("%3.0f", fmgc.FMGCInternal.clean_appr)); @@ -6597,32 +6592,13 @@ setlistener("/sim/signals/fdm-initialized", func { mcdu.mcdu_message(0, "SELECT DESIRED SYSTEM"); mcdu.mcdu_message(1, "SELECT DESIRED SYSTEM"); - - #setlistener("/MCDU[0]/page", func(v) { - # pageSwitch[0].setBoolValue(0); - # MCDU_1.onPageChanged(0); - #}, 1, 0); - - #setlistener("/MCDU[1]/page", func(v) { - # pageSwitch[1].setBoolValue(0); - # MCDU_2.onPageChanged(1); - #}, 1, 0); - + MCDU_update.start(); - }); var MCDU_update = maketimer(0.125, func { canvas_MCDU_base.update(); }); - -var MCDU1_update = maketimer(0.125, func { - MCDU1.update(); -}); - -var MCDU2_update = maketimer(0.125, func { - MCDU2.update(); -}); var showMCDU1 = func { gui.showDialog("mcdu1"); @@ -6632,3 +6608,10 @@ var showMCDU2 = func { gui.showDialog("mcdu2"); } +setlistener("/MCDU[0]/page", func { + pageSwitch[0].setBoolValue(0); +}, 0, 0); + +setlistener("/MCDU[1]/page", func { + pageSwitch[1].setBoolValue(0); +}, 0, 0); diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index 96f189e5..a106e8b1 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -84,7 +84,6 @@ var FMGCinit = func { FMGCInternal.minspeed = 0; FMGCInternal.maxspeed = 338; FMGCInternal.phase = 0; # 0 is Preflight 1 is Takeoff 2 is Climb 3 is Cruise 4 is Descent 5 is Decel/Approach 6 is Go Around 7 is Done - FMGCNodes.phase.setValue(0); FMGCInternal.mngSpd = 157; FMGCInternal.mngSpdCmd = 157; FMGCInternal.mngKtsMach = 0; @@ -258,7 +257,6 @@ var FMGCNodes = { toState: props.globals.initNode("/FMGC/internal/to-state", 0, "BOOL"), v1: props.globals.initNode("/FMGC/internal/v1", 0, "DOUBLE"), v1set: props.globals.initNode("/FMGC/internal/v1-set", 0, "BOOL"), - phase: props.globals.initNode("/FMGC/internal/phase", 0, "INT"), }; ############ @@ -603,15 +601,92 @@ var radios = maketimer(1, func() { adf1(); }); -var fuelUpdateFMGC = maketime(0.5, func { +var masterFMGC = maketimer(0.2, func { + n1_left = pts.Engines.Engine.n1Actual[0].getValue(); + n1_right = pts.Engines.Engine.n1Actual[1].getValue(); + modelat = Modes.PFD.FMA.rollMode.getValue(); + mode = Modes.PFD.FMA.pitchMode.getValue(); + gs = pts.Velocities.groundspeed.getValue(); + alt = pts.Instrumentation.Altimeter.indicatedFt.getValue(); + # cruiseft = FMGCInternal.crzFt; + # cruiseft_b = FMGCInternal.crzFt - 200; + state1 = pts.Systems.Thrust.state[0].getValue(); + state2 = pts.Systems.Thrust.state[1].getValue(); + accel_agl_ft = Setting.reducAglFt.getValue(); + gear0 = pts.Gear.wow[0].getBoolValue(); + altSel = Input.alt.getValue(); + + if ((n1_left < 85 or n1_right < 85) and gs < 90 and mode == " " and gear0 and FMGCInternal.phase == 1) { # rejected takeoff + FMGCInternal.phase = 0; + systems.PNEU.pressMode.setValue("GN"); + } + + if (gear0 and FMGCInternal.phase == 0 and ((n1_left >= 85 and n1_right >= 85 and mode == "SRS") or gs >= 90)) { + FMGCInternal.phase = 1; + systems.PNEU.pressMode.setValue("TO"); + } + + if (FMGCInternal.phase == 1 and ((mode != "SRS" and mode != " ") or alt >= accel_agl_ft)) { + FMGCInternal.phase = 2; + systems.PNEU.pressMode.setValue("TO"); + } + + if (FMGCInternal.phase == 2 and (mode == "ALT CRZ" or mode == "ALT CRZ*")) { + FMGCInternal.phase = 3; + systems.PNEU.pressMode.setValue("CR"); + } + + if (FMGCInternal.crzFl >= 200) { + if (FMGCInternal.phase == 3 and (flightPlanController.arrivalDist <= 200 or altSel < 20000)) { + FMGCInternal.phase = 4; + systems.PNEU.pressMode.setValue("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; + systems.PNEU.pressMode.setValue("DE"); + } + } + + if (FMGCInternal.phase == 4) { + if (getprop("/FMGC/internal/decel")) { + FMGCInternal.phase = 5; + } + else if (altSel == (FMGCInternal.crzFl * 100)) { # back to CRZ state + FMGCInternal.phase = 3; + systems.PNEU.pressMode.setValue("CR"); + } + } + + if (flightPlanController.num[2].getValue() > 0 and getprop("/FMGC/flightplan[2]/active") == 1 and flightPlanController.arrivalDist <= 15 and (modelat == "NAV" or modelat == "LOC" or modelat == "LOC*") and pts.Position.gearAglFt.getValue() < 9500) { #todo decel pseudo waypoint + setprop("/FMGC/internal/decel", 1); + } else if (getprop("/FMGC/internal/decel") == 1 and (FMGCInternal.phase == 0 or FMGCInternal.phase == 6)) { + setprop("/FMGC/internal/decel", 0); + } + + if ((FMGCInternal.phase == 5) and state1 == "TOGA" and state2 == "TOGA") { + FMGCInternal.phase = 6; + systems.PNEU.pressMode.setValue("TO"); + Input.toga.setValue(1); + } + + if (FMGCInternal.phase == 6 and alt >= accel_agl_ft) { # todo when insert altn or new dest + FMGCInternal.phase = 2; + } + + if (getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") != 1024) { + FMGCInternal.maxspeed = getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") - 4; + } elsif (pts.Gear.position[0].getValue() != 0 or pts.Gear.position[1].getValue() != 0 or pts.Gear.position[2].getValue() != 0) { + FMGCInternal.maxspeed = 284; + } else { + FMGCInternal.maxspeed = fmgc.FMGCInternal.vmo_mmo; + } + ############################ # fuel ############################ updateFuel(); -}); - -var windUpdateFMGC = maketime(1, func { - + ############################ # wind ############################ @@ -655,141 +730,6 @@ var windUpdateFMGC = maketime(1, func { fmgc.windController.write(); } } - -}); - -var prop_n1_left = pts.Engines.Engine.n1Actual[0]; -var prop_n1_right = pts.Engines.Engine.n1Actual[1]; -var prop_nmodelat = Modes.PFD.FMA.rollMode; -var prop_mode = Modes.PFD.FMA.pitchMode; -var prop_gs = pts.Velocities.groundspeed; -var prop_alt = pts.Instrumentation.Altimeter.indicatedFt; -var prop_state1 = pts.Systems.Thrust.state[0]; -var prop_state2 = pts.Systems.Thrust.state[1]; -var prop_accel_agl_ft = Setting.reducAglFt; -var prop_gear0 = pts.Gear.wow[0]; -var prop_altSel = Input.alt; - -var masterFMGC = maketimer(0.2, func { - n1_left = prop_n1_left.getValue(); - n1_right = prop_n1_right.getValue(); - modelat = prop_nmodelat.getValue(); - mode = prop_mode.getValue(); - gs = prop_gs.getValue(); - alt = prop_alt.getValue(); - # cruiseft = FMGCInternal.crzFt; - # cruiseft_b = FMGCInternal.crzFt - 200; - state1 = prop_state1.getValue(); - state2 = prop_state2.getValue(); - accel_agl_ft = prop_accel_agl_ft.getValue(); - gear0 = prop_gear0.getBoolValue(); - altSel = prop_altSel.getValue(); - - var phase = FMGCInternal.phase; - var newphase = phase; - - if (phase == 0) { - - if (gear0 and ((n1_left >= 85 and n1_right >= 85 and mode == "SRS") or gs >= 90)) { - newphase = 1; - systems.PNEU.pressMode.setValue("TO"); - } - - } - - else if (phase == 1) { - - if (gear0) { - - if ((n1_left < 85 or n1_right < 85) and gs < 90 and mode == " ") { # rejected takeoff - newphase = 0; - systems.PNEU.pressMode.setValue("GN"); - } - - } - else if (((mode != "SRS" and mode != " ") or alt >= accel_agl_ft)) { - newphase = 2; - systems.PNEU.pressMode.setValue("TO"); - } - - } - - else if (phase == 2) { - - if ((mode == "ALT CRZ" or mode == "ALT CRZ*")) { - newphase = 3; - systems.PNEU.pressMode.setValue("CR"); - } - - } - - else if (phase == 3) { - - if (FMGCInternal.crzFl >= 200) { - if ((flightPlanController.arrivalDist <= 200 or altSel < 20000)) { - newphase = 4; - systems.PNEU.pressMode.setValue("DE"); - } - } else { - if ((flightPlanController.arrivalDist <= 200 or altSel < (FMGCInternal.crzFl * 100))) { # todo - not sure about crzFl condition, investigate what happens! - newphase = 4; - systems.PNEU.pressMode.setValue("DE"); - } - } - - } - - else if (phase == 4) { - - if (getprop("/FMGC/internal/decel")) { - newphase = 5; - } - else if (altSel == (FMGCInternal.crzFl * 100)) { # back to CRZ state - newphase = 3; - systems.PNEU.pressMode.setValue("CR"); - } - - } - - else if (phase == 5) { - - if (state1 == "TOGA" and state2 == "TOGA") { - newphase = 6; - systems.PNEU.pressMode.setValue("TO"); - Input.toga.setValue(1); - } - - } - - else if (phase == 6) { - - if (alt >= accel_agl_ft) { # todo when insert altn or new dest - newphase = 2; - } - - } - - - if (flightPlanController.num[2].getValue() > 0 and getprop("/FMGC/flightplan[2]/active") == 1 and - flightPlanController.arrivalDist <= 15 and (modelat == "NAV" or modelat == "LOC" or modelat == "LOC*") and pts.Position.gearAglFt.getValue() < 9500) { #todo decel pseudo waypoint - setprop("/FMGC/internal/decel", 1); - } else if (getprop("/FMGC/internal/decel") == 1 and (phase == 0 or phase == 6)) { - setprop("/FMGC/internal/decel", 0); - } - - - if (getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") != 1024) { - FMGCInternal.maxspeed = getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") - 4; - } elsif (pts.Gear.position[0].getValue() != 0 or pts.Gear.position[1].getValue() != 0 or pts.Gear.position[2].getValue() != 0) { - FMGCInternal.maxspeed = 284; - } else { - FMGCInternal.maxspeed = fmgc.FMGCInternal.vmo_mmo; - } - - if (newphase != phase) { # phase changed - FMGCInternal.phase = newphase; - FMGCNodes.phase.setValue(newphase); - } ############################ # calculate speeds @@ -831,7 +771,7 @@ var masterFMGC = maketimer(0.2, func { } # predicted takeoff speeds - if (phase == 1) { + if (FMGCInternal.phase == 1) { FMGCInternal.clean_to = FMGCInternal.clean; FMGCInternal.vs1g_clean_to = FMGCInternal.vs1g_clean; FMGCInternal.vs1g_conf_2_to = FMGCInternal.vs1g_conf_2; @@ -853,7 +793,7 @@ var masterFMGC = maketimer(0.2, func { } # predicted approach (temp go-around) speeds - if (phase == 5 or phase == 6) { + if (FMGCInternal.phase == 5 or FMGCInternal.phase == 6) { FMGCInternal.clean_appr = FMGCInternal.clean; FMGCInternal.vs1g_clean_appr = FMGCInternal.vs1g_clean; FMGCInternal.vs1g_conf_2_appr = FMGCInternal.vs1g_conf_2; @@ -974,8 +914,7 @@ var masterFMGC = maketimer(0.2, func { } } - #if (gear0 and pts.Controls.Flight.flapsPos.getValue() < 5 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA")) { - if (gear0 and flaps < 5 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA")) { + if (gear0 and pts.Controls.Flight.flapsPos.getValue() < 5 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA")) { if (!FMGCInternal.takeoffState) { fmgc.FMGCNodes.toState.setValue(1); } @@ -991,15 +930,9 @@ var masterFMGC = maketimer(0.2, func { #handle radios, runways, v1/vr/v2 ############################ -}); - -var updateAirportRadios = func { - - var phase = FMGCInternal.phase; - departure_rwy = fmgc.flightPlanController.flightplans[2].departure_runway; destination_rwy = fmgc.flightPlanController.flightplans[2].destination_runway; - if (destination_rwy != nil and phase >= 2) { + if (destination_rwy != nil and FMGCInternal.phase >= 2) { var airport = airportinfo(FMGCInternal.arrApt); setprop("/FMGC/internal/ldg-elev", airport.elevation * M2FT); # eventually should be runway elevation magnetic_hdg = geo.normdeg(destination_rwy.heading - getprop("/environment/magnetic-variation-deg")); @@ -1014,7 +947,7 @@ var updateAirportRadios = func { } else if (!getprop("/FMGC/internal/ils1crs-set")) { setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); } - } else if (departure_rwy != nil and phase <= 1) { + } else if (departure_rwy != nil and FMGCInternal.phase <= 1) { magnetic_hdg = geo.normdeg(departure_rwy.heading - getprop("/environment/magnetic-variation-deg")); runway_ils = departure_rwy.ils_frequency_mhz; if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set") and !getprop("/FMGC/internal/ils1crs-set")) { @@ -1028,15 +961,10 @@ var updateAirportRadios = func { setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); } } - -}; - -setlistener(FMGCNodes.phase, updateAirportRadios); -setlistener(flightPlanController.changed, updateAirportRadios); +}); var reset_FMGC = func { FMGCInternal.phase = 0; - FMGCNodes.phase.serValue(0); fd1 = Input.fd1.getValue(); fd2 = Input.fd2.getValue(); spd = Input.kts.getValue(); diff --git a/Nasal/FMGC/flightplan.nas b/Nasal/FMGC/flightplan.nas index b072de4e..cb71f578 100644 --- a/Nasal/FMGC/flightplan.nas +++ b/Nasal/FMGC/flightplan.nas @@ -32,8 +32,6 @@ var flightPlanController = { # These flags are only for the main flgiht-plan active: props.globals.initNode("/FMGC/flightplan[2]/active", 0, "BOOL"), - - changed: props.globals.initNode("/FMGC/flightplan[2]/changed", 0, "BOOL"), currentToWpt: nil, # container for the current TO waypoint ghost currentToWptIndex: props.globals.initNode("/FMGC/flightplan[2]/current-wp", 0, "INT"), @@ -767,9 +765,6 @@ var flightPlanController = { fmgc.FMGCInternal.fuelCalculating = 1; fmgc.fuelCalculating.setValue(1); } - - if (n == 2) flightPlanController.changed.setBoolValue(1); - canvas_nd.A3XXRouteDriver.triggerSignal("fp-added"); }, From d18b1212238c82ff663d33738c368412b8b5eb8e Mon Sep 17 00:00:00 2001 From: Inuyaksa Date: Sun, 6 Jun 2021 23:21:58 +0200 Subject: [PATCH 17/96] rework fix --- Nasal/FMGC/FMGC.nas | 249 ++++++++++++++++++++++------------ Nasal/FMGC/flightplan.nas | 5 + Nasal/Libraries/libraries.nas | 4 +- 3 files changed, 168 insertions(+), 90 deletions(-) diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index a106e8b1..b72f980f 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -84,6 +84,7 @@ var FMGCinit = func { FMGCInternal.minspeed = 0; FMGCInternal.maxspeed = 338; FMGCInternal.phase = 0; # 0 is Preflight 1 is Takeoff 2 is Climb 3 is Cruise 4 is Descent 5 is Decel/Approach 6 is Go Around 7 is Done + FMGCNodes.phase.setValue(0); FMGCInternal.mngSpd = 157; FMGCInternal.mngSpdCmd = 157; FMGCInternal.mngKtsMach = 0; @@ -257,6 +258,7 @@ var FMGCNodes = { toState: props.globals.initNode("/FMGC/internal/to-state", 0, "BOOL"), v1: props.globals.initNode("/FMGC/internal/v1", 0, "DOUBLE"), v1set: props.globals.initNode("/FMGC/internal/v1-set", 0, "BOOL"), + phase: props.globals.initNode("/FMGC/internal/phase", 0, "INT"), }; ############ @@ -601,92 +603,15 @@ var radios = maketimer(1, func() { adf1(); }); -var masterFMGC = maketimer(0.2, func { - n1_left = pts.Engines.Engine.n1Actual[0].getValue(); - n1_right = pts.Engines.Engine.n1Actual[1].getValue(); - modelat = Modes.PFD.FMA.rollMode.getValue(); - mode = Modes.PFD.FMA.pitchMode.getValue(); - gs = pts.Velocities.groundspeed.getValue(); - alt = pts.Instrumentation.Altimeter.indicatedFt.getValue(); - # cruiseft = FMGCInternal.crzFt; - # cruiseft_b = FMGCInternal.crzFt - 200; - state1 = pts.Systems.Thrust.state[0].getValue(); - state2 = pts.Systems.Thrust.state[1].getValue(); - accel_agl_ft = Setting.reducAglFt.getValue(); - gear0 = pts.Gear.wow[0].getBoolValue(); - altSel = Input.alt.getValue(); - - if ((n1_left < 85 or n1_right < 85) and gs < 90 and mode == " " and gear0 and FMGCInternal.phase == 1) { # rejected takeoff - FMGCInternal.phase = 0; - systems.PNEU.pressMode.setValue("GN"); - } - - if (gear0 and FMGCInternal.phase == 0 and ((n1_left >= 85 and n1_right >= 85 and mode == "SRS") or gs >= 90)) { - FMGCInternal.phase = 1; - systems.PNEU.pressMode.setValue("TO"); - } - - if (FMGCInternal.phase == 1 and ((mode != "SRS" and mode != " ") or alt >= accel_agl_ft)) { - FMGCInternal.phase = 2; - systems.PNEU.pressMode.setValue("TO"); - } - - if (FMGCInternal.phase == 2 and (mode == "ALT CRZ" or mode == "ALT CRZ*")) { - FMGCInternal.phase = 3; - systems.PNEU.pressMode.setValue("CR"); - } - - if (FMGCInternal.crzFl >= 200) { - if (FMGCInternal.phase == 3 and (flightPlanController.arrivalDist <= 200 or altSel < 20000)) { - FMGCInternal.phase = 4; - systems.PNEU.pressMode.setValue("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; - systems.PNEU.pressMode.setValue("DE"); - } - } - - if (FMGCInternal.phase == 4) { - if (getprop("/FMGC/internal/decel")) { - FMGCInternal.phase = 5; - } - else if (altSel == (FMGCInternal.crzFl * 100)) { # back to CRZ state - FMGCInternal.phase = 3; - systems.PNEU.pressMode.setValue("CR"); - } - } - - if (flightPlanController.num[2].getValue() > 0 and getprop("/FMGC/flightplan[2]/active") == 1 and flightPlanController.arrivalDist <= 15 and (modelat == "NAV" or modelat == "LOC" or modelat == "LOC*") and pts.Position.gearAglFt.getValue() < 9500) { #todo decel pseudo waypoint - setprop("/FMGC/internal/decel", 1); - } else if (getprop("/FMGC/internal/decel") == 1 and (FMGCInternal.phase == 0 or FMGCInternal.phase == 6)) { - setprop("/FMGC/internal/decel", 0); - } - - if ((FMGCInternal.phase == 5) and state1 == "TOGA" and state2 == "TOGA") { - FMGCInternal.phase = 6; - systems.PNEU.pressMode.setValue("TO"); - Input.toga.setValue(1); - } - - if (FMGCInternal.phase == 6 and alt >= accel_agl_ft) { # todo when insert altn or new dest - FMGCInternal.phase = 2; - } - - if (getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") != 1024) { - FMGCInternal.maxspeed = getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") - 4; - } elsif (pts.Gear.position[0].getValue() != 0 or pts.Gear.position[1].getValue() != 0 or pts.Gear.position[2].getValue() != 0) { - FMGCInternal.maxspeed = 284; - } else { - FMGCInternal.maxspeed = fmgc.FMGCInternal.vmo_mmo; - } - +var fuelUpdateFMGC = maketimer(0.5, func { ############################ # fuel ############################ updateFuel(); - +}); + +var windUpdateFMGC = maketimer(1, func { + ############################ # wind ############################ @@ -730,6 +655,142 @@ var masterFMGC = maketimer(0.2, func { fmgc.windController.write(); } } + +}); + +var prop_n1_left = pts.Engines.Engine.n1Actual[0]; +var prop_n1_right = pts.Engines.Engine.n1Actual[1]; +#var prop_nmodelat = Modes.PFD.FMA.rollMode; +#var prop_mode = Modes.PFD.FMA.pitchMode; +var prop_gs = pts.Velocities.groundspeed; +var prop_alt = pts.Instrumentation.Altimeter.indicatedFt; +var prop_state1 = pts.Systems.Thrust.state[0]; +var prop_state2 = pts.Systems.Thrust.state[1]; +#var prop_accel_agl_ft = Setting.reducAglFt; +var prop_gear0 = pts.Gear.wow[0]; +#var prop_altSel = Input.alt; + +var masterFMGC = maketimer(0.2, func { + + n1_left = prop_n1_left.getValue(); + n1_right = prop_n1_right.getValue(); + modelat = Modes.PFD.FMA.rollMode.getValue(); + mode = Modes.PFD.FMA.pitchMode.getValue(); + gs = prop_gs.getValue(); + alt = prop_alt.getValue(); + # cruiseft = FMGCInternal.crzFt; + # cruiseft_b = FMGCInternal.crzFt - 200; + state1 = prop_state1.getValue(); + state2 = prop_state2.getValue(); + accel_agl_ft = Setting.reducAglFt.getValue(); + gear0 = prop_gear0.getBoolValue(); + altSel = Input.alt.getValue(); + + var phase = FMGCInternal.phase; + var newphase = phase; + + if (phase == 0) { + + if (gear0 and ((n1_left >= 85 and n1_right >= 85 and mode == "SRS") or gs >= 90)) { + newphase = 1; + systems.PNEU.pressMode.setValue("TO"); + } + + } + + else if (phase == 1) { + + if (gear0) { + + if ((n1_left < 85 or n1_right < 85) and gs < 90 and mode == " ") { # rejected takeoff + newphase = 0; + systems.PNEU.pressMode.setValue("GN"); + } + + } + else if (((mode != "SRS" and mode != " ") or alt >= accel_agl_ft)) { + newphase = 2; + systems.PNEU.pressMode.setValue("TO"); + } + + } + + else if (phase == 2) { + + if ((mode == "ALT CRZ" or mode == "ALT CRZ*")) { + newphase = 3; + systems.PNEU.pressMode.setValue("CR"); + } + + } + + else if (phase == 3) { + + if (FMGCInternal.crzFl >= 200) { + if ((flightPlanController.arrivalDist <= 200 or altSel < 20000)) { + newphase = 4; + systems.PNEU.pressMode.setValue("DE"); + } + } else { + if ((flightPlanController.arrivalDist <= 200 or altSel < (FMGCInternal.crzFl * 100))) { # todo - not sure about crzFl condition, investigate what happens! + newphase = 4; + systems.PNEU.pressMode.setValue("DE"); + } + } + + } + + else if (phase == 4) { + + if (getprop("/FMGC/internal/decel")) { + newphase = 5; + } + else if (altSel == (FMGCInternal.crzFl * 100)) { # back to CRZ state + newphase = 3; + systems.PNEU.pressMode.setValue("CR"); + } + + } + + else if (phase == 5) { + + if (state1 == "TOGA" and state2 == "TOGA") { + newphase = 6; + systems.PNEU.pressMode.setValue("TO"); + Input.toga.setValue(1); + } + + } + + else if (phase == 6) { + + if (alt >= accel_agl_ft) { # todo when insert altn or new dest + newphase = 2; + } + + } + + + if (flightPlanController.num[2].getValue() > 0 and getprop("/FMGC/flightplan[2]/active") == 1 and + flightPlanController.arrivalDist <= 15 and (modelat == "NAV" or modelat == "LOC" or modelat == "LOC*") and pts.Position.gearAglFt.getValue() < 9500) { #todo decel pseudo waypoint + setprop("/FMGC/internal/decel", 1); + } else if (getprop("/FMGC/internal/decel") == 1 and (phase == 0 or phase == 6)) { + setprop("/FMGC/internal/decel", 0); + } + + + if (getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") != 1024) { + FMGCInternal.maxspeed = getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") - 4; + } elsif (pts.Gear.position[0].getValue() != 0 or pts.Gear.position[1].getValue() != 0 or pts.Gear.position[2].getValue() != 0) { + FMGCInternal.maxspeed = 284; + } else { + FMGCInternal.maxspeed = fmgc.FMGCInternal.vmo_mmo; + } + + if (newphase != phase) { # phase changed + FMGCInternal.phase = newphase; + FMGCNodes.phase.setValue(newphase); + } ############################ # calculate speeds @@ -771,7 +832,7 @@ var masterFMGC = maketimer(0.2, func { } # predicted takeoff speeds - if (FMGCInternal.phase == 1) { + if (phase == 1) { FMGCInternal.clean_to = FMGCInternal.clean; FMGCInternal.vs1g_clean_to = FMGCInternal.vs1g_clean; FMGCInternal.vs1g_conf_2_to = FMGCInternal.vs1g_conf_2; @@ -793,7 +854,7 @@ var masterFMGC = maketimer(0.2, func { } # predicted approach (temp go-around) speeds - if (FMGCInternal.phase == 5 or FMGCInternal.phase == 6) { + if (phase == 5 or phase == 6) { FMGCInternal.clean_appr = FMGCInternal.clean; FMGCInternal.vs1g_clean_appr = FMGCInternal.vs1g_clean; FMGCInternal.vs1g_conf_2_appr = FMGCInternal.vs1g_conf_2; @@ -914,7 +975,8 @@ var masterFMGC = maketimer(0.2, func { } } - if (gear0 and pts.Controls.Flight.flapsPos.getValue() < 5 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA")) { + #if (gear0 and pts.Controls.Flight.flapsPos.getValue() < 5 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA")) { + if (gear0 and flap < 5 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA")) { if (!FMGCInternal.takeoffState) { fmgc.FMGCNodes.toState.setValue(1); } @@ -930,9 +992,15 @@ var masterFMGC = maketimer(0.2, func { #handle radios, runways, v1/vr/v2 ############################ +}); + +var updateAirportRadios = func { + + var phase = FMGCInternal.phase; + departure_rwy = fmgc.flightPlanController.flightplans[2].departure_runway; destination_rwy = fmgc.flightPlanController.flightplans[2].destination_runway; - if (destination_rwy != nil and FMGCInternal.phase >= 2) { + if (destination_rwy != nil and phase >= 2) { var airport = airportinfo(FMGCInternal.arrApt); setprop("/FMGC/internal/ldg-elev", airport.elevation * M2FT); # eventually should be runway elevation magnetic_hdg = geo.normdeg(destination_rwy.heading - getprop("/environment/magnetic-variation-deg")); @@ -947,7 +1015,7 @@ var masterFMGC = maketimer(0.2, func { } else if (!getprop("/FMGC/internal/ils1crs-set")) { setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); } - } else if (departure_rwy != nil and FMGCInternal.phase <= 1) { + } else if (departure_rwy != nil and phase <= 1) { magnetic_hdg = geo.normdeg(departure_rwy.heading - getprop("/environment/magnetic-variation-deg")); runway_ils = departure_rwy.ils_frequency_mhz; if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set") and !getprop("/FMGC/internal/ils1crs-set")) { @@ -961,10 +1029,15 @@ var masterFMGC = maketimer(0.2, func { setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); } } -}); + +}; + +setlistener(FMGCNodes.phase, updateAirportRadios); +setlistener(flightPlanController.changed, updateAirportRadios); var reset_FMGC = func { FMGCInternal.phase = 0; + FMGCNodes.phase.serValue(0); fd1 = Input.fd1.getValue(); fd2 = Input.fd2.getValue(); spd = Input.kts.getValue(); diff --git a/Nasal/FMGC/flightplan.nas b/Nasal/FMGC/flightplan.nas index cb71f578..b072de4e 100644 --- a/Nasal/FMGC/flightplan.nas +++ b/Nasal/FMGC/flightplan.nas @@ -32,6 +32,8 @@ var flightPlanController = { # These flags are only for the main flgiht-plan active: props.globals.initNode("/FMGC/flightplan[2]/active", 0, "BOOL"), + + changed: props.globals.initNode("/FMGC/flightplan[2]/changed", 0, "BOOL"), currentToWpt: nil, # container for the current TO waypoint ghost currentToWptIndex: props.globals.initNode("/FMGC/flightplan[2]/current-wp", 0, "INT"), @@ -765,6 +767,9 @@ var flightPlanController = { fmgc.FMGCInternal.fuelCalculating = 1; fmgc.fuelCalculating.setValue(1); } + + if (n == 2) flightPlanController.changed.setBoolValue(1); + canvas_nd.A3XXRouteDriver.triggerSignal("fp-added"); }, diff --git a/Nasal/Libraries/libraries.nas b/Nasal/Libraries/libraries.nas index 0e15b916..b0662140 100644 --- a/Nasal/Libraries/libraries.nas +++ b/Nasal/Libraries/libraries.nas @@ -250,8 +250,8 @@ setlistener("/instrumentation/mk-viii/inputs/discretes/ta-tcf-inhibit", func{ # Replay var replayState = props.globals.getNode("/sim/replay/replay-state"); -setlistener("/sim/replay/replay-state", func() { - if (replayState.getBoolValue()) { +setlistener(replayState, func(v) { + if (v.getBoolValue()) { } else { acconfig.colddark(); gui.popupTip("Replay Ended: Setting Cold and Dark state..."); From 9798a20850e97fdd2881e00e3582c781defc297b Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Mon, 7 Jun 2021 15:38:50 +0100 Subject: [PATCH 18/96] Hydraulics / brakes: smooth the pressure guague --- Models/FlightDeck/a320.flightdeck.xml | 10 +++++----- Nasal/Systems/hydraulics.nas | 24 ++++++++++++----------- Systems/libraries.xml | 28 +++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 16 deletions(-) diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index c0e5eed8..cd816a46 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -346,7 +346,7 @@ rotate brakes_lb_psi - systems/hydraulic/brakes/pressure-left-psi + systems/hydraulic/brakes/pressure-left-psi-output -0.03 @@ -360,7 +360,7 @@ 1 - systems/hydraulic/brakes/pressure-left-psi + systems/hydraulic/brakes/pressure-left-psi-output 0 @@ -378,7 +378,7 @@ rotate brakes_rb_psi - systems/hydraulic/brakes/pressure-right-psi + systems/hydraulic/brakes/pressure-right-psi-output 0.03 @@ -392,7 +392,7 @@ 1 - systems/hydraulic/brakes/pressure-right-psi + systems/hydraulic/brakes/pressure-right-psi-output 0 @@ -410,7 +410,7 @@ rotate brakes_accum_psi - systems/hydraulic/yellow-accumulator-psi + systems/hydraulic/yellow-accumulator-psi-output 00 700-20 diff --git a/Nasal/Systems/hydraulics.nas b/Nasal/Systems/hydraulics.nas index 204c40b5..04bef4bc 100644 --- a/Nasal/Systems/hydraulics.nas +++ b/Nasal/Systems/hydraulics.nas @@ -2,10 +2,10 @@ # Jonathan Redpath # Copyright (c) 2019 Jonathan Redpath -var lcont = 0; -var rcont = 0; var HYD = { + lcont: 0, + rcont: 0, Brakes: { accumPressPsi: props.globals.initNode("/systems/hydraulic/yellow-accumulator-psi-cmd", 0, "INT"), leftPressPsi: props.globals.initNode("/systems/hydraulic/brakes/pressure-left-psi", 0, "INT"), @@ -86,23 +86,24 @@ var HYD = { me.Fail.yellowLeak.setBoolValue(0); }, loop: func(notification) { - # Decrease accumPressPsi when green and yellow hydraulic's aren't pressurized + # Decrease accumPressPsi when green and yellow hydraulics aren't pressurized if (me.Brakes.leftbrake.getValue() > 0 or notification.brakesMode == 0) { - lcont = lcont + 1; + me.lcont = me.lcont + 1; } else { - lcont = 0; + me.lcont = 0; } if (me.Brakes.rightbrake.getValue() > 0 or notification.brakesMode == 0) { - rcont = rcont + 1; + me.rcont = me.rcont + 1; } else { - rcont = 0; + me.rcont = 0; } + if (notification.yellow < notification.accumPressPsi and notification.accumPressPsi > 0) { - if (lcont == 1) { - me.Brakes.accumPressPsi.setValue(notification.accumPressPsi - 200); + if (me.lcont == 1) { + me.Brakes.accumPressPsi.setValue(notification.accumPressPsi - 200); } - if (rcont == 1) { - me.Brakes.accumPressPsi.setValue(notification.accumPressPsi - 200); + if (me.rcont == 1) { + me.Brakes.accumPressPsi.setValue(notification.accumPressPsi - 200); } if (notification.accumPressPsi < 0) { me.Brakes.accumPressPsi.setValue(0); @@ -181,6 +182,7 @@ var HYD = { }, }; +# Restrict gear raising on the ground setlistener("/controls/gear/gear-down", func { if (!pts.Controls.Gear.gearDown.getValue() and (pts.Gear.wow[0].getValue() or pts.Gear.wow[1].getValue() or pts.Gear.wow[2].getValue())) { pts.Controls.Gear.gearDown.setValue(1); diff --git a/Systems/libraries.xml b/Systems/libraries.xml index 52d14c55..ba0338a4 100644 --- a/Systems/libraries.xml +++ b/Systems/libraries.xml @@ -1326,4 +1326,32 @@ /instrumentation/mk-viii/inputs/discretes/landing-flaps + + + + noise-spike + + /systems/hydraulic/yellow-accumulator-psi + + /systems/hydraulic/yellow-accumulator-psi-output + 3000 + + + + noise-spike + + /systems/hydraulic/brakes/pressure-left-psi + + /systems/hydraulic/brakes/pressure-left-psi-output + 3000 + + + + noise-spike + + /systems/hydraulic/brakes/pressure-right-psi + + /systems/hydraulic/brakes/pressure-right-psi-output + 3000 + From 113b2264f3078bb44db7ce928186f3651aa32fa5 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Tue, 8 Jun 2021 16:09:21 +0100 Subject: [PATCH 19/96] Pneumatics: remove some extra un-needed code --- Nasal/Systems/pneumatics.nas | 2 -- 1 file changed, 2 deletions(-) diff --git a/Nasal/Systems/pneumatics.nas b/Nasal/Systems/pneumatics.nas index 97425c63..cf3879f3 100644 --- a/Nasal/Systems/pneumatics.nas +++ b/Nasal/Systems/pneumatics.nas @@ -233,14 +233,12 @@ setlistener("/controls/oxygen/masksDeployMan", func { setlistener("/controls/oxygen/masksDeployMan", func { masks = getprop("/controls/oxygen/masksDeployMan"); - autoMasks = getprop("/controls/oxygen/masksDeploy"); if (!masks) { setprop("/controls/oxygen/masksDeployMan", 1); } }, 0, 0); setlistener("/controls/oxygen/masksDeploy", func { - masks = getprop("/controls/oxygen/masksDeployMan"); autoMasks = getprop("/controls/oxygen/masksDeploy"); if (!autoMasks) { setprop("/controls/oxygen/masksDeploy", 1); From 0dd4f55400241d971d1e56c50d11c63d2df67052 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Tue, 8 Jun 2021 16:53:09 +0100 Subject: [PATCH 20/96] Correct acconfig.nas failures resetting; brake guague --> use lag_filter instead of property rules filter --- AircraftConfig/acconfig.nas | 29 +++----------------------- Models/FlightDeck/a320.flightdeck.xml | 4 ++-- Nasal/FBW/it-fbw.nas | 3 +++ Systems/a320-hydraulic.xml | 30 +++++++++++++++++++++++++++ Systems/libraries.xml | 29 -------------------------- 5 files changed, 38 insertions(+), 57 deletions(-) diff --git a/AircraftConfig/acconfig.nas b/AircraftConfig/acconfig.nas index e963ddc1..6b627de1 100644 --- a/AircraftConfig/acconfig.nas +++ b/AircraftConfig/acconfig.nas @@ -23,39 +23,15 @@ var spinning = maketimer(0.05, func { var failReset = func { systems.ELEC.resetFail(); systems.PNEU.resetFail(); + fbw.FBW.resetFail(); + systems.HYD.resetFail(); } var failResetOld = func { - setprop("/systems/failures/fctl/elac1", 0); - setprop("/systems/failures/fctl/elac2", 0); - setprop("/systems/failures/fctl/sec1", 0); - setprop("/systems/failures/fctl/sec2", 0); - setprop("/systems/failures/fctl/sec3", 0); - setprop("/systems/failures/fctl/fac1", 0); - setprop("/systems/failures/fctl/fac2", 0); - setprop("/systems/failures/fctl/rtlu-1", 0); - setprop("/systems/failures/fctl/rtlu-2", 0); setprop("/systems/failures/aileron-left", 0); setprop("/systems/failures/aileron-right", 0); setprop("/systems/failures/elevator-left", 0); setprop("/systems/failures/elevator-right", 0); - setprop("/systems/failures/spoilers/spoiler-l1", 0); - setprop("/systems/failures/spoilers/spoiler-l2", 0); - setprop("/systems/failures/spoilers/spoiler-l3", 0); - setprop("/systems/failures/spoilers/spoiler-l4", 0); - setprop("/systems/failures/spoilers/spoiler-l5", 0); - setprop("/systems/failures/spoilers/spoiler-r1", 0); - setprop("/systems/failures/spoilers/spoiler-r2", 0); - setprop("/systems/failures/spoilers/spoiler-r3", 0); - setprop("/systems/failures/spoilers/spoiler-r4", 0); - setprop("/systems/failures/spoilers/spoiler-r5", 0); - setprop("/systems/failures/hyd-blue", 0); - setprop("/systems/failures/hyd-green", 0); - setprop("/systems/failures/hyd-yellow", 0); - setprop("/systems/failures/pump-blue", 0); - setprop("/systems/failures/pump-green", 0); - setprop("/systems/failures/pump-yellow-eng", 0); - setprop("/systems/failures/pump-yellow-elec", 0); setprop("/systems/failures/fire/cargo-aft-fire", 0); setprop("/systems/failures/fire/cargo-fwd-fire", 0); setprop("/systems/failures/fire/engine-left-fire", 0); @@ -65,6 +41,7 @@ var failResetOld = func { } failResetOld(); + setprop("/systems/acconfig/autoconfig-running", 0); setprop("/systems/acconfig/spinning", 0); setprop("/systems/acconfig/spin", "-"); diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index cd816a46..c45e4ec1 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -360,7 +360,7 @@ 1 - systems/hydraulic/brakes/pressure-left-psi-output + systems/hydraulic/brakes/pressure-left-psi 0 @@ -392,7 +392,7 @@ 1 - systems/hydraulic/brakes/pressure-right-psi-output + systems/hydraulic/brakes/pressure-right-psi 0 diff --git a/Nasal/FBW/it-fbw.nas b/Nasal/FBW/it-fbw.nas index 18b21fec..120e4a89 100644 --- a/Nasal/FBW/it-fbw.nas +++ b/Nasal/FBW/it-fbw.nas @@ -64,6 +64,9 @@ var FBW = { sec3: props.globals.getNode("/systems/failures/fctl/sec3"), fac1: props.globals.getNode("/systems/failures/fctl/fac1"), fac2: props.globals.getNode("/systems/failures/fctl/fac2"), + rtlu1: props.globals.getNode("/systems/failures/fctl/rtlu-1"), + rtlu2: props.globals.getNode("/systems/failures/fctl/rtlu-2"), + rtlu2: props.globals.getNode("/systems/failures/fctl/rtlu-2"), ths: props.globals.getNode("/systems/failures/fctl/ths-jam"), spoilerl1: props.globals.getNode("/systems/failures/spoilers/spoiler-l1"), spoilerl2: props.globals.getNode("/systems/failures/spoilers/spoiler-l2"), diff --git a/Systems/a320-hydraulic.xml b/Systems/a320-hydraulic.xml index 30264be1..cfc655f0 100644 --- a/Systems/a320-hydraulic.xml +++ b/Systems/a320-hydraulic.xml @@ -541,6 +541,36 @@ /systems/hydraulic/yellow-accumulator-psi-cmd ge 0 + + + /systems/hydraulic/yellow-accumulator-psi + 9 + + + + + + /systems/hydraulic/brakes/mode ne 1 + + + + + + + /systems/hydraulic/brakes/mode ne 1 + + + + + /systems/hydraulic/brakes/pressure-left-psi-input + 9 + + + + /systems/hydraulic/brakes/pressure-right-psi-input + 9 + + diff --git a/Systems/libraries.xml b/Systems/libraries.xml index ba0338a4..fecc9de2 100644 --- a/Systems/libraries.xml +++ b/Systems/libraries.xml @@ -1325,33 +1325,4 @@ /instrumentation/mk-viii/inputs/discretes/landing-flaps - - - - - noise-spike - - /systems/hydraulic/yellow-accumulator-psi - - /systems/hydraulic/yellow-accumulator-psi-output - 3000 - - - - noise-spike - - /systems/hydraulic/brakes/pressure-left-psi - - /systems/hydraulic/brakes/pressure-left-psi-output - 3000 - - - - noise-spike - - /systems/hydraulic/brakes/pressure-right-psi - - /systems/hydraulic/brakes/pressure-right-psi-output - 3000 - From aa3990d3d94024ceb9823a8e4afaa38878d0bb0a Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Tue, 8 Jun 2021 18:16:19 +0100 Subject: [PATCH 21/96] Misc fixes + improvements to Nasal code; no real changes; only improved code quality --- AircraftConfig/acconfig.nas | 7 +- .../ND/canvas/framework/navdisplay.nas | 1 - Nasal/ECAM/ECAM-logic.nas | 2 +- Nasal/Libraries/property-tree-setup.nas | 1 + Nasal/Panels/acp.nas | 4 +- Nasal/Panels/atc.nas | 20 +-- Nasal/Panels/clock.nas | 54 ++++--- Nasal/Panels/rmp.nas | 142 ++++++++++-------- 8 files changed, 125 insertions(+), 106 deletions(-) diff --git a/AircraftConfig/acconfig.nas b/AircraftConfig/acconfig.nas index 6b627de1..5f4419c4 100644 --- a/AircraftConfig/acconfig.nas +++ b/AircraftConfig/acconfig.nas @@ -92,7 +92,8 @@ var revisionFile = (getprop("/sim/aircraft-dir") ~ "/revision.txt"); var current_revision = io.readfile(revisionFile); print("A320-family Revision: " ~ current_revision); setprop("/systems/acconfig/revision", current_revision); -setprop("/systems/acconfig/options/fo-view", 0); + +var foViewNode = props.globals.initNode("/systems/acconfig/options/fo-view", 0, "BOOL"); setprop("/systems/acconfig/options/simbrief-username", ""); setlistener("/systems/acconfig/new-revision", func { @@ -209,7 +210,7 @@ var readSettings = func { setprop("/systems/apu/oil/allow-oil-consumption", getprop("/systems/acconfig/options/allow-oil-consumption")); setprop("/sim/model/autopush/route/show", getprop("/systems/acconfig/options/autopush/show-route")); setprop("/sim/model/autopush/route/show-wingtip", getprop("/systems/acconfig/options/autopush/show-wingtip")); - setprop("/options/system/fo-view", getprop("/systems/acconfig/options/fo-view")); + setprop("/options/system/fo-view", foViewNode.getValue()); setprop("/FMGC/simbrief-username", getprop("/systems/acconfig/options/simbrief-username")); setprop("/systems/atsu/atis-server", getprop("/systems/acconfig/options/atis-server")); setprop("/systems/atsu/wxr-server", getprop("/systems/acconfig/options/wxr-server")); @@ -223,7 +224,7 @@ var writeSettings = func { setprop("/systems/acconfig/options/allow-oil-consumption", getprop("/systems/apu/oil/allow-oil-consumption")); setprop("/systems/acconfig/options/autopush/show-route", getprop("/sim/model/autopush/route/show")); setprop("/systems/acconfig/options/autopush/show-wingtip", getprop("/sim/model/autopush/route/show-wingtip")); - setprop("/systems/acconfig/options/fo-view", getprop("/options/system/fo-view")); + foViewNode.setValue(getprop("/options/system/fo-view")); setprop("/systems/acconfig/options/simbrief-username", getprop("/FMGC/simbrief-username")); setprop("/systems/acconfig/options/atis-server", getprop("/systems/atsu/atis-server")); setprop("/systems/acconfig/options/wxr-server", getprop("/systems/atsu/wxr-server")); diff --git a/Models/Instruments/ND/canvas/framework/navdisplay.nas b/Models/Instruments/ND/canvas/framework/navdisplay.nas index 8c4063d8..bca19f6c 100644 --- a/Models/Instruments/ND/canvas/framework/navdisplay.nas +++ b/Models/Instruments/ND/canvas/framework/navdisplay.nas @@ -41,7 +41,6 @@ var easeArrow = { #me.element.hide(); me.duration = 0; me.changed = 1; - print("VOR reset"); }, setzero: func { me.duration = 0; diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index 7dc62249..19d09c56 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -2155,7 +2155,7 @@ var messages_priority_2 = func { ECAM_controller.warningReset(athr_lim_1); } - if (getprop("/instrumentation/tcas/serviceable") == 0 and phaseVar2 != 1 and phaseVar2 != 3 and phaseVar2 != 4 and phaseVar2 != 5 and phaseVar2 != 7 and phaseVar2 != 8 and phaseVar2 != 10 and systems.ELEC.Bus.ac1.getValue() >= 110 and pts.Instrumentation.TCAS.Inputs.mode.getValue() != 1 and tcasFault.clearFlag == 0) { + if (pts.Instrumentation.TCAS.servicable.getValue() == 0 and phaseVar2 != 1 and phaseVar2 != 3 and phaseVar2 != 4 and phaseVar2 != 5 and phaseVar2 != 7 and phaseVar2 != 8 and phaseVar2 != 10 and systems.ELEC.Bus.ac1.getValue() >= 110 and pts.Instrumentation.TCAS.Inputs.mode.getValue() != 1 and tcasFault.clearFlag == 0) { tcasFault.active = 1; } else { ECAM_controller.warningReset(tcasFault); diff --git a/Nasal/Libraries/property-tree-setup.nas b/Nasal/Libraries/property-tree-setup.nas index ed512e14..cb5d1857 100644 --- a/Nasal/Libraries/property-tree-setup.nas +++ b/Nasal/Libraries/property-tree-setup.nas @@ -192,6 +192,7 @@ var Instrumentation = { locDeflection: props.globals.getNode("/instrumentation/nav[0]/heading-needle-deflection-norm"), }, TCAS: { + servicable: props.globals.getNode("/instrumentation/tcas/serviceable"), Inputs: { mode: props.globals.getNode("/instrumentation/tcas/inputs/mode"), }, diff --git a/Nasal/Panels/acp.nas b/Nasal/Panels/acp.nas index 6aa3b5bf..bade1ce6 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 (acconfig.foViewNode.getValue() == 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 (acconfig.foViewNode.getValue() == 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 d5abadfb..fb5a32a5 100644 --- a/Nasal/Panels/atc.nas +++ b/Nasal/Panels/atc.nas @@ -141,10 +141,11 @@ var transponderPanel = { code: "2000", codeDisp: "2000", codeProp: props.globals.initNode("/systems/atc/transponder-code", "2000", "STRING"), + failNode: props.globals.getNode("/systems/atc/failed"), 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 (pts.Controls.Switches.annunTest.getBoolValue() or systems.ELEC.Bus.dcEss.getValue() < 25) { return; } if (keyNum < 0 or keyNum > 7) { @@ -162,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 (pts.Controls.Switches.annunTest.getBoolValue() or systems.ELEC.Bus.dcEss.getValue() < 25) { return; } if (me.codeDisp != "") { @@ -214,7 +215,7 @@ var transponderPanel = { return; } me.failLight = newFail; - props.globals.getNode("/systems/atc/failed").setBoolValue(me.failLight); + me.failNode.setBoolValue(me.failLight); }, identSwitch: func() { Transponders.vector[me.atcSel - 1].ident(); @@ -255,27 +256,27 @@ var transponderPanel = { updateADR1: func(val) { if (Transponders.vector[me.atcSel - 1].activeADIRS == 1) { if (val) { - setprop("/instrumentation/tcas/serviceable", 1); + pts.Instrumentation.TCAS.servicable.setValue(1); } else { - setprop("/instrumentation/tcas/serviceable", 0); + pts.Instrumentation.TCAS.servicable.setValue(0); } } }, updateADR2: func(val) { if (Transponders.vector[me.atcSel - 1].activeADIRS == 2) { if (val) { - setprop("/instrumentation/tcas/serviceable", 1); + pts.Instrumentation.TCAS.servicable.setValue(1); } else { - setprop("/instrumentation/tcas/serviceable", 0); + pts.Instrumentation.TCAS.servicable.setValue(0); } } }, updateADR3: func(val) { if (Transponders.vector[me.atcSel - 1].activeADIRS == 3) { if (val) { - setprop("/instrumentation/tcas/serviceable", 1); + pts.Instrumentation.TCAS.servicable.setValue(1); } else { - setprop("/instrumentation/tcas/serviceable", 0); + pts.Instrumentation.TCAS.servicable.setValue(0); } } }, @@ -295,7 +296,6 @@ setlistener("/instrumentation/transponder/id-code", func { var Transponders = std.Vector.new([Transponder.new("/systems/electrical/bus/ac-ess-shed", 1), Transponder.new("/systems/electrical/bus/ac-2", 2)]); - setlistener("/systems/navigation/adr/operating-1", func() { transponderPanel.updateADR1(systems.ADIRS.Operating.adr[0].getValue()); }, 1, 0); diff --git a/Nasal/Panels/clock.nas b/Nasal/Panels/clock.nas index ff47f577..0aa80d10 100644 --- a/Nasal/Panels/clock.nas +++ b/Nasal/Panels/clock.nas @@ -1,10 +1,12 @@ # # Chrono - Clock - ET # -var chr = aircraft.timer.new("instrumentation/chrono[0]/elapsetime-sec",1); -var clk = aircraft.timer.new("instrumentation/clock/elapsetime-sec",1); -var chrono_cpt = aircraft.timer.new("instrumentation/ndchrono[0]/elapsetime-sec",1); -var chrono_fo = aircraft.timer.new("instrumentation/ndchrono[1]/elapsetime-sec",1); +var chr = aircraft.timer.new("/instrumentation/chrono[0]/elapsetime-sec",1); +var clk = aircraft.timer.new("/instrumentation/clock/elapsetime-sec",1); +var chrono_cpt = aircraft.timer.new("/instrumentation/ndchrono[0]/elapsetime-sec",1); +var chrono_fo = aircraft.timer.new("/instrumentation/ndchrono[1]/elapsetime-sec",1); +var chrono_cpt_node = props.globals.getNode("/instrumentation/ndchrono[0]/elapsetime-sec"); +var chrono_fo_node = props.globals.getNode("/instrumentation/ndchrono[1]/elapsetime-sec"); var chr_min = nil; var chr_sec = nil; @@ -141,7 +143,7 @@ setlistener("/instrumentation/chrono[0]/chrono-reset", func(et){ }, 0, 0); #Chrono -setlistener("instrumentation/efis[0]/inputs/CHRONO", func(et){ +setlistener("/instrumentation/efis[0]/inputs/CHRONO", func(et){ chrono0 = et.getValue(); if (chrono0 == 1){ chrono_cpt.start(); @@ -149,11 +151,11 @@ setlistener("instrumentation/efis[0]/inputs/CHRONO", func(et){ chrono_cpt.stop(); } elsif (chrono0 == 0) { chrono_cpt.reset(); - setprop("instrumentation/ndchrono[0]/elapsetime-sec", 0); + chrono_cpt_node.setValue(0); } }, 0, 0); -setlistener("instrumentation/efis[1]/inputs/CHRONO", func(et){ +setlistener("/instrumentation/efis[1]/inputs/CHRONO", func(et){ chrono1 = et.getValue(); if (chrono1 == 1){ chrono_fo.start(); @@ -161,11 +163,11 @@ setlistener("instrumentation/efis[1]/inputs/CHRONO", func(et){ chrono_fo.stop(); } elsif (chrono1 == 0) { chrono_fo.reset(); - setprop("instrumentation/ndchrono[1]/elapsetime-sec", 0); + chrono_fo_node.setValue(0); } }, 0, 0); -setlistener("instrumentation/clock/et-selector", func(et){ +setlistener("/instrumentation/clock/et-selector", func(et){ tmp1 = et.getValue(); if (tmp1 == 2){ clk.reset(); @@ -272,37 +274,39 @@ var start_loop = maketimer(0.1, func { } #Cpt Chrono - chr0_tmp = getprop("instrumentation/ndchrono[0]/elapsetime-sec"); + chr0_tmp = chrono_cpt_node.getValue(); if (chr0_tmp >= 360000) { - setprop("instrumentation/ndchrono[0]/elapsetime-sec", getprop("instrumentation/ndchrono[0]/elapsetime-sec") - 360000); - }; + chrono_cpt_node.setValue(chrono_cpt_node.getValue() - 360000); + } + chr0_hh = int(chr0_tmp * 0.000277777777778); chr0_min = int((chr0_tmp * 0.0166666666667) - (chr0_hh * 60)); chr0_sec = int(chr0_tmp - (chr0_min * 60) - (chr0_hh * 3600)); - setprop("instrumentation/ndchrono[0]/etHh_cpt", chr0_hh); - setprop("instrumentation/ndchrono[0]/etMin_cpt", chr0_min); - setprop("instrumentation/ndchrono[0]/etSec_cpt", chr0_sec); + cpt_chrono.etHh_cpt.setValue(chr0_hh); + cpt_chrono.etMin_cpt.setValue(chr0_min); + cpt_chrono.etSec_cpt.setValue(chr0_sec); if (chr0_tmp >= 3600) { - setprop("instrumentation/ndchrono[0]/text", sprintf("%02d H %02d'", chr0_hh, chr0_min)); + cpt_chrono.text.setValue(sprintf("%02d H %02d'", chr0_hh, chr0_min)); } else { - setprop("instrumentation/ndchrono[0]/text", sprintf("%02d' %02d''", chr0_min, chr0_sec)); + cpt_chrono.text.setValue(sprintf("%02d' %02d''", chr0_min, chr0_sec)); } #Fo Chrono - chr1_tmp = getprop("instrumentation/ndchrono[1]/elapsetime-sec"); + chr1_tmp = chrono_fo_node.getValue(); if (chr1_tmp >= 360000) { - setprop("instrumentation/ndchrono[1]/elapsetime-sec", getprop("instrumentation/ndchrono[1]/elapsetime-sec") - 360000); - }; + chrono_fo_node.setValue(chrono_fo_node.getValue() - 360000); + } + chr1_hh = int(chr1_tmp * 0.000277777777778); chr1_min = int(chr1_tmp * 0.0166666666667); chr1_sec = int(chr1_tmp - (chr1_min * 60) - (chr1_hh * 3600)); - setprop("instrumentation/ndchrono[1]/etHh_fo", chr1_hh); - setprop("instrumentation/ndchrono[1]/etMin_fo", chr1_min); - setprop("instrumentation/ndchrono[1]/etSec_fo", chr1_sec); + fo_chrono.etHh_fo.setValue(chr1_hh); + fo_chrono.etMin_fo.setValue(chr1_min); + fo_chrono.etSec_fo.setValue(chr1_sec); if (chr1_tmp >= 3600) { - setprop("instrumentation/ndchrono[1]/text", sprintf("%02d H %02d'", chr1_hh, chr1_min)); + fo_chrono.text.setValue(sprintf("%02d H %02d'", chr1_hh, chr1_min)); } else { - setprop("instrumentation/ndchrono[1]/text", sprintf("%02d' %02d''", chr1_min, chr1_sec)); + fo_chrono.text.setValue(sprintf("%02d' %02d''", chr1_min, chr1_sec)); } }); diff --git a/Nasal/Panels/rmp.nas b/Nasal/Panels/rmp.nas index 022ffb6c..523d0acf 100644 --- a/Nasal/Panels/rmp.nas +++ b/Nasal/Panels/rmp.nas @@ -27,23 +27,23 @@ var chan_rmp1_v = "vhr1"; var chan_rmp2_v = "vhr2"; var chan_rmp3_v = "vhr3"; -var act_vhf1 = props.globals.getNode("instrumentation/comm[0]/frequencies/selected-mhz"); -var act_vhf2 = props.globals.getNode("instrumentation/comm[1]/frequencies/selected-mhz"); -var act_vhf3 = props.globals.getNode("instrumentation/comm[2]/frequencies/selected-mhz"); +var act_vhf1 = props.globals.getNode("/instrumentation/comm[0]/frequencies/selected-mhz"); +var act_vhf2 = props.globals.getNode("/instrumentation/comm[1]/frequencies/selected-mhz"); +var act_vhf3 = props.globals.getNode("/instrumentation/comm[2]/frequencies/selected-mhz"); -var act_ls1 = props.globals.getNode("instrumentation/nav[0]/frequencies/selected-mhz"); -var act_vor1 = props.globals.getNode("instrumentation/nav[2]/frequencies/selected-mhz"); -var act_vor2 = props.globals.getNode("instrumentation/nav[3]/frequencies/selected-mhz"); -var act_adf1 = props.globals.getNode("instrumentation/adf[0]/frequencies/selected-khz"); -var act_adf2 = props.globals.getNode("instrumentation/adf[1]/frequencies/selected-khz"); -var stby_ls1 = props.globals.getNode("instrumentation/nav[0]/frequencies/standby-mhz"); -var stby_vor1 = props.globals.getNode("instrumentation/nav[2]/frequencies/standby-mhz"); -var stby_vor2 = props.globals.getNode("instrumentation/nav[3]/frequencies/standby-mhz"); -var stby_adf1 = props.globals.getNode("instrumentation/adf[0]/frequencies/standby-khz"); -var stby_adf2 = props.globals.getNode("instrumentation/adf[1]/frequencies/standby-khz"); -var act_ls1_crs = props.globals.getNode("instrumentation/nav[0]/radials/selected-deg"); -var act_vor1_crs = props.globals.getNode("instrumentation/nav[2]/radials/selected-deg"); -var act_vor2_crs = props.globals.getNode("instrumentation/nav[3]/radials/selected-deg"); +var act_ls1 = props.globals.getNode("/instrumentation/nav[0]/frequencies/selected-mhz"); +var act_vor1 = props.globals.getNode("/instrumentation/nav[2]/frequencies/selected-mhz"); +var act_vor2 = props.globals.getNode("/instrumentation/nav[3]/frequencies/selected-mhz"); +var act_adf1 = props.globals.getNode("/instrumentation/adf[0]/frequencies/selected-khz"); +var act_adf2 = props.globals.getNode("/instrumentation/adf[1]/frequencies/selected-khz"); +var stby_ls1 = props.globals.getNode("/instrumentation/nav[0]/frequencies/standby-mhz"); +var stby_vor1 = props.globals.getNode("/instrumentation/nav[2]/frequencies/standby-mhz"); +var stby_vor2 = props.globals.getNode("/instrumentation/nav[3]/frequencies/standby-mhz"); +var stby_adf1 = props.globals.getNode("/instrumentation/adf[0]/frequencies/standby-khz"); +var stby_adf2 = props.globals.getNode("/instrumentation/adf[1]/frequencies/standby-khz"); +var act_ls1_crs = props.globals.getNode("/instrumentation/nav[0]/radials/selected-deg"); +var act_vor1_crs = props.globals.getNode("/instrumentation/nav[2]/radials/selected-deg"); +var act_vor2_crs = props.globals.getNode("/instrumentation/nav[3]/radials/selected-deg"); if (rand() > 0.5) { var hf1 = genFourRand(); @@ -149,13 +149,19 @@ var rmpUpdate = func() { } } +var act = nil; +var data_mode = nil; +var sel1 = nil; +var sel2 = nil; +var sel3 = nil; + var update_active_vhf = func(vhf) { - var sel1 = chan_rmp1.getValue(); - var sel2 = chan_rmp2.getValue(); - var sel3 = chan_rmp3.getValue(); + sel1 = chan_rmp1.getValue(); + sel2 = chan_rmp2.getValue(); + sel3 = chan_rmp3.getValue(); if (vhf == 1) { - var act = sprintf("%3.3f", act_vhf1.getValue()); + act = sprintf("%3.3f", act_vhf1.getValue()); if (sel1 == "vhf1") { act_display_rmp1.setValue(act); @@ -167,7 +173,7 @@ var update_active_vhf = func(vhf) { act_display_rmp3.setValue(act); } } else if (vhf == 2) { - var act = sprintf("%3.3f", act_vhf2.getValue()); + act = sprintf("%3.3f", act_vhf2.getValue()); if (sel1 == "vhf2") { act_display_rmp1.setValue(act); @@ -179,8 +185,8 @@ var update_active_vhf = func(vhf) { act_display_rmp3.setValue(act); } } else if (vhf == 3) { - var act = sprintf("%3.3f", act_vhf3.getValue()); - var data_mode = vhf3_data_mode.getValue(); + act = sprintf("%3.3f", act_vhf3.getValue()); + data_mode = vhf3_data_mode.getValue(); if (sel1 == "vhf3") { if (data_mode == 1) { @@ -205,7 +211,7 @@ var update_active_vhf = func(vhf) { } } else if (vhf == 4) { if (sel1 == "hf1" or sel2 == "hf1") { - var act = sprintf("%5.0f", systems.HFS[0].selectedChannelKhz); + act = sprintf("%5.0f", systems.HFS[0].selectedChannelKhz); if (sel1 == "hf1") { act_display_rmp1.setValue(act); @@ -219,7 +225,7 @@ var update_active_vhf = func(vhf) { } } else if (vhf == 5) { if (sel1 == "hf2" or sel2 == "hf2") { - var act = sprintf("%5.0f", systems.HFS[1].selectedChannelKhz); + act = sprintf("%5.0f", systems.HFS[1].selectedChannelKhz); if (sel1 == "hf2") { act_display_rmp1.setValue(act); @@ -279,65 +285,67 @@ var update_displays_nav = func(nav) { } } +var stby = nil; var update_stby_freq = func(rmp_no, freq) { - var data_mode = vhf3_data_mode.getValue(); + data_mode = vhf3_data_mode.getValue(); if (rmp_no == 0) { if (freq == 1) { - var stby = sprintf("%3.3f", stby_rmp1_vhf1.getValue()); + stby = sprintf("%3.3f", stby_rmp1_vhf1.getValue()); } else if (freq == 2) { - var stby = sprintf("%3.3f", stby_rmp1_vhf2.getValue()); + stby = sprintf("%3.3f", stby_rmp1_vhf2.getValue()); } else if (freq == 3) { if (data_mode == 0) { - var stby = "data"; + stby = "data"; } else { - var stby = sprintf("%3.3f", stby_rmp1_vhf3.getValue()); + stby = sprintf("%3.3f", stby_rmp1_vhf3.getValue()); } } else if (freq == 4) { - var stby = sprintf("%5.0f", stby_rmp1_hf1.getValue()); + stby = sprintf("%5.0f", stby_rmp1_hf1.getValue()); } else if (freq == 5) { - var stby = sprintf("%5.0f", stby_rmp1_hf2.getValue()); + stby = sprintf("%5.0f", stby_rmp1_hf2.getValue()); } stby_display_rmp1.setValue(stby); } else if (rmp_no == 1) { if (freq == 1) { - var stby = sprintf("%3.3f", stby_rmp2_vhf1.getValue()); + stby = sprintf("%3.3f", stby_rmp2_vhf1.getValue()); } else if (freq == 2) { - var stby = sprintf("%3.3f", stby_rmp2_vhf2.getValue()); + stby = sprintf("%3.3f", stby_rmp2_vhf2.getValue()); } else if (freq == 3) { if (data_mode == 0) { - var stby = "data"; + stby = "data"; } else { - var stby = sprintf("%3.3f", stby_rmp2_vhf3.getValue()); + stby = sprintf("%3.3f", stby_rmp2_vhf3.getValue()); } } else if (freq == 4) { - var stby = sprintf("%5.0f", stby_rmp2_hf1.getValue()); + stby = sprintf("%5.0f", stby_rmp2_hf1.getValue()); } else if (freq == 5) { - var stby = sprintf("%5.0f", stby_rmp2_hf2.getValue()); + stby = sprintf("%5.0f", stby_rmp2_hf2.getValue()); } stby_display_rmp2.setValue(stby); } else { if (freq == 1) { - var stby = sprintf("%3.3f", stby_rmp3_vhf1.getValue()); + stby = sprintf("%3.3f", stby_rmp3_vhf1.getValue()); } else if (freq == 2) { - var stby = sprintf("%3.3f", stby_rmp3_vhf2.getValue()); + stby = sprintf("%3.3f", stby_rmp3_vhf2.getValue()); } else if (freq == 3) { if (data_mode == 0) { - var stby = "data"; + stby = "data"; } else { - var stby = sprintf("%3.3f", stby_rmp3_vhf3.getValue()); + stby = sprintf("%3.3f", stby_rmp3_vhf3.getValue()); } } else if (freq == 4) { - var stby = sprintf("%5.0f", stby_rmp3_hf1.getValue()); + stby = sprintf("%5.0f", stby_rmp3_hf1.getValue()); } else if (freq == 5) { - var stby = sprintf("%5.0f", stby_rmp3_hf2.getValue()); + stby = sprintf("%5.0f", stby_rmp3_hf2.getValue()); } stby_display_rmp3.setValue(stby); } } +var chan = nil; var update_chan_sel = func(rmp_no) { update_active_vhf(1); update_active_vhf(2); @@ -350,7 +358,7 @@ var update_chan_sel = func(rmp_no) { update_displays_nav(rmp_no + 5); if (rmp_no == 0) { - var chan = chan_rmp1.getValue(); + chan = chan_rmp1.getValue(); if (chan == "vhf1") { update_stby_freq(rmp_no, 1); } else if (chan == "vhf2") { @@ -363,7 +371,7 @@ var update_chan_sel = func(rmp_no) { update_stby_freq(rmp_no, 5); } } else if (rmp_no == 1) { - var chan = chan_rmp2.getValue(); + chan = chan_rmp2.getValue(); if (chan == "vhf1") { update_stby_freq(rmp_no, 1); } else if (chan == "vhf2") { @@ -376,7 +384,7 @@ var update_chan_sel = func(rmp_no) { update_stby_freq(rmp_no, 5); } } else { - var chan = chan_rmp3.getValue(); + chan = chan_rmp3.getValue(); if (chan == "vhf1") { update_stby_freq(rmp_no, 1); } else if (chan == "vhf2") { @@ -391,13 +399,19 @@ var update_chan_sel = func(rmp_no) { } } +var sel_chan = nil; +var sel_crs = nil; +var mod1 = nil; +var mod = nil; +var mem = nil; + 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"); + sel_chan = getprop("/systems/radio/rmp[" ~ rmp_no ~ "]/sel_chan"); + sel_crs = getprop("/systems/radio/rmp[" ~ rmp_no ~ "]/select-crs"); if (string.match(sel_chan, "vhf[1-3]")) { - var data_mode = vhf3_data_mode.getValue(); + data_mode = vhf3_data_mode.getValue(); if (string.match(sel_chan, "vhf3")) { if (data_mode == 0) { vhf3_data_mode.setValue(1); @@ -415,41 +429,41 @@ var transfer = func(rmp_no) { update_stby_freq(2, 3); } } - var mod1 = int(string.replace(sel_chan, "vhf", "")); - var mod = mod1 - 1; + mod1 = int(string.replace(sel_chan, "vhf", "")); + 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")); + 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); } elsif (string.match(sel_chan, "hf[1-2]")) { - var mod1 = int(string.replace(sel_chan, "hf", "")); - var mod = mod1 - 1; + mod1 = int(string.replace(sel_chan, "hf", "")); + mod = mod1 - 1; - var mem = systems.HFS[mod].selectedChannelKhz; + 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); } 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")); - setprop("instrumentation/adf[" ~ rmp_no ~ "]/frequencies/standby-khz", mem); + 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")); + setprop("/instrumentation/adf[" ~ rmp_no ~ "]/frequencies/standby-khz", mem); update_displays_nav(rmp_no + 5); } 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("/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); 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("/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); 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("/instrumentation/nav[0]/frequencies/standby-mhz", getprop("/instrumentation/nav[0]/frequencies/selected-mhz")); 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("/instrumentation/nav[0]/frequencies/selected-mhz", getprop("/instrumentation/nav[0]/frequencies/standby-mhz")); setprop("/systems/radio/rmp[" ~ rmp_no ~ "]/select-crs", 1); update_displays_nav(1); } From 49f994beceaff52bef81dce426f72778aa5a6bfa Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Wed, 9 Jun 2021 13:19:52 +0100 Subject: [PATCH 22/96] ADF radio: implement BFO mode such that it will allow the ident to be heard with backup nav --- Nasal/Panels/rmp.nas | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Nasal/Panels/rmp.nas b/Nasal/Panels/rmp.nas index 523d0acf..0615a7b7 100644 --- a/Nasal/Panels/rmp.nas +++ b/Nasal/Panels/rmp.nas @@ -489,6 +489,21 @@ var change_nav_mode = func(rmp_nr, nav_mode) { } } +# ADF Radio: Implement BFO such that you will hear audio +var BFOActive = [props.globals.getNode("/systems/radio/rmp[0]/bfo-active"),props.globals.getNode("/systems/radio/rmp[1]/bfo-active")]; +var ADFIdent = [props.globals.getNode("/instrumentation/adf[0]/ident-audible"),props.globals.getNode("/instrumentation/adf[1]/ident-audible")]; +var ADFMode = [props.globals.getNode("/instrumentation/adf[0]/mode"),props.globals.getNode("/instrumentation/adf[1]/mode")]; + +setlistener("/systems/radio/rmp[0]/bfo-active", func (val) { + ADFIdent[0].setValue(val.getValue()); + ADFMode[0].setValue(val.getValue() == 1 ? "bfo" : "adf"); +},0,0); + +setlistener("/systems/radio/rmp[1]/bfo-active", func (val) { + ADFIdent[1].setValue(val.getValue()); + ADFMode[1].setValue(val.getValue() == 1 ? "bfo" : "adf"); +},0,0); + setlistener("/systems/radio/rmp[0]/vhf1-standby", func { update_stby_freq(0, 1); }); @@ -627,9 +642,11 @@ setlistener("/instrumentation/nav[3]/radials/selected-deg", func { setlistener("/systems/radio/rmp[0]/nav", func(nav_mode) { change_nav_mode(1, nav_mode); + if (nav_mode.getValue() == 0) { BFOActive[0].setValue(0); } }); setlistener("/systems/radio/rmp[1]/nav", func(nav_mode) { change_nav_mode(2, nav_mode); + if (nav_mode.getValue() == 0) { BFOActive[1].setValue(0); } }); From 51e82aeb0956c1964602c49120d46d003930f5e4 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Wed, 9 Jun 2021 17:20:19 +0100 Subject: [PATCH 23/96] FCU code: use ITAF nodes rather than own nodes --- Nasal/FMGC/FCU.nas | 356 +++++++++++++++++++++------------------------ 1 file changed, 169 insertions(+), 187 deletions(-) diff --git a/Nasal/FMGC/FCU.nas b/Nasal/FMGC/FCU.nas index 2ca20a91..30ba98a1 100644 --- a/Nasal/FMGC/FCU.nas +++ b/Nasal/FMGC/FCU.nas @@ -2,37 +2,11 @@ # Copyright (c) 2020 Josh Davidson (Octal450), Jonathan Redpath (legoboyvdlp) # Nodes -var fd1 = props.globals.getNode("/it-autoflight/output/fd1", 1); -var fd2 = props.globals.getNode("/it-autoflight/output/fd2", 1); -var ap1 = props.globals.getNode("/it-autoflight/output/ap1", 1); -var ap2 = props.globals.getNode("/it-autoflight/output/ap2", 1); -var athr = props.globals.getNode("/it-autoflight/output/athr", 1); -var fd1Input = props.globals.getNode("/it-autoflight/input/fd1", 1); -var fd2Input = props.globals.getNode("/it-autoflight/input/fd2", 1); -var ap1Input = props.globals.getNode("/it-autoflight/input/ap1", 1); -var ap2Input = props.globals.getNode("/it-autoflight/input/ap2", 1); -var athrInput = props.globals.getNode("/it-autoflight/input/athr", 1); -var ktsMach = props.globals.getNode("/it-autoflight/input/kts-mach", 1); -var iasSet = props.globals.getNode("/it-autoflight/input/kts", 1); -var machSet = props.globals.getNode("/it-autoflight/input/mach", 1); -var hdgSet = props.globals.getNode("/it-autoflight/input/hdg", 1); -var altSet = props.globals.getNode("/it-autoflight/input/alt", 1); var altSetMode = props.globals.getNode("/it-autoflight/config/altitude-dial-mode", 1); -var vsSet = props.globals.getNode("/it-autoflight/input/vs", 1); -var fpaSet = props.globals.getNode("/it-autoflight/input/fpa", 1); -var iasNow = props.globals.getNode("/instrumentation/airspeed-indicator/indicated-speed-kt", 1); -var machNow = props.globals.getNode("/instrumentation/airspeed-indicator/indicated-mach", 1); -var spdManaged = props.globals.getNode("/it-autoflight/input/spd-managed", 1); -var showHDG = props.globals.getNode("/it-autoflight/custom/show-hdg", 1); -var trkFpaSW = props.globals.getNode("/it-autoflight/custom/trk-fpa", 1); -var latMode = props.globals.getNode("/it-autoflight/output/lat", 1); -var vertMode = props.globals.getNode("/it-autoflight/output/vert", 1); -var fpaModeInput = props.globals.getNode("/it-autoflight/input/fpa", 1); -var latModeInput = props.globals.getNode("/it-autoflight/input/lat", 1); -var vertModeInput = props.globals.getNode("/it-autoflight/input/vert", 1); -var vsModeInput = props.globals.getNode("/it-autoflight/input/vs", 1); -var locArm = props.globals.getNode("/it-autoflight/output/loc-armed", 1); -var apprArm = props.globals.getNode("/it-autoflight/output/appr-armed", 1); +var apOffSound = [props.globals.getNode("/it-autoflight/sound/apoffsound"),props.globals.getNode("/it-autoflight/sound/apoffsound2")]; +var apWarningNode = props.globals.getNode("/it-autoflight/output/ap-warning"); +var athrWarningNode = props.globals.getNode("/it-autoflight/output/athr-warning"); +var apDiscBtn = props.globals.getNode("/sim/sounde/apdiscbtn"); var FCUworkingNode = props.globals.initNode("/FMGC/FCU-working", 0, "BOOL"); var FCU = { @@ -99,8 +73,8 @@ var FCUController = { }, AP1: func() { if (me.FCUworking) { - if (!ap1.getBoolValue() and fbw.FBW.apOff == 0) { - ap1Input.setValue(1); + if (!fmgc.Output.ap1.getBoolValue() and fbw.FBW.apOff == 0) { + fmgc.Input.ap1.setValue(1); ecam.apWarnNode.setValue(0); pts.Controls.Flight.rudderTrim.setValue(0); } else { @@ -110,8 +84,8 @@ var FCUController = { }, AP2: func() { if (me.FCUworking) { - if (!ap2.getBoolValue() and fbw.FBW.apOff == 0) { - ap2Input.setValue(1); + if (!fmgc.Output.ap2.getBoolValue() and fbw.FBW.apOff == 0) { + fmgc.Input.ap2.setValue(1); ecam.apWarnNode.setValue(0); pts.Controls.Flight.rudderTrim.setValue(0); } else { @@ -121,8 +95,8 @@ var FCUController = { }, ATHR: func() { if (me.FCUworking) { - if (!athr.getBoolValue() and !pts.FMGC.CasCompare.casRejectAll.getBoolValue() and fbw.FBW.apOff == 0) { - athrInput.setValue(1); + if (!fmgc.Output.athr.getBoolValue() and !pts.FMGC.CasCompare.casRejectAll.getBoolValue() and fbw.FBW.apOff == 0) { + fmgc.Input.athr.setValue(1); } else { athrOff("hard"); } @@ -130,7 +104,7 @@ var FCUController = { }, FD1: func() { if (me.FCUworking) { - if (!fd1.getBoolValue()) { + if (!fmgc.Output.fd1.getBoolValue()) { fd1Input.setValue(1); } else { fd1Input.setValue(0); @@ -139,7 +113,7 @@ var FCUController = { }, FD2: func() { if (me.FCUworking) { - if (!fd2.getBoolValue()) { + if (!fmgc.Output.fd2.getBoolValue()) { fd2Input.setValue(1); } else { fd2Input.setValue(0); @@ -148,21 +122,21 @@ var FCUController = { }, APDisc: func() { # physical button sound - so put it outside here as you get a sound even if it doesn't work! - setprop("/sim/sounde/apdiscbtn", 1); + apDiscBtn.setValue(1); settimer(func { - setprop("/sim/sounde/apdiscbtn", 0); + apDiscBtn.setValue(0); }, 0.5); if (me.FCUworking) { - if (ap1.getBoolValue() or ap2.getBoolValue()) { + if (fmgc.Output.ap1.getBoolValue() or fmgc.Output.ap2.getBoolValue()) { apOff("soft", 0); } else { - if (getprop("/it-autoflight/sound/apoffsound") == 1 or getprop("/it-autoflight/sound/apoffsound2") == 1) { - setprop("/it-autoflight/sound/apoffsound", 0); - setprop("/it-autoflight/sound/apoffsound2", 0); + if (apOffSound[0].getValue() or apOffSound[1].getValue()) { + apOffSound[0].setValue(0); + apOffSound[1].setValue(0); } - if (getprop("/it-autoflight/output/ap-warning") != 0) { - setprop("/it-autoflight/output/ap-warning", 0); + if (apWarningNode.getValue() != 0) { + apWarningNode.setValue(0); ecam.lights[0].setValue(0); } } @@ -170,18 +144,18 @@ var FCUController = { }, ATDisc: func() { # physical button sound - so put it outside here as you get a sound even if it doesn't work! - setprop("/sim/sounde/apdiscbtn", 1); + apDiscBtn.setValue(1); settimer(func { - setprop("/sim/sounde/apdiscbtn", 0); + apDiscBtn.setValue(0); }, 0.5); if (me.FCUworking) { - if (athr.getBoolValue()) { + if (fmgc.Output.athr.getBoolValue()) { athrOff("soft"); ecam.lights[1].setValue(1); } else { - if (getprop("/it-autoflight/output/athr-warning") == 1) { - setprop("/it-autoflight/output/athr-warning", 0); + if (athrWarningNode.getValue() == 1) { + athrWarningNode.setValue(0); ecam.lights[1].setValue(0); } } @@ -189,84 +163,88 @@ var FCUController = { }, IASMach: func() { if (me.FCUworking) { - if (ktsMach.getBoolValue()) { - ktsMach.setBoolValue(0); + if (fmgc.Input.ktsMach.getBoolValue()) { + fmgc.Input.ktsMach.setBoolValue(0); } else { - ktsMach.setBoolValue(1); + fmgc.Input.ktsMach.setBoolValue(1); } } }, SPDPush: func() { if (me.FCUworking) { if (fmgc.FMGCInternal.crzSet and fmgc.FMGCInternal.costIndexSet) { - spdManaged.setBoolValue(1); + fmgc.Custom.Input.spdManaged.setBoolValue(1); fmgc.ManagedSPD.start(); } } }, + ias: nil, + mach: nil, SPDPull: func() { if (me.FCUworking) { - spdManaged.setBoolValue(0); + fmgc.Custom.Input.spdManaged.setBoolValue(0); fmgc.ManagedSPD.stop(); - var ias = iasNow.getValue(); - var mach = machNow.getValue(); - if (!ktsMach.getBoolValue()) { - if (ias >= 100 and ias <= 350) { - iasSet.setValue(math.round(ias)); - } else if (ias < 100) { - iasSet.setValue(100); - } else if (ias > 350) { - iasSet.setValue(350); + me.ias = fmgc.Velocities.indicatedAirspeedKt.getValue(); + me.mach = fmgc.Velocities.indicatedMach.getValue(); + if (!fmgc.Input.ktsMach.getBoolValue()) { + if (me.ias >= 100 and me.ias <= 350) { + fmgc.Input.kts.setValue(math.round(me.ias)); + } else if (me.ias < 100) { + fmgc.Input.kts.setValue(100); + } else if (me.ias > 350) { + fmgc.Input.kts.setValue(350); } - } else if (ktsMach.getBoolValue()) { - if (mach >= 0.50 and mach <= 0.82) { - machSet.setValue(math.round(mach, 0.001)); - } else if (mach < 0.50) { - machSet.setValue(0.50); - } else if (mach > 0.82) { - machSet.setValue(0.82); + } else if (fmgc.Input.ktsMach.getBoolValue()) { + if (me.mach >= 0.50 and me.mach <= 0.82) { + fmgc.Input.mach.setValue(math.round(me.mach, 0.001)); + } else if (me.mach < 0.50) { + fmgc.Input.mach.setValue(0.50); + } else if (me.mach > 0.82) { + fmgc.Input.mach.setValue(0.82); } } } }, + machTemp: nil, + iasTemp: nil, SPDAdjust: func(d) { if (me.FCUworking) { - if (!spdManaged.getBoolValue()) { - if (ktsMach.getBoolValue()) { - var machTemp = machSet.getValue(); + if (!fmgc.Custom.Input.spdManaged.getBoolValue()) { + if (fmgc.Input.ktsMach.getBoolValue()) { + me.machTemp = fmgc.Input.mach.getValue(); if (d == 1) { - machTemp = math.round(machTemp + 0.001, 0.001); # Kill floating point error + me.machTemp = math.round(me.machTemp + 0.001, 0.001); # Kill floating point error } else if (d == -1) { - machTemp = math.round(machTemp - 0.001, 0.001); # Kill floating point error + me.machTemp = math.round(me.machTemp - 0.001, 0.001); # Kill floating point error } else if (d == 10) { - machTemp = math.round(machTemp + 0.01, 0.01); # Kill floating point error + me.machTemp = math.round(me.machTemp + 0.01, 0.01); # Kill floating point error } else if (d == -10) { - machTemp = math.round(machTemp - 0.01, 0.01); # Kill floating point error + me.machTemp = math.round(me.machTemp - 0.01, 0.01); # Kill floating point error } - if (machTemp < 0.50) { - machSet.setValue(0.50); - } else if (machTemp > 0.82) { - machSet.setValue(0.82); + if (me.machTemp < 0.50) { + fmgc.Input.mach.setValue(0.50); + } else if (me.machTemp > 0.82) { + fmgc.Input.mach.setValue(0.82); } else { - machSet.setValue(machTemp); + fmgc.Input.mach.setValue(me.machTemp); } } else { - var iasTemp = iasSet.getValue(); + me.iasTemp = fmgc.Input.kts.getValue(); if (d == 1) { - iasTemp = iasTemp + 1; + me.iasTemp = me.iasTemp + 1; } else if (d == -1) { - iasTemp = iasTemp - 1; + me.iasTemp = me.iasTemp - 1; } else if (d == 10) { - iasTemp = iasTemp + 10; + me.iasTemp = me.iasTemp + 10; } else if (d == -10) { - iasTemp = iasTemp - 10; + me.iasTemp = me.iasTemp - 10; } - if (iasTemp < 100) { - iasSet.setValue(100); - } else if (iasTemp > 350) { - iasSet.setValue(350); + if (me.iasTemp < 100) { + fmgc.Input.kts.setValue(100); + } else if (me.iasTemp > 350) { + fmgc.Input.kts.setValue(350); } else { - iasSet.setValue(iasTemp); + fmgc.Input.kts.setValue(me.iasTemp); } } } @@ -274,66 +252,68 @@ var FCUController = { }, HDGPush: func() { if (me.FCUworking) { - if (fd1.getBoolValue() or fd2.getBoolValue() or ap1.getBoolValue() or ap2.getBoolValue()) { - latModeInput.setValue(1); + if (fmgc.Output.fd1.getBoolValue() or fmgc.Output.fd2.getBoolValue() or fmgc.Output.ap1.getBoolValue() or fmgc.Output.ap2.getBoolValue()) { + fmgc.Input.lat.setValue(1); } } }, HDGPull: func() { if (me.FCUworking) { - if (fd1.getBoolValue() or fd2.getBoolValue() or ap1.getBoolValue() or ap2.getBoolValue()) { - if (latMode.getValue() == 0 or !showHDG.getBoolValue()) { - latModeInput.setValue(3); + if (fmgc.Output.fd1.getBoolValue() or fmgc.Output.fd2.getBoolValue() or fmgc.Output.ap1.getBoolValue() or fmgc.Output.ap2.getBoolValue()) { + if (fmgc.Output.lat.getValue() == 0 or !fmgc.Custom.showHdg.getBoolValue()) { + fmgc.Input.lat.setValue(3); } else { - latModeInput.setValue(0); + fmgc.Input.lat.setValue(0); } } } }, + hdgTemp: nil, HDGAdjust: func(d) { if (me.FCUworking) { - if (latMode.getValue() != 0) { + if (fmgc.Output.lat.getValue() != 0) { hdgInput(); } - if (showHDG.getBoolValue()) { - var hdgTemp = hdgSet.getValue(); + if (fmgc.Custom.showHdg.getBoolValue()) { + me.hdgTemp = fmgc.Input.hdg.getValue(); if (d == 1) { - hdgTemp = hdgTemp + 1; + me.hdgTemp = me.hdgTemp + 1; } else if (d == -1) { - hdgTemp = hdgTemp - 1; + me.hdgTemp = me.hdgTemp - 1; } else if (d == 10) { - hdgTemp = hdgTemp + 10; + me.hdgTemp = me.hdgTemp + 10; } else if (d == -10) { - hdgTemp = hdgTemp - 10; + me.hdgTemp = me.hdgTemp - 10; } - if (hdgTemp < 0.5) { - hdgSet.setValue(hdgTemp + 360); - } else if (hdgTemp >= 360.5) { - hdgSet.setValue(hdgTemp - 360); + if (me.hdgTemp < 0.5) { + fmgc.Input.hdg.setValue(me.hdgTemp + 360); + } else if (me.hdgTemp >= 360.5) { + fmgc.Input.hdg.setValue(me.hdgTemp - 360); } else { - hdgSet.setValue(hdgTemp); + fmgc.Input.hdg.setValue(me.hdgTemp); } } } }, + vertTemp: nil, LOCButton: func() { if (me.FCUworking) { - var vertTemp = vertMode.getValue(); - if ((locArm.getBoolValue() or latMode.getValue() == 2) and !apprArm.getBoolValue() and vertTemp != 2 and vertTemp != 6) { - if (latMode.getValue() == 2) { - latModeInput.setValue(0); + me.vertTemp = fmgc.Output.vert.getValue(); + if ((fmgc.Output.locArm.getBoolValue() or fmgc.Output.lat.getValue() == 2) and !fmgc.Output.apprArm.getBoolValue() and me.vertTemp != 2 and me.vertTemp != 6) { + if (fmgc.Output.lat.getValue() == 2) { + fmgc.Input.lat.setValue(0); } else { fmgc.ITAF.disarmLOC(); } - if (vertTemp == 2 or vertTemp == 6) { + if (me.vertTemp == 2 or me.vertTemp == 6) { me.VSPull(); } else { fmgc.ITAF.disarmGS(); } } else { - if (pts.Position.gearAglFt.getValue() >= 400 and vertTemp != 7) { - latModeInput.setValue(2); - if (vertTemp == 2 or vertTemp == 6) { + if (pts.Position.gearAglFt.getValue() >= 400 and me.vertTemp != 7) { + fmgc.Input.lat.setValue(2); + if (me.vertTemp == 2 or me.vertTemp == 6) { me.VSPull(); } else { fmgc.ITAF.disarmGS(); @@ -354,123 +334,126 @@ var FCUController = { }, ALTPull: func() { if (me.FCUworking) { - vertModeInput.setValue(4); + fmgc.Input.vert.setValue(4); } }, + altTemp: nil, ALTAdjust: func(d) { if (me.FCUworking) { - var altTemp = altSet.getValue(); + me.altTemp = fmgc.Input.alt.getValue(); if (d == 1) { if (altSetMode.getBoolValue()) { - altTemp = altTemp + 1000; + me.altTemp = me.altTemp + 1000; } else { - altTemp = altTemp + 100; + me.altTemp = me.altTemp + 100; } } else if (d == -1) { if (altSetMode.getBoolValue()) { - altTemp = altTemp - 1000; + me.altTemp = me.altTemp - 1000; } else { - altTemp = altTemp - 100; + me.altTemp = me.altTemp - 100; } } else if (d == 2) { - altTemp = altTemp + 100; + me.altTemp = me.altTemp + 100; } else if (d == -2) { - altTemp = altTemp - 100; + me.altTemp = me.altTemp - 100; } else if (d == 10) { - altTemp = altTemp + 1000; + me.altTemp = me.altTemp + 1000; } else if (d == -10) { - altTemp = altTemp - 1000; + me.altTemp = me.altTemp - 1000; } - if (altTemp < 100) { - altSet.setValue(100); - } else if (altTemp > 49000) { - altSet.setValue(49000); + if (me.altTemp < 100) { + fmgc.Input.alt.setValue(100); + } else if (me.altTemp > 49000) { + fmgc.Input.alt.setValue(49000); } else { - altSet.setValue(altTemp); + fmgc.Input.alt.setValue(me.altTemp); } } }, VSPush: func() { if (me.FCUworking) { - if (trkFpaSW.getBoolValue()) { - vertModeInput.setValue(5); - fpaModeInput.setValue(0); + if (fmgc.Custom.trkFpa.getBoolValue()) { + fmgc.Input.vert.setValue(5); + fmgc.Input.fpa.setValue(0); } else { - vertModeInput.setValue(1); - vsModeInput.setValue(0); + fmgc.Input.vert.setValue(1); + fmgc.Input.vs.setValue(0); } } }, VSPull: func() { if (me.FCUworking) { - if (trkFpaSW.getBoolValue()) { - vertModeInput.setValue(5); + if (fmgc.Custom.trkFpa.getBoolValue()) { + fmgc.Input.vert.setValue(5); } else { - vertModeInput.setValue(1); + fmgc.Input.vert.setValue(1); } } }, + vsTemp: nil, + fpaTemp: nil, VSAdjust: func(d) { if (me.FCUworking) { - if (vertMode.getValue() == 1) { - var vsTemp = vsSet.getValue(); + if (fmgc.Output.vert.getValue() == 1) { + me.vsTemp = fmgc.Input.vs.getValue(); if (d == 1) { - vsTemp = vsTemp + 100; + me.vsTemp = me.vsTemp + 100; } else if (d == -1) { - vsTemp = vsTemp - 100; + me.vsTemp = me.vsTemp - 100; } else if (d == 10) { - vsTemp = vsTemp + 1000; + me.vsTemp = me.vsTemp + 1000; } else if (d == -10) { - vsTemp = vsTemp - 1000; + me.vsTemp = me.vsTemp - 1000; } - if (vsTemp < -6000) { - vsSet.setValue(-6000); - } else if (vsTemp > 6000) { - vsSet.setValue(6000); + if (me.vsTemp < -6000) { + fmgc.Input.vs.setValue(-6000); + } else if (me.vsTemp > 6000) { + fmgc.Input.vs.setValue(6000); } else { - vsSet.setValue(vsTemp); + fmgc.Input.vs.setValue(me.vsTemp); } - } else if (vertMode.getValue() == 5) { - var fpaTemp = fpaSet.getValue(); + } else if (fmgc.Output.vert.getValue() == 5) { + me.fpaTemp = fmgc.Input.fpa.getValue(); if (d == 1) { - fpaTemp = math.round(fpaTemp + 0.1, 0.1); + me.fpaTemp = math.round(me.fpaTemp + 0.1, 0.1); } else if (d == -1) { - fpaTemp = math.round(fpaTemp - 0.1, 0.1); + me.fpaTemp = math.round(me.fpaTemp - 0.1, 0.1); } else if (d == 10) { - fpaTemp = fpaTemp + 1; + me.fpaTemp = me.fpaTemp + 1; } else if (d == -10) { - fpaTemp = fpaTemp - 1; + me.fpaTemp = me.fpaTemp - 1; } - if (fpaTemp < -9.9) { - fpaSet.setValue(-9.9); - } else if (fpaTemp > 9.9) { - fpaSet.setValue(9.9); + if (me.fpaTemp < -9.9) { + fmgc.Input.fpa.setValue(-9.9); + } else if (me.fpaTemp > 9.9) { + fmgc.Input.fpa.setValue(9.9); } else { - fpaSet.setValue(fpaTemp); + fmgc.Input.fpa.setValue(me.fpaTemp); } } - if ((vertMode.getValue() != 1 and !trkFpaSW.getBoolValue()) or (vertMode.getValue() != 5 and trkFpaSW.getBoolValue())) { + if ((fmgc.Output.vert.getValue() != 1 and !fmgc.Custom.trkFpa.getBoolValue()) or (fmgc.Output.vert.getValue() != 5 and fmgc.Custom.trkFpa.getBoolValue())) { me.VSPull(); } } }, APPRButton: func() { if (me.FCUworking) { - var vertTemp = vertMode.getValue(); - if ((locArm.getBoolValue() or latMode.getValue() == 2) and (apprArm.getBoolValue() or vertTemp == 2 or vertTemp == 6)) { - if (latMode.getValue() == 2) { - latModeInput.setValue(0); + me.vertTemp = fmgc.Output.vert.getValue(); + if ((fmgc.Output.locArm.getBoolValue() or fmgc.Output.lat.getValue() == 2) and (fmgc.Output.apprArm.getBoolValue() or me.vertTemp == 2 or me.vertTemp == 6)) { + if (fmgc.Output.lat.getValue() == 2) { + fmgc.Input.lat.setValue(0); } else { fmgc.ITAF.disarmLOC(); } - if (vertTemp == 2 or vertTemp == 6) { + if (me.vertTemp == 2 or me.vertTemp == 6) { me.VSPull(); } else { fmgc.ITAF.disarmGS(); } } else { - if (pts.Position.gearAglFt.getValue() >= 400 and vertTemp != 7) { - vertModeInput.setValue(2); + if (pts.Position.gearAglFt.getValue() >= 400 and me.vertTemp != 7) { + fmgc.Input.vert.setValue(2); } } } @@ -479,13 +462,13 @@ var FCUController = { # Master / slave principle of operation depending on the autopilot / flight director engagement var updateActiveFMGC = func { - if (ap1.getBoolValue()) { + if (fmgc.Output.ap1.getBoolValue()) { FCUController.activeFMGC.setValue(1); - } elsif (ap2.getBoolValue()) { + } elsif (fmgc.Output.ap2.getBoolValue()) { FCUController.activeFMGC.setValue(2); - } elsif (fd1.getBoolValue()) { + } elsif (fmgc.Output.fd1.getBoolValue()) { FCUController.activeFMGC.setValue(1); - } elsif (fd2.getBoolValue()) { + } elsif (fmgc.Output.fd2.getBoolValue()) { FCUController.activeFMGC.setValue(2); } else { FCUController.activeFMGC.setValue(1); @@ -494,36 +477,35 @@ var updateActiveFMGC = func { # Autopilot Disconnection var apOff = func(type, side) { - if ((ap1Input.getValue() and (side == 1 or side == 0)) or (ap2Input.getValue() and (side == 2 or side == 0))) { + if ((fmgc.Input.ap1.getValue() and (side == 1 or side == 0)) or (fmgc.Input.ap2.getValue() and (side == 2 or side == 0))) { ecam.doApWarn(type); } if (side == 0) { - ap1Input.setValue(0); - ap2Input.setValue(0); + fmgc.Input.ap1.setValue(0); + fmgc.Input.ap2.setValue(0); } elsif (side == 1) { - ap1Input.setValue(0); + fmgc.Input.ap1.setValue(0); } elsif (side == 2) { - ap2Input.setValue(0); + fmgc.Input.ap2.setValue(0); } } # Autothrust Disconnection var athrOff = func(type) { - if (athrInput.getValue() == 1) { + if (fmgc.Input.athr.getValue() == 1) { if (type == "hard") { fadec.lockThr(); } - athrInput.setValue(0); + fmgc.Input.athr.setValue(0); ecam.doAthrWarn(type); } } # If the heading knob is turned while in nav mode, it will display heading for a period of time var hdgInput = func { - if (latMode.getValue() != 0) { - showHDG.setBoolValue(1); - var hdgnow = fmgc.Input.hdg.getValue(); + if (fmgc.Output.lat.getValue() != 0) { + fmgc.Custom.showHdg.setBoolValue(1); fmgc.Custom.hdgTime.setValue(pts.Sim.Time.elapsedSec.getValue()); } } From 35ddbf04264f2e40475d82af0ce4c04ce37f1bf5 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Wed, 9 Jun 2021 17:25:17 +0100 Subject: [PATCH 24/96] Some extra PTS --- AircraftConfig/acconfig.nas | 8 ++++---- Nasal/FMGC/SimbriefParser.nas | 4 ++-- Nasal/FMGC/flightplan-waypoints.nas | 4 ++-- Nasal/FMGC/winds.nas | 4 ++-- Nasal/Libraries/property-tree-setup.nas | 2 ++ 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/AircraftConfig/acconfig.nas b/AircraftConfig/acconfig.nas index 5f4419c4..205c4dae 100644 --- a/AircraftConfig/acconfig.nas +++ b/AircraftConfig/acconfig.nas @@ -158,7 +158,7 @@ setlistener("/sim/signals/fdm-initialized", func { writeSettings(); if (getprop("/options/system/save-state") == 1) { - save.restore(save.default, getprop("/sim/fg-home") ~ "/Export/" ~ getprop("/sim/aircraft") ~ "-save.xml"); + save.restore(save.default, pts.Sim.fgHome.getValue() ~ "/Export/" ~ pts.Sim.aircraft.getValue() ~ "-save.xml"); } if (getprop("/options/system/fo-view") == 1) { @@ -169,7 +169,7 @@ setlistener("/sim/signals/fdm-initialized", func { }); setlistener("/sim/signals/exit", func { - save.save(save.default, getprop("/sim/fg-home") ~ "/Export/" ~ getprop("/sim/aircraft") ~ "-save.xml"); + save.save(save.default, pts.Sim.fgHome.getValue() ~ "/Export/" ~ pts.Sim.aircraft.getValue() ~ "-save.xml"); }); var renderingSettings = { @@ -202,7 +202,7 @@ var renderingSettings = { }; var readSettings = func { - io.read_properties(getprop("/sim/fg-home") ~ "/Export/A320-family-config.xml", "/systems/acconfig/options"); + io.read_properties(pts.Sim.fgHome.getValue() ~ "/Export/A320-family-config.xml", "/systems/acconfig/options"); setprop("/options/system/keyboard-mode", getprop("/systems/acconfig/options/keyboard-mode")); setprop("/options/system/weight-kgs", getprop("/systems/acconfig/options/weight-kgs")); setprop("/options/system/save-state", getprop("/systems/acconfig/options/save-state")); @@ -228,7 +228,7 @@ var writeSettings = func { setprop("/systems/acconfig/options/simbrief-username", getprop("/FMGC/simbrief-username")); setprop("/systems/acconfig/options/atis-server", getprop("/systems/atsu/atis-server")); setprop("/systems/acconfig/options/wxr-server", getprop("/systems/atsu/wxr-server")); - io.write_properties(getprop("/sim/fg-home") ~ "/Export/A320-family-config.xml", "/systems/acconfig/options"); + io.write_properties(pts.Sim.fgHome.getValue() ~ "/Export/A320-family-config.xml", "/systems/acconfig/options"); } ################ diff --git a/Nasal/FMGC/SimbriefParser.nas b/Nasal/FMGC/SimbriefParser.nas index 9c4b7d21..8fa4136f 100644 --- a/Nasal/FMGC/SimbriefParser.nas +++ b/Nasal/FMGC/SimbriefParser.nas @@ -13,11 +13,11 @@ var SimbriefParser = { fetch: func(username, i) { me.inhibit = 1; var stamp = systime(); - http.save("https://www.simbrief.com/api/xml.fetcher.php?username=" ~ username, getprop('/sim/fg-home') ~ "/Export/A320-family-simbrief.xml") + http.save("https://www.simbrief.com/api/xml.fetcher.php?username=" ~ username, pts.Sim.fgHome.getValue() ~ "/Export/A320-family-simbrief.xml") .fail(func { me.failure(i) }) .done(func { var errs = []; - call(me.read, [(getprop('/sim/fg-home') ~ "/Export/A320-family-simbrief.xml"),i], SimbriefParser, {}, errs); + call(me.read, [(pts.Sim.fgHome.getValue() ~ "/Export/A320-family-simbrief.xml"),i], SimbriefParser, {}, errs); if (size(errs) > 0) { debug.printerror(errs); me.failure(i); diff --git a/Nasal/FMGC/flightplan-waypoints.nas b/Nasal/FMGC/flightplan-waypoints.nas index a7808639..24319dc0 100644 --- a/Nasal/FMGC/flightplan-waypoints.nas +++ b/Nasal/FMGC/flightplan-waypoints.nas @@ -160,7 +160,7 @@ var WaypointDatabase = { }, # write - write to file, as a hash structure write: func() { - var path = getprop("/sim/fg-home") ~ "/Export/A320SavedWaypoints.xml"; + var path = pts.Sim.fgHome.getValue() ~ "/Export/A320SavedWaypoints.xml"; var tree = { waypoints: { @@ -177,7 +177,7 @@ var WaypointDatabase = { }, # read - read from a file, extract using props interface read: func() { - var path = getprop("/sim/fg-home") ~ "/Export/A320SavedWaypoints.xml"; + var path = pts.Sim.fgHome.getValue() ~ "/Export/A320SavedWaypoints.xml"; # create file if it doesn't exist if (io.stat(path) == nil) { me.write(); diff --git a/Nasal/FMGC/winds.nas b/Nasal/FMGC/winds.nas index 0d28fdd9..c5a5de18 100644 --- a/Nasal/FMGC/winds.nas +++ b/Nasal/FMGC/winds.nas @@ -226,7 +226,7 @@ var windController = { }, # read - read from hist wind file, create one if it doesn't exist read: func() { - var path = getprop("/sim/fg-home") ~ "/Export/A320SavedWinds.txt"; + var path = pts.Sim.fgHome.getValue() ~ "/Export/A320SavedWinds.txt"; # create file if it doesn't exist if (io.stat(path) == nil) { me.write(); @@ -267,7 +267,7 @@ var windController = { # write - write to hist wind file, called whenever winds changed write: func() { if (me.des_winds[2] != 0) { - var path = getprop("/sim/fg-home") ~ "/Export/A320SavedWinds.txt"; + var path = pts.Sim.fgHome.getValue() ~ "/Export/A320SavedWinds.txt"; var file = io.open(path, "wb"); var winds_added = 0; diff --git a/Nasal/Libraries/property-tree-setup.nas b/Nasal/Libraries/property-tree-setup.nas index cb5d1857..f290d131 100644 --- a/Nasal/Libraries/property-tree-setup.nas +++ b/Nasal/Libraries/property-tree-setup.nas @@ -217,6 +217,7 @@ var Position = { var Sim = { aero: props.globals.getNode("/sim/aero"), + aircraft: props.globals.getNode("/sim/aircraft"), CurrentView: { fieldOfView: props.globals.getNode("/sim/current-view/field-of-view", 1), headingOffsetDeg: props.globals.getNode("/sim/current-view/heading-offset-deg", 1), @@ -232,6 +233,7 @@ var Sim = { zOffsetMaxM: props.globals.getNode("/sim/current-view/z-offset-max-m", 1), zOffsetMinM: props.globals.getNode("/sim/current-view/z-offset-min-m", 1), }, + fgHome: props.globals.getNode("/sim/fg-home"), Input: { Selected: { engine: [props.globals.getNode("/sim/input/selected/engine[0]", 1),props.globals.getNode("/sim/input/selected/engine[1]", 1)], From f025bb82f9cf9604a41ba32b2b72520fdd540564 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 10 Jun 2021 16:38:16 +0100 Subject: [PATCH 25/96] FMGC: improve Nasal code quality --- Nasal/FMGC/FMGC-b.nas | 31 +++++++++++++------------ Nasal/FMGC/FMGC.nas | 15 +++++++----- Nasal/Libraries/property-tree-setup.nas | 7 ++++++ 3 files changed, 32 insertions(+), 21 deletions(-) diff --git a/Nasal/FMGC/FMGC-b.nas b/Nasal/FMGC/FMGC-b.nas index b5f19f1b..57320445 100644 --- a/Nasal/FMGC/FMGC-b.nas +++ b/Nasal/FMGC/FMGC-b.nas @@ -947,35 +947,35 @@ setlistener("/it-autoflight/input/ap1", func { if (Input.ap1Temp != Output.ap1.getBoolValue()) { ITAF.ap1Master(Input.ap1Temp); } -}); +}, 0, 0); setlistener("/it-autoflight/input/ap2", func { Input.ap2Temp = Input.ap2.getBoolValue(); if (Input.ap2Temp != Output.ap2.getBoolValue()) { ITAF.ap2Master(Input.ap2Temp); } -}); +}, 0, 0); setlistener("/it-autoflight/input/athr", func { Input.athrTemp = Input.athr.getBoolValue(); if (Input.athrTemp != Output.athr.getBoolValue()) { ITAF.athrMaster(Input.athrTemp); } -}); +}, 0, 0); setlistener("/it-autoflight/input/fd1", func { Input.fd1Temp = Input.fd1.getBoolValue(); if (Input.fd1Temp != Output.fd1.getBoolValue()) { ITAF.fd1Master(Input.fd1Temp); } -}); +}, 0, 0); setlistener("/it-autoflight/input/fd2", func { Input.fd2Temp = Input.fd2.getBoolValue(); if (Input.fd2Temp != Output.fd2.getBoolValue()) { ITAF.fd2Master(Input.fd2Temp); } -}); +}, 0, 0); setlistener("/it-autoflight/input/kts-mach", func { if (Input.ktsMach.getBoolValue()) { @@ -990,7 +990,7 @@ setlistener("/it-autoflight/input/toga", func { ITAF.takeoffGoAround(); Input.toga.setBoolValue(0); } -}); +}, 0, 0); setlistener("/it-autoflight/input/lat", func { Input.latTemp = Input.lat.getValue(); @@ -998,6 +998,7 @@ setlistener("/it-autoflight/input/lat", func { Output.ap2Temp = Output.ap2.getBoolValue(); Output.fd1Temp = Output.fd1.getBoolValue(); Output.fd2Temp = Output.fd2.getBoolValue(); + if (!Gear.wow1.getBoolValue() and !Gear.wow2.getBoolValue()) { if (Output.ap1Temp or Output.ap2Temp or Output.fd1Temp or Output.fd2Temp) { ITAF.setLatMode(Input.latTemp); @@ -1011,7 +1012,7 @@ setlistener("/it-autoflight/input/lat", func { ITAF.setLatArm(0); } } -}); +}, 0, 0); setlistener("/it-autoflight/input/vert", func { if (!Gear.wow1.getBoolValue() and !Gear.wow2.getBoolValue() and (Output.ap1.getBoolValue() or Output.ap2.getBoolValue() or Output.fd1.getBoolValue() or Output.fd2.getBoolValue())) { @@ -1019,19 +1020,19 @@ setlistener("/it-autoflight/input/vert", func { } else { ITAF.setVertMode(9); } -}); +}, 0, 0); setlistener("/sim/signals/fdm-initialized", func { ITAF.init(); -}); - -# For Canvas Nav Display. -setlistener("/it-autoflight/input/hdg", func { - setprop("/autopilot/settings/heading-bug-deg", Input.hdg.getValue()); }, 0, 0); -setlistener("/it-autoflight/internal/alt", func { - setprop("/autopilot/settings/target-altitude-ft", Internal.alt.getValue()); +# For Canvas Nav Display. +setlistener("/it-autoflight/input/hdg", func() { + pts.Autopilot.Settings.headingBugDeg.setValue(Input.hdg.getValue()); +}, 0, 0); + +setlistener("/it-autoflight/internal/alt", func() { + pts.Autopilot.Settings.targetAltitudeFt.setValue(Internal.alt.getValue()); }, 0, 0); var loopTimer = maketimer(0.1, ITAF, ITAF.loop); diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index a106e8b1..b771d080 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -63,6 +63,8 @@ var crzFl = 0; var windHdg = 0; var windSpeed = 0; var windsDidChange = 0; +var tempOverspeed = nil; + setprop("position/gear-agl-ft", 0); setprop("/it-autoflight/settings/accel-agl-ft", 1500); #eventually set to 1500 above runway setprop("/it-autoflight/internal/vert-speed-fpm", 0); @@ -279,9 +281,9 @@ var trimReset = func { ############### var updateARPT = func { - setprop("autopilot/route-manager/departure/airport", FMGCInternal.depApt); - setprop("autopilot/route-manager/destination/airport", FMGCInternal.arrApt); - setprop("autopilot/route-manager/alternate/airport", FMGCInternal.altAirport); + setprop("/autopilot/route-manager/departure/airport", FMGCInternal.depApt); + setprop("/autopilot/route-manager/destination/airport", FMGCInternal.arrApt); + setprop("/autopilot/route-manager/alternate/airport", FMGCInternal.altAirport); if (getprop("/autopilot/route-manager/active") != 1) { fgcommand("activate-flightplan", props.Node.new({"activate": 1})); } @@ -310,7 +312,7 @@ var updateArptLatLon = func { } updateRouteManagerAlt = func() { - setprop("autopilot/route-manager/cruise/altitude-ft", FMGCInternal.crzFt); + setprop("/autopilot/route-manager/cruise/altitude-ft", FMGCInternal.crzFt); # TODO - update FMGCInternal.phase when DES to re-enter in CLIMB/CRUIZE }; @@ -674,8 +676,9 @@ var masterFMGC = maketimer(0.2, func { FMGCInternal.phase = 2; } - if (getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") != 1024) { - FMGCInternal.maxspeed = getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") - 4; + tempOverspeed = systems.ADIRS.overspeedVFE.getValue(); + if (tempOverspeed != 1024) { + FMGCInternal.maxspeed = tempOverspeed - 4; } elsif (pts.Gear.position[0].getValue() != 0 or pts.Gear.position[1].getValue() != 0 or pts.Gear.position[2].getValue() != 0) { FMGCInternal.maxspeed = 284; } else { diff --git a/Nasal/Libraries/property-tree-setup.nas b/Nasal/Libraries/property-tree-setup.nas index f290d131..ed05e695 100644 --- a/Nasal/Libraries/property-tree-setup.nas +++ b/Nasal/Libraries/property-tree-setup.nas @@ -4,6 +4,13 @@ # Anything that says Temp is set by another file to avoid multiple getValue calls # Usage Example: pts.Class.SubClass.node.getValue() +var Autopilot = { + Settings: { + headingBugDeg: props.globals.getNode("/autopilot/settings/heading-bug-deg",1), + targetAltitudeFt: props.globals.getNode("/autopilot/settings/target-altitude-ft",1), + }, +}; + var Accelerations = { pilotGDamped: props.globals.getNode("/accelerations/pilot-gdamped"), }; From d33d229f865c00ba362b3df82df7b92b99cd26ab Mon Sep 17 00:00:00 2001 From: Josh Davidson Date: Thu, 10 Jun 2021 11:49:09 -0400 Subject: [PATCH 26/96] FMGC: Fix listener cancel break some func --- Nasal/FMGC/FMGC-b.nas | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Nasal/FMGC/FMGC-b.nas b/Nasal/FMGC/FMGC-b.nas index 57320445..5260a87a 100644 --- a/Nasal/FMGC/FMGC-b.nas +++ b/Nasal/FMGC/FMGC-b.nas @@ -947,35 +947,35 @@ setlistener("/it-autoflight/input/ap1", func { if (Input.ap1Temp != Output.ap1.getBoolValue()) { ITAF.ap1Master(Input.ap1Temp); } -}, 0, 0); +}); setlistener("/it-autoflight/input/ap2", func { Input.ap2Temp = Input.ap2.getBoolValue(); if (Input.ap2Temp != Output.ap2.getBoolValue()) { ITAF.ap2Master(Input.ap2Temp); } -}, 0, 0); +}); setlistener("/it-autoflight/input/athr", func { Input.athrTemp = Input.athr.getBoolValue(); if (Input.athrTemp != Output.athr.getBoolValue()) { ITAF.athrMaster(Input.athrTemp); } -}, 0, 0); +}); setlistener("/it-autoflight/input/fd1", func { Input.fd1Temp = Input.fd1.getBoolValue(); if (Input.fd1Temp != Output.fd1.getBoolValue()) { ITAF.fd1Master(Input.fd1Temp); } -}, 0, 0); +}); setlistener("/it-autoflight/input/fd2", func { Input.fd2Temp = Input.fd2.getBoolValue(); if (Input.fd2Temp != Output.fd2.getBoolValue()) { ITAF.fd2Master(Input.fd2Temp); } -}, 0, 0); +}); setlistener("/it-autoflight/input/kts-mach", func { if (Input.ktsMach.getBoolValue()) { @@ -990,7 +990,7 @@ setlistener("/it-autoflight/input/toga", func { ITAF.takeoffGoAround(); Input.toga.setBoolValue(0); } -}, 0, 0); +}); setlistener("/it-autoflight/input/lat", func { Input.latTemp = Input.lat.getValue(); @@ -1012,7 +1012,7 @@ setlistener("/it-autoflight/input/lat", func { ITAF.setLatArm(0); } } -}, 0, 0); +}); setlistener("/it-autoflight/input/vert", func { if (!Gear.wow1.getBoolValue() and !Gear.wow2.getBoolValue() and (Output.ap1.getBoolValue() or Output.ap2.getBoolValue() or Output.fd1.getBoolValue() or Output.fd2.getBoolValue())) { @@ -1020,11 +1020,11 @@ setlistener("/it-autoflight/input/vert", func { } else { ITAF.setVertMode(9); } -}, 0, 0); +}); setlistener("/sim/signals/fdm-initialized", func { ITAF.init(); -}, 0, 0); +}); # For Canvas Nav Display. setlistener("/it-autoflight/input/hdg", func() { From 8c470e641c8bf48e2b7e9c812ca3f28d26440fb5 Mon Sep 17 00:00:00 2001 From: Inuyaksa Date: Fri, 11 Jun 2021 19:34:00 +0200 Subject: [PATCH 27/96] MCDU web moved as webpanel - MCDU as webpanel (not visible on PHI) - New menu to access MCDU web - Open via browser or QRCode - Fixed MCDU web text selection #230 --- A320-main.xml | 10 +++ mcdu.html => WebPanel/mcdu.html | 50 ++++++++---- gui/dialogs/mcduweb.xml | 137 ++++++++++++++++++++++++++++++++ 3 files changed, 182 insertions(+), 15 deletions(-) rename mcdu.html => WebPanel/mcdu.html (76%) create mode 100644 gui/dialogs/mcduweb.xml diff --git a/A320-main.xml b/A320-main.xml index 0283c7f9..1d253efc 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -457,6 +457,16 @@ ]]> + + + + nasal + + + diff --git a/mcdu.html b/WebPanel/mcdu.html similarity index 76% rename from mcdu.html rename to WebPanel/mcdu.html index ec2904ad..55c0ed67 100644 --- a/mcdu.html +++ b/WebPanel/mcdu.html @@ -1,12 +1,18 @@ - + MCDU + + + + + - + - @@ -245,7 +265,7 @@ - +


Z / SPOVFY
â–³
OVFY
â–³
CLR
@@ -283,11 +303,11 @@ . 0 + style="font-size: 3vw; width: 33.333333333333333333333333333333333333333333333333333333333333333333333%; /* :) */" class="disabled"> +/- - + \ No newline at end of file diff --git a/gui/dialogs/mcduweb.xml b/gui/dialogs/mcduweb.xml new file mode 100644 index 00000000..f4cd077b --- /dev/null +++ b/gui/dialogs/mcduweb.xml @@ -0,0 +1,137 @@ + + + + + + + + + mcdu-web + vbox + 480 + + + hbox + + left + + + + + + + + + + vbox + + + left + + + + /sim/http/running + 0 + + + + + left + + + + /sim/http/running + 0 + + + + + + + + vbox + + + center + + + + + + + + vbox + + center + + + + center + + + + + + + mcduwebqr + center + center + false + 320 + 320 + + + + + + + + + + + + vbox + + center + + + + + + From 87f49f28e9234826a46d3d04627b1a61d3f18e67 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 12 Jun 2021 00:27:46 +0100 Subject: [PATCH 28/96] FMGC: improve nasal --- Nasal/FMGC/FMGC.nas | 59 ++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index b771d080..61e3d052 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -69,8 +69,8 @@ setprop("position/gear-agl-ft", 0); setprop("/it-autoflight/settings/accel-agl-ft", 1500); #eventually set to 1500 above runway setprop("/it-autoflight/internal/vert-speed-fpm", 0); setprop("/it-autoflight/output/fma-pwr", 0); -setprop("instrumentation/nav[0]/nav-id", "XXX"); -setprop("instrumentation/nav[1]/nav-id", "XXX"); +setprop("/instrumentation/nav[0]/nav-id", "XXX"); +setprop("/instrumentation/nav[1]/nav-id", "XXX"); setprop("/FMGC/internal/ils1-mcdu", "XXX/999.99"); setprop("/FMGC/internal/ils2-mcdu", "XXX/999.99"); setprop("/FMGC/internal/vor1-mcdu", "XXX/999.99"); @@ -78,6 +78,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 FMGCAlignDone = [props.globals.getNode("/FMGC/internal/align1-done"),props.globals.getNode("/FMGC/internal/align2-done"),props.globals.getNode("/FMGC/internal/align3-done")]; +var FMGCAlignTime = [props.globals.getNode("/FMGC/internal/align1-time"),props.globals.getNode("/FMGC/internal/align2-time"),props.globals.getNode("/FMGC/internal/align3-time")]; +var adirsSkip = props.globals.getNode("/systems/acconfig/options/adirs-skip"); var blockCalculating = props.globals.initNode("/FMGC/internal/block-calculating", 0, "BOOL"); var fuelCalculating = props.globals.initNode("/FMGC/internal/fuel-calculating", 0, "BOOL"); @@ -93,9 +96,9 @@ var FMGCinit = func { setprop("/FMGC/internal/loc-source", "NAV0"); setprop("/FMGC/internal/optalt", 0); setprop("/FMGC/internal/landing-time", -99); - setprop("/FMGC/internal/align1-time", -99); - setprop("/FMGC/internal/align2-time", -99); - setprop("/FMGC/internal/align3-time", -99); + FMGCAlignTime[0].setValue(-99); + FMGCAlignTime[1].setValue(-99); + FMGCAlignTime[2].setValue(-99); setprop("/FMGC/internal/block-fuel-time", -99); setprop("/FMGC/internal/fuel-pred-time", -99); masterFMGC.start(); @@ -942,26 +945,26 @@ var masterFMGC = maketimer(0.2, func { runway_ils = destination_rwy.ils_frequency_mhz; if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set") and !getprop("/FMGC/internal/ils1crs-set")) { setprop("/FMGC/internal/ils1freq-calculated", runway_ils); - setprop("instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); - setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); + setprop("/instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); + setprop("/instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); } else if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set")) { setprop("/FMGC/internal/ils1freq-calculated", runway_ils); - setprop("instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); + setprop("/instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); } else if (!getprop("/FMGC/internal/ils1crs-set")) { - setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); + setprop("/instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); } } else if (departure_rwy != nil and FMGCInternal.phase <= 1) { magnetic_hdg = geo.normdeg(departure_rwy.heading - getprop("/environment/magnetic-variation-deg")); runway_ils = departure_rwy.ils_frequency_mhz; if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set") and !getprop("/FMGC/internal/ils1crs-set")) { setprop("/FMGC/internal/ils1freq-calculated", runway_ils); - setprop("instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); - setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); + setprop("/instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); + setprop("/instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); } else if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set")) { setprop("/FMGC/internal/ils1freq-calculated", runway_ils); - setprop("instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); + setprop("/instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); } else if (!getprop("/FMGC/internal/ils1crs-set")) { - setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); + setprop("/instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); } } }); @@ -1158,9 +1161,9 @@ setlistener("/systems/navigation/adr/operating-1", func() { timer48gpsAlign1.stop(); } - if (getprop("/FMGC/internal/align1-time") == -99) { + if (FMGCAlignTime[0].getValue() == -99) { timer48gpsAlign1.start(); - setprop("/FMGC/internal/align1-time", pts.Sim.Time.elapsedSec.getValue()); + FMGCAlignTime[0].setValue(pts.Sim.Time.elapsedSec.getValue()); } }, 0, 0); @@ -1170,9 +1173,9 @@ setlistener("/systems/navigation/adr/operating-2", func() { timer48gpsAlign2.stop(); } - if (getprop("/FMGC/internal/align2-time") == -99) { + if (FMGCAlignTime[1].getValue() == -99) { timer48gpsAlign2.start(); - setprop("/FMGC/internal/align2-time", pts.Sim.Time.elapsedSec.getValue()); + FMGCAlignTime[1].setValue(pts.Sim.Time.elapsedSec.getValue()); } }, 0, 0); @@ -1182,9 +1185,9 @@ setlistener("/systems/navigation/adr/operating-3", func() { timer48gpsAlign3.stop(); } - if (getprop("/FMGC/internal/align3-time") == -99) { + if (FMGCAlignTime[2].getValue() == -99) { timer48gpsAlign3.start(); - setprop("/FMGC/internal/align3-time", pts.Sim.Time.elapsedSec.getValue()); + FMGCAlignTime[2].setValue(pts.Sim.Time.elapsedSec.getValue()); } }, 0, 0); @@ -1231,25 +1234,25 @@ var timer30secLanding = maketimer(1, func() { }); var timer48gpsAlign1 = maketimer(1, func() { - if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/align1-time") + 48 or getprop("/systems/acconfig/options/adirs-skip")) { - setprop("/FMGC/internal/align1-done", 1); - setprop("/FMGC/internal/align1-time", -99); + if (pts.Sim.Time.elapsedSec.getValue() > (FMGCAlignTime[0].getValue() + 48) or adirsSkip.getValue()) { + FMGCAlignDone[0].setValue(1); + FMGCAlignTime[0].setValue(-99); timer48gpsAlign1.stop(); } }); var timer48gpsAlign2 = maketimer(1, func() { - if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/align2-time") + 48 or getprop("/systems/acconfig/options/adirs-skip")) { - setprop("/FMGC/internal/align2-done", 1); - setprop("/FMGC/internal/align2-time", -99); + if (pts.Sim.Time.elapsedSec.getValue() > (FMGCAlignTime[1].getValue() + 48) or adirsSkip.getValue()) { + FMGCAlignDone[1].setValue(1); + FMGCAlignTime[1].setValue(-99); timer48gpsAlign2.stop(); } }); var timer48gpsAlign3 = maketimer(1, func() { - if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/align3-time") + 48 or getprop("/systems/acconfig/options/adirs-skip")) { - setprop("/FMGC/internal/align3-done", 1); - setprop("/FMGC/internal/align3-time", -99); + if (pts.Sim.Time.elapsedSec.getValue() > (FMGCAlignTime[2].getValue() + 48) or adirsSkip.getValue()) { + FMGCAlignDone[2].setValue(1); + FMGCAlignTime[2].setValue(-99); timer48gpsAlign3.stop(); } }); From c4036fc40784229c7865660a2d73b6802ee4f0a2 Mon Sep 17 00:00:00 2001 From: Inuyaksa Date: Sat, 12 Jun 2021 15:42:41 +0200 Subject: [PATCH 29/96] autoland light, phase as a nodes optimzed fmgc phase loop --- Models/FlightDeck/a320.flightdeck.xml | 25 +++- Models/Instruments/PFD/PFD.nas | 3 + Nasal/FMGC/FMGC.nas | 200 +++++++++++++++++--------- Systems/a320-adr.xml | 11 ++ Systems/a320-fwc.xml | 38 ++++- 5 files changed, 210 insertions(+), 67 deletions(-) diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index c45e4ec1..c352a650 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -1206,7 +1206,7 @@ audio_call_vhf2_led audio_call_vhf3_led audio_mech_sgn - autoland_light_on + ecam_c_b_led ecam_el_dc_led ecam_sts_led @@ -6158,6 +6158,29 @@ + + select + autoland_light_on + + + + controls/switches/annun-test + 1 + + + + instrumentation/pfd/lights/autoland-armed + 1 + + + instrumentation/pfd/lights/autoland-on + 1 + + + + + + select diff --git a/Models/Instruments/PFD/PFD.nas b/Models/Instruments/PFD/PFD.nas index 78e62441..d39738ac 100644 --- a/Models/Instruments/PFD/PFD.nas +++ b/Models/Instruments/PFD/PFD.nas @@ -164,6 +164,9 @@ var amberFlash1 = props.globals.initNode("/instrumentation/pfd/flash-indicators/ var amberFlash2 = props.globals.initNode("/instrumentation/pfd/flash-indicators/amber-flash-2", 0, "BOOL"); var dhFlash = props.globals.initNode("/instrumentation/pfd/flash-indicators/dh-flash", 0, "BOOL"); +var light_autoland_armed = props.globals.initNode("/instrumentation/pfd/lights/autoland-armed", 0, "BOOL"); +var light_autoland_on = props.globals.initNode("/instrumentation/pfd/lights/autoland-on", 0, "BOOL"); + var canvas_PFD_base = { init: func(canvas_group, file) { var font_mapper = func(family, weight) { diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index b771d080..a65f6fe6 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -86,6 +86,7 @@ var FMGCinit = func { FMGCInternal.minspeed = 0; FMGCInternal.maxspeed = 338; FMGCInternal.phase = 0; # 0 is Preflight 1 is Takeoff 2 is Climb 3 is Cruise 4 is Descent 5 is Decel/Approach 6 is Go Around 7 is Done + FMGCNodes.phase.setValue(0); FMGCInternal.mngSpd = 157; FMGCInternal.mngSpdCmd = 157; FMGCInternal.mngKtsMach = 0; @@ -259,6 +260,7 @@ var FMGCNodes = { toState: props.globals.initNode("/FMGC/internal/to-state", 0, "BOOL"), v1: props.globals.initNode("/FMGC/internal/v1", 0, "DOUBLE"), v1set: props.globals.initNode("/FMGC/internal/v1-set", 0, "BOOL"), + phase: props.globals.initNode("/FMGC/internal/phase", 0, "INT"), }; ############ @@ -603,88 +605,144 @@ var radios = maketimer(1, func() { adf1(); }); + + +var prop_n1_left = pts.Engines.Engine.n1Actual[0]; +var prop_n1_right = pts.Engines.Engine.n1Actual[1]; +#var prop_nmodelat = Modes.PFD.FMA.rollMode; +#var prop_mode = Modes.PFD.FMA.pitchMode; +var prop_gs = pts.Velocities.groundspeed; +var prop_alt = pts.Instrumentation.Altimeter.indicatedFt; +var prop_state1 = pts.Systems.Thrust.state[0]; +var prop_state2 = pts.Systems.Thrust.state[1]; +#var prop_accel_agl_ft = Setting.reducAglFt; +var prop_gear0 = pts.Gear.wow[0]; +#var prop_altSel = Input.alt; + var masterFMGC = maketimer(0.2, func { - n1_left = pts.Engines.Engine.n1Actual[0].getValue(); - n1_right = pts.Engines.Engine.n1Actual[1].getValue(); + + n1_left = prop_n1_left.getValue(); + n1_right = prop_n1_right.getValue(); modelat = Modes.PFD.FMA.rollMode.getValue(); mode = Modes.PFD.FMA.pitchMode.getValue(); - gs = pts.Velocities.groundspeed.getValue(); - alt = pts.Instrumentation.Altimeter.indicatedFt.getValue(); + gs = prop_gs.getValue(); + alt = prop_alt.getValue(); # cruiseft = FMGCInternal.crzFt; # cruiseft_b = FMGCInternal.crzFt - 200; - state1 = pts.Systems.Thrust.state[0].getValue(); - state2 = pts.Systems.Thrust.state[1].getValue(); + state1 = prop_state1.getValue(); + state2 = prop_state2.getValue(); accel_agl_ft = Setting.reducAglFt.getValue(); - gear0 = pts.Gear.wow[0].getBoolValue(); + gear0 = prop_gear0.getBoolValue(); altSel = Input.alt.getValue(); - if ((n1_left < 85 or n1_right < 85) and gs < 90 and mode == " " and gear0 and FMGCInternal.phase == 1) { # rejected takeoff - FMGCInternal.phase = 0; - systems.PNEU.pressMode.setValue("GN"); - } - - if (gear0 and FMGCInternal.phase == 0 and ((n1_left >= 85 and n1_right >= 85 and mode == "SRS") or gs >= 90)) { - FMGCInternal.phase = 1; - systems.PNEU.pressMode.setValue("TO"); - } - - if (FMGCInternal.phase == 1 and ((mode != "SRS" and mode != " ") or alt >= accel_agl_ft)) { - FMGCInternal.phase = 2; - systems.PNEU.pressMode.setValue("TO"); - } - - if (FMGCInternal.phase == 2 and (mode == "ALT CRZ" or mode == "ALT CRZ*")) { - FMGCInternal.phase = 3; - systems.PNEU.pressMode.setValue("CR"); - } - - if (FMGCInternal.crzFl >= 200) { - if (FMGCInternal.phase == 3 and (flightPlanController.arrivalDist <= 200 or altSel < 20000)) { - FMGCInternal.phase = 4; - systems.PNEU.pressMode.setValue("DE"); + var phase = FMGCInternal.phase; + var newphase = phase; + + if (phase == 0) { + + if (gear0 and ((n1_left >= 85 and n1_right >= 85 and mode == "SRS") or gs >= 90)) { + newphase = 1; + systems.PNEU.pressMode.setValue("TO"); } - } 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; - systems.PNEU.pressMode.setValue("DE"); + + } + + else if (phase == 1) { + + if (gear0) { + + if ((n1_left < 85 or n1_right < 85) and gs < 90 and mode == " ") { # rejected takeoff + newphase = 0; + systems.PNEU.pressMode.setValue("GN"); + } + + } + else if (((mode != "SRS" and mode != " ") or alt >= accel_agl_ft)) { + newphase = 2; + systems.PNEU.pressMode.setValue("TO"); } + } - if (FMGCInternal.phase == 4) { - if (getprop("/FMGC/internal/decel")) { - FMGCInternal.phase = 5; - } - else if (altSel == (FMGCInternal.crzFl * 100)) { # back to CRZ state - FMGCInternal.phase = 3; + else if (phase == 2) { + + if ((mode == "ALT CRZ" or mode == "ALT CRZ*")) { + newphase = 3; systems.PNEU.pressMode.setValue("CR"); } + + } + + else if (phase == 3) { + + if (FMGCInternal.crzFl >= 200) { + if ((flightPlanController.arrivalDist <= 200 or altSel < 20000)) { + newphase = 4; + systems.PNEU.pressMode.setValue("DE"); + } + } else { + if ((flightPlanController.arrivalDist <= 200 and altSel < (FMGCInternal.crzFl * 100))) { # todo - not sure about crzFl condition, investigate what happens! + newphase = 4; + systems.PNEU.pressMode.setValue("DE"); + } + } + + } + + else if (phase == 4) { + + if (getprop("/FMGC/internal/decel")) { + newphase = 5; + } + else if (altSel == (FMGCInternal.crzFl * 100)) { # back to CRZ state + newphase = 3; + systems.PNEU.pressMode.setValue("CR"); + } + } - if (flightPlanController.num[2].getValue() > 0 and getprop("/FMGC/flightplan[2]/active") == 1 and flightPlanController.arrivalDist <= 15 and (modelat == "NAV" or modelat == "LOC" or modelat == "LOC*") and pts.Position.gearAglFt.getValue() < 9500) { #todo decel pseudo waypoint + else if (phase == 5) { + + if (state1 == "TOGA" and state2 == "TOGA") { + newphase = 6; + systems.PNEU.pressMode.setValue("TO"); + Input.toga.setValue(1); + } + + } + + else if (phase == 6) { + + if (alt >= accel_agl_ft) { # todo when insert altn or new dest + newphase = 2; + } + + } + + + if (flightPlanController.num[2].getValue() > 0 and getprop("/FMGC/flightplan[2]/active") == 1 and + flightPlanController.arrivalDist <= 15 and (modelat == "NAV" or modelat == "LOC" or modelat == "LOC*") and pts.Position.gearAglFt.getValue() < 9500) { #todo decel pseudo waypoint setprop("/FMGC/internal/decel", 1); - } else if (getprop("/FMGC/internal/decel") == 1 and (FMGCInternal.phase == 0 or FMGCInternal.phase == 6)) { + } else if (getprop("/FMGC/internal/decel") == 1 and (phase == 0 or phase == 6)) { setprop("/FMGC/internal/decel", 0); } - if ((FMGCInternal.phase == 5) and state1 == "TOGA" and state2 == "TOGA") { - FMGCInternal.phase = 6; - systems.PNEU.pressMode.setValue("TO"); - Input.toga.setValue(1); - } - if (FMGCInternal.phase == 6 and alt >= accel_agl_ft) { # todo when insert altn or new dest - FMGCInternal.phase = 2; - } - - tempOverspeed = systems.ADIRS.overspeedVFE.getValue(); - if (tempOverspeed != 1024) { - FMGCInternal.maxspeed = tempOverspeed - 4; + if (getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") != 1024) { + FMGCInternal.maxspeed = getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") - 4; } elsif (pts.Gear.position[0].getValue() != 0 or pts.Gear.position[1].getValue() != 0 or pts.Gear.position[2].getValue() != 0) { FMGCInternal.maxspeed = 284; } else { FMGCInternal.maxspeed = fmgc.FMGCInternal.vmo_mmo; } + if (newphase != phase) { # phase changed + FMGCInternal.phase = newphase; + FMGCNodes.phase.setValue(newphase); + } + + + ############################ # fuel ############################ @@ -774,7 +832,7 @@ var masterFMGC = maketimer(0.2, func { } # predicted takeoff speeds - if (FMGCInternal.phase == 1) { + if (phase == 1) { FMGCInternal.clean_to = FMGCInternal.clean; FMGCInternal.vs1g_clean_to = FMGCInternal.vs1g_clean; FMGCInternal.vs1g_conf_2_to = FMGCInternal.vs1g_conf_2; @@ -796,7 +854,7 @@ var masterFMGC = maketimer(0.2, func { } # predicted approach (temp go-around) speeds - if (FMGCInternal.phase == 5 or FMGCInternal.phase == 6) { + if (phase == 5 or phase == 6) { FMGCInternal.clean_appr = FMGCInternal.clean; FMGCInternal.vs1g_clean_appr = FMGCInternal.vs1g_clean; FMGCInternal.vs1g_conf_2_appr = FMGCInternal.vs1g_conf_2; @@ -917,7 +975,8 @@ var masterFMGC = maketimer(0.2, func { } } - if (gear0 and pts.Controls.Flight.flapsPos.getValue() < 5 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA")) { + #if (gear0 and pts.Controls.Flight.flapsPos.getValue() < 5 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA")) { + if (gear0 and flap < 5 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA")) { if (!FMGCInternal.takeoffState) { fmgc.FMGCNodes.toState.setValue(1); } @@ -929,13 +988,21 @@ var masterFMGC = maketimer(0.2, func { FMGCInternal.takeoffState = 0; } - ############################ - #handle radios, runways, v1/vr/v2 - ############################ +}); + +############################ +#handle radios, runways, v1/vr/v2 +############################ + +var updateAirportRadios = func { + + var phase = FMGCInternal.phase; + print("# Update airport radios"); + departure_rwy = fmgc.flightPlanController.flightplans[2].departure_runway; destination_rwy = fmgc.flightPlanController.flightplans[2].destination_runway; - if (destination_rwy != nil and FMGCInternal.phase >= 2) { + if (phase >= 2 and destination_rwy != nil) { var airport = airportinfo(FMGCInternal.arrApt); setprop("/FMGC/internal/ldg-elev", airport.elevation * M2FT); # eventually should be runway elevation magnetic_hdg = geo.normdeg(destination_rwy.heading - getprop("/environment/magnetic-variation-deg")); @@ -950,7 +1017,7 @@ var masterFMGC = maketimer(0.2, func { } else if (!getprop("/FMGC/internal/ils1crs-set")) { setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); } - } else if (departure_rwy != nil and FMGCInternal.phase <= 1) { + } else if (phase <= 1 and departure_rwy != nil) { magnetic_hdg = geo.normdeg(departure_rwy.heading - getprop("/environment/magnetic-variation-deg")); runway_ils = departure_rwy.ils_frequency_mhz; if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set") and !getprop("/FMGC/internal/ils1crs-set")) { @@ -964,10 +1031,15 @@ var masterFMGC = maketimer(0.2, func { setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); } } -}); + +}; + +setlistener(FMGCNodes.phase, updateAirportRadios); +setlistener(flightPlanController.changed, updateAirportRadios); var reset_FMGC = func { FMGCInternal.phase = 0; + FMGCNodes.phase.serValue(0); fd1 = Input.fd1.getValue(); fd2 = Input.fd2.getValue(); spd = Input.kts.getValue(); diff --git a/Systems/a320-adr.xml b/Systems/a320-adr.xml index 2a125dcf..9896d49b 100644 --- a/Systems/a320-adr.xml +++ b/Systems/a320-adr.xml @@ -922,6 +922,17 @@ 5000 + + + + + + /instrumentation/radar-altimeter[0]/radar-altitude-ft-corrected + /instrumentation/radar-altimeter[1]/radar-altitude-ft-corrected + + + + diff --git a/Systems/a320-fwc.xml b/Systems/a320-fwc.xml index 1c08f6c3..09ab1065 100644 --- a/Systems/a320-fwc.xml +++ b/Systems/a320-fwc.xml @@ -2211,7 +2211,7 @@ /ECAM/warnings/logic/stall/phase-flipflop eq 1 - + @@ -2300,7 +2300,41 @@ /ECAM/warnings/logic/stall/stall-warn-inhibit eq 0 - + + + + + + + /modes/pfd/ILS1 eq 1 + /instrumentation/radar-altimeter[0]/radar-altitude-ft-corrected le 200 + + + /modes/pfd/ILS2 eq 1 + /instrumentation/radar-altimeter[1]/radar-altitude-ft-corrected le 200 + + + + + + + + + /instrumentation/pfd/lights/autoland-armed eq 1 + + + /it-autoflight/output/ap1 eq 0 + /it-autoflight/output/ap2 eq 0 + + /instrumentation/radar-altimeter-difference gt 15 + + + + + From 23369f854b9cc1c703e94fcb7aee5ae0006a0d2a Mon Sep 17 00:00:00 2001 From: Inuyaksa Date: Sat, 12 Jun 2021 15:46:08 +0200 Subject: [PATCH 30/96] property /instrumentation/radar-altimeter-difference-ft Difference from 2 radar altimeter (corrected) in ft --- Systems/a320-adr.xml | 2 +- Systems/a320-fwc.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Systems/a320-adr.xml b/Systems/a320-adr.xml index 9896d49b..b1ef10f0 100644 --- a/Systems/a320-adr.xml +++ b/Systems/a320-adr.xml @@ -923,7 +923,7 @@ - + diff --git a/Systems/a320-fwc.xml b/Systems/a320-fwc.xml index 09ab1065..de676136 100644 --- a/Systems/a320-fwc.xml +++ b/Systems/a320-fwc.xml @@ -2326,7 +2326,7 @@ /it-autoflight/output/ap1 eq 0 /it-autoflight/output/ap2 eq 0 - /instrumentation/radar-altimeter-difference gt 15 + /instrumentation/radar-altimeter-difference-ft gt 15 props.globals --- AircraftConfig/acconfig.nas | 20 ++++++++++---------- Nasal/ECAM/ECAM-logic.nas | 16 ++++++++-------- Nasal/ECAM/ECAM-main.nas | 32 ++++++++++++++------------------ Nasal/FMGC/FMGC.nas | 4 ++-- Nasal/Libraries/buttons.nas | 8 ++++---- Nasal/Libraries/libraries.nas | 3 +++ Nasal/MCDU/MCDU.nas | 6 +++--- 7 files changed, 44 insertions(+), 45 deletions(-) diff --git a/AircraftConfig/acconfig.nas b/AircraftConfig/acconfig.nas index 205c4dae..c941efc8 100644 --- a/AircraftConfig/acconfig.nas +++ b/AircraftConfig/acconfig.nas @@ -258,7 +258,7 @@ var colddark = func { setprop("/controls/engines/engine[0]/cutoff-switch", 1); setprop("/controls/engines/engine[1]/cutoff-switch", 1); setprop("/controls/flight/flaps", 0); - setprop("/controls/flight/speedbrake-arm", 0); + pts.Controls.Flight.speedbrakeArm.setValue(0); setprop("/controls/flight/speedbrake", 0); setprop("/controls/gear/gear-down", 1); setprop("/controls/flight/elevator-trim", 0); @@ -317,7 +317,7 @@ var beforestart = func { setprop("/controls/engines/engine[0]/cutoff-switch", 1); setprop("/controls/engines/engine[1]/cutoff-switch", 1); setprop("/controls/flight/flaps", 0); - setprop("/controls/flight/speedbrake-arm", 0); + pts.Controls.Flight.speedbrakeArm.setValue(0); setprop("/controls/flight/speedbrake", 0); setprop("/controls/gear/gear-down", 1); setprop("/controls/flight/elevator-trim", 0); @@ -380,9 +380,9 @@ var beforestart_b = func { setprop("/controls/adirs/mcducbtn", 1); setprop("/controls/switches/beacon", 1); setprop("/controls/lighting/nav-lights-switch", 1); - setprop("/controls/switches/no-smoking-sign", 0.5); - setprop("/controls/switches/seatbelt-sign", 1); - setprop("/controls/switches/emer-lights", 0.5); + libraries.noSmokingSwitch.setValue(0.5); + libraries.seatbeltSwitch.setValue(1.0); + libraries.emerLtsSwitch.setValue(0.5); setprop("/controls/radio/rmp[0]/on", 1); setprop("/controls/radio/rmp[1]/on", 1); setprop("/controls/radio/rmp[2]/on", 1); @@ -412,7 +412,7 @@ var taxi = func { setprop("/controls/engines/engine[0]/cutoff-switch", 1); setprop("/controls/engines/engine[1]/cutoff-switch", 1); setprop("/controls/flight/flaps", 0); - setprop("/controls/flight/speedbrake-arm", 0); + pts.Controls.Flight.speedbrakeArm.setValue(0); setprop("/controls/flight/speedbrake", 0); setprop("/controls/gear/gear-down", 1); setprop("/controls/flight/elevator-trim", 0); @@ -476,9 +476,9 @@ var taxi_b = func { setprop("/controls/switches/beacon", 1); setprop("/controls/switches/wing-lights", 1); setprop("/controls/lighting/nav-lights-switch", 1); - setprop("/controls/switches/no-smoking-sign", 0.5); - setprop("/controls/switches/seatbelt-sign", 1); - setprop("/controls/switches/emer-lights", 0.5); + libraries.noSmokingSwitch.setValue(0.5); + libraries.seatbeltSwitch.setValue(1.0); + libraries.emerLtsSwitch.setValue(0.5); setprop("/controls/radio/rmp[0]/on", 1); setprop("/controls/radio/rmp[1]/on", 1); setprop("/controls/radio/rmp[2]/on", 1); @@ -537,7 +537,7 @@ var takeoff = func { setprop("/controls/lighting/taxi-light-switch", 1); setprop("/controls/switches/landing-lights-l", 1); setprop("/controls/switches/landing-lights-r", 1); - setprop("/controls/flight/speedbrake-arm", 1); + pts.Controls.Flight.speedbrakeArm.setValue(1); setprop("/controls/flight/flaps", 0.2); setprop("/controls/atc/mode-knob", 4); atc.transponderPanel.modeSwitch(5); diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index 19d09c56..e387da41 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -3158,7 +3158,7 @@ var messages_config_memo = func { toMemoLine1.colour = "c"; } - if (getprop("/controls/switches/seatbelt-sign") and getprop("/controls/switches/no-smoking-sign")) { + if (libraries.seatbeltSwitch.getValue() and libraries.noSmokingSwitch.getValue() ) { toMemoLine2.msg = " SIGNS ON"; toMemoLine2.colour = "g"; } else { @@ -3166,7 +3166,7 @@ var messages_config_memo = func { toMemoLine2.colour = "c"; } - if (getprop("/controls/flight/speedbrake-arm")) { + if (pts.Controls.Flight.speedbrakeArm.getValue()) { toMemoLine3.msg = " SPLRS ARM"; toMemoLine3.colour = "g"; } else { @@ -3202,7 +3202,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 < pts.Sim.Time.elapsedSec.getValue()) or getprop("/ECAM/to-memo-flipflop")) { + if ((phaseVarMemo == 2 and engStrtTime.getValue() != 0 and engStrtTime.getValue() + 120 < pts.Sim.Time.elapsedSec.getValue()) or getprop("/ECAM/to-memo-flipflop")) { toMemoLine1.active = 1; toMemoLine2.active = 1; toMemoLine3.active = 1; @@ -3224,7 +3224,7 @@ var messages_config_memo = func { ldgMemoLine1.colour = "c"; } - if (getprop("/controls/switches/seatbelt-sign") and getprop("/controls/switches/no-smoking-sign")) { + if (libraries.seatbeltSwitch.getValue() and libraries.noSmokingSwitch.getValue()) { ldgMemoLine2.msg = " SIGNS ON"; ldgMemoLine2.colour = "g"; } else { @@ -3232,7 +3232,7 @@ var messages_config_memo = func { ldgMemoLine2.colour = "c"; } - if (getprop("/controls/flight/speedbrake-arm")) { + if (pts.Controls.Flight.speedbrakeArm.getValue()) { ldgMemoLine3.msg = " SPLRS ARM"; ldgMemoLine3.colour = "g"; } else { @@ -3343,19 +3343,19 @@ var messages_memo = func { } } - if (getprop("/controls/flight/speedbrake-arm") == 1 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) { + if (pts.Controls.Flight.speedbrakeArm.getValue() == 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 (libraries.seatbeltLight.getValue() == 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 (libraries.noSmokingLight.getValue() == 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; diff --git a/Nasal/ECAM/ECAM-main.nas b/Nasal/ECAM/ECAM-main.nas index bf56df2a..5a3f88b8 100644 --- a/Nasal/ECAM/ECAM-main.nas +++ b/Nasal/ECAM/ECAM-main.nas @@ -5,33 +5,29 @@ var ap_active = 0; var athr_active = 0; -var aileron = 0; -var elevator = 0; var engModeSel = 0; var APUMaster = 0; var APURPM = 0; -var gearDown = 0; -var apOffTime = 0; -var athrOffTime = 0; -var apWarnNode = 0; -var athrWarnNode = 0; -var engStrtTimeSw = 0; -var engStrtTime = 0; -var page = 0; +var apOffTime = props.globals.initNode("/ECAM/warnings/ap-off-time", 0, "INT"); +var athrOffTime = props.globals.initNode("/ECAM/warnings/athr-off-time", 0, "INT"); +var engStrtTimeSw = props.globals.initNode("/ECAM/engine-start-time-switch", 0, "BOOL"); +var engStrtTime = props.globals.initNode("/ECAM/engine-start-time", 0.0, "DOUBLE"); +var apWarnNode = props.globals.initNode("/it-autoflight/output/ap-warning", 0, "INT"); +var athrWarnNode = props.globals.initNode("/it-autoflight/output/athr-warning", 0, "INT"); +var page = props.globals.initNode("/ECAM/Lower/page", "door", "STRING"); var gearWarnLight = props.globals.initNode("/ECAM/warnings/landing-gear-warning-light", 0, "BOOL"); var ECAM = { _cachePage: "", init: func() { - page = props.globals.initNode("/ECAM/Lower/page", "door", "STRING"); - - apOffTime = props.globals.initNode("/ECAM/warnings/ap-off-time", 0, "INT"); - athrOffTime = props.globals.initNode("/ECAM/warnings/athr-off-time", 0, "INT"); - 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"); - athrWarnNode = props.globals.initNode("/it-autoflight/output/athr-warning", 0, "INT"); + page.setValue("door"); + apOffTime.setValue(0); + athrOffTime.setValue(0); + engStrtTimeSw.setValue(0); + engStrtTime.setValue(0); + apWarnNode.setValue(0); + athrWarnNode.setValue(0); me.reset(); }, update_items: [ diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index 61e3d052..6056faa7 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -78,8 +78,8 @@ setprop("/FMGC/internal/vor2-mcdu", "999.99/XXX"); setprop("/FMGC/internal/adf1-mcdu", "XXX/999.99"); setprop("/FMGC/internal/adf2-mcdu", "999.99/XXX"); -var FMGCAlignDone = [props.globals.getNode("/FMGC/internal/align1-done"),props.globals.getNode("/FMGC/internal/align2-done"),props.globals.getNode("/FMGC/internal/align3-done")]; -var FMGCAlignTime = [props.globals.getNode("/FMGC/internal/align1-time"),props.globals.getNode("/FMGC/internal/align2-time"),props.globals.getNode("/FMGC/internal/align3-time")]; +var FMGCAlignDone = [props.globals.initNode("/FMGC/internal/align1-done", 0, "BOOL"), props.globals.initNode("/FMGC/internal/align2-done", 0, "BOOL"), props.globals.initNode("/FMGC/internal/align3-done", 0, "BOOL")]; +var FMGCAlignTime = [props.globals.initNode("/FMGC/internal/align1-time", 0, "DOUBLE"), props.globals.initNode("/FMGC/internal/align2-time", 0, "DOUBLE"), props.globals.initNode("/FMGC/internal/align3-time", 0, "DOUBLE")]; var adirsSkip = props.globals.getNode("/systems/acconfig/options/adirs-skip"); var blockCalculating = props.globals.initNode("/FMGC/internal/block-calculating", 0, "BOOL"); var fuelCalculating = props.globals.initNode("/FMGC/internal/fuel-calculating", 0, "BOOL"); diff --git a/Nasal/Libraries/buttons.nas b/Nasal/Libraries/buttons.nas index 24dbb3a6..b480d47b 100644 --- a/Nasal/Libraries/buttons.nas +++ b/Nasal/Libraries/buttons.nas @@ -24,7 +24,7 @@ var variousReset = func() { setprop("/instrumentation/mk-viii/inputs/discretes/momentary-flap-3-override", 0); setprop("/controls/switches/cabinCall", 0); setprop("/controls/switches/mechCall", 0); - setprop("/controls/switches/emer-lights", 0.5); + libraries.emerLtsSwitch.setValue(0.5); # cockpit voice recorder stuff setprop("/controls/CVR/power", 0); setprop("/controls/CVR/test", 0); @@ -62,9 +62,9 @@ var variousReset = func() { setprop("/modes/fcu/hdg-time", -45); setprop("/controls/navigation/switching/att-hdg", 0); setprop("/controls/navigation/switching/air-data", 0); - setprop("/controls/switches/no-smoking-sign", 0.0); - setprop("/controls/switches/seatbelt-sign", 0); - setprop("/controls/switches/emer-lights", 0); + libraries.noSmokingSwitch.setValue(0.0); + libraries.seatbeltSwitch.setValue(0.0); + libraries.emerLtsSwitch.setValue(0.0); } var BUTTONS = { diff --git a/Nasal/Libraries/libraries.nas b/Nasal/Libraries/libraries.nas index 0e15b916..5d0f72ee 100644 --- a/Nasal/Libraries/libraries.nas +++ b/Nasal/Libraries/libraries.nas @@ -142,6 +142,9 @@ var groundspeed = 0; var stateL = 0; var stateR = 0; +var seatbeltSwitch = props.globals.getNode("/controls/switches/seatbelt-sign"); +var noSmokingSwitch = props.globals.getNode("/controls/switches/no-smoking-sign"); +var emerLtsSwitch = props.globals.getNode("/controls/switches/emer-lights"); var seatbeltLight = props.globals.getNode("/controls/lighting/seatbelt-sign"); var noSmokingLight = props.globals.getNode("/controls/lighting/no-smoking-sign"); diff --git a/Nasal/MCDU/MCDU.nas b/Nasal/MCDU/MCDU.nas index 592f6f26..d092eca9 100644 --- a/Nasal/MCDU/MCDU.nas +++ b/Nasal/MCDU/MCDU.nas @@ -91,9 +91,9 @@ var MCDU_reset = func(i) { setprop("/FMGC/internal/align-ref-long-sign", ""); setprop("/FMGC/internal/align-ref-lat-edit", 0); setprop("/FMGC/internal/align-ref-long-edit", 0); - setprop("/FMGC/internal/align1-done", 0); - setprop("/FMGC/internal/align2-done", 0); - setprop("/FMGC/internal/align3-done", 0); + fmgc.FMGCAlignDone[0].setValue(0); + fmgc.FMGCAlignDone[1].setValue(0); + fmgc.FMGCAlignDone[2].setValue(0); # ROUTE SELECTION fmgc.FMGCInternal.altSelected = 0; From c87de06effab7196ad818054b2b578e517cc92b1 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sun, 13 Jun 2021 17:55:01 +0100 Subject: [PATCH 37/96] Simbrief: after a FMGC reset, also reset the Simbrief inhibit for a new flight --- Nasal/FMGC/FMGC.nas | 1 + 1 file changed, 1 insertion(+) diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index 6056faa7..f1baf7d3 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -984,6 +984,7 @@ var reset_FMGC = func { windController.init(); mcdu.MCDU_reset(0); mcdu.MCDU_reset(1); + Simbrief.SimbriefParser.inhibit = 0; mcdu.ReceivedMessagesDatabase.clearDatabase(); mcdu.FlightLogDatabase.reset(); # track reset events without loosing recorded data From b87c4045818b8732c4a79c65b3a081361b11bb31 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sun, 13 Jun 2021 17:58:01 +0100 Subject: [PATCH 38/96] Simbrief: explicitly disable the ability whenever FROM / TO is already filled, because the function is not available then --- Nasal/MCDU/INITA.nas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nasal/MCDU/INITA.nas b/Nasal/MCDU/INITA.nas index 9d048ea0..0ddced4e 100644 --- a/Nasal/MCDU/INITA.nas +++ b/Nasal/MCDU/INITA.nas @@ -279,7 +279,7 @@ var initInputA = func(key, i) { } } } else if (key == "R2") { - if (pts.Engines.Engine.state[0].getValue() != 3 and pts.Engines.Engine.state[1].getValue() != 3) { + if (pts.Engines.Engine.state[0].getValue() != 3 and pts.Engines.Engine.state[1].getValue() != 3 and fmgc.FMGCInternal.toFromSet == 0) { if (!ecam.vhf3_voice.active) { if (atsu.ATSU.working) { if (getprop("/FMGC/simbrief-username") == "") { From 2590e734037cecf784cfdeb97574be789765d95d Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sun, 13 Jun 2021 18:57:13 +0100 Subject: [PATCH 39/96] Nasal cleanup --- Nasal/FMGC/FMGC.nas | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index 1d32c4c8..26bba681 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -997,16 +997,14 @@ var masterFMGC = maketimer(0.2, func { ############################ #handle radios, runways, v1/vr/v2 ############################ - +var airportRadiosPhase = nil; var updateAirportRadios = func { - var phase = FMGCInternal.phase; - - print("# Update airport radios"); + airportRadiosPhase = FMGCInternal.phase; departure_rwy = fmgc.flightPlanController.flightplans[2].departure_runway; destination_rwy = fmgc.flightPlanController.flightplans[2].destination_runway; - if (phase >= 2 and destination_rwy != nil) { + if (airportRadiosPhase >= 2 and destination_rwy != nil) { var airport = airportinfo(FMGCInternal.arrApt); setprop("/FMGC/internal/ldg-elev", airport.elevation * M2FT); # eventually should be runway elevation magnetic_hdg = geo.normdeg(destination_rwy.heading - getprop("/environment/magnetic-variation-deg")); @@ -1021,7 +1019,7 @@ var updateAirportRadios = func { } else if (!getprop("/FMGC/internal/ils1crs-set")) { setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); } - } else if (phase <= 1 and departure_rwy != nil) { + } else if (airportRadiosPhase <= 1 and departure_rwy != nil) { magnetic_hdg = geo.normdeg(departure_rwy.heading - getprop("/environment/magnetic-variation-deg")); runway_ils = departure_rwy.ils_frequency_mhz; if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set") and !getprop("/FMGC/internal/ils1crs-set")) { @@ -1039,7 +1037,7 @@ var updateAirportRadios = func { }; setlistener(FMGCNodes.phase, updateAirportRadios,0,0); -setlistener(flightPlanController.changed, updateAirportRadios); +setlistener(flightPlanController.changed, updateAirportRadios,0,0); var reset_FMGC = func { FMGCInternal.phase = 0; From cebc7584e9c987e4502c9fb4b58585d22f9b4e56 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sun, 13 Jun 2021 18:58:35 +0100 Subject: [PATCH 40/96] Actually remove; don't just comment out --- Models/FlightDeck/a320.flightdeck.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index c352a650..2389bf10 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -1206,7 +1206,6 @@ audio_call_vhf2_led audio_call_vhf3_led audio_mech_sgn - ecam_c_b_led ecam_el_dc_led ecam_sts_led From 851c06ec3eede24868fbf256e6bb4497cff18cfa Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sun, 13 Jun 2021 19:29:25 +0100 Subject: [PATCH 41/96] Style improvements and restore work that was reverted --- Nasal/FMGC/FMGC.nas | 213 ++++++++++++++++----------------------- Nasal/MCDU/FLIGHTLOG.nas | 14 +-- 2 files changed, 93 insertions(+), 134 deletions(-) diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index 26bba681..33fa7ea0 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -69,8 +69,8 @@ setprop("position/gear-agl-ft", 0); setprop("/it-autoflight/settings/accel-agl-ft", 1500); #eventually set to 1500 above runway setprop("/it-autoflight/internal/vert-speed-fpm", 0); setprop("/it-autoflight/output/fma-pwr", 0); -setprop("instrumentation/nav[0]/nav-id", "XXX"); -setprop("instrumentation/nav[1]/nav-id", "XXX"); +setprop("/instrumentation/nav[0]/nav-id", "XXX"); +setprop("/instrumentation/nav[1]/nav-id", "XXX"); setprop("/FMGC/internal/ils1-mcdu", "XXX/999.99"); setprop("/FMGC/internal/ils2-mcdu", "XXX/999.99"); setprop("/FMGC/internal/vor1-mcdu", "XXX/999.99"); @@ -97,9 +97,9 @@ var FMGCinit = func { setprop("/FMGC/internal/loc-source", "NAV0"); setprop("/FMGC/internal/optalt", 0); setprop("/FMGC/internal/landing-time", -99); - setprop("/FMGC/internal/align1-time", -99); - setprop("/FMGC/internal/align2-time", -99); - setprop("/FMGC/internal/align3-time", -99); + FMGCAlignTime[0].setValue(-99); + FMGCAlignTime[1].setValue(-99); + FMGCAlignTime[2].setValue(-99); setprop("/FMGC/internal/block-fuel-time", -99); setprop("/FMGC/internal/fuel-pred-time", -99); masterFMGC.start(); @@ -336,7 +336,7 @@ var updateFuel = func { final_time = final_fuel / (2.0 * ((zfw*zfw*-2e-10) + (zfw*0.0003) + 2.8903)); # x2 for 2 engines if (final_time < 0) { final_time = 0; - } else if (final_time > 480) { + } elsif (final_time > 480) { final_time = 480; } if (num(final_time) >= 60) { @@ -358,7 +358,7 @@ var updateFuel = func { final_fuel = final_time * 2.0 * ((zfw*zfw*-2e-10) + (zfw*0.0003) + 2.8903); # x2 for 2 engines if (final_fuel < 0) { final_fuel = 0; - } else if (final_fuel > 80000) { + } elsif (final_fuel > 80000) { final_fuel = 80000; } FMGCInternal.finalFuel = final_fuel / 1000; @@ -367,14 +367,14 @@ var updateFuel = func { # Calculate alternate fuel if (!FMGCInternal.altFuelSet and FMGCInternal.altAirportSet) { #calc - } else if (FMGCInternal.altFuelSet and FMGCInternal.altAirportSet) { + } elsif (FMGCInternal.altFuelSet and FMGCInternal.altAirportSet) { #dummy calc for now alt_fuel = 1000 * num(FMGCInternal.altFuel); zfw = 1000 * FMGCInternal.zfw; alt_time = alt_fuel / (2.0 * ((zfw*zfw*-2e-10) + (zfw*0.0003) + 2.8903)); # x2 for 2 engines if (alt_time < 0) { alt_time = 0; - } else if (alt_time > 480) { + } elsif (alt_time > 480) { alt_time = 480; } if (num(alt_time) >= 60) { @@ -384,7 +384,7 @@ var updateFuel = func { } else { FMGCInternal.altTime = sprintf("%04d", alt_time); } - } else if (!FMGCInternal.altFuelSet) { + } elsif (!FMGCInternal.altFuelSet) { FMGCInternal.altFuel = 0.0; FMGCInternal.altTime = "0000"; } @@ -415,7 +415,7 @@ var updateFuel = func { trip_fuel = 4.018e+02 + (dist*3.575e+01) + (dist*dist*-4.260e-02) + (dist*dist*dist*-1.446e-05) + (dist*dist*dist*dist*4.101e-09) + (dist*dist*dist*dist*dist*-6.753e-13) + (dist*dist*dist*dist*dist*dist*5.074e-17) + (crz*-2.573e+01) + (dist*crz*-1.583e-01) + (dist*dist*crz*8.147e-04) + (dist*dist*dist*crz*4.485e-08) + (dist*dist*dist*dist*crz*-7.656e-12) + (dist*dist*dist*dist*dist*crz*4.503e-16) + (crz*crz*4.427e-01) + (dist*crz*crz*-1.137e-03) + (dist*dist*crz*crz*-4.409e-06) + (dist*dist*dist*crz*crz*-3.345e-11) + (dist*dist*dist*dist*crz*crz*4.985e-15) + (crz*crz*crz*-2.471e-03) + (dist*crz*crz*crz*1.223e-05) + (dist*dist*crz*crz*crz*9.660e-09) + (dist*dist*dist*crz*crz*crz*-2.127e-14) + (crz*crz*crz*crz*5.714e-06) + (dist*crz*crz*crz*crz*-3.546e-08) + (dist*dist*crz*crz*crz*crz*-7.536e-12) + (crz*crz*crz*crz*crz*-4.061e-09) + (dist*crz*crz*crz*crz*crz*3.355e-11) + (crz*crz*crz*crz*crz*crz*-1.451e-12); if (trip_fuel < 400) { trip_fuel = 400; - } else if (trip_fuel > 80000) { + } elsif (trip_fuel > 80000) { trip_fuel = 80000; } @@ -425,7 +425,7 @@ var updateFuel = func { trip_time = 9.095e-02 + (dist*-3.968e-02) + (dist*dist*4.302e-04) + (dist*dist*dist*2.005e-07) + (dist*dist*dist*dist*-6.876e-11) + (dist*dist*dist*dist*dist*1.432e-14) + (dist*dist*dist*dist*dist*dist*-1.177e-18) + (crz*7.348e-01) + (dist*crz*3.310e-03) + (dist*dist*crz*-8.700e-06) + (dist*dist*dist*crz*-4.214e-10) + (dist*dist*dist*dist*crz*5.652e-14) + (dist*dist*dist*dist*dist*crz*-6.379e-18) + (crz*crz*-1.449e-02) + (dist*crz*crz*-7.508e-06) + (dist*dist*crz*crz*4.529e-08) + (dist*dist*dist*crz*crz*3.699e-13) + (dist*dist*dist*dist*crz*crz*8.466e-18) + (crz*crz*crz*1.108e-04) + (dist*crz*crz*crz*-4.126e-08) + (dist*dist*crz*crz*crz*-9.645e-11) + (dist*dist*dist*crz*crz*crz*-1.544e-16) + (crz*crz*crz*crz*-4.123e-07) + (dist*crz*crz*crz*crz*1.831e-10) + (dist*dist*crz*crz*crz*crz*7.438e-14) + (crz*crz*crz*crz*crz*7.546e-10) + (dist*crz*crz*crz*crz*crz*-1.921e-13) + (crz*crz*crz*crz*crz*crz*-5.453e-13); if (trip_time < 10) { trip_time = 10; - } else if (trip_time > 480) { + } elsif (trip_time > 480) { trip_time = 480; } # if (low air conditioning) { @@ -433,7 +433,7 @@ var updateFuel = func { #} # if (total anti-ice) { # trip_fuel = trip_fuel * 1.045; - #} else if (engine anti-ice) { + #} elsif (engine anti-ice) { # trip_fuel = trip_fuel * 1.02; #} @@ -442,7 +442,7 @@ var updateFuel = func { trip_fuel = trip_fuel + (landing_weight_correction * (FMGCInternal.lw * 1000 - 121254.24421) / 2204.622622); if (trip_fuel < 400) { trip_fuel = 400; - } else if (trip_fuel > 80000) { + } elsif (trip_fuel > 80000) { trip_fuel = 80000; } @@ -470,7 +470,7 @@ var updateFuel = func { FMGCInternal.rtePercent = 15.0; # need reasearch on this value } } - } else if (FMGCInternal.rtePercentSet) { + } elsif (FMGCInternal.rtePercentSet) { FMGCInternal.rteRsv = num(FMGCInternal.tripFuel * FMGCInternal.rtePercent / 100.0); } else { if (num(FMGCInternal.tripFuel) <= 0.0) { @@ -500,7 +500,7 @@ var updateFuel = func { extra_time = extra_fuel / (2.0 * ((lw*lw*-2e-10) + (lw*0.0003) + 2.8903)); # x2 for 2 engines if (extra_time < 0) { extra_time = 0; - } else if (extra_time > 480) { + } elsif (extra_time > 480) { extra_time = 480; } if (num(extra_time) >= 60) { @@ -608,76 +608,47 @@ var radios = maketimer(1, func() { adf1(); }); - - -var prop_n1_left = pts.Engines.Engine.n1Actual[0]; -var prop_n1_right = pts.Engines.Engine.n1Actual[1]; -#var prop_nmodelat = Modes.PFD.FMA.rollMode; -#var prop_mode = Modes.PFD.FMA.pitchMode; -var prop_gs = pts.Velocities.groundspeed; -var prop_alt = pts.Instrumentation.Altimeter.indicatedFt; -var prop_state1 = pts.Systems.Thrust.state[0]; -var prop_state2 = pts.Systems.Thrust.state[1]; -#var prop_accel_agl_ft = Setting.reducAglFt; -var prop_gear0 = pts.Gear.wow[0]; -#var prop_altSel = Input.alt; +var newphase = nil; var masterFMGC = maketimer(0.2, func { - n1_left = prop_n1_left.getValue(); - n1_right = prop_n1_right.getValue(); + n1_left = pts.Engines.Engine.n1Actual[0].getValue(); + n1_right = pts.Engines.Engine.n1Actual[1].getValue(); modelat = Modes.PFD.FMA.rollMode.getValue(); mode = Modes.PFD.FMA.pitchMode.getValue(); - gs = prop_gs.getValue(); - alt = prop_alt.getValue(); + gs = pts.Velocities.groundspeed.getValue(); + alt = pts.Instrumentation.Altimeter.indicatedFt.getValue(); # cruiseft = FMGCInternal.crzFt; # cruiseft_b = FMGCInternal.crzFt - 200; - state1 = prop_state1.getValue(); - state2 = prop_state2.getValue(); + state1 = pts.Systems.Thrust.state[0].getValue(); + state2 = pts.Systems.Thrust.state[1].getValue(); accel_agl_ft = Setting.reducAglFt.getValue(); - gear0 = prop_gear0.getBoolValue(); + gear0 = pts.Gear.wow[0].getValue(); altSel = Input.alt.getValue(); - var phase = FMGCInternal.phase; - var newphase = phase; - - if (phase == 0) { + newphase = FMGCInternal.phase; + if (FMGCInternal.phase == 0) { if (gear0 and ((n1_left >= 85 and n1_right >= 85 and mode == "SRS") or gs >= 90)) { newphase = 1; systems.PNEU.pressMode.setValue("TO"); } - - } - - else if (phase == 1) { - + } elsif (FMGCInternal.phase == 1) { if (gear0) { - if ((n1_left < 85 or n1_right < 85) and gs < 90 and mode == " ") { # rejected takeoff newphase = 0; systems.PNEU.pressMode.setValue("GN"); } - - } - else if (((mode != "SRS" and mode != " ") or alt >= accel_agl_ft)) { + } elsif (((mode != "SRS" and mode != " ") or alt >= accel_agl_ft)) { newphase = 2; systems.PNEU.pressMode.setValue("TO"); } - - } - - else if (phase == 2) { - + } elsif (FMGCInternal.phase == 2) { if ((mode == "ALT CRZ" or mode == "ALT CRZ*")) { newphase = 3; systems.PNEU.pressMode.setValue("CR"); } - - } - - else if (phase == 3) { - + } elsif (FMGCInternal.phase == 3) { if (FMGCInternal.crzFl >= 200) { if ((flightPlanController.arrivalDist <= 200 or altSel < 20000)) { newphase = 4; @@ -689,44 +660,31 @@ var masterFMGC = maketimer(0.2, func { systems.PNEU.pressMode.setValue("DE"); } } - - } - - else if (phase == 4) { - + } elsif (FMGCInternal.phase == 4) { if (getprop("/FMGC/internal/decel")) { newphase = 5; } - else if (altSel == (FMGCInternal.crzFl * 100)) { # back to CRZ state + elsif (altSel == (FMGCInternal.crzFl * 100)) { # back to CRZ state newphase = 3; systems.PNEU.pressMode.setValue("CR"); } - - } - - else if (phase == 5) { - + } elsif (FMGCInternal.phase == 5) { if (state1 == "TOGA" and state2 == "TOGA") { newphase = 6; systems.PNEU.pressMode.setValue("TO"); Input.toga.setValue(1); } - - } - - else if (phase == 6) { - + } elsif (FMGCInternal.phase == 6) { if (alt >= accel_agl_ft) { # todo when insert altn or new dest newphase = 2; } - } if (flightPlanController.num[2].getValue() > 0 and getprop("/FMGC/flightplan[2]/active") == 1 and flightPlanController.arrivalDist <= 15 and (modelat == "NAV" or modelat == "LOC" or modelat == "LOC*") and pts.Position.gearAglFt.getValue() < 9500) { #todo decel pseudo waypoint setprop("/FMGC/internal/decel", 1); - } else if (getprop("/FMGC/internal/decel") == 1 and (phase == 0 or phase == 6)) { + } elsif (getprop("/FMGC/internal/decel") == 1 and (FMGCInternal.phase == 0 or FMGCInternal.phase == 6)) { setprop("/FMGC/internal/decel", 0); } @@ -740,7 +698,7 @@ var masterFMGC = maketimer(0.2, func { FMGCInternal.maxspeed = fmgc.FMGCInternal.vmo_mmo; } - if (newphase != phase) { # phase changed + if (newphase != FMGCInternal.phase) { # phase changed FMGCInternal.phase = newphase; FMGCNodes.phase.setValue(newphase); } @@ -828,7 +786,7 @@ var masterFMGC = maketimer(0.2, func { if (!fmgc.FMGCInternal.vappSpeedSet) { if (FMGCInternal.destWind < 5) { FMGCInternal.vapp = FMGCInternal.vls + 5; - } else if (FMGCInternal.destWind > 15) { + } elsif (FMGCInternal.destWind > 15) { FMGCInternal.vapp = FMGCInternal.vls + 15; } else { FMGCInternal.vapp = FMGCInternal.vls + FMGCInternal.destWind; @@ -836,7 +794,7 @@ var masterFMGC = maketimer(0.2, func { } # predicted takeoff speeds - if (phase == 1) { + if (FMGCInternal.phase == 1) { FMGCInternal.clean_to = FMGCInternal.clean; FMGCInternal.vs1g_clean_to = FMGCInternal.vs1g_clean; FMGCInternal.vs1g_conf_2_to = FMGCInternal.vs1g_conf_2; @@ -858,7 +816,7 @@ var masterFMGC = maketimer(0.2, func { } # predicted approach (temp go-around) speeds - if (phase == 5 or phase == 6) { + if (FMGCInternal.phase == 5 or FMGCInternal.phase == 6) { FMGCInternal.clean_appr = FMGCInternal.clean; FMGCInternal.vs1g_clean_appr = FMGCInternal.vs1g_clean; FMGCInternal.vs1g_conf_2_appr = FMGCInternal.vs1g_conf_2; @@ -892,7 +850,7 @@ var masterFMGC = maketimer(0.2, func { if (!fmgc.FMGCInternal.vappSpeedSet) { if (FMGCInternal.destWind < 5) { FMGCInternal.vapp_appr = FMGCInternal.vls_appr + 5; - } else if (FMGCInternal.destWind > 15) { + } elsif (FMGCInternal.destWind > 15) { FMGCInternal.vapp_appr = FMGCInternal.vls_appr + 15; } else { FMGCInternal.vapp_appr = FMGCInternal.vls_appr + FMGCInternal.destWind; @@ -928,7 +886,7 @@ var masterFMGC = maketimer(0.2, func { } else { FMGCInternal.vls_min = FMGCInternal.vs1g_clean * 1.23; } - } else if (flap == 1) { # 1 + } elsif (flap == 1) { # 1 FMGCInternal.vsw = FMGCInternal.vs1g_conf_2; FMGCInternal.minspeed = FMGCInternal.slat; @@ -937,7 +895,7 @@ var masterFMGC = maketimer(0.2, func { } else { FMGCInternal.vls_min = FMGCInternal.vs1g_conf_1 * 1.23; } - } else if (flap == 2) { # 1+F + } elsif (flap == 2) { # 1+F FMGCInternal.vsw = FMGCInternal.vs1g_conf_1f; FMGCInternal.minspeed = FMGCInternal.slat; @@ -946,7 +904,7 @@ var masterFMGC = maketimer(0.2, func { } else { FMGCInternal.vls_min = FMGCInternal.vs1g_conf_1f * 1.23; } - } else if (flap == 3) { # 2 + } elsif (flap == 3) { # 2 FMGCInternal.vsw = FMGCInternal.vs1g_conf_2; FMGCInternal.minspeed = FMGCInternal.flap2; @@ -955,7 +913,7 @@ var masterFMGC = maketimer(0.2, func { } else { FMGCInternal.vls_min = FMGCInternal.vs1g_conf_2 * 1.23; } - } else if (flap == 4) { # 3 + } elsif (flap == 4) { # 3 FMGCInternal.vsw = FMGCInternal.vs1g_conf_3; FMGCInternal.minspeed = FMGCInternal.flap3; @@ -964,7 +922,7 @@ var masterFMGC = maketimer(0.2, func { } else { FMGCInternal.vls_min = FMGCInternal.vs1g_conf_3 * 1.23; } - } else if (flap == 5) { # FULL + } elsif (flap == 5) { # FULL FMGCInternal.vsw = FMGCInternal.vs1g_conf_full; if (FMGCInternal.vappSpeedSet) { FMGCInternal.minspeed = FMGCInternal.vapp_appr; @@ -979,7 +937,6 @@ var masterFMGC = maketimer(0.2, func { } } - #if (gear0 and pts.Controls.Flight.flapsPos.getValue() < 5 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA")) { if (gear0 and flap < 5 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA")) { if (!FMGCInternal.takeoffState) { fmgc.FMGCNodes.toState.setValue(1); @@ -1011,26 +968,26 @@ var updateAirportRadios = func { runway_ils = destination_rwy.ils_frequency_mhz; if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set") and !getprop("/FMGC/internal/ils1crs-set")) { setprop("/FMGC/internal/ils1freq-calculated", runway_ils); - setprop("instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); - setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); - } else if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set")) { + setprop("/instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); + setprop("/instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); + } elsif (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set")) { setprop("/FMGC/internal/ils1freq-calculated", runway_ils); - setprop("instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); - } else if (!getprop("/FMGC/internal/ils1crs-set")) { - setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); + setprop("/instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); + } elsif (!getprop("/FMGC/internal/ils1crs-set")) { + setprop("/instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); } - } else if (airportRadiosPhase <= 1 and departure_rwy != nil) { + } elsif (airportRadiosPhase <= 1 and departure_rwy != nil) { magnetic_hdg = geo.normdeg(departure_rwy.heading - getprop("/environment/magnetic-variation-deg")); runway_ils = departure_rwy.ils_frequency_mhz; if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set") and !getprop("/FMGC/internal/ils1crs-set")) { setprop("/FMGC/internal/ils1freq-calculated", runway_ils); - setprop("instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); - setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); - } else if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set")) { + setprop("/instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); + setprop("/instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); + } elsif (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set")) { setprop("/FMGC/internal/ils1freq-calculated", runway_ils); - setprop("instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); - } else if (!getprop("/FMGC/internal/ils1crs-set")) { - setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); + setprop("/instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); + } elsif (!getprop("/FMGC/internal/ils1crs-set")) { + setprop("/instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); } } @@ -1120,59 +1077,59 @@ var ManagedSPD = maketimer(0.25, func { if (FMGCInternal.mngSpdCmd != srsSPD) { FMGCInternal.mngSpdCmd = srsSPD; } - } else if ((FMGCInternal.phase == 2 or FMGCInternal.phase == 3) and altitude <= 10050) { + } elsif ((FMGCInternal.phase == 2 or FMGCInternal.phase == 3) and altitude <= 10050) { if (FMGCInternal.mngKtsMach) { FMGCInternal.mngKtsMach = 0; } if (FMGCInternal.mngSpdCmd != 250 and !decel) { FMGCInternal.mngSpdCmd = 250; - } else if (FMGCInternal.mngSpdCmd != FMGCInternal.minspeed and decel) { + } elsif (FMGCInternal.mngSpdCmd != FMGCInternal.minspeed and decel) { FMGCInternal.mngSpdCmd = FMGCInternal.minspeed; } - } else if ((FMGCInternal.phase == 2 or FMGCInternal.phase == 3) and altitude > 10070 and !FMGCInternal.machSwitchover) { + } elsif ((FMGCInternal.phase == 2 or FMGCInternal.phase == 3) and altitude > 10070 and !FMGCInternal.machSwitchover) { if (FMGCInternal.mngKtsMach) { FMGCInternal.mngKtsMach = 0; } if (FMGCInternal.mngSpdCmd != mng_alt_spd) { FMGCInternal.mngSpdCmd = mng_alt_spd; } - } else if ((FMGCInternal.phase == 2 or FMGCInternal.phase == 3) and altitude > 10070 and FMGCInternal.machSwitchover) { + } elsif ((FMGCInternal.phase == 2 or FMGCInternal.phase == 3) and altitude > 10070 and FMGCInternal.machSwitchover) { if (!FMGCInternal.mngKtsMach) { FMGCInternal.mngKtsMach = 1; } if (FMGCInternal.mngSpdCmd != mng_alt_mach) { FMGCInternal.mngSpdCmd = mng_alt_mach; } - } else if (FMGCInternal.phase == 4 and altitude > 11000 and !FMGCInternal.machSwitchover) { + } elsif (FMGCInternal.phase == 4 and altitude > 11000 and !FMGCInternal.machSwitchover) { if (FMGCInternal.mngKtsMach) { FMGCInternal.mngKtsMach = 0; } if (FMGCInternal.mngSpdCmd != mng_alt_spd) { FMGCInternal.mngSpdCmd = mng_alt_spd; } - } else if (FMGCInternal.phase == 4 and altitude > 11000 and FMGCInternal.machSwitchover) { + } elsif (FMGCInternal.phase == 4 and altitude > 11000 and FMGCInternal.machSwitchover) { if (!FMGCInternal.mngKtsMach) { FMGCInternal.mngKtsMach = 1; } if (FMGCInternal.mngSpdCmd != mng_alt_mach) { FMGCInternal.mngSpdCmd = mng_alt_mach; } - } else if ((FMGCInternal.phase == 4 or FMGCInternal.phase == 5 or FMGCInternal.phase == 6) and altitude > 11000 and !FMGCInternal.machSwitchover) { + } elsif ((FMGCInternal.phase == 4 or FMGCInternal.phase == 5 or FMGCInternal.phase == 6) and altitude > 11000 and !FMGCInternal.machSwitchover) { if (FMGCInternal.mngKtsMach) { FMGCInternal.mngKtsMach = 0; } if (FMGCInternal.mngSpdCmd != mng_alt_spd and !decel) { FMGCInternal.mngSpdCmd = mng_alt_spd; - } else if (FMGCInternal.mngSpdCmd != FMGCInternal.minspeed and decel) { + } elsif (FMGCInternal.mngSpdCmd != FMGCInternal.minspeed and decel) { FMGCInternal.mngSpdCmd = FMGCInternal.minspeed; } - } else if ((FMGCInternal.phase == 4 or FMGCInternal.phase == 5 or FMGCInternal.phase == 6) and altitude <= 10980) { + } elsif ((FMGCInternal.phase == 4 or FMGCInternal.phase == 5 or FMGCInternal.phase == 6) and altitude <= 10980) { if (FMGCInternal.mngKtsMach) { FMGCInternal.mngKtsMach = 0; } if (FMGCInternal.mngSpdCmd != 250 and !decel) { FMGCInternal.mngSpdCmd = 250; - } else if (FMGCInternal.mngSpdCmd != FMGCInternal.minspeed and decel) { + } elsif (FMGCInternal.mngSpdCmd != FMGCInternal.minspeed and decel) { FMGCInternal.mngSpdCmd = FMGCInternal.minspeed; } } @@ -1185,13 +1142,13 @@ var ManagedSPD = maketimer(0.25, func { if (ktsmach and !FMGCInternal.mngKtsMach) { Input.ktsMach.setValue(0); - } else if (!ktsmach and FMGCInternal.mngKtsMach) { + } elsif (!ktsmach and FMGCInternal.mngKtsMach) { Input.ktsMach.setValue(1); } if (kts_sel != FMGCInternal.mngSpd and !ktsmach) { Input.kts.setValue(FMGCInternal.mngSpd); - } else if (mach_sel != FMGCInternal.mngSpd and ktsmach) { + } elsif (mach_sel != FMGCInternal.mngSpd and ktsmach) { Input.mach.setValue(FMGCInternal.mngSpd); } } else { @@ -1233,9 +1190,9 @@ setlistener("/systems/navigation/adr/operating-1", func() { timer48gpsAlign1.stop(); } - if (getprop("/FMGC/internal/align1-time") == -99) { + if (FMGCAlignTime[0].getValue() == -99) { timer48gpsAlign1.start(); - setprop("/FMGC/internal/align1-time", pts.Sim.Time.elapsedSec.getValue()); + FMGCAlignTime[0].setValue(pts.Sim.Time.elapsedSec.getValue()); } }, 0, 0); @@ -1245,9 +1202,9 @@ setlistener("/systems/navigation/adr/operating-2", func() { timer48gpsAlign2.stop(); } - if (getprop("/FMGC/internal/align2-time") == -99) { + if (FMGCAlignTime[1].getValue() == -99) { timer48gpsAlign2.start(); - setprop("/FMGC/internal/align2-time", pts.Sim.Time.elapsedSec.getValue()); + FMGCAlignTime[1].setValue(pts.Sim.Time.elapsedSec.getValue()); } }, 0, 0); @@ -1257,9 +1214,9 @@ setlistener("/systems/navigation/adr/operating-3", func() { timer48gpsAlign3.stop(); } - if (getprop("/FMGC/internal/align3-time") == -99) { + if (FMGCAlignTime[2].getValue() == -99) { timer48gpsAlign3.start(); - setprop("/FMGC/internal/align3-time", pts.Sim.Time.elapsedSec.getValue()); + FMGCAlignTime[2].setValue(pts.Sim.Time.elapsedSec.getValue()); } }, 0, 0); @@ -1306,25 +1263,25 @@ var timer30secLanding = maketimer(1, func() { }); var timer48gpsAlign1 = maketimer(1, func() { - if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/align1-time") + 48 or getprop("/systems/acconfig/options/adirs-skip")) { - setprop("/FMGC/internal/align1-done", 1); - setprop("/FMGC/internal/align1-time", -99); + if (pts.Sim.Time.elapsedSec.getValue() > (FMGCAlignTime[0].getValue() + 48) or adirsSkip.getValue()) { + FMGCAlignDone[0].setValue(1); + FMGCAlignTime[0].setValue(-99); timer48gpsAlign1.stop(); } }); var timer48gpsAlign2 = maketimer(1, func() { - if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/align2-time") + 48 or getprop("/systems/acconfig/options/adirs-skip")) { - setprop("/FMGC/internal/align2-done", 1); - setprop("/FMGC/internal/align2-time", -99); + if (pts.Sim.Time.elapsedSec.getValue() > (FMGCAlignTime[1].getValue() + 48) or adirsSkip.getValue()) { + FMGCAlignDone[1].setValue(1); + FMGCAlignTime[1].setValue(-99); timer48gpsAlign2.stop(); } }); var timer48gpsAlign3 = maketimer(1, func() { - if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/align3-time") + 48 or getprop("/systems/acconfig/options/adirs-skip")) { - setprop("/FMGC/internal/align3-done", 1); - setprop("/FMGC/internal/align3-time", -99); + if (pts.Sim.Time.elapsedSec.getValue() > (FMGCAlignTime[2].getValue() + 48) or adirsSkip.getValue()) { + FMGCAlignDone[2].setValue(1); + FMGCAlignTime[2].setValue(-99); timer48gpsAlign3.stop(); } }); diff --git a/Nasal/MCDU/FLIGHTLOG.nas b/Nasal/MCDU/FLIGHTLOG.nas index cffe7bd4..523c78ec 100644 --- a/Nasal/MCDU/FLIGHTLOG.nas +++ b/Nasal/MCDU/FLIGHTLOG.nas @@ -128,15 +128,17 @@ var doorR4_pos = props.globals.getNode("/sim/model/door-positions/doorr4/positio # Detect OFF without IN var lastgs0 = 0; -#var lastgear0 = 0; +var phase = 0; +var gs = 0; +var gear0 = 0; var lastgsrestart = 0; # Check for A/C state change - advice me for a better method, please :/ var waitingOOOIChange = maketimer(1, func(){ # 1sec precision - var phase = fmgc.FMGCInternal.phase; - var gs = pts.Velocities.groundspeed.getValue(); - var gear0 = pts.Gear.wow[0].getBoolValue(); + phase = fmgc.FMGCInternal.phase; + gs = pts.Velocities.groundspeed.getValue(); + gear0 = pts.Gear.wow[0].getBoolValue(); #print(sprintf("OOOI check: %d %d %.2f %s",expectedOOOIState,phase,gs,gear0)); @@ -183,14 +185,14 @@ var waitingOOOIChange = maketimer(1, func(){ # 1sec precision expectedOOOIState = 1; # go on to OFF state } else if (gs > 9 and lastgsrestart == 0) { # try to detect OFF without IN - lastgsrestart = int(getprop("/sim/time/elapsed-sec")); + lastgsrestart = int(pts.Sim.Time.elapsedSec.getValue()); } } }); var engine_one_chk_OOOI = setlistener("/engines/engine[0]/state", func { - if (getprop("/engines/engine[0]/state") == 3) { + if (pts.Engines.Engine.state[0].getValue() == 3) { removelistener(engine_one_chk_OOOI); waitingOOOIChange.start(); } From 0c8b70403b2b2df3d509a4283af32dbd9932ee91 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sun, 13 Jun 2021 19:41:53 +0100 Subject: [PATCH 42/96] Add missing variable --- Nasal/FMGC/FMGC.nas | 1 + 1 file changed, 1 insertion(+) diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index 33fa7ea0..ba125b25 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -31,6 +31,7 @@ var hdg = 0; var alt = 0; var altitude = 0; var flap = 0; +var flaps = 0; var freqnav0uf = 0; var freqnav0 = 0; var namenav0 = "XX"; From e4548f7eef439f8603a3e48d92bb31b661618c59 Mon Sep 17 00:00:00 2001 From: Inuyaksa Date: Mon, 14 Jun 2021 21:32:43 +0200 Subject: [PATCH 43/96] Restore style changes by legoboy --- Nasal/FMGC/FMGC.nas | 226 ++++++++++++++++++-------------------------- 1 file changed, 94 insertions(+), 132 deletions(-) diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index a69c99db..d6ece00e 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -31,6 +31,7 @@ var hdg = 0; var alt = 0; var altitude = 0; var flap = 0; +var flaps = 0; var freqnav0uf = 0; var freqnav0 = 0; var namenav0 = "XX"; @@ -69,8 +70,8 @@ setprop("position/gear-agl-ft", 0); setprop("/it-autoflight/settings/accel-agl-ft", 1500); #eventually set to 1500 above runway setprop("/it-autoflight/internal/vert-speed-fpm", 0); setprop("/it-autoflight/output/fma-pwr", 0); -setprop("instrumentation/nav[0]/nav-id", "XXX"); -setprop("instrumentation/nav[1]/nav-id", "XXX"); +setprop("/instrumentation/nav[0]/nav-id", "XXX"); +setprop("/instrumentation/nav[1]/nav-id", "XXX"); setprop("/FMGC/internal/ils1-mcdu", "XXX/999.99"); setprop("/FMGC/internal/ils2-mcdu", "XXX/999.99"); setprop("/FMGC/internal/vor1-mcdu", "XXX/999.99"); @@ -78,6 +79,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 FMGCAlignDone = [props.globals.initNode("/FMGC/internal/align1-done", 0, "BOOL"), props.globals.initNode("/FMGC/internal/align2-done", 0, "BOOL"), props.globals.initNode("/FMGC/internal/align3-done", 0, "BOOL")]; +var FMGCAlignTime = [props.globals.initNode("/FMGC/internal/align1-time", 0, "DOUBLE"), props.globals.initNode("/FMGC/internal/align2-time", 0, "DOUBLE"), props.globals.initNode("/FMGC/internal/align3-time", 0, "DOUBLE")]; +var adirsSkip = props.globals.getNode("/systems/acconfig/options/adirs-skip"); var blockCalculating = props.globals.initNode("/FMGC/internal/block-calculating", 0, "BOOL"); var fuelCalculating = props.globals.initNode("/FMGC/internal/fuel-calculating", 0, "BOOL"); @@ -94,9 +98,9 @@ var FMGCinit = func { setprop("/FMGC/internal/loc-source", "NAV0"); setprop("/FMGC/internal/optalt", 0); setprop("/FMGC/internal/landing-time", -99); - setprop("/FMGC/internal/align1-time", -99); - setprop("/FMGC/internal/align2-time", -99); - setprop("/FMGC/internal/align3-time", -99); + FMGCAlignTime[0].setValue(-99); + FMGCAlignTime[1].setValue(-99); + FMGCAlignTime[2].setValue(-99); setprop("/FMGC/internal/block-fuel-time", -99); setprop("/FMGC/internal/fuel-pred-time", -99); masterFMGC.start(); @@ -333,7 +337,7 @@ var updateFuel = func { final_time = final_fuel / (2.0 * ((zfw*zfw*-2e-10) + (zfw*0.0003) + 2.8903)); # x2 for 2 engines if (final_time < 0) { final_time = 0; - } else if (final_time > 480) { + } elsif (final_time > 480) { final_time = 480; } if (num(final_time) >= 60) { @@ -355,7 +359,7 @@ var updateFuel = func { final_fuel = final_time * 2.0 * ((zfw*zfw*-2e-10) + (zfw*0.0003) + 2.8903); # x2 for 2 engines if (final_fuel < 0) { final_fuel = 0; - } else if (final_fuel > 80000) { + } elsif (final_fuel > 80000) { final_fuel = 80000; } FMGCInternal.finalFuel = final_fuel / 1000; @@ -364,14 +368,14 @@ var updateFuel = func { # Calculate alternate fuel if (!FMGCInternal.altFuelSet and FMGCInternal.altAirportSet) { #calc - } else if (FMGCInternal.altFuelSet and FMGCInternal.altAirportSet) { + } elsif (FMGCInternal.altFuelSet and FMGCInternal.altAirportSet) { #dummy calc for now alt_fuel = 1000 * num(FMGCInternal.altFuel); zfw = 1000 * FMGCInternal.zfw; alt_time = alt_fuel / (2.0 * ((zfw*zfw*-2e-10) + (zfw*0.0003) + 2.8903)); # x2 for 2 engines if (alt_time < 0) { alt_time = 0; - } else if (alt_time > 480) { + } elsif (alt_time > 480) { alt_time = 480; } if (num(alt_time) >= 60) { @@ -381,7 +385,7 @@ var updateFuel = func { } else { FMGCInternal.altTime = sprintf("%04d", alt_time); } - } else if (!FMGCInternal.altFuelSet) { + } elsif (!FMGCInternal.altFuelSet) { FMGCInternal.altFuel = 0.0; FMGCInternal.altTime = "0000"; } @@ -412,7 +416,7 @@ var updateFuel = func { trip_fuel = 4.018e+02 + (dist*3.575e+01) + (dist*dist*-4.260e-02) + (dist*dist*dist*-1.446e-05) + (dist*dist*dist*dist*4.101e-09) + (dist*dist*dist*dist*dist*-6.753e-13) + (dist*dist*dist*dist*dist*dist*5.074e-17) + (crz*-2.573e+01) + (dist*crz*-1.583e-01) + (dist*dist*crz*8.147e-04) + (dist*dist*dist*crz*4.485e-08) + (dist*dist*dist*dist*crz*-7.656e-12) + (dist*dist*dist*dist*dist*crz*4.503e-16) + (crz*crz*4.427e-01) + (dist*crz*crz*-1.137e-03) + (dist*dist*crz*crz*-4.409e-06) + (dist*dist*dist*crz*crz*-3.345e-11) + (dist*dist*dist*dist*crz*crz*4.985e-15) + (crz*crz*crz*-2.471e-03) + (dist*crz*crz*crz*1.223e-05) + (dist*dist*crz*crz*crz*9.660e-09) + (dist*dist*dist*crz*crz*crz*-2.127e-14) + (crz*crz*crz*crz*5.714e-06) + (dist*crz*crz*crz*crz*-3.546e-08) + (dist*dist*crz*crz*crz*crz*-7.536e-12) + (crz*crz*crz*crz*crz*-4.061e-09) + (dist*crz*crz*crz*crz*crz*3.355e-11) + (crz*crz*crz*crz*crz*crz*-1.451e-12); if (trip_fuel < 400) { trip_fuel = 400; - } else if (trip_fuel > 80000) { + } elsif (trip_fuel > 80000) { trip_fuel = 80000; } @@ -422,7 +426,7 @@ var updateFuel = func { trip_time = 9.095e-02 + (dist*-3.968e-02) + (dist*dist*4.302e-04) + (dist*dist*dist*2.005e-07) + (dist*dist*dist*dist*-6.876e-11) + (dist*dist*dist*dist*dist*1.432e-14) + (dist*dist*dist*dist*dist*dist*-1.177e-18) + (crz*7.348e-01) + (dist*crz*3.310e-03) + (dist*dist*crz*-8.700e-06) + (dist*dist*dist*crz*-4.214e-10) + (dist*dist*dist*dist*crz*5.652e-14) + (dist*dist*dist*dist*dist*crz*-6.379e-18) + (crz*crz*-1.449e-02) + (dist*crz*crz*-7.508e-06) + (dist*dist*crz*crz*4.529e-08) + (dist*dist*dist*crz*crz*3.699e-13) + (dist*dist*dist*dist*crz*crz*8.466e-18) + (crz*crz*crz*1.108e-04) + (dist*crz*crz*crz*-4.126e-08) + (dist*dist*crz*crz*crz*-9.645e-11) + (dist*dist*dist*crz*crz*crz*-1.544e-16) + (crz*crz*crz*crz*-4.123e-07) + (dist*crz*crz*crz*crz*1.831e-10) + (dist*dist*crz*crz*crz*crz*7.438e-14) + (crz*crz*crz*crz*crz*7.546e-10) + (dist*crz*crz*crz*crz*crz*-1.921e-13) + (crz*crz*crz*crz*crz*crz*-5.453e-13); if (trip_time < 10) { trip_time = 10; - } else if (trip_time > 480) { + } elsif (trip_time > 480) { trip_time = 480; } # if (low air conditioning) { @@ -430,7 +434,7 @@ var updateFuel = func { #} # if (total anti-ice) { # trip_fuel = trip_fuel * 1.045; - #} else if (engine anti-ice) { + #} elsif (engine anti-ice) { # trip_fuel = trip_fuel * 1.02; #} @@ -439,7 +443,7 @@ var updateFuel = func { trip_fuel = trip_fuel + (landing_weight_correction * (FMGCInternal.lw * 1000 - 121254.24421) / 2204.622622); if (trip_fuel < 400) { trip_fuel = 400; - } else if (trip_fuel > 80000) { + } elsif (trip_fuel > 80000) { trip_fuel = 80000; } @@ -467,7 +471,7 @@ var updateFuel = func { FMGCInternal.rtePercent = 15.0; # need reasearch on this value } } - } else if (FMGCInternal.rtePercentSet) { + } elsif (FMGCInternal.rtePercentSet) { FMGCInternal.rteRsv = num(FMGCInternal.tripFuel * FMGCInternal.rtePercent / 100.0); } else { if (num(FMGCInternal.tripFuel) <= 0.0) { @@ -497,7 +501,7 @@ var updateFuel = func { extra_time = extra_fuel / (2.0 * ((lw*lw*-2e-10) + (lw*0.0003) + 2.8903)); # x2 for 2 engines if (extra_time < 0) { extra_time = 0; - } else if (extra_time > 480) { + } elsif (extra_time > 480) { extra_time = 480; } if (num(extra_time) >= 60) { @@ -605,76 +609,48 @@ var radios = maketimer(1, func() { adf1(); }); - - -var prop_n1_left = pts.Engines.Engine.n1Actual[0]; -var prop_n1_right = pts.Engines.Engine.n1Actual[1]; -#var prop_nmodelat = Modes.PFD.FMA.rollMode; -#var prop_mode = Modes.PFD.FMA.pitchMode; -var prop_gs = pts.Velocities.groundspeed; -var prop_alt = pts.Instrumentation.Altimeter.indicatedFt; -var prop_state1 = pts.Systems.Thrust.state[0]; -var prop_state2 = pts.Systems.Thrust.state[1]; -#var prop_accel_agl_ft = Setting.reducAglFt; -var prop_gear0 = pts.Gear.wow[0]; -#var prop_altSel = Input.alt; +var newphase = nil; var masterFMGC = maketimer(0.2, func { - n1_left = prop_n1_left.getValue(); - n1_right = prop_n1_right.getValue(); + n1_left = pts.Engines.Engine.n1Actual[0].getValue(); + n1_right = pts.Engines.Engine.n1Actual[1].getValue(); modelat = Modes.PFD.FMA.rollMode.getValue(); mode = Modes.PFD.FMA.pitchMode.getValue(); - gs = prop_gs.getValue(); - alt = prop_alt.getValue(); + gs = pts.Velocities.groundspeed.getValue(); + alt = pts.Instrumentation.Altimeter.indicatedFt.getValue(); # cruiseft = FMGCInternal.crzFt; # cruiseft_b = FMGCInternal.crzFt - 200; - state1 = prop_state1.getValue(); - state2 = prop_state2.getValue(); + state1 = pts.Systems.Thrust.state[0].getValue(); + state2 = pts.Systems.Thrust.state[1].getValue(); accel_agl_ft = Setting.reducAglFt.getValue(); - gear0 = prop_gear0.getBoolValue(); + gear0 = pts.Gear.wow[0].getValue(); altSel = Input.alt.getValue(); - var phase = FMGCInternal.phase; - var newphase = phase; - - if (phase == 0) { + newphase = FMGCInternal.phase; + if (FMGCInternal.phase == 0) { if (gear0 and ((n1_left >= 85 and n1_right >= 85 and mode == "SRS") or gs >= 90)) { newphase = 1; systems.PNEU.pressMode.setValue("TO"); } - - } - - else if (phase == 1) { - + } elsif (FMGCInternal.phase == 1) { if (gear0) { if ((n1_left < 85 or n1_right < 85) and gs < 90 and mode == " ") { # rejected takeoff newphase = 0; systems.PNEU.pressMode.setValue("GN"); } - - } - else if (((mode != "SRS" and mode != " ") or alt >= accel_agl_ft)) { + } elsif (((mode != "SRS" and mode != " ") or alt >= accel_agl_ft)) { newphase = 2; systems.PNEU.pressMode.setValue("TO"); } - - } - - else if (phase == 2) { - + } elsif (FMGCInternal.phase == 2) { if ((mode == "ALT CRZ" or mode == "ALT CRZ*")) { newphase = 3; systems.PNEU.pressMode.setValue("CR"); } - - } - - else if (phase == 3) { - + } elsif (FMGCInternal.phase == 3) { if (FMGCInternal.crzFl >= 200) { if ((flightPlanController.arrivalDist <= 200 or altSel < 20000)) { newphase = 4; @@ -686,33 +662,21 @@ var masterFMGC = maketimer(0.2, func { systems.PNEU.pressMode.setValue("DE"); } } - - } - - else if (phase == 4) { - + } elsif (FMGCInternal.phase == 4) { if (getprop("/FMGC/internal/decel")) { newphase = 5; } - else if (altSel == (FMGCInternal.crzFl * 100)) { # back to CRZ state + elsif (altSel == (FMGCInternal.crzFl * 100)) { # back to CRZ state newphase = 3; systems.PNEU.pressMode.setValue("CR"); } - - } - - else if (phase == 5) { - + } elsif (FMGCInternal.phase == 5) { if (state1 == "TOGA" and state2 == "TOGA") { newphase = 6; systems.PNEU.pressMode.setValue("TO"); Input.toga.setValue(1); } - - } - - else if (phase == 6) { - + } elsif (FMGCInternal.phase == 6) { if (alt >= accel_agl_ft) { # todo when insert altn or new dest newphase = 2; } @@ -723,7 +687,7 @@ var masterFMGC = maketimer(0.2, func { if (flightPlanController.num[2].getValue() > 0 and getprop("/FMGC/flightplan[2]/active") == 1 and flightPlanController.arrivalDist <= 15 and (modelat == "NAV" or modelat == "LOC" or modelat == "LOC*") and pts.Position.gearAglFt.getValue() < 9500) { #todo decel pseudo waypoint setprop("/FMGC/internal/decel", 1); - } else if (getprop("/FMGC/internal/decel") == 1 and (phase == 0 or phase == 6)) { + } elsif (getprop("/FMGC/internal/decel") == 1 and (FMGCInternal.phase == 0 or FMGCInternal.phase == 6)) { setprop("/FMGC/internal/decel", 0); } @@ -737,7 +701,7 @@ var masterFMGC = maketimer(0.2, func { FMGCInternal.maxspeed = fmgc.FMGCInternal.vmo_mmo; } - if (newphase != phase) { # phase changed + if (newphase != FMGCInternal.phase) { # phase changed FMGCInternal.phase = newphase; FMGCNodes.phase.setValue(newphase); } @@ -825,7 +789,7 @@ var masterFMGC = maketimer(0.2, func { if (!fmgc.FMGCInternal.vappSpeedSet) { if (FMGCInternal.destWind < 5) { FMGCInternal.vapp = FMGCInternal.vls + 5; - } else if (FMGCInternal.destWind > 15) { + } elsif (FMGCInternal.destWind > 15) { FMGCInternal.vapp = FMGCInternal.vls + 15; } else { FMGCInternal.vapp = FMGCInternal.vls + FMGCInternal.destWind; @@ -833,7 +797,7 @@ var masterFMGC = maketimer(0.2, func { } # predicted takeoff speeds - if (phase == 1) { + if (FMGCInternal.phase == 1) { FMGCInternal.clean_to = FMGCInternal.clean; FMGCInternal.vs1g_clean_to = FMGCInternal.vs1g_clean; FMGCInternal.vs1g_conf_2_to = FMGCInternal.vs1g_conf_2; @@ -855,7 +819,7 @@ var masterFMGC = maketimer(0.2, func { } # predicted approach (temp go-around) speeds - if (phase == 5 or phase == 6) { + if (FMGCInternal.phase == 5 or FMGCInternal.phase == 6) { FMGCInternal.clean_appr = FMGCInternal.clean; FMGCInternal.vs1g_clean_appr = FMGCInternal.vs1g_clean; FMGCInternal.vs1g_conf_2_appr = FMGCInternal.vs1g_conf_2; @@ -889,7 +853,7 @@ var masterFMGC = maketimer(0.2, func { if (!fmgc.FMGCInternal.vappSpeedSet) { if (FMGCInternal.destWind < 5) { FMGCInternal.vapp_appr = FMGCInternal.vls_appr + 5; - } else if (FMGCInternal.destWind > 15) { + } elsif (FMGCInternal.destWind > 15) { FMGCInternal.vapp_appr = FMGCInternal.vls_appr + 15; } else { FMGCInternal.vapp_appr = FMGCInternal.vls_appr + FMGCInternal.destWind; @@ -925,7 +889,7 @@ var masterFMGC = maketimer(0.2, func { } else { FMGCInternal.vls_min = FMGCInternal.vs1g_clean * 1.23; } - } else if (flap == 1) { # 1 + } elsif (flap == 1) { # 1 FMGCInternal.vsw = FMGCInternal.vs1g_conf_2; FMGCInternal.minspeed = FMGCInternal.slat; @@ -934,7 +898,7 @@ var masterFMGC = maketimer(0.2, func { } else { FMGCInternal.vls_min = FMGCInternal.vs1g_conf_1 * 1.23; } - } else if (flap == 2) { # 1+F + } elsif (flap == 2) { # 1+F FMGCInternal.vsw = FMGCInternal.vs1g_conf_1f; FMGCInternal.minspeed = FMGCInternal.slat; @@ -943,7 +907,7 @@ var masterFMGC = maketimer(0.2, func { } else { FMGCInternal.vls_min = FMGCInternal.vs1g_conf_1f * 1.23; } - } else if (flap == 3) { # 2 + } elsif (flap == 3) { # 2 FMGCInternal.vsw = FMGCInternal.vs1g_conf_2; FMGCInternal.minspeed = FMGCInternal.flap2; @@ -952,7 +916,7 @@ var masterFMGC = maketimer(0.2, func { } else { FMGCInternal.vls_min = FMGCInternal.vs1g_conf_2 * 1.23; } - } else if (flap == 4) { # 3 + } elsif (flap == 4) { # 3 FMGCInternal.vsw = FMGCInternal.vs1g_conf_3; FMGCInternal.minspeed = FMGCInternal.flap3; @@ -961,7 +925,7 @@ var masterFMGC = maketimer(0.2, func { } else { FMGCInternal.vls_min = FMGCInternal.vs1g_conf_3 * 1.23; } - } else if (flap == 5) { # FULL + } elsif (flap == 5) { # FULL FMGCInternal.vsw = FMGCInternal.vs1g_conf_full; if (FMGCInternal.vappSpeedSet) { FMGCInternal.minspeed = FMGCInternal.vapp_appr; @@ -976,7 +940,6 @@ var masterFMGC = maketimer(0.2, func { } } - #if (gear0 and pts.Controls.Flight.flapsPos.getValue() < 5 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA")) { if (gear0 and flap < 5 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA")) { if (!FMGCInternal.takeoffState) { fmgc.FMGCNodes.toState.setValue(1); @@ -994,49 +957,47 @@ var masterFMGC = maketimer(0.2, func { ############################ #handle radios, runways, v1/vr/v2 ############################ - +var airportRadiosPhase = nil; var updateAirportRadios = func { - var phase = FMGCInternal.phase; - - print("# Update airport radios"); + airportRadiosPhase = FMGCInternal.phase; departure_rwy = fmgc.flightPlanController.flightplans[2].departure_runway; destination_rwy = fmgc.flightPlanController.flightplans[2].destination_runway; - if (phase >= 2 and destination_rwy != nil) { + if (airportRadiosPhase >= 2 and destination_rwy != nil) { var airport = airportinfo(FMGCInternal.arrApt); setprop("/FMGC/internal/ldg-elev", airport.elevation * M2FT); # eventually should be runway elevation magnetic_hdg = geo.normdeg(destination_rwy.heading - getprop("/environment/magnetic-variation-deg")); runway_ils = destination_rwy.ils_frequency_mhz; if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set") and !getprop("/FMGC/internal/ils1crs-set")) { setprop("/FMGC/internal/ils1freq-calculated", runway_ils); - setprop("instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); - setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); - } else if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set")) { + setprop("/instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); + setprop("/instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); + } elsif (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set")) { setprop("/FMGC/internal/ils1freq-calculated", runway_ils); - setprop("instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); - } else if (!getprop("/FMGC/internal/ils1crs-set")) { - setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); + setprop("/instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); + } elsif (!getprop("/FMGC/internal/ils1crs-set")) { + setprop("/instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); } - } else if (phase <= 1 and departure_rwy != nil) { + } elsif (airportRadiosPhase <= 1 and departure_rwy != nil) { magnetic_hdg = geo.normdeg(departure_rwy.heading - getprop("/environment/magnetic-variation-deg")); runway_ils = departure_rwy.ils_frequency_mhz; if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set") and !getprop("/FMGC/internal/ils1crs-set")) { setprop("/FMGC/internal/ils1freq-calculated", runway_ils); - setprop("instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); - setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); - } else if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set")) { + setprop("/instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); + setprop("/instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); + } elsif (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set")) { setprop("/FMGC/internal/ils1freq-calculated", runway_ils); - setprop("instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); - } else if (!getprop("/FMGC/internal/ils1crs-set")) { - setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); + setprop("/instrumentation/nav[0]/frequencies/selected-mhz", runway_ils); + } elsif (!getprop("/FMGC/internal/ils1crs-set")) { + setprop("/instrumentation/nav[0]/radials/selected-deg", magnetic_hdg); } } }; setlistener(FMGCNodes.phase, updateAirportRadios,0,0); -setlistener(flightPlanController.changed, updateAirportRadios); +setlistener(flightPlanController.changed, updateAirportRadios,0,0); var reset_FMGC = func { FMGCInternal.phase = 0; @@ -1054,6 +1015,7 @@ var reset_FMGC = func { windController.init(); mcdu.MCDU_reset(0); mcdu.MCDU_reset(1); + Simbrief.SimbriefParser.inhibit = 0; mcdu.ReceivedMessagesDatabase.clearDatabase(); mcdu.FlightLogDatabase.reset(); # track reset events without loosing recorded data @@ -1118,59 +1080,59 @@ var ManagedSPD = maketimer(0.25, func { if (FMGCInternal.mngSpdCmd != srsSPD) { FMGCInternal.mngSpdCmd = srsSPD; } - } else if ((FMGCInternal.phase == 2 or FMGCInternal.phase == 3) and altitude <= 10050) { + } elsif ((FMGCInternal.phase == 2 or FMGCInternal.phase == 3) and altitude <= 10050) { if (FMGCInternal.mngKtsMach) { FMGCInternal.mngKtsMach = 0; } if (FMGCInternal.mngSpdCmd != 250 and !decel) { FMGCInternal.mngSpdCmd = 250; - } else if (FMGCInternal.mngSpdCmd != FMGCInternal.minspeed and decel) { + } elsif (FMGCInternal.mngSpdCmd != FMGCInternal.minspeed and decel) { FMGCInternal.mngSpdCmd = FMGCInternal.minspeed; } - } else if ((FMGCInternal.phase == 2 or FMGCInternal.phase == 3) and altitude > 10070 and !FMGCInternal.machSwitchover) { + } elsif ((FMGCInternal.phase == 2 or FMGCInternal.phase == 3) and altitude > 10070 and !FMGCInternal.machSwitchover) { if (FMGCInternal.mngKtsMach) { FMGCInternal.mngKtsMach = 0; } if (FMGCInternal.mngSpdCmd != mng_alt_spd) { FMGCInternal.mngSpdCmd = mng_alt_spd; } - } else if ((FMGCInternal.phase == 2 or FMGCInternal.phase == 3) and altitude > 10070 and FMGCInternal.machSwitchover) { + } elsif ((FMGCInternal.phase == 2 or FMGCInternal.phase == 3) and altitude > 10070 and FMGCInternal.machSwitchover) { if (!FMGCInternal.mngKtsMach) { FMGCInternal.mngKtsMach = 1; } if (FMGCInternal.mngSpdCmd != mng_alt_mach) { FMGCInternal.mngSpdCmd = mng_alt_mach; } - } else if (FMGCInternal.phase == 4 and altitude > 11000 and !FMGCInternal.machSwitchover) { + } elsif (FMGCInternal.phase == 4 and altitude > 11000 and !FMGCInternal.machSwitchover) { if (FMGCInternal.mngKtsMach) { FMGCInternal.mngKtsMach = 0; } if (FMGCInternal.mngSpdCmd != mng_alt_spd) { FMGCInternal.mngSpdCmd = mng_alt_spd; } - } else if (FMGCInternal.phase == 4 and altitude > 11000 and FMGCInternal.machSwitchover) { + } elsif (FMGCInternal.phase == 4 and altitude > 11000 and FMGCInternal.machSwitchover) { if (!FMGCInternal.mngKtsMach) { FMGCInternal.mngKtsMach = 1; } if (FMGCInternal.mngSpdCmd != mng_alt_mach) { FMGCInternal.mngSpdCmd = mng_alt_mach; } - } else if ((FMGCInternal.phase == 4 or FMGCInternal.phase == 5 or FMGCInternal.phase == 6) and altitude > 11000 and !FMGCInternal.machSwitchover) { + } elsif ((FMGCInternal.phase == 4 or FMGCInternal.phase == 5 or FMGCInternal.phase == 6) and altitude > 11000 and !FMGCInternal.machSwitchover) { if (FMGCInternal.mngKtsMach) { FMGCInternal.mngKtsMach = 0; } if (FMGCInternal.mngSpdCmd != mng_alt_spd and !decel) { FMGCInternal.mngSpdCmd = mng_alt_spd; - } else if (FMGCInternal.mngSpdCmd != FMGCInternal.minspeed and decel) { + } elsif (FMGCInternal.mngSpdCmd != FMGCInternal.minspeed and decel) { FMGCInternal.mngSpdCmd = FMGCInternal.minspeed; } - } else if ((FMGCInternal.phase == 4 or FMGCInternal.phase == 5 or FMGCInternal.phase == 6) and altitude <= 10980) { + } elsif ((FMGCInternal.phase == 4 or FMGCInternal.phase == 5 or FMGCInternal.phase == 6) and altitude <= 10980) { if (FMGCInternal.mngKtsMach) { FMGCInternal.mngKtsMach = 0; } if (FMGCInternal.mngSpdCmd != 250 and !decel) { FMGCInternal.mngSpdCmd = 250; - } else if (FMGCInternal.mngSpdCmd != FMGCInternal.minspeed and decel) { + } elsif (FMGCInternal.mngSpdCmd != FMGCInternal.minspeed and decel) { FMGCInternal.mngSpdCmd = FMGCInternal.minspeed; } } @@ -1183,13 +1145,13 @@ var ManagedSPD = maketimer(0.25, func { if (ktsmach and !FMGCInternal.mngKtsMach) { Input.ktsMach.setValue(0); - } else if (!ktsmach and FMGCInternal.mngKtsMach) { + } elsif (!ktsmach and FMGCInternal.mngKtsMach) { Input.ktsMach.setValue(1); } if (kts_sel != FMGCInternal.mngSpd and !ktsmach) { Input.kts.setValue(FMGCInternal.mngSpd); - } else if (mach_sel != FMGCInternal.mngSpd and ktsmach) { + } elsif (mach_sel != FMGCInternal.mngSpd and ktsmach) { Input.mach.setValue(FMGCInternal.mngSpd); } } else { @@ -1231,9 +1193,9 @@ setlistener("/systems/navigation/adr/operating-1", func() { timer48gpsAlign1.stop(); } - if (getprop("/FMGC/internal/align1-time") == -99) { + if (FMGCAlignTime[0].getValue() == -99) { timer48gpsAlign1.start(); - setprop("/FMGC/internal/align1-time", pts.Sim.Time.elapsedSec.getValue()); + FMGCAlignTime[0].setValue(pts.Sim.Time.elapsedSec.getValue()); } }, 0, 0); @@ -1243,9 +1205,9 @@ setlistener("/systems/navigation/adr/operating-2", func() { timer48gpsAlign2.stop(); } - if (getprop("/FMGC/internal/align2-time") == -99) { + if (FMGCAlignTime[1].getValue() == -99) { timer48gpsAlign2.start(); - setprop("/FMGC/internal/align2-time", pts.Sim.Time.elapsedSec.getValue()); + FMGCAlignTime[1].setValue(pts.Sim.Time.elapsedSec.getValue()); } }, 0, 0); @@ -1255,9 +1217,9 @@ setlistener("/systems/navigation/adr/operating-3", func() { timer48gpsAlign3.stop(); } - if (getprop("/FMGC/internal/align3-time") == -99) { + if (FMGCAlignTime[2].getValue() == -99) { timer48gpsAlign3.start(); - setprop("/FMGC/internal/align3-time", pts.Sim.Time.elapsedSec.getValue()); + FMGCAlignTime[2].setValue(pts.Sim.Time.elapsedSec.getValue()); } }, 0, 0); @@ -1304,25 +1266,25 @@ var timer30secLanding = maketimer(1, func() { }); var timer48gpsAlign1 = maketimer(1, func() { - if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/align1-time") + 48 or getprop("/systems/acconfig/options/adirs-skip")) { - setprop("/FMGC/internal/align1-done", 1); - setprop("/FMGC/internal/align1-time", -99); + if (pts.Sim.Time.elapsedSec.getValue() > (FMGCAlignTime[0].getValue() + 48) or adirsSkip.getValue()) { + FMGCAlignDone[0].setValue(1); + FMGCAlignTime[0].setValue(-99); timer48gpsAlign1.stop(); } }); var timer48gpsAlign2 = maketimer(1, func() { - if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/align2-time") + 48 or getprop("/systems/acconfig/options/adirs-skip")) { - setprop("/FMGC/internal/align2-done", 1); - setprop("/FMGC/internal/align2-time", -99); + if (pts.Sim.Time.elapsedSec.getValue() > (FMGCAlignTime[1].getValue() + 48) or adirsSkip.getValue()) { + FMGCAlignDone[1].setValue(1); + FMGCAlignTime[1].setValue(-99); timer48gpsAlign2.stop(); } }); var timer48gpsAlign3 = maketimer(1, func() { - if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/align3-time") + 48 or getprop("/systems/acconfig/options/adirs-skip")) { - setprop("/FMGC/internal/align3-done", 1); - setprop("/FMGC/internal/align3-time", -99); + if (pts.Sim.Time.elapsedSec.getValue() > (FMGCAlignTime[2].getValue() + 48) or adirsSkip.getValue()) { + FMGCAlignDone[2].setValue(1); + FMGCAlignTime[2].setValue(-99); timer48gpsAlign3.stop(); } }); From a42edcfc1fa28b070887b9fbe02e7e4a91a0d0bf Mon Sep 17 00:00:00 2001 From: Inuyaksa Date: Mon, 14 Jun 2021 22:47:11 +0200 Subject: [PATCH 44/96] preliminary for holding pattern support --- .../ND/canvas/framework/canvas.nas | 67 ++++++++++++++ .../ND/canvas/map/HOLD.lcontroller | 91 +++++++++++++++++++ Models/Instruments/ND/canvas/map/HOLD.symbol | 46 ++++++++++ Models/Instruments/ND/canvas/style.nas | 13 +-- 4 files changed, 211 insertions(+), 6 deletions(-) create mode 100644 Models/Instruments/ND/canvas/map/HOLD.lcontroller create mode 100644 Models/Instruments/ND/canvas/map/HOLD.symbol diff --git a/Models/Instruments/ND/canvas/framework/canvas.nas b/Models/Instruments/ND/canvas/framework/canvas.nas index 402dff60..7dc6cf73 100644 --- a/Models/Instruments/ND/canvas/framework/canvas.nas +++ b/Models/Instruments/ND/canvas/framework/canvas.nas @@ -307,3 +307,70 @@ canvas.LineSymbol.draw = func() { me.callback("draw_after"); }; +# RacetrackSymbol + +canvas.RacetrackSymbol.new = func(group, layer, model, controller=nil) { + if (me == nil) __die("Need me reference for RacetrackSymbol.new()"); + if (typeof(model) != "vector") { + if(typeof(model) == "hash"){ + if(!contains(model, "path")) + canvas.__die("RacetrackSymbol.new(): model hash requires path"); + } + else canvas.__die("RacetrackSymbol.new(): need a vector of points or a hash"); + } + var m = { + parents: [me], + group: group, + layer: layer, + model: model, + controller: controller == nil ? me.df_controller : controller, + element: group.createChild( + "path", me.element_id + ), + }; + append(m.parents, m.element); + canvas.Symbol._new(m); + + m.init(); + return m; +}; + # Non-static: +canvas.RacetrackSymbol.draw = func() { + me.callback("draw_before"); + if (!me.needs_update) return; + #logprint(_MP_dbg_lvl, "redrawing a RacetrackSymbol "~me.layer.type); + me.element.reset(); + var cmds = []; + var coords = []; + var cmd = canvas.Path.VG_MOVE_TO; + var path = me.model; + if(typeof(path) == "hash"){ + path = me.model.path; + if(path == nil) + canvas.__die("RacetrackSymbol model requires a 'path' member (vector)"); + } + foreach (var m; path) { + if(size(keys(m)) >= 2){ + var (lat,lon) = me.controller.getpos(m); + append(coords,"N"~lat); + append(coords,"E"~lon); + append(cmds,cmd); + if (m[0] == 'R') cmd = canvas.Path.arcSmallCWTo; + else if (m[0] == 'L') cmd = canvas.Path.arcSmallCCWTo; + else cmd = canvas.Path.VG_LINE_TO; + } else { + cmd = canvas.Path.VG_MOVE_TO; + } + } + + # close racetrack + var (lat,lon) = me.controller.getpos(path[0]); + append(coords,"N"~lat); + append(coords,"E"~lon); + append(cmds,cmd); + + me.element.setDataGeo(cmds, coords); + me.element.update(); # this doesn"t help with flickering, it seems + me.callback("draw_after"); +}; + diff --git a/Models/Instruments/ND/canvas/map/HOLD.lcontroller b/Models/Instruments/ND/canvas/map/HOLD.lcontroller new file mode 100644 index 00000000..6189d87d --- /dev/null +++ b/Models/Instruments/ND/canvas/map/HOLD.lcontroller @@ -0,0 +1,91 @@ +# See: http://wiki.flightgear.org/MapStructure +# TODO: this layer doesn't make sense to support for AI/MP traffic, because we don't currently have access to flightplan/routing info +# that also applies to other layers like WPT or even navaid layers that handle station tuning based on local radio settings +# +# Class things: +var name = 'HOLD'; +var parents = [SymbolLayer.Controller]; +var __self__ = caller(0)[0]; +SymbolLayer.Controller.add(name, __self__); +SymbolLayer.add(name, { + parents: [MultiSymbolLayer], + type: name, # Symbol type + df_controller: __self__, # controller to use by default -- this one + df_options: { # default configuration options + active_node: "/FMGC/flightplan[2]/active", + #current_wp_node: "/FMGC/flightplan[2]/current-wp", + #wp_num: "/FMGC/flightplan[2]/num", + display_inactive_rte: 0 + } +}); +var new = func(layer) { + var m = { + parents: [__self__], + layer: layer, + map: layer.map, + listeners: [], + }; + layer.searcher._equals = func(l,r) 0; # TODO: create model objects instead? + append(m.listeners, setlistener(layer.options.active_node, func m.layer.update() ), setlistener(layer.options.wp_num, func m.layer.update() )); + m.addVisibilityListener(); + var driver = opt_member(m.layer.options, 'route_driver'); + if(driver == nil){ + driver = A3XXRouteDriver.new(); + } + var driver_listeners = driver.getListeners(); + foreach(var listener; driver_listeners){ + append(m.listeners, setlistener(listener, func m.layer.update())); + } + m.route_driver = driver; + return m; +}; +var del = func() { + foreach (var l; me.listeners) + removelistener(l); +}; + +var last_result = []; + +var searchCmd = func { + # FIXME: do we return the active route even if it isn't active? + logprint(_MP_dbg_lvl, "Running query: ", name); + var plans = []; + var driver = me.route_driver; + if(!driver.shouldUpdate()) return me.last_result; + driver.update(); + # http://wiki.flightgear.org/Nasal_Flightplan + var planCount = driver.getNumberOfFlightPlans(); + for(var idx = 0; idx < planCount; idx += 1){ + #var fp = driver.getFlightPlan(idx); + var fpSize = driver.getPlanSize(idx); + if(fpSize < 2) continue; + var type = driver.getFlightPlanType(idx); + if(type == nil) type = 'active'; + if (!getprop(me.layer.options.active_node) and + type == 'active' and + !me.layer.options.display_inactive_rte) fpSize = 0; + var coords = []; + #var hold_wp = me.layer.options.hold_wp; + var path = nil; + if (getprop(me.layer.options.hold_wp) != nil) { + var pdir = (getprop(me.layer.options.hold_direction) == "Right") ? 'R' : 'L'; + for (var a = 0; a<6; a += 1) { + var point = props.globals.getNode(me.layer.options.points_node~'['~a~']'); + path = [(a==2 or a==5) ? '' : pdir, {lon:point.lon, lat:point.lat}]; + coords ~= path; + } + } + append(plans, { + id: type, + #name: type, + type: type, + path: coords, + #size: fpSize, + equals: func(o){ + me.id == o.id# and me.size == o.size + } + }); + } + me.last_result = plans; + return plans; +}; \ No newline at end of file diff --git a/Models/Instruments/ND/canvas/map/HOLD.symbol b/Models/Instruments/ND/canvas/map/HOLD.symbol new file mode 100644 index 00000000..15dfa1ed --- /dev/null +++ b/Models/Instruments/ND/canvas/map/HOLD.symbol @@ -0,0 +1,46 @@ +# See: http://wiki.flightgear.org/MapStructure + +# Class things: +var name = 'HOLD'; +var parents = [RacetrackSymbol]; +var __self__ = caller(0)[0]; +RacetrackSymbol.makeinstance( name, __self__ ); + +SymbolLayer.get(name).df_style = { # style to use by default + line_width: 5, + color: [1,0,1] +}; + +var getLineStyle = func(property, df_val){ + var type = nil; + if(typeof(me.model) == 'hash'){ + type = me.model.type; + } + if(type != nil and type != 'active'){ + var base_prop = property; + property = property~'_'~type; + me.getStyle(property, me.getStyle(base_prop, df_val)); + } else { + me.getStyle(property, df_val); + } +}; + +var setRouteStyle = func{ + var df_style = SymbolLayer.get(name).df_style; + var dash = me.getLineStyle('line_dash', []); + var color = me.getLineStyle('color', df_style.color); + var line_width = me.getLineStyle('line_width', df_style.line_width); + me.element.setColor(color) + .setStrokeLineWidth(line_width); + if(typeof(dash) == 'vector') + me.element.setStrokeDashArray(dash); +}; + +var init = func { + me.setRouteStyle(); +}; + +#var draw = func { +# me.setRouteStyle(); +#}; + diff --git a/Models/Instruments/ND/canvas/style.nas b/Models/Instruments/ND/canvas/style.nas index 7f4579f9..dd880013 100644 --- a/Models/Instruments/ND/canvas/style.nas +++ b/Models/Instruments/ND/canvas/style.nas @@ -459,12 +459,13 @@ canvas.NDStyles["Airbus"] = { } }, options: { - hold_node: "/flight-management/hold", - hold_init: "flight-management/hold/init", - points_node: "/flight-management/hold/points", - first_point_node: "/flight-management/hold/points/point/lat", - hold_wp: "/flight-management/hold/wp", - hold_wp_idx: "/flight-management/hold/wp_id", + hold_node: "/autopilot/hold/", + hold_init: "/autopilot/hold/init", #NOT EXISTS?? + hold_direction: "/autopilot/hold/hold-direction" + points_node: "autopilot/auto-hold/point", + first_point_node: "autopilot/hold/entry", #CHECKME + hold_wp: "autopilot/hold/fix", + #hold_wp_idx: "autopilot/hold/wp_id", range_dependant: 1, listen: [ "first_point_node", From 35b236ffa417933931da2d378284266ca748b05d Mon Sep 17 00:00:00 2001 From: Inuyaksa Date: Tue, 15 Jun 2021 20:07:56 +0200 Subject: [PATCH 45/96] Revert "preliminary for holding pattern support" This reverts commit a42edcfc1fa28b070887b9fbe02e7e4a91a0d0bf. --- .../ND/canvas/framework/canvas.nas | 67 -------------- .../ND/canvas/map/HOLD.lcontroller | 91 ------------------- Models/Instruments/ND/canvas/map/HOLD.symbol | 46 ---------- Models/Instruments/ND/canvas/style.nas | 13 ++- 4 files changed, 6 insertions(+), 211 deletions(-) delete mode 100644 Models/Instruments/ND/canvas/map/HOLD.lcontroller delete mode 100644 Models/Instruments/ND/canvas/map/HOLD.symbol diff --git a/Models/Instruments/ND/canvas/framework/canvas.nas b/Models/Instruments/ND/canvas/framework/canvas.nas index 7dc6cf73..402dff60 100644 --- a/Models/Instruments/ND/canvas/framework/canvas.nas +++ b/Models/Instruments/ND/canvas/framework/canvas.nas @@ -307,70 +307,3 @@ canvas.LineSymbol.draw = func() { me.callback("draw_after"); }; -# RacetrackSymbol - -canvas.RacetrackSymbol.new = func(group, layer, model, controller=nil) { - if (me == nil) __die("Need me reference for RacetrackSymbol.new()"); - if (typeof(model) != "vector") { - if(typeof(model) == "hash"){ - if(!contains(model, "path")) - canvas.__die("RacetrackSymbol.new(): model hash requires path"); - } - else canvas.__die("RacetrackSymbol.new(): need a vector of points or a hash"); - } - var m = { - parents: [me], - group: group, - layer: layer, - model: model, - controller: controller == nil ? me.df_controller : controller, - element: group.createChild( - "path", me.element_id - ), - }; - append(m.parents, m.element); - canvas.Symbol._new(m); - - m.init(); - return m; -}; - # Non-static: -canvas.RacetrackSymbol.draw = func() { - me.callback("draw_before"); - if (!me.needs_update) return; - #logprint(_MP_dbg_lvl, "redrawing a RacetrackSymbol "~me.layer.type); - me.element.reset(); - var cmds = []; - var coords = []; - var cmd = canvas.Path.VG_MOVE_TO; - var path = me.model; - if(typeof(path) == "hash"){ - path = me.model.path; - if(path == nil) - canvas.__die("RacetrackSymbol model requires a 'path' member (vector)"); - } - foreach (var m; path) { - if(size(keys(m)) >= 2){ - var (lat,lon) = me.controller.getpos(m); - append(coords,"N"~lat); - append(coords,"E"~lon); - append(cmds,cmd); - if (m[0] == 'R') cmd = canvas.Path.arcSmallCWTo; - else if (m[0] == 'L') cmd = canvas.Path.arcSmallCCWTo; - else cmd = canvas.Path.VG_LINE_TO; - } else { - cmd = canvas.Path.VG_MOVE_TO; - } - } - - # close racetrack - var (lat,lon) = me.controller.getpos(path[0]); - append(coords,"N"~lat); - append(coords,"E"~lon); - append(cmds,cmd); - - me.element.setDataGeo(cmds, coords); - me.element.update(); # this doesn"t help with flickering, it seems - me.callback("draw_after"); -}; - diff --git a/Models/Instruments/ND/canvas/map/HOLD.lcontroller b/Models/Instruments/ND/canvas/map/HOLD.lcontroller deleted file mode 100644 index 6189d87d..00000000 --- a/Models/Instruments/ND/canvas/map/HOLD.lcontroller +++ /dev/null @@ -1,91 +0,0 @@ -# See: http://wiki.flightgear.org/MapStructure -# TODO: this layer doesn't make sense to support for AI/MP traffic, because we don't currently have access to flightplan/routing info -# that also applies to other layers like WPT or even navaid layers that handle station tuning based on local radio settings -# -# Class things: -var name = 'HOLD'; -var parents = [SymbolLayer.Controller]; -var __self__ = caller(0)[0]; -SymbolLayer.Controller.add(name, __self__); -SymbolLayer.add(name, { - parents: [MultiSymbolLayer], - type: name, # Symbol type - df_controller: __self__, # controller to use by default -- this one - df_options: { # default configuration options - active_node: "/FMGC/flightplan[2]/active", - #current_wp_node: "/FMGC/flightplan[2]/current-wp", - #wp_num: "/FMGC/flightplan[2]/num", - display_inactive_rte: 0 - } -}); -var new = func(layer) { - var m = { - parents: [__self__], - layer: layer, - map: layer.map, - listeners: [], - }; - layer.searcher._equals = func(l,r) 0; # TODO: create model objects instead? - append(m.listeners, setlistener(layer.options.active_node, func m.layer.update() ), setlistener(layer.options.wp_num, func m.layer.update() )); - m.addVisibilityListener(); - var driver = opt_member(m.layer.options, 'route_driver'); - if(driver == nil){ - driver = A3XXRouteDriver.new(); - } - var driver_listeners = driver.getListeners(); - foreach(var listener; driver_listeners){ - append(m.listeners, setlistener(listener, func m.layer.update())); - } - m.route_driver = driver; - return m; -}; -var del = func() { - foreach (var l; me.listeners) - removelistener(l); -}; - -var last_result = []; - -var searchCmd = func { - # FIXME: do we return the active route even if it isn't active? - logprint(_MP_dbg_lvl, "Running query: ", name); - var plans = []; - var driver = me.route_driver; - if(!driver.shouldUpdate()) return me.last_result; - driver.update(); - # http://wiki.flightgear.org/Nasal_Flightplan - var planCount = driver.getNumberOfFlightPlans(); - for(var idx = 0; idx < planCount; idx += 1){ - #var fp = driver.getFlightPlan(idx); - var fpSize = driver.getPlanSize(idx); - if(fpSize < 2) continue; - var type = driver.getFlightPlanType(idx); - if(type == nil) type = 'active'; - if (!getprop(me.layer.options.active_node) and - type == 'active' and - !me.layer.options.display_inactive_rte) fpSize = 0; - var coords = []; - #var hold_wp = me.layer.options.hold_wp; - var path = nil; - if (getprop(me.layer.options.hold_wp) != nil) { - var pdir = (getprop(me.layer.options.hold_direction) == "Right") ? 'R' : 'L'; - for (var a = 0; a<6; a += 1) { - var point = props.globals.getNode(me.layer.options.points_node~'['~a~']'); - path = [(a==2 or a==5) ? '' : pdir, {lon:point.lon, lat:point.lat}]; - coords ~= path; - } - } - append(plans, { - id: type, - #name: type, - type: type, - path: coords, - #size: fpSize, - equals: func(o){ - me.id == o.id# and me.size == o.size - } - }); - } - me.last_result = plans; - return plans; -}; \ No newline at end of file diff --git a/Models/Instruments/ND/canvas/map/HOLD.symbol b/Models/Instruments/ND/canvas/map/HOLD.symbol deleted file mode 100644 index 15dfa1ed..00000000 --- a/Models/Instruments/ND/canvas/map/HOLD.symbol +++ /dev/null @@ -1,46 +0,0 @@ -# See: http://wiki.flightgear.org/MapStructure - -# Class things: -var name = 'HOLD'; -var parents = [RacetrackSymbol]; -var __self__ = caller(0)[0]; -RacetrackSymbol.makeinstance( name, __self__ ); - -SymbolLayer.get(name).df_style = { # style to use by default - line_width: 5, - color: [1,0,1] -}; - -var getLineStyle = func(property, df_val){ - var type = nil; - if(typeof(me.model) == 'hash'){ - type = me.model.type; - } - if(type != nil and type != 'active'){ - var base_prop = property; - property = property~'_'~type; - me.getStyle(property, me.getStyle(base_prop, df_val)); - } else { - me.getStyle(property, df_val); - } -}; - -var setRouteStyle = func{ - var df_style = SymbolLayer.get(name).df_style; - var dash = me.getLineStyle('line_dash', []); - var color = me.getLineStyle('color', df_style.color); - var line_width = me.getLineStyle('line_width', df_style.line_width); - me.element.setColor(color) - .setStrokeLineWidth(line_width); - if(typeof(dash) == 'vector') - me.element.setStrokeDashArray(dash); -}; - -var init = func { - me.setRouteStyle(); -}; - -#var draw = func { -# me.setRouteStyle(); -#}; - diff --git a/Models/Instruments/ND/canvas/style.nas b/Models/Instruments/ND/canvas/style.nas index dd880013..7f4579f9 100644 --- a/Models/Instruments/ND/canvas/style.nas +++ b/Models/Instruments/ND/canvas/style.nas @@ -459,13 +459,12 @@ canvas.NDStyles["Airbus"] = { } }, options: { - hold_node: "/autopilot/hold/", - hold_init: "/autopilot/hold/init", #NOT EXISTS?? - hold_direction: "/autopilot/hold/hold-direction" - points_node: "autopilot/auto-hold/point", - first_point_node: "autopilot/hold/entry", #CHECKME - hold_wp: "autopilot/hold/fix", - #hold_wp_idx: "autopilot/hold/wp_id", + hold_node: "/flight-management/hold", + hold_init: "flight-management/hold/init", + points_node: "/flight-management/hold/points", + first_point_node: "/flight-management/hold/points/point/lat", + hold_wp: "/flight-management/hold/wp", + hold_wp_idx: "/flight-management/hold/wp_id", range_dependant: 1, listen: [ "first_point_node", From 84526a7dfe55e68a5351cabed6b1901b4547e4fd Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Wed, 16 Jun 2021 12:39:59 +0100 Subject: [PATCH 46/96] FCU: vs / fpa -- improve display --- Models/FlightDeck/a320.flightdeck.xml | 41 +++++++++++++++++++++++---- Nasal/FMGC/FCU.nas | 2 ++ Nasal/FMGC/FMGC-b.nas | 7 ++++- 3 files changed, 43 insertions(+), 7 deletions(-) diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index 2389bf10..8903b74d 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -1158,6 +1158,7 @@ vord_led vord_led.001 vs-text + vs-text-last-2-digits vs-text-test wpt_led wpt_led.001 @@ -4393,6 +4394,7 @@ select vs-text + vs-text-last-2-digits @@ -4631,16 +4633,42 @@ vs-text -0.377 - 0.09043 + 0.0850 0.50254 90 72.81 center-center xy-plane - number-value - %4.0f - it-autoflight/input/vs + text-value + %s + it-autoflight/output/vs-fcu-display + false + led.txf + true + false + false + 0.008 + + 32 + 32 + + + + + vs-text-last-2-digits + + -0.377 + 0.0977 + 0.5028 + 90 + 72.81 + + center-center + xy-plane + text-value + oo + autopilot/serviceable false led.txf true @@ -4657,7 +4685,7 @@ fpa-text -0.377 - 0.09043 + 0.0860 0.50254 90 72.81 @@ -4665,7 +4693,7 @@ center-center xy-plane number-value - %2.1f + %+2.1f it-autoflight/input/fpa false led.txf @@ -7235,6 +7263,7 @@ hdg-text alt-text vs-text + vs-text-last-2-digits spd-text-test hdg-text-test alt-text-test diff --git a/Nasal/FMGC/FCU.nas b/Nasal/FMGC/FCU.nas index 30ba98a1..ebca85a6 100644 --- a/Nasal/FMGC/FCU.nas +++ b/Nasal/FMGC/FCU.nas @@ -379,6 +379,7 @@ var FCUController = { } else { fmgc.Input.vert.setValue(1); fmgc.Input.vs.setValue(0); + fmgc.Custom.Output.vsFCU.setValue(left(sprintf("%+05.0f",0),3)); } } }, @@ -413,6 +414,7 @@ var FCUController = { } else { fmgc.Input.vs.setValue(me.vsTemp); } + fmgc.Custom.Output.vsFCU.setValue(left(sprintf("%+05.0f",fmgc.Input.vs.getValue()),3)); } else if (fmgc.Output.vert.getValue() == 5) { me.fpaTemp = fmgc.Input.fpa.getValue(); if (d == 1) { diff --git a/Nasal/FMGC/FMGC-b.nas b/Nasal/FMGC/FMGC-b.nas index 5260a87a..95ad7b6b 100644 --- a/Nasal/FMGC/FMGC-b.nas +++ b/Nasal/FMGC/FMGC-b.nas @@ -174,6 +174,7 @@ var Custom = { }, Output: { fmaPower: props.globals.initNode("/it-autoflight/output/fma-pwr", 0, "BOOL"), + vsFCU: props.globals.initNode("/it-autoflight/output/vs-fcu-display", "", "STRING"), }, Sound: { athrOff: props.globals.initNode("/it-autoflight/sound/athrsound", 0, "BOOL"), @@ -196,6 +197,7 @@ var ITAF = { Input.hdg.setValue(360); Input.alt.setValue(10000); Input.vs.setValue(0); + Custom.Output.vsFCU.setValue(left(sprintf("%+05.0f",0),3)); Input.fpa.setValue(0); Input.lat.setValue(9); Input.vert.setValue(9); @@ -861,8 +863,11 @@ var ITAF = { Input.alt.setValue(math.clamp(math.round(Internal.altPredicted.getValue(), 100), 0, 50000)); Internal.alt.setValue(math.clamp(math.round(Internal.altPredicted.getValue(), 100), 0, 50000)); }, + tempVS: 0, syncVs: func() { - Input.vs.setValue(math.clamp(math.round(Internal.vs.getValue(), 100), -6000, 6000)); + me.tempVS = math.clamp(math.round(Internal.vs.getValue(), 100), -6000, 6000); + Input.vs.setValue(me.tempVS); + fmgc.Custom.Output.vsFCU.setValue(left(sprintf("%+05.0f",me.tempVS),3)); }, syncFpa: func() { Input.fpa.setValue(math.clamp(math.round(Internal.fpa.getValue(), 0.1), -9.9, 9.9)); From 768cf4e1a080cf3a539b1edbbab7d5f814ce631d Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Wed, 16 Jun 2021 13:36:36 +0100 Subject: [PATCH 47/96] FCU: improve display of characters; LVL / CH should always display also. Improve speed control range --- Models/FlightDeck/a320.flightdeck.xml | 29 ++++++--------------------- Nasal/FMGC/FCU.nas | 28 +++++++++++++------------- Nasal/FMGC/FMGC-b.nas | 6 +++--- 3 files changed, 23 insertions(+), 40 deletions(-) diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index 8903b74d..6bc7fd11 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -4310,23 +4310,6 @@ - - select - lvlch.ind - - - - controls/switches/annun-test - 1 - - - it-autoflight/output/vert - 4 - - - - - select alt-text @@ -7278,9 +7261,9 @@ rudder-trim rudder-trim-letter - 0.89 - 0.37 - 0.08 + 0.75 + 0.30 + 0.0 0 @@ -7293,9 +7276,9 @@ 0 - 0.89 - 0.37 - 0.08 + 0.75 + 0.30 + 0.0 diff --git a/Nasal/FMGC/FCU.nas b/Nasal/FMGC/FCU.nas index ebca85a6..5ef43dfb 100644 --- a/Nasal/FMGC/FCU.nas +++ b/Nasal/FMGC/FCU.nas @@ -187,20 +187,20 @@ var FCUController = { me.ias = fmgc.Velocities.indicatedAirspeedKt.getValue(); me.mach = fmgc.Velocities.indicatedMach.getValue(); if (!fmgc.Input.ktsMach.getBoolValue()) { - if (me.ias >= 100 and me.ias <= 350) { + if (me.ias >= 100 and me.ias <= 399) { fmgc.Input.kts.setValue(math.round(me.ias)); } else if (me.ias < 100) { fmgc.Input.kts.setValue(100); - } else if (me.ias > 350) { - fmgc.Input.kts.setValue(350); + } else if (me.ias > 399) { + fmgc.Input.kts.setValue(399); } } else if (fmgc.Input.ktsMach.getBoolValue()) { - if (me.mach >= 0.50 and me.mach <= 0.82) { + if (me.mach >= 0.10 and me.mach <= 0.99) { fmgc.Input.mach.setValue(math.round(me.mach, 0.001)); - } else if (me.mach < 0.50) { - fmgc.Input.mach.setValue(0.50); - } else if (me.mach > 0.82) { - fmgc.Input.mach.setValue(0.82); + } else if (me.mach < 0.10) { + fmgc.Input.mach.setValue(0.10); + } else if (me.mach > 0.99) { + fmgc.Input.mach.setValue(0.99); } } } @@ -221,10 +221,10 @@ var FCUController = { } else if (d == -10) { me.machTemp = math.round(me.machTemp - 0.01, 0.01); # Kill floating point error } - if (me.machTemp < 0.50) { - fmgc.Input.mach.setValue(0.50); - } else if (me.machTemp > 0.82) { - fmgc.Input.mach.setValue(0.82); + if (me.machTemp < 0.10) { + fmgc.Input.mach.setValue(0.10); + } else if (me.machTemp > 0.99) { + fmgc.Input.mach.setValue(0.99); } else { fmgc.Input.mach.setValue(me.machTemp); } @@ -241,8 +241,8 @@ var FCUController = { } if (me.iasTemp < 100) { fmgc.Input.kts.setValue(100); - } else if (me.iasTemp > 350) { - fmgc.Input.kts.setValue(350); + } else if (me.iasTemp > 399) { + fmgc.Input.kts.setValue(399); } else { fmgc.Input.kts.setValue(me.iasTemp); } diff --git a/Nasal/FMGC/FMGC-b.nas b/Nasal/FMGC/FMGC-b.nas index 95ad7b6b..be727e2c 100644 --- a/Nasal/FMGC/FMGC-b.nas +++ b/Nasal/FMGC/FMGC-b.nas @@ -848,13 +848,13 @@ var ITAF = { } }, syncKts: func() { - Input.kts.setValue(math.clamp(math.round(Velocities.indicatedAirspeedKt.getValue()), 100, 350)); + Input.kts.setValue(math.clamp(math.round(Velocities.indicatedAirspeedKt.getValue()), 100, 399)); }, syncKtsGa: func() { # Same as syncKts, except doesn't go below V2 - Input.kts.setValue(math.clamp(math.round(Velocities.indicatedAirspeedKt.getValue()), FMGCInternal.v2, 350)); + Input.kts.setValue(math.clamp(math.round(Velocities.indicatedAirspeedKt.getValue()), FMGCInternal.v2, 399)); }, syncMach: func() { - Input.mach.setValue(math.clamp(math.round(Velocities.indicatedMach.getValue(), 0.001), 0.5, 0.82)); + Input.mach.setValue(math.clamp(math.round(Velocities.indicatedMach.getValue(), 0.001), 0.1, 0.99)); }, syncHdg: func() { Input.hdg.setValue(math.round(Internal.hdgPredicted.getValue())); # Switches to track automatically From 53dcada429e945c874fffe27809ab8c733aaa25b Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Wed, 16 Jun 2021 14:40:15 +0100 Subject: [PATCH 48/96] VLS / VMAX --> properties --- Nasal/FMGC/FMGC.nas | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index ba125b25..ba7eca87 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -265,6 +265,8 @@ var FMGCNodes = { v1: props.globals.initNode("/FMGC/internal/v1", 0, "DOUBLE"), v1set: props.globals.initNode("/FMGC/internal/v1-set", 0, "BOOL"), phase: props.globals.initNode("/FMGC/internal/phase", 0, "INT"), + vlsMin: props.globals.initNode("/FMGC/internal/vls-min", 0, "DOUBLE"), + vmax: props.globals.initNode("/FMGC/internal/vmax", 0, "DOUBLE"), }; ############ @@ -698,6 +700,7 @@ var masterFMGC = maketimer(0.2, func { } else { FMGCInternal.maxspeed = fmgc.FMGCInternal.vmo_mmo; } + FMGCNodes.vmax.setValue(FMGCInternal.maxspeed); if (newphase != FMGCInternal.phase) { # phase changed FMGCInternal.phase = newphase; @@ -937,6 +940,7 @@ var masterFMGC = maketimer(0.2, func { FMGCInternal.vls_min = FMGCInternal.vs1g_conf_full * 1.23; } } + FMGCNodes.vlsMin.setValue(FMGCInternal.vls_min); if (gear0 and flap < 5 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA")) { if (!FMGCInternal.takeoffState) { From 559800e05d0c9bef8f250d69a75c7a823e656ec9 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Wed, 16 Jun 2021 14:59:37 +0100 Subject: [PATCH 49/96] Move to ITAF loop --- Nasal/FMGC/FMGC-b.nas | 4 ++++ Nasal/FMGC/FMGC.nas | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Nasal/FMGC/FMGC-b.nas b/Nasal/FMGC/FMGC-b.nas index be727e2c..1669b469 100644 --- a/Nasal/FMGC/FMGC-b.nas +++ b/Nasal/FMGC/FMGC-b.nas @@ -254,6 +254,10 @@ var ITAF = { Internal.vsTemp = Internal.vs.getValue(); Position.indicatedAltitudeFtTemp = Position.indicatedAltitudeFt.getValue(); + # Update VLS / VMAX for autothrust + FMGCNodes.vmax.setValue(FMGCInternal.maxspeed); + FMGCNodes.vlsMin.setValue(FMGCInternal.vls_min); + # LNAV Engagement if (Output.lnavArm.getBoolValue()) { me.checkLNAV(1); diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index ba7eca87..e986acaa 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -700,15 +700,12 @@ var masterFMGC = maketimer(0.2, func { } else { FMGCInternal.maxspeed = fmgc.FMGCInternal.vmo_mmo; } - FMGCNodes.vmax.setValue(FMGCInternal.maxspeed); if (newphase != FMGCInternal.phase) { # phase changed FMGCInternal.phase = newphase; FMGCNodes.phase.setValue(newphase); } - - ############################ # fuel ############################ @@ -940,7 +937,6 @@ var masterFMGC = maketimer(0.2, func { FMGCInternal.vls_min = FMGCInternal.vs1g_conf_full * 1.23; } } - FMGCNodes.vlsMin.setValue(FMGCInternal.vls_min); if (gear0 and flap < 5 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA")) { if (!FMGCInternal.takeoffState) { From ac0db37a26efa2e80734e93abf8be41722d5c665 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Wed, 16 Jun 2021 15:30:54 +0100 Subject: [PATCH 50/96] TERR ON ND switch - change label to green --- Models/FlightDeck/res/main_labels.png | Bin 106756 -> 107300 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Models/FlightDeck/res/main_labels.png b/Models/FlightDeck/res/main_labels.png index fced50a3309845d17eab8625dfd48857ebc31f33..f3d38bbd4d27906b74c0c394f7e5892ed4277b64 100644 GIT binary patch delta 50679 zcmX_mWl$bX)AfbByL*se!GgQHySuwXSlrzqxVyW%2Liz%XmEFjkNbV9zMnfa)7_{0 z^qH;Q4jzCm8i9_d0RR4)Kt%=+aU~Xg>|*|aJoP7nsT^B3j1|Zo2%4&@syaSSm4e4J z9rBs^3&zT>rW1euy7}Sq7kFC&LM*8|bhT^MD-U{YS9Z3T{sJE>FRYKR@2__T?@#9f zzMF6FLjQCkYL8xo2sW3PAN`(ok$P*;_67Vl?{ag8-fx6@YhG^xq%?roSF?|&FHe52 zJtWsNFe^{*%GIp`o5#_cOLsQ|9$y7|JG*^m!+r?tY@W|-j>V|0h9DH#fxKos;MpaB{WybgyEKflX&l!3(Qkkw5Sx2Z+FNDz z)@*Zk0iaH7GQI2U2mpGVZ#{*NaROyzA%J&Q?&ia}-^Ejo{lAIGMUp6QcTB$@h)h}Z zUfvFsuhy@Ouif1SBemyY2DVT4lL~&-hGY#SOCf~rxZ9yOJvDW0!-NX9zA;YqO3(TV z4BEOuY|y0i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1jUO)h-T_2&riG!fjEx^V{Umj%V RqXfbX6$MTCQaRIr{{tAiDT)99 From 4297101ec950fdcc19bda1956dbcb1c83328a46f Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Fri, 18 Jun 2021 17:01:50 +0100 Subject: [PATCH 51/96] PFD indication of vertical speed --- Models/Instruments/PFD/PFD.nas | 15 +++++++++++++-- Models/Instruments/PFD/res/pfd.svg | 13 +++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Models/Instruments/PFD/PFD.nas b/Models/Instruments/PFD/PFD.nas index d39738ac..d17276e1 100644 --- a/Models/Instruments/PFD/PFD.nas +++ b/Models/Instruments/PFD/PFD.nas @@ -221,7 +221,7 @@ var canvas_PFD_base = { "AI_agl_g","AI_agl","AI_error","AI_group","FD_roll","FD_pitch","ALT_box_flash","ALT_box","ALT_box_amber","ALT_scale","ALT_target","ALT_target_digit","ALT_one","ALT_two","ALT_three","ALT_four","ALT_five","ALT_digits","ALT_tens","ALT_digit_UP", "ALT_digit_DN","ALT_error","ALT_neg","ALT_group","ALT_group2","ALT_frame","VS_pointer","VS_box","VS_digit","VS_error","VS_group","QNH","QNH_setting","QNH_std","QNH_box","LOC_pointer","LOC_scale","GS_scale","GS_pointer","CRS_pointer","HDG_target","HDG_scale", "HDG_one","HDG_two","HDG_three","HDG_four","HDG_five","HDG_six","HDG_seven","HDG_digit_L","HDG_digit_R","HDG_error","HDG_group","HDG_frame","TRK_pointer","machError","ilsError","ils_code","ils_freq","dme_dist","dme_dist_legend","ILS_HDG_R","ILS_HDG_L", - "ILS_right","ILS_left","outerMarker","middleMarker","innerMarker","v1_group","v1_text","vr_speed","F_target","S_target","FS_targets","flap_max","clean_speed","ground","ground_ref","FPV","spdLimError"]; + "ILS_right","ILS_left","outerMarker","middleMarker","innerMarker","v1_group","v1_text","vr_speed","F_target","S_target","FS_targets","flap_max","clean_speed","ground","ground_ref","FPV","spdLimError","vsFMArate"]; }, updateDu1: func() { var elapsedtime_act = elapsedtime.getValue(); @@ -876,7 +876,18 @@ var canvas_PFD_base = { } # FMA Pitch - me["FMA_pitch"].setText(sprintf("%s", pitch_mode_act)); + if (pitch_mode_act == "V/S") { + me["FMA_pitch"].setText(sprintf("%s ", pitch_mode_act)); + me["vsFMArate"].setText(sprintf("%+4.0f",fmgc.Input.vs.getValue())); + me["vsFMArate"].show(); + } elsif (pitch_mode_act == "FPA") { + me["FMA_pitch"].setText(sprintf("%s ", pitch_mode_act)); + me["vsFMArate"].setText(sprintf("%+3.1f°",fmgc.Input.fpa.getValue())); + me["vsFMArate"].show(); + }else { + me["FMA_pitch"].setText(sprintf("%s", pitch_mode_act)); + me["vsFMArate"].hide(); + } me["FMA_pitcharm"].setText(sprintf("%s", pitch_mode_armed_act)); me["FMA_pitcharm2"].setText(sprintf("%s", pitch_mode2_armed_act)); diff --git a/Models/Instruments/PFD/res/pfd.svg b/Models/Instruments/PFD/res/pfd.svg index 5c571f2b..23653432 100644 --- a/Models/Instruments/PFD/res/pfd.svg +++ b/Models/Instruments/PFD/res/pfd.svg @@ -6256,4 +6256,17 @@ x="823.7511" sodipodi:role="line" id="tspan1797">G + -800 From 82bf43608457e290a360bac8ee93b6c070f7a8ca Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 19 Jun 2021 01:46:57 +0100 Subject: [PATCH 52/96] Code Global Speed Protection mode reversion from THR CLB to SPEED on overspeed --- Nasal/ECAM/ECAM-controller.nas | 4 ++-- Nasal/ECAM/ECAM-logic.nas | 2 +- Nasal/FMGC/FCU.nas | 8 ++++---- Nasal/FMGC/FMGC-b.nas | 13 +++++++++++++ Nasal/Libraries/property-tree-setup.nas | 7 +++++++ Sounds/A320-common-sound.xml | 15 +++++++++++++++ 6 files changed, 42 insertions(+), 7 deletions(-) diff --git a/Nasal/ECAM/ECAM-controller.nas b/Nasal/ECAM/ECAM-controller.nas index aedd52cf..d84b680d 100644 --- a/Nasal/ECAM/ECAM-controller.nas +++ b/Nasal/ECAM/ECAM-controller.nas @@ -14,7 +14,7 @@ var overflow = props.globals.initNode("/ECAM/warnings/overflow", 0, "BOOL"); 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"), props.globals.initNode("/sim/sound/warnings/retard", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/cchord", 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"), props.globals.initNode("/sim/sound/warnings/retard", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/cchord", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/click", 0, "BOOL")]; var warningFlash = props.globals.initNode("/ECAM/warnings/master-warning-flash", 0, "BOOL"); var lineIndex = 0; @@ -223,7 +223,7 @@ var warning = { me.noRepeat = 1; }, sound: func() { - if (me.aural > 3) { return; } + if (me.aural == 9) { return; } if (me.active == 0 and me.wasActive == 1) { aural[me.aural].setBoolValue(0); me.wasActive = 0; diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index e387da41..670a67c9 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -66,7 +66,7 @@ var messages_priority_3 = func { ECAM_controller.warningReset(flap_not_zero); } - if (overspeed.clearFlag == 0 and (phaseVar3 == 1 or (phaseVar3 >= 5 and phaseVar3 <= 7)) and getprop("/systems/navigation/adr/output/overspeed")) { + if (overspeed.clearFlag == 0 and (phaseVar3 == 1 or (phaseVar3 >= 5 and phaseVar3 <= 7)) and pts.Systems.Navigation.ADR.Output.overspeed.getBoolValue()) { overspeed.active = 1; if (getprop("/systems/navigation/adr/computation/overspeed-vmo") or getprop("/systems/navigation/adr/computation/overspeed-mmo")) { overspeedVMO.active = 1; diff --git a/Nasal/FMGC/FCU.nas b/Nasal/FMGC/FCU.nas index 5ef43dfb..69196aa4 100644 --- a/Nasal/FMGC/FCU.nas +++ b/Nasal/FMGC/FCU.nas @@ -105,18 +105,18 @@ var FCUController = { FD1: func() { if (me.FCUworking) { if (!fmgc.Output.fd1.getBoolValue()) { - fd1Input.setValue(1); + fmgc.Input.fd1.setValue(1); } else { - fd1Input.setValue(0); + fmgc.Input.fd1.setValue(0); } } }, FD2: func() { if (me.FCUworking) { if (!fmgc.Output.fd2.getBoolValue()) { - fd2Input.setValue(1); + fmgc.Input.fd2.setValue(1); } else { - fd2Input.setValue(0); + fmgc.Input.fd2.setValue(0); } } }, diff --git a/Nasal/FMGC/FMGC-b.nas b/Nasal/FMGC/FMGC-b.nas index 1669b469..e30a4a72 100644 --- a/Nasal/FMGC/FMGC-b.nas +++ b/Nasal/FMGC/FMGC-b.nas @@ -1031,6 +1031,19 @@ setlistener("/it-autoflight/input/vert", func { } }); +# Mode Reversions +setlistener(pts.Systems.Navigation.ADR.Output.overspeed, func(v) { + if (v.getBoolValue() and !Output.ap1.getBoolValue() and !Output.ap2.getBoolValue() and Output.athr.getBoolValue() and Modes.PFD.FMA.pitchMode.getValue() == "OP CLB" and Modes.PFD.FMA.throttle.getValue() == "THR CLB") { + Input.fd1.setValue(0); + Input.fd2.setValue(0); + ecam.aural[5].setBoolValue(0); + settimer(func() { + ecam.aural[5].setBoolValue(1); + }, 0.15); + } +}, 0, 0); + + setlistener("/sim/signals/fdm-initialized", func { ITAF.init(); }); diff --git a/Nasal/Libraries/property-tree-setup.nas b/Nasal/Libraries/property-tree-setup.nas index ed05e695..d3d99167 100644 --- a/Nasal/Libraries/property-tree-setup.nas +++ b/Nasal/Libraries/property-tree-setup.nas @@ -278,6 +278,13 @@ var Sim = { }; var Systems = { + Navigation: { + ADR: { + Output: { + overspeed: props.globals.getNode("/systems/navigation/adr/output/overspeed"), + }, + }, + }, Thrust: { engOut: props.globals.getNode("/systems/thrust/eng-out"), state: [props.globals.getNode("/systems/thrust/state1"), props.globals.getNode("/systems/thrust/state2")], diff --git a/Sounds/A320-common-sound.xml b/Sounds/A320-common-sound.xml index 40db7e4e..7514ae02 100644 --- a/Sounds/A320-common-sound.xml +++ b/Sounds/A320-common-sound.xml @@ -1913,6 +1913,21 @@ + + Chime + Aircraft/A320-family/Sounds/Cockpit/click.wav + once + avionics + + /sim/sound/warnings/click + + + /sim/current-view/internal + + 10 + 100 + + Chime Aircraft/A320-family/Sounds/Cockpit/chime.wav From 72245558c64a8d740121303b63284cbac1200be2 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 19 Jun 2021 14:25:21 +0100 Subject: [PATCH 53/96] Global speed protection in DES mode --- Nasal/FMGC/FMGC-b.nas | 11 +++++++++ Nasal/Libraries/property-tree-setup.nas | 1 + Systems/a320-adr.xml | 32 +++++++++++++++++++++++++ 3 files changed, 44 insertions(+) diff --git a/Nasal/FMGC/FMGC-b.nas b/Nasal/FMGC/FMGC-b.nas index e30a4a72..76acb10f 100644 --- a/Nasal/FMGC/FMGC-b.nas +++ b/Nasal/FMGC/FMGC-b.nas @@ -1043,6 +1043,17 @@ setlistener(pts.Systems.Navigation.ADR.Output.overspeed, func(v) { } }, 0, 0); +setlistener(pts.Systems.Navigation.ADR.Output.underspeed, func(v) { + if (v.getBoolValue() and !Output.ap1.getBoolValue() and !Output.ap2.getBoolValue() and Output.athr.getBoolValue() and Modes.PFD.FMA.pitchMode.getValue() == "OP DES" and Modes.PFD.FMA.throttle.getValue() == "THR IDLE") { + Input.fd1.setValue(0); + Input.fd2.setValue(0); + ecam.aural[5].setBoolValue(0); + settimer(func() { + ecam.aural[5].setBoolValue(1); + }, 0.15); + } +}, 0, 0); + setlistener("/sim/signals/fdm-initialized", func { ITAF.init(); diff --git a/Nasal/Libraries/property-tree-setup.nas b/Nasal/Libraries/property-tree-setup.nas index d3d99167..85b13d6d 100644 --- a/Nasal/Libraries/property-tree-setup.nas +++ b/Nasal/Libraries/property-tree-setup.nas @@ -282,6 +282,7 @@ var Systems = { ADR: { Output: { overspeed: props.globals.getNode("/systems/navigation/adr/output/overspeed"), + underspeed: props.globals.getNode("/systems/navigation/adr/output/underspeed"), }, }, }, diff --git a/Systems/a320-adr.xml b/Systems/a320-adr.xml index b1ef10f0..1946e513 100644 --- a/Systems/a320-adr.xml +++ b/Systems/a320-adr.xml @@ -736,6 +736,33 @@ + + + + /controls/flight/speedbrake eq 1.0 + + + + + + + + + /systems/navigation/adr/output/cas-1 + /systems/navigation/adr/output/cas-2 + /systems/navigation/adr/output/cas-3 + + + /FMGC/internal/vls-min + /systems/navigation/adr/computation/underspeed-difference + + + 1 + 0 + + + + @@ -905,6 +932,11 @@ /systems/navigation/adr/any-adr-on + + /systems/navigation/adr/computation/underspeed + /systems/navigation/adr/any-adr-on + + /instrumentation/radar-altimeter[0]/radar-altitude-ft 1 From 7519519692c26c21261a80beeaf3ec2384610fc1 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 19 Jun 2021 15:02:13 +0100 Subject: [PATCH 54/96] Alpha floor requires at least one working FCU channel --- Nasal/Systems/FADEC/fadec-common.nas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nasal/Systems/FADEC/fadec-common.nas b/Nasal/Systems/FADEC/fadec-common.nas index 64d7bf0b..f0b29c17 100644 --- a/Nasal/Systems/FADEC/fadec-common.nas +++ b/Nasal/Systems/FADEC/fadec-common.nas @@ -285,7 +285,7 @@ var thrust_loop = maketimer(0.04, func { togaLock = alphaProt - 1; if (!pts.Gear.wow[1].getValue() and !pts.Gear.wow[2].getValue() and fbw.FBW.activeLaw.getValue() == 0 and (!pts.Systems.Thrust.engOut.getValue() or (pts.Systems.Thrust.engOut.getValue() and flaps == 0)) and !Fadec.n1Mode[0].getValue() - and !Fadec.n1Mode[1].getValue()) { + and !Fadec.n1Mode[1].getValue() and fmgc.FCUworkingNode.getBoolValue()) { if (alpha > alphaProt and pts.Position.gearAglFt.getValue() >= 100) { Thrust.alphaFloor.setValue(1); Thrust.togaLk.setValue(0); From 1878bcd02ac85b57faf098a57b1e6aa9e018815a Mon Sep 17 00:00:00 2001 From: Inuyaksa Date: Sat, 19 Jun 2021 23:36:49 +0200 Subject: [PATCH 55/96] ND: TCAS range ring 2.5 mn --- Models/Instruments/ND/canvas/res/airbusND.svg | 115 ++++++++++++++---- Models/Instruments/ND/canvas/style.nas | 20 +++ 2 files changed, 109 insertions(+), 26 deletions(-) diff --git a/Models/Instruments/ND/canvas/res/airbusND.svg b/Models/Instruments/ND/canvas/res/airbusND.svg index c93d3d05..cfa7496d 100644 --- a/Models/Instruments/ND/canvas/res/airbusND.svg +++ b/Models/Instruments/ND/canvas/res/airbusND.svg @@ -1,19 +1,19 @@ .9.9MAP NOT AVAILMAP NOT AVAILRANGE CHANGE + id="nd_msg_change" + inkscape:label="#text3401">RANGE CHANGE diff --git a/Models/Instruments/ND/canvas/style.nas b/Models/Instruments/ND/canvas/style.nas index 7f4579f9..0e65b7f1 100644 --- a/Models/Instruments/ND/canvas/style.nas +++ b/Models/Instruments/ND/canvas/style.nas @@ -1094,6 +1094,16 @@ canvas.NDStyles["Airbus"] = { is_false: func(nd) nd.symbols.planArcs.hide(), }, # of planArcs.impl }, # of planArcs + { + id:"rangeRingPlan", + impl: { + init: func(nd,symbol), + predicate: func(nd) (((nd.in_mode("toggle_display_mode", ["PLAN"])) or ((nd.get_switch("toggle_display_mode") == "MAP") and (nd.get_switch("toggle_centered")))) + and (pts.Instrumentation.TCAS.Inputs.mode.getValue() >= 2) and (nd.rangeNm() <= 20) and (nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting))), + is_true: func(nd) nd.symbols.rangeRingPlan.show(), + is_false: func(nd) nd.symbols.rangeRingPlan.hide(), + }, # of rangeRingPlan.impl + }, # of rangeRingPlan { id:"rangeArcs", impl: { @@ -1104,6 +1114,16 @@ canvas.NDStyles["Airbus"] = { is_false: func(nd) nd.symbols.rangeArcs.hide(), }, # of rangeArcs.impl }, # of rangeArcs + { + id:"rangeRingMap", + impl: { + init: func(nd,symbol), + predicate: func(nd) ((nd.get_switch("toggle_display_mode") == "MAP") and (!nd.get_switch("toggle_centered")) + and (pts.Instrumentation.TCAS.Inputs.mode.getValue() >= 2) and (nd.rangeNm() <= 20) and (nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting))), + is_true: func(nd) nd.symbols.rangeRingMap.show(), + is_false: func(nd) nd.symbols.rangeRingMap.hide(), + }, # of rangeRingMap.impl + }, # of rangeRingMap { id:"rangePln1", impl: { From 0c72d737ff7bb552ceac6aa11e704de7000d65d7 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sun, 20 Jun 2021 15:56:45 +0100 Subject: [PATCH 56/96] Bugfix --- Nasal/Systems/FADEC/fadec-common.nas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nasal/Systems/FADEC/fadec-common.nas b/Nasal/Systems/FADEC/fadec-common.nas index f0b29c17..d5799760 100644 --- a/Nasal/Systems/FADEC/fadec-common.nas +++ b/Nasal/Systems/FADEC/fadec-common.nas @@ -285,7 +285,7 @@ var thrust_loop = maketimer(0.04, func { togaLock = alphaProt - 1; if (!pts.Gear.wow[1].getValue() and !pts.Gear.wow[2].getValue() and fbw.FBW.activeLaw.getValue() == 0 and (!pts.Systems.Thrust.engOut.getValue() or (pts.Systems.Thrust.engOut.getValue() and flaps == 0)) and !Fadec.n1Mode[0].getValue() - and !Fadec.n1Mode[1].getValue() and fmgc.FCUworkingNode.getBoolValue()) { + and !Fadec.n1Mode[1].getValue() and fcu.FCUworkingNode.getBoolValue()) { if (alpha > alphaProt and pts.Position.gearAglFt.getValue() >= 100) { Thrust.alphaFloor.setValue(1); Thrust.togaLk.setValue(0); From 01018ef7430493f67b95d9caae01c3306ea0136b Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Mon, 21 Jun 2021 16:38:22 +0100 Subject: [PATCH 57/96] Rework the system display handler to properly handle failures and manual calling of pages --- A320-main.xml | 1 + Models/FlightDeck/a320.flightdeck.xml | 24 +- Nasal/ECAM/ECAM-main.nas | 149 +---------- Nasal/ECAM/SystemDisplay.nas | 332 ++++++++++++++++++++++++ Nasal/Libraries/property-tree-setup.nas | 3 + Systems/a320-apu.xml | 1 + 6 files changed, 357 insertions(+), 153 deletions(-) create mode 100644 Nasal/ECAM/SystemDisplay.nas diff --git a/A320-main.xml b/A320-main.xml index b8158454..79e43a8b 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -4656,6 +4656,7 @@ Aircraft/A320-family/Nasal/Systems/tyresmoke.nas + Aircraft/A320-family/Nasal/ECAM/SystemDisplay.nas Aircraft/A320-family/Nasal/ECAM/ECAM-main.nas Aircraft/A320-family/Nasal/ECAM/ECAM-controller.nas Aircraft/A320-family/Nasal/ECAM/ECAM-logic.nas diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index 6bc7fd11..0691d528 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -2157,7 +2157,7 @@ nasal - + @@ -2176,7 +2176,7 @@ nasal - + @@ -2195,7 +2195,7 @@ nasal - + @@ -2214,7 +2214,7 @@ nasal - + @@ -2233,7 +2233,7 @@ nasal - + @@ -2252,7 +2252,7 @@ nasal - + @@ -2271,7 +2271,7 @@ nasal - + @@ -2290,7 +2290,7 @@ nasal - + @@ -2309,7 +2309,7 @@ nasal - + @@ -2328,7 +2328,7 @@ nasal - + @@ -2347,7 +2347,7 @@ nasal - + @@ -2366,7 +2366,7 @@ nasal - + diff --git a/Nasal/ECAM/ECAM-main.nas b/Nasal/ECAM/ECAM-main.nas index 5a3f88b8..ab8f015d 100644 --- a/Nasal/ECAM/ECAM-main.nas +++ b/Nasal/ECAM/ECAM-main.nas @@ -5,9 +5,6 @@ var ap_active = 0; var athr_active = 0; -var engModeSel = 0; -var APUMaster = 0; -var APURPM = 0; var apOffTime = props.globals.initNode("/ECAM/warnings/ap-off-time", 0, "INT"); var athrOffTime = props.globals.initNode("/ECAM/warnings/athr-off-time", 0, "INT"); var engStrtTimeSw = props.globals.initNode("/ECAM/engine-start-time-switch", 0, "BOOL"); @@ -28,6 +25,7 @@ var ECAM = { engStrtTime.setValue(0); apWarnNode.setValue(0); athrWarnNode.setValue(0); + SystemDisplayController.init(); me.reset(); }, update_items: [ @@ -77,7 +75,6 @@ var ECAM = { setprop("ECAM/rightmsg/linec" ~ i, "w"); } - page.setValue("door"); me.lights.apu.setValue(0); me.lights.bleed.setValue(0); me.lights.cond.setValue(0); @@ -124,10 +121,8 @@ var ECAM = { update_item.update(notification); } - SystemDisplay.update(notification); - - if (me._cachePage != SystemDisplay.page) { - me.updateSDPage(SystemDisplay.page); + if (me._cachePage != SystemDisplayController.displayedPage.name) { + me.updateSDPage(SystemDisplayController.displayedPage.name); } }, updateSDPage: func(newPage) { @@ -139,128 +134,9 @@ var ECAM = { }, }; -var SystemDisplay = { - page: "", - - manShownPage: 0, - failShownPage: 0, - APU10sec: 9, - eng10sec: 9, - fctl20sc: 9, - _apuTime: 0, - _engTime: 0, - _fctlTime: 0, - - failCall: func(page) { - if (me.manShownPage) { - me.manShownPage = 0; - ECAMControlPanel.lightOff(me.page); - } - ECAMControlPanel.lightOn(page); - me.page = page; - me.failShownPage = 1; - }, - manCall: func(page) { - ECAMControlPanel.lightOff(me.page); - ECAMControlPanel.lightOn(page); - me.page = page; - me.manShownPage = 1; - }, - autoCall: func(page) { - if (me.manShownPage or me.failShownPage) { return; } - if (me.page != page) { - me.page = page; - } - }, - update: func(notification) { - APUMaster = systems.APUNodes.Controls.master.getValue(); - APURPM = pts.APU.rpm.getValue(); - engModeSel = pts.Controls.Engines.startSw.getValue(); - - if (APUMaster == 1 and me.APU10sec != 1) { - me.autoCall("apu"); - me.fctl20sec = 0; - - if (me.APU10sec == 9 and APURPM >= 95.0) { - me.APU10sec = 0; - me._apuTime = notification.elapsedTime; - } - - if (me.APU10sec != 9 and notification.elapsedTime > me._apuTime + 10) { - me.APU10sec = 1; - } - } elsif (engModeSel == 0 or engModeSel == 2 or (engModeSel == 1 and me.eng10sec == 0)) { - me.autoCall("eng"); - me.fctl20sec = 0; - - if (me.eng10sec == 9 and engModeSel == 1) { - me.eng10sec = 0; - me._engTime = notification.elapsedTime; - } - - if (me.eng10sec != 9 and notification.elapsedTime > me._engTime + 10) { - me.eng10sec = 1; - } - } else { - # Reset variables - if (APUMaster == 0) { - me.APU10sec = 9; - } - me.eng10sec = 9; - - # Phase logic - if (notification.FWCPhase == 1) { - me.autoCall("door"); - me.fctl20sec = 9; - } elsif (notification.FWCPhase == 2) { - if (notification.aileronFBW >= 0.15 or notification.elevatorFBW >= 0.15 and me.fctl20sec == 9) { - me.autoCall("fctl"); - - if (me.fctl20sec == 9) { - me.fctl20sec = 0; - me._fctlTime = notification.elapsedTime; - } - - if (me.fctl20sec != 9 and notification.elapsedTime > me._fctlTime + 20) { - me.fctl20sec = 1; - } - } elsif (me.fctl20sec == 0) { - if (me.fctl20sec != 9 and notification.elapsedTime > me._fctlTime + 20) { - me.fctl20sec = 1; - } - } else { - me.autoCall("wheel"); - me.fctl20sec = 9; - } - } elsif (notification.FWCPhase >= 3 and notification.FWCPhase <= 5) { - me.autoCall("eng"); - me.fctl20sec = 9; - } elsif (notification.FWCPhase == 6) { - if (notification.gearLever and notification.agl <= 16000) { - me.autoCall("wheel"); - } else { - me.autoCall("crz"); - } - me.fctl20sec = 9; - } elsif (notification.FWCPhase >= 7 and notification.FWCPhase <= 9) { - me.autoCall("wheel"); - me.fctl20sec = 9; - } elsif (notification.FWCPhase == 10) { - me.autoCall("door"); - me.fctl20sec = 9; - } - } - }, -}; - var ECAMControlPanel = { sysPageBtn: func(page) { - if (SystemDisplay.page != page) { - SystemDisplay.manCall(page); - } else { - me.lightOff(SystemDisplay.page); - SystemDisplay.manShownPage = 0; - } + SystemDisplayController.manCall(page); }, rclBtn: func() { ecam.ECAM_controller.recall(); @@ -278,22 +154,13 @@ var ECAMControlPanel = { return; } - if (SystemDisplay.manShownPage) { - me.lightOff(SystemDisplay.page); - SystemDisplay.manShownPage = 0; - return; - } - - if (SystemDisplay.failShownPage) { - me.lightOff(SystemDisplay.page); - SystemDisplay.failShownPage = 0; - return; - } - + SystemDisplayController.manCall("CLR"); ecam.ECAM_controller.clear(); }, stsBtn: func() { - SystemDisplay.manCall("sts"); + if (SystemDisplayController.displayedPage.name != "statusPage") { + SystemDisplayController.manCall("statusPage"); + } }, allBtn: func() { # todo diff --git a/Nasal/ECAM/SystemDisplay.nas b/Nasal/ECAM/SystemDisplay.nas new file mode 100644 index 00000000..23572e5c --- /dev/null +++ b/Nasal/ECAM/SystemDisplay.nas @@ -0,0 +1,332 @@ +var Page = { + new: func(name) { + var page = {parents:[Page]}; + page.name = name; + return page; + }, +}; + +var SystemDisplayController = { + PageList: { + apuPage: Page.new("apu"), + bleedPage: Page.new("bleed"), + cabPressPage: Page.new("press"), + condPage: Page.new("cond"), + cruisePage: Page.new("cruise"), + doorPage: Page.new("door"), + enginePage: Page.new("eng"), + elecPage: Page.new("elec"), + fctlPage: Page.new("fctl"), + fuelPage: Page.new("fuel"), + hydraulicPage: Page.new("hyd"), + statusPage: Page.new("sts"), + wheelPage: Page.new("wheel"), + }, + displayedPage: nil, + lastDisplayedPage: nil, + lastMode: nil, + mode: 0, # 0 = man, 1 = warning, 2 = advisory (not used yet), 3 = auto + tempFWCPhase: nil, + tempElapsedTime: nil, + tempEngineModeSel: nil, + init: func() { + me.displayedPage = me.PageList.doorPage; + ECAMTimer.start(); + }, + autoCallLoop: func() { + me.tempFWCPhase = pts.ECAM.fwcWarningPhase.getValue(); + + if (me.Display.APU) { + me.displayedPage = me.PageList.apuPage; + } else if (me.Display.Engine) { + me.displayedPage = me.PageList.enginePage; + } else if (me.tempFWCPhase == 1) { + if (me.Display.Elec) { + me.displayedPage = me.PageList.elecPage; + } else { + me.displayedPage = me.PageList.doorPage; + } + } else if (me.tempFWCPhase == 2) { + if (me.Display.Elec) { + me.displayedPage = me.PageList.elecPage; + } else if (me.Display.FCTL) { + me.displayedPage = me.PageList.fctlPage; + } else { + me.displayedPage = me.PageList.wheelPage; + } + } else if (me.tempFWCPhase == 3 or me.tempFWCPhase == 4 or me.tempFWCPhase == 5) { + me.displayedPage = me.PageList.enginePage; + } else if (me.tempFWCPhase == 6) { + if (pts.Controls.Gear.gearDown.getValue() and me.altitudeBelow16000) { + me.displayedPage = me.PageList.wheelPage; + } else if (me.Display.Cruise) { + me.displayedPage = me.PageList.cruisePage; + } else { + me.displayedPage = me.PageList.enginePage; + } + } else if (me.tempFWCPhase == 7) { + me.displayedPage = me.PageList.wheelPage; + } else if (me.tempFWCPhase == 8 or me.tempFWCPhase == 9) { + if (me.Display.Elec) { + me.displayedPage = me.PageList.elecPage; + } else { + me.displayedPage = me.PageList.wheelPage; + } + } else if (me.tempFWCPhase == 10) { + if (me.Display.Elec) { + me.displayedPage = me.PageList.elecPage; + } else { + me.displayedPage = me.PageList.doorPage; + } + } + }, + Timers: { + APUTimeOn: 0, + APUTime: 0, + CruiseTime: 0, + CruiseTimeOn: 0, + EngineTime: 0, + EngineTimeStart: 0, + EngineTimeOn: 0, + FCTLTimeStart: 0, + FCTLTimeOn: 0, + FCTLTime: 0, + }, + Display: { + APU: 0, + Cruise: 0, + Elec: 0, + Engine: 0, + FCTL: 0, + }, + altitudeBelow16000: 0, + update: func() { + me.tempElapsedTime = pts.Sim.Time.elapsedSec.getValue(); + + me.altitude = pts.Position.altitudeFt.getValue(); + if (me.altitude < 16000) { + if (!me.altitudeBelow16000) { + me.altitudeBelow16000 = 1; + me.autoCallLoop(); + } + } else { + if (me.altitudeBelow16000) { + me.altitudeBelow16000 = 0; + me.autoCallLoop(); + } + } + + if (systems.ELEC.Switch.emerGenTest.getValue()) { + if (!me.Display.Elec) { + me.Display.Elec = 1; + me.autoCallLoop(); + } + } else { + if (me.Display.Elec) { + me.Display.Elec = 0; + me.autoCallLoop(); + } + } + + if (systems.APUNodes.Controls.master.getValue()) { + if (pts.APU.rpm.getValue() > 95 and !me.Timers.APUTimeOn) { + me.Timers.APUTimeOn = 1; + me.Timers.APUTime = me.tempElapsedTime; + } + + if ((me.Timers.APUTimeOn and (me.tempElapsedTime - me.Timers.APUTime) < 10) or !me.Timers.APUTimeOn) { + if (!me.Display.APU) { + me.Display.APU = 1; + me.autoCallLoop(); + } + } else { + if (me.Display.APU) { + me.Display.APU = 0; + me.autoCallLoop(); + } + } + } else { + me.Timers.APUTimeOn = 0; + me.Timers.APUTime = 0; + if (me.Display.APU) { + me.Display.APU = 0; + me.autoCallLoop(); + } + } + + if (abs(pts.Controls.Flight.aileron.getValue()) > 0.05 or abs(pts.Controls.Flight.elevator.getValue()) > 0.05 or abs(pts.Controls.Flight.rudder.getValue()) > 0.50) { + me.Timers.FCTLTimeStart = 1; + if (!me.Display.FCTL) { + me.Display.FCTL = 1; + me.autoCallLoop(); + } + me.autoCallLoop(); + } else { + if (!me.Timers.FCTLTimeOn and me.Timers.FCTLTimeStart) { + me.Timers.FCTLTimeOn = 1; + me.Timers.FCTLTimeStart = 0; + me.Timers.FCTLTime = me.tempElapsedTime; + } else if (me.Timers.FCTLTimeOn) { + if ((me.tempElapsedTime - me.Timers.FCTLTime) < 20) { + if (!me.Display.FCTL) { + me.Display.FCTL = 1; + me.autoCallLoop(); + } + } else { + me.Timers.FCTLTimeOn = 0; + me.Timers.FCTLTime = 0; + } + } else { + if (me.Display.FCTL) { + me.Display.FCTL = 0; + me.autoCallLoop(); + } + me.Timers.FCTLTime = 0; + } + } + + me.tempFWCPhase = pts.ECAM.fwcWarningPhase.getValue(); + if (me.tempFWCPhase == 6) { + if (!ecam.FWC.toPower.getValue() and pts.Controls.Flight.flapsPos.getValue() == 0) { + if (!me.Display.Cruise) { + me.Display.Cruise = 1; + me.autoCallLoop(); + } + } else if (!me.Display.Cruise) { + if (!me.Timers.CruiseTimeOn) { + me.Timers.CruiseTimeOn = 1; + me.Timers.CruiseTime = me.tempElapsedTime; + } else { + if ((me.tempElapsedTime - me.Timers.CruiseTime) > 60) { + if (!me.Display.Cruise) { + me.Display.Cruise = 1; + me.autoCallLoop(); + } + } + } + } + } else { + me.Timers.CruiseTime = 0; + me.Timers.CruiseTimeOn = 0; + if (me.Display.Cruise) { + me.Display.Cruise = 0; + me.autoCallLoop(); + } + } + + me.tempEngineModeSel = pts.Controls.Engines.startSw.getValue(); + if (me.tempEngineModeSel == 0 or me.tempEngineModeSel == 2) { + if (!me.Display.Engine) { + me.Display.Engine = 1; + me.autoCallLoop(); + } + + if (me.tempEngineModeSel == 2) { + me.Timers.EngineTimeStart = 1; + } + } else { + if (me.Timers.EngineTimeStart and !me.Timers.EngineTimeOn) { + me.Timers.EngineTimeOn = 1; + me.Timers.EngineTime = me.tempElapsedTime; + } + + if (me.Timers.EngineTimeOn) { + if ((me.tempElapsedTime - me.Timers.EngineTime) < 10) { + if (!me.Display.Engine) { + me.Display.Engine = 1; + me.autoCallLoop(); + } + } else { + me.Timers.EngineTimeStart = 0; + me.Timers.EngineTimeOn = 0; + me.Timers.EngineTime = 0; + if (me.Display.Engine) { + me.Display.Engine = 0; + me.autoCallLoop(); + } + } + } else { + if (me.Display.Engine) { + me.Display.Engine = 0; + me.autoCallLoop(); + } + } + } + }, + autoCall: func() { + me.mode = 3; + me.autoCallLoop(); + }, + failureCall: func(newPage) { + if (contains(me.PageList, newPage)) { + me.lastDisplayedPage = me.displayedPage; + me.displayedPage = me.PageList[newPage]; + me.lastMode = me.mode; + me.mode = 1; + ECAMControlPanel.lightOff(me.lastDisplayedPage.name); + ECAMControlPanel.lightOn(me.displayedPage.name); + } else { + debug.dump("Attempted to set page to unknown page", newPage); + } + }, + manCall: func(newPage) { + if (contains(me.PageList, newPage)) { + if (me.displayedPage == me.PageList[newPage] and me.mode != 3) { + ECAMControlPanel.lightOff(me.displayedPage.name); + me.displayedPage = me.autoCall(); + } else { + ECAMControlPanel.lightOff(me.displayedPage.name); + if (me.mode == 1) { + me.lastDisplayedPage = me.displayedPage; + me.lastMode = me.mode; + } + me.displayedPage = me.PageList[newPage]; + me.mode = 0; + ECAMControlPanel.lightOn(me.displayedPage.name); + } + } elsif (newPage == "CLR") { + if (me.mode == 1) { + if (me.lastMode == 0) { + ECAMControlPanel.lightOff(me.displayedPage.name); + me.displayedPage = me.lastDisplayedPage; + ECAMControlPanel.lightOn(me.displayedPage.name); + me.lastDisplayedPage = nil; + me.mode = 0; + } else { + ECAMControlPanel.lightOff(me.displayedPage.name); + me.displayedPage = me.autoCall(); + } + } elsif (me.mode == 0) { + if (me.lastMode == 1) { + ECAMControlPanel.lightOff(me.displayedPage.name); + me.displayedPage = me.lastDisplayedPage; + ECAMControlPanel.lightOn(me.displayedPage.name); + me.lastDisplayedPage = nil; + me.mode = 1; + } else { + ECAMControlPanel.lightOff(me.displayedPage.name); + me.displayedPage = me.autoCall(); + } + } + } else { + debug.dump("Attempted to set page to unknown page", newPage); + } + }, +}; + +setlistener("/ECAM/warning-phase", func() { + if (SystemDisplayController.mode == 3) { + SystemDisplayController.autoCall(); + } +}, 0, 0); + +setlistener("/controls/gear/gear-down", func() { + if (SystemDisplayController.mode == 3) { + SystemDisplayController.autoCall(); + } +}, 0, 0); + + +var ECAMTimer = maketimer(1, func() { + SystemDisplayController.update(); +}); \ No newline at end of file diff --git a/Nasal/Libraries/property-tree-setup.nas b/Nasal/Libraries/property-tree-setup.nas index 85b13d6d..b64e56ca 100644 --- a/Nasal/Libraries/property-tree-setup.nas +++ b/Nasal/Libraries/property-tree-setup.nas @@ -50,6 +50,7 @@ var Controls = { aileron: props.globals.getNode("/controls/flight/aileron"), aileronDrivesTiller: props.globals.getNode("/controls/flight/aileron-drives-tiller"), autoCoordination: props.globals.getNode("/controls/flight/auto-coordination"), + elevator: props.globals.getNode("/controls/flight/elevator"), elevatorTrim: props.globals.getNode("/controls/flight/elevator-trim"), flaps: props.globals.getNode("/controls/flight/flaps"), flapsTemp: 0, @@ -57,6 +58,7 @@ var Controls = { flapsPos: props.globals.getNode("/controls/flight/flaps-pos"), speedbrake: props.globals.getNode("/controls/flight/speedbrake"), speedbrakeArm: props.globals.getNode("/controls/flight/speedbrake-arm"), + rudder: props.globals.getNode("/controls/flight/rudder"), rudderTrim: props.globals.getNode("/controls/flight/rudder-trim"), }, Gear: { @@ -217,6 +219,7 @@ var Orientation = { }; var Position = { + altitudeFt: props.globals.getNode("/position/altitude-ft"), gearAglFt: props.globals.getNode("/position/gear-agl-ft"), latitude: props.globals.getNode("/position/latitude-deg"), longitude: props.globals.getNode("/position/longitude-deg"), diff --git a/Systems/a320-apu.xml b/Systems/a320-apu.xml index 42691717..f6ad2161 100644 --- a/Systems/a320-apu.xml +++ b/Systems/a320-apu.xml @@ -182,6 +182,7 @@ /systems/apu/oil/level-l + From 11c230bdfe5bb00b0e7cd571c212e7afa78f059c Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Mon, 21 Jun 2021 16:41:29 +0100 Subject: [PATCH 58/96] Fix ECAM controller --- Nasal/ECAM/ECAM-controller.nas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Nasal/ECAM/ECAM-controller.nas b/Nasal/ECAM/ECAM-controller.nas index d84b680d..cb5ff9ab 100644 --- a/Nasal/ECAM/ECAM-controller.nas +++ b/Nasal/ECAM/ECAM-controller.nas @@ -243,7 +243,7 @@ var warning = { }, callPage: func() { if (me.sdPage == "nil" or me.hasCalled == 1) { return; } - ecam.SystemDisplay.failCall(me.sdPage); + ecam.SystemDisplayController.failureCall(me.sdPage); me.hasCalled = 1; } }; @@ -478,7 +478,7 @@ var ECAM_controller = { } if (statusFlag == 1 and lines[0].getValue() == "") { - ecam.SystemDisplay.manCall("sts"); + ecam.SystemDisplay.manCall("statusPage"); statusFlag = 0; } }, From 6f4865e5422ab55a3f93ba30851bf734aebd99c2 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Mon, 21 Jun 2021 16:42:36 +0100 Subject: [PATCH 59/96] ECAM controller fix #2 --- Nasal/ECAM/ECAM-controller.nas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nasal/ECAM/ECAM-controller.nas b/Nasal/ECAM/ECAM-controller.nas index cb5ff9ab..23fefb7a 100644 --- a/Nasal/ECAM/ECAM-controller.nas +++ b/Nasal/ECAM/ECAM-controller.nas @@ -478,7 +478,7 @@ var ECAM_controller = { } if (statusFlag == 1 and lines[0].getValue() == "") { - ecam.SystemDisplay.manCall("statusPage"); + ecam.SystemDisplayController.manCall("statusPage"); statusFlag = 0; } }, From 1811431d00fe0f66e2b5ff8bb6dfc94b74be3e10 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Mon, 21 Jun 2021 16:51:31 +0100 Subject: [PATCH 60/96] First test of a warning triggering a failure page call --- Nasal/ECAM/ECAM-controller.nas | 1 + Nasal/ECAM/ECAM-logic.nas | 6 +++--- Nasal/ECAM/ECAM-messages.nas | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Nasal/ECAM/ECAM-controller.nas b/Nasal/ECAM/ECAM-controller.nas index 23fefb7a..00881a12 100644 --- a/Nasal/ECAM/ECAM-controller.nas +++ b/Nasal/ECAM/ECAM-controller.nas @@ -352,6 +352,7 @@ var ECAM_controller = { if (counter < 9) { w.write(); counter += 1; + w.callPage(); } w.warnlight(); w.sound(); diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index 670a67c9..a5b764c5 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -211,19 +211,19 @@ var messages_priority_3 = func { } # ENG FIRE - if ((eng1FireFlAgent2.clearFlag == 0 and systems.eng1FireWarn.getValue() == 1 and phaseVar3 >= 5 and phaseVar3 <= 7) or (eng1FireGnEvac.clearFlag == 0 and systems.eng1FireWarn.getValue() == 1 and (phaseVar3 < 5 or phaseVar3 > 7))) { + if ((eng1Fire.clearFlag == 0 and systems.eng1FireWarn.getValue() == 1 and phaseVar3 >= 5 and phaseVar3 <= 7) or (eng1FireGnEvac.clearFlag == 0 and systems.eng1FireWarn.getValue() == 1 and (phaseVar3 < 5 or phaseVar3 > 7))) { eng1Fire.active = 1; } else { ECAM_controller.warningReset(eng1Fire); } - if ((eng2FireFlAgent2.clearFlag == 0 and systems.eng2FireWarn.getValue() == 1 and phaseVar3 >= 5 and phaseVar3 <= 7) or (eng2FireGnEvac.clearFlag == 0 and systems.eng2FireWarn.getValue() == 1 and (phaseVar3 < 5 or phaseVar3 > 7))) { + if ((eng2Fire.clearFlag == 0 and systems.eng2FireWarn.getValue() == 1 and phaseVar3 >= 5 and phaseVar3 <= 7) or (eng2FireGnEvac.clearFlag == 0 and systems.eng2FireWarn.getValue() == 1 and (phaseVar3 < 5 or phaseVar3 > 7))) { eng2Fire.active = 1; } else { ECAM_controller.warningReset(eng2Fire); } - if (apuFireMaster.clearFlag == 0 and systems.apuFireWarn.getValue() == 1) { + if (apuFire.clearFlag == 0 and systems.apuFireWarn.getValue() == 1) { apuFire.active = 1; } else { ECAM_controller.warningReset(apuFire); diff --git a/Nasal/ECAM/ECAM-messages.nas b/Nasal/ECAM/ECAM-messages.nas index a0d2c854..5560b411 100644 --- a/Nasal/ECAM/ECAM-messages.nas +++ b/Nasal/ECAM/ECAM-messages.nas @@ -101,7 +101,7 @@ var warnings = std.Vector.new([ var ADR123FaultPROC = warning.new(msg: " -ALL ADR OFF PROC.APPLY", colour: "c"), # APU FIRE - var apuFire = warning.new(msg: "APU FIRE ", colour: "r", aural: 0, light: 0, isMainMsg: 1, sdPage: "apu"), + var apuFire = warning.new(msg: "APU FIRE ", colour: "r", aural: 0, light: 0, isMainMsg: 1, sdPage: "apuPage"), var apuFirePB = warning.new(msg: " -APU FIRE P/B......PUSH", colour: "c"), var apuFireAgentTimer = warning.new(msg: " -AGENT AFT 10 S...DISCH", colour: "c"), var apuFireAgent = warning.new(msg: " -AGENT............DISCH", colour: "c"), From 611cd9c74ca208bfec8ccf37cd094ee4de638980 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Mon, 21 Jun 2021 17:52:13 +0100 Subject: [PATCH 61/96] More stuff --- Models/Instruments/Lower-ECAM/Lower-ECAM.nas | 2 +- Nasal/ECAM/ECAM-controller.nas | 9 +++++++-- Nasal/ECAM/ECAM-logic.nas | 4 ++-- Nasal/ECAM/ECAM-main.nas | 5 ++--- Nasal/ECAM/SystemDisplay.nas | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index ae1298d8..35e6d808 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -296,7 +296,7 @@ var canvas_lowerECAM_base = { lowerECAM_hyd.page.hide(); lowerECAM_wheel.page.hide(); lowerECAM_cond.update(); - } else if (page == "crz") { + } else if (page == "cruise") { lowerECAM_apu.page.hide(); lowerECAM_bleed.page.hide(); lowerECAM_cond.page.hide(); diff --git a/Nasal/ECAM/ECAM-controller.nas b/Nasal/ECAM/ECAM-controller.nas index 00881a12..b3628e89 100644 --- a/Nasal/ECAM/ECAM-controller.nas +++ b/Nasal/ECAM/ECAM-controller.nas @@ -478,9 +478,14 @@ var ECAM_controller = { } } - if (statusFlag == 1 and lines[0].getValue() == "") { - ecam.SystemDisplayController.manCall("statusPage"); + if (!hasCleared and statusFlag) { statusFlag = 0; + ecam.SystemDisplayController.manCall("statusPage"); + return; + } + + if (!hasCleared and !statusFlag) { + SystemDisplayController.manCall("CLR"); } }, recall: func() { diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index a5b764c5..90aa0205 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -551,13 +551,13 @@ var messages_priority_3 = func { apuFireAgentTimer.msg = " -AGENT AFT " ~ systems.apuAgentTimer.getValue() ~ " S...DISCH"; } - if (apuFireAgent.clearFlag == 0 and systems.APUNodes.Controls.fire.getValue() and !systems.extinguisherBottles.vector[5].lightProp.getValue() and systems.apuAgentTimer.getValue() != 0) { + if (apuFireAgent.clearFlag == 0 and systems.APUNodes.Controls.fire.getValue() and !systems.extinguisherBottles.vector[4].lightProp.getValue() and systems.apuAgentTimer.getValue() != 0) { apuFireAgentTimer.active = 1; } else { ECAM_controller.warningReset(apuFireAgentTimer); } - if (apuFireAgent.clearFlag == 0 and systems.APUNodes.Controls.fire.getValue() and !systems.extinguisherBottles.vector[5].lightProp.getValue() and systems.apuAgentTimer.getValue() == 0) { + if (apuFireAgent.clearFlag == 0 and systems.APUNodes.Controls.fire.getValue() and !systems.extinguisherBottles.vector[4].lightProp.getValue() and systems.apuAgentTimer.getValue() == 0) { apuFireAgent.active = 1; } else { ECAM_controller.warningReset(apuFireAgent); diff --git a/Nasal/ECAM/ECAM-main.nas b/Nasal/ECAM/ECAM-main.nas index ab8f015d..8ce03bed 100644 --- a/Nasal/ECAM/ECAM-main.nas +++ b/Nasal/ECAM/ECAM-main.nas @@ -154,7 +154,6 @@ var ECAMControlPanel = { return; } - SystemDisplayController.manCall("CLR"); ecam.ECAM_controller.clear(); }, stsBtn: func() { @@ -172,11 +171,11 @@ var ECAMControlPanel = { # todo }, lightOff: func(pageLightOff) { - if (pageLightOff == "crz") { return; } + if (pageLightOff == "cruise") { return; } ECAM.lights[pageLightOff].setBoolValue(0); }, lightOn: func(pageLightOn) { - if (pageLightOn == "crz") { return; } + if (pageLightOn == "cruise") { return; } ECAM.lights[pageLightOn].setBoolValue(1); }, }; diff --git a/Nasal/ECAM/SystemDisplay.nas b/Nasal/ECAM/SystemDisplay.nas index 23572e5c..e3f0f75e 100644 --- a/Nasal/ECAM/SystemDisplay.nas +++ b/Nasal/ECAM/SystemDisplay.nas @@ -259,11 +259,11 @@ var SystemDisplayController = { }, failureCall: func(newPage) { if (contains(me.PageList, newPage)) { + ECAMControlPanel.lightOff(me.displayedPage.name); me.lastDisplayedPage = me.displayedPage; me.displayedPage = me.PageList[newPage]; me.lastMode = me.mode; me.mode = 1; - ECAMControlPanel.lightOff(me.lastDisplayedPage.name); ECAMControlPanel.lightOn(me.displayedPage.name); } else { debug.dump("Attempted to set page to unknown page", newPage); From 10edd0fd0f5b018fab5ed6695e3c9b27fc817ee7 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Tue, 22 Jun 2021 15:26:56 +0100 Subject: [PATCH 62/96] ECAM phases: fix interaction of phase 1 / phase 10 and finish the move from Nasal --> jsb --- Nasal/ECAM/ECAM-main.nas | 11 ++-- Nasal/ECAM/ECAM-phases.nas | 119 +++++++++++++----------------------- Systems/a320-fwc-phases.xml | 85 ++++++++++++++++++++++++-- 3 files changed, 126 insertions(+), 89 deletions(-) diff --git a/Nasal/ECAM/ECAM-main.nas b/Nasal/ECAM/ECAM-main.nas index 8ce03bed..4c814e53 100644 --- a/Nasal/ECAM/ECAM-main.nas +++ b/Nasal/ECAM/ECAM-main.nas @@ -69,10 +69,10 @@ var ECAM = { }, reset: func() { for (var i = 0; i <= 8; i = i + 1) { - setprop("ECAM/msg/line" ~ i, ""); - setprop("ECAM/rightmsg/line" ~ i, ""); - setprop("ECAM/msg/linec" ~ i, "w"); - setprop("ECAM/rightmsg/linec" ~ i, "w"); + setprop("/ECAM/msg/line" ~ i, ""); + setprop("/ECAM/rightmsg/line" ~ i, ""); + setprop("/ECAM/msg/linec" ~ i, "w"); + setprop("/ECAM/rightmsg/linec" ~ i, "w"); } me.lights.apu.setValue(0); @@ -129,9 +129,6 @@ var ECAM = { me._cachePage = newPage; page.setValue(newPage); }, - clrLight: func() { - me.lights.clr.setValue(1); - }, }; var ECAMControlPanel = { diff --git a/Nasal/ECAM/ECAM-phases.nas b/Nasal/ECAM/ECAM-phases.nas index edccc4c4..3dea0097 100644 --- a/Nasal/ECAM/ECAM-phases.nas +++ b/Nasal/ECAM/ECAM-phases.nas @@ -2,7 +2,7 @@ # Copyright (c) 2019 Jonathan Redpath (legoboyvdlp) -var myPhase = nil; +var currentPhase = nil; var eng = nil; var eng1epr = nil; var eng2epr = nil; @@ -22,11 +22,16 @@ var FWC = { Monostable: { phase1: props.globals.initNode("/ECAM/phases/monostable/phase-1-300", 0, "BOOL"), phase5: props.globals.initNode("/ECAM/phases/monostable/phase-5", 0, "BOOL"), + phase5Temp: 0, phase7: props.globals.initNode("/ECAM/phases/monostable/phase-7", 0, "BOOL"), + phase7Temp: 0, phase9: props.globals.initNode("/ECAM/phases/monostable/phase-9", 0, "BOOL"), phase1Output: props.globals.initNode("/ECAM/phases/monostable/phase-1-300-output"), + phase1OutputTemp: 0, phase5Output: props.globals.initNode("/ECAM/phases/monostable/phase-5-output"), + phase5OutputTemp: 0, phase7Output: props.globals.initNode("/ECAM/phases/monostable/phase-7-output"), + phase7OutputTemp: 0, phase9Output: props.globals.initNode("/ECAM/phases/monostable/phase-9-output"), toPowerOutput: props.globals.getNode("/ECAM/phases/monostable/to-power-set-output"), m80kt: props.globals.getNode("/ECAM/phases/monostable-80kt"), @@ -38,12 +43,14 @@ var FWC = { phase2Set: props.globals.initNode("/ECAM/phases/flipflop/phase-2-set", 0, "BOOL"), phase2Reset: props.globals.initNode("/ECAM/phases/flipflop/phase-2-reset", 0, "BOOL"), phase2Output: props.globals.initNode("/ECAM/phases/flipflop/phase-2-output", 0, "BOOL"), + phase2OutputTemp: 0, phase10Set: props.globals.initNode("/ECAM/phases/flipflop/phase-10-set", 0, "BOOL"), phase10Reset: props.globals.initNode("/ECAM/phases/flipflop/phase-10-reset", 0, "BOOL"), phase10Output: props.globals.initNode("/ECAM/phases/flipflop/phase-10-output", 0, "BOOL"), recallSet: props.globals.initNode("/ECAM/flipflop/recall-set", 0, "BOOL"), recallReset: props.globals.initNode("/ECAM/flipflop/recall-reset", 0, "BOOL"), recallOutput: props.globals.initNode("/ECAM/flipflop/recall-output", 0, "BOOL"), + recallOutputTemp: 0, }, Logic: { gnd: props.globals.getNode("/ECAM/logic/ground-calc-immediate"), @@ -60,7 +67,9 @@ var FWC = { eng1idleOutput: props.globals.getNode("/ECAM/phases/timer/eng1idle-output"), eng2idleOutput: props.globals.getNode("/ECAM/phases/timer/eng2idle-output"), eng1and2Off: props.globals.getNode("/ECAM/phases/phase-calculation/engines-1-2-not-running"), + eng1and2OffTemp: 0, eng1or2Output: props.globals.getNode("/ECAM/phases/phase-calculation/engine-1-or-2-running"), + eng1or2OutputTemp: 0, toInhibitOutput: props.globals.getNode("/ECAM/phases/timer/to-inhibit-output"), ldgInhibitOutput: props.globals.getNode("/ECAM/phases/timer/ldg-inhibit-output"), gnd: props.globals.getNode("/ECAM/timer/ground-calc"), # ZGND @@ -68,7 +77,9 @@ var FWC = { gnd2SecHalf: props.globals.getNode("/ECAM/phases/monostable/gnd-output-2"), # hack to prevent getting confused between phase 5 / 6 }, speed80: props.globals.initNode("/ECAM/phases/speed-gt-80", 0, "BOOL"), + speed80Temp: 0, toPower: props.globals.getNode("/ECAM/phases/phase-calculation/takeoff-power"), + toPowerTemp: 0, altChg: props.globals.getNode("/it-autoflight/input/alt-is-changing", 1), }; @@ -79,124 +90,78 @@ var phaseLoop = func() { if ((systems.ELEC.Bus.acEss.getValue() < 110 and systems.ELEC.Bus.ac2.getValue() < 110) or pts.Acconfig.running.getBoolValue()) { return; } if (pts.Sim.Replay.replayActive.getBoolValue()) { return; } - myPhase = pts.ECAM.fwcWarningPhase.getValue(); - eng = pts.Options.eng.getValue(); - eng1epr = pts.Engines.Engine.eprActual[0].getValue(); - eng2epr = pts.Engines.Engine.eprActual[1].getValue(); - eng1n1 = pts.Engines.Engine.n1Actual[0].getValue(); - eng2n1 = pts.Engines.Engine.n1Actual[1].getValue(); - master1 = pts.Controls.Engines.Engine.cutoffSw[0].getBoolValue(); - master2 = pts.Controls.Engines.Engine.cutoffSw[1].getBoolValue(); + currentPhase = pts.ECAM.fwcWarningPhase.getValue(); gnd = FWC.Logic.gnd.getBoolValue(); gndTimer = FWC.Timer.gnd.getValue(); - FWC.Flipflop.recallReset.setValue(0); + + if (FWC.Flipflop.recallReset.getValue() != 0) { + FWC.Flipflop.recallReset.setValue(0); + } - # Various things - - if (myPhase == 9) { - FWC.Monostable.phase9.setBoolValue(1); - } else { - FWC.Monostable.phase9.setBoolValue(0); - } - - # Phase 1 / 10 flipflop - if (myPhase == 9) { - FWC.Flipflop.phase10Set.setBoolValue(1); - } else { - FWC.Flipflop.phase10Set.setBoolValue(0); - } - - if (gndTimer == 1 and pts.Controls.Engines.Engine.firePb[0].getBoolValue()) { - FWC.Flipflop.phase10Reset.setBoolValue(1); - } else { - FWC.Flipflop.phase10Reset.setBoolValue(0); - } - - if ((gnd and FWC.Timer.eng1and2Off.getValue() and myPhase == 9) and FWC.Flipflop.phase10Output.getBoolValue()) { - FWC.Monostable.phase1.setBoolValue(1); # true for 300 sec then false - } else { - FWC.Monostable.phase1.setBoolValue(0); - } - - # Phase 2 flipflop - if (myPhase == 3 or myPhase == 8) { - FWC.Flipflop.phase2Set.setBoolValue(1); - } else { - FWC.Flipflop.phase2Set.setBoolValue(0); - } - - if (!FWC.Monostable.m80kt.getBoolValue() and myPhase != 9 and ((!FWC.Monostable.phase9Output.getBoolValue() and gndTimer == 1) or (!FWC.Monostable.toPowerOutput.getBoolValue() and gndTimer == 1))) { - FWC.Flipflop.phase2Reset.setBoolValue(1); - } else { - FWC.Flipflop.phase2Reset.setBoolValue(0); - } - gear_agl_cur = pts.Position.gearAglFt.getValue(); + FWC.toPowerTemp = FWC.toPower.getBoolValue(); + FWC.Timer.eng1and2OffTemp = FWC.Timer.eng1and2Off.getValue(); + FWC.Timer.eng1or2OutputTemp = FWC.Timer.eng1or2Output.getBoolValue(); + FWC.speed80Temp = FWC.speed80.getBoolValue(); - # Phase 5 monostable - if (FWC.toPower.getBoolValue() and (!FWC.Logic.feet1500.getBoolValue() and !gnd and FWC.Timer.gnd2Sec.getValue() != 1)) { - FWC.Monostable.phase5.setBoolValue(1); - } else { - FWC.Monostable.phase5.setBoolValue(0); - } + FWC.Monostable.phase1OutputTemp = FWC.Monostable.phase1Output.getBoolValue(); + FWC.Flipflop.phase2OutputTemp = FWC.Flipflop.phase2Output.getBoolValue(); + FWC.Monostable.phase5Temp = FWC.Monostable.phase5.getBoolValue(); + FWC.Monostable.phase5OutputTemp = FWC.Monostable.phase5Output.getBoolValue(); + FWC.Monostable.phase7Temp = FWC.Monostable.phase7.getBoolValue(); + FWC.Monostable.phase7OutputTemp = FWC.Monostable.phase7Output.getBoolValue(); - # Phase 7 monostable - if (!FWC.toPower.getBoolValue() and !FWC.Logic.feet1500.getBoolValue() and !FWC.Logic.feet800.getBoolValue() and !gnd and FWC.Timer.gnd2Sec.getValue() != 1) { - FWC.Monostable.phase7.setBoolValue(1); - } else { - FWC.Monostable.phase7.setBoolValue(0); - } - - # Actual Phases - if ((gnd and FWC.Timer.eng1and2Off.getValue() and myPhase != 9) and !FWC.Monostable.phase1Output.getBoolValue()) { + # Set Phases + if ((gnd and FWC.Timer.eng1and2OffTemp and currentPhase != 9) and !FWC.Monostable.phase1OutputTemp) { setPhase(1); } - if (FWC.Timer.eng1or2Output.getBoolValue() and (gnd and !FWC.toPower.getBoolValue() and !FWC.speed80.getBoolValue()) and !FWC.Flipflop.phase2Output.getBoolValue()) { + if (FWC.Timer.eng1or2OutputTemp and (gnd and !FWC.toPowerTemp and !FWC.speed80Temp) and !FWC.Flipflop.phase2OutputTemp) { setPhase(2); } - if (FWC.Timer.eng1or2Output.getBoolValue() and (gndTimer == 1 and FWC.toPower.getBoolValue()) and !FWC.speed80.getBoolValue()) { + if (FWC.Timer.eng1or2OutputTemp and (gndTimer == 1 and FWC.toPowerTemp) and !FWC.speed80Temp) { setPhase(3); } - if ((gndTimer == 1 and FWC.toPower.getBoolValue()) and FWC.speed80.getBoolValue()) { + if ((gndTimer == 1 and FWC.toPowerTemp) and FWC.speed80Temp) { setPhase(4); } - if (FWC.Monostable.phase5.getBoolValue() and FWC.Monostable.phase5Output.getBoolValue()) { + if (FWC.Monostable.phase5Temp and FWC.Monostable.phase5OutputTemp) { setPhase(5); } - if (!gnd and FWC.Timer.gnd2SecHalf.getValue() != 1 and (!FWC.Monostable.phase5.getBoolValue() or !FWC.Monostable.phase5Output.getBoolValue()) and (!FWC.Monostable.phase7.getBoolValue() or !FWC.Monostable.phase7Output.getBoolValue())) { + if (!gnd and FWC.Timer.gnd2SecHalf.getValue() != 1 and (!FWC.Monostable.phase5Temp or !FWC.Monostable.phase5OutputTemp) and (!FWC.Monostable.phase7Temp or !FWC.Monostable.phase7OutputTemp)) { setPhase(6); } - if ((FWC.Monostable.phase7.getBoolValue() and FWC.Monostable.phase7Output.getBoolValue()) and myPhase != 8) { + if ((FWC.Monostable.phase7Temp and FWC.Monostable.phase7OutputTemp) and currentPhase != 8) { setPhase(7); } - if (!FWC.toPower.getBoolValue() and FWC.speed80.getBoolValue() and (gnd or FWC.Timer.gnd2Sec.getValue == 1)) { + if (!FWC.toPowerTemp and FWC.speed80Temp and (gnd or FWC.Timer.gnd2Sec.getValue() == 1)) { setPhase(8); } - if (FWC.Flipflop.phase2Output.getBoolValue() and (gnd and !FWC.toPower.getBoolValue() and !FWC.speed80.getBoolValue()) and FWC.Timer.eng1or2.getBoolValue()) { + if (FWC.Flipflop.phase2OutputTemp and (gnd and !FWC.toPowerTemp and !FWC.speed80Temp) and FWC.Timer.eng1or2.getBoolValue()) { setPhase(9); } - if ((gnd and FWC.Timer.eng1and2Off.getValue() and myPhase == 9) and FWC.Monostable.phase1Output.getBoolValue()) { + if ((gnd and FWC.Timer.eng1and2OffTemp and currentPhase == 9) and FWC.Monostable.phase1OutputTemp) { setPhase(10); } # FWC Inhibiting - myPhase = pts.ECAM.fwcWarningPhase.getValue(); - if (myPhase >= 3 and myPhase <= 5 and !FWC.Flipflop.recallOutput.getValue()) { + currentPhase = pts.ECAM.fwcWarningPhase.getValue(); + FWC.Flipflop.recallOutputTemp = FWC.Flipflop.recallOutput.getValue(); + if (currentPhase >= 3 and currentPhase <= 5 and !FWC.Flipflop.recallOutputTemp) { FWC.Timer.toInhibit.setValue(1); } else { FWC.Timer.toInhibit.setValue(0); } - if (myPhase == 7 or myPhase == 8 and !FWC.Flipflop.recallOutput.getValue()) { + if (currentPhase == 7 or currentPhase == 8 and !FWC.Flipflop.recallOutputTemp) { FWC.Timer.ldgInhibit.setValue(1); } else { FWC.Timer.ldgInhibit.setValue(0); diff --git a/Systems/a320-fwc-phases.xml b/Systems/a320-fwc-phases.xml index 0426d80a..5dbd7e02 100644 --- a/Systems/a320-fwc-phases.xml +++ b/Systems/a320-fwc-phases.xml @@ -19,10 +19,10 @@ 0.03333333333 - + /ECAM/phases/monostable/phase-1-300 - 0.00333333333 - 120 + 0.00333333333 + 120 @@ -95,8 +95,8 @@ - - /ECAM/phases/monostable/phase-1-300-output ne 1 + + /ECAM/phases/monostable/phase-1-300-timer ne 0 /ECAM/phases/monostable/phase-1-300 eq 1 @@ -229,6 +229,27 @@ + + + + + /ECAM/phases/phase-calculation/takeoff-power eq 1 + /ECAM/phases/phase-calculation/altitude-ge-1500 eq 0 + /ECAM/logic/ground-calc-immediate eq 0 + /ECAM/phases/monostable/gnd-output ne 1 + + + + + + + /ECAM/phases/phase-calculation/takeoff-power eq 0 + /ECAM/phases/phase-calculation/altitude-ge-1500 eq 0 + /ECAM/phases/phase-calculation/altitude-ge-800 eq 0 + /ECAM/logic/ground-calc-immediate eq 0 + /ECAM/phases/monostable/gnd-output ne 1 + + @@ -237,6 +258,60 @@ + + + + /ECAM/warning-phase eq 9 + + + + + + + /ECAM/warning-phase eq 9 + + + + + + + /ECAM/timer/ground-calc eq 1 + /controls/engines/engine[0]/fire-btn eq 1 + + + + + + + /ECAM/phases/phase-calculation/engines-1-2-not-running eq 1 + /ECAM/logic/ground-calc-immediate eq 1 + /ECAM/warning-phase eq 9 + /ECAM/phases/flipflop/phase-10-output eq 1 + + + + + + + /ECAM/warning-phase eq 3 + /ECAM/warning-phase eq 8 + + + + + + + /ECAM/phases/monostable-80kt eq 0 + /ECAM/warning-phase ne 9 + /ECAM/timer/ground-calc eq 1 + + /ECAM/phases/monostable/phase-9-output eq 0 + /ECAM/phases/monostable/to-power-set-output eq 0 + + + + + From 8002a2335c665ef0d8afd01bc289a0536b378a40 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Tue, 22 Jun 2021 15:33:17 +0100 Subject: [PATCH 63/96] Remove un-needed variables and unused code --- Nasal/ECAM/ECAM-phases.nas | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Nasal/ECAM/ECAM-phases.nas b/Nasal/ECAM/ECAM-phases.nas index 3dea0097..510a2503 100644 --- a/Nasal/ECAM/ECAM-phases.nas +++ b/Nasal/ECAM/ECAM-phases.nas @@ -3,14 +3,6 @@ # Copyright (c) 2019 Jonathan Redpath (legoboyvdlp) var currentPhase = nil; -var eng = nil; -var eng1epr = nil; -var eng2epr = nil; -var eng1n1 = nil; -var eng2n1 = nil; -var master1 = nil; -var master2 = nil; -var gear_agl_cur = nil; var FWC = { Btn: { @@ -98,7 +90,6 @@ var phaseLoop = func() { FWC.Flipflop.recallReset.setValue(0); } - gear_agl_cur = pts.Position.gearAglFt.getValue(); FWC.toPowerTemp = FWC.toPower.getBoolValue(); FWC.Timer.eng1and2OffTemp = FWC.Timer.eng1and2Off.getValue(); FWC.Timer.eng1or2OutputTemp = FWC.Timer.eng1or2Output.getBoolValue(); @@ -180,7 +171,3 @@ var setPhase = func(newPhase) { setlistener("/ECAM/buttons/recall-btn", func() { FWC.Flipflop.recallSet.setValue(FWC.Btn.recall.getBoolValue()); }, 0, 0); - -var clrBtn = func(btn) { - FWC.Btn.clr.setValue(btn); -} From 5bac220c4754026cf39b8422d380d1da5e6520ef Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Tue, 22 Jun 2021 15:39:48 +0100 Subject: [PATCH 64/96] Move nodes to a new file ECAM-nodes.nas --- A320-main.xml | 1 + Nasal/ECAM/ECAM-controller.nas | 141 +--------------------- Nasal/ECAM/ECAM-logic.nas | 3 +- Nasal/ECAM/ECAM-main.nas | 2 +- Nasal/ECAM/ECAM-messages.nas | 3 +- Nasal/ECAM/ECAM-nodes.nas | 212 +++++++++++++++++++++++++++++++++ Nasal/ECAM/ECAM-phases.nas | 74 +----------- Nasal/ECAM/SystemDisplay.nas | 3 + 8 files changed, 221 insertions(+), 218 deletions(-) create mode 100644 Nasal/ECAM/ECAM-nodes.nas diff --git a/A320-main.xml b/A320-main.xml index 79e43a8b..02cc8599 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -4657,6 +4657,7 @@ Aircraft/A320-family/Nasal/ECAM/SystemDisplay.nas + Aircraft/A320-family/Nasal/ECAM/ECAM-nodes.nas Aircraft/A320-family/Nasal/ECAM/ECAM-main.nas Aircraft/A320-family/Nasal/ECAM/ECAM-controller.nas Aircraft/A320-family/Nasal/ECAM/ECAM-logic.nas diff --git a/Nasal/ECAM/ECAM-controller.nas b/Nasal/ECAM/ECAM-controller.nas index b3628e89..8645f29c 100644 --- a/Nasal/ECAM/ECAM-controller.nas +++ b/Nasal/ECAM/ECAM-controller.nas @@ -1,5 +1,5 @@ # A3XX Electronic Centralised Aircraft Monitoring System -# Copyright (c) 2019 Jonathan Redpath (legoboyvdlp) +# Copyright (c) 2021 Jonathan Redpath (legoboyvdlp) var lines = [props.globals.getNode("ECAM/msg/line1", 1), props.globals.getNode("ECAM/msg/line2", 1), props.globals.getNode("ECAM/msg/line3", 1), props.globals.getNode("ECAM/msg/line4", 1), props.globals.getNode("ECAM/msg/line5", 1), props.globals.getNode("ECAM/msg/line6", 1), props.globals.getNode("ECAM/msg/line7", 1), props.globals.getNode("ECAM/msg/line8", 1)]; var linesCol = [props.globals.getNode("ECAM/msg/linec1", 1), props.globals.getNode("ECAM/msg/linec2", 1), props.globals.getNode("ECAM/msg/linec3", 1), props.globals.getNode("ECAM/msg/linec4", 1), props.globals.getNode("ECAM/msg/linec5", 1), props.globals.getNode("ECAM/msg/linec6", 1), props.globals.getNode("ECAM/msg/linec7", 1), props.globals.getNode("ECAM/msg/linec8", 1)]; @@ -29,145 +29,6 @@ var counterClear = 0; var noMainMsg = 0; var storeFirstWarning = nil; -var warningNodes = { - Logic: { - altitudeAlert: props.globals.initNode("/ECAM/warnings/altitude-alert/c-chord"), - altitudeAlertSteady: props.globals.initNode("/ECAM/warnings/altitude-alert/altitude-alert-steady"), - altitudeAlertFlash: props.globals.initNode("/ECAM/warnings/altitude-alert/altitude-alert-flash"), - crossbleedFault: props.globals.initNode("/ECAM/warnings/logic/crossbleed-fault"), - crossbleedWai: props.globals.initNode("/ECAM/warnings/logic/crossbleed-wai"), - bleed1LoTempUnsuc: props.globals.initNode("/ECAM/warnings/logic/bleed-1-lo-temp-unsucc"), - bleed1LoTempXbleed: props.globals.initNode("/ECAM/warnings/logic/bleed-1-lo-temp-xbleed"), - bleed1LoTempBleed: props.globals.initNode("/ECAM/warnings/logic/bleed-1-lo-temp-bleed"), - bleed1LoTempPack: props.globals.initNode("/ECAM/warnings/logic/bleed-1-lo-temp-pack"), - bleed1WaiAvail: props.globals.initNode("/ECAM/warnings/logic/bleed-1-wai-avail"), - bleed2LoTempUnsuc: props.globals.initNode("/ECAM/warnings/logic/bleed-2-lo-temp-unsucc"), - bleed2LoTempXbleed: props.globals.initNode("/ECAM/warnings/logic/bleed-2-lo-temp-xbleed"), - bleed2LoTempBleed: props.globals.initNode("/ECAM/warnings/logic/bleed-2-lo-temp-bleed"), - bleed2LoTempPack: props.globals.initNode("/ECAM/warnings/logic/bleed-2-lo-temp-pack"), - bleed2WaiAvail: props.globals.initNode("/ECAM/warnings/logic/bleed-2-wai-avail"), - waiSysfault: props.globals.initNode("/ECAM/warnings/logic/wing-anti-ice-sys-fault"), - waiLclosed: props.globals.initNode("/ECAM/warnings/flipflop/wing-anti-ice-left-closed"), - waiRclosed: props.globals.initNode("/ECAM/warnings/flipflop/wing-anti-ice-right-closed"), - procWaiShutdown: props.globals.initNode("/ECAM/warnings/logic/proc-wai-shutdown-output"), - waiGndFlight: props.globals.initNode("/ECAM/warnings/logic/wing-anti-ice-gnd-fault"), - pack12Fault: props.globals.initNode("/ECAM/warnings/logic/pack-1-2-fault"), - pack1ResetPb: props.globals.initNode("/ECAM/warnings/logic/reset-pack-1-switch-cmd"), - pack2ResetPb: props.globals.initNode("/ECAM/warnings/logic/reset-pack-2-switch-cmd"), - cabinFans: props.globals.initNode("/ECAM/warnings/logic/cabin-fans-fault"), - rtlu1Fault: props.globals.initNode("/ECAM/warnings/logic/rud-trav-lim-sys-1-fault"), - rtlu2Fault: props.globals.initNode("/ECAM/warnings/logic/rud-trav-lim-sys-2-fault"), - rtlu12Fault: props.globals.initNode("/ECAM/warnings/logic/rud-trav-lim-sys-fault"), - fac12Fault: props.globals.initNode("/ECAM/warnings/logic/fac-12-fault"), - fac1Fault: props.globals.initNode("/ECAM/warnings/logic/fac-1-fault"), - fac2Fault: props.globals.initNode("/ECAM/warnings/logic/fac-2-fault"), - stallWarn: props.globals.initNode("/ECAM/warnings/logic/stall/stall-warn-on"), - yawDamper12Fault: props.globals.initNode("/ECAM/warnings/logic/yaw-damper-12-fault"), - gearNotDown1: props.globals.initNode("/ECAM/warnings/fctl/gear-not-down-not-cancellable"), - gearNotDown2: props.globals.initNode("/ECAM/warnings/fctl/gear-not-down-cancellable"), - gearNotDownLocked: props.globals.initNode("/ECAM/warnings/fctl/gear-not-down-locked"), - gearNotDownLockedFlipflop: props.globals.initNode("/ECAM/warnings/fctl/gear-not-downlocked-output"), - blueGreen: props.globals.initNode("/ECAM/warnings/hyd/blue-green-failure"), - blueGreenFuel: props.globals.initNode("/ECAM/warnings/hyd/blue-green-fuel-consumpt"), - blueYellow: props.globals.initNode("/ECAM/warnings/hyd/blue-yellow-failure"), - blueYellowFuel: props.globals.initNode("/ECAM/warnings/hyd/blue-yellow-fuel-consumpt"), - greenYellow: props.globals.initNode("/ECAM/warnings/hyd/green-yellow-failure"), - greenYellowFuel: props.globals.initNode("/ECAM/warnings/hyd/green-yellow-fuel-consumpt"), - leftElevFail: props.globals.initNode("/ECAM/warnings/fctl/leftElevFault"), - rightElevFail: props.globals.initNode("/ECAM/warnings/fctl/rightElevFault"), - flapNotZero: props.globals.initNode("/ECAM/warnings/fctl/flaps-not-zero"), - slatsConfig: props.globals.initNode("/ECAM/warnings/fctl/slats-config-output"), - flapsConfig: props.globals.initNode("/ECAM/warnings/fctl/flaps-config-output"), - spdBrkConfig: props.globals.initNode("/ECAM/warnings/fctl/spd-brk-config-output"), - pitchTrimConfig: props.globals.initNode("/ECAM/warnings/fctl/pitch-trim-config-output"), - rudTrimConfig: props.globals.initNode("/ECAM/warnings/fctl/rudder-trim-config-output"), - parkBrkConfig: props.globals.initNode("/ECAM/warnings/fctl/park-brk-config-output"), - slatsConfig2: props.globals.initNode("/ECAM/warnings/fctl/slats-config-range"), - flapsConfig2: props.globals.initNode("/ECAM/warnings/fctl/flaps-config-range"), - spdBrkConfig2: props.globals.initNode("/ECAM/warnings/fctl/spd-brk-config-range"), - pitchTrimConfig2: props.globals.initNode("/ECAM/warnings/fctl/pitch-trim-config-range"), - rudTrimConfig2: props.globals.initNode("/ECAM/warnings/fctl/rudder-trim-config-range"), - dcEssFuelConsumptionIncreased: props.globals.initNode("/ECAM/warnings/logic/dc-ess-fuel-consumption-increased"), - dcEssFMSPredictions: props.globals.initNode("/ECAM/warnings/logic/dc-ess-fms-predictions-unreliable"), - dc2FuelConsumptionIncreased: props.globals.initNode("/ECAM/warnings/logic/dc-2-fuel-consumption-increased"), - dc2FMSPredictions: props.globals.initNode("/ECAM/warnings/logic/dc-2-fms-predictions-unreliable"), - thrLeversNotSet: props.globals.initNode("/ECAM/warnings/logic/eng/thr-lever-not-set"), - revSet: props.globals.initNode("/ECAM/warnings/logic/eng/reverse-set"), - eng1Fail: props.globals.initNode("/ECAM/warnings/logic/eng/eng-1-fail"), - eng2Fail: props.globals.initNode("/ECAM/warnings/logic/eng/eng-2-fail"), - phase5Trans: props.globals.initNode("/ECAM/warnings/logic/eng/phase-5-output"), - eng1Shutdown: props.globals.initNode("/ECAM/warnings/logic/eng/eng-1-shutdown"), - eng2Shutdown: props.globals.initNode("/ECAM/warnings/logic/eng/eng-2-shutdown"), - acEssBusAltn: props.globals.initNode("/ECAM/warnings/logic/ac-ess-bus-altn-feed"), - gen1Off: props.globals.initNode("/ECAM/warnings/logic/elec/gen-1-off"), - gen2Off: props.globals.initNode("/ECAM/warnings/logic/elec/gen-2-off"), - spdBrkOut: props.globals.initNode("/ECAM/warnings/fctl/spd-brk-still-out"), - }, - Timers: { - apuFaultOutput: props.globals.initNode("/ECAM/warnings/timer/apu-fault-output"), - bleed1Fault: props.globals.initNode("/ECAM/warnings/timer/bleed-1-fault"), - bleed1FaultOutput: props.globals.initNode("/ECAM/warnings/timer/bleed-1-fault-output"), - bleed2Fault: props.globals.initNode("/ECAM/warnings/timer/bleed-2-fault"), - bleed2FaultOutput: props.globals.initNode("/ECAM/warnings/timer/bleed-2-fault-output"), - bleed1NotShutOutput: props.globals.initNode("/ECAM/warnings/timer/prv-1-not-shut-output"), - bleed2NotShutOutput: props.globals.initNode("/ECAM/warnings/timer/prv-2-not-shut-output"), - bleed1And2LoTemp: props.globals.initNode("/ECAM/warnings/timer/bleed-1-and-2-low-temp"), - bleed1And2LoTempOutput: props.globals.initNode("/ECAM/warnings/timer/bleed-1-and-2-low-temp-output"), - bleed1Off60Output: props.globals.initNode("/ECAM/warnings/logic/bleed-1-off-60-output"), - bleed1Off5Output: props.globals.initNode("/ECAM/warnings/logic/bleed-1-off-5-output"), - bleed2Off60Output: props.globals.initNode("/ECAM/warnings/logic/bleed-2-off-60-output"), - bleed2Off5Output: props.globals.initNode("/ECAM/warnings/logic/bleed-2-off-5-output"), - eng1AiceNotClsd: props.globals.initNode("/ECAM/warnings/timer/eng-aice-1-open-output"), - eng2AiceNotClsd: props.globals.initNode("/ECAM/warnings/timer/eng-aice-2-open-output"), - eng1AiceNotOpen: props.globals.initNode("/ECAM/warnings/timer/eng-aice-1-closed-output"), - eng2AiceNotOpen: props.globals.initNode("/ECAM/warnings/timer/eng-aice-2-closed-output"), - LRElevFault: props.globals.initNode("/ECAM/warnings/fctl/lrElevFault-output"), - altnLaw: props.globals.initNode("/ECAM/warnings/fctl/altn-law-output"), - directLaw: props.globals.initNode("/ECAM/warnings/fctl/direct-law-output"), - waiLhiPr: props.globals.initNode("/ECAM/warnings/timer/wing-hi-pr-left"), - waiRhiPr: props.globals.initNode("/ECAM/warnings/timer/wing-hi-pr-right"), - pack1Fault: props.globals.initNode("/ECAM/warnings/timer/pack-1-fault-2"), - pack2Fault: props.globals.initNode("/ECAM/warnings/timer/pack-2-fault-2"), - pack1Off: props.globals.initNode("/ECAM/warnings/timer/pack-1-off"), - pack2Off: props.globals.initNode("/ECAM/warnings/timer/pack-2-off"), - trimAirFault: props.globals.initNode("/ECAM/warnings/timer/trim-air-fault"), - yawDamper1Fault: props.globals.initNode("/ECAM/warnings/timer/yaw-damper-1-fault"), - yawDamper2Fault: props.globals.initNode("/ECAM/warnings/timer/yaw-damper-2-fault"), - navTerrFault: props.globals.initNode("/ECAM/warnings/timer/nav-gpws-terr-fault"), - leftElevFail: props.globals.initNode("/ECAM/warnings/fctl/leftElevFault-output"), - rightElevFail: props.globals.initNode("/ECAM/warnings/fctl/rightElevFault-output"), - staticInverter: props.globals.initNode("/systems/electrical/some-electric-thingie/static-inverter-timer"), - dcEmerConfig: props.globals.initNode("/ECAM/warnings/logic/dc-emer-config-output"), - dc12Fault: props.globals.initNode("/ECAM/warnings/logic/dc-1-2-output"), - dcEssFault: props.globals.initNode("/ECAM/warnings/logic/dc-ess-output"), - dc1Fault: props.globals.initNode("/ECAM/warnings/logic/dc-1-output"), - dc2Fault: props.globals.initNode("/ECAM/warnings/logic/dc-2-output"), - dcBatFault: props.globals.initNode("/ECAM/warnings/logic/dc-bat-output"), - ac1Fault: props.globals.initNode("/ECAM/warnings/logic/ac-1-output"), - ac2Fault: props.globals.initNode("/ECAM/warnings/logic/ac-2-output"), - acEssFault: props.globals.initNode("/ECAM/warnings/logic/ac-ess-output"), - dcEssShed: props.globals.initNode("/ECAM/warnings/logic/dc-ess-shed-output"), - acEssShed: props.globals.initNode("/ECAM/warnings/logic/ac-ess-shed-output"), - centerPumpsOff: props.globals.initNode("/ECAM/warnings/fuel/center-pumps-off-output"), - lowLevelBoth: props.globals.initNode("/ECAM/warnings/fuel/lo-level-l-r-output"), - }, - Flipflops: { - apuGenFault: props.globals.initNode("/ECAM/warnings/flipflop/apu-gen-fault"), - apuGenFaultOnOff: props.globals.initNode("/ECAM/warnings/flipflop/apu-gen-fault-on-off"), - bleed1LowTemp: props.globals.initNode("/ECAM/warnings/logic/bleed-1-low-temp-flipflop-output"), - bleed2LowTemp: props.globals.initNode("/ECAM/warnings/logic/bleed-2-low-temp-flipflop-output"), - gen1Fault: props.globals.initNode("/ECAM/warnings/flipflop/gen-1-fault"), - gen2Fault: props.globals.initNode("/ECAM/warnings/flipflop/gen-2-fault"), - gen1FaultOnOff: props.globals.initNode("/ECAM/warnings/flipflop/gen-1-fault-on-off"), - gen2FaultOnOff: props.globals.initNode("/ECAM/warnings/flipflop/gen-2-fault-on-off"), - pack1Ovht: props.globals.initNode("/ECAM/warnings/flipflop/pack-1-ovht"), - pack2Ovht: props.globals.initNode("/ECAM/warnings/flipflop/pack-2-ovht"), - parkBrk: props.globals.initNode("/ECAM/warnings/config/park-brk/park-brk-output"), - eng1ThrLvrAbvIdle: props.globals.initNode("/ECAM/warnings/logic/eng/eng-1-thr-lvr-abv-idle"), - eng2ThrLvrAbvIdle: props.globals.initNode("/ECAM/warnings/logic/eng/eng-2-thr-lvr-abv-idle"), - }, -}; - var warning = { new: func(msg,colour = "g",aural = 9,light = 9,isMainMsg = 0,lastSubmsg = 0, sdPage = "nil", isMemo = 0) { var t = {parents:[warning]}; diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index 90aa0205..e5976e0c 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -1,6 +1,5 @@ # A3XX Electronic Centralised Aircraft Monitoring System - -# Copyright (c) 2019 Jonathan Redpath (legoboyvdlp) +# Copyright (c) 2021 Jonathan Redpath (legoboyvdlp) # props.nas: diff --git a/Nasal/ECAM/ECAM-main.nas b/Nasal/ECAM/ECAM-main.nas index 4c814e53..b1b619fe 100644 --- a/Nasal/ECAM/ECAM-main.nas +++ b/Nasal/ECAM/ECAM-main.nas @@ -1,7 +1,7 @@ # A3XX ECAM # Joshua Davidson (Octal450) and Jonathan Redpath (legoboyvdlp) -# Copyright (c) 2020 Josh Davidson (Octal450) and Jonathan Redpath (legoboyvdlp) +# Copyright (c) 2021 Josh Davidson (Octal450) and Jonathan Redpath (legoboyvdlp) var ap_active = 0; var athr_active = 0; diff --git a/Nasal/ECAM/ECAM-messages.nas b/Nasal/ECAM/ECAM-messages.nas index 5560b411..e36d11bb 100644 --- a/Nasal/ECAM/ECAM-messages.nas +++ b/Nasal/ECAM/ECAM-messages.nas @@ -1,6 +1,5 @@ # A3XX Electronic Centralised Aircraft Monitoring System - -# Copyright (c) 2019 Jonathan Redpath (legoboyvdlp) +# Copyright (c) 2021 Jonathan Redpath (legoboyvdlp) # messages stored in vectors diff --git a/Nasal/ECAM/ECAM-nodes.nas b/Nasal/ECAM/ECAM-nodes.nas new file mode 100644 index 00000000..21b38d32 --- /dev/null +++ b/Nasal/ECAM/ECAM-nodes.nas @@ -0,0 +1,212 @@ +# A3XX Electronic Centralised Aircraft Monitoring System +# Copyright (c) 2021 Jonathan Redpath (legoboyvdlp) + +var FWC = { + Btn: { + clr: props.globals.initNode("/ECAM/buttons/clear-btn", 0, "BOOL"), + recall: props.globals.initNode("/ECAM/buttons/recall-btn", 0, "BOOL"), + recallStsNormal: props.globals.initNode("/ECAM/buttons/recall-status-normal", 0, "BOOL"), + recallStsNormalOutput: props.globals.initNode("/ECAM/buttons/recall-status-normal-output", 0, "BOOL"), + }, + Monostable: { + phase1: props.globals.initNode("/ECAM/phases/monostable/phase-1-300", 0, "BOOL"), + phase5: props.globals.initNode("/ECAM/phases/monostable/phase-5", 0, "BOOL"), + phase5Temp: 0, + phase7: props.globals.initNode("/ECAM/phases/monostable/phase-7", 0, "BOOL"), + phase7Temp: 0, + phase9: props.globals.initNode("/ECAM/phases/monostable/phase-9", 0, "BOOL"), + phase1Output: props.globals.initNode("/ECAM/phases/monostable/phase-1-300-output"), + phase1OutputTemp: 0, + phase5Output: props.globals.initNode("/ECAM/phases/monostable/phase-5-output"), + phase5OutputTemp: 0, + phase7Output: props.globals.initNode("/ECAM/phases/monostable/phase-7-output"), + phase7OutputTemp: 0, + phase9Output: props.globals.initNode("/ECAM/phases/monostable/phase-9-output"), + toPowerOutput: props.globals.getNode("/ECAM/phases/monostable/to-power-set-output"), + m80kt: props.globals.getNode("/ECAM/phases/monostable-80kt"), + altAlert1: props.globals.initNode("/ECAM/altitude-alert-monostable-set", 0, "BOOL"), + altAlert1Output: props.globals.initNode("/ECAM/altitude-alert-monostable-output"), + altAlert2: props.globals.initNode("/ECAM/flipflop/altitude-alert-rs-set", 0, "BOOL"), + }, + Flipflop: { + phase2Set: props.globals.initNode("/ECAM/phases/flipflop/phase-2-set", 0, "BOOL"), + phase2Reset: props.globals.initNode("/ECAM/phases/flipflop/phase-2-reset", 0, "BOOL"), + phase2Output: props.globals.initNode("/ECAM/phases/flipflop/phase-2-output", 0, "BOOL"), + phase2OutputTemp: 0, + phase10Set: props.globals.initNode("/ECAM/phases/flipflop/phase-10-set", 0, "BOOL"), + phase10Reset: props.globals.initNode("/ECAM/phases/flipflop/phase-10-reset", 0, "BOOL"), + phase10Output: props.globals.initNode("/ECAM/phases/flipflop/phase-10-output", 0, "BOOL"), + recallSet: props.globals.initNode("/ECAM/flipflop/recall-set", 0, "BOOL"), + recallReset: props.globals.initNode("/ECAM/flipflop/recall-reset", 0, "BOOL"), + recallOutput: props.globals.initNode("/ECAM/flipflop/recall-output", 0, "BOOL"), + recallOutputTemp: 0, + }, + Logic: { + gnd: props.globals.getNode("/ECAM/logic/ground-calc-immediate"), + IRSinAlign: props.globals.initNode("/ECAM/irs-in-align", 0, "BOOL"), + feet1500: props.globals.getNode("/ECAM/phases/phase-calculation/altitude-ge-1500"), + feet800: props.globals.getNode("/ECAM/phases/phase-calculation/altitude-ge-800"), + }, + Timer: { + eng1idle: props.globals.getNode("/ECAM/phases/timer/eng1idle"), + eng2idle: props.globals.getNode("/ECAM/phases/timer/eng2idle"), + eng1or2: props.globals.getNode("/ECAM/phases/phase-calculation/one-engine-running"), + toInhibit: props.globals.initNode("/ECAM/phases/timer/to-inhibit", 0, "INT"), + ldgInhibit: props.globals.initNode("/ECAM/phases/timer/ldg-inhibit", 0, "INT"), + eng1idleOutput: props.globals.getNode("/ECAM/phases/timer/eng1idle-output"), + eng2idleOutput: props.globals.getNode("/ECAM/phases/timer/eng2idle-output"), + eng1and2Off: props.globals.getNode("/ECAM/phases/phase-calculation/engines-1-2-not-running"), + eng1and2OffTemp: 0, + eng1or2Output: props.globals.getNode("/ECAM/phases/phase-calculation/engine-1-or-2-running"), + eng1or2OutputTemp: 0, + toInhibitOutput: props.globals.getNode("/ECAM/phases/timer/to-inhibit-output"), + ldgInhibitOutput: props.globals.getNode("/ECAM/phases/timer/ldg-inhibit-output"), + gnd: props.globals.getNode("/ECAM/timer/ground-calc"), # ZGND + gnd2Sec: props.globals.getNode("/ECAM/phases/monostable/gnd-output"), + gnd2SecHalf: props.globals.getNode("/ECAM/phases/monostable/gnd-output-2"), # hack to prevent getting confused between phase 5 / 6 + }, + speed80: props.globals.initNode("/ECAM/phases/speed-gt-80", 0, "BOOL"), + speed80Temp: 0, + toPower: props.globals.getNode("/ECAM/phases/phase-calculation/takeoff-power"), + toPowerTemp: 0, + altChg: props.globals.getNode("/it-autoflight/input/alt-is-changing", 1), +}; + +var warningNodes = { + Logic: { + altitudeAlert: props.globals.initNode("/ECAM/warnings/altitude-alert/c-chord"), + altitudeAlertSteady: props.globals.initNode("/ECAM/warnings/altitude-alert/altitude-alert-steady"), + altitudeAlertFlash: props.globals.initNode("/ECAM/warnings/altitude-alert/altitude-alert-flash"), + crossbleedFault: props.globals.initNode("/ECAM/warnings/logic/crossbleed-fault"), + crossbleedWai: props.globals.initNode("/ECAM/warnings/logic/crossbleed-wai"), + bleed1LoTempUnsuc: props.globals.initNode("/ECAM/warnings/logic/bleed-1-lo-temp-unsucc"), + bleed1LoTempXbleed: props.globals.initNode("/ECAM/warnings/logic/bleed-1-lo-temp-xbleed"), + bleed1LoTempBleed: props.globals.initNode("/ECAM/warnings/logic/bleed-1-lo-temp-bleed"), + bleed1LoTempPack: props.globals.initNode("/ECAM/warnings/logic/bleed-1-lo-temp-pack"), + bleed1WaiAvail: props.globals.initNode("/ECAM/warnings/logic/bleed-1-wai-avail"), + bleed2LoTempUnsuc: props.globals.initNode("/ECAM/warnings/logic/bleed-2-lo-temp-unsucc"), + bleed2LoTempXbleed: props.globals.initNode("/ECAM/warnings/logic/bleed-2-lo-temp-xbleed"), + bleed2LoTempBleed: props.globals.initNode("/ECAM/warnings/logic/bleed-2-lo-temp-bleed"), + bleed2LoTempPack: props.globals.initNode("/ECAM/warnings/logic/bleed-2-lo-temp-pack"), + bleed2WaiAvail: props.globals.initNode("/ECAM/warnings/logic/bleed-2-wai-avail"), + waiSysfault: props.globals.initNode("/ECAM/warnings/logic/wing-anti-ice-sys-fault"), + waiLclosed: props.globals.initNode("/ECAM/warnings/flipflop/wing-anti-ice-left-closed"), + waiRclosed: props.globals.initNode("/ECAM/warnings/flipflop/wing-anti-ice-right-closed"), + procWaiShutdown: props.globals.initNode("/ECAM/warnings/logic/proc-wai-shutdown-output"), + waiGndFlight: props.globals.initNode("/ECAM/warnings/logic/wing-anti-ice-gnd-fault"), + pack12Fault: props.globals.initNode("/ECAM/warnings/logic/pack-1-2-fault"), + pack1ResetPb: props.globals.initNode("/ECAM/warnings/logic/reset-pack-1-switch-cmd"), + pack2ResetPb: props.globals.initNode("/ECAM/warnings/logic/reset-pack-2-switch-cmd"), + cabinFans: props.globals.initNode("/ECAM/warnings/logic/cabin-fans-fault"), + rtlu1Fault: props.globals.initNode("/ECAM/warnings/logic/rud-trav-lim-sys-1-fault"), + rtlu2Fault: props.globals.initNode("/ECAM/warnings/logic/rud-trav-lim-sys-2-fault"), + rtlu12Fault: props.globals.initNode("/ECAM/warnings/logic/rud-trav-lim-sys-fault"), + fac12Fault: props.globals.initNode("/ECAM/warnings/logic/fac-12-fault"), + fac1Fault: props.globals.initNode("/ECAM/warnings/logic/fac-1-fault"), + fac2Fault: props.globals.initNode("/ECAM/warnings/logic/fac-2-fault"), + stallWarn: props.globals.initNode("/ECAM/warnings/logic/stall/stall-warn-on"), + yawDamper12Fault: props.globals.initNode("/ECAM/warnings/logic/yaw-damper-12-fault"), + gearNotDown1: props.globals.initNode("/ECAM/warnings/fctl/gear-not-down-not-cancellable"), + gearNotDown2: props.globals.initNode("/ECAM/warnings/fctl/gear-not-down-cancellable"), + gearNotDownLocked: props.globals.initNode("/ECAM/warnings/fctl/gear-not-down-locked"), + gearNotDownLockedFlipflop: props.globals.initNode("/ECAM/warnings/fctl/gear-not-downlocked-output"), + blueGreen: props.globals.initNode("/ECAM/warnings/hyd/blue-green-failure"), + blueGreenFuel: props.globals.initNode("/ECAM/warnings/hyd/blue-green-fuel-consumpt"), + blueYellow: props.globals.initNode("/ECAM/warnings/hyd/blue-yellow-failure"), + blueYellowFuel: props.globals.initNode("/ECAM/warnings/hyd/blue-yellow-fuel-consumpt"), + greenYellow: props.globals.initNode("/ECAM/warnings/hyd/green-yellow-failure"), + greenYellowFuel: props.globals.initNode("/ECAM/warnings/hyd/green-yellow-fuel-consumpt"), + leftElevFail: props.globals.initNode("/ECAM/warnings/fctl/leftElevFault"), + rightElevFail: props.globals.initNode("/ECAM/warnings/fctl/rightElevFault"), + flapNotZero: props.globals.initNode("/ECAM/warnings/fctl/flaps-not-zero"), + slatsConfig: props.globals.initNode("/ECAM/warnings/fctl/slats-config-output"), + flapsConfig: props.globals.initNode("/ECAM/warnings/fctl/flaps-config-output"), + spdBrkConfig: props.globals.initNode("/ECAM/warnings/fctl/spd-brk-config-output"), + pitchTrimConfig: props.globals.initNode("/ECAM/warnings/fctl/pitch-trim-config-output"), + rudTrimConfig: props.globals.initNode("/ECAM/warnings/fctl/rudder-trim-config-output"), + parkBrkConfig: props.globals.initNode("/ECAM/warnings/fctl/park-brk-config-output"), + slatsConfig2: props.globals.initNode("/ECAM/warnings/fctl/slats-config-range"), + flapsConfig2: props.globals.initNode("/ECAM/warnings/fctl/flaps-config-range"), + spdBrkConfig2: props.globals.initNode("/ECAM/warnings/fctl/spd-brk-config-range"), + pitchTrimConfig2: props.globals.initNode("/ECAM/warnings/fctl/pitch-trim-config-range"), + rudTrimConfig2: props.globals.initNode("/ECAM/warnings/fctl/rudder-trim-config-range"), + dcEssFuelConsumptionIncreased: props.globals.initNode("/ECAM/warnings/logic/dc-ess-fuel-consumption-increased"), + dcEssFMSPredictions: props.globals.initNode("/ECAM/warnings/logic/dc-ess-fms-predictions-unreliable"), + dc2FuelConsumptionIncreased: props.globals.initNode("/ECAM/warnings/logic/dc-2-fuel-consumption-increased"), + dc2FMSPredictions: props.globals.initNode("/ECAM/warnings/logic/dc-2-fms-predictions-unreliable"), + thrLeversNotSet: props.globals.initNode("/ECAM/warnings/logic/eng/thr-lever-not-set"), + revSet: props.globals.initNode("/ECAM/warnings/logic/eng/reverse-set"), + eng1Fail: props.globals.initNode("/ECAM/warnings/logic/eng/eng-1-fail"), + eng2Fail: props.globals.initNode("/ECAM/warnings/logic/eng/eng-2-fail"), + phase5Trans: props.globals.initNode("/ECAM/warnings/logic/eng/phase-5-output"), + eng1Shutdown: props.globals.initNode("/ECAM/warnings/logic/eng/eng-1-shutdown"), + eng2Shutdown: props.globals.initNode("/ECAM/warnings/logic/eng/eng-2-shutdown"), + acEssBusAltn: props.globals.initNode("/ECAM/warnings/logic/ac-ess-bus-altn-feed"), + gen1Off: props.globals.initNode("/ECAM/warnings/logic/elec/gen-1-off"), + gen2Off: props.globals.initNode("/ECAM/warnings/logic/elec/gen-2-off"), + spdBrkOut: props.globals.initNode("/ECAM/warnings/fctl/spd-brk-still-out"), + }, + Timers: { + apuFaultOutput: props.globals.initNode("/ECAM/warnings/timer/apu-fault-output"), + bleed1Fault: props.globals.initNode("/ECAM/warnings/timer/bleed-1-fault"), + bleed1FaultOutput: props.globals.initNode("/ECAM/warnings/timer/bleed-1-fault-output"), + bleed2Fault: props.globals.initNode("/ECAM/warnings/timer/bleed-2-fault"), + bleed2FaultOutput: props.globals.initNode("/ECAM/warnings/timer/bleed-2-fault-output"), + bleed1NotShutOutput: props.globals.initNode("/ECAM/warnings/timer/prv-1-not-shut-output"), + bleed2NotShutOutput: props.globals.initNode("/ECAM/warnings/timer/prv-2-not-shut-output"), + bleed1And2LoTemp: props.globals.initNode("/ECAM/warnings/timer/bleed-1-and-2-low-temp"), + bleed1And2LoTempOutput: props.globals.initNode("/ECAM/warnings/timer/bleed-1-and-2-low-temp-output"), + bleed1Off60Output: props.globals.initNode("/ECAM/warnings/logic/bleed-1-off-60-output"), + bleed1Off5Output: props.globals.initNode("/ECAM/warnings/logic/bleed-1-off-5-output"), + bleed2Off60Output: props.globals.initNode("/ECAM/warnings/logic/bleed-2-off-60-output"), + bleed2Off5Output: props.globals.initNode("/ECAM/warnings/logic/bleed-2-off-5-output"), + eng1AiceNotClsd: props.globals.initNode("/ECAM/warnings/timer/eng-aice-1-open-output"), + eng2AiceNotClsd: props.globals.initNode("/ECAM/warnings/timer/eng-aice-2-open-output"), + eng1AiceNotOpen: props.globals.initNode("/ECAM/warnings/timer/eng-aice-1-closed-output"), + eng2AiceNotOpen: props.globals.initNode("/ECAM/warnings/timer/eng-aice-2-closed-output"), + LRElevFault: props.globals.initNode("/ECAM/warnings/fctl/lrElevFault-output"), + altnLaw: props.globals.initNode("/ECAM/warnings/fctl/altn-law-output"), + directLaw: props.globals.initNode("/ECAM/warnings/fctl/direct-law-output"), + waiLhiPr: props.globals.initNode("/ECAM/warnings/timer/wing-hi-pr-left"), + waiRhiPr: props.globals.initNode("/ECAM/warnings/timer/wing-hi-pr-right"), + pack1Fault: props.globals.initNode("/ECAM/warnings/timer/pack-1-fault-2"), + pack2Fault: props.globals.initNode("/ECAM/warnings/timer/pack-2-fault-2"), + pack1Off: props.globals.initNode("/ECAM/warnings/timer/pack-1-off"), + pack2Off: props.globals.initNode("/ECAM/warnings/timer/pack-2-off"), + trimAirFault: props.globals.initNode("/ECAM/warnings/timer/trim-air-fault"), + yawDamper1Fault: props.globals.initNode("/ECAM/warnings/timer/yaw-damper-1-fault"), + yawDamper2Fault: props.globals.initNode("/ECAM/warnings/timer/yaw-damper-2-fault"), + navTerrFault: props.globals.initNode("/ECAM/warnings/timer/nav-gpws-terr-fault"), + leftElevFail: props.globals.initNode("/ECAM/warnings/fctl/leftElevFault-output"), + rightElevFail: props.globals.initNode("/ECAM/warnings/fctl/rightElevFault-output"), + staticInverter: props.globals.initNode("/systems/electrical/some-electric-thingie/static-inverter-timer"), + dcEmerConfig: props.globals.initNode("/ECAM/warnings/logic/dc-emer-config-output"), + dc12Fault: props.globals.initNode("/ECAM/warnings/logic/dc-1-2-output"), + dcEssFault: props.globals.initNode("/ECAM/warnings/logic/dc-ess-output"), + dc1Fault: props.globals.initNode("/ECAM/warnings/logic/dc-1-output"), + dc2Fault: props.globals.initNode("/ECAM/warnings/logic/dc-2-output"), + dcBatFault: props.globals.initNode("/ECAM/warnings/logic/dc-bat-output"), + ac1Fault: props.globals.initNode("/ECAM/warnings/logic/ac-1-output"), + ac2Fault: props.globals.initNode("/ECAM/warnings/logic/ac-2-output"), + acEssFault: props.globals.initNode("/ECAM/warnings/logic/ac-ess-output"), + dcEssShed: props.globals.initNode("/ECAM/warnings/logic/dc-ess-shed-output"), + acEssShed: props.globals.initNode("/ECAM/warnings/logic/ac-ess-shed-output"), + centerPumpsOff: props.globals.initNode("/ECAM/warnings/fuel/center-pumps-off-output"), + lowLevelBoth: props.globals.initNode("/ECAM/warnings/fuel/lo-level-l-r-output"), + }, + Flipflops: { + apuGenFault: props.globals.initNode("/ECAM/warnings/flipflop/apu-gen-fault"), + apuGenFaultOnOff: props.globals.initNode("/ECAM/warnings/flipflop/apu-gen-fault-on-off"), + bleed1LowTemp: props.globals.initNode("/ECAM/warnings/logic/bleed-1-low-temp-flipflop-output"), + bleed2LowTemp: props.globals.initNode("/ECAM/warnings/logic/bleed-2-low-temp-flipflop-output"), + gen1Fault: props.globals.initNode("/ECAM/warnings/flipflop/gen-1-fault"), + gen2Fault: props.globals.initNode("/ECAM/warnings/flipflop/gen-2-fault"), + gen1FaultOnOff: props.globals.initNode("/ECAM/warnings/flipflop/gen-1-fault-on-off"), + gen2FaultOnOff: props.globals.initNode("/ECAM/warnings/flipflop/gen-2-fault-on-off"), + pack1Ovht: props.globals.initNode("/ECAM/warnings/flipflop/pack-1-ovht"), + pack2Ovht: props.globals.initNode("/ECAM/warnings/flipflop/pack-2-ovht"), + parkBrk: props.globals.initNode("/ECAM/warnings/config/park-brk/park-brk-output"), + eng1ThrLvrAbvIdle: props.globals.initNode("/ECAM/warnings/logic/eng/eng-1-thr-lvr-abv-idle"), + eng2ThrLvrAbvIdle: props.globals.initNode("/ECAM/warnings/logic/eng/eng-2-thr-lvr-abv-idle"), + }, +}; \ No newline at end of file diff --git a/Nasal/ECAM/ECAM-phases.nas b/Nasal/ECAM/ECAM-phases.nas index 510a2503..6b959355 100644 --- a/Nasal/ECAM/ECAM-phases.nas +++ b/Nasal/ECAM/ECAM-phases.nas @@ -1,80 +1,8 @@ # A3XX FWC Phases - -# Copyright (c) 2019 Jonathan Redpath (legoboyvdlp) +# Copyright (c) 2021 Jonathan Redpath (legoboyvdlp) var currentPhase = nil; -var FWC = { - Btn: { - clr: props.globals.initNode("/ECAM/buttons/clear-btn", 0, "BOOL"), - recall: props.globals.initNode("/ECAM/buttons/recall-btn", 0, "BOOL"), - recallStsNormal: props.globals.initNode("/ECAM/buttons/recall-status-normal", 0, "BOOL"), - recallStsNormalOutput: props.globals.initNode("/ECAM/buttons/recall-status-normal-output", 0, "BOOL"), - }, - Monostable: { - phase1: props.globals.initNode("/ECAM/phases/monostable/phase-1-300", 0, "BOOL"), - phase5: props.globals.initNode("/ECAM/phases/monostable/phase-5", 0, "BOOL"), - phase5Temp: 0, - phase7: props.globals.initNode("/ECAM/phases/monostable/phase-7", 0, "BOOL"), - phase7Temp: 0, - phase9: props.globals.initNode("/ECAM/phases/monostable/phase-9", 0, "BOOL"), - phase1Output: props.globals.initNode("/ECAM/phases/monostable/phase-1-300-output"), - phase1OutputTemp: 0, - phase5Output: props.globals.initNode("/ECAM/phases/monostable/phase-5-output"), - phase5OutputTemp: 0, - phase7Output: props.globals.initNode("/ECAM/phases/monostable/phase-7-output"), - phase7OutputTemp: 0, - phase9Output: props.globals.initNode("/ECAM/phases/monostable/phase-9-output"), - toPowerOutput: props.globals.getNode("/ECAM/phases/monostable/to-power-set-output"), - m80kt: props.globals.getNode("/ECAM/phases/monostable-80kt"), - altAlert1: props.globals.initNode("/ECAM/altitude-alert-monostable-set", 0, "BOOL"), - altAlert1Output: props.globals.initNode("/ECAM/altitude-alert-monostable-output"), - altAlert2: props.globals.initNode("/ECAM/flipflop/altitude-alert-rs-set", 0, "BOOL"), - }, - Flipflop: { - phase2Set: props.globals.initNode("/ECAM/phases/flipflop/phase-2-set", 0, "BOOL"), - phase2Reset: props.globals.initNode("/ECAM/phases/flipflop/phase-2-reset", 0, "BOOL"), - phase2Output: props.globals.initNode("/ECAM/phases/flipflop/phase-2-output", 0, "BOOL"), - phase2OutputTemp: 0, - phase10Set: props.globals.initNode("/ECAM/phases/flipflop/phase-10-set", 0, "BOOL"), - phase10Reset: props.globals.initNode("/ECAM/phases/flipflop/phase-10-reset", 0, "BOOL"), - phase10Output: props.globals.initNode("/ECAM/phases/flipflop/phase-10-output", 0, "BOOL"), - recallSet: props.globals.initNode("/ECAM/flipflop/recall-set", 0, "BOOL"), - recallReset: props.globals.initNode("/ECAM/flipflop/recall-reset", 0, "BOOL"), - recallOutput: props.globals.initNode("/ECAM/flipflop/recall-output", 0, "BOOL"), - recallOutputTemp: 0, - }, - Logic: { - gnd: props.globals.getNode("/ECAM/logic/ground-calc-immediate"), - IRSinAlign: props.globals.initNode("/ECAM/irs-in-align", 0, "BOOL"), - feet1500: props.globals.getNode("/ECAM/phases/phase-calculation/altitude-ge-1500"), - feet800: props.globals.getNode("/ECAM/phases/phase-calculation/altitude-ge-800"), - }, - Timer: { - eng1idle: props.globals.getNode("/ECAM/phases/timer/eng1idle"), - eng2idle: props.globals.getNode("/ECAM/phases/timer/eng2idle"), - eng1or2: props.globals.getNode("/ECAM/phases/phase-calculation/one-engine-running"), - toInhibit: props.globals.initNode("/ECAM/phases/timer/to-inhibit", 0, "INT"), - ldgInhibit: props.globals.initNode("/ECAM/phases/timer/ldg-inhibit", 0, "INT"), - eng1idleOutput: props.globals.getNode("/ECAM/phases/timer/eng1idle-output"), - eng2idleOutput: props.globals.getNode("/ECAM/phases/timer/eng2idle-output"), - eng1and2Off: props.globals.getNode("/ECAM/phases/phase-calculation/engines-1-2-not-running"), - eng1and2OffTemp: 0, - eng1or2Output: props.globals.getNode("/ECAM/phases/phase-calculation/engine-1-or-2-running"), - eng1or2OutputTemp: 0, - toInhibitOutput: props.globals.getNode("/ECAM/phases/timer/to-inhibit-output"), - ldgInhibitOutput: props.globals.getNode("/ECAM/phases/timer/ldg-inhibit-output"), - gnd: props.globals.getNode("/ECAM/timer/ground-calc"), # ZGND - gnd2Sec: props.globals.getNode("/ECAM/phases/monostable/gnd-output"), - gnd2SecHalf: props.globals.getNode("/ECAM/phases/monostable/gnd-output-2"), # hack to prevent getting confused between phase 5 / 6 - }, - speed80: props.globals.initNode("/ECAM/phases/speed-gt-80", 0, "BOOL"), - speed80Temp: 0, - toPower: props.globals.getNode("/ECAM/phases/phase-calculation/takeoff-power"), - toPowerTemp: 0, - altChg: props.globals.getNode("/it-autoflight/input/alt-is-changing", 1), -}; - var gnd = nil; var gndTimer = nil; diff --git a/Nasal/ECAM/SystemDisplay.nas b/Nasal/ECAM/SystemDisplay.nas index e3f0f75e..7fa71d20 100644 --- a/Nasal/ECAM/SystemDisplay.nas +++ b/Nasal/ECAM/SystemDisplay.nas @@ -1,3 +1,6 @@ +# A3XX System Display Controller +# Copyright (c) 2021 Jonathan Redpath (legoboyvdlp) + var Page = { new: func(name) { var page = {parents:[Page]}; From 9b4a4de1b969547d96542fe7cc9f3973352f7a58 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Tue, 22 Jun 2021 17:52:24 +0100 Subject: [PATCH 65/96] Light Manager: rewrite to use more efficient and faster code --- Nasal/Effects/light-manager.nas | 614 +++++++++--------------- Nasal/Libraries/libraries.nas | 2 +- Nasal/Libraries/property-tree-setup.nas | 13 + 3 files changed, 244 insertions(+), 385 deletions(-) diff --git a/Nasal/Effects/light-manager.nas b/Nasal/Effects/light-manager.nas index 3e59a4ed..811dc02b 100644 --- a/Nasal/Effects/light-manager.nas +++ b/Nasal/Effects/light-manager.nas @@ -2,407 +2,253 @@ # in east/north/up coordinates the renderer uses # Thanks to BAWV12 / Thorsten - -var als_on = props.globals.getNode("/sim/rendering/shaders/skydome"); +var als_on = props.globals.getNode(""); var alt_agl = props.globals.getNode("position/gear-agl-ft"); var cur_alt = 0; -var light_manager = { +var Light = { + new: func(n) { + var light = {parents: [Light]}; + light.isOn = 0; + + light.Pos = { + x: 0, + y: 0, + z: 0, + }; + + light.Color = { + r: 0, + g: 0, + b: 0, + }; + + light.colorr = props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[" ~ n ~ "]", 1); + light.colorg = props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[" ~ n ~ "]", 1); + light.colorb = props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[" ~ n ~ "]", 1); + light.dir = props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/dir[" ~ n ~ "]", 1); + light.size = props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/size[" ~ n ~ "]", 1); + light.posx = props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[" ~ n ~ "]", 1); + light.posy = props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[" ~ n ~ "]", 1); + light.posz = props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[" ~ n ~ "]", 1); + + if (n <= 1) { + light.stretch = props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/stretch[" ~ n ~ "]", 1); + } + return light; + }, + setColor: func(r,g,b) { + me.Color.r = r; + me.Color.g = g; + me.Color.b = b; + }, + setDir: func(dir) { + me.dir.setValue(dir); + }, + setSize: func(size) { + me.size.setValue(size); + }, + setStretch: func(stretch) { + me.stretch.setValue(stretch); + }, + setPos: func(x,y,z) { + me.Pos.x = x; + me.Pos.y = y; + me.Pos.z = z; + }, + on: func() { + if (me.isOn) { return; } + me.colorr.setValue(me.Color.r); + me.colorg.setValue(me.Color.g); + me.colorb.setValue(me.Color.b); + me.isOn = 1; + }, + off: func() { + if (!me.isOn) { return; } + me.colorr.setValue(0); + me.colorg.setValue(0); + me.colorb.setValue(0); + me.isOn = 0; + }, +}; - run: 0, - +var lightManager = { lat_to_m: 110952.0, lon_to_m: 0.0, - - light1_xpos: 0.0, - light1_ypos: 0.0, - light1_zpos: 0.0, - light1_r: 0.0, - light1_g: 0.0, - light1_b: 0.0, - light1_size: 0.0, - light1_stretch: 0.0, - light1_is_on: 0, - - light2_xpos: 0.0, - light2_ypos: 0.0, - light2_zpos: 0.0, - light2_r: 0.0, - light2_g: 0.0, - light2_b: 0.0, - light2_size: 0.0, - light2_stretch: 0.0, - light2_is_on: 0, - light3_xpos: 0.0, - light3_ypos: 0.0, - light3_zpos: 0.0, - light3_r: 0.0, - light3_g: 0.0, - light3_b: 0.0, - light3_size: 0.0, - light3_stretch: 0.0, - light3_is_on: 0, - - light4_xpos: 0.0, - light4_ypos: 0.0, - light4_zpos: 0.0, - light4_r: 0.0, - light4_g: 0.0, - light4_b: 0.0, - light4_size: 0.0, - light4_stretch: 0.0, - light4_is_on: 0, - - light5_xpos: 0.0, - light5_ypos: 0.0, - light5_zpos: 0.0, - light5_r: 0.0, - light5_g: 0.0, - light5_b: 0.0, - light5_size: 0.0, - light5_stretch: 0.0, - light5_is_on: 0, - - 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_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_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), - - init: func { - # define your lights here - - # lights ######## - # offsets to aircraft center - - me.light1_xpos = 100.0; - me.light1_ypos = 0.0; - me.light1_zpos = 2.0; - - me.light2_xpos = 60.0; - me.light2_ypos = 0.0; - me.light2_zpos = 2.0; - - me.light3_xpos = -2.0; - me.light3_ypos = 18.0; - me.light3_zpos = 2.0; - - me.light4_xpos = -2.0; - me.light4_ypos = -18.0; - me.light4_zpos = 2.0; - - me.light5_xpos = -25.0; - me.light5_ypos = 0.0; - me.light5_zpos = 2.0; - - - # color values - me.light1_r = 0.7; - me.light1_g = 0.7; - me.light1_b = 0.7; - me.light2_r = 0.6; - me.light2_g = 0.6; - me.light2_b = 0.6; - me.light3_r = 0.4; - me.light3_g = 0.0; - me.light3_b = 0.0; - me.light4_r = 0.0; - me.light4_g = 0.4; - me.light4_b = 0.0; - me.light5_r = 0.4; - me.light5_g = 0.4; - me.light5_b = 0.4; - - # spot size - me.light1_size = 12; - me.light1_stretch = 6; - me.light2_size = 6; - me.light2_stretch = 6; - me.light3_size = 4; - me.light4_size = 4; - me.light5_size = 5; - - - setprop("/sim/rendering/als-secondary-lights/flash-radius", 13); - - me.start(); + Lights: { + light1: Light.new(0), + light2: Light.new(1), + light3: Light.new(2), + light4: Light.new(3), + light5: Light.new(4), }, - - start: func { + + init: func() { + setprop("/sim/rendering/als-secondary-lights/flash-radius", 13); 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/stretch", me.light1_stretch); - setprop("/sim/rendering/als-secondary-lights/lightspot/stretch[1]", me.light2_stretch); - - me.run = 1; + + me.Lights.light1.setPos(100,0,2); + me.Lights.light2.setPos(60,0,2); + me.Lights.light3.setPos(-2,18,2); + me.Lights.light4.setPos(-2,-18,2); + me.Lights.light5.setPos(-25,0,2); + + me.Lights.light1.setColor(0.7,0.7,0.7); + me.Lights.light2.setColor(0.7,0.7,0.7); + me.Lights.light3.setColor(0.4,0.0,0.0); + me.Lights.light4.setColor(0.0,0.4,0.0); + me.Lights.light5.setColor(0.4,0.4,0.4); + + me.Lights.light1.setSize(12); + me.Lights.light2.setSize(6); + me.Lights.light3.setSize(4); + me.Lights.light4.setSize(4); + me.Lights.light5.setSize(5); + + me.Lights.light1.setStretch(6); + me.Lights.light2.setStretch(6); me.update(); }, - - stop: func { - me.run = 0; + apos: 0, + curAlt: 0, + ELEC: [0, 0], + ll1: 0, + ll2: 0, + ll3: 0, + nav: 0, + run: 0, + vpos: 0, + Pos: { + alt: 0, + heading: 0, + headingSine: 0, + headingCosine: 0, + lat: 0, + lon: 0, }, - - update: func { - if (me.run == 0) { + update: func() { + if (!me.run) { + settimer ( func me.update(), 0.00); return; } - 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"); - - var apos = geo.aircraft_position(); - var vpos = geo.viewer_position(); - - me.lon_to_m = math.cos(apos.lat()*math.pi/180.0) * me.lat_to_m; - - var heading = getprop("orientation/heading-deg") * math.pi/180.0; - - var lat = apos.lat(); - var lon = apos.lon(); - var alt = apos.alt(); - - var sh = math.sin(heading); - var ch = math.cos(heading); - - if ((ll1 == 1 and systems.ELEC.Bus.ac1.getValue() != 0) and (ll2 == 1 and systems.ELEC.Bus.ac2.getValue() != 0)) { - me.light1_ypos = 0.0; - me.light1_setSize(16); - me.light1_on(); - } else if (ll1 == 1 and systems.ELEC.Bus.ac1.getValue() != 0) { - me.light1_ypos = 3.0; - me.light1_setSize(12); - me.light1_on(); - } else if (ll2 == 1 and systems.ELEC.Bus.ac2.getValue() != 0) { - me.light1_ypos = -3.0; - me.light1_setSize(12); - me.light1_on(); - } else { - me.light1_off(); - } - - if (ll3 != 0) { - me.light2_on(); - } else { - me.light2_off(); - } - - if (ll3 == 1) { - me.light2_setSize(8); - me.light2_xpos = 65.0; - } else { - me.light2_setSize(6); - me.light2_xpos = 60.0; - } - - if (nav == 1) { - me.light3_on(); - me.light4_on(); - me.light5_on(); - } else { - me.light3_off(); - me.light4_off(); - me.light5_off(); - } - - - # light 1 position - var proj_x = cur_alt; - var proj_z = cur_alt/10.0; - - apos.set_lat(lat + ((me.light1_xpos + proj_x) * ch + me.light1_ypos * sh) / me.lat_to_m); - apos.set_lon(lon + ((me.light1_xpos + proj_x)* sh - me.light1_ypos * ch) / me.lon_to_m); - - delta_x = (apos.lat() - vpos.lat()) * me.lat_to_m; - delta_y = -(apos.lon() - vpos.lon()) * me.lon_to_m; - var delta_z = apos.alt()- proj_z - vpos.alt(); - - me.nd_ref_light1_x.setValue(delta_x); - me.nd_ref_light1_y.setValue(delta_y); - me.nd_ref_light1_z.setValue(delta_z); - me.nd_ref_light1_dir.setValue(heading); - - - - # light 2 position - - apos.set_lat(lat + (me.light2_xpos * ch + me.light2_ypos * sh) / me.lat_to_m); - apos.set_lon(lon + (me.light2_xpos * sh - me.light2_ypos * ch) / me.lon_to_m); - - delta_x = (apos.lat() - vpos.lat()) * me.lat_to_m; - delta_y = -(apos.lon() - vpos.lon()) * me.lon_to_m; - delta_z = apos.alt() - vpos.alt(); - - me.nd_ref_light2_x.setValue(delta_x); - me.nd_ref_light2_y.setValue(delta_y); - me.nd_ref_light2_z.setValue(delta_z); - me.nd_ref_light2_dir.setValue(heading); - - - # light 3 position - - apos.set_lat(lat + (me.light3_xpos * ch + me.light3_ypos * sh) / me.lat_to_m); - apos.set_lon(lon + (me.light3_xpos * sh - me.light3_ypos * ch) / me.lon_to_m); - - delta_x = (apos.lat() - vpos.lat()) * me.lat_to_m; - delta_y = -(apos.lon() - vpos.lon()) * me.lon_to_m; - delta_z = apos.alt() - vpos.alt(); - - me.nd_ref_light3_x.setValue(delta_x); - me.nd_ref_light3_y.setValue(delta_y); - me.nd_ref_light3_z.setValue(delta_z); - me.nd_ref_light3_dir.setValue(heading); - - - # light 4 position - - apos.set_lat(lat + (me.light4_xpos * ch + me.light4_ypos * sh) / me.lat_to_m); - apos.set_lon(lon + (me.light4_xpos * sh - me.light4_ypos * ch) / me.lon_to_m); - - delta_x = (apos.lat() - vpos.lat()) * me.lat_to_m; - delta_y = -(apos.lon() - vpos.lon()) * me.lon_to_m; - delta_z = apos.alt() - vpos.alt(); - - me.nd_ref_light4_x.setValue(delta_x); - me.nd_ref_light4_y.setValue(delta_y); - me.nd_ref_light4_z.setValue(delta_z); - me.nd_ref_light4_dir.setValue(heading); - - # light 5 position - - apos.set_lat(lat + (me.light5_xpos * ch + me.light5_ypos * sh) / me.lat_to_m); - apos.set_lon(lon + (me.light5_xpos * sh - me.light5_ypos * ch) / me.lon_to_m); - - delta_x = (apos.lat() - vpos.lat()) * me.lat_to_m; - delta_y = -(apos.lon() - vpos.lon()) * me.lon_to_m; - delta_z = apos.alt() - vpos.alt(); - - me.nd_ref_light5_x.setValue(delta_x); - me.nd_ref_light5_y.setValue(delta_y); - me.nd_ref_light5_z.setValue(delta_z); - me.nd_ref_light5_dir.setValue(heading); + me.curAlt = pts.Position.gearAglFt.getValue(); + if (me.curAlt > 100) { + settimer ( func me.update(), 1); + return; } + me.ll1 = pts.Controls.Lighting.landingLights[1].getValue(); + me.ll2 = pts.Controls.Lighting.landingLights[2].getValue(); + me.ll3 = pts.Sim.Model.Lights.noseLights.getValue(); + me.nav = pts.Sim.Model.Lights.navLights.getValue(); + + me.apos = geo.aircraft_position(); + me.vpos = geo.viewer_position(); + + + me.Pos.lat = me.apos.lat(); + me.Pos.lon = me.apos.lon(); + me.Pos.alt = me.apos.alt(); + me.Pos.heading = pts.Orientation.heading.getValue() * D2R; + me.Pos.headingSine = math.sin(me.Pos.heading); + me.Pos.headingCosine = math.cos(me.Pos.heading); + me.lon_to_m = math.cos(me.Pos.lat*D2R) * me.lat_to_m; + + me.ELEC[0] = systems.ELEC.Bus.ac1.getValue(); + me.ELEC[1] = systems.ELEC.Bus.ac2.getValue(); + + if ((me.ll1 == 1 and me.ELEC[0] >= 110) and (me.ll2 == 1 and me.ELEC[1] >= 110)) { + me.Lights.light1.setPos(100,0,2); + me.Lights.light1.setSize(16); + me.Lights.light1.on(); + } else if (me.ll1 == 1 and me.ELEC[0] >= 110) { + me.Lights.light1.setPos(100,3,2); + me.Lights.light1.setSize(12); + me.Lights.light1.on(); + } else if (me.ll2 == 1 and me.ELEC[1] >= 110) { + me.Lights.light1.setPos(100,-3,2); + me.Lights.light1.setSize(12); + me.Lights.light1.on(); + } else { + me.Lights.light1.off(); + } + + if (me.ll3 != 0) { + me.Lights.light2.on(); + } else { + me.Lights.light2.off(); + } + + if (me.ll3 == 1) { + me.Lights.light2.setSize(8); + me.Lights.light2.setPos(65,0,2); + } else { + me.Lights.light2.setSize(6); + me.Lights.light2.setPos(60,0,2); + } + + if (me.nav == 1) { + me.Lights.light3.on(); + me.Lights.light4.on(); + me.Lights.light5.on(); + } else { + me.Lights.light3.off(); + me.Lights.light4.off(); + me.Lights.light5.off(); + } + + + # light 1 position + me.apos.set_lat(me.Pos.lat + ((me.Lights.light1.Pos.x + me.curAlt) * me.Pos.headingCosine + me.Lights.light1.Pos.y * me.Pos.headingSine) / me.lat_to_m); + me.apos.set_lon(me.Pos.lon + ((me.Lights.light1.Pos.x + me.curAlt) * me.Pos.headingSine - me.Lights.light1.Pos.y * me.Pos.headingCosine) / me.lon_to_m); + + me.Lights.light1.posx.setValue((me.apos.lat() - me.vpos.lat()) * me.lat_to_m); + me.Lights.light1.posy.setValue(-(me.apos.lon() - me.vpos.lon()) * me.lon_to_m); + me.Lights.light1.posz.setValue(me.apos.alt()- (me.curAlt / 10) - me.vpos.alt()); + me.Lights.light1.dir.setValue(me.Pos.heading); + + # light 2 position + me.apos.set_lat(me.Pos.lat + ((me.Lights.light2.Pos.x + me.curAlt) * me.Pos.headingCosine + me.Lights.light2.Pos.y * me.Pos.headingSine) / me.lat_to_m); + me.apos.set_lon(me.Pos.lon + ((me.Lights.light2.Pos.x + me.curAlt) * me.Pos.headingSine - me.Lights.light2.Pos.y * me.Pos.headingCosine) / me.lon_to_m); + + me.Lights.light2.posx.setValue((me.apos.lat() - me.vpos.lat()) * me.lat_to_m); + me.Lights.light2.posy.setValue(-(me.apos.lon() - me.vpos.lon()) * me.lon_to_m); + me.Lights.light2.posz.setValue(me.apos.alt()- (me.curAlt / 10) - me.vpos.alt()); + me.Lights.light2.dir.setValue(me.Pos.heading); + + # light 3 position + me.apos.set_lat(me.Pos.lat + ((me.Lights.light3.Pos.x + me.curAlt) * me.Pos.headingCosine + me.Lights.light3.Pos.y * me.Pos.headingSine) / me.lat_to_m); + me.apos.set_lon(me.Pos.lon + ((me.Lights.light3.Pos.x + me.curAlt) * me.Pos.headingSine - me.Lights.light3.Pos.y * me.Pos.headingCosine) / me.lon_to_m); + + me.Lights.light3.posx.setValue((me.apos.lat() - me.vpos.lat()) * me.lat_to_m); + me.Lights.light3.posy.setValue(-(me.apos.lon() - me.vpos.lon()) * me.lon_to_m); + me.Lights.light3.posz.setValue(me.apos.alt()- (me.curAlt / 10) - me.vpos.alt()); + me.Lights.light3.dir.setValue(me.Pos.heading); + + # light 4 position + me.apos.set_lat(me.Pos.lat + ((me.Lights.light4.Pos.x + me.curAlt) * me.Pos.headingCosine + me.Lights.light4.Pos.y * me.Pos.headingSine) / me.lat_to_m); + me.apos.set_lon(me.Pos.lon + ((me.Lights.light4.Pos.x + me.curAlt) * me.Pos.headingSine - me.Lights.light4.Pos.y * me.Pos.headingCosine) / me.lon_to_m); + + me.Lights.light4.posx.setValue((me.apos.lat() - me.vpos.lat()) * me.lat_to_m); + me.Lights.light4.posy.setValue(-(me.apos.lon() - me.vpos.lon()) * me.lon_to_m); + me.Lights.light4.posz.setValue(me.apos.alt()- (me.curAlt / 10) - me.vpos.alt()); + me.Lights.light4.dir.setValue(me.Pos.heading); + + # light 5 position + me.apos.set_lat(me.Pos.lat + ((me.Lights.light5.Pos.x + me.curAlt) * me.Pos.headingCosine + me.Lights.light5.Pos.y * me.Pos.headingSine) / me.lat_to_m); + me.apos.set_lon(me.Pos.lon + ((me.Lights.light5.Pos.x + me.curAlt) * me.Pos.headingSine - me.Lights.light5.Pos.y * me.Pos.headingCosine) / me.lon_to_m); + + me.Lights.light5.posx.setValue((me.apos.lat() - me.vpos.lat()) * me.lat_to_m); + me.Lights.light5.posy.setValue(-(me.apos.lon() - me.vpos.lon()) * me.lon_to_m); + me.Lights.light5.posz.setValue(me.apos.alt()- (me.curAlt / 10) - me.vpos.alt()); + me.Lights.light5.dir.setValue(me.Pos.heading); + settimer ( func me.update(), 0.00); }, +}; - 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); - 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); - me.light1_is_on = 0; - }, - - light1_setSize : func(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); - 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); - me.light2_is_on = 0; - }, - - light2_setSize : func(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); - 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); - 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); - 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); - 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); - 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); - me.light5_is_on = 0; - }, -}; \ No newline at end of file +setlistener(pts.Sim.Rendering.Shaders.skydome, func(v) { + lightManager.run = v.getValue() ? 1 : 0; +}, 1, 0); \ No newline at end of file diff --git a/Nasal/Libraries/libraries.nas b/Nasal/Libraries/libraries.nas index 6c4636e0..f86ee125 100644 --- a/Nasal/Libraries/libraries.nas +++ b/Nasal/Libraries/libraries.nas @@ -88,7 +88,7 @@ var A320Libraries = nil; var systemsInit = func() { systemsInitialized = 0; fbw.FBW.init(); - effects.light_manager.init(); + effects.lightManager.init(); systems.ELEC.init(); systems.PNEU.init(); systems.HYD.init(); diff --git a/Nasal/Libraries/property-tree-setup.nas b/Nasal/Libraries/property-tree-setup.nas index b64e56ca..a4d5c988 100644 --- a/Nasal/Libraries/property-tree-setup.nas +++ b/Nasal/Libraries/property-tree-setup.nas @@ -67,6 +67,9 @@ var Controls = { parkingBrake: props.globals.getNode("/controls/gear/brake-parking"), chocks: props.globals.getNode("/services/chocks/enable"), }, + Lighting: { + landingLights: [props.globals.getNode("/controls/lighting/landing-lights[0]"),props.globals.getNode("/controls/lighting/landing-lights[1]"),props.globals.getNode("/controls/lighting/landing-lights[2]")], + }, Switches: { annunTest: props.globals.getNode("/controls/switches/annun-test"), }, @@ -213,6 +216,7 @@ var Options = { }; var Orientation = { + heading: props.globals.getNode("/orientation/heading-deg"), pitch: props.globals.getNode("/orientation/pitch-deg"), roll: props.globals.getNode("/orientation/roll-deg"), yaw: props.globals.getNode("/orientation/yaw-deg"), @@ -249,6 +253,12 @@ var Sim = { engine: [props.globals.getNode("/sim/input/selected/engine[0]", 1),props.globals.getNode("/sim/input/selected/engine[1]", 1)], } }, + Model: { + Lights: { + navLights: props.globals.getNode("/sim/model/lights/nav-lights"), + noseLights: props.globals.getNode("/sim/model/lights/nose-lights"), + }, + }, Multiplay: { online: props.globals.getNode("/sim/multiplay/online"), }, @@ -257,6 +267,9 @@ var Sim = { Headshake: { enabled: props.globals.getNode("/sim/rendering/headshake/enabled"), }, + Shaders: { + skydome: props.globals.getNode("/sim/rendering/shaders/skydome"), + }, }, replayState: props.globals.getNode("/sim/freeze/replay-state"), Replay: { From e32f5ef1416431c6d9ef51fcfdf23240de0083e6 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Mon, 5 Jul 2021 22:17:20 +0100 Subject: [PATCH 66/96] Lower ECAM: rework APU page (emesary) --- .../Instruments/Lower-ECAM/Lower-ECAM-old.nas | 3489 +++++++++++++++ Models/Instruments/Lower-ECAM/Lower-ECAM.nas | 3848 ++--------------- Models/Instruments/Lower-ECAM/res/apu.svg | 24 +- Models/Instruments/Upper-ECAM/Upper-ECAM.nas | 2 +- 4 files changed, 3787 insertions(+), 3576 deletions(-) create mode 100644 Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas new file mode 100644 index 00000000..f9a7f0ef --- /dev/null +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas @@ -0,0 +1,3489 @@ +# A3XX Lower ECAM Canvas + +# Copyright (c) 2020 Josh Davidson (Octal450) + +var lowerECAM_apu = nil; +var lowerECAM_bleed = nil; +var lowerECAM_cond = nil; +var lowerECAM_crz = nil; +var lowerECAM_door = nil; +var lowerECAM_elec = nil; +var lowerECAM_eng = nil; +var lowerECAM_fctl = nil; +var lowerECAM_fuel = nil; +var lowerECAM_hyd = nil; +var lowerECAM_press = nil; +var lowerECAM_status = nil; +var lowerECAM_wheel = nil; +var lowerECAM_test = nil; +var lowerECAM_display = nil; +var page = "fctl"; +var blue_psi = 0; +var green_psi = 0; +var yellow_psi = 0; +var autobrakemode = 0; +var nosegear = 0; +var leftgear = 0; +var rightgear = 0; +var leftdoor = 0; +var rightdoor = 0; +var nosedoor = 0; +var gearlvr = 0; +var elapsedtime = 0; +var tr1_v = 0; +var tr1_a = 0; +var tr2_v = 0; +var tr2_a = 0; +var essTramps = 0; +var essTrvolts = 0; +var elac1Node = 0; +var elac2Node = 0; +var sec1Node = 0; +var sec2Node = 0; +var eng_valve_state = 0; +var bleed_valve_cur = 0; +var hp_valve_state = 0; +var xbleedcmdstate = 0; +var ramAirState = 0; + +# Conversion factor pounds to kilogram +LBS2KGS = 0.4535924; + +# Fetch Nodes +var acconfig_weight_kgs = props.globals.getNode("/systems/acconfig/options/weight-kgs", 1); +var rate = props.globals.getNode("/systems/acconfig/options/lecam-rate", 1); +var autoconfig_running = props.globals.getNode("/systems/acconfig/autoconfig-running", 1); +var ecam_page = props.globals.getNode("/ECAM/Lower/page", 1); +var hour = props.globals.getNode("/sim/time/utc/hour", 1); +var minute = props.globals.getNode("/sim/time/utc/minute", 1); +var apu_flap = props.globals.getNode("/controls/apu/inlet-flap/position-norm", 1); +var apu_rpm = props.globals.getNode("/engines/engine[2]/n1", 1); +var apu_egt = props.globals.getNode("/systems/apu/egt-degC", 1); +var door_left = props.globals.getNode("/ECAM/Lower/door-left", 1); +var door_right = props.globals.getNode("/ECAM/Lower/door-right", 1); +var door_nose_left = props.globals.getNode("/ECAM/Lower/door-nose-left", 1); +var door_nose_right = props.globals.getNode("/ECAM/Lower/door-nose-right", 1); +var apu_rpm_rot = props.globals.getNode("/ECAM/Lower/APU-N", 1); +var apu_egt_rot = props.globals.getNode("/ECAM/Lower/APU-EGT", 1); +var oil_qt1 = props.globals.getNode("/ECAM/Lower/Oil-QT[0]", 1); +var oil_qt2 = props.globals.getNode("/ECAM/Lower/Oil-QT[1]", 1); +var oil_psi1 = props.globals.getNode("/ECAM/Lower/Oil-PSI[0]", 1); +var oil_psi2 = props.globals.getNode("/ECAM/Lower/Oil-PSI[1]", 1); +var bleedapu = props.globals.getNode("", 1); +var aileron_ind_left = props.globals.getNode("/ECAM/Lower/aileron-ind-left", 1); +var aileron_ind_right = props.globals.getNode("/ECAM/Lower/aileron-ind-right", 1); +var elevator_ind_left = props.globals.getNode("/ECAM/Lower/elevator-ind-left", 1); +var elevator_ind_right = props.globals.getNode("/ECAM/Lower/elevator-ind-right", 1); +var elevator_trim_deg = props.globals.getNode("/ECAM/Lower/elevator-trim-deg", 1); +var final_deg = props.globals.getNode("/fdm/jsbsim/hydraulics/rudder/final-deg", 1); +var temperature_degc = props.globals.getNode("/environment/temperature-degc", 1); +var tank3_content_lbs = props.globals.getNode("/fdm/jsbsim/propulsion/tank[2]/contents-lbs", 1); +var ir2_knob = props.globals.getNode("/controls/adirs/ir[1]/knob", 1); +var apuBleedNotOn = props.globals.getNode("/systems/pneumatics/warnings/apu-bleed-not-on", 1); +var apu_valve = props.globals.getNode("/systems/pneumatics/valves/apu-bleed-valve-cmd", 1); +var apu_valve_state = props.globals.getNode("/systems/pneumatics/valves/apu-bleed-valve", 1); +var xbleedcmd = props.globals.getNode("/systems/pneumatics/valves/crossbleed-valve-cmd", 1); +var xbleed = props.globals.getNode("/systems/pneumatics/valves/crossbleed-valve", 1); +var xbleedstate = nil; +var hp_valve1_state = props.globals.getNode("/systems/pneumatics/valves/engine-1-hp-valve", 1); +var hp_valve2_state = props.globals.getNode("/systems/pneumatics/valves/engine-2-hp-valve", 1); +var hp_valve1 = props.globals.getNode("/systems/pneumatics/valves/engine-1-hp-valve-cmd", 1); +var hp_valve2 = props.globals.getNode("/systems/pneumatics/valves/engine-2-hp-valve-cmd", 1); +var eng_valve1 = props.globals.getNode("/systems/pneumatics/valves/engine-1-prv-valve", 1); +var eng_valve2 = props.globals.getNode("/systems/pneumatics/valves/engine-2-prv-valve", 1); +var precooler1_psi = props.globals.getNode("/systems/pneumatics/psi/engine-1-psi", 1); +var precooler2_psi = props.globals.getNode("/systems/pneumatics/psi/engine-2-psi", 1); +var precooler1_temp = props.globals.getNode("/systems/pneumatics/precooler/temp-1", 1); +var precooler2_temp = props.globals.getNode("/systems/pneumatics/precooler/temp-2", 1); +var precooler1_ovht = props.globals.getNode("/systems/pneumatics/precooler/ovht-1", 1); +var precooler2_ovht = props.globals.getNode("/systems/pneumatics/precooler/ovht-2", 1); +var bmc1working = props.globals.getNode("/systems/pneumatics/indicating/bmc1-working", 1); +var bmc2working = props.globals.getNode("/systems/pneumatics/indicating/bmc2-working", 1); +var bmc1 = 0; +var bmc2 = 0; +var gs_kt = props.globals.getNode("/velocities/groundspeed-kt", 1); +var switch_wing_aice = props.globals.getNode("/controls/ice-protection/wing", 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); +var oil_qt2_actual = props.globals.getNode("/engines/engine[1]/oil-qt-actual", 1); +var fuel_used_lbs1 = props.globals.getNode("/systems/fuel/fuel-used-1", 1); +var fuel_used_lbs2 = props.globals.getNode("/systems/fuel/fuel-used-2", 1); +var doorL1_pos = props.globals.getNode("/sim/model/door-positions/doorl1/position-norm", 1); +var doorR1_pos = props.globals.getNode("/sim/model/door-positions/doorr1/position-norm", 1); +var doorL4_pos = props.globals.getNode("/sim/model/door-positions/doorl4/position-norm", 1); +var doorR4_pos = props.globals.getNode("/sim/model/door-positions/doorr4/position-norm", 1); +var cargobulk_pos = props.globals.getNode("/sim/model/door-positions/cargobulk/position-norm", 1); +var cargofwd_pos = props.globals.getNode("/sim/model/door-positions/cargofwd/position-norm", 1); +var cargoaft_pos = props.globals.getNode("/sim/model/door-positions/cargoaft/position-norm", 1); +var gLoad = props.globals.getNode("/ECAM/Lower/g-force-display", 1); + +# Hydraulic +var blue_psi = 0; +var green_psi = 0; +var yellow_psi = 0; +var y_resv_lo_air_press = props.globals.getNode("/systems/hydraulic/yellow-resv-lo-air-press", 1); +var b_resv_lo_air_press = props.globals.getNode("/systems/hydraulic/blue-resv-lo-air-press", 1); +var g_resv_lo_air_press = props.globals.getNode("/systems/hydraulic/green-resv-lo-air-press", 1); +var elec_pump_y_ovht = props.globals.getNode("/systems/hydraulic/elec-pump-yellow-ovht", 1); +var elec_pump_b_ovht = props.globals.getNode("/systems/hydraulic/elec-pump-blue-ovht", 1); +var rat_deployed = props.globals.getNode("/controls/hydraulic/rat-deployed", 1); +var y_resv_ovht = props.globals.getNode("/systems/hydraulic/yellow-resv-ovht", 1); +var b_resv_ovht = props.globals.getNode("/systems/hydraulic/blue-resv-ovht", 1); +var g_resv_ovht = props.globals.getNode("/systems/hydraulic/green-resv-ovht", 1); +var askidsw = 0; +var brakemode = 0; +var accum = 0; +var L1BrakeTempc = props.globals.getNode("/gear/gear[1]/L1brake-temp-degc", 1); +var L2BrakeTempc = props.globals.getNode("/gear/gear[1]/L2brake-temp-degc", 1); +var R3BrakeTempc = props.globals.getNode("/gear/gear[2]/R3brake-temp-degc", 1); +var R4BrakeTempc = props.globals.getNode("/gear/gear[2]/R4brake-temp-degc", 1); + +var eng1_running = props.globals.getNode("/engines/engine[0]/running", 1); +var eng2_running = props.globals.getNode("/engines/engine[1]/running", 1); +var switch_cart = props.globals.getNode("/controls/electrical/ground-cart", 1); +var spoiler_L1 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l1/final-deg", 1); +var spoiler_L2 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l2/final-deg", 1); +var spoiler_L3 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l3/final-deg", 1); +var spoiler_L4 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l4/final-deg", 1); +var spoiler_L5 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l5/final-deg", 1); +var spoiler_R1 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r1/final-deg", 1); +var spoiler_R2 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r2/final-deg", 1); +var spoiler_R3 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r3/final-deg", 1); +var spoiler_R4 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r4/final-deg", 1); +var spoiler_R5 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r5/final-deg", 1); +var total_fuel_lbs = props.globals.getNode("/consumables/fuel/total-fuel-lbs", 1); +var fuel_flow1 = props.globals.getNode("/engines/engine[0]/fuel-flow_actual", 1); +var fuel_flow2 = props.globals.getNode("/engines/engine[1]/fuel-flow_actual", 1); +var fuel_left_outer_temp = props.globals.getNode("/consumables/fuel/tank[0]/temperature_degC", 1); +var fuel_left_inner_temp = props.globals.getNode("/consumables/fuel/tank[1]/temperature_degC", 1); +var fuel_right_outer_temp = props.globals.getNode("/consumables/fuel/tank[4]/temperature_degC", 1); +var fuel_right_inner_temp = props.globals.getNode("/consumables/fuel/tank[3]/temperature_degC", 1); +var cutoff_switch1 = props.globals.getNode("/controls/engines/engine[0]/cutoff-switch", 1); +var cutoff_switch2 = props.globals.getNode("/controls/engines/engine[1]/cutoff-switch", 1); +var autobreak_mode = props.globals.getNode("/controls/autobrake/mode", 1); +var gear1_pos = props.globals.getNode("/gear/gear[0]/position-norm", 1); +var gear2_pos = props.globals.getNode("/gear/gear[1]/position-norm", 1); +var gear3_pos = props.globals.getNode("/gear/gear[2]/position-norm", 1); +var gear_door_L = props.globals.getNode("/systems/hydraulic/gear/door-left", 1); +var gear_door_R = props.globals.getNode("/systems/hydraulic/gear/door-right", 1); +var gear_door_N = props.globals.getNode("/systems/hydraulic/gear/door-nose", 1); +var gear_down = props.globals.getNode("/controls/gear/gear-down", 1); +var press_vs_norm = props.globals.getNode("/systems/pressurization/vs-norm", 1); +var cabinalt = props.globals.getNode("/systems/pressurization/cabinalt-norm", 1); +var gear0_wow = props.globals.getNode("/gear/gear[0]/wow", 1); + +# Create Nodes: + +var canvas_lowerECAM_base = { + init: func(canvas_group, file) { + var font_mapper = func(family, weight) { + return "LiberationFonts/LiberationSans-Regular.ttf"; + }; + + canvas.parsesvg(canvas_group, file, {"font-mapper": font_mapper}); + + var svg_keys = me.getKeys(); + foreach(var key; svg_keys) { + me[key] = canvas_group.getElementById(key); + } + + me.page = canvas_group; + + return me; + }, + getKeys: func() { + return []; + }, + update: func() { + var elapsedtime = pts.Sim.Time.elapsedSec.getValue(); + + if (systems.ELEC.Bus.ac2.getValue() >= 110 and lighting_du4.getValue() > 0.01) { + if (du4_test_time.getValue() + du4_test_amount.getValue() >= elapsedtime) { + lowerECAM_apu.page.hide(); + lowerECAM_bleed.page.hide(); + lowerECAM_cond.page.hide(); + lowerECAM_crz.page.hide(); + lowerECAM_door.page.hide(); + lowerECAM_elec.page.hide(); + lowerECAM_eng.page.hide(); + lowerECAM_fctl.page.hide(); + lowerECAM_fuel.page.hide(); + lowerECAM_press.page.hide(); + lowerECAM_status.page.hide(); + lowerECAM_wheel.page.hide(); + lowerECAM_test.page.show(); + lowerECAM_test.update(); + } else { + lowerECAM_test.page.hide(); + page = ecam_page.getValue(); + if (page == "apu") { + lowerECAM_apu.page.show(); + lowerECAM_bleed.page.hide(); + lowerECAM_cond.page.hide(); + lowerECAM_crz.page.hide(); + lowerECAM_door.page.hide(); + lowerECAM_elec.page.hide(); + lowerECAM_eng.page.hide(); + lowerECAM_fctl.page.hide(); + lowerECAM_fuel.page.hide(); + lowerECAM_press.page.hide(); + lowerECAM_status.page.hide(); + lowerECAM_hyd.page.hide(); + lowerECAM_wheel.page.hide(); + lowerECAM_apu.update(); + } else if (page == "bleed") { + lowerECAM_apu.page.hide(); + lowerECAM_bleed.page.show(); + lowerECAM_cond.page.hide(); + lowerECAM_crz.page.hide(); + lowerECAM_door.page.hide(); + lowerECAM_elec.page.hide(); + lowerECAM_eng.page.hide(); + lowerECAM_fctl.page.hide(); + lowerECAM_fuel.page.hide(); + lowerECAM_press.page.hide(); + lowerECAM_status.page.hide(); + lowerECAM_hyd.page.hide(); + lowerECAM_wheel.page.hide(); + lowerECAM_bleed.update(); + } else if (page == "cond") { + lowerECAM_apu.page.hide(); + lowerECAM_bleed.page.hide(); + lowerECAM_cond.page.show(); + lowerECAM_crz.page.hide(); + lowerECAM_door.page.hide(); + lowerECAM_elec.page.hide(); + lowerECAM_eng.page.hide(); + lowerECAM_fctl.page.hide(); + lowerECAM_fuel.page.hide(); + lowerECAM_press.page.hide(); + lowerECAM_status.page.hide(); + lowerECAM_hyd.page.hide(); + lowerECAM_wheel.page.hide(); + lowerECAM_cond.update(); + } else if (page == "cruise") { + lowerECAM_apu.page.hide(); + lowerECAM_bleed.page.hide(); + lowerECAM_cond.page.hide(); + lowerECAM_crz.page.show(); + lowerECAM_door.page.hide(); + lowerECAM_elec.page.hide(); + lowerECAM_eng.page.hide(); + lowerECAM_fctl.page.hide(); + lowerECAM_fuel.page.hide(); + lowerECAM_press.page.hide(); + lowerECAM_status.page.hide(); + lowerECAM_hyd.page.hide(); + lowerECAM_wheel.page.hide(); + lowerECAM_crz.update(); + } else if (page == "door") { + lowerECAM_apu.page.hide(); + lowerECAM_bleed.page.hide(); + lowerECAM_cond.page.hide(); + lowerECAM_crz.page.hide(); + lowerECAM_door.page.show(); + lowerECAM_elec.page.hide(); + lowerECAM_eng.page.hide(); + lowerECAM_fctl.page.hide(); + lowerECAM_fuel.page.hide(); + lowerECAM_press.page.hide(); + lowerECAM_status.page.hide(); + lowerECAM_hyd.page.hide(); + lowerECAM_wheel.page.hide(); + lowerECAM_door.update(); + } else if (page == "elec") { + lowerECAM_apu.page.hide(); + lowerECAM_bleed.page.hide(); + lowerECAM_cond.page.hide(); + lowerECAM_crz.page.hide(); + lowerECAM_door.page.hide(); + lowerECAM_elec.page.show(); + lowerECAM_eng.page.hide(); + lowerECAM_fctl.page.hide(); + lowerECAM_fuel.page.hide(); + lowerECAM_press.page.hide(); + lowerECAM_status.page.hide(); + lowerECAM_hyd.page.hide(); + lowerECAM_wheel.page.hide(); + lowerECAM_elec.update(); + } else if (page == "eng") { + lowerECAM_apu.page.hide(); + lowerECAM_bleed.page.hide(); + lowerECAM_cond.page.hide(); + lowerECAM_crz.page.hide(); + lowerECAM_door.page.hide(); + lowerECAM_elec.page.hide(); + lowerECAM_eng.page.show(); + lowerECAM_fctl.page.hide(); + lowerECAM_fuel.page.hide(); + lowerECAM_press.page.hide(); + lowerECAM_status.page.hide(); + lowerECAM_hyd.page.hide(); + lowerECAM_wheel.page.hide(); + lowerECAM_eng.update(); + } else if (page == "fctl") { + lowerECAM_apu.page.hide(); + lowerECAM_bleed.page.hide(); + lowerECAM_cond.page.hide(); + lowerECAM_crz.page.hide(); + lowerECAM_door.page.hide(); + lowerECAM_elec.page.hide(); + lowerECAM_eng.page.hide(); + lowerECAM_fctl.page.show(); + lowerECAM_fuel.page.hide(); + lowerECAM_press.page.hide(); + lowerECAM_status.page.hide(); + lowerECAM_hyd.page.hide(); + lowerECAM_wheel.page.hide(); + lowerECAM_fctl.update(); + } else if (page == "fuel") { + lowerECAM_apu.page.hide(); + lowerECAM_bleed.page.hide(); + lowerECAM_cond.page.hide(); + lowerECAM_crz.page.hide(); + lowerECAM_door.page.hide(); + lowerECAM_elec.page.hide(); + lowerECAM_eng.page.hide(); + lowerECAM_fctl.page.hide(); + lowerECAM_fuel.page.show(); + lowerECAM_press.page.hide(); + lowerECAM_status.page.hide(); + lowerECAM_hyd.page.hide(); + lowerECAM_wheel.page.hide(); + lowerECAM_fuel.update(); + } else if (page == "press") { + lowerECAM_apu.page.hide(); + lowerECAM_bleed.page.hide(); + lowerECAM_cond.page.hide(); + lowerECAM_crz.page.hide(); + lowerECAM_door.page.hide(); + lowerECAM_elec.page.hide(); + lowerECAM_eng.page.hide(); + lowerECAM_fctl.page.hide(); + lowerECAM_fuel.page.hide(); + lowerECAM_press.page.show(); + lowerECAM_status.page.hide(); + lowerECAM_hyd.page.hide(); + lowerECAM_wheel.page.hide(); + lowerECAM_press.update(); + } else if (page == "sts") { + lowerECAM_apu.page.hide(); + lowerECAM_bleed.page.hide(); + lowerECAM_cond.page.hide(); + lowerECAM_crz.page.hide(); + lowerECAM_door.page.hide(); + lowerECAM_elec.page.hide(); + lowerECAM_eng.page.hide(); + lowerECAM_fctl.page.hide(); + lowerECAM_fuel.page.hide(); + lowerECAM_press.page.hide(); + lowerECAM_status.page.show(); + lowerECAM_hyd.page.hide(); + lowerECAM_wheel.page.hide(); + lowerECAM_status.update(); + } else if (page == "hyd") { + lowerECAM_apu.page.hide(); + lowerECAM_bleed.page.hide(); + lowerECAM_cond.page.hide(); + lowerECAM_crz.page.hide(); + lowerECAM_door.page.hide(); + lowerECAM_elec.page.hide(); + lowerECAM_eng.page.hide(); + lowerECAM_fctl.page.hide(); + lowerECAM_fuel.page.hide(); + lowerECAM_press.page.hide(); + lowerECAM_status.page.hide(); + lowerECAM_hyd.page.show(); + lowerECAM_wheel.page.hide(); + lowerECAM_hyd.update(); + } else if (page == "wheel") { + lowerECAM_apu.page.hide(); + lowerECAM_bleed.page.hide(); + lowerECAM_cond.page.hide(); + lowerECAM_crz.page.hide(); + lowerECAM_door.page.hide(); + lowerECAM_elec.page.hide(); + lowerECAM_eng.page.hide(); + lowerECAM_fctl.page.hide(); + lowerECAM_fuel.page.hide(); + lowerECAM_press.page.hide(); + lowerECAM_status.page.hide(); + lowerECAM_hyd.page.hide(); + lowerECAM_wheel.page.show(); + lowerECAM_wheel.update(); + } else { + lowerECAM_apu.page.hide(); + lowerECAM_bleed.page.hide(); + lowerECAM_cond.page.hide(); + lowerECAM_crz.page.hide(); + lowerECAM_door.page.hide(); + lowerECAM_elec.page.hide(); + lowerECAM_eng.page.hide(); + lowerECAM_fctl.page.hide(); + lowerECAM_fuel.page.hide(); + lowerECAM_press.page.hide(); + lowerECAM_status.page.hide(); + lowerECAM_hyd.page.hide(); + lowerECAM_wheel.page.hide(); + } + } + } else { + lowerECAM_test.page.hide(); + lowerECAM_apu.page.hide(); + lowerECAM_bleed.page.hide(); + lowerECAM_cond.page.hide(); + lowerECAM_crz.page.hide(); + lowerECAM_door.page.hide(); + lowerECAM_elec.page.hide(); + lowerECAM_eng.page.hide(); + lowerECAM_fctl.page.hide(); + lowerECAM_fuel.page.hide(); + lowerECAM_press.page.hide(); + lowerECAM_status.page.hide(); + lowerECAM_hyd.page.hide(); + lowerECAM_wheel.page.hide(); + } + }, + displayedGForce: 0, + updateBottomStatus: func() { + if (dmc.DMController.DMCs[1].outputs[4] != nil) { + me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["SAT"].setText(sprintf("%s", "XX")); + me["SAT"].setColor(0.7333,0.3803,0); + } + + if (dmc.DMController.DMCs[1].outputs[5] != nil) { + me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["TAT"].setText(sprintf("%s", "XX")); + me["TAT"].setColor(0.7333,0.3803,0); + } + + me.gloadStore = gLoad.getValue(); + if ((me.gloadStore == 1 and !me.displayedGForce) or (me.gloadStore != 0 and me.displayedGForce)) { + me.displayedGForce = 1; + me["GLoad"].setText("G.LOAD " ~ sprintf("%3.1f", pts.Accelerations.pilotGDamped.getValue())); + me["GLoad"].show(); + } else { + me.displayedGForce = 0; + me["GLoad"].hide(); + } + + me["UTCh"].setText(sprintf("%02d", hour.getValue())); + me["UTCm"].setText(sprintf("%02d", minute.getValue())); + + if (fmgc.FMGCInternal.fuelRequest and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating and ecam.phaseNode.getValue() != 1) { + if (acconfig_weight_kgs.getValue()) { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000 * LBS2KGS, 100))); + } else { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000, 100))); + } + me["GW"].setColor(0.0509,0.7529,0.2941); + } else { + me["GW"].setText(sprintf("%s", "-----")); + me["GW"].setColor(0.0901,0.6039,0.7176); + } + + if (acconfig_weight_kgs.getValue()) { + me["GW-weight-unit"].setText("KG"); + } else { + me["GW-weight-unit"].setText("LBS"); + } + }, +}; + +var canvas_lowerECAM_apu = { + new: func(canvas_group, file) { + var m = {parents: [canvas_lowerECAM_apu, canvas_lowerECAM_base]}; + m.init(canvas_group, file); + + return m; + }, + getKeys: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","APUN-needle","APUEGT-needle","APUN","APUEGT","APUAvail","APUFlapOpen","APUBleedValve","APUBleedOnline","APUGenOnline","APUGentext","APUGenLoad","APUGenbox","APUGenVolt","APUGenHz","APUBleedPSI","APUfuelLO","APU-low-oil", + "text3724","text3728","text3732"]; + }, + update: func() { + + + + var apu_valve_state2 = apu_valve_state.getValue(); + if (apu_valve_state2 == 1) { + me["APUBleedValve"].setRotation(90 * D2R); + } else { + me["APUBleedValve"].setRotation(0); + } + + if (apu_valve_state2 == apu_valve_state.getValue()) { + me["APUBleedValve"].setColor(0.0509,0.7529,0.2941); + me["APUBleedOnline"].show(); + } else { + me["APUBleedValve"].setColor(0.7333,0.3803,0); + me["APUBleedOnline"].hide(); + } + + me.updateBottomStatus(); + }, +}; + +var canvas_lowerECAM_bleed = { + new: func(canvas_group, file) { + var m = {parents: [canvas_lowerECAM_bleed, canvas_lowerECAM_base]}; + m.init(canvas_group, file); + + return m; + }, + getKeys: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit", "BLEED-XFEED", "BLEED-Ram-Air", "BLEED-APU-CIRCLE", "BLEED-HP-Valve-1", + "BLEED-APU-LINES","BLEED-ENG-1", "BLEED-HP-Valve-2", "BLEED-ENG-2", "BLEED-Precooler-1-Inlet-Press", "BLEED-Precooler-1-Outlet-Temp", + "BLEED-Precooler-2-Inlet-Press", "BLEED-Precooler-2-Outlet-Temp", "BLEED-ENG-1-label", "BLEED-ENG-2-label", + "BLEED-GND", "BLEED-Pack-1-Flow-Valve", "BLEED-Pack-2-Flow-Valve", "BLEED-Pack-1-Out-Temp","BLEED-APU-connectionTop", + "BLEED-Pack-1-Comp-Out-Temp", "BLEED-Pack-1-Packflow-needle", "BLEED-Pack-1-Bypass-needle", "BLEED-Pack-2-Out-Temp", + "BLEED-Pack-2-Bypass-needle", "BLEED-Pack-2-Comp-Out-Temp", "BLEED-Pack-2-Packflow-needle", "BLEED-Anti-Ice-Left", + "BLEED-Anti-Ice-Right", "BLEED-HP-2-connection", "BLEED-HP-1-connection", "BLEED-ANTI-ICE-ARROW-LEFT", "BLEED-ANTI-ICE-ARROW-RIGHT", + "BLEED-xbleedLeft","BLEED-xbleedCenter","BLEED-xbleedRight","BLEED-cond-1","BLEED-cond-2","BLEED-cond-3","BLEED-Ram-Air-connection"]; + }, + update: func() { + # X BLEED + xbleedstate = xbleed.getValue(); + xbleedcmdstate = xbleedcmd.getBoolValue(); + if (xbleedcmdstate != xbleedstate) { + me["BLEED-XFEED"].setColor(0.7333,0.3803,0); + } else { + me["BLEED-XFEED"].setColor(0.0509,0.7529,0.2941); + } + + if (xbleedcmdstate == xbleedstate) { + if (xbleedcmdstate) { + me["BLEED-XFEED"].setRotation(0); + } else { + me["BLEED-XFEED"].setRotation(90 * D2R); + } + } else { + me["BLEED-XFEED"].setRotation(45 * D2R); + } + + if (xbleedstate == 1) { + me["BLEED-xbleedCenter"].show(); + me["BLEED-xbleedRight"].show(); + } else { + me["BLEED-xbleedCenter"].hide(); + me["BLEED-xbleedRight"].hide(); + } + + # HP valve 1 + hp_valve_state = hp_valve1_state.getValue(); + + if (hp_valve_state == 1) { + me["BLEED-HP-Valve-1"].setRotation(90 * D2R); + me["BLEED-HP-1-connection"].show(); + } else { + me["BLEED-HP-Valve-1"].setRotation(0); + me["BLEED-HP-1-connection"].hide(); + } + + if (hp_valve_state == hp_valve1.getValue()) { + me["BLEED-HP-Valve-1"].setColor(0.0509,0.7529,0.2941); + } else { + me["BLEED-HP-Valve-1"].setColor(0.7333,0.3803,0); + } + + # HP valve 2 + hp_valve_state = hp_valve2_state.getValue(); + + if (hp_valve_state == 1) { + me["BLEED-HP-Valve-2"].setRotation(90 * D2R); + me["BLEED-HP-2-connection"].show(); + } else { + me["BLEED-HP-Valve-2"].setRotation(0); + me["BLEED-HP-2-connection"].hide(); + } + + if (hp_valve_state == hp_valve2.getValue()) { + me["BLEED-HP-Valve-2"].setColor(0.0509,0.7529,0.2941); + } else { + me["BLEED-HP-Valve-2"].setColor(0.7333,0.3803,0); + } + + # ENG BLEED valve 1 + eng_valve_state = systems.PNEU.Switch.bleed1.getValue(); + bleed_valve_cur = eng_valve1.getValue(); + + if (bleed_valve_cur == 0) { + me["BLEED-ENG-1"].setRotation(0); + } else { + me["BLEED-ENG-1"].setRotation(90 * D2R); + } + + if (eng_valve_state == bleed_valve_cur) { + me["BLEED-ENG-1"].setColor(0.0509,0.7529,0.2941); + } else { + me["BLEED-ENG-1"].setColor(0.7333,0.3803,0); + } + + # APU BLEED valve + var apu_valve_state2 = apu_valve_state.getValue(); + + if (systems.APUNodes.Controls.master.getValue()) { + me["BLEED-APU-LINES"].show(); + if (apu_valve_state2 == 1) { + me["BLEED-APU-CIRCLE"].setRotation(0); + me["BLEED-APU-connectionTop"].show(); + me["BLEED-xbleedLeft"].show(); + } else { + me["BLEED-APU-CIRCLE"].setRotation(90 * D2R); + me["BLEED-APU-connectionTop"].hide(); + if (xbleed.getValue() != 1) { + me["BLEED-xbleedLeft"].hide(); + } else { + me["BLEED-xbleedLeft"].show(); + } + } + if (apuBleedNotOn.getValue() != 1) { + me["BLEED-APU-CIRCLE"].setColor(0.0509,0.7529,0.2941); + } else { + me["BLEED-APU-CIRCLE"].setColor(0.7333,0.3803,0); + } + } else { + if (xbleed.getValue() != 1) { + me["BLEED-xbleedLeft"].hide(); + } else { + me["BLEED-xbleedLeft"].show(); + } + me["BLEED-APU-LINES"].hide(); + me["BLEED-APU-connectionTop"].hide(); + } + + # ENG BLEED valve 2 + eng_valve_state = systems.PNEU.Switch.bleed2.getValue(); + bleed_valve_cur = eng_valve2.getValue(); + + if (bleed_valve_cur == 0) { + me["BLEED-ENG-2"].setRotation(0); + } else { + me["BLEED-ENG-2"].setRotation(90 * D2R); + } + + if (eng_valve_state == bleed_valve_cur) { + me["BLEED-ENG-2"].setColor(0.0509,0.7529,0.2941); + } else { + me["BLEED-ENG-2"].setColor(0.7333,0.3803,0); + } + + # Precooler inlet 1 + bmc1 = bmc1working.getValue(); + bmc2 = bmc2working.getValue(); + + if (bmc1) { + var precooler_psi = precooler1_psi.getValue(); + me["BLEED-Precooler-1-Inlet-Press"].setText(sprintf("%s", math.round(precooler_psi))); + if (precooler_psi < 4 or precooler_psi > 57) { + me["BLEED-Precooler-1-Inlet-Press"].setColor(0.7333,0.3803,0); + } else { + me["BLEED-Precooler-1-Inlet-Press"].setColor(0.0509,0.7529,0.2941); + } + } else { + me["BLEED-Precooler-1-Inlet-Press"].setText(sprintf("%s", "XX")); + me["BLEED-Precooler-1-Inlet-Press"].setColor(0.7333,0.3803,0); + } + + # Precooler inlet 2 + if (bmc2) { + var precooler_psi = precooler2_psi.getValue(); + me["BLEED-Precooler-2-Inlet-Press"].setText(sprintf("%s", math.round(precooler_psi))); + if (precooler_psi < 4 or precooler_psi > 57) { + me["BLEED-Precooler-2-Inlet-Press"].setColor(0.7333,0.3803,0); + } else { + me["BLEED-Precooler-2-Inlet-Press"].setColor(0.0509,0.7529,0.2941); + } + } else { + me["BLEED-Precooler-2-Inlet-Press"].setText(sprintf("%s", "XX")); + me["BLEED-Precooler-2-Inlet-Press"].setColor(0.7333,0.3803,0); + } + + # Precooler outlet 1 + if (bmc1) { + var precooler_temp = precooler1_temp.getValue(); + me["BLEED-Precooler-1-Outlet-Temp"].setText(sprintf("%s", math.round(precooler_temp, 5))); + if (systems.PNEU.Switch.bleed1.getValue() and (precooler_temp < 150 or precooler1_ovht.getValue())) { + me["BLEED-Precooler-1-Outlet-Temp"].setColor(0.7333,0.3803,0); + } else { + me["BLEED-Precooler-1-Outlet-Temp"].setColor(0.0509,0.7529,0.2941); + } + } else { + me["BLEED-Precooler-1-Outlet-Temp"].setText(sprintf("%s", "XX")); + me["BLEED-Precooler-1-Outlet-Temp"].setColor(0.7333,0.3803,0); + } + + # Precooler outlet 2 + if (bmc2) { + var precooler_temp = precooler2_temp.getValue(); + me["BLEED-Precooler-2-Outlet-Temp"].setText(sprintf("%s", math.round(precooler_temp, 5))); + if (systems.PNEU.Switch.bleed2.getValue() and (precooler_temp < 150 or precooler2_ovht.getValue())) { + me["BLEED-Precooler-2-Outlet-Temp"].setColor(0.7333,0.3803,0); + } else { + me["BLEED-Precooler-2-Outlet-Temp"].setColor(0.0509,0.7529,0.2941); + } + } else { + me["BLEED-Precooler-2-Outlet-Temp"].setText(sprintf("%s", "XX")); + me["BLEED-Precooler-2-Outlet-Temp"].setColor(0.7333,0.3803,0); + } + + # GND air + if (pts.Gear.wow[1].getValue()) { + me["BLEED-GND"].show(); + } else { + me["BLEED-GND"].hide(); + } + + # WING ANTI ICE + if (switch_wing_aice.getValue()) { + me["BLEED-Anti-Ice-Left"].show(); + me["BLEED-Anti-Ice-Right"].show(); + } else { + me["BLEED-Anti-Ice-Left"].hide(); + me["BLEED-Anti-Ice-Right"].hide(); + } + + # ENG 1 label + 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 (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); + } + + # PACK 1 ----------------------------------------- + packValveState = systems.PNEU.Valves.pack1.getValue(); + me["BLEED-Pack-1-Out-Temp"].setText(sprintf("%s", math.round(systems.PNEU.Packs.pack1OutTemp.getValue(), 5))); + me["BLEED-Pack-1-Comp-Out-Temp"].setText(sprintf("%s", math.round(systems.PNEU.Packs.pack1OutletTemp.getValue(), 5))); + + if (systems.PNEU.Packs.pack1OutTemp.getValue() > 90) { + me["BLEED-Pack-1-Out-Temp"].setColor(0.7333,0.3803,0); + } else { + me["BLEED-Pack-1-Out-Temp"].setColor(0.0509,0.7529,0.2941); + } + + # `-50` cause the middel position from where we move the needle is at 50 + me["BLEED-Pack-1-Bypass-needle"].setRotation((pack1_bypass.getValue() - 50) * D2R); + + if (systems.PNEU.Packs.pack1OutletTemp.getValue() > 230) { + me["BLEED-Pack-1-Comp-Out-Temp"].setColor(0.7333,0.3803,0); + } else { + me["BLEED-Pack-1-Comp-Out-Temp"].setColor(0.0509,0.7529,0.2941); + } + + me["BLEED-Pack-1-Packflow-needle"].setRotation(systems.PNEU.Packs.packFlow1.getValue() * D2R); + + if (packValveState == 0) { + me["BLEED-Pack-1-Packflow-needle"].setColorFill(0.7333,0.3803,0); + me["BLEED-Pack-1-Flow-Valve"].setRotation(90 * D2R); + } else { + me["BLEED-Pack-1-Packflow-needle"].setColorFill(0.0509,0.7529,0.2941); + me["BLEED-Pack-1-Flow-Valve"].setRotation(0); + } + + if (packValveState == systems.PNEU.Switch.pack1.getValue()) { + me["BLEED-Pack-1-Flow-Valve"].setColor(0.0509,0.7529,0.2941); + } else { + me["BLEED-Pack-1-Flow-Valve"].setColor(0.7333,0.3803,0); + } + + # PACK 2 ----------------------------------------- + packValveState = systems.PNEU.Valves.pack2.getValue(); + me["BLEED-Pack-2-Out-Temp"].setText(sprintf("%s", math.round(systems.PNEU.Packs.pack2OutTemp.getValue(), 5))); + me["BLEED-Pack-2-Comp-Out-Temp"].setText(sprintf("%s", math.round(systems.PNEU.Packs.pack2OutletTemp.getValue(), 5))); + + if (systems.PNEU.Packs.pack2OutTemp.getValue() > 90) { + me["BLEED-Pack-2-Out-Temp"].setColor(0.7333,0.3803,0); + } else { + me["BLEED-Pack-2-Out-Temp"].setColor(0.0509,0.7529,0.2941); + } + + me["BLEED-Pack-2-Bypass-needle"].setRotation((pack2_bypass.getValue() - 50) * D2R); + + if (systems.PNEU.Packs.pack2OutletTemp.getValue() > 230) { + me["BLEED-Pack-2-Comp-Out-Temp"].setColor(0.7333,0.3803,0); + } else { + me["BLEED-Pack-2-Comp-Out-Temp"].setColor(0.0509,0.7529,0.2941); + } + + me["BLEED-Pack-2-Packflow-needle"].setRotation(systems.PNEU.Packs.packFlow2.getValue() * D2R); + + if (packValveState == 0) { + me["BLEED-Pack-2-Packflow-needle"].setColorFill(0.7333,0.3803,0); + me["BLEED-Pack-2-Flow-Valve"].setRotation(90 * D2R); + } else { + me["BLEED-Pack-2-Packflow-needle"].setColorFill(0.0509,0.7529,0.2941); + me["BLEED-Pack-2-Flow-Valve"].setRotation(0); + } + + if (packValveState == systems.PNEU.Switch.pack2.getValue()) { + me["BLEED-Pack-2-Flow-Valve"].setColor(0.0509,0.7529,0.2941); + } else { + me["BLEED-Pack-2-Flow-Valve"].setColor(0.7333,0.3803,0); + } + + # Ram Air + ramAirState = systems.PNEU.Valves.ramAir.getValue(); + if (ramAirState == 0) { + me["BLEED-Ram-Air"].setRotation(90 * D2R); + me["BLEED-Ram-Air"].setColor(0.0509,0.7529,0.2941); + me["BLEED-Ram-Air"].setColorFill(0.0509,0.7529,0.2941); + me["BLEED-Ram-Air-connection"].hide(); + } elsif (ramAirState) { + me["BLEED-Ram-Air"].setRotation(0); + if (pts.Gear.wow[1].getValue()) { + me["BLEED-Ram-Air"].setColor(0.7333,0.3803,0); + me["BLEED-Ram-Air"].setColorFill(0.7333,0.3803,0); + } else { + me["BLEED-Ram-Air"].setColor(0.0509,0.7529,0.2941); + me["BLEED-Ram-Air"].setColorFill(0.0509,0.7529,0.2941); + } + me["BLEED-Ram-Air-connection"].show(); + } else { + me["BLEED-Ram-Air"].setRotation(45 * D2R); + me["BLEED-Ram-Air"].setColor(0.7333,0.3803,0); + me["BLEED-Ram-Air"].setColorFill(0.7333,0.3803,0); + me["BLEED-Ram-Air-connection"].show(); + } + + # Triangles + if (systems.PNEU.Valves.pack1.getValue() == 0 and systems.PNEU.Valves.pack2.getValue() == 0) { + if (pts.Gear.wow[1].getValue() or ramAirState != 1) { + me["BLEED-cond-1"].setColor(0.7333,0.3803,0); + me["BLEED-cond-2"].setColor(0.7333,0.3803,0); + me["BLEED-cond-3"].setColor(0.7333,0.3803,0); + } else { + me["BLEED-cond-1"].setColor(0.0509,0.7529,0.2941); + me["BLEED-cond-2"].setColor(0.0509,0.7529,0.2941); + me["BLEED-cond-3"].setColor(0.0509,0.7529,0.2941); + } + } else { + me["BLEED-cond-1"].setColor(0.0509,0.7529,0.2941); + me["BLEED-cond-2"].setColor(0.0509,0.7529,0.2941); + me["BLEED-cond-3"].setColor(0.0509,0.7529,0.2941); + } + me.updateBottomStatus(); + }, +}; + +var canvas_lowerECAM_cond = { + new: func(canvas_group, file) { + var m = {parents: [canvas_lowerECAM_cond, canvas_lowerECAM_base]}; + m.init(canvas_group, file); + + return m; + }, + getKeys: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","CargoCond","CONDHotAirValve","CONDFanFwdFault","CONDFanAftFault", + "CONDTrimValveCKPT","CONDTrimValveAFT","CONDTrimValveFWD","CONDDuctTempCKPT","CONDDuctTempAFT","CONDDuctTempFWD","CONDTempCKPT","CONDTempAFT","CONDTempFWD"]; + }, + update: func() { + if (systems.PNEU.Valves.hotAir.getValue() == 0) { + me["CONDHotAirValve"].setRotation(90 * D2R); + if (systems.PNEU.Switch.hotAir.getBoolValue()) { + me["CONDHotAirValve"].setColor(0.7333,0.3803,0); + } else { + me["CONDHotAirValve"].setColor(0.0509,0.7529,0.2941); + } + } else { + me["CONDHotAirValve"].setRotation(0); # doesn't show rotation in transit + if (systems.PNEU.Switch.hotAir.getBoolValue()) { + me["CONDHotAirValve"].setColor(0.0509,0.7529,0.2941); + } else { + me["CONDHotAirValve"].setColor(0.7333,0.3803,0); + } + } + + me["CONDTrimValveCKPT"].setRotation(systems.PNEU.Packs.trimCockpit.getValue() * D2R); + me["CONDTrimValveAFT"].setRotation(systems.PNEU.Packs.trimAft.getValue() * D2R); + me["CONDTrimValveFWD"].setRotation(systems.PNEU.Packs.trimFwd.getValue() * D2R); + + me["CONDDuctTempCKPT"].setText(sprintf("%2.0f",math.round(systems.PNEU.Packs.cockpitDuctTemp.getValue()))); + me["CONDDuctTempAFT"].setText(sprintf("%2.0f",math.round(systems.PNEU.Packs.cabinAftDuctTemp.getValue()))); + me["CONDDuctTempFWD"].setText(sprintf("%2.0f",math.round(systems.PNEU.Packs.cabinFwdDuctTemp.getValue()))); + + me["CONDTempCKPT"].setText(sprintf("%2.0f",math.round(systems.PNEU.Packs.cockpitTemp.getValue()))); + me["CONDTempAFT"].setText(sprintf("%2.0f",math.round(systems.PNEU.Packs.cabinAftTemp.getValue()))); + me["CONDTempFWD"].setText(sprintf("%2.0f",math.round(systems.PNEU.Packs.cabinFwdTemp.getValue()))); + + # fans faults not implemented + me["CONDFanFwdFault"].hide(); + me["CONDFanAftFault"].hide(); + + # aft cargo ventilation disabled + me["CargoCond"].hide(); + me.updateBottomStatus(); + }, +}; + +var canvas_lowerECAM_crz = { + new: func(canvas_group, file) { + var m = {parents: [canvas_lowerECAM_crz, canvas_lowerECAM_base]}; + m.init(canvas_group, file); + + return m; + }, + getKeys: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","Oil1","Oil2","FUsed1","FUsed2","FUsed","VIB1N1","VIB1N2","VIB2N1","VIB2N2","deltaPSI","LDGELEV-AUTO","LDGELEV","CABVS","CABALT","VS-Arrow-UP","VS-Arrow-DN","CKPT-TEMP","FWD-TEMP","AFT-TEMP","Fused-weight-unit"]; + }, + update: func() { + + me["Oil1"].setText(sprintf("%2.1f", oil_qt1_actual.getValue())); + me["Oil2"].setText(sprintf("%2.1f", oil_qt2_actual.getValue())); + + if (acconfig_weight_kgs.getValue()) { + me["Fused-weight-unit"].setText("KG"); + me["FUsed1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue() * LBS2KGS, 10))); + me["FUsed2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue() * LBS2KGS, 10))); + me["FUsed"].setText(sprintf("%s", (math.round(fuel_used_lbs1.getValue() * LBS2KGS, 10) + math.round(fuel_used_lbs2.getValue() * LBS2KGS, 10)))); + } else { + me["Fused-weight-unit"].setText("LBS"); + me["FUsed1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue(), 10))); + me["FUsed2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue(), 10))); + me["FUsed"].setText(sprintf("%s", (math.round(fuel_used_lbs1.getValue(), 10) + math.round(fuel_used_lbs2.getValue(), 10)))); + } + + me.updateBottomStatus(); + }, +}; + +var canvas_lowerECAM_door = { + new: func(canvas_group, file) { + var m = {parents: [canvas_lowerECAM_door, canvas_lowerECAM_base]}; + m.init(canvas_group, file); + + return m; + }, + getKeys: func() { + return["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", + "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", + "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", + "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"]; + }, + update: func() { + # If you make AirBerlin or Allegiant livery add below + + if (doorL1_pos.getValue() > 0) { + me["Cabin1Left"].show(); + me["Cabin1Left"].setColor(0.7333,0.3803,0); + me["Cabin1Left"].setColorFill(0.7333,0.3803,0); + me["Cabin1LeftLbl"].show(); + me["Cabin1LeftLine"].show(); + } else { + me["Cabin1Left"].setColor(0.0509,0.7529,0.2941); + me["Cabin1Left"].setColorFill(0,0,0); + me["Cabin1LeftLbl"].hide(); + me["Cabin1LeftLine"].hide(); + } + + if (doorR1_pos.getValue() > 0) { + me["Cabin1Right"].show(); + me["Cabin1Right"].setColor(0.7333,0.3803,0); + me["Cabin1Right"].setColorFill(0.7333,0.3803,0); + me["Cabin1RightLbl"].show(); + me["Cabin1RightLine"].show(); + } else { + me["Cabin1Right"].setColor(0.0509,0.7529,0.2941); + me["Cabin1Right"].setColorFill(0,0,0); + me["Cabin1RightLbl"].hide(); + me["Cabin1RightLine"].hide(); + } + + if (doorL4_pos.getValue() > 0) { + me["Cabin4Left"].show(); + me["Cabin4Left"].setColor(0.7333,0.3803,0); + me["Cabin4Left"].setColorFill(0.7333,0.3803,0); + me["Cabin4LeftLbl"].show(); + me["Cabin4LeftLine"].show(); + } else { + me["Cabin4Left"].setColor(0.0509,0.7529,0.2941); + me["Cabin4Left"].setColorFill(0,0,0); + me["Cabin4LeftLbl"].hide(); + me["Cabin4LeftLine"].hide(); + } + + if (doorR4_pos.getValue() > 0) { + me["Cabin4Right"].show(); + me["Cabin4Right"].setColor(0.7333,0.3803,0); + me["Cabin4Right"].setColorFill(0.7333,0.3803,0); + me["Cabin4RightLbl"].show(); + me["Cabin4RightLine"].show(); + } else { + me["Cabin4Right"].setColor(0.0509,0.7529,0.2941); + me["Cabin4Right"].setColorFill(0,0,0); + me["Cabin4RightLbl"].hide(); + me["Cabin4RightLine"].hide(); + } + + if (cargobulk_pos.getValue() > 0) { + me["Bulk"].setColor(0.7333,0.3803,0); + me["Bulk"].setColorFill(0.7333,0.3803,0); + me["BulkLbl"].show(); + me["BulkLine"].show(); + } else { + me["Bulk"].setColor(0.0509,0.7529,0.2941); + me["Bulk"].setColorFill(0,0,0); + me["BulkLbl"].hide(); + me["BulkLine"].hide(); + } + + if (cargofwd_pos.getValue() > 0) { + me["Cargo1Door"].setColor(0.7333,0.3803,0); + me["Cargo1Door"].setColorFill(0.7333,0.3803,0); + me["Cargo1Lbl"].show(); + me["Cargo1Line"].show(); + } else { + me["Cargo1Door"].setColor(0.0509,0.7529,0.2941); + me["Cargo1Door"].setColorFill(0,0,0); + me["Cargo1Lbl"].hide(); + me["Cargo1Line"].hide(); + } + + if (cargoaft_pos.getValue() > 0) { + me["Cargo2Door"].setColor(0.7333,0.3803,0); + me["Cargo2Door"].setColorFill(0.7333,0.3803,0); + me["Cargo2Lbl"].show(); + me["Cargo2Line"].show(); + } else { + me["Cargo2Door"].setColor(0.0509,0.7529,0.2941); + me["Cargo2Door"].setColorFill(0,0,0); + me["Cargo2Lbl"].hide(); + me["Cargo2Line"].hide(); + } + + me["Cabin1LeftSlide"].hide(); + me["Cabin1RightSlide"].hide(); + me["Cabin2LeftSlide"].hide(); + me["Cabin2RightSlide"].hide(); + me["Cabin3LeftSlide"].hide(); + me["Cabin3RightSlide"].hide(); + me["Cabin4LeftSlide"].hide(); + me["Cabin4RightSlide"].hide(); + + me["DOOROXY-REGUL-LO-PR"].hide(); + me["AvionicsLine1"].hide(); + me["AvionicsLine2"].hide(); + me["AvionicsLbl1"].hide(); + me["AvionicsLbl2"].hide(); + me["ExitLSlide"].hide(); + me["ExitLLine"].hide(); + me["ExitLLbl"].hide(); + me["ExitRSlide"].hide(); + me["ExitRLine"].hide(); + me["ExitRLbl"].hide(); + me["Cabin1LeftSlide"].hide(); + me["Cabin1RightSlide"].hide(); + me["Cabin4LeftSlide"].hide(); + me["Cabin4RightSlide"].hide(); + me["Cabin2Left"].hide(); + me["Cabin2LeftLine"].hide(); + me["Cabin2LeftLbl"].hide(); + me["Cabin2Right"].hide(); + me["Cabin2RightLine"].hide(); + me["Cabin2RightLbl"].hide(); + me["Cabin3Left"].hide(); + me["Cabin3LeftLine"].hide(); + me["Cabin3LeftLbl"].hide(); + me["Cabin3Right"].hide(); + me["Cabin3RightLine"].hide(); + me["Cabin3RightLbl"].hide(); + + me.updateBottomStatus(); + }, +}; + +var canvas_lowerECAM_elec = { + new: func(canvas_group, file) { + var m = {parents: [canvas_lowerECAM_elec, canvas_lowerECAM_base]}; + m.init(canvas_group, file); + + return m; + }, + getKeys: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","BAT1-label","Bat1Volt","Bat1Ampere","BAT2-label","Bat2Volt","Bat2Ampere","BAT1-charge","BAT1-discharge","BAT2-charge","BAT2-discharge","ELEC-Line-DC1-DCBAT","ELEC-Line-DC1-DCESS","ELEC-Line-DC2-DCBAT", + "ELEC-Line-DC1-DCESS_DCBAT","ELEC-Line-DC2-DCESS_DCBAT","ELEC-Line-TR1-DC1","ELEC-Line-TR2-DC2","Shed-label","ELEC-Line-ESSTR-DCESS","TR1-label","TR1Volt","TR1Ampere","TR2-label","TR2Volt","TR2Ampere","EMERGEN-group","EmergenVolt","EmergenHz", + "ELEC-Line-Emergen-ESSTR","EMERGEN-Label-off","Emergen-Label","EMERGEN-out","ELEC-Line-ACESS-TRESS","ELEC-Line-AC1-TR1","ELEC-Line-AC2-TR2","ELEC-Line-AC1-ACESS","ELEC-Line-AC2-ACESS","ACESS-SHED","ACESS","AC1-in","AC2-in","ELEC-Line-GEN1-AC1","ELEC-Line-GEN2-AC2", + "ELEC-Line-APU-AC1","ELEC-Line-APU-EXT","ELEC-Line-EXT-AC2","APU-out","EXT-out","EXTPWR-group","ExtVolt","ExtHz","APU-content","APU-border","APUGentext","APUGenLoad","APUGenVolt","APUGenHz","APUGEN-off","GEN1-label","Gen1Load","Gen1Volt","Gen1Hz", + "GEN2-label","Gen2Load","GEN2-off","Gen2Volt","Gen2Hz","ELEC-IDG-1-label","ELEC-IDG-1-num-label","ELEC-IDG-1-Temp","IDG1-LOPR","IDG1-DISC","IDG1-RISE-Value","IDG1-RISE-label","GalleyShed","ELEC-IDG-2-Temp","ELEC-IDG-2-label","ELEC-IDG-2-num-label","IDG2-RISE-label","IDG2-RISE-Value","IDG2-LOPR", + "IDG2-DISC","ESSTR-group","ESSTR","ESSTR-Volt","ESSTR-Ampere","BAT1-content","BAT2-content","BAT1-OFF","BAT2-OFF","GEN1-content","GEN2-content","GEN-1-num-label","GEN-2-num-label","GEN1-off","GEN2-off","GEN1-num-label","GEN2-num-label","EXTPWR-label", + "ELEC-ACESS-SHED-label","ELEC-DCBAT-label","ELEC-DCESS-label","ELEC-DC2-label","ELEC-DC1-label","ELEC-AC1-label","ELEC-AC2-label","ELEC-ACESS-label","ELEC-Line-ESSTR-DCESS-off","ELEC-Line-Emergen-ESSTR-off"]; + }, + update: func() { + + # BAT1 + if (systems.ELEC.Switch.bat1.getValue() == 0) { + me["BAT1-OFF"].show(); + me["BAT1-content"].hide(); + me["BAT1-discharge"].hide(); + me["BAT1-charge"].hide(); + } else { + me["BAT1-OFF"].hide(); + me["BAT1-content"].show(); + me["Bat1Ampere"].setText(sprintf("%s", math.round(systems.ELEC.Source.Bat1.amps.getValue()))); + me["Bat1Volt"].setText(sprintf("%s", math.round(systems.ELEC.Source.Bat1.volt.getValue()))); + + if (systems.ELEC.Source.Bat1.volt.getValue() >= 24.95 and systems.ELEC.Source.Bat1.volt.getValue() <= 31.05) { + me["Bat1Volt"].setColor(0.0509,0.7529,0.2941); + } else { + me["Bat1Volt"].setColor(0.7333,0.3803,0); + } + + if (systems.ELEC.Source.Bat1.amps.getValue() > 5) { + me["Bat1Ampere"].setColor(0.7333,0.3803,0); + } else { + me["Bat1Ampere"].setColor(0.0509,0.7529,0.2941); + } + + if (systems.ELEC.Source.Bat1.direction.getValue() == 0) { + me["BAT1-discharge"].hide(); + me["BAT1-charge"].hide(); + } else { + if (systems.ELEC.Source.Bat1.direction.getValue() == -1) { + me["BAT1-charge"].show(); + me["BAT1-discharge"].hide(); + } else { + me["BAT1-discharge"].show(); + me["BAT1-charge"].hide(); + } + } + } + + if (systems.ELEC.Light.bat1Fault.getValue() or systems.ELEC.Source.Bat1.volt.getValue() < 25 or systems.ELEC.Source.Bat1.volt.getValue() > 31 or systems.ELEC.Source.Bat1.amps.getValue() > 5) { + me["BAT1-label"].setColor(0.7333,0.3803,0); + } else { + me["BAT1-label"].setColor(0.8078,0.8039,0.8078); + } + + # BAT2 + if (systems.ELEC.Switch.bat2.getValue() == 0) { + me["BAT2-OFF"].show(); + me["BAT2-content"].hide(); + me["BAT2-discharge"].hide(); + me["BAT2-charge"].hide(); + } else { + me["BAT2-OFF"].hide(); + me["BAT2-content"].show(); + me["Bat2Ampere"].setText(sprintf("%s", math.round(systems.ELEC.Source.Bat2.amps.getValue()))); + me["Bat2Volt"].setText(sprintf("%s", math.round(systems.ELEC.Source.Bat2.volt.getValue()))); + + if (systems.ELEC.Source.Bat2.volt.getValue() >= 24.95 and systems.ELEC.Source.Bat2.volt.getValue() <= 31.05) { + me["Bat2Volt"].setColor(0.0509,0.7529,0.2941); + } else { + me["Bat2Volt"].setColor(0.7333,0.3803,0); + } + + if (systems.ELEC.Source.Bat2.amps.getValue() > 5) { + me["Bat2Ampere"].setColor(0.7333,0.3803,0); + } else { + me["Bat2Ampere"].setColor(0.0509,0.7529,0.2941); + } + + if (systems.ELEC.Source.Bat2.direction.getValue() == 0) { + me["BAT2-discharge"].hide(); + me["BAT2-charge"].hide(); + } else { + if (systems.ELEC.Source.Bat2.direction.getValue() == -1) { + me["BAT2-charge"].show(); + me["BAT2-discharge"].hide(); + } else { + me["BAT2-discharge"].show(); + me["BAT2-charge"].hide(); + } + } + } + + if (systems.ELEC.Light.bat2Fault.getValue() or systems.ELEC.Source.Bat2.volt.getValue() < 25 or systems.ELEC.Source.Bat2.volt.getValue() > 31 or systems.ELEC.Source.Bat2.amps.getValue() > 5) { + me["BAT2-label"].setColor(0.7333,0.3803,0); + } else { + me["BAT2-label"].setColor(0.8078,0.8039,0.8078); + } + + # TR1 + # is only powered when ac1 has power + tr1_v = systems.ELEC.Source.tr1.outputVolt.getValue(); + tr1_a = systems.ELEC.Source.tr1.outputAmp.getValue(); + + me["TR1Volt"].setText(sprintf("%s", math.round(tr1_v))); + me["TR1Ampere"].setText(sprintf("%s", math.round(tr1_a))); + + if (tr1_v < 25 or tr1_v > 31 or tr1_a < 5) { + me["TR1-label"].setColor(0.7333,0.3803,0); + } else { + me["TR1-label"].setColor(0.8078,0.8039,0.8078); + } + + if (tr1_v < 25 or tr1_v > 31) { + me["TR1Volt"].setColor(0.7333,0.3803,0); + } else { + me["TR1Volt"].setColor(0.0509,0.7529,0.2941); + } + + if (tr1_a < 5) { + me["TR1Ampere"].setColor(0.7333,0.3803,0); + } else { + me["TR1Ampere"].setColor(0.0509,0.7529,0.2941); + } + + # TR2 + # is only powered when ac2 has power + tr2_v = systems.ELEC.Source.tr2.outputVolt.getValue(); + tr2_a = systems.ELEC.Source.tr2.outputAmp.getValue(); + + me["TR2Volt"].setText(sprintf("%s", math.round(tr2_v))); + me["TR2Ampere"].setText(sprintf("%s", math.round(tr2_a))); + + if (tr2_v < 25 or tr2_v > 31 or tr2_a < 5) { + me["TR2-label"].setColor(0.7333,0.3803,0); + } else { + me["TR2-label"].setColor(0.8078,0.8039,0.8078); + } + + if (tr2_v < 25 or tr2_v > 31) { + me["TR2Volt"].setColor(0.7333,0.3803,0); + } else { + me["TR2Volt"].setColor(0.0509,0.7529,0.2941); + } + + if (tr2_a < 5) { + me["TR2Ampere"].setColor(0.7333,0.3803,0); + } else { + me["TR2Ampere"].setColor(0.0509,0.7529,0.2941); + } + + # ESS TR + essTrvolts = systems.ELEC.Source.trEss.outputVoltRelay.getValue(); + essTramps = systems.ELEC.Source.trEss.outputAmpRelay.getValue(); + if (systems.ELEC.Relay.essTrContactor.getValue()) { + me["ESSTR-group"].show(); + me["ESSTR-Volt"].setText(sprintf("%s", math.round(essTrvolts))); + me["ESSTR-Ampere"].setText(sprintf("%s", math.round(essTramps))); + + if (essTrvolts < 25 or essTrvolts > 31 or essTramps < 5) { + me["ESSTR"].setColor(0.7333,0.3803,0); + } else { + me["ESSTR"].setColor(0.8078,0.8039,0.8078); + } + + if (essTrvolts < 25 or essTrvolts > 31) { + me["ESSTR-Volt"].setColor(0.7333,0.3803,0); + } else { + me["ESSTR-Volt"].setColor(0.0509,0.7529,0.2941); + } + + if (essTramps < 5) { + me["ESSTR-Ampere"].setColor(0.7333,0.3803,0); + } else { + me["ESSTR-Ampere"].setColor(0.0509,0.7529,0.2941); + } + } else { + me["ESSTR-group"].hide(); + } + + # EMER GEN + if (systems.ELEC.Source.EmerGen.volts.getValue() == 0) { + me["EMERGEN-group"].hide(); + me["ELEC-Line-Emergen-ESSTR"].hide(); + me["ELEC-Line-Emergen-ESSTR-off"].show(); + me["EMERGEN-Label-off"].show(); + } else { + me["EMERGEN-group"].show(); + me["ELEC-Line-Emergen-ESSTR"].show(); + me["ELEC-Line-Emergen-ESSTR-off"].hide(); + me["EMERGEN-Label-off"].hide(); + + me["EmergenVolt"].setText(sprintf("%s", math.round(systems.ELEC.Source.EmerGen.voltsRelay.getValue()))); + me["EmergenHz"].setText(sprintf("%s", math.round(systems.ELEC.Source.EmerGen.hertz.getValue()))); + + if (systems.ELEC.Source.EmerGen.voltsRelay.getValue() > 120 or systems.ELEC.Source.EmerGen.voltsRelay.getValue() < 110 or systems.ELEC.Source.EmerGen.hertz.getValue() > 410 or systems.ELEC.Source.EmerGen.hertz.getValue() < 390) { + me["Emergen-Label"].setColor(0.7333,0.3803,0); + } else { + me["Emergen-Label"].setColor(0.8078,0.8039,0.8078); + } + + if (systems.ELEC.Source.EmerGen.voltsRelay.getValue() > 120 or systems.ELEC.Source.EmerGen.voltsRelay.getValue() < 110) { + me["EmergenVolt"].setColor(0.7333,0.3803,0); + } else { + me["EmergenVolt"].setColor(0.0509,0.7529,0.2941); + } + + if (systems.ELEC.Source.EmerGen.hertz.getValue() > 410 or systems.ELEC.Source.EmerGen.hertz.getValue() < 390) { + me["EmergenHz"].setColor(0.7333,0.3803,0); + } else { + me["EmergenHz"].setColor(0.0509,0.7529,0.2941); + } + } + + # IDG 1 + if (!systems.ELEC.Switch.idg1Disc.getBoolValue()) { + me["IDG1-DISC"].show(); + me["ELEC-IDG-1-label"].setColor(0.7333,0.3803,0); + } else { + me["IDG1-DISC"].hide(); + me["ELEC-IDG-1-label"].setColor(0.8078,0.8039,0.8078); + } + + if (eng1_running.getValue() == 0) { + me["ELEC-IDG-1-num-label"].setColor(0.7333,0.3803,0); + } else { + me["ELEC-IDG-1-num-label"].setColor(0.8078,0.8039,0.8078); + } + + if (eng2_running.getValue() == 0) { + me["ELEC-IDG-2-num-label"].setColor(0.7333,0.3803,0); + } else { + me["ELEC-IDG-2-num-label"].setColor(0.8078,0.8039,0.8078); + } + + # IDG 2 + if (!systems.ELEC.Switch.idg2Disc.getBoolValue()) { + me["IDG2-DISC"].show(); + me["ELEC-IDG-2-label"].setColor(0.7333,0.3803,0); + } else { + me["IDG2-DISC"].hide(); + me["ELEC-IDG-2-label"].setColor(0.8078,0.8039,0.8078); + } + + # GEN1 + if (systems.ELEC.Switch.gen1.getValue() == 0) { + me["GEN1-content"].hide(); + me["GEN1-off"].show(); + if (systems.ELEC.Source.IDG1.gcrRelay.getValue()) { + me["GEN1-label"].setColor(0.7333,0.3803,0); + } else { + me["GEN1-label"].setColor(0.8078,0.8039,0.8078); + } + + if (eng1_running.getValue() == 0) { + me["GEN1-num-label"].setColor(0.7333,0.3803,0); + } else { + me["GEN1-num-label"].setColor(0.8078,0.8039,0.8078); + } + } else { + me["GEN1-content"].show(); + me["GEN1-off"].hide(); + # me["Gen1Load"].setText(sprintf("%s", math.round(gen1_load.getValue()))); + me["Gen1Volt"].setText(sprintf("%s", math.round(systems.ELEC.Source.IDG1.volts.getValue()))); + + if (systems.ELEC.Source.IDG1.hertz.getValue() == 0) { + me["Gen1Hz"].setText(sprintf("XX")); + } else { + me["Gen1Hz"].setText(sprintf("%s", math.round(systems.ELEC.Source.IDG1.hertz.getValue()))); + } + + if (eng1_running.getValue() == 0) { + me["GEN1-num-label"].setColor(0.7333,0.3803,0); + } else { + me["GEN1-num-label"].setColor(0.8078,0.8039,0.8078); + } + + if (systems.ELEC.Source.IDG1.volts.getValue() > 120 or systems.ELEC.Source.IDG1.volts.getValue() < 110 or systems.ELEC.Source.IDG1.hertz.getValue() > 410 or systems.ELEC.Source.IDG1.hertz.getValue() < 390 or gen1_load.getValue() >= 110) { + me["GEN1-label"].setColor(0.7333,0.3803,0); + } else { + me["GEN1-label"].setColor(0.8078,0.8039,0.8078); + } + + if (gen1_load.getValue() >= 110) { + me["Gen1Load"].setColor(0.7333,0.3803,0); + } else { + me["Gen1Load"].setColor(0.0509,0.7529,0.2941); + } + + if (systems.ELEC.Source.IDG1.volts.getValue() > 120 or systems.ELEC.Source.IDG1.volts.getValue() < 110) { + me["Gen1Volt"].setColor(0.7333,0.3803,0); + } else { + me["Gen1Volt"].setColor(0.0509,0.7529,0.2941); + } + + if (systems.ELEC.Source.IDG1.hertz.getValue() > 410 or systems.ELEC.Source.IDG1.hertz.getValue() < 390) { + me["Gen1Hz"].setColor(0.7333,0.3803,0); + } else { + me["Gen1Hz"].setColor(0.0509,0.7529,0.2941); + } + } + + # GEN2 + if (systems.ELEC.Switch.gen2.getValue() == 0) { + me["GEN2-content"].hide(); + me["GEN2-off"].show(); + if (systems.ELEC.Source.IDG2.gcrRelay.getValue()) { + me["GEN2-label"].setColor(0.7333,0.3803,0); + } else { + me["GEN2-label"].setColor(0.8078,0.8039,0.8078); + } + + if (eng2_running.getValue() == 0) { + me["GEN2-num-label"].setColor(0.7333,0.3803,0); + } else { + me["GEN2-num-label"].setColor(0.8078,0.8039,0.8078); + } + } else { + me["GEN2-content"].show(); + me["GEN2-off"].hide(); + # me["Gen2Load"].setText(sprintf("%s", math.round(gen2_load.getValue()))); + me["Gen2Volt"].setText(sprintf("%s", math.round(systems.ELEC.Source.IDG2.volts.getValue()))); + if (systems.ELEC.Source.IDG2.hertz.getValue() == 0) { + me["Gen2Hz"].setText(sprintf("XX")); + } else { + me["Gen2Hz"].setText(sprintf("%s", math.round(systems.ELEC.Source.IDG2.hertz.getValue()))); + } + + if (eng2_running.getValue() == 0) { + me["GEN2-num-label"].setColor(0.7333,0.3803,0); + } else { + me["GEN2-num-label"].setColor(0.8078,0.8039,0.8078); + } + + if (systems.ELEC.Source.IDG2.volts.getValue() > 120 or systems.ELEC.Source.IDG2.volts.getValue() < 110 or systems.ELEC.Source.IDG2.hertz.getValue() > 410 or systems.ELEC.Source.IDG2.hertz.getValue() < 390 or gen2_load.getValue() >= 110) { + me["GEN2-label"].setColor(0.7333,0.3803,0); + } else { + me["GEN2-label"].setColor(0.8078,0.8039,0.8078); + } + + if (gen2_load.getValue() >= 110) { + me["Gen2Load"].setColor(0.7333,0.3803,0); + } else { + me["Gen2Load"].setColor(0.0509,0.7529,0.2941); + } + + + if (systems.ELEC.Source.IDG2.volts.getValue() > 120 or systems.ELEC.Source.IDG2.volts.getValue() < 110) { + me["Gen2Volt"].setColor(0.7333,0.3803,0); + } else { + me["Gen2Volt"].setColor(0.0509,0.7529,0.2941); + } + + if (systems.ELEC.Source.IDG2.hertz.getValue() > 410 or systems.ELEC.Source.IDG2.hertz.getValue() < 390) { + me["Gen2Hz"].setColor(0.7333,0.3803,0); + } else { + me["Gen2Hz"].setColor(0.0509,0.7529,0.2941); + } + } + + # APU + if (systems.APUNodes.Controls.master.getValue() == 0) { + me["APU-content"].hide(); + me["APUGEN-off"].hide(); + me["APU-border"].hide(); + me["APUGentext"].setColor(0.8078,0.8039,0.8078); + } else { + me["APU-border"].show(); + if (systems.ELEC.Source.APU.contact.getValue() == 0) { + me["APU-content"].hide(); + me["APUGEN-off"].show(); + me["APUGentext"].setColor(0.7333,0.3803,0); + } else { + me["APU-content"].show(); + me["APUGEN-off"].hide(); + # me["APUGenLoad"].setText(sprintf("%s", math.round(apu_load.getValue()))); + me["APUGenVolt"].setText(sprintf("%s", math.round(systems.ELEC.Source.APU.volts.getValue()))); + + if (systems.ELEC.Source.APU.hertz.getValue() == 0) { + me["APUGenHz"].setText(sprintf("XX")); + } else { + me["APUGenHz"].setText(sprintf("%s", math.round(systems.ELEC.Source.APU.hertz.getValue()))); + } + + if (systems.ELEC.Source.APU.volts.getValue() > 120 or systems.ELEC.Source.APU.volts.getValue() < 110 or systems.ELEC.Source.APU.hertz.getValue() > 410 or systems.ELEC.Source.APU.hertz.getValue() < 390 or apu_load.getValue() >= 110) { + me["APUGentext"].setColor(0.7333,0.3803,0); + } else { + me["APUGentext"].setColor(0.8078,0.8039,0.8078); + } + + if(apu_load.getValue() >= 110) { + me["APUGenLoad"].setColor(0.7333,0.3803,0); + } else { + me["APUGenLoad"].setColor(0.0509,0.7529,0.2941); + } + + if (systems.ELEC.Source.APU.volts.getValue() > 120 or systems.ELEC.Source.APU.volts.getValue() < 110) { + me["APUGenVolt"].setColor(0.7333,0.3803,0); + } else { + me["APUGenVolt"].setColor(0.0509,0.7529,0.2941); + } + + if (systems.ELEC.Source.APU.hertz.getValue() > 410 or systems.ELEC.Source.APU.hertz.getValue() < 390) { + me["APUGenHz"].setColor(0.7333,0.3803,0); + } else { + me["APUGenHz"].setColor(0.0509,0.7529,0.2941); + } + } + } + + # EXT PWR + + if (switch_cart.getValue() == 0) { + me["EXTPWR-group"].hide(); + } else { + me["EXTPWR-group"].show(); + me["ExtVolt"].setText(sprintf("%s", math.round(systems.ELEC.Source.Ext.volts.getValue()))); + me["ExtHz"].setText(sprintf("%s", math.round(systems.ELEC.Source.Ext.hertz.getValue()))); + + if (systems.ELEC.Source.Ext.hertz.getValue() > 410 or systems.ELEC.Source.Ext.hertz.getValue() < 390 or systems.ELEC.Source.Ext.volts.getValue() > 120 or systems.ELEC.Source.Ext.volts.getValue() < 110) { + me["EXTPWR-label"].setColor(0.7333,0.3803,0); + } else { + me["EXTPWR-label"].setColor(0.0509,0.7529,0.2941); + } + + if (systems.ELEC.Source.Ext.hertz.getValue() > 410 or systems.ELEC.Source.Ext.hertz.getValue() < 390) { + me["ExtHz"].setColor(0.7333,0.3803,0); + } else { + me["ExtHz"].setColor(0.0509,0.7529,0.2941); + } + + if (systems.ELEC.Source.Ext.volts.getValue() > 120 or systems.ELEC.Source.Ext.volts.getValue() < 110) { + me["ExtVolt"].setColor(0.7333,0.3803,0); + } else { + me["ExtVolt"].setColor(0.0509,0.7529,0.2941); + } + } + + if (systems.ELEC.SomeThing.galley.getValue()) { + me["GalleyShed"].show(); + } else { + me["GalleyShed"].hide(); + } + + # Bus indicators + if (systems.ELEC.Switch.bat1.getValue() or systems.ELEC.Switch.bat2.getValue()) { + me["ELEC-DCBAT-label"].setText("DC BAT"); + if (systems.ELEC.Bus.dcBat.getValue() > 25) { + me["ELEC-DCBAT-label"].setColor(0.0509,0.7529,0.2941); + } else { + me["ELEC-DCBAT-label"].setColor(0.7333,0.3803,0); + } + } else { + me["ELEC-DCBAT-label"].setText("XX"); # BCL not powered hence no voltage info supplied from BCL + me["ELEC-DCBAT-label"].setColor(0.7333,0.3803,0); + } + + if (systems.ELEC.Bus.dc1.getValue() > 25) { + me["ELEC-DC1-label"].setColor(0.0509,0.7529,0.2941); + } else { + me["ELEC-DC1-label"].setColor(0.7333,0.3803,0); + } + + if (systems.ELEC.Bus.dc2.getValue() > 25) { + me["ELEC-DC2-label"].setColor(0.0509,0.7529,0.2941); + } else { + me["ELEC-DC2-label"].setColor(0.7333,0.3803,0); + } + + if (systems.ELEC.Bus.dcEss.getValue() > 25) { + me["ELEC-DCESS-label"].setColor(0.0509,0.7529,0.2941); + } else { + me["ELEC-DCESS-label"].setColor(0.7333,0.3803,0); + } + + if (systems.ELEC.Bus.acEss.getValue() >= 110) { + me["ELEC-ACESS-label"].setColor(0.0509,0.7529,0.2941); + } else { + me["ELEC-ACESS-label"].setColor(0.7333,0.3803,0); + } + + if (systems.ELEC.Bus.acEssShed.getValue() >= 110) { + me["ACESS-SHED"].hide(); + } else { + me["ACESS-SHED"].show(); + } + + if (systems.ELEC.Bus.ac1.getValue() >= 110) { + me["ELEC-AC1-label"].setColor(0.0509,0.7529,0.2941); + } else { + me["ELEC-AC1-label"].setColor(0.7333,0.3803,0); + } + + if (systems.ELEC.Bus.ac2.getValue() >= 110) { + me["ELEC-AC2-label"].setColor(0.0509,0.7529,0.2941); + } else { + me["ELEC-AC2-label"].setColor(0.7333,0.3803,0); + } + + + # Managment of the connecting lines between the components + if (systems.ELEC.Relay.apuGlc.getValue() and (systems.ELEC.Relay.acTie1.getValue() or systems.ELEC.Relay.acTie2.getValue())) { + me["APU-out"].show(); + } else { + me["APU-out"].hide(); + } + + if (systems.ELEC.Relay.extEpc.getValue() and (systems.ELEC.Relay.acTie1.getValue() or systems.ELEC.Relay.acTie2.getValue())) { + me["EXT-out"].show(); + } else { + me["EXT-out"].hide(); + } + + if (systems.ELEC.Source.IDG1.volts.getValue() >= 110 and systems.ELEC.Relay.glc1.getValue()) { + me["ELEC-Line-GEN1-AC1"].show(); + } else { + me["ELEC-Line-GEN1-AC1"].hide(); + } + + if (systems.ELEC.Source.IDG2.volts.getValue() >= 110 and systems.ELEC.Relay.glc2.getValue()) { + me["ELEC-Line-GEN2-AC2"].show(); + } else { + me["ELEC-Line-GEN2-AC2"].hide(); + } + + if (systems.ELEC.Bus.ac1.getValue() >= 110) { + me["AC1-in"].show(); + } else { + me["AC1-in"].hide(); + } + + if (systems.ELEC.Bus.ac2.getValue() >= 110) { + me["AC2-in"].show(); + } else { + me["AC2-in"].hide(); + } + + if (systems.ELEC.Relay.acTie1.getValue() and systems.ELEC.Relay.acTie2.getValue()) { + me["ELEC-Line-APU-AC1"].show(); + me["ELEC-Line-APU-EXT"].show(); + me["ELEC-Line-EXT-AC2"].show(); + } else { + if (systems.ELEC.Relay.acTie1.getValue()) { + me["ELEC-Line-APU-AC1"].show(); + } else { + me["ELEC-Line-APU-AC1"].hide(); + } + + if ((systems.ELEC.Relay.acTie2.getValue() and systems.ELEC.Relay.apuGlc.getValue() and !systems.ELEC.Relay.glc2.getValue()) or (systems.ELEC.Relay.acTie1.getValue() and systems.ELEC.Relay.extEpc.getValue() and !systems.ELEC.Relay.glc1.getValue())) { + me["ELEC-Line-APU-EXT"].show(); + } else { + me["ELEC-Line-APU-EXT"].hide(); + } + + if (systems.ELEC.Relay.acTie2.getValue()) { + me["ELEC-Line-EXT-AC2"].show(); + } else { + me["ELEC-Line-EXT-AC2"].hide(); + } + } + + if (systems.ELEC.Relay.acEssFeed1.getValue()) { + if (systems.ELEC.Bus.ac1.getValue() >= 110) { + me["ELEC-Line-AC1-ACESS"].show(); + } else { + me["ELEC-Line-AC1-ACESS"].hide(); + } + me["ELEC-Line-AC2-ACESS"].hide(); + } elsif (systems.ELEC.Relay.acEssFeed2.getValue()) { + me["ELEC-Line-AC1-ACESS"].hide(); + if (systems.ELEC.Bus.ac2.getValue() >= 110) { + me["ELEC-Line-AC2-ACESS"].show(); + } else { + me["ELEC-Line-AC2-ACESS"].hide(); + } + } else { + me["ELEC-Line-AC1-ACESS"].hide(); + me["ELEC-Line-AC2-ACESS"].hide(); + } + + if (systems.ELEC.Relay.tr1Contactor.getValue()) { + if (systems.ELEC.Bus.ac1.getValue() < 110) { + me["ELEC-Line-AC1-TR1"].setColorFill(0.7333,0.3803,0); + } else { + me["ELEC-Line-AC1-TR1"].setColorFill(0.0509,0.7529,0.2941); + } + me["ELEC-Line-AC1-TR1"].show(); + me["ELEC-Line-TR1-DC1"].show(); + } else { + me["ELEC-Line-AC1-TR1"].hide(); + me["ELEC-Line-TR1-DC1"].hide(); + } + + if (systems.ELEC.Relay.tr2Contactor.getValue()) { + if (systems.ELEC.Bus.ac2.getValue() < 110) { + me["ELEC-Line-AC2-TR2"].setColorFill(0.7333,0.3803,0); + } else { + me["ELEC-Line-AC2-TR2"].setColorFill(0.0509,0.7529,0.2941); + } + me["ELEC-Line-AC2-TR2"].show(); + me["ELEC-Line-TR2-DC2"].show(); + } else { + me["ELEC-Line-AC2-TR2"].hide(); + me["ELEC-Line-TR2-DC2"].hide(); + } + + if (systems.ELEC.Relay.dcTie1.getValue()) { + me["ELEC-Line-DC1-DCESS_DCBAT"].show(); + } else { + me["ELEC-Line-DC1-DCESS_DCBAT"].hide(); + } + + if (systems.ELEC.Relay.dcEssFeedBat.getValue()) { + me["ELEC-Line-DC1-DCESS"].show(); + } else { + me["ELEC-Line-DC1-DCESS"].hide(); + } + + if (systems.ELEC.Relay.dcEssFeedBat.getValue() or systems.ELEC.Relay.dcTie1.getValue()) { + me["ELEC-Line-DC1-DCBAT"].show(); + } else { + me["ELEC-Line-DC1-DCBAT"].hide(); + } + + if (systems.ELEC.Relay.dcTie2.getValue()) { + me["ELEC-Line-DC2-DCBAT"].show(); + me["ELEC-Line-DC2-DCESS_DCBAT"].show(); + } else { + me["ELEC-Line-DC2-DCBAT"].hide(); + me["ELEC-Line-DC2-DCESS_DCBAT"].hide(); + } + + if (systems.ELEC.Relay.acEssEmerGenFeed.getValue()) { + me["EMERGEN-out"].show(); + me["ELEC-Line-Emergen-ESSTR"].show(); + } else { + me["EMERGEN-out"].hide(); + me["ELEC-Line-Emergen-ESSTR"].hide(); + } + + if (systems.ELEC.Bus.acEss.getValue() >= 110 and !systems.ELEC.Relay.acEssEmerGenFeed.getValue() and (!systems.ELEC.Relay.tr1Contactor.getValue() or !systems.ELEC.Relay.tr2Contactor.getValue())) { + me["ELEC-Line-ACESS-TRESS"].show(); + } else { + me["ELEC-Line-ACESS-TRESS"].hide(); + } + + if (systems.ELEC.Relay.essTrContactor.getValue()) { + me["ELEC-Line-ESSTR-DCESS"].show(); + } else { + me["ELEC-Line-ESSTR-DCESS"].hide(); + } + + # hide not yet implemented items + me["IDG1-LOPR"].hide(); + me["IDG2-LOPR"].hide(); + me["Shed-label"].hide(); + me["IDG2-RISE-label"].hide(); + me["IDG2-RISE-Value"].hide(); + me["IDG1-RISE-label"].hide(); + me["IDG1-RISE-Value"].hide(); + + me.updateBottomStatus(); + }, +}; + +var canvas_lowerECAM_eng = { + new: func(canvas_group, file) { + var m = {parents: [canvas_lowerECAM_eng, canvas_lowerECAM_base]}; + m.init(canvas_group, file); + + return m; + }, + getKeys: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","OilQT1-needle","OilQT2-needle","OilQT1","OilQT2","OilQT1-decimal","OilQT2-decimal","OilPSI1-needle","OilPSI2-needle","OilPSI1","OilPSI2","FUEL-used-1","FUEL-used-2", "Fused-weight-unit"]; + }, + update: func() { + # Oil Quantity + me["OilQT1"].setText(sprintf("%s", int(oil_qt1_actual.getValue()))); + me["OilQT2"].setText(sprintf("%s", int(oil_qt2_actual.getValue()))); + me["OilQT1-decimal"].setText(sprintf("%s", int(10*math.mod(oil_qt1_actual.getValue(),1)))); + me["OilQT2-decimal"].setText(sprintf("%s", int(10*math.mod(oil_qt2_actual.getValue(),1)))); + + me["OilQT1-needle"].setRotation((oil_qt1.getValue() + 90) * D2R); + me["OilQT2-needle"].setRotation((oil_qt2.getValue() + 90) * D2R); + + # Oil Pressure + if (pts.Engines.Engine.oilPsi[0].getValue() >= 20) { + me["OilPSI1"].setColor(0.0509,0.7529,0.2941); + me["OilPSI1-needle"].setColor(0.0509,0.7529,0.2941); + } else { + me["OilPSI1"].setColor(1,0,0); + me["OilPSI1-needle"].setColor(1,0,0); + } + + if (pts.Engines.Engine.oilPsi[1].getValue() >= 20) { + me["OilPSI2"].setColor(0.0509,0.7529,0.2941); + me["OilPSI2-needle"].setColor(0.0509,0.7529,0.2941); + } else { + me["OilPSI2"].setColor(1,0,0); + me["OilPSI2-needle"].setColor(1,0,0); + } + + me["OilPSI1"].setText(sprintf("%s", math.round(pts.Engines.Engine.oilPsi[0].getValue()))); + me["OilPSI2"].setText(sprintf("%s", math.round(pts.Engines.Engine.oilPsi[1].getValue()))); + + me["OilPSI1-needle"].setRotation((oil_psi1.getValue() + 90) * D2R); + me["OilPSI2-needle"].setRotation((oil_psi2.getValue() + 90) * D2R); + + # Fuel Used + if (acconfig_weight_kgs.getValue()) { + me["FUEL-used-1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue() * LBS2KGS, 10))); + me["FUEL-used-2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue() * LBS2KGS, 10))); + me["Fused-weight-unit"].setText("KG"); + } else { + me["FUEL-used-1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue(), 10))); + me["FUEL-used-2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue(), 10))); + me["Fused-weight-unit"].setText("LBS"); + } + + me.updateBottomStatus(); + }, +}; + +var canvas_lowerECAM_fctl = { + new: func(canvas_group, file) { + var m = {parents: [canvas_lowerECAM_fctl, canvas_lowerECAM_base]}; + m.init(canvas_group, file); + + return m; + }, + getKeys: func() { + return["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","ailL","ailR","elevL","elevR","PTcc","PT","PTupdn","elac1","elac2","sec1","sec2","sec3","ailLblue","ailRblue","elevLblue","elevRblue","rudderblue","ailLgreen","ailRgreen","elevLgreen","ruddergreen","PTgreen", + "elevRyellow","rudderyellow","PTyellow","rudder","spdbrkblue","spdbrkgreen","spdbrkyellow","spoiler1Rex","spoiler1Rrt","spoiler2Rex","spoiler2Rrt","spoiler3Rex","spoiler3Rrt","spoiler4Rex","spoiler4Rrt","spoiler5Rex","spoiler5Rrt","spoiler1Lex", + "spoiler1Lrt","spoiler2Lex","spoiler2Lrt","spoiler3Lex","spoiler3Lrt","spoiler4Lex","spoiler4Lrt","spoiler5Lex","spoiler5Lrt","spoiler1Rf","spoiler2Rf","spoiler3Rf","spoiler4Rf","spoiler5Rf","spoiler1Lf","spoiler2Lf","spoiler3Lf","spoiler4Lf", + "spoiler5Lf","ailLscale","ailRscale","path4249","path4249-3","path4249-3-6-7","path4249-3-6-7-5","path4249-3-6","text4343"]; + }, + update: func() { + blue_psi = systems.HYD.Psi.blue.getValue(); + green_psi = systems.HYD.Psi.green.getValue(); + yellow_psi = systems.HYD.Psi.yellow.getValue(); + elac1Node = fbw.FBW.Computers.elac1.getValue(); + elac2Node = fbw.FBW.Computers.elac2.getValue(); + sec1Node = fbw.FBW.Computers.sec1.getValue(); + sec2Node = fbw.FBW.Computers.sec2.getValue(); + + # Pitch Trim + me["PT"].setText(sprintf("%2.1f", math.round(elevator_trim_deg.getValue(), 0.1))); + + if (math.round(elevator_trim_deg.getValue(), 0.1) >= 0) { + me["PTupdn"].setText(sprintf("UP")); + } else if (math.round(elevator_trim_deg.getValue(), 0.1) < 0) { + me["PTupdn"].setText(sprintf("DN")); + } + + if (green_psi < 1500 and yellow_psi < 1500) { + me["PT"].setColor(0.7333,0.3803,0); + me["PTupdn"].setColor(0.7333,0.3803,0); + me["PTcc"].setColor(0.7333,0.3803,0); + } else { + me["PT"].setColor(0.0509,0.7529,0.2941); + me["PTupdn"].setColor(0.0509,0.7529,0.2941); + me["PTcc"].setColor(0.0509,0.7529,0.2941); + } + + if (fbw.FBW.Failures.ths.getBoolValue()) { + me["text4343"].setColor(0.7333,0.3803,0); + } else { + me["text4343"].setColor(0.8078,0.8039,0.8078); + } + + # Ailerons + me["ailL"].setTranslation(0, aileron_ind_left.getValue() * 100); + me["ailR"].setTranslation(0, aileron_ind_right.getValue() * (-100)); + + if ((blue_psi < 1500 or !elac1Node) and (green_psi < 1500 or !elac2Node)) { + me["ailL"].setColor(0.7333,0.3803,0); + } else { + me["ailL"].setColor(0.0509,0.7529,0.2941); + } + + if ((green_psi < 1500 or !elac1Node) and (blue_psi < 1500 or !elac2Node)) { + me["ailR"].setColor(0.7333,0.3803,0); + } else { + me["ailR"].setColor(0.0509,0.7529,0.2941); + } + + # Elevators + me["elevL"].setTranslation(0, elevator_ind_left.getValue() * 100); + me["elevR"].setTranslation(0, elevator_ind_right.getValue() * 100); + + if ((blue_psi < 1500 or (!elac1Node and !sec1Node)) and (green_psi < 1500 or (!elac2Node and !sec2Node))) { + me["elevL"].setColor(0.7333,0.3803,0); + } else { + me["elevL"].setColor(0.0509,0.7529,0.2941); + } + + if ((blue_psi < 1500 or (!elac1Node and !sec1Node)) and (yellow_psi < 1500 or (!elac2Node and !sec2Node))) { + me["elevR"].setColor(0.7333,0.3803,0); + } else { + me["elevR"].setColor(0.0509,0.7529,0.2941); + } + + # Rudder + me["rudder"].setRotation(final_deg.getValue() * -0.024); + + if (blue_psi < 1500 and yellow_psi < 1500 and green_psi < 1500) { + me["rudder"].setColor(0.7333,0.3803,0); + } else { + me["rudder"].setColor(0.0509,0.7529,0.2941); + } + + # Spoilers + if (spoiler_L1.getValue() < 1.5) { + me["spoiler1Lex"].hide(); + me["spoiler1Lrt"].show(); + } else { + me["spoiler1Lrt"].hide(); + me["spoiler1Lex"].show(); + } + + if (spoiler_L2.getValue() < 1.5) { + me["spoiler2Lex"].hide(); + me["spoiler2Lrt"].show(); + } else { + me["spoiler2Lrt"].hide(); + me["spoiler2Lex"].show(); + } + + if (spoiler_L3.getValue() < 1.5) { + me["spoiler3Lex"].hide(); + me["spoiler3Lrt"].show(); + } else { + me["spoiler3Lrt"].hide(); + me["spoiler3Lex"].show(); + } + + if (spoiler_L4.getValue() < 1.5) { + me["spoiler4Lex"].hide(); + me["spoiler4Lrt"].show(); + } else { + me["spoiler4Lrt"].hide(); + me["spoiler4Lex"].show(); + } + + if (spoiler_L5.getValue() < 1.5) { + me["spoiler5Lex"].hide(); + me["spoiler5Lrt"].show(); + } else { + me["spoiler5Lrt"].hide(); + me["spoiler5Lex"].show(); + } + + if (spoiler_R1.getValue() < 1.5) { + me["spoiler1Rex"].hide(); + me["spoiler1Rrt"].show(); + } else { + me["spoiler1Rrt"].hide(); + me["spoiler1Rex"].show(); + } + + if (spoiler_R2.getValue() < 1.5) { + me["spoiler2Rex"].hide(); + me["spoiler2Rrt"].show(); + } else { + me["spoiler2Rrt"].hide(); + me["spoiler2Rex"].show(); + } + + if (spoiler_R3.getValue() < 1.5) { + me["spoiler3Rex"].hide(); + me["spoiler3Rrt"].show(); + } else { + me["spoiler3Rrt"].hide(); + me["spoiler3Rex"].show(); + } + + if (spoiler_R4.getValue() < 1.5) { + me["spoiler4Rex"].hide(); + me["spoiler4Rrt"].show(); + } else { + me["spoiler4Rrt"].hide(); + me["spoiler4Rex"].show(); + } + + if (spoiler_R5.getValue() < 1.5) { + me["spoiler5Rex"].hide(); + me["spoiler5Rrt"].show(); + } else { + me["spoiler5Rrt"].hide(); + me["spoiler5Rex"].show(); + } + + # Spoiler Fail + if (fbw.FBW.Failures.spoilerl1.getValue() or green_psi < 1500) { + me["spoiler1Lex"].setColor(0.7333,0.3803,0); + me["spoiler1Lrt"].setColor(0.7333,0.3803,0); + if (spoiler_L1.getValue() < 1.5) { + me["spoiler1Lf"].show(); + } else { + me["spoiler1Lf"].hide(); + } + } else { + me["spoiler1Lex"].setColor(0.0509,0.7529,0.2941); + me["spoiler1Lrt"].setColor(0.0509,0.7529,0.2941); + me["spoiler1Lf"].hide(); + } + + if (fbw.FBW.Failures.spoilerl2.getValue() or yellow_psi < 1500) { + me["spoiler2Lex"].setColor(0.7333,0.3803,0); + me["spoiler2Lrt"].setColor(0.7333,0.3803,0); + if (spoiler_L2.getValue() < 1.5) { + me["spoiler2Lf"].show(); + } else { + me["spoiler2Lf"].hide(); + } + } else { + me["spoiler2Lex"].setColor(0.0509,0.7529,0.2941); + me["spoiler2Lrt"].setColor(0.0509,0.7529,0.2941); + me["spoiler2Lf"].hide(); + } + + if (fbw.FBW.Failures.spoilerl3.getValue() or blue_psi < 1500) { + me["spoiler3Lex"].setColor(0.7333,0.3803,0); + me["spoiler3Lrt"].setColor(0.7333,0.3803,0); + if (spoiler_L3.getValue() < 1.5) { + me["spoiler3Lf"].show(); + } else { + me["spoiler3Lf"].hide(); + } + } else { + me["spoiler3Lex"].setColor(0.0509,0.7529,0.2941); + me["spoiler3Lrt"].setColor(0.0509,0.7529,0.2941); + me["spoiler3Lf"].hide(); + } + + if (fbw.FBW.Failures.spoilerl4.getValue() or yellow_psi < 1500) { + me["spoiler4Lex"].setColor(0.7333,0.3803,0); + me["spoiler4Lrt"].setColor(0.7333,0.3803,0); + if (spoiler_L4.getValue() < 1.5) { + me["spoiler4Lf"].show(); + } else { + me["spoiler4Lf"].hide(); + } + } else { + me["spoiler4Lex"].setColor(0.0509,0.7529,0.2941); + me["spoiler4Lrt"].setColor(0.0509,0.7529,0.2941); + me["spoiler4Lf"].hide(); + } + + if (fbw.FBW.Failures.spoilerl5.getValue() or green_psi < 1500) { + me["spoiler5Lex"].setColor(0.7333,0.3803,0); + me["spoiler5Lrt"].setColor(0.7333,0.3803,0); + if (spoiler_L5.getValue() < 1.5) { + me["spoiler5Lf"].show(); + } else { + me["spoiler5Lf"].hide(); + } + } else { + me["spoiler5Lex"].setColor(0.0509,0.7529,0.2941); + me["spoiler5Lrt"].setColor(0.0509,0.7529,0.2941); + me["spoiler5Lf"].hide(); + } + + if (fbw.FBW.Failures.spoilerr1.getValue() or green_psi < 1500) { + me["spoiler1Rex"].setColor(0.7333,0.3803,0); + me["spoiler1Rrt"].setColor(0.7333,0.3803,0); + if (spoiler_R1.getValue() < 1.5) { + me["spoiler1Rf"].show(); + } else { + me["spoiler1Rf"].hide(); + } + } else { + me["spoiler1Rex"].setColor(0.0509,0.7529,0.2941); + me["spoiler1Rrt"].setColor(0.0509,0.7529,0.2941); + me["spoiler1Rf"].hide(); + } + + if (fbw.FBW.Failures.spoilerr2.getValue() or yellow_psi < 1500) { + me["spoiler2Rex"].setColor(0.7333,0.3803,0); + me["spoiler2Rrt"].setColor(0.7333,0.3803,0); + if (spoiler_R2.getValue() < 1.5) { + me["spoiler2Rf"].show(); + } else { + me["spoiler2Rf"].hide(); + } + } else { + me["spoiler2Rex"].setColor(0.0509,0.7529,0.2941); + me["spoiler2Rrt"].setColor(0.0509,0.7529,0.2941); + me["spoiler2Rf"].hide(); + } + + if (fbw.FBW.Failures.spoilerr3.getValue() or blue_psi < 1500) { + me["spoiler3Rex"].setColor(0.7333,0.3803,0); + me["spoiler3Rrt"].setColor(0.7333,0.3803,0); + if (spoiler_R3.getValue() < 1.5) { + me["spoiler3Rf"].show(); + } else { + me["spoiler3Rf"].hide(); + } + } else { + me["spoiler3Rex"].setColor(0.0509,0.7529,0.2941); + me["spoiler3Rrt"].setColor(0.0509,0.7529,0.2941); + me["spoiler3Rf"].hide(); + } + + if (fbw.FBW.Failures.spoilerr4.getValue() or yellow_psi < 1500) { + me["spoiler4Rex"].setColor(0.7333,0.3803,0); + me["spoiler4Rrt"].setColor(0.7333,0.3803,0); + if (spoiler_R4.getValue() < 1.5) { + me["spoiler4Rf"].show(); + } else { + me["spoiler4Rf"].hide(); + } + } else { + me["spoiler4Rex"].setColor(0.0509,0.7529,0.2941); + me["spoiler4Rrt"].setColor(0.0509,0.7529,0.2941); + me["spoiler4Rf"].hide(); + } + + if (fbw.FBW.Failures.spoilerr5.getValue() or green_psi < 1500) { + me["spoiler5Rex"].setColor(0.7333,0.3803,0); + me["spoiler5Rrt"].setColor(0.7333,0.3803,0); + if (spoiler_R5.getValue() < 1.5) { + me["spoiler5Rf"].show(); + } else { + me["spoiler5Rf"].hide(); + } + } else { + me["spoiler5Rex"].setColor(0.0509,0.7529,0.2941); + me["spoiler5Rrt"].setColor(0.0509,0.7529,0.2941); + me["spoiler5Rf"].hide(); + } + + # Flight Computers + if (elac1Node) { + me["elac1"].setColor(0.0509,0.7529,0.2941); + me["path4249"].setColor(0.0509,0.7529,0.2941); + } else if (!elac1Node or fbw.FBW.Failures.elac1.getValue()) { + me["elac1"].setColor(0.7333,0.3803,0); + me["path4249"].setColor(0.7333,0.3803,0); + } + + if (elac2Node) { + me["elac2"].setColor(0.0509,0.7529,0.2941); + me["path4249-3"].setColor(0.0509,0.7529,0.2941); + } else if (!elac2Node or fbw.FBW.Failures.elac2.getValue()) { + me["elac2"].setColor(0.7333,0.3803,0); + me["path4249-3"].setColor(0.7333,0.3803,0); + } + + if (sec1Node) { + me["sec1"].setColor(0.0509,0.7529,0.2941); + me["path4249-3-6-7"].setColor(0.0509,0.7529,0.2941); + } else if (!sec1Node or fbw.FBW.Failures.sec1.getValue()) { + me["sec1"].setColor(0.7333,0.3803,0); + me["path4249-3-6-7"].setColor(0.7333,0.3803,0); + } + + if (sec2Node) { + me["sec2"].setColor(0.0509,0.7529,0.2941); + me["path4249-3-6-7-5"].setColor(0.0509,0.7529,0.2941); + } else if (!sec2Node or fbw.FBW.Failures.sec2.getValue()) { + me["sec2"].setColor(0.7333,0.3803,0); + me["path4249-3-6-7-5"].setColor(0.7333,0.3803,0); + } + + if (fbw.FBW.Computers.sec3.getValue()) { + me["sec3"].setColor(0.0509,0.7529,0.2941); + me["path4249-3-6"].setColor(0.0509,0.7529,0.2941); + } else if (!fbw.FBW.Computers.sec3.getValue() or fbw.FBW.Failures.sec3.getValue()) { + me["sec3"].setColor(0.7333,0.3803,0); + me["path4249-3-6"].setColor(0.7333,0.3803,0); + } + + # Hydraulic Indicators + if (blue_psi >= 1500) { + if (elac1Node) { + me["ailLblue"].setColor(0.0509,0.7529,0.2941); + } else { + me["ailLblue"].setColor(0.7333,0.3803,0); + } + if (elac1Node or sec1Node) { + me["elevLblue"].setColor(0.0509,0.7529,0.2941); + me["elevRblue"].setColor(0.0509,0.7529,0.2941); + } else { + me["elevLblue"].setColor(0.7333,0.3803,0); + me["elevRblue"].setColor(0.7333,0.3803,0); + } + if (elac2Node) { + me["ailRblue"].setColor(0.0509,0.7529,0.2941); + } else { + me["ailRblue"].setColor(0.7333,0.3803,0); + } + me["rudderblue"].setColor(0.0509,0.7529,0.2941); + me["spdbrkblue"].setColor(0.0509,0.7529,0.2941); + } else { + me["ailLblue"].setColor(0.7333,0.3803,0); + me["ailRblue"].setColor(0.7333,0.3803,0); + me["elevLblue"].setColor(0.7333,0.3803,0); + me["elevRblue"].setColor(0.7333,0.3803,0); + me["rudderblue"].setColor(0.7333,0.3803,0); + me["spdbrkblue"].setColor(0.7333,0.3803,0); + } + + if (green_psi >= 1500) { + if (elac2Node or sec2Node) { + me["elevLgreen"].setColor(0.0509,0.7529,0.2941); + } else { + me["elevLgreen"].setColor(0.7333,0.3803,0); + } + + if (elac2Node) { + me["ailLgreen"].setColor(0.0509,0.7529,0.2941); + } else { + me["ailLgreen"].setColor(0.7333,0.3803,0); + } + if (elac1Node) { + me["ailRgreen"].setColor(0.0509,0.7529,0.2941); + } else { + me["ailRgreen"].setColor(0.7333,0.3803,0); + } + me["ruddergreen"].setColor(0.0509,0.7529,0.2941); + me["PTgreen"].setColor(0.0509,0.7529,0.2941); + me["spdbrkgreen"].setColor(0.0509,0.7529,0.2941); + } else { + me["ailLgreen"].setColor(0.7333,0.3803,0); + me["ailRgreen"].setColor(0.7333,0.3803,0); + me["elevLgreen"].setColor(0.7333,0.3803,0); + me["ruddergreen"].setColor(0.7333,0.3803,0); + me["PTgreen"].setColor(0.7333,0.3803,0); + me["spdbrkgreen"].setColor(0.7333,0.3803,0); + } + + if (yellow_psi >= 1500) { + if (elac2Node or sec2Node) { + me["elevRyellow"].setColor(0.0509,0.7529,0.2941); + } else { + me["elevRyellow"].setColor(0.7333,0.3803,0); + } + me["rudderyellow"].setColor(0.0509,0.7529,0.2941); + me["PTyellow"].setColor(0.0509,0.7529,0.2941); + me["spdbrkyellow"].setColor(0.0509,0.7529,0.2941); + } else { + me["elevRyellow"].setColor(0.7333,0.3803,0); + me["rudderyellow"].setColor(0.7333,0.3803,0); + me["PTyellow"].setColor(0.7333,0.3803,0); + me["spdbrkyellow"].setColor(0.7333,0.3803,0); + } + + me.updateBottomStatus(); + }, +}; + +var canvas_lowerECAM_fuel = { + new: func(canvas_group, file) { + var m = {parents: [canvas_lowerECAM_fuel, canvas_lowerECAM_base]}; + m.init(canvas_group, file); + + return m; + }, + getKeys: func() { + return["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","FUEL-Pump-Left-1","FUEL-Pump-Left-2","FUEL-Pump-Center-1","FUEL-Pump-Center-2","FUEL-Pump-Right-1","FUEL-Pump-Right-2","FUEL-Left-blocked","FUEL-Right-blocked","FUEL-Center-blocked","FUEL-Left-Transfer", + "FUEL-Right-Transfer","FUEL-Left-Outer-Inacc","FUEL-Left-Inner-Inacc","FUEL-Center-Inacc","FUEL-Right-Inner-Inacc","FUEL-Right-Outer-Inacc","FUEL-Left-Outer-quantity","FUEL-Left-Inner-quantity","FUEL-Center-quantity","FUEL-Right-Inner-quantity", + "FUEL-Right-Outer-quantity","FUEL-On-Board","FUEL-Flow-per-min","FUEL-APU-arrow","FUEL-APU-line","FUEL-APU-label","FUEL-used-1","FUEL-used-both","FUEL-used-2","FUEL-ENG-Master-1","FUEL-ENG-Master-2","FUEL-XFEED","FUEL-XFEED-pipes","FUEL-Left-Outer-temp", + "FUEL-Left-Inner-temp","FUEL-Right-Inner-temp","FUEL-Right-Outer-temp","FUEL-Pump-Left-1-Closed","FUEL-Pump-Left-1-Open","FUEL-Pump-Left-2-Closed","FUEL-Pump-Left-2-Open","FUEL-Pump-Center-1-Open","FUEL-Pump-Center-1-Closed","FUEL-Pump-Center-2-Closed", + "FUEL-Pump-Center-2-Open","FUEL-Pump-Right-1-Closed","FUEL-Pump-Right-1-Open","FUEL-Pump-Right-2-Closed","FUEL-Pump-Right-2-Open","FUEL-ENG-1-label","FUEL-ENG-2-label","FUEL-ENG-1-pipe","FUEL-ENG-2-pipe","ENG1idFFlow","ENG2idFFlow","FUEL-used-1","FUEL-used-2","FUEL-used-both", + "Fused-weight-unit","FFlow-weight-unit","FOB-weight-unit"]; + }, + update: func() { + _weight_kgs = acconfig_weight_kgs.getValue(); + + if (pts.Engines.Engine.n1Actual[0].getValue() <= 18.8) { + me["ENG1idFFlow"].setColor(0.7333,0.3803,0); + me["FUEL-ENG-1-label"].setColor(0.7333,0.3803,0); + } else { + me["ENG1idFFlow"].setColor(0.8078,0.8039,0.8078); + me["FUEL-ENG-1-label"].setColor(0.8078,0.8039,0.8078); + } + + if (pts.Engines.Engine.n1Actual[1].getValue() <= 18.5) { + me["ENG2idFFlow"].setColor(0.7333,0.3803,0); + me["FUEL-ENG-2-label"].setColor(0.7333,0.3803,0); + } else { + me["ENG2idFFlow"].setColor(0.8078,0.8039,0.8078); + me["FUEL-ENG-2-label"].setColor(0.8078,0.8039,0.8078); + } + + # TODO add FOB half-boxed amber if some fuel is blocked + if (_weight_kgs == 1) + { + me["FUEL-On-Board"].setText(sprintf("%s", math.round(total_fuel_lbs.getValue() * LBS2KGS, 10))); + me["FOB-weight-unit"].setText("KG"); + } else { + me["FUEL-On-Board"].setText(sprintf("%s", math.round(total_fuel_lbs.getValue(), 10))); + me["FOB-weight-unit"].setText("LBS"); + } + + if (_weight_kgs == 1) { + me["FFlow-weight-unit"].setText("KG/MIN"); + } else { + me["FFlow-weight-unit"].setText("LBS/MIN"); + } + + if (fadec.FADEC.Power.powered1.getValue() and fadec.FADEC.Power.powered2.getValue() or fadec.FADEC.Power.powerup.getValue()) { + me["FUEL-Flow-per-min"].setColor(0.0509,0.7529,0.2941); + if (_weight_kgs == 1) { + me["FUEL-Flow-per-min"].setText(sprintf("%s", math.round(((fuel_flow1.getValue() + fuel_flow2.getValue()) * LBS2KGS) / 60, 10))); + } else { + me["FUEL-Flow-per-min"].setText(sprintf("%s", math.round((fuel_flow1.getValue() + fuel_flow2.getValue()) / 60, 10))); + } + } else { + me["FUEL-Flow-per-min"].setColor(0.7333,0.3803,0); + me["FUEL-Flow-per-min"].setText("XX"); + } + + # TODO use the valve prop and add amber if difference between eng master and valve + # TODO add transition state + if (systems.FUEL.Valves.lpValve1.getValue()) { + me["FUEL-ENG-Master-1"].setRotation(0); + me["FUEL-ENG-Master-1"].setColor(0.0509,0.7529,0.2941); + me["FUEL-ENG-Master-1"].setColorFill(0.0509,0.7529,0.2941); + me["FUEL-ENG-1-pipe"].setColor(0.0509,0.7529,0.2941); + } else { + me["FUEL-ENG-Master-1"].setRotation(90 * D2R); + me["FUEL-ENG-Master-1"].setColor(0.7333,0.3803,0); + me["FUEL-ENG-Master-1"].setColorFill(0.7333,0.3803,0); + me["FUEL-ENG-1-pipe"].setColor(0.7333,0.3803,0); + } + + # TODO use the valve prop and add amber if difference between eng master and valve + # TODO add transition state + if (systems.FUEL.Valves.lpValve2.getValue()) { + me["FUEL-ENG-Master-2"].setRotation(0); + me["FUEL-ENG-Master-2"].setColor(0.0509,0.7529,0.2941); + me["FUEL-ENG-Master-2"].setColorFill(0.0509,0.7529,0.2941); + me["FUEL-ENG-2-pipe"].setColor(0.0509,0.7529,0.2941); + } else { + me["FUEL-ENG-Master-2"].setRotation(90 * D2R); + me["FUEL-ENG-Master-2"].setColor(0.7333,0.3803,0); + me["FUEL-ENG-Master-2"].setColorFill(0.7333,0.3803,0); + me["FUEL-ENG-2-pipe"].setColor(0.7333,0.3803,0); + } + + # this is now bound to the XFEED switch + # TODO use the valve prop + # TODO add amber when disagree between switch and btn + # TODO add transition state + if (systems.FUEL.Valves.crossfeed.getBoolValue()) { + me["FUEL-XFEED"].setRotation(0); + me["FUEL-XFEED-pipes"].show(); + } else { + me["FUEL-XFEED"].setRotation(90 * D2R); + me["FUEL-XFEED-pipes"].hide(); + } + + # TODO add LO indication + if (systems.FUEL.Switches.pumpLeft1.getBoolValue()) { + me["FUEL-Pump-Left-1-Open"].show(); + me["FUEL-Pump-Left-1-Closed"].hide(); + me["FUEL-Pump-Left-1"].setColor(0.0509,0.7529,0.2941); + me["FUEL-Pump-Left-1"].setColorFill(0.0509,0.7529,0.2941); + } else { + me["FUEL-Pump-Left-1-Open"].hide(); + me["FUEL-Pump-Left-1-Closed"].show(); + me["FUEL-Pump-Left-1"].setColor(0.7333,0.3803,0); + me["FUEL-Pump-Left-1"].setColorFill(0.7333,0.3803,0); + } + + # TODO add LO indication + if (systems.FUEL.Switches.pumpLeft2.getBoolValue()) { + me["FUEL-Pump-Left-2-Open"].show(); + me["FUEL-Pump-Left-2-Closed"].hide(); + me["FUEL-Pump-Left-2"].setColor(0.0509,0.7529,0.2941); + me["FUEL-Pump-Left-2"].setColorFill(0.0509,0.7529,0.2941); + } else { + me["FUEL-Pump-Left-2-Open"].hide(); + me["FUEL-Pump-Left-2-Closed"].show(); + me["FUEL-Pump-Left-2"].setColor(0.7333,0.3803,0); + me["FUEL-Pump-Left-2"].setColorFill(0.7333,0.3803,0); + } + + # TODO add functionality to match FCOM 1.28.20 "Amber: Transfer valve is open, whereas commanded closed in automatic or manual mode" + if (systems.FUEL.Switches.pumpCenter1.getBoolValue()) { + me["FUEL-Pump-Center-1-Open"].show(); + me["FUEL-Pump-Center-1-Closed"].hide(); + me["FUEL-Pump-Center-1"].setColor(0.0509,0.7529,0.2941); + me["FUEL-Pump-Center-1"].setColorFill(0.0509,0.7529,0.2941); + } else { + me["FUEL-Pump-Center-1-Open"].hide(); + me["FUEL-Pump-Center-1-Closed"].show(); + me["FUEL-Pump-Center-1"].setColor(0.7333,0.3803,0); + me["FUEL-Pump-Center-1"].setColorFill(0.7333,0.3803,0); + } + + # TODO add LO indication + if (systems.FUEL.Switches.pumpCenter2.getBoolValue()) { + me["FUEL-Pump-Center-2-Open"].show(); + me["FUEL-Pump-Center-2-Closed"].hide(); + me["FUEL-Pump-Center-2"].setColor(0.0509,0.7529,0.2941); + me["FUEL-Pump-Center-2"].setColorFill(0.0509,0.7529,0.2941); + } else { + me["FUEL-Pump-Center-2-Open"].hide(); + me["FUEL-Pump-Center-2-Closed"].show(); + me["FUEL-Pump-Center-2"].setColor(0.7333,0.3803,0); + me["FUEL-Pump-Center-2"].setColorFill(0.7333,0.3803,0); + } + + # TODO add LO indication + if (systems.FUEL.Switches.pumpRight1.getBoolValue()) { + me["FUEL-Pump-Right-1-Open"].show(); + me["FUEL-Pump-Right-1-Closed"].hide(); + me["FUEL-Pump-Right-1"].setColor(0.0509,0.7529,0.2941); + me["FUEL-Pump-Right-1"].setColorFill(0.0509,0.7529,0.2941); + } else { + me["FUEL-Pump-Right-1-Open"].hide(); + me["FUEL-Pump-Right-1-Closed"].show(); + me["FUEL-Pump-Right-1"].setColor(0.7333,0.3803,0); + me["FUEL-Pump-Right-1"].setColorFill(0.7333,0.3803,0); + } + + # TODO add LO indication + if (systems.FUEL.Switches.pumpRight2.getBoolValue()) { + me["FUEL-Pump-Right-2-Open"].show(); + me["FUEL-Pump-Right-2-Closed"].hide(); + me["FUEL-Pump-Right-2"].setColor(0.0509,0.7529,0.2941); + me["FUEL-Pump-Right-2"].setColorFill(0.0509,0.7529,0.2941); + } else { + me["FUEL-Pump-Right-2-Open"].hide(); + me["FUEL-Pump-Right-2-Closed"].show(); + me["FUEL-Pump-Right-2"].setColor(0.7333,0.3803,0); + me["FUEL-Pump-Right-2"].setColorFill(0.7333,0.3803,0); + } + + # Fuel Used + if (_weight_kgs == 1) { + me["FUEL-used-1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue() * LBS2KGS, 10))); + me["FUEL-used-2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue() * LBS2KGS, 10))); + me["FUEL-used-both"].setText(sprintf("%s", (math.round(fuel_used_lbs1.getValue() * LBS2KGS, 10) + math.round(fuel_used_lbs2.getValue() * LBS2KGS, 10)))); + me["Fused-weight-unit"].setText("KG"); + } else { + me["FUEL-used-1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue(), 10))); + me["FUEL-used-2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue(), 10))); + me["FUEL-used-both"].setText(sprintf("%s", (math.round(fuel_used_lbs1.getValue(), 10) + math.round(fuel_used_lbs2.getValue(), 10)))); + me["Fused-weight-unit"].setText("LBS"); + } + + # Fuel Temp + me["FUEL-Left-Outer-temp"].setText(sprintf("%s", math.round(fuel_left_outer_temp.getValue()))); + me["FUEL-Left-Inner-temp"].setText(sprintf("%s", math.round(fuel_left_inner_temp.getValue()))); + me["FUEL-Right-Outer-temp"].setText(sprintf("%s", math.round(fuel_right_outer_temp.getValue()))); + me["FUEL-Right-Inner-temp"].setText(sprintf("%s", math.round(fuel_right_inner_temp.getValue()))); + + # Fuel Quantity + # TODO add LO indication + if (_weight_kgs == 1) { + me["FUEL-Left-Outer-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.leftOuter.getValue() * LBS2KGS, 10))); + me["FUEL-Left-Inner-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.leftInner.getValue() * LBS2KGS, 10))); + me["FUEL-Center-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.center.getValue() * LBS2KGS, 10))); + me["FUEL-Right-Inner-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.rightInner.getValue() * LBS2KGS, 10))); + me["FUEL-Right-Outer-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.rightOuter.getValue() * LBS2KGS, 10))); + } else { + me["FUEL-Left-Outer-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.leftOuter.getValue(), 10))); + me["FUEL-Left-Inner-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.leftInner.getValue(), 10))); + me["FUEL-Center-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.center.getValue(), 10))); + me["FUEL-Right-Inner-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.rightInner.getValue(), 10))); + me["FUEL-Right-Outer-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.rightOuter.getValue(), 10))); + } + + if (systems.FUEL.Valves.transfer1.getValue() == 0) { + me["FUEL-Left-Transfer"].hide(); + } else { + if (systems.FUEL.Valves.transfer1.getValue()) { + me["FUEL-Left-Transfer"].setColor(0.0509,0.7529,0.2941); + } else { + me["FUEL-Left-Transfer"].setColor(0.7333,0.3803,0); + } + me["FUEL-Left-Transfer"].show(); + } + + if (systems.FUEL.Valves.transfer2.getValue() == 0) { + me["FUEL-Right-Transfer"].hide(); + } else { + if (systems.FUEL.Valves.transfer2.getValue()) { + me["FUEL-Right-Transfer"].setColor(0.0509,0.7529,0.2941); + } else { + me["FUEL-Right-Transfer"].setColor(0.7333,0.3803,0); + } + me["FUEL-Right-Transfer"].show(); + } + + if (!systems.FUEL.Switches.pumpCenter1.getValue() and !systems.FUEL.Switches.pumpCenter2.getValue()) { + me["FUEL-Center-blocked"].show(); + } else { + me["FUEL-Center-blocked"].hide(); + } + + # APU + if (systems.FUEL.Valves.apu.getValue() and systems.APUNodes.Controls.master.getValue() and !systems.APUNodes.Controls.fire.getValue()) { + me["FUEL-APU-label"].setColor(0.8078, 0.8039, 0.8078); + me["FUEL-APU-line"].setColor(0.0509,0.7529,0.2941); + me["FUEL-APU-arrow"].setColor(0.0509,0.7529,0.2941); + me["FUEL-APU-line"].show(); + me["FUEL-APU-arrow"].show(); + } elsif (systems.FUEL.Valves.apu.getValue() and (!systems.APUNodes.Controls.master.getValue() or systems.APUNodes.Controls.fire.getValue())) { + me["FUEL-APU-label"].setColor(0.7333,0.3803,0); + me["FUEL-APU-line"].setColor(0.7333,0.3803,0); + me["FUEL-APU-arrow"].setColor(0.7333,0.3803,0); + me["FUEL-APU-line"].show(); + me["FUEL-APU-arrow"].show(); + } elsif (systems.FUEL.Valves.apu.getValue() != 1 and (systems.APUNodes.Controls.master.getValue() or systems.APUNodes.Controls.fire.getValue())) { + me["FUEL-APU-label"].setColor(0.7333,0.3803,0); + me["FUEL-APU-line"].hide(); + me["FUEL-APU-arrow"].hide(); + } else { + me["FUEL-APU-label"].setColor(0.8078, 0.8039, 0.8078); + me["FUEL-APU-arrow"].setColor(0.8078, 0.8039, 0.8078); + me["FUEL-APU-line"].hide(); + me["FUEL-APU-arrow"].show(); + } + + # Hide not yet implemented features + # TODO add them + me["FUEL-Left-blocked"].hide(); + me["FUEL-Right-blocked"].hide(); + me["FUEL-Left-Outer-Inacc"].hide(); + me["FUEL-Left-Inner-Inacc"].hide(); + me["FUEL-Right-Outer-Inacc"].hide(); + me["FUEL-Right-Inner-Inacc"].hide(); + me["FUEL-Center-Inacc"].hide(); + me.updateBottomStatus(); + }, +}; + +var canvas_lowerECAM_press = { + new: func(canvas_group, file) { + var m = {parents: [canvas_lowerECAM_press, canvas_lowerECAM_base]}; + m.init(canvas_group, file); + + return m; + }, + getKeys: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit", "PRESS-Cab-VS", "PRESS-Cab-VS-neg", "PRESS-Cab-Alt"]; + }, + update: func() { + me["PRESS-Cab-VS"].setText(sprintf("%4.0f", press_vs_norm.getValue())); + me["PRESS-Cab-Alt"].setText(sprintf("%4.0f", cabinalt.getValue())); + + + me.updateBottomStatus(); + }, +}; + +var canvas_lowerECAM_status = { + new: func(canvas_group, file) { + var m = {parents: [canvas_lowerECAM_status, canvas_lowerECAM_base]}; + m.init(canvas_group, file); + + return m; + }, + getKeys: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; + }, + update: func() { + + me.updateBottomStatus(); + }, +}; + +var canvas_lowerECAM_hyd = { + new: func(canvas_group, file) { + var m = {parents: [canvas_lowerECAM_hyd, canvas_lowerECAM_base]}; + m.init(canvas_group, file); + + return m; + }, + getKeys: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","Green-Indicator","Blue-Indicator","Yellow-Indicator","Press-Green","Press-Blue","Press-Yellow","Green-Line","Blue-Line","Yellow-Line","PTU-Supply-Line","PTU-supply-yellow","PTU-supply-green","PTU-connection", + "PTU-Auto-or-off","RAT-label","RAT-stowed","RAT-not-stowed","ELEC-Yellow-off","ELEC-Yellow-on","ELEC-Yellow-label","ELEC-OVTH-Yellow","ELEC-Blue-label","ELEC-OVHT-Blue","ELEC-OVHT-Yellow","Pump-Green-label","Pump-Yellow-label","Pump-Green", + "Pump-LOPR-Green","Pump-Green-off","Pump-Green-on","Pump-Yellow","Pump-LOPR-Yellow","Pump-Yellow-off","Pump-Yellow-on","Pump-Blue", "Pump-Blue-off","Pump-Blue-on","Fire-Valve-Green","Fire-Valve-Yellow","LO-AIR-PRESS-Green", + "LO-AIR-PRESS-Yellow","LO-AIR-PRESS-Blue","OVHT-Green","OVHT-Blue","OVHT-Yellow","Quantity-Indicator-Green","Quantity-Indicator-Blue","Quantity-Indicator-Yellow","Green-label","Blue-label","Yellow-label"]; + }, + update: func() { + blue_psi = systems.HYD.Psi.blue.getValue(); + green_psi = systems.HYD.Psi.green.getValue(); + yellow_psi = systems.HYD.Psi.yellow.getValue(); + + me["Press-Green"].setText(sprintf("%s", math.round(green_psi, 50))); + me["Press-Blue"].setText(sprintf("%s", math.round(blue_psi, 50))); + me["Press-Yellow"].setText(sprintf("%s", math.round(yellow_psi, 50))); + + if (blue_psi >= 1500) { + me["Blue-Line"].setColor(0.0509,0.7529,0.2941); + me["Blue-Line"].setColorFill(0.0509,0.7529,0.2941); + me["Blue-Indicator"].setColor(0.0509,0.7529,0.2941); + me["Press-Blue"].setColor(0.0509,0.7529,0.2941); + me["Blue-label"].setColor(0.8078,0.8039,0.8078); + } else { + me["Blue-Line"].setColor(0.7333,0.3803,0); + me["Blue-Line"].setColorFill(0.7333,0.3803,0); + me["Blue-Indicator"].setColor(0.7333,0.3803,0); + me["Press-Blue"].setColor(0.7333,0.3803,0); + me["Blue-label"].setColor(0.7333,0.3803,0); + } + + if (yellow_psi >= 1500) { + me["Yellow-Line"].setColor(0.0509,0.7529,0.2941); + me["Yellow-Line"].setColorFill(0.0509,0.7529,0.2941); + me["Yellow-Indicator"].setColor(0.0509,0.7529,0.2941); + me["Press-Yellow"].setColor(0.0509,0.7529,0.2941); + me["Yellow-label"].setColor(0.8078,0.8039,0.8078); + } else { + me["Yellow-Line"].setColor(0.7333,0.3803,0); + me["Yellow-Line"].setColorFill(0.7333,0.3803,0); + me["Yellow-Indicator"].setColor(0.7333,0.3803,0); + me["Press-Yellow"].setColor(0.7333,0.3803,0); + me["Yellow-label"].setColor(0.7333,0.3803,0); + } + + if (green_psi >= 1500) { + me["Green-Line"].setColor(0.0509,0.7529,0.2941); + me["Green-Line"].setColorFill(0.0509,0.7529,0.2941); + me["Green-Indicator"].setColor(0.0509,0.7529,0.2941); + me["Press-Green"].setColor(0.0509,0.7529,0.2941); + me["Green-label"].setColor(0.8078,0.8039,0.8078); + } else { + me["Green-Line"].setColor(0.7333,0.3803,0); + me["Green-Line"].setColorFill(0.7333,0.3803,0); + me["Green-Indicator"].setColor(0.7333,0.3803,0); + me["Press-Green"].setColor(0.7333,0.3803,0); + me["Green-label"].setColor(0.7333,0.3803,0); + } + + if (systems.HYD.Switch.ptu.getValue() and !systems.HYD.Fail.ptuFault.getValue()) { + me["PTU-connection"].setColor(0.0509,0.7529,0.2941); + + if (systems.HYD.Ptu.active.getValue()) { + if (systems.HYD.Ptu.diff.getValue() < 0) { + me["PTU-Supply-Line"].show(); + me["PTU-supply-yellow"].show(); + me["PTU-supply-green"].hide(); + me["PTU-Auto-or-off"].hide(); + } else { + me["PTU-Supply-Line"].show(); + me["PTU-supply-yellow"].hide(); + me["PTU-supply-green"].show(); + me["PTU-Auto-or-off"].hide(); + } + } else { + me["PTU-Auto-or-off"].setColor(0.0509,0.7529,0.2941); + me["PTU-Supply-Line"].hide(); + me["PTU-supply-yellow"].hide(); + me["PTU-supply-green"].hide(); + me["PTU-Auto-or-off"].show(); + } + } else { + me["PTU-connection"].setColor(0.7333,0.3803,0); + me["PTU-Auto-or-off"].setColor(0.7333,0.3803,0); + me["PTU-Supply-Line"].hide(); + me["PTU-supply-yellow"].hide(); + me["PTU-supply-green"].hide(); + me["PTU-Auto-or-off"].show(); + } + + 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 (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); + } + + if (systems.HYD.Switch.greenEDP.getValue()) { + me["Pump-Green-off"].hide(); + if (green_psi >= 1500) { + me["Pump-Green-on"].show(); + me["Pump-LOPR-Green"].hide(); + me["Pump-Green"].setColor(0.0509,0.7529,0.2941); + me["Pump-Green"].setColorFill(0.0509,0.7529,0.2941); + } else { + me["Pump-Green-on"].hide(); + me["Pump-LOPR-Green"].show(); + me["Pump-Green"].setColor(0.7333,0.3803,0); + me["Pump-Green"].setColorFill(0.7333,0.3803,0); + } + } else { + me["Pump-Green-off"].show(); + me["Pump-Green-on"].hide(); + me["Pump-LOPR-Green"].hide(); + me["Pump-Green"].setColor(0.7333,0.3803,0); + } + + if (systems.HYD.Switch.yellowEDP.getValue()) { + me["Pump-Yellow-off"].hide(); + if (yellow_psi >= 1500) { + me["Pump-Yellow-on"].show(); + me["Pump-LOPR-Yellow"].hide(); + me["Pump-Yellow"].setColorFill(0.0509,0.7529,0.2941); + me["Pump-Yellow"].setColor(0.0509,0.7529,0.2941); + } else { + me["Pump-Yellow-on"].hide(); + me["Pump-LOPR-Yellow"].show(); + me["Pump-Yellow"].setColorFill(0.7333,0.3803,0); + me["Pump-Yellow"].setColor(0.7333,0.3803,0); + } + } else { + me["Pump-Yellow-off"].show(); + me["Pump-Yellow-on"].hide(); + me["Pump-LOPR-Yellow"].hide(); + me["Pump-Yellow"].setColorFill(0.7333,0.3803,0); + me["Pump-Yellow"].setColor(0.7333,0.3803,0); + } + + if (systems.HYD.Switch.blueElec.getValue()) { + me["Pump-Blue-off"].hide(); + if (blue_psi >= 1500) { + me["Pump-Blue-on"].show(); + me["Pump-Blue-off"].hide(); + me["Pump-Blue"].setColorFill(0.0509,0.7529,0.2941); + me["Pump-Blue"].setColor(0.0509,0.7529,0.2941); + } else { + me["Pump-Blue-off"].show(); + me["Pump-Blue-on"].hide(); + me["Pump-Blue"].setColorFill(0.7333,0.3803,0); + me["Pump-Blue"].setColor(0.7333,0.3803,0); + } + } else { + me["Pump-Blue-off"].show(); + me["Pump-Blue-on"].hide(); + me["Pump-Blue"].setColorFill(0.7333,0.3803,0); + me["Pump-Blue"].setColor(0.7333,0.3803,0); + } + + if (!systems.HYD.Switch.yellowElec.getValue()) { + me["ELEC-Yellow-on"].hide(); + me["ELEC-Yellow-off"].show(); + } else { + me["ELEC-Yellow-on"].show(); + me["ELEC-Yellow-off"].hide(); + if (yellow_psi >= 1500) { + me["ELEC-Yellow-on"].setColor(0.0509,0.7529,0.2941); + } else { + me["ELEC-Yellow-on"].setColor(0.7333,0.3803,0); + } + } + + if (y_resv_lo_air_press.getValue()) { + me["LO-AIR-PRESS-Yellow"].show(); + } else { + me["LO-AIR-PRESS-Yellow"].hide(); + } + + if (b_resv_lo_air_press.getValue()) { + me["LO-AIR-PRESS-Blue"].show(); + } else { + me["LO-AIR-PRESS-Blue"].hide(); + } + + if (g_resv_lo_air_press.getValue()) { + me["LO-AIR-PRESS-Green"].show(); + } else { + me["LO-AIR-PRESS-Green"].hide(); + } + + if (elec_pump_y_ovht.getValue()) { + me["ELEC-OVHT-Yellow"].show(); + } else { + me["ELEC-OVHT-Yellow"].hide(); + } + + if (elec_pump_b_ovht.getValue()) { + me["ELEC-OVHT-Blue"].show(); + } else { + me["ELEC-OVHT-Blue"].hide(); + } + + if (systems.HYD.Rat.position.getValue()) { + me["RAT-stowed"].hide(); + me["RAT-not-stowed"].show(); + } else { + me["RAT-stowed"].show(); + me["RAT-not-stowed"].hide(); + } + + if (y_resv_ovht.getValue()) { + me["OVHT-Yellow"].show(); + } else { + me["OVHT-Yellow"].hide(); + } + + if (b_resv_ovht.getValue()) { + me["OVHT-Green"].show(); + } else { + me["OVHT-Green"].hide(); + } + + if (g_resv_ovht.getValue()) { + me["OVHT-Blue"].show(); + } else { + me["OVHT-Blue"].hide(); + } + + if (systems.ELEC.Bus.ac1.getValue() >= 110) { + me["ELEC-Blue-label"].setColor(0.8078,0.8039,0.8078); + } else { + me["ELEC-Blue-label"].setColor(0.7333,0.3803,0); + } + + if (systems.ELEC.Bus.ac2.getValue() >= 110) { + me["ELEC-Yellow-label"].setColor(0.8078,0.8039,0.8078); + } else { + me["ELEC-Yellow-label"].setColor(0.7333,0.3803,0); + } + + if (systems.HYD.Valve.yellowFire.getValue() != 0) { + me["Fire-Valve-Yellow"].setColor(0.7333,0.3803,0); + me["Fire-Valve-Yellow"].setRotation(90 * D2R); + } else { + me["Fire-Valve-Yellow"].setColor(0.0509,0.7529,0.2941); + me["Fire-Valve-Yellow"].setRotation(0); + } + + if (systems.HYD.Valve.greenFire.getValue() != 0) { + me["Fire-Valve-Green"].setColor(0.7333,0.3803,0); + me["Fire-Valve-Green"].setRotation(90 * D2R); + } else { + me["Fire-Valve-Green"].setColor(0.0509,0.7529,0.2941); + me["Fire-Valve-Green"].setRotation(0); + } + + me.updateBottomStatus(); + }, +}; + +var canvas_lowerECAM_wheel = { + new: func(canvas_group, file) { + var m = {parents: [canvas_lowerECAM_wheel, canvas_lowerECAM_base]}; + m.init(canvas_group, file); + + return m; + }, + getKeys: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","lgctltext","NORMbrk","NWStext","leftdoor","rightdoor","nosegeardoorL","nosegeardoorR", + "autobrk","autobrkind","NWS","NWSrect","normbrk-rect","altnbrk","normbrkhyd","spoiler1Rex","spoiler1Rrt","spoiler2Rex","spoiler2Rrt","spoiler3Rex", + "spoiler3Rrt","spoiler4Rex","spoiler4Rrt","spoiler5Rex","spoiler5Rrt","spoiler1Lex","spoiler1Lrt","spoiler2Lex","spoiler2Lrt", + "spoiler3Lex","spoiler3Lrt","spoiler4Lex","spoiler4Lrt","spoiler5Lex","spoiler5Lrt","spoiler1Rf","spoiler2Rf","spoiler3Rf","spoiler4Rf","spoiler5Rf", + "spoiler1Lf","spoiler2Lf","spoiler3Lf","spoiler4Lf","spoiler5Lf","ALTNbrk","altnbrkhyd","altnbrk-rect","antiskidtext","brakearrow","accupress_text", + "accuonlyarrow","accuonly","braketemp1","normbrkhyd","braketemp2","braketemp3","braketemp4","toparc1","toparc2","toparc3","toparc4","leftuplock", + "noseuplock","rightuplock","Triangle-Left1","Triangle-Left2","Triangle-Nose1","Triangle-Nose2","Triangle-Right1","Triangle-Right2","BSCUrect1", + "BSCUrect2","BSCU1","BSCU2","tirepress1","tirepress2","tirepress3","tirepress4","tirepress5","tirepress6"]; + }, + update: func() { + blue_psi = systems.HYD.Psi.blue.getValue(); + green_psi = systems.HYD.Psi.green.getValue(); + yellow_psi = systems.HYD.Psi.yellow.getValue(); + autobrakemode = autobreak_mode.getValue(); + nosegear = gear1_pos.getValue(); + leftgear = gear2_pos.getValue(); + rightgear = gear3_pos.getValue(); + leftdoor = gear_door_L.getValue(); + rightdoor = gear_door_R.getValue(); + nosedoor = gear_door_N.getValue(); + gearlvr = gear_down.getValue(); + askidsw = systems.HYD.Switch.nwsSwitch.getBoolValue(); + brakemode = systems.HYD.Brakes.mode.getBoolValue(); + accum = systems.HYD.Brakes.accumPressPsi.getBoolValue(); + + # L/G CTL + if ((leftgear == 0 or nosegear == 0 or rightgear == 0 and gearlvr == 0) or (leftgear == 1 or nosegear == 1 or rightgear == 1 and gearlvr == 1)) { + me["lgctltext"].hide(); + } else { + me["lgctltext"].show(); + } + + # NWS / Antiskid / Brakes + if (askidsw and yellow_psi >= 1500) { + me["NWStext"].hide(); + me["NWS"].hide(); + me["NWSrect"].hide(); + me["antiskidtext"].hide(); + me["BSCUrect1"].hide(); + me["BSCUrect2"].hide(); + me["BSCU1"].hide(); + me["BSCU2"].hide(); + } else if (!askidsw and yellow_psi >= 1500) { + me["NWStext"].show(); + me["NWS"].show(); + me["NWS"].setColor(0.0509,0.7529,0.2941); + me["NWSrect"].show(); + me["antiskidtext"].show(); + me["antiskidtext"].setColor(0.7333,0.3803,0); + me["BSCUrect1"].show(); + me["BSCUrect2"].show(); + me["BSCU1"].show(); + me["BSCU2"].show(); + } else { + me["NWStext"].show(); + me["NWS"].show(); + me["NWS"].setColor(0.7333,0.3803,0); + me["NWSrect"].show(); + me["antiskidtext"].show(); + me["antiskidtext"].setColor(0.7333,0.3803,0); + me["BSCUrect1"].show(); + me["BSCUrect2"].show(); + me["BSCU1"].show(); + me["BSCU2"].show(); + } + + if (green_psi >= 1500 and brakemode == 1) { + me["NORMbrk"].hide(); + me["normbrk-rect"].hide(); + me["normbrkhyd"].hide(); + } else if (green_psi >= 1500 and askidsw) { + me["NORMbrk"].show(); + me["normbrk-rect"].show(); + me["NORMbrk"].setColor(0.7333,0.3803,0); + me["normbrkhyd"].setColor(0.0509,0.7529,0.2941); + } else if (green_psi < 1500 or !askidsw) { + me["NORMbrk"].show(); + me["normbrk-rect"].show(); + me["NORMbrk"].setColor(0.7333,0.3803,0); + me["normbrkhyd"].setColor(0.7333,0.3803,0); + } + + if (brakemode != 2) { + me["ALTNbrk"].hide(); + me["altnbrk-rect"].hide(); + me["altnbrkhyd"].hide(); + } else if (yellow_psi >= 1500) { + me["ALTNbrk"].show(); + me["altnbrk-rect"].show(); + me["altnbrkhyd"].setColor(0.0509,0.7529,0.2941); + } else { + me["ALTNbrk"].show(); + me["altnbrk-rect"].show(); + me["altnbrkhyd"].setColor(0.7333,0.3803,0); + } + + if (brakemode == 2 and accum < 200 and yellow_psi < 1500) { + me["accupress_text"].show(); + me["brakearrow"].hide(); + me["accupress_text"].setColor(0.7333,0.3803,0); + } else if (brakemode == 2 and accum > 200 and yellow_psi >= 1500){ + me["accupress_text"].show(); + me["brakearrow"].show(); + me["accupress_text"].setColor(0.0509,0.7529,0.2941); + } else if (brakemode == 2 and accum > 200 and yellow_psi < 1500) { + me["accuonlyarrow"].show(); + me["accuonly"].show(); + me["brakearrow"].hide(); + me["accupress_text"].hide(); + } else { + me["accuonlyarrow"].hide(); + me["accuonly"].hide(); + me["brakearrow"].hide(); + me["accupress_text"].hide(); + } + + # Gear Doors + me["leftdoor"].setRotation(door_left.getValue() * D2R); + me["rightdoor"].setRotation(door_right.getValue() * D2R); + me["nosegeardoorL"].setRotation(door_nose_left.getValue() * D2R); + me["nosegeardoorR"].setRotation(door_nose_right.getValue() * D2R); + + if (nosedoor == 0) { + me["nosegeardoorL"].setColorFill(0.0509,0.7529,0.2941); + me["nosegeardoorR"].setColorFill(0.0509,0.7529,0.2941); + } else { + me["nosegeardoorL"].setColorFill(0.7333,0.3803,0); + me["nosegeardoorR"].setColorFill(0.7333,0.3803,0); + } + + if (leftdoor == 0) { + me["leftdoor"].setColorFill(0.0509,0.7529,0.2941); + } else { + me["leftdoor"].setColorFill(0.7333,0.3803,0); + } + + if (rightdoor == 0) { + me["rightdoor"].setColorFill(0.0509,0.7529,0.2941); + } else { + me["rightdoor"].setColorFill(0.7333,0.3803,0); + } + + # Triangles + if (leftgear < 0.2 or leftgear > 0.8) { + me["Triangle-Left1"].hide(); + me["Triangle-Left2"].hide(); + } else { + me["Triangle-Left1"].show(); + me["Triangle-Left2"].show(); + } + + if (leftgear == 1) { + me["Triangle-Left1"].setColor(0.0509,0.7529,0.2941); + me["Triangle-Left2"].setColor(0.0509,0.7529,0.2941); + } else { + me["Triangle-Left1"].setColor(1,0,0); + me["Triangle-Left2"].setColor(1,0,0); + } + + if (nosegear < 0.2 or nosegear > 0.8) { + me["Triangle-Nose1"].hide(); + me["Triangle-Nose2"].hide(); + } else { + me["Triangle-Nose1"].show(); + me["Triangle-Nose2"].show(); + } + + if (nosegear == 1) { + me["Triangle-Nose1"].setColor(0.0509,0.7529,0.2941); + me["Triangle-Nose2"].setColor(0.0509,0.7529,0.2941); + } else { + me["Triangle-Nose1"].setColor(1,0,0); + me["Triangle-Nose2"].setColor(1,0,0); + } + + if (rightgear < 0.2 or rightgear > 0.8) { + me["Triangle-Right1"].hide(); + me["Triangle-Right2"].hide(); + } else { + me["Triangle-Right1"].show(); + me["Triangle-Right2"].show(); + } + + if (rightgear == 1) { + me["Triangle-Right1"].setColor(0.0509,0.7529,0.2941); + me["Triangle-Right2"].setColor(0.0509,0.7529,0.2941); + } else { + me["Triangle-Right1"].setColor(1,0,0); + me["Triangle-Right2"].setColor(1,0,0); + } + + # Autobrake + if (autobrakemode == 0) { + me["autobrkind"].hide(); + } elsif (autobrakemode == 1) { + me["autobrkind"].show(); + me["autobrkind"].setText(sprintf("%s", "LO")); + } elsif (autobrakemode == 2) { + me["autobrkind"].show(); + me["autobrkind"].setText(sprintf("%s", "MED")); + } elsif (autobrakemode == 3) { + me["autobrkind"].show(); + me["autobrkind"].setText(sprintf("%s", "MAX")); + } + + if (autobrakemode != 0) { + me["autobrk"].show(); + } elsif (autobrakemode == 0) { + me["autobrk"].hide(); + } + + # Spoilers + if (spoiler_L1.getValue() < 1.5) { + me["spoiler1Lex"].hide(); + me["spoiler1Lrt"].show(); + } else { + me["spoiler1Lrt"].hide(); + me["spoiler1Lex"].show(); + } + + if (spoiler_L2.getValue() < 1.5) { + me["spoiler2Lex"].hide(); + me["spoiler2Lrt"].show(); + } else { + me["spoiler2Lrt"].hide(); + me["spoiler2Lex"].show(); + } + + if (spoiler_L3.getValue() < 1.5) { + me["spoiler3Lex"].hide(); + me["spoiler3Lrt"].show(); + } else { + me["spoiler3Lrt"].hide(); + me["spoiler3Lex"].show(); + } + + if (spoiler_L4.getValue() < 1.5) { + me["spoiler4Lex"].hide(); + me["spoiler4Lrt"].show(); + } else { + me["spoiler4Lrt"].hide(); + me["spoiler4Lex"].show(); + } + + if (spoiler_L5.getValue() < 1.5) { + me["spoiler5Lex"].hide(); + me["spoiler5Lrt"].show(); + } else { + me["spoiler5Lrt"].hide(); + me["spoiler5Lex"].show(); + } + + if (spoiler_R1.getValue() < 1.5) { + me["spoiler1Rex"].hide(); + me["spoiler1Rrt"].show(); + } else { + me["spoiler1Rrt"].hide(); + me["spoiler1Rex"].show(); + } + + if (spoiler_R2.getValue() < 1.5) { + me["spoiler2Rex"].hide(); + me["spoiler2Rrt"].show(); + } else { + me["spoiler2Rrt"].hide(); + me["spoiler2Rex"].show(); + } + + if (spoiler_R3.getValue() < 1.5) { + me["spoiler3Rex"].hide(); + me["spoiler3Rrt"].show(); + } else { + me["spoiler3Rrt"].hide(); + me["spoiler3Rex"].show(); + } + + if (spoiler_R4.getValue() < 1.5) { + me["spoiler4Rex"].hide(); + me["spoiler4Rrt"].show(); + } else { + me["spoiler4Rrt"].hide(); + me["spoiler4Rex"].show(); + } + + if (spoiler_R5.getValue() < 1.5) { + me["spoiler5Rex"].hide(); + me["spoiler5Rrt"].show(); + } else { + me["spoiler5Rrt"].hide(); + me["spoiler5Rex"].show(); + } + + # Spoiler Fail + if (fbw.FBW.Failures.spoilerl1.getValue() or green_psi < 1500) { + me["spoiler1Lex"].setColor(0.7333,0.3803,0); + me["spoiler1Lrt"].setColor(0.7333,0.3803,0); + if (spoiler_L1.getValue() < 1.5) { + me["spoiler1Lf"].show(); + } else { + me["spoiler1Lf"].hide(); + } + } else { + me["spoiler1Lex"].setColor(0.0509,0.7529,0.2941); + me["spoiler1Lrt"].setColor(0.0509,0.7529,0.2941); + me["spoiler1Lf"].hide(); + } + + if (fbw.FBW.Failures.spoilerl2.getValue() or yellow_psi < 1500) { + me["spoiler2Lex"].setColor(0.7333,0.3803,0); + me["spoiler2Lrt"].setColor(0.7333,0.3803,0); + if (spoiler_L2.getValue() < 1.5) { + me["spoiler2Lf"].show(); + } else { + me["spoiler2Lf"].hide(); + } + } else { + me["spoiler2Lex"].setColor(0.0509,0.7529,0.2941); + me["spoiler2Lrt"].setColor(0.0509,0.7529,0.2941); + me["spoiler2Lf"].hide(); + } + + if (fbw.FBW.Failures.spoilerl3.getValue() or blue_psi < 1500) { + me["spoiler3Lex"].setColor(0.7333,0.3803,0); + me["spoiler3Lrt"].setColor(0.7333,0.3803,0); + if (spoiler_L3.getValue() < 1.5) { + me["spoiler3Lf"].show(); + } else { + me["spoiler3Lf"].hide(); + } + } else { + me["spoiler3Lex"].setColor(0.0509,0.7529,0.2941); + me["spoiler3Lrt"].setColor(0.0509,0.7529,0.2941); + me["spoiler3Lf"].hide(); + } + + if (fbw.FBW.Failures.spoilerl4.getValue() or yellow_psi < 1500) { + me["spoiler4Lex"].setColor(0.7333,0.3803,0); + me["spoiler4Lrt"].setColor(0.7333,0.3803,0); + if (spoiler_L4.getValue() < 1.5) { + me["spoiler4Lf"].show(); + } else { + me["spoiler4Lf"].hide(); + } + } else { + me["spoiler4Lex"].setColor(0.0509,0.7529,0.2941); + me["spoiler4Lrt"].setColor(0.0509,0.7529,0.2941); + me["spoiler4Lf"].hide(); + } + + if (fbw.FBW.Failures.spoilerl5.getValue() or green_psi < 1500) { + me["spoiler5Lex"].setColor(0.7333,0.3803,0); + me["spoiler5Lrt"].setColor(0.7333,0.3803,0); + if (spoiler_L5.getValue() < 1.5) { + me["spoiler5Lf"].show(); + } else { + me["spoiler5Lf"].hide(); + } + } else { + me["spoiler5Lex"].setColor(0.0509,0.7529,0.2941); + me["spoiler5Lrt"].setColor(0.0509,0.7529,0.2941); + me["spoiler5Lf"].hide(); + } + + if (fbw.FBW.Failures.spoilerr1.getValue() or green_psi < 1500) { + me["spoiler1Rex"].setColor(0.7333,0.3803,0); + me["spoiler1Rrt"].setColor(0.7333,0.3803,0); + if (spoiler_R1.getValue() < 1.5) { + me["spoiler1Rf"].show(); + } else { + me["spoiler1Rf"].hide(); + } + } else { + me["spoiler1Rex"].setColor(0.0509,0.7529,0.2941); + me["spoiler1Rrt"].setColor(0.0509,0.7529,0.2941); + me["spoiler1Rf"].hide(); + } + + if (fbw.FBW.Failures.spoilerr2.getValue() or yellow_psi < 1500) { + me["spoiler2Rex"].setColor(0.7333,0.3803,0); + me["spoiler2Rrt"].setColor(0.7333,0.3803,0); + if (spoiler_R2.getValue() < 1.5) { + me["spoiler2Rf"].show(); + } else { + me["spoiler2Rf"].hide(); + } + } else { + me["spoiler2Rex"].setColor(0.0509,0.7529,0.2941); + me["spoiler2Rrt"].setColor(0.0509,0.7529,0.2941); + me["spoiler2Rf"].hide(); + } + + if (fbw.FBW.Failures.spoilerr3.getValue() or blue_psi < 1500) { + me["spoiler3Rex"].setColor(0.7333,0.3803,0); + me["spoiler3Rrt"].setColor(0.7333,0.3803,0); + if (spoiler_R3.getValue() < 1.5) { + me["spoiler3Rf"].show(); + } else { + me["spoiler3Rf"].hide(); + } + } else { + me["spoiler3Rex"].setColor(0.0509,0.7529,0.2941); + me["spoiler3Rrt"].setColor(0.0509,0.7529,0.2941); + me["spoiler3Rf"].hide(); + } + + if (fbw.FBW.Failures.spoilerr4.getValue() or yellow_psi < 1500) { + me["spoiler4Rex"].setColor(0.7333,0.3803,0); + me["spoiler4Rrt"].setColor(0.7333,0.3803,0); + if (spoiler_R4.getValue() < 1.5) { + me["spoiler4Rf"].show(); + } else { + me["spoiler4Rf"].hide(); + } + } else { + me["spoiler4Rex"].setColor(0.0509,0.7529,0.2941); + me["spoiler4Rrt"].setColor(0.0509,0.7529,0.2941); + me["spoiler4Rf"].hide(); + } + + if (fbw.FBW.Failures.spoilerr5.getValue() or green_psi < 1500) { + me["spoiler5Rex"].setColor(0.7333,0.3803,0); + me["spoiler5Rrt"].setColor(0.7333,0.3803,0); + if (spoiler_R5.getValue() < 1.5) { + me["spoiler5Rf"].show(); + } else { + me["spoiler5Rf"].hide(); + } + } else { + me["spoiler5Rex"].setColor(0.0509,0.7529,0.2941); + me["spoiler5Rrt"].setColor(0.0509,0.7529,0.2941); + me["spoiler5Rf"].hide(); + } + + # Show Brakes temperature + if (L1BrakeTempc.getValue() > 300) { + me["braketemp1"].setColor(0.7333,0.3803,0); + } else { + me["braketemp1"].setColor(0.0509,0.7529,0.2941); + } + + if (L2BrakeTempc.getValue() > 300) { + me["braketemp2"].setColor(0.7333,0.3803,0); + } else { + me["braketemp2"].setColor(0.0509,0.7529,0.2941); + } + if (R3BrakeTempc.getValue() > 300) { + me["braketemp3"].setColor(0.7333,0.3803,0); + } else { + me["braketemp3"].setColor(0.0509,0.7529,0.2941); + } + if (R4BrakeTempc.getValue() > 300) { + me["braketemp4"].setColor(0.7333,0.3803,0); + } else { + me["braketemp4"].setColor(0.0509,0.7529,0.2941); + } + + # Brake arcs + if (L1BrakeTempc.getValue() > 300) { + me["toparc1"].setColor(0.7333,0.3803,0); + } else + { + if (L1BrakeTempc.getValue() > 100 and L1BrakeTempc.getValue() < 300) + { + me["toparc1"].setColor(0.0509,0.7529,0.2941); + } + else { + me["toparc1"].setColor(0.8078,0.8039,0.8078); + } + } + if (L2BrakeTempc.getValue() > 300) { + me["toparc2"].setColor(0.7333,0.3803,0); + } else + { + if (L2BrakeTempc.getValue() > 100 and L2BrakeTempc.getValue() < 300) + { + me["toparc2"].setColor(0.0509,0.7529,0.2941); + } + else { + me["toparc2"].setColor(0.8078,0.8039,0.8078); + } + } + if (R3BrakeTempc.getValue() > 300) { + me["toparc3"].setColor(0.7333,0.3803,0); + } else + { + if (R3BrakeTempc.getValue() > 100 and R3BrakeTempc.getValue() < 300) + { + me["toparc3"].setColor(0.0509,0.7529,0.2941); + } + else { + me["toparc3"].setColor(0.8078,0.8039,0.8078); + } + } + if (R4BrakeTempc.getValue() > 300) { + me["toparc4"].setColor(0.7333,0.3803,0); + } else + { + if (R4BrakeTempc.getValue() > 100 and R4BrakeTempc.getValue() < 300) + { + me["toparc4"].setColor(0.0509,0.7529,0.2941); + } + else { + me["toparc4"].setColor(0.8078,0.8039,0.8078); + } + } + me["braketemp1"].setText(sprintf("%s", math.round(L1BrakeTempc.getValue(), 1))); + me["braketemp2"].setText(sprintf("%s", math.round(L2BrakeTempc.getValue(), 1))); + me["braketemp3"].setText(sprintf("%s", math.round(R3BrakeTempc.getValue(), 1))); + me["braketemp4"].setText(sprintf("%s", math.round(R4BrakeTempc.getValue(), 1))); + me["braketemp1"].show(); + me["braketemp2"].show(); + me["braketemp3"].show(); + me["braketemp4"].show(); + me["toparc1"].show(); + me["toparc2"].show(); + me["toparc3"].show(); + me["toparc4"].show(); + + # Hide not yet implemented stuff + me["leftuplock"].hide(); + me["noseuplock"].hide(); + me["rightuplock"].hide(); + me["tirepress1"].hide(); + me["tirepress2"].hide(); + me["tirepress3"].hide(); + me["tirepress4"].hide(); + me["tirepress5"].hide(); + me["tirepress6"].hide(); + + me.updateBottomStatus(); + }, +}; + +var canvas_lowerECAM_test = { + init: func(canvas_group, file) { + var font_mapper = func(family, weight) { + return "LiberationFonts/LiberationSans-Regular.ttf"; + }; + + canvas.parsesvg(canvas_group, file, {"font-mapper": font_mapper}); + + var svg_keys = me.getKeys(); + foreach(var key; svg_keys) { + me[key] = canvas_group.getElementById(key); + } + + me.page = canvas_group; + + return me; + }, + new: func(canvas_group, file) { + var m = {parents: [canvas_lowerECAM_test]}; + m.init(canvas_group, file); + + return m; + }, + getKeys: func() { + return ["Test_white","Test_text"]; + }, + update: func() { + var elapsedtime = pts.Sim.Time.elapsedSec.getValue(); + if (du4_test_time.getValue() + 1 >= elapsedtime) { + me["Test_white"].show(); + me["Test_text"].hide(); + } else { + me["Test_white"].hide(); + me["Test_text"].show(); + } + }, +}; + +setlistener("/sim/signals/fdm-initialized", func { + lowerECAM_display = canvas.new({ + "name": "lowerECAM", + "size": [1024, 1024], + "view": [1024, 1024], + "mipmapping": 1 + }); + lowerECAM_display.addPlacement({"node": "lecam.screen"}); + var groupApu = lowerECAM_display.createGroup(); + var groupBleed = lowerECAM_display.createGroup(); + var groupCond = lowerECAM_display.createGroup(); + var groupCrz = lowerECAM_display.createGroup(); + var groupDoor = lowerECAM_display.createGroup(); + var groupElec = lowerECAM_display.createGroup(); + var groupEng = lowerECAM_display.createGroup(); + var groupFctl = lowerECAM_display.createGroup(); + var groupFuel = lowerECAM_display.createGroup(); + var groupPress = lowerECAM_display.createGroup(); + var groupStatus = lowerECAM_display.createGroup(); + var groupHyd = lowerECAM_display.createGroup(); + var groupWheel = lowerECAM_display.createGroup(); + var group_test = lowerECAM_display.createGroup(); + + lowerECAM_apu = canvas_lowerECAM_apu.new(groupApu, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/apu.svg"); + lowerECAM_bleed = canvas_lowerECAM_bleed.new(groupBleed, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/bleed.svg"); + lowerECAM_cond = canvas_lowerECAM_cond.new(groupCond, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/cond.svg"); + lowerECAM_crz = canvas_lowerECAM_crz.new(groupCrz, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/crz.svg"); + lowerECAM_door = canvas_lowerECAM_door.new(groupDoor, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/door.svg"); + lowerECAM_elec = canvas_lowerECAM_elec.new(groupElec, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/elec.svg"); + lowerECAM_eng = canvas_lowerECAM_eng.new(groupEng, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/eng.svg"); + lowerECAM_fctl = canvas_lowerECAM_fctl.new(groupFctl, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/fctl.svg"); + lowerECAM_fuel = canvas_lowerECAM_fuel.new(groupFuel, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/fuel.svg"); + lowerECAM_press = canvas_lowerECAM_press.new(groupPress, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/press.svg"); + lowerECAM_status = canvas_lowerECAM_status.new(groupStatus, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/status.svg"); + lowerECAM_hyd = canvas_lowerECAM_hyd.new(groupHyd, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/hyd.svg"); + lowerECAM_wheel = canvas_lowerECAM_wheel.new(groupWheel, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/wheel.svg"); + lowerECAM_test = canvas_lowerECAM_test.new(group_test, "Aircraft/A320-family/Models/Instruments/Common/res/du-test.svg"); + + lowerECAM_update.start(); + if (rate.getValue() > 1) { + l_rateApply(); + } +}); + +var l_rateApply = func { + lowerECAM_update.restart(0.05 * rate.getValue()); +} + +var lowerECAM_update = maketimer(0.05, func { + canvas_lowerECAM_base.update(); +}); + +var showLowerECAM = func { + var dlg = canvas.Window.new([512, 512], "dialog").set("resize", 1); + dlg.setCanvas(lowerECAM_display); +} + +setlistener("/systems/electrical/bus/ac-2", func() { + canvas_lowerECAM_base.updateDu4(); +}, 0, 0); diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index 35e6d808..fcf37cf6 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -1,180 +1,7 @@ # A3XX Lower ECAM Canvas +# Copyright (c) 2021 Josh Davidson (Octal450) and Jonathan Redpath -# Copyright (c) 2020 Josh Davidson (Octal450) - -var lowerECAM_apu = nil; -var lowerECAM_bleed = nil; -var lowerECAM_cond = nil; -var lowerECAM_crz = nil; -var lowerECAM_door = nil; -var lowerECAM_elec = nil; -var lowerECAM_eng = nil; -var lowerECAM_fctl = nil; -var lowerECAM_fuel = nil; -var lowerECAM_hyd = nil; -var lowerECAM_press = nil; -var lowerECAM_status = nil; -var lowerECAM_wheel = nil; -var lowerECAM_test = nil; -var lowerECAM_display = nil; -var page = "fctl"; -var blue_psi = 0; -var green_psi = 0; -var yellow_psi = 0; -var autobrakemode = 0; -var nosegear = 0; -var leftgear = 0; -var rightgear = 0; -var leftdoor = 0; -var rightdoor = 0; -var nosedoor = 0; -var gearlvr = 0; -var elapsedtime = 0; -var tr1_v = 0; -var tr1_a = 0; -var tr2_v = 0; -var tr2_a = 0; -var essTramps = 0; -var essTrvolts = 0; -var elac1Node = 0; -var elac2Node = 0; -var sec1Node = 0; -var sec2Node = 0; -var eng_valve_state = 0; -var bleed_valve_cur = 0; -var hp_valve_state = 0; -var xbleedcmdstate = 0; -var ramAirState = 0; - -# Conversion factor pounds to kilogram -LBS2KGS = 0.4535924; - -# Fetch Nodes -var acconfig_weight_kgs = props.globals.getNode("/systems/acconfig/options/weight-kgs", 1); -var rate = props.globals.getNode("/systems/acconfig/options/lecam-rate", 1); -var autoconfig_running = props.globals.getNode("/systems/acconfig/autoconfig-running", 1); -var lighting_du4 = props.globals.getNode("/controls/lighting/DU/du4", 1); -var ecam_page = props.globals.getNode("/ECAM/Lower/page", 1); -var hour = props.globals.getNode("/sim/time/utc/hour", 1); -var minute = props.globals.getNode("/sim/time/utc/minute", 1); -var apu_flap = props.globals.getNode("/controls/apu/inlet-flap/position-norm", 1); -var apu_rpm = props.globals.getNode("/engines/engine[2]/n1", 1); -var apu_egt = props.globals.getNode("/systems/apu/egt-degC", 1); -var door_left = props.globals.getNode("/ECAM/Lower/door-left", 1); -var door_right = props.globals.getNode("/ECAM/Lower/door-right", 1); -var door_nose_left = props.globals.getNode("/ECAM/Lower/door-nose-left", 1); -var door_nose_right = props.globals.getNode("/ECAM/Lower/door-nose-right", 1); -var apu_rpm_rot = props.globals.getNode("/ECAM/Lower/APU-N", 1); -var apu_egt_rot = props.globals.getNode("/ECAM/Lower/APU-EGT", 1); -var oil_qt1 = props.globals.getNode("/ECAM/Lower/Oil-QT[0]", 1); -var oil_qt2 = props.globals.getNode("/ECAM/Lower/Oil-QT[1]", 1); -var oil_psi1 = props.globals.getNode("/ECAM/Lower/Oil-PSI[0]", 1); -var oil_psi2 = props.globals.getNode("/ECAM/Lower/Oil-PSI[1]", 1); -var bleedapu = props.globals.getNode("/systems/pneumatics/source/apu-psi", 1); -var aileron_ind_left = props.globals.getNode("/ECAM/Lower/aileron-ind-left", 1); -var aileron_ind_right = props.globals.getNode("/ECAM/Lower/aileron-ind-right", 1); -var elevator_ind_left = props.globals.getNode("/ECAM/Lower/elevator-ind-left", 1); -var elevator_ind_right = props.globals.getNode("/ECAM/Lower/elevator-ind-right", 1); -var elevator_trim_deg = props.globals.getNode("/ECAM/Lower/elevator-trim-deg", 1); -var final_deg = props.globals.getNode("/fdm/jsbsim/hydraulics/rudder/final-deg", 1); -var temperature_degc = props.globals.getNode("/environment/temperature-degc", 1); -var tank3_content_lbs = props.globals.getNode("/fdm/jsbsim/propulsion/tank[2]/contents-lbs", 1); -var ir2_knob = props.globals.getNode("/controls/adirs/ir[1]/knob", 1); -var apuBleedNotOn = props.globals.getNode("/systems/pneumatics/warnings/apu-bleed-not-on", 1); -var apu_valve = props.globals.getNode("/systems/pneumatics/valves/apu-bleed-valve-cmd", 1); -var apu_valve_state = props.globals.getNode("/systems/pneumatics/valves/apu-bleed-valve", 1); -var xbleedcmd = props.globals.getNode("/systems/pneumatics/valves/crossbleed-valve-cmd", 1); -var xbleed = props.globals.getNode("/systems/pneumatics/valves/crossbleed-valve", 1); -var xbleedstate = nil; -var hp_valve1_state = props.globals.getNode("/systems/pneumatics/valves/engine-1-hp-valve", 1); -var hp_valve2_state = props.globals.getNode("/systems/pneumatics/valves/engine-2-hp-valve", 1); -var hp_valve1 = props.globals.getNode("/systems/pneumatics/valves/engine-1-hp-valve-cmd", 1); -var hp_valve2 = props.globals.getNode("/systems/pneumatics/valves/engine-2-hp-valve-cmd", 1); -var eng_valve1 = props.globals.getNode("/systems/pneumatics/valves/engine-1-prv-valve", 1); -var eng_valve2 = props.globals.getNode("/systems/pneumatics/valves/engine-2-prv-valve", 1); -var precooler1_psi = props.globals.getNode("/systems/pneumatics/psi/engine-1-psi", 1); -var precooler2_psi = props.globals.getNode("/systems/pneumatics/psi/engine-2-psi", 1); -var precooler1_temp = props.globals.getNode("/systems/pneumatics/precooler/temp-1", 1); -var precooler2_temp = props.globals.getNode("/systems/pneumatics/precooler/temp-2", 1); -var precooler1_ovht = props.globals.getNode("/systems/pneumatics/precooler/ovht-1", 1); -var precooler2_ovht = props.globals.getNode("/systems/pneumatics/precooler/ovht-2", 1); -var bmc1working = props.globals.getNode("/systems/pneumatics/indicating/bmc1-working", 1); -var bmc2working = props.globals.getNode("/systems/pneumatics/indicating/bmc2-working", 1); -var bmc1 = 0; -var bmc2 = 0; -var gs_kt = props.globals.getNode("/velocities/groundspeed-kt", 1); -var switch_wing_aice = props.globals.getNode("/controls/ice-protection/wing", 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); -var oil_qt2_actual = props.globals.getNode("/engines/engine[1]/oil-qt-actual", 1); -var fuel_used_lbs1 = props.globals.getNode("/systems/fuel/fuel-used-1", 1); -var fuel_used_lbs2 = props.globals.getNode("/systems/fuel/fuel-used-2", 1); -var doorL1_pos = props.globals.getNode("/sim/model/door-positions/doorl1/position-norm", 1); -var doorR1_pos = props.globals.getNode("/sim/model/door-positions/doorr1/position-norm", 1); -var doorL4_pos = props.globals.getNode("/sim/model/door-positions/doorl4/position-norm", 1); -var doorR4_pos = props.globals.getNode("/sim/model/door-positions/doorr4/position-norm", 1); -var cargobulk_pos = props.globals.getNode("/sim/model/door-positions/cargobulk/position-norm", 1); -var cargofwd_pos = props.globals.getNode("/sim/model/door-positions/cargofwd/position-norm", 1); -var cargoaft_pos = props.globals.getNode("/sim/model/door-positions/cargoaft/position-norm", 1); -var gLoad = props.globals.getNode("/ECAM/Lower/g-force-display", 1); - -# Hydraulic -var blue_psi = 0; -var green_psi = 0; -var yellow_psi = 0; -var y_resv_lo_air_press = props.globals.getNode("/systems/hydraulic/yellow-resv-lo-air-press", 1); -var b_resv_lo_air_press = props.globals.getNode("/systems/hydraulic/blue-resv-lo-air-press", 1); -var g_resv_lo_air_press = props.globals.getNode("/systems/hydraulic/green-resv-lo-air-press", 1); -var elec_pump_y_ovht = props.globals.getNode("/systems/hydraulic/elec-pump-yellow-ovht", 1); -var elec_pump_b_ovht = props.globals.getNode("/systems/hydraulic/elec-pump-blue-ovht", 1); -var rat_deployed = props.globals.getNode("/controls/hydraulic/rat-deployed", 1); -var y_resv_ovht = props.globals.getNode("/systems/hydraulic/yellow-resv-ovht", 1); -var b_resv_ovht = props.globals.getNode("/systems/hydraulic/blue-resv-ovht", 1); -var g_resv_ovht = props.globals.getNode("/systems/hydraulic/green-resv-ovht", 1); -var askidsw = 0; -var brakemode = 0; -var accum = 0; -var L1BrakeTempc = props.globals.getNode("/gear/gear[1]/L1brake-temp-degc", 1); -var L2BrakeTempc = props.globals.getNode("/gear/gear[1]/L2brake-temp-degc", 1); -var R3BrakeTempc = props.globals.getNode("/gear/gear[2]/R3brake-temp-degc", 1); -var R4BrakeTempc = props.globals.getNode("/gear/gear[2]/R4brake-temp-degc", 1); - -var eng1_running = props.globals.getNode("/engines/engine[0]/running", 1); -var eng2_running = props.globals.getNode("/engines/engine[1]/running", 1); -var switch_cart = props.globals.getNode("/controls/electrical/ground-cart", 1); -var spoiler_L1 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l1/final-deg", 1); -var spoiler_L2 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l2/final-deg", 1); -var spoiler_L3 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l3/final-deg", 1); -var spoiler_L4 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l4/final-deg", 1); -var spoiler_L5 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l5/final-deg", 1); -var spoiler_R1 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r1/final-deg", 1); -var spoiler_R2 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r2/final-deg", 1); -var spoiler_R3 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r3/final-deg", 1); -var spoiler_R4 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r4/final-deg", 1); -var spoiler_R5 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r5/final-deg", 1); -var total_fuel_lbs = props.globals.getNode("/consumables/fuel/total-fuel-lbs", 1); -var fuel_flow1 = props.globals.getNode("/engines/engine[0]/fuel-flow_actual", 1); -var fuel_flow2 = props.globals.getNode("/engines/engine[1]/fuel-flow_actual", 1); -var fuel_left_outer_temp = props.globals.getNode("/consumables/fuel/tank[0]/temperature_degC", 1); -var fuel_left_inner_temp = props.globals.getNode("/consumables/fuel/tank[1]/temperature_degC", 1); -var fuel_right_outer_temp = props.globals.getNode("/consumables/fuel/tank[4]/temperature_degC", 1); -var fuel_right_inner_temp = props.globals.getNode("/consumables/fuel/tank[3]/temperature_degC", 1); -var cutoff_switch1 = props.globals.getNode("/controls/engines/engine[0]/cutoff-switch", 1); -var cutoff_switch2 = props.globals.getNode("/controls/engines/engine[1]/cutoff-switch", 1); -var autobreak_mode = props.globals.getNode("/controls/autobrake/mode", 1); -var gear1_pos = props.globals.getNode("/gear/gear[0]/position-norm", 1); -var gear2_pos = props.globals.getNode("/gear/gear[1]/position-norm", 1); -var gear3_pos = props.globals.getNode("/gear/gear[2]/position-norm", 1); -var gear_door_L = props.globals.getNode("/systems/hydraulic/gear/door-left", 1); -var gear_door_R = props.globals.getNode("/systems/hydraulic/gear/door-right", 1); -var gear_door_N = props.globals.getNode("/systems/hydraulic/gear/door-nose", 1); -var gear_down = props.globals.getNode("/controls/gear/gear-down", 1); -var press_vs_norm = props.globals.getNode("/systems/pressurization/vs-norm", 1); -var cabinalt = props.globals.getNode("/systems/pressurization/cabinalt-norm", 1); -var gear0_wow = props.globals.getNode("/gear/gear[0]/wow", 1); - -# Create Nodes: +var du4_lgt = props.globals.getNode("/controls/lighting/DU/du4", 1); var apu_load = props.globals.initNode("/systems/electrical/extra/apu-load", 0, "DOUBLE"); var gen1_load = props.globals.initNode("/systems/electrical/extra/gen1-load", 0, "DOUBLE"); var gen2_load = props.globals.initNode("/systems/electrical/extra/gen2-load", 0, "DOUBLE"); @@ -183,40 +10,235 @@ var du4_test_time = props.globals.initNode("/instrumentation/du/du4-test-time", var du4_test_amount = props.globals.initNode("/instrumentation/du/du4-test-amount", 0, "DOUBLE"); var du4_offtime = props.globals.initNode("/instrumentation/du/du4-off-time", 0.0, "DOUBLE"); -var canvas_lowerECAM_base = { - init: func(canvas_group, file) { - var font_mapper = func(family, weight) { +var canvas_lowerECAMPage = +{ + new: func(svg) { + var obj = {parents: [canvas_lowerECAMPage] }; + obj.canvas = canvas.new({ + "name": "lowerECAM", + "size": [1024, 1024], + "view": [1024, 1024], + "mipmapping": 1 + }); + + obj.canvas.addPlacement({"node": "lecam.screen"}); + obj.group = obj.canvas.createGroup(); + obj.test = obj.canvas.createGroup(); + + obj.font_mapper = func(family, weight) { return "LiberationFonts/LiberationSans-Regular.ttf"; }; - - canvas.parsesvg(canvas_group, file, {"font-mapper": font_mapper}); - - var svg_keys = me.getKeys(); - foreach(var key; svg_keys) { - me[key] = canvas_group.getElementById(key); - } - - me.page = canvas_group; - - return me; + + canvas.parsesvg(obj.group, svg, {"font-mapper": obj.font_mapper} ); + obj.keysHash = obj.getKeys(); + + foreach(var key; obj.keysHash) { + obj[key] = obj.group.getElementById(key); + }; + + canvas.parsesvg(obj.test, "Aircraft/A320-family/Models/Instruments/Common/res/du-test.svg", {"font-mapper": obj.font_mapper} ); + foreach(var key; obj.getKeysTest()) { + obj[key] = obj.test.getElementById(key); + }; + + obj.units = acconfig_weight_kgs.getValue(); + + # init + obj["APUGenOff"].hide(); + + obj.update_items = [ + props.UpdateManager.FromHashValue("apuFlap",1, func(val) { + if (val) { + obj["APUFlapOpen"].show(); + } else { + obj["APUFlapOpen"].hide(); + } + }), + props.UpdateManager.FromHashValue("apuNeedleRot",0.1, func(val) { + obj["APUN-needle"].setRotation((val + 90) * D2R); + }), + props.UpdateManager.FromHashValue("apuEgtRot",0.1, func(val) { + obj["APUEGT-needle"].setRotation((val + 90) * D2R); + }), + props.UpdateManager.FromHashValue("apuAvailable", nil, func(val) { + if (val) { + obj["APUAvail"].show(); + } else { + obj["APUAvail"].hide(); + } + }), + props.UpdateManager.FromHashList(["apuRpm","apuEgt","apuMaster","apuGenPB"], nil, func(val) { + if (val.apuRpm > 0.001) { + obj["APUN"].setColor(0.0509,0.7529,0.2941); + obj["APUN"].setText(sprintf("%s", math.round(val.apuRpm))); + obj["APUN-needle"].show(); + obj["APUEGT"].setColor(0.0509,0.7529,0.2941); + obj["APUEGT"].setText(sprintf("%s", math.round(val.apuEgt, 5))); + obj["APUEGT-needle"].show(); + } else { + obj["APUN"].setColor(0.7333,0.3803,0); + obj["APUN"].setText(sprintf("%s", "XX")); + obj["APUN-needle"].hide(); + obj["APUEGT"].setColor(0.7333,0.3803,0); + obj["APUEGT"].setText(sprintf("%s", "XX")); + obj["APUEGT-needle"].hide(); + } + + if (val.apuMaster or val.apuRpm >= 94.9) { + obj["APUGenbox"].show(); + if (val.apuGenPB) { + obj["APUGenOff"].hide(); + obj["APUGentext"].setColor(0.8078,0.8039,0.8078); + obj["APUGenHz"].show(); + obj["APUGenVolt"].show(); + obj["APUGenLoad"].show(); + obj["text3724"].show(); + obj["text3728"].show(); + obj["text3732"].show(); + } else { + obj["APUGenOff"].show(); + obj["APUGentext"].setColor(0.7333,0.3803,0); + obj["APUGenHz"].hide(); + obj["APUGenVolt"].hide(); + obj["APUGenLoad"].hide(); + obj["text3724"].hide(); + obj["text3728"].hide(); + obj["text3732"].hide(); + } + } else { + obj["APUGentext"].setColor(0.8078,0.8039,0.8078); + obj["APUGenbox"].hide(); + obj["APUGenHz"].hide(); + obj["APUGenVolt"].hide(); + obj["APUGenLoad"].hide(); + obj["text3724"].hide(); + obj["text3728"].hide(); + obj["text3732"].hide(); + } + }), + props.UpdateManager.FromHashList(["apuFuelPumpsOff","apuFuelPump"], nil, func(val) { + if (val.apuFuelPumpsOff and !val.apuFuelPump) { + obj["APUfuelLO"].show(); + } else { + obj["APUfuelLO"].hide(); + } + }), + props.UpdateManager.FromHashList(["apuRpm","apuOilLevel","gear0Wow"], nil, func(val) { + if (val.apuRpm >= 94.9 and val.gear0Wow and val.apuOilLevel < 3.69) { + obj["APU-low-oil"].show(); + } else { + obj["APU-low-oil"].hide(); + } + }), + props.UpdateManager.FromHashList(["apuAdr","apuPsi","apuRpm"], nil, func(val) { + if (val.apuAdr and val.apuRpm > 0.001) { + obj["APUBleedPSI"].setColor(0.0509,0.7529,0.2941); + obj["APUBleedPSI"].setText(sprintf("%s", math.round(val.apuPsi))); + } else { + obj["APUBleedPSI"].setColor(0.7333,0.3803,0); + obj["APUBleedPSI"].setText(sprintf("%s", "XX")); + } + }), + props.UpdateManager.FromHashValue("apuLoad", 0.1, func(val) { + obj["APUGenLoad"].setText(sprintf("%s", math.round(val))); + + if (val <= 100) { + obj["APUGenHz"].setColor(0.0509,0.7529,0.2941); + } else { + obj["APUGenHz"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("apuHertz", 1, func(val) { + obj["APUGenHz"].setText(sprintf("%s", math.round(val))); + + if (val >= 390 and val <= 410) { + obj["APUGenHz"].setColor(0.0509,0.7529,0.2941); + } else { + obj["APUGenHz"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("apuVolt", 0.1, func(val) { + obj["APUGenVolt"].setText(sprintf("%s", math.round(val))); + + if (val >= 110 and val <= 120) { + obj["APUGenVolt"].setColor(0.0509,0.7529,0.2941); + } else { + obj["APUGenVolt"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("apuGLC", nil, func(val) { + if (val) { + obj["APUGenOnline"].show(); + } else { + obj["APUGenOnline"].hide(); + } + }), + props.UpdateManager.FromHashList(["apuBleedValvePos","apuBleedValveCmd"], nil, func(val) { + if (val.apuBleedValvePos == 1) { + obj["APUBleedValve"].setRotation(90 * D2R); + obj["APUBleedOnline"].show(); + } else { + obj["APUBleedValve"].setRotation(0); + obj["APUBleedOnline"].hide(); + } + + if (val.apuBleedValveCmd == val.apuBleedValvePos) { + obj["APUBleedValveCrossBar"].setColor(0.0509,0.7529,0.2941); + obj["APUBleedValveCrossBar"].setColorFill(0.0509,0.7529,0.2941); + obj["APUBleedValve"].setColor(0.0509,0.7529,0.2941); + } else { + obj["APUBleedValveCrossBar"].setColor(0.7333,0.3803,0); + obj["APUBleedValveCrossBar"].setColorFill(0.7333,0.3803,0); + obj["APUBleedValve"].setColor(0.7333,0.3803,0); + } + }), + ]; + return obj; }, getKeys: func() { - return []; + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","APUN-needle","APUEGT-needle","APUN","APUEGT","APUAvail","APUFlapOpen","APUBleedValve","APUBleedOnline","APUBleedValveCrossBar","APUGenOnline","APUGenOff","APUGentext","APUGenLoad","APUGenbox","APUGenVolt","APUGenHz","APUBleedPSI","APUfuelLO","APU-low-oil", + "text3724","text3728","text3732"]; }, - updateDu4: func() { - var elapsedtime = pts.Sim.Time.elapsedSec.getValue(); + getKeysTest: func() { + return ["Test_white","Test_text"]; + }, + update: func(notification) { + me.updatePower(); + if (me.test.getVisible() == 1) { + me.updateTest(notification); + } + + if (me.group.getVisible() == 0) { + return; + } + + foreach(var update_item; me.update_items) + { + update_item.update(notification); + } + }, + updateTest: func(notification) { + if (du4_test_time.getValue() + 1 >= notification.elapsedTime) { + me["Test_white"].show(); + me["Test_text"].hide(); + } else { + me["Test_white"].hide(); + me["Test_text"].show(); + } + }, + powerTransient: func() { if (systems.ELEC.Bus.ac2.getValue() >= 110) { - if (du4_offtime.getValue() + 3 < elapsedtime) { - if (gear0_wow.getValue()) { - if (autoconfig_running.getValue() != 1 and du4_test.getValue() != 1) { + if (du4_offtime.getValue() + 3 < pts.Sim.Time.elapsedSec.getValue()) { + if (pts.Gear.wow[0].getValue()) { + if (!acconfig.getBoolValue() and !du4_test.getBoolValue()) { du4_test.setValue(1); du4_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1)); - du4_test_time.setValue(elapsedtime); - } else if (autoconfig_running.getValue() and du4_test.getValue() != 1) { + du4_test_time.setValue(pts.Sim.Time.elapsedSec.getValue()); + } else if (acconfig.getBoolValue() and !du4_test.getBoolValue()) { du4_test.setValue(1); du4_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1)); - du4_test_time.setValue(elapsedtime - 30); + du4_test_time.setValue(pts.Sim.Time.elapsedSec.getValue() - 30); } } else { du4_test.setValue(1); @@ -226,3397 +248,83 @@ var canvas_lowerECAM_base = { } } else { du4_test.setValue(0); - du4_offtime.setValue(elapsedtime); + du4_offtime.setValue(pts.Sim.Time.elapsedSec.getValue()); } }, - update: func() { - var elapsedtime = pts.Sim.Time.elapsedSec.getValue(); - - if (systems.ELEC.Bus.ac2.getValue() >= 110 and lighting_du4.getValue() > 0.01) { - if (du4_test_time.getValue() + du4_test_amount.getValue() >= elapsedtime) { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_test.page.show(); - lowerECAM_test.update(); + updatePower: func() { + if (du4_lgt.getValue() > 0.01 and systems.ELEC.Bus.ac2.getValue() >= 110) { + if (du4_test_time.getValue() + du4_test_amount.getValue() >= pts.Sim.Time.elapsedSec.getValue()) { + me.group.setVisible(0); + me.test.setVisible(1); } else { - lowerECAM_test.page.hide(); - page = ecam_page.getValue(); - if (page == "apu") { - lowerECAM_apu.page.show(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_apu.update(); - } else if (page == "bleed") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.show(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_bleed.update(); - } else if (page == "cond") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.show(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_cond.update(); - } else if (page == "cruise") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.show(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_crz.update(); - } else if (page == "door") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.show(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_door.update(); - } else if (page == "elec") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.show(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_elec.update(); - } else if (page == "eng") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.show(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_eng.update(); - } else if (page == "fctl") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.show(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_fctl.update(); - } else if (page == "fuel") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.show(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_fuel.update(); - } else if (page == "press") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.show(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_press.update(); - } else if (page == "sts") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.show(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_status.update(); - } else if (page == "hyd") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.show(); - lowerECAM_wheel.page.hide(); - lowerECAM_hyd.update(); - } else if (page == "wheel") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.show(); - lowerECAM_wheel.update(); - } else { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - } + me.group.setVisible(1); + me.test.setVisible(0); } } else { - lowerECAM_test.page.hide(); - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - } - }, - displayedGForce: 0, - updateBottomStatus: func() { - if (dmc.DMController.DMCs[1].outputs[4] != nil) { - me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); - me["SAT"].setColor(0.0509,0.7529,0.2941); - } else { - me["SAT"].setText(sprintf("%s", "XX")); - me["SAT"].setColor(0.7333,0.3803,0); - } - - if (dmc.DMController.DMCs[1].outputs[5] != nil) { - me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); - me["TAT"].setColor(0.0509,0.7529,0.2941); - } else { - me["TAT"].setText(sprintf("%s", "XX")); - me["TAT"].setColor(0.7333,0.3803,0); - } - - me.gloadStore = gLoad.getValue(); - if ((me.gloadStore == 1 and !me.displayedGForce) or (me.gloadStore != 0 and me.displayedGForce)) { - me.displayedGForce = 1; - me["GLoad"].setText("G.LOAD " ~ sprintf("%3.1f", pts.Accelerations.pilotGDamped.getValue())); - me["GLoad"].show(); - } else { - me.displayedGForce = 0; - me["GLoad"].hide(); - } - - me["UTCh"].setText(sprintf("%02d", hour.getValue())); - me["UTCm"].setText(sprintf("%02d", minute.getValue())); - - if (fmgc.FMGCInternal.fuelRequest and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating and ecam.phaseNode.getValue() != 1) { - if (acconfig_weight_kgs.getValue()) { - me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000 * LBS2KGS, 100))); - } else { - me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000, 100))); - } - me["GW"].setColor(0.0509,0.7529,0.2941); - } else { - me["GW"].setText(sprintf("%s", "-----")); - me["GW"].setColor(0.0901,0.6039,0.7176); - } - - if (acconfig_weight_kgs.getValue()) { - me["GW-weight-unit"].setText("KG"); - } else { - me["GW-weight-unit"].setText("LBS"); + me.group.setVisible(0); + me.test.setVisible(0); } }, }; -var canvas_lowerECAM_apu = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_apu, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","APUN-needle","APUEGT-needle","APUN","APUEGT","APUAvail","APUFlapOpen","APUBleedValve","APUBleedOnline","APUGenOnline","APUGentext","APUGenLoad","APUGenbox","APUGenVolt","APUGenHz","APUBleedPSI","APUfuelLO","APU-low-oil", - "text3724","text3728","text3732"]; - }, - update: func() { - # Avail and Flap Open - if (apu_flap.getValue()) { - me["APUFlapOpen"].show(); - } else { - me["APUFlapOpen"].hide(); - } - - if (apu_rpm.getValue() > 94.9) { - me["APUAvail"].show(); - } else { - me["APUAvail"].hide(); - } - - if (!systems.FUEL.Pumps.apu.getBoolValue() and systems.FUEL.Pumps.allOff.getBoolValue()) { - me["APUfuelLO"].show(); - } else { - me["APUfuelLO"].hide(); - } - - # APU Gen - if (systems.ELEC.Source.APU.volts.getValue() >= 110) { - me["APUGenVolt"].setColor(0.0509,0.7529,0.2941); - } else { - me["APUGenVolt"].setColor(0.7333,0.3803,0); - } - - if (systems.ELEC.Source.APU.hertz.getValue() > 380) { - me["APUGenHz"].setColor(0.0509,0.7529,0.2941); - } else { - me["APUGenHz"].setColor(0.7333,0.3803,0); - } - - if (systems.APUNodes.Controls.master.getValue() or apu_rpm.getValue() >= 94.9) { - me["APUGenbox"].show(); - me["APUGenHz"].show(); - me["APUGenVolt"].show(); - me["APUGenLoad"].show(); - me["text3724"].show(); - me["text3728"].show(); - me["text3732"].show(); - } else { - me["APUGenbox"].hide(); - me["APUGenHz"].hide(); - me["APUGenVolt"].hide(); - me["APUGenLoad"].hide(); - me["text3724"].hide(); - me["text3728"].hide(); - me["text3732"].hide(); - } - - if ((apu_rpm.getValue() > 94.9) and (systems.ELEC.Source.APU.contact.getValue())) { - me["APUGenOnline"].show(); - } else { - me["APUGenOnline"].hide(); - } - - if ((systems.APUNodes.Controls.master.getValue() == 0) or ((systems.APUNodes.Controls.master.getValue()) and (systems.ELEC.Source.APU.contact.getValue()) and (apu_rpm.getValue() > 94.9))) { - me["APUGentext"].setColor(0.8078,0.8039,0.8078); - } else if ((systems.APUNodes.Controls.master.getValue()) and (systems.ELEC.Source.APU.contact.getValue() == 0) and (apu_rpm.getValue() < 94.9)) { - me["APUGentext"].setColor(0.7333,0.3803,0); - } - - me["APUGenLoad"].setText(sprintf("%s", math.round(apu_load.getValue()))); - me["APUGenVolt"].setText(sprintf("%s", math.round(systems.ELEC.Source.APU.volts.getValue()))); - me["APUGenHz"].setText(sprintf("%s", math.round(systems.ELEC.Source.APU.hertz.getValue()))); - - # APU Bleed - if (systems.ADIRS.Operating.adr[0].getValue() and (systems.APUNodes.Controls.bleed.getValue() or bleedapu.getValue() > 0)) { - me["APUBleedPSI"].setColor(0.0509,0.7529,0.2941); - me["APUBleedPSI"].setText(sprintf("%s", math.round(bleedapu.getValue()))); - } else { - me["APUBleedPSI"].setColor(0.7333,0.3803,0); - me["APUBleedPSI"].setText(sprintf("%s", "XX")); - } - - var apu_valve_state2 = apu_valve_state.getValue(); - if (apu_valve_state2 == 1) { - me["APUBleedValve"].setRotation(90 * D2R); - } else { - me["APUBleedValve"].setRotation(0); - } - - if (apu_valve_state2 == apu_valve_state.getValue()) { - me["APUBleedValve"].setColor(0.0509,0.7529,0.2941); - me["APUBleedOnline"].show(); - } else { - me["APUBleedValve"].setColor(0.7333,0.3803,0); - me["APUBleedOnline"].hide(); - } - - - # APU N and EGT - if (systems.APUNodes.Controls.master.getValue()) { - me["APUN"].setColor(0.0509,0.7529,0.2941); - me["APUN"].setText(sprintf("%s", math.round(apu_rpm.getValue() or 0))); - me["APUEGT"].setColor(0.0509,0.7529,0.2941); - me["APUEGT"].setText(sprintf("%s", math.round(apu_egt.getValue() or 0, 5))); - } else if (apu_rpm.getValue() >= 1) { - me["APUN"].setColor(0.0509,0.7529,0.2941); - me["APUN"].setText(sprintf("%s", math.round(apu_rpm.getValue() or 0))); - me["APUEGT"].setColor(0.0509,0.7529,0.2941); - me["APUEGT"].setText(sprintf("%s", math.round(apu_egt.getValue() or 0, 5))); - } else { - me["APUN"].setColor(0.7333,0.3803,0); - me["APUN"].setText(sprintf("%s", "XX")); - me["APUEGT"].setColor(0.7333,0.3803,0); - me["APUEGT"].setText(sprintf("%s", "XX")); - } - me["APUN-needle"].setRotation((apu_rpm_rot.getValue() + 90) * D2R); - me["APUEGT-needle"].setRotation((apu_egt_rot.getValue() + 90) * D2R); - - if (systems.APUNodes.Oil.level.getValue() < 3.69 and apu_rpm.getValue() < 94.9 and gear0_wow.getValue()) { - me["APU-low-oil"].show(); - } else { - me["APU-low-oil"].hide(); - } - - me.updateBottomStatus(); - }, -}; - -var canvas_lowerECAM_bleed = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_bleed, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit", "BLEED-XFEED", "BLEED-Ram-Air", "BLEED-APU-CIRCLE", "BLEED-HP-Valve-1", - "BLEED-APU-LINES","BLEED-ENG-1", "BLEED-HP-Valve-2", "BLEED-ENG-2", "BLEED-Precooler-1-Inlet-Press", "BLEED-Precooler-1-Outlet-Temp", - "BLEED-Precooler-2-Inlet-Press", "BLEED-Precooler-2-Outlet-Temp", "BLEED-ENG-1-label", "BLEED-ENG-2-label", - "BLEED-GND", "BLEED-Pack-1-Flow-Valve", "BLEED-Pack-2-Flow-Valve", "BLEED-Pack-1-Out-Temp","BLEED-APU-connectionTop", - "BLEED-Pack-1-Comp-Out-Temp", "BLEED-Pack-1-Packflow-needle", "BLEED-Pack-1-Bypass-needle", "BLEED-Pack-2-Out-Temp", - "BLEED-Pack-2-Bypass-needle", "BLEED-Pack-2-Comp-Out-Temp", "BLEED-Pack-2-Packflow-needle", "BLEED-Anti-Ice-Left", - "BLEED-Anti-Ice-Right", "BLEED-HP-2-connection", "BLEED-HP-1-connection", "BLEED-ANTI-ICE-ARROW-LEFT", "BLEED-ANTI-ICE-ARROW-RIGHT", - "BLEED-xbleedLeft","BLEED-xbleedCenter","BLEED-xbleedRight","BLEED-cond-1","BLEED-cond-2","BLEED-cond-3","BLEED-Ram-Air-connection"]; - }, - update: func() { - # X BLEED - xbleedstate = xbleed.getValue(); - xbleedcmdstate = xbleedcmd.getBoolValue(); - if (xbleedcmdstate != xbleedstate) { - me["BLEED-XFEED"].setColor(0.7333,0.3803,0); - } else { - me["BLEED-XFEED"].setColor(0.0509,0.7529,0.2941); - } - - if (xbleedcmdstate == xbleedstate) { - if (xbleedcmdstate) { - me["BLEED-XFEED"].setRotation(0); - } else { - me["BLEED-XFEED"].setRotation(90 * D2R); - } - } else { - me["BLEED-XFEED"].setRotation(45 * D2R); - } - - if (xbleedstate == 1) { - me["BLEED-xbleedCenter"].show(); - me["BLEED-xbleedRight"].show(); - } else { - me["BLEED-xbleedCenter"].hide(); - me["BLEED-xbleedRight"].hide(); - } - - # HP valve 1 - hp_valve_state = hp_valve1_state.getValue(); - - if (hp_valve_state == 1) { - me["BLEED-HP-Valve-1"].setRotation(90 * D2R); - me["BLEED-HP-1-connection"].show(); - } else { - me["BLEED-HP-Valve-1"].setRotation(0); - me["BLEED-HP-1-connection"].hide(); - } - - if (hp_valve_state == hp_valve1.getValue()) { - me["BLEED-HP-Valve-1"].setColor(0.0509,0.7529,0.2941); - } else { - me["BLEED-HP-Valve-1"].setColor(0.7333,0.3803,0); - } - - # HP valve 2 - hp_valve_state = hp_valve2_state.getValue(); - - if (hp_valve_state == 1) { - me["BLEED-HP-Valve-2"].setRotation(90 * D2R); - me["BLEED-HP-2-connection"].show(); - } else { - me["BLEED-HP-Valve-2"].setRotation(0); - me["BLEED-HP-2-connection"].hide(); - } - - if (hp_valve_state == hp_valve2.getValue()) { - me["BLEED-HP-Valve-2"].setColor(0.0509,0.7529,0.2941); - } else { - me["BLEED-HP-Valve-2"].setColor(0.7333,0.3803,0); - } - - # ENG BLEED valve 1 - eng_valve_state = systems.PNEU.Switch.bleed1.getValue(); - bleed_valve_cur = eng_valve1.getValue(); - - if (bleed_valve_cur == 0) { - me["BLEED-ENG-1"].setRotation(0); - } else { - me["BLEED-ENG-1"].setRotation(90 * D2R); - } - - if (eng_valve_state == bleed_valve_cur) { - me["BLEED-ENG-1"].setColor(0.0509,0.7529,0.2941); - } else { - me["BLEED-ENG-1"].setColor(0.7333,0.3803,0); - } - - # APU BLEED valve - var apu_valve_state2 = apu_valve_state.getValue(); - - if (systems.APUNodes.Controls.master.getValue()) { - me["BLEED-APU-LINES"].show(); - if (apu_valve_state2 == 1) { - me["BLEED-APU-CIRCLE"].setRotation(0); - me["BLEED-APU-connectionTop"].show(); - me["BLEED-xbleedLeft"].show(); - } else { - me["BLEED-APU-CIRCLE"].setRotation(90 * D2R); - me["BLEED-APU-connectionTop"].hide(); - if (xbleed.getValue() != 1) { - me["BLEED-xbleedLeft"].hide(); - } else { - me["BLEED-xbleedLeft"].show(); - } - } - if (apuBleedNotOn.getValue() != 1) { - me["BLEED-APU-CIRCLE"].setColor(0.0509,0.7529,0.2941); - } else { - me["BLEED-APU-CIRCLE"].setColor(0.7333,0.3803,0); - } - } else { - if (xbleed.getValue() != 1) { - me["BLEED-xbleedLeft"].hide(); - } else { - me["BLEED-xbleedLeft"].show(); - } - me["BLEED-APU-LINES"].hide(); - me["BLEED-APU-connectionTop"].hide(); - } - - # ENG BLEED valve 2 - eng_valve_state = systems.PNEU.Switch.bleed2.getValue(); - bleed_valve_cur = eng_valve2.getValue(); - - if (bleed_valve_cur == 0) { - me["BLEED-ENG-2"].setRotation(0); - } else { - me["BLEED-ENG-2"].setRotation(90 * D2R); - } - - if (eng_valve_state == bleed_valve_cur) { - me["BLEED-ENG-2"].setColor(0.0509,0.7529,0.2941); - } else { - me["BLEED-ENG-2"].setColor(0.7333,0.3803,0); - } - - # Precooler inlet 1 - bmc1 = bmc1working.getValue(); - bmc2 = bmc2working.getValue(); - - if (bmc1) { - var precooler_psi = precooler1_psi.getValue(); - me["BLEED-Precooler-1-Inlet-Press"].setText(sprintf("%s", math.round(precooler_psi))); - if (precooler_psi < 4 or precooler_psi > 57) { - me["BLEED-Precooler-1-Inlet-Press"].setColor(0.7333,0.3803,0); - } else { - me["BLEED-Precooler-1-Inlet-Press"].setColor(0.0509,0.7529,0.2941); - } - } else { - me["BLEED-Precooler-1-Inlet-Press"].setText(sprintf("%s", "XX")); - me["BLEED-Precooler-1-Inlet-Press"].setColor(0.7333,0.3803,0); - } - - # Precooler inlet 2 - if (bmc2) { - var precooler_psi = precooler2_psi.getValue(); - me["BLEED-Precooler-2-Inlet-Press"].setText(sprintf("%s", math.round(precooler_psi))); - if (precooler_psi < 4 or precooler_psi > 57) { - me["BLEED-Precooler-2-Inlet-Press"].setColor(0.7333,0.3803,0); - } else { - me["BLEED-Precooler-2-Inlet-Press"].setColor(0.0509,0.7529,0.2941); - } - } else { - me["BLEED-Precooler-2-Inlet-Press"].setText(sprintf("%s", "XX")); - me["BLEED-Precooler-2-Inlet-Press"].setColor(0.7333,0.3803,0); - } - - # Precooler outlet 1 - if (bmc1) { - var precooler_temp = precooler1_temp.getValue(); - me["BLEED-Precooler-1-Outlet-Temp"].setText(sprintf("%s", math.round(precooler_temp, 5))); - if (systems.PNEU.Switch.bleed1.getValue() and (precooler_temp < 150 or precooler1_ovht.getValue())) { - me["BLEED-Precooler-1-Outlet-Temp"].setColor(0.7333,0.3803,0); - } else { - me["BLEED-Precooler-1-Outlet-Temp"].setColor(0.0509,0.7529,0.2941); - } - } else { - me["BLEED-Precooler-1-Outlet-Temp"].setText(sprintf("%s", "XX")); - me["BLEED-Precooler-1-Outlet-Temp"].setColor(0.7333,0.3803,0); - } - - # Precooler outlet 2 - if (bmc2) { - var precooler_temp = precooler2_temp.getValue(); - me["BLEED-Precooler-2-Outlet-Temp"].setText(sprintf("%s", math.round(precooler_temp, 5))); - if (systems.PNEU.Switch.bleed2.getValue() and (precooler_temp < 150 or precooler2_ovht.getValue())) { - me["BLEED-Precooler-2-Outlet-Temp"].setColor(0.7333,0.3803,0); - } else { - me["BLEED-Precooler-2-Outlet-Temp"].setColor(0.0509,0.7529,0.2941); - } - } else { - me["BLEED-Precooler-2-Outlet-Temp"].setText(sprintf("%s", "XX")); - me["BLEED-Precooler-2-Outlet-Temp"].setColor(0.7333,0.3803,0); - } - - # GND air - if (pts.Gear.wow[1].getValue()) { - me["BLEED-GND"].show(); - } else { - me["BLEED-GND"].hide(); - } - - # WING ANTI ICE - if (switch_wing_aice.getValue()) { - me["BLEED-Anti-Ice-Left"].show(); - me["BLEED-Anti-Ice-Right"].show(); - } else { - me["BLEED-Anti-Ice-Left"].hide(); - me["BLEED-Anti-Ice-Right"].hide(); - } - - # ENG 1 label - 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 (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); - } - - # PACK 1 ----------------------------------------- - packValveState = systems.PNEU.Valves.pack1.getValue(); - me["BLEED-Pack-1-Out-Temp"].setText(sprintf("%s", math.round(systems.PNEU.Packs.pack1OutTemp.getValue(), 5))); - me["BLEED-Pack-1-Comp-Out-Temp"].setText(sprintf("%s", math.round(systems.PNEU.Packs.pack1OutletTemp.getValue(), 5))); - - if (systems.PNEU.Packs.pack1OutTemp.getValue() > 90) { - me["BLEED-Pack-1-Out-Temp"].setColor(0.7333,0.3803,0); - } else { - me["BLEED-Pack-1-Out-Temp"].setColor(0.0509,0.7529,0.2941); - } - - # `-50` cause the middel position from where we move the needle is at 50 - me["BLEED-Pack-1-Bypass-needle"].setRotation((pack1_bypass.getValue() - 50) * D2R); - - if (systems.PNEU.Packs.pack1OutletTemp.getValue() > 230) { - me["BLEED-Pack-1-Comp-Out-Temp"].setColor(0.7333,0.3803,0); - } else { - me["BLEED-Pack-1-Comp-Out-Temp"].setColor(0.0509,0.7529,0.2941); - } - - me["BLEED-Pack-1-Packflow-needle"].setRotation(systems.PNEU.Packs.packFlow1.getValue() * D2R); - - if (packValveState == 0) { - me["BLEED-Pack-1-Packflow-needle"].setColorFill(0.7333,0.3803,0); - me["BLEED-Pack-1-Flow-Valve"].setRotation(90 * D2R); - } else { - me["BLEED-Pack-1-Packflow-needle"].setColorFill(0.0509,0.7529,0.2941); - me["BLEED-Pack-1-Flow-Valve"].setRotation(0); - } - - if (packValveState == systems.PNEU.Switch.pack1.getValue()) { - me["BLEED-Pack-1-Flow-Valve"].setColor(0.0509,0.7529,0.2941); - } else { - me["BLEED-Pack-1-Flow-Valve"].setColor(0.7333,0.3803,0); - } - - # PACK 2 ----------------------------------------- - packValveState = systems.PNEU.Valves.pack2.getValue(); - me["BLEED-Pack-2-Out-Temp"].setText(sprintf("%s", math.round(systems.PNEU.Packs.pack2OutTemp.getValue(), 5))); - me["BLEED-Pack-2-Comp-Out-Temp"].setText(sprintf("%s", math.round(systems.PNEU.Packs.pack2OutletTemp.getValue(), 5))); - - if (systems.PNEU.Packs.pack2OutTemp.getValue() > 90) { - me["BLEED-Pack-2-Out-Temp"].setColor(0.7333,0.3803,0); - } else { - me["BLEED-Pack-2-Out-Temp"].setColor(0.0509,0.7529,0.2941); - } - - me["BLEED-Pack-2-Bypass-needle"].setRotation((pack2_bypass.getValue() - 50) * D2R); - - if (systems.PNEU.Packs.pack2OutletTemp.getValue() > 230) { - me["BLEED-Pack-2-Comp-Out-Temp"].setColor(0.7333,0.3803,0); - } else { - me["BLEED-Pack-2-Comp-Out-Temp"].setColor(0.0509,0.7529,0.2941); - } - - me["BLEED-Pack-2-Packflow-needle"].setRotation(systems.PNEU.Packs.packFlow2.getValue() * D2R); - - if (packValveState == 0) { - me["BLEED-Pack-2-Packflow-needle"].setColorFill(0.7333,0.3803,0); - me["BLEED-Pack-2-Flow-Valve"].setRotation(90 * D2R); - } else { - me["BLEED-Pack-2-Packflow-needle"].setColorFill(0.0509,0.7529,0.2941); - me["BLEED-Pack-2-Flow-Valve"].setRotation(0); - } - - if (packValveState == systems.PNEU.Switch.pack2.getValue()) { - me["BLEED-Pack-2-Flow-Valve"].setColor(0.0509,0.7529,0.2941); - } else { - me["BLEED-Pack-2-Flow-Valve"].setColor(0.7333,0.3803,0); - } - - # Ram Air - ramAirState = systems.PNEU.Valves.ramAir.getValue(); - if (ramAirState == 0) { - me["BLEED-Ram-Air"].setRotation(90 * D2R); - me["BLEED-Ram-Air"].setColor(0.0509,0.7529,0.2941); - me["BLEED-Ram-Air"].setColorFill(0.0509,0.7529,0.2941); - me["BLEED-Ram-Air-connection"].hide(); - } elsif (ramAirState) { - me["BLEED-Ram-Air"].setRotation(0); - if (pts.Gear.wow[1].getValue()) { - me["BLEED-Ram-Air"].setColor(0.7333,0.3803,0); - me["BLEED-Ram-Air"].setColorFill(0.7333,0.3803,0); - } else { - me["BLEED-Ram-Air"].setColor(0.0509,0.7529,0.2941); - me["BLEED-Ram-Air"].setColorFill(0.0509,0.7529,0.2941); - } - me["BLEED-Ram-Air-connection"].show(); - } else { - me["BLEED-Ram-Air"].setRotation(45 * D2R); - me["BLEED-Ram-Air"].setColor(0.7333,0.3803,0); - me["BLEED-Ram-Air"].setColorFill(0.7333,0.3803,0); - me["BLEED-Ram-Air-connection"].show(); - } - - # Triangles - if (systems.PNEU.Valves.pack1.getValue() == 0 and systems.PNEU.Valves.pack2.getValue() == 0) { - if (pts.Gear.wow[1].getValue() or ramAirState != 1) { - me["BLEED-cond-1"].setColor(0.7333,0.3803,0); - me["BLEED-cond-2"].setColor(0.7333,0.3803,0); - me["BLEED-cond-3"].setColor(0.7333,0.3803,0); - } else { - me["BLEED-cond-1"].setColor(0.0509,0.7529,0.2941); - me["BLEED-cond-2"].setColor(0.0509,0.7529,0.2941); - me["BLEED-cond-3"].setColor(0.0509,0.7529,0.2941); - } - } else { - me["BLEED-cond-1"].setColor(0.0509,0.7529,0.2941); - me["BLEED-cond-2"].setColor(0.0509,0.7529,0.2941); - me["BLEED-cond-3"].setColor(0.0509,0.7529,0.2941); - } - me.updateBottomStatus(); - }, -}; - -var canvas_lowerECAM_cond = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_cond, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","CargoCond","CONDHotAirValve","CONDFanFwdFault","CONDFanAftFault", - "CONDTrimValveCKPT","CONDTrimValveAFT","CONDTrimValveFWD","CONDDuctTempCKPT","CONDDuctTempAFT","CONDDuctTempFWD","CONDTempCKPT","CONDTempAFT","CONDTempFWD"]; - }, - update: func() { - if (systems.PNEU.Valves.hotAir.getValue() == 0) { - me["CONDHotAirValve"].setRotation(90 * D2R); - if (systems.PNEU.Switch.hotAir.getBoolValue()) { - me["CONDHotAirValve"].setColor(0.7333,0.3803,0); - } else { - me["CONDHotAirValve"].setColor(0.0509,0.7529,0.2941); - } - } else { - me["CONDHotAirValve"].setRotation(0); # doesn't show rotation in transit - if (systems.PNEU.Switch.hotAir.getBoolValue()) { - me["CONDHotAirValve"].setColor(0.0509,0.7529,0.2941); - } else { - me["CONDHotAirValve"].setColor(0.7333,0.3803,0); - } - } - - me["CONDTrimValveCKPT"].setRotation(systems.PNEU.Packs.trimCockpit.getValue() * D2R); - me["CONDTrimValveAFT"].setRotation(systems.PNEU.Packs.trimAft.getValue() * D2R); - me["CONDTrimValveFWD"].setRotation(systems.PNEU.Packs.trimFwd.getValue() * D2R); - - me["CONDDuctTempCKPT"].setText(sprintf("%2.0f",math.round(systems.PNEU.Packs.cockpitDuctTemp.getValue()))); - me["CONDDuctTempAFT"].setText(sprintf("%2.0f",math.round(systems.PNEU.Packs.cabinAftDuctTemp.getValue()))); - me["CONDDuctTempFWD"].setText(sprintf("%2.0f",math.round(systems.PNEU.Packs.cabinFwdDuctTemp.getValue()))); - - me["CONDTempCKPT"].setText(sprintf("%2.0f",math.round(systems.PNEU.Packs.cockpitTemp.getValue()))); - me["CONDTempAFT"].setText(sprintf("%2.0f",math.round(systems.PNEU.Packs.cabinAftTemp.getValue()))); - me["CONDTempFWD"].setText(sprintf("%2.0f",math.round(systems.PNEU.Packs.cabinFwdTemp.getValue()))); - - # fans faults not implemented - me["CONDFanFwdFault"].hide(); - me["CONDFanAftFault"].hide(); - - # aft cargo ventilation disabled - me["CargoCond"].hide(); - me.updateBottomStatus(); - }, -}; - -var canvas_lowerECAM_crz = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_crz, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","Oil1","Oil2","FUsed1","FUsed2","FUsed","VIB1N1","VIB1N2","VIB2N1","VIB2N2","deltaPSI","LDGELEV-AUTO","LDGELEV","CABVS","CABALT","VS-Arrow-UP","VS-Arrow-DN","CKPT-TEMP","FWD-TEMP","AFT-TEMP","Fused-weight-unit"]; - }, - update: func() { - - me["Oil1"].setText(sprintf("%2.1f", oil_qt1_actual.getValue())); - me["Oil2"].setText(sprintf("%2.1f", oil_qt2_actual.getValue())); - - if (acconfig_weight_kgs.getValue()) { - me["Fused-weight-unit"].setText("KG"); - me["FUsed1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue() * LBS2KGS, 10))); - me["FUsed2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue() * LBS2KGS, 10))); - me["FUsed"].setText(sprintf("%s", (math.round(fuel_used_lbs1.getValue() * LBS2KGS, 10) + math.round(fuel_used_lbs2.getValue() * LBS2KGS, 10)))); - } else { - me["Fused-weight-unit"].setText("LBS"); - me["FUsed1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue(), 10))); - me["FUsed2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue(), 10))); - me["FUsed"].setText(sprintf("%s", (math.round(fuel_used_lbs1.getValue(), 10) + math.round(fuel_used_lbs2.getValue(), 10)))); - } - - me.updateBottomStatus(); - }, -}; - -var canvas_lowerECAM_door = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_door, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", - "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", - "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", - "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"]; - }, - update: func() { - # If you make AirBerlin or Allegiant livery add below - - if (doorL1_pos.getValue() > 0) { - me["Cabin1Left"].show(); - me["Cabin1Left"].setColor(0.7333,0.3803,0); - me["Cabin1Left"].setColorFill(0.7333,0.3803,0); - me["Cabin1LeftLbl"].show(); - me["Cabin1LeftLine"].show(); - } else { - me["Cabin1Left"].setColor(0.0509,0.7529,0.2941); - me["Cabin1Left"].setColorFill(0,0,0); - me["Cabin1LeftLbl"].hide(); - me["Cabin1LeftLine"].hide(); - } - - if (doorR1_pos.getValue() > 0) { - me["Cabin1Right"].show(); - me["Cabin1Right"].setColor(0.7333,0.3803,0); - me["Cabin1Right"].setColorFill(0.7333,0.3803,0); - me["Cabin1RightLbl"].show(); - me["Cabin1RightLine"].show(); - } else { - me["Cabin1Right"].setColor(0.0509,0.7529,0.2941); - me["Cabin1Right"].setColorFill(0,0,0); - me["Cabin1RightLbl"].hide(); - me["Cabin1RightLine"].hide(); - } - - if (doorL4_pos.getValue() > 0) { - me["Cabin4Left"].show(); - me["Cabin4Left"].setColor(0.7333,0.3803,0); - me["Cabin4Left"].setColorFill(0.7333,0.3803,0); - me["Cabin4LeftLbl"].show(); - me["Cabin4LeftLine"].show(); - } else { - me["Cabin4Left"].setColor(0.0509,0.7529,0.2941); - me["Cabin4Left"].setColorFill(0,0,0); - me["Cabin4LeftLbl"].hide(); - me["Cabin4LeftLine"].hide(); - } - - if (doorR4_pos.getValue() > 0) { - me["Cabin4Right"].show(); - me["Cabin4Right"].setColor(0.7333,0.3803,0); - me["Cabin4Right"].setColorFill(0.7333,0.3803,0); - me["Cabin4RightLbl"].show(); - me["Cabin4RightLine"].show(); - } else { - me["Cabin4Right"].setColor(0.0509,0.7529,0.2941); - me["Cabin4Right"].setColorFill(0,0,0); - me["Cabin4RightLbl"].hide(); - me["Cabin4RightLine"].hide(); - } - - if (cargobulk_pos.getValue() > 0) { - me["Bulk"].setColor(0.7333,0.3803,0); - me["Bulk"].setColorFill(0.7333,0.3803,0); - me["BulkLbl"].show(); - me["BulkLine"].show(); - } else { - me["Bulk"].setColor(0.0509,0.7529,0.2941); - me["Bulk"].setColorFill(0,0,0); - me["BulkLbl"].hide(); - me["BulkLine"].hide(); - } - - if (cargofwd_pos.getValue() > 0) { - me["Cargo1Door"].setColor(0.7333,0.3803,0); - me["Cargo1Door"].setColorFill(0.7333,0.3803,0); - me["Cargo1Lbl"].show(); - me["Cargo1Line"].show(); - } else { - me["Cargo1Door"].setColor(0.0509,0.7529,0.2941); - me["Cargo1Door"].setColorFill(0,0,0); - me["Cargo1Lbl"].hide(); - me["Cargo1Line"].hide(); - } - - if (cargoaft_pos.getValue() > 0) { - me["Cargo2Door"].setColor(0.7333,0.3803,0); - me["Cargo2Door"].setColorFill(0.7333,0.3803,0); - me["Cargo2Lbl"].show(); - me["Cargo2Line"].show(); - } else { - me["Cargo2Door"].setColor(0.0509,0.7529,0.2941); - me["Cargo2Door"].setColorFill(0,0,0); - me["Cargo2Lbl"].hide(); - me["Cargo2Line"].hide(); - } - - me["Cabin1LeftSlide"].hide(); - me["Cabin1RightSlide"].hide(); - me["Cabin2LeftSlide"].hide(); - me["Cabin2RightSlide"].hide(); - me["Cabin3LeftSlide"].hide(); - me["Cabin3RightSlide"].hide(); - me["Cabin4LeftSlide"].hide(); - me["Cabin4RightSlide"].hide(); - - me["DOOROXY-REGUL-LO-PR"].hide(); - me["AvionicsLine1"].hide(); - me["AvionicsLine2"].hide(); - me["AvionicsLbl1"].hide(); - me["AvionicsLbl2"].hide(); - me["ExitLSlide"].hide(); - me["ExitLLine"].hide(); - me["ExitLLbl"].hide(); - me["ExitRSlide"].hide(); - me["ExitRLine"].hide(); - me["ExitRLbl"].hide(); - me["Cabin1LeftSlide"].hide(); - me["Cabin1RightSlide"].hide(); - me["Cabin4LeftSlide"].hide(); - me["Cabin4RightSlide"].hide(); - me["Cabin2Left"].hide(); - me["Cabin2LeftLine"].hide(); - me["Cabin2LeftLbl"].hide(); - me["Cabin2Right"].hide(); - me["Cabin2RightLine"].hide(); - me["Cabin2RightLbl"].hide(); - me["Cabin3Left"].hide(); - me["Cabin3LeftLine"].hide(); - me["Cabin3LeftLbl"].hide(); - me["Cabin3Right"].hide(); - me["Cabin3RightLine"].hide(); - me["Cabin3RightLbl"].hide(); - - me.updateBottomStatus(); - }, -}; - -var canvas_lowerECAM_elec = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_elec, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","BAT1-label","Bat1Volt","Bat1Ampere","BAT2-label","Bat2Volt","Bat2Ampere","BAT1-charge","BAT1-discharge","BAT2-charge","BAT2-discharge","ELEC-Line-DC1-DCBAT","ELEC-Line-DC1-DCESS","ELEC-Line-DC2-DCBAT", - "ELEC-Line-DC1-DCESS_DCBAT","ELEC-Line-DC2-DCESS_DCBAT","ELEC-Line-TR1-DC1","ELEC-Line-TR2-DC2","Shed-label","ELEC-Line-ESSTR-DCESS","TR1-label","TR1Volt","TR1Ampere","TR2-label","TR2Volt","TR2Ampere","EMERGEN-group","EmergenVolt","EmergenHz", - "ELEC-Line-Emergen-ESSTR","EMERGEN-Label-off","Emergen-Label","EMERGEN-out","ELEC-Line-ACESS-TRESS","ELEC-Line-AC1-TR1","ELEC-Line-AC2-TR2","ELEC-Line-AC1-ACESS","ELEC-Line-AC2-ACESS","ACESS-SHED","ACESS","AC1-in","AC2-in","ELEC-Line-GEN1-AC1","ELEC-Line-GEN2-AC2", - "ELEC-Line-APU-AC1","ELEC-Line-APU-EXT","ELEC-Line-EXT-AC2","APU-out","EXT-out","EXTPWR-group","ExtVolt","ExtHz","APU-content","APU-border","APUGentext","APUGenLoad","APUGenVolt","APUGenHz","APUGEN-off","GEN1-label","Gen1Load","Gen1Volt","Gen1Hz", - "GEN2-label","Gen2Load","GEN2-off","Gen2Volt","Gen2Hz","ELEC-IDG-1-label","ELEC-IDG-1-num-label","ELEC-IDG-1-Temp","IDG1-LOPR","IDG1-DISC","IDG1-RISE-Value","IDG1-RISE-label","GalleyShed","ELEC-IDG-2-Temp","ELEC-IDG-2-label","ELEC-IDG-2-num-label","IDG2-RISE-label","IDG2-RISE-Value","IDG2-LOPR", - "IDG2-DISC","ESSTR-group","ESSTR","ESSTR-Volt","ESSTR-Ampere","BAT1-content","BAT2-content","BAT1-OFF","BAT2-OFF","GEN1-content","GEN2-content","GEN-1-num-label","GEN-2-num-label","GEN1-off","GEN2-off","GEN1-num-label","GEN2-num-label","EXTPWR-label", - "ELEC-ACESS-SHED-label","ELEC-DCBAT-label","ELEC-DCESS-label","ELEC-DC2-label","ELEC-DC1-label","ELEC-AC1-label","ELEC-AC2-label","ELEC-ACESS-label","ELEC-Line-ESSTR-DCESS-off","ELEC-Line-Emergen-ESSTR-off"]; - }, - update: func() { - - # BAT1 - if (systems.ELEC.Switch.bat1.getValue() == 0) { - me["BAT1-OFF"].show(); - me["BAT1-content"].hide(); - me["BAT1-discharge"].hide(); - me["BAT1-charge"].hide(); - } else { - me["BAT1-OFF"].hide(); - me["BAT1-content"].show(); - me["Bat1Ampere"].setText(sprintf("%s", math.round(systems.ELEC.Source.Bat1.amps.getValue()))); - me["Bat1Volt"].setText(sprintf("%s", math.round(systems.ELEC.Source.Bat1.volt.getValue()))); - - if (systems.ELEC.Source.Bat1.volt.getValue() >= 24.95 and systems.ELEC.Source.Bat1.volt.getValue() <= 31.05) { - me["Bat1Volt"].setColor(0.0509,0.7529,0.2941); - } else { - me["Bat1Volt"].setColor(0.7333,0.3803,0); - } - - if (systems.ELEC.Source.Bat1.amps.getValue() > 5) { - me["Bat1Ampere"].setColor(0.7333,0.3803,0); - } else { - me["Bat1Ampere"].setColor(0.0509,0.7529,0.2941); - } - - if (systems.ELEC.Source.Bat1.direction.getValue() == 0) { - me["BAT1-discharge"].hide(); - me["BAT1-charge"].hide(); - } else { - if (systems.ELEC.Source.Bat1.direction.getValue() == -1) { - me["BAT1-charge"].show(); - me["BAT1-discharge"].hide(); - } else { - me["BAT1-discharge"].show(); - me["BAT1-charge"].hide(); - } - } - } - - if (systems.ELEC.Light.bat1Fault.getValue() or systems.ELEC.Source.Bat1.volt.getValue() < 25 or systems.ELEC.Source.Bat1.volt.getValue() > 31 or systems.ELEC.Source.Bat1.amps.getValue() > 5) { - me["BAT1-label"].setColor(0.7333,0.3803,0); - } else { - me["BAT1-label"].setColor(0.8078,0.8039,0.8078); - } - - # BAT2 - if (systems.ELEC.Switch.bat2.getValue() == 0) { - me["BAT2-OFF"].show(); - me["BAT2-content"].hide(); - me["BAT2-discharge"].hide(); - me["BAT2-charge"].hide(); - } else { - me["BAT2-OFF"].hide(); - me["BAT2-content"].show(); - me["Bat2Ampere"].setText(sprintf("%s", math.round(systems.ELEC.Source.Bat2.amps.getValue()))); - me["Bat2Volt"].setText(sprintf("%s", math.round(systems.ELEC.Source.Bat2.volt.getValue()))); - - if (systems.ELEC.Source.Bat2.volt.getValue() >= 24.95 and systems.ELEC.Source.Bat2.volt.getValue() <= 31.05) { - me["Bat2Volt"].setColor(0.0509,0.7529,0.2941); - } else { - me["Bat2Volt"].setColor(0.7333,0.3803,0); - } - - if (systems.ELEC.Source.Bat2.amps.getValue() > 5) { - me["Bat2Ampere"].setColor(0.7333,0.3803,0); - } else { - me["Bat2Ampere"].setColor(0.0509,0.7529,0.2941); - } - - if (systems.ELEC.Source.Bat2.direction.getValue() == 0) { - me["BAT2-discharge"].hide(); - me["BAT2-charge"].hide(); - } else { - if (systems.ELEC.Source.Bat2.direction.getValue() == -1) { - me["BAT2-charge"].show(); - me["BAT2-discharge"].hide(); - } else { - me["BAT2-discharge"].show(); - me["BAT2-charge"].hide(); - } - } - } - - if (systems.ELEC.Light.bat2Fault.getValue() or systems.ELEC.Source.Bat2.volt.getValue() < 25 or systems.ELEC.Source.Bat2.volt.getValue() > 31 or systems.ELEC.Source.Bat2.amps.getValue() > 5) { - me["BAT2-label"].setColor(0.7333,0.3803,0); - } else { - me["BAT2-label"].setColor(0.8078,0.8039,0.8078); - } - - # TR1 - # is only powered when ac1 has power - tr1_v = systems.ELEC.Source.tr1.outputVolt.getValue(); - tr1_a = systems.ELEC.Source.tr1.outputAmp.getValue(); - - me["TR1Volt"].setText(sprintf("%s", math.round(tr1_v))); - me["TR1Ampere"].setText(sprintf("%s", math.round(tr1_a))); - - if (tr1_v < 25 or tr1_v > 31 or tr1_a < 5) { - me["TR1-label"].setColor(0.7333,0.3803,0); - } else { - me["TR1-label"].setColor(0.8078,0.8039,0.8078); - } - - if (tr1_v < 25 or tr1_v > 31) { - me["TR1Volt"].setColor(0.7333,0.3803,0); - } else { - me["TR1Volt"].setColor(0.0509,0.7529,0.2941); - } - - if (tr1_a < 5) { - me["TR1Ampere"].setColor(0.7333,0.3803,0); - } else { - me["TR1Ampere"].setColor(0.0509,0.7529,0.2941); - } - - # TR2 - # is only powered when ac2 has power - tr2_v = systems.ELEC.Source.tr2.outputVolt.getValue(); - tr2_a = systems.ELEC.Source.tr2.outputAmp.getValue(); - - me["TR2Volt"].setText(sprintf("%s", math.round(tr2_v))); - me["TR2Ampere"].setText(sprintf("%s", math.round(tr2_a))); - - if (tr2_v < 25 or tr2_v > 31 or tr2_a < 5) { - me["TR2-label"].setColor(0.7333,0.3803,0); - } else { - me["TR2-label"].setColor(0.8078,0.8039,0.8078); - } - - if (tr2_v < 25 or tr2_v > 31) { - me["TR2Volt"].setColor(0.7333,0.3803,0); - } else { - me["TR2Volt"].setColor(0.0509,0.7529,0.2941); - } - - if (tr2_a < 5) { - me["TR2Ampere"].setColor(0.7333,0.3803,0); - } else { - me["TR2Ampere"].setColor(0.0509,0.7529,0.2941); - } - - # ESS TR - essTrvolts = systems.ELEC.Source.trEss.outputVoltRelay.getValue(); - essTramps = systems.ELEC.Source.trEss.outputAmpRelay.getValue(); - if (systems.ELEC.Relay.essTrContactor.getValue()) { - me["ESSTR-group"].show(); - me["ESSTR-Volt"].setText(sprintf("%s", math.round(essTrvolts))); - me["ESSTR-Ampere"].setText(sprintf("%s", math.round(essTramps))); - - if (essTrvolts < 25 or essTrvolts > 31 or essTramps < 5) { - me["ESSTR"].setColor(0.7333,0.3803,0); - } else { - me["ESSTR"].setColor(0.8078,0.8039,0.8078); - } - - if (essTrvolts < 25 or essTrvolts > 31) { - me["ESSTR-Volt"].setColor(0.7333,0.3803,0); - } else { - me["ESSTR-Volt"].setColor(0.0509,0.7529,0.2941); - } - - if (essTramps < 5) { - me["ESSTR-Ampere"].setColor(0.7333,0.3803,0); - } else { - me["ESSTR-Ampere"].setColor(0.0509,0.7529,0.2941); - } - } else { - me["ESSTR-group"].hide(); - } - - # EMER GEN - if (systems.ELEC.Source.EmerGen.volts.getValue() == 0) { - me["EMERGEN-group"].hide(); - me["ELEC-Line-Emergen-ESSTR"].hide(); - me["ELEC-Line-Emergen-ESSTR-off"].show(); - me["EMERGEN-Label-off"].show(); - } else { - me["EMERGEN-group"].show(); - me["ELEC-Line-Emergen-ESSTR"].show(); - me["ELEC-Line-Emergen-ESSTR-off"].hide(); - me["EMERGEN-Label-off"].hide(); - - me["EmergenVolt"].setText(sprintf("%s", math.round(systems.ELEC.Source.EmerGen.voltsRelay.getValue()))); - me["EmergenHz"].setText(sprintf("%s", math.round(systems.ELEC.Source.EmerGen.hertz.getValue()))); - - if (systems.ELEC.Source.EmerGen.voltsRelay.getValue() > 120 or systems.ELEC.Source.EmerGen.voltsRelay.getValue() < 110 or systems.ELEC.Source.EmerGen.hertz.getValue() > 410 or systems.ELEC.Source.EmerGen.hertz.getValue() < 390) { - me["Emergen-Label"].setColor(0.7333,0.3803,0); - } else { - me["Emergen-Label"].setColor(0.8078,0.8039,0.8078); - } - - if (systems.ELEC.Source.EmerGen.voltsRelay.getValue() > 120 or systems.ELEC.Source.EmerGen.voltsRelay.getValue() < 110) { - me["EmergenVolt"].setColor(0.7333,0.3803,0); - } else { - me["EmergenVolt"].setColor(0.0509,0.7529,0.2941); - } - - if (systems.ELEC.Source.EmerGen.hertz.getValue() > 410 or systems.ELEC.Source.EmerGen.hertz.getValue() < 390) { - me["EmergenHz"].setColor(0.7333,0.3803,0); - } else { - me["EmergenHz"].setColor(0.0509,0.7529,0.2941); - } - } - - # IDG 1 - if (!systems.ELEC.Switch.idg1Disc.getBoolValue()) { - me["IDG1-DISC"].show(); - me["ELEC-IDG-1-label"].setColor(0.7333,0.3803,0); - } else { - me["IDG1-DISC"].hide(); - me["ELEC-IDG-1-label"].setColor(0.8078,0.8039,0.8078); - } - - if (eng1_running.getValue() == 0) { - me["ELEC-IDG-1-num-label"].setColor(0.7333,0.3803,0); - } else { - me["ELEC-IDG-1-num-label"].setColor(0.8078,0.8039,0.8078); - } - - if (eng2_running.getValue() == 0) { - me["ELEC-IDG-2-num-label"].setColor(0.7333,0.3803,0); - } else { - me["ELEC-IDG-2-num-label"].setColor(0.8078,0.8039,0.8078); - } - - # IDG 2 - if (!systems.ELEC.Switch.idg2Disc.getBoolValue()) { - me["IDG2-DISC"].show(); - me["ELEC-IDG-2-label"].setColor(0.7333,0.3803,0); - } else { - me["IDG2-DISC"].hide(); - me["ELEC-IDG-2-label"].setColor(0.8078,0.8039,0.8078); - } - - # GEN1 - if (systems.ELEC.Switch.gen1.getValue() == 0) { - me["GEN1-content"].hide(); - me["GEN1-off"].show(); - if (systems.ELEC.Source.IDG1.gcrRelay.getValue()) { - me["GEN1-label"].setColor(0.7333,0.3803,0); - } else { - me["GEN1-label"].setColor(0.8078,0.8039,0.8078); - } - - if (eng1_running.getValue() == 0) { - me["GEN1-num-label"].setColor(0.7333,0.3803,0); - } else { - me["GEN1-num-label"].setColor(0.8078,0.8039,0.8078); - } - } else { - me["GEN1-content"].show(); - me["GEN1-off"].hide(); - # me["Gen1Load"].setText(sprintf("%s", math.round(gen1_load.getValue()))); - me["Gen1Volt"].setText(sprintf("%s", math.round(systems.ELEC.Source.IDG1.volts.getValue()))); - - if (systems.ELEC.Source.IDG1.hertz.getValue() == 0) { - me["Gen1Hz"].setText(sprintf("XX")); - } else { - me["Gen1Hz"].setText(sprintf("%s", math.round(systems.ELEC.Source.IDG1.hertz.getValue()))); - } - - if (eng1_running.getValue() == 0) { - me["GEN1-num-label"].setColor(0.7333,0.3803,0); - } else { - me["GEN1-num-label"].setColor(0.8078,0.8039,0.8078); - } - - if (systems.ELEC.Source.IDG1.volts.getValue() > 120 or systems.ELEC.Source.IDG1.volts.getValue() < 110 or systems.ELEC.Source.IDG1.hertz.getValue() > 410 or systems.ELEC.Source.IDG1.hertz.getValue() < 390 or gen1_load.getValue() >= 110) { - me["GEN1-label"].setColor(0.7333,0.3803,0); - } else { - me["GEN1-label"].setColor(0.8078,0.8039,0.8078); - } - - if (gen1_load.getValue() >= 110) { - me["Gen1Load"].setColor(0.7333,0.3803,0); - } else { - me["Gen1Load"].setColor(0.0509,0.7529,0.2941); - } - - if (systems.ELEC.Source.IDG1.volts.getValue() > 120 or systems.ELEC.Source.IDG1.volts.getValue() < 110) { - me["Gen1Volt"].setColor(0.7333,0.3803,0); - } else { - me["Gen1Volt"].setColor(0.0509,0.7529,0.2941); - } - - if (systems.ELEC.Source.IDG1.hertz.getValue() > 410 or systems.ELEC.Source.IDG1.hertz.getValue() < 390) { - me["Gen1Hz"].setColor(0.7333,0.3803,0); - } else { - me["Gen1Hz"].setColor(0.0509,0.7529,0.2941); - } - } - - # GEN2 - if (systems.ELEC.Switch.gen2.getValue() == 0) { - me["GEN2-content"].hide(); - me["GEN2-off"].show(); - if (systems.ELEC.Source.IDG2.gcrRelay.getValue()) { - me["GEN2-label"].setColor(0.7333,0.3803,0); - } else { - me["GEN2-label"].setColor(0.8078,0.8039,0.8078); - } - - if (eng2_running.getValue() == 0) { - me["GEN2-num-label"].setColor(0.7333,0.3803,0); - } else { - me["GEN2-num-label"].setColor(0.8078,0.8039,0.8078); - } - } else { - me["GEN2-content"].show(); - me["GEN2-off"].hide(); - # me["Gen2Load"].setText(sprintf("%s", math.round(gen2_load.getValue()))); - me["Gen2Volt"].setText(sprintf("%s", math.round(systems.ELEC.Source.IDG2.volts.getValue()))); - if (systems.ELEC.Source.IDG2.hertz.getValue() == 0) { - me["Gen2Hz"].setText(sprintf("XX")); - } else { - me["Gen2Hz"].setText(sprintf("%s", math.round(systems.ELEC.Source.IDG2.hertz.getValue()))); - } - - if (eng2_running.getValue() == 0) { - me["GEN2-num-label"].setColor(0.7333,0.3803,0); - } else { - me["GEN2-num-label"].setColor(0.8078,0.8039,0.8078); - } - - if (systems.ELEC.Source.IDG2.volts.getValue() > 120 or systems.ELEC.Source.IDG2.volts.getValue() < 110 or systems.ELEC.Source.IDG2.hertz.getValue() > 410 or systems.ELEC.Source.IDG2.hertz.getValue() < 390 or gen2_load.getValue() >= 110) { - me["GEN2-label"].setColor(0.7333,0.3803,0); - } else { - me["GEN2-label"].setColor(0.8078,0.8039,0.8078); - } - - if (gen2_load.getValue() >= 110) { - me["Gen2Load"].setColor(0.7333,0.3803,0); - } else { - me["Gen2Load"].setColor(0.0509,0.7529,0.2941); - } - - - if (systems.ELEC.Source.IDG2.volts.getValue() > 120 or systems.ELEC.Source.IDG2.volts.getValue() < 110) { - me["Gen2Volt"].setColor(0.7333,0.3803,0); - } else { - me["Gen2Volt"].setColor(0.0509,0.7529,0.2941); - } - - if (systems.ELEC.Source.IDG2.hertz.getValue() > 410 or systems.ELEC.Source.IDG2.hertz.getValue() < 390) { - me["Gen2Hz"].setColor(0.7333,0.3803,0); - } else { - me["Gen2Hz"].setColor(0.0509,0.7529,0.2941); - } - } - - # APU - if (systems.APUNodes.Controls.master.getValue() == 0) { - me["APU-content"].hide(); - me["APUGEN-off"].hide(); - me["APU-border"].hide(); - me["APUGentext"].setColor(0.8078,0.8039,0.8078); - } else { - me["APU-border"].show(); - if (systems.ELEC.Source.APU.contact.getValue() == 0) { - me["APU-content"].hide(); - me["APUGEN-off"].show(); - me["APUGentext"].setColor(0.7333,0.3803,0); - } else { - me["APU-content"].show(); - me["APUGEN-off"].hide(); - # me["APUGenLoad"].setText(sprintf("%s", math.round(apu_load.getValue()))); - me["APUGenVolt"].setText(sprintf("%s", math.round(systems.ELEC.Source.APU.volts.getValue()))); - - if (systems.ELEC.Source.APU.hertz.getValue() == 0) { - me["APUGenHz"].setText(sprintf("XX")); - } else { - me["APUGenHz"].setText(sprintf("%s", math.round(systems.ELEC.Source.APU.hertz.getValue()))); - } - - if (systems.ELEC.Source.APU.volts.getValue() > 120 or systems.ELEC.Source.APU.volts.getValue() < 110 or systems.ELEC.Source.APU.hertz.getValue() > 410 or systems.ELEC.Source.APU.hertz.getValue() < 390 or apu_load.getValue() >= 110) { - me["APUGentext"].setColor(0.7333,0.3803,0); - } else { - me["APUGentext"].setColor(0.8078,0.8039,0.8078); - } - - if(apu_load.getValue() >= 110) { - me["APUGenLoad"].setColor(0.7333,0.3803,0); - } else { - me["APUGenLoad"].setColor(0.0509,0.7529,0.2941); - } - - if (systems.ELEC.Source.APU.volts.getValue() > 120 or systems.ELEC.Source.APU.volts.getValue() < 110) { - me["APUGenVolt"].setColor(0.7333,0.3803,0); - } else { - me["APUGenVolt"].setColor(0.0509,0.7529,0.2941); - } - - if (systems.ELEC.Source.APU.hertz.getValue() > 410 or systems.ELEC.Source.APU.hertz.getValue() < 390) { - me["APUGenHz"].setColor(0.7333,0.3803,0); - } else { - me["APUGenHz"].setColor(0.0509,0.7529,0.2941); - } - } - } - - # EXT PWR - - if (switch_cart.getValue() == 0) { - me["EXTPWR-group"].hide(); - } else { - me["EXTPWR-group"].show(); - me["ExtVolt"].setText(sprintf("%s", math.round(systems.ELEC.Source.Ext.volts.getValue()))); - me["ExtHz"].setText(sprintf("%s", math.round(systems.ELEC.Source.Ext.hertz.getValue()))); - - if (systems.ELEC.Source.Ext.hertz.getValue() > 410 or systems.ELEC.Source.Ext.hertz.getValue() < 390 or systems.ELEC.Source.Ext.volts.getValue() > 120 or systems.ELEC.Source.Ext.volts.getValue() < 110) { - me["EXTPWR-label"].setColor(0.7333,0.3803,0); - } else { - me["EXTPWR-label"].setColor(0.0509,0.7529,0.2941); - } - - if (systems.ELEC.Source.Ext.hertz.getValue() > 410 or systems.ELEC.Source.Ext.hertz.getValue() < 390) { - me["ExtHz"].setColor(0.7333,0.3803,0); - } else { - me["ExtHz"].setColor(0.0509,0.7529,0.2941); - } - - if (systems.ELEC.Source.Ext.volts.getValue() > 120 or systems.ELEC.Source.Ext.volts.getValue() < 110) { - me["ExtVolt"].setColor(0.7333,0.3803,0); - } else { - me["ExtVolt"].setColor(0.0509,0.7529,0.2941); - } - } - - if (systems.ELEC.SomeThing.galley.getValue()) { - me["GalleyShed"].show(); - } else { - me["GalleyShed"].hide(); - } - - # Bus indicators - if (systems.ELEC.Switch.bat1.getValue() or systems.ELEC.Switch.bat2.getValue()) { - me["ELEC-DCBAT-label"].setText("DC BAT"); - if (systems.ELEC.Bus.dcBat.getValue() > 25) { - me["ELEC-DCBAT-label"].setColor(0.0509,0.7529,0.2941); - } else { - me["ELEC-DCBAT-label"].setColor(0.7333,0.3803,0); - } - } else { - me["ELEC-DCBAT-label"].setText("XX"); # BCL not powered hence no voltage info supplied from BCL - me["ELEC-DCBAT-label"].setColor(0.7333,0.3803,0); - } - - if (systems.ELEC.Bus.dc1.getValue() > 25) { - me["ELEC-DC1-label"].setColor(0.0509,0.7529,0.2941); - } else { - me["ELEC-DC1-label"].setColor(0.7333,0.3803,0); - } - - if (systems.ELEC.Bus.dc2.getValue() > 25) { - me["ELEC-DC2-label"].setColor(0.0509,0.7529,0.2941); - } else { - me["ELEC-DC2-label"].setColor(0.7333,0.3803,0); - } - - if (systems.ELEC.Bus.dcEss.getValue() > 25) { - me["ELEC-DCESS-label"].setColor(0.0509,0.7529,0.2941); - } else { - me["ELEC-DCESS-label"].setColor(0.7333,0.3803,0); - } - - if (systems.ELEC.Bus.acEss.getValue() >= 110) { - me["ELEC-ACESS-label"].setColor(0.0509,0.7529,0.2941); - } else { - me["ELEC-ACESS-label"].setColor(0.7333,0.3803,0); - } - - if (systems.ELEC.Bus.acEssShed.getValue() >= 110) { - me["ACESS-SHED"].hide(); - } else { - me["ACESS-SHED"].show(); - } - - if (systems.ELEC.Bus.ac1.getValue() >= 110) { - me["ELEC-AC1-label"].setColor(0.0509,0.7529,0.2941); - } else { - me["ELEC-AC1-label"].setColor(0.7333,0.3803,0); - } - - if (systems.ELEC.Bus.ac2.getValue() >= 110) { - me["ELEC-AC2-label"].setColor(0.0509,0.7529,0.2941); - } else { - me["ELEC-AC2-label"].setColor(0.7333,0.3803,0); - } - - - # Managment of the connecting lines between the components - if (systems.ELEC.Relay.apuGlc.getValue() and (systems.ELEC.Relay.acTie1.getValue() or systems.ELEC.Relay.acTie2.getValue())) { - me["APU-out"].show(); - } else { - me["APU-out"].hide(); - } - - if (systems.ELEC.Relay.extEpc.getValue() and (systems.ELEC.Relay.acTie1.getValue() or systems.ELEC.Relay.acTie2.getValue())) { - me["EXT-out"].show(); - } else { - me["EXT-out"].hide(); - } - - if (systems.ELEC.Source.IDG1.volts.getValue() >= 110 and systems.ELEC.Relay.glc1.getValue()) { - me["ELEC-Line-GEN1-AC1"].show(); - } else { - me["ELEC-Line-GEN1-AC1"].hide(); - } - - if (systems.ELEC.Source.IDG2.volts.getValue() >= 110 and systems.ELEC.Relay.glc2.getValue()) { - me["ELEC-Line-GEN2-AC2"].show(); - } else { - me["ELEC-Line-GEN2-AC2"].hide(); - } - - if (systems.ELEC.Bus.ac1.getValue() >= 110) { - me["AC1-in"].show(); - } else { - me["AC1-in"].hide(); - } - - if (systems.ELEC.Bus.ac2.getValue() >= 110) { - me["AC2-in"].show(); - } else { - me["AC2-in"].hide(); - } - - if (systems.ELEC.Relay.acTie1.getValue() and systems.ELEC.Relay.acTie2.getValue()) { - me["ELEC-Line-APU-AC1"].show(); - me["ELEC-Line-APU-EXT"].show(); - me["ELEC-Line-EXT-AC2"].show(); - } else { - if (systems.ELEC.Relay.acTie1.getValue()) { - me["ELEC-Line-APU-AC1"].show(); - } else { - me["ELEC-Line-APU-AC1"].hide(); - } - - if ((systems.ELEC.Relay.acTie2.getValue() and systems.ELEC.Relay.apuGlc.getValue() and !systems.ELEC.Relay.glc2.getValue()) or (systems.ELEC.Relay.acTie1.getValue() and systems.ELEC.Relay.extEpc.getValue() and !systems.ELEC.Relay.glc1.getValue())) { - me["ELEC-Line-APU-EXT"].show(); - } else { - me["ELEC-Line-APU-EXT"].hide(); - } - - if (systems.ELEC.Relay.acTie2.getValue()) { - me["ELEC-Line-EXT-AC2"].show(); - } else { - me["ELEC-Line-EXT-AC2"].hide(); - } - } - - if (systems.ELEC.Relay.acEssFeed1.getValue()) { - if (systems.ELEC.Bus.ac1.getValue() >= 110) { - me["ELEC-Line-AC1-ACESS"].show(); - } else { - me["ELEC-Line-AC1-ACESS"].hide(); - } - me["ELEC-Line-AC2-ACESS"].hide(); - } elsif (systems.ELEC.Relay.acEssFeed2.getValue()) { - me["ELEC-Line-AC1-ACESS"].hide(); - if (systems.ELEC.Bus.ac2.getValue() >= 110) { - me["ELEC-Line-AC2-ACESS"].show(); - } else { - me["ELEC-Line-AC2-ACESS"].hide(); - } - } else { - me["ELEC-Line-AC1-ACESS"].hide(); - me["ELEC-Line-AC2-ACESS"].hide(); - } - - if (systems.ELEC.Relay.tr1Contactor.getValue()) { - if (systems.ELEC.Bus.ac1.getValue() < 110) { - me["ELEC-Line-AC1-TR1"].setColorFill(0.7333,0.3803,0); - } else { - me["ELEC-Line-AC1-TR1"].setColorFill(0.0509,0.7529,0.2941); - } - me["ELEC-Line-AC1-TR1"].show(); - me["ELEC-Line-TR1-DC1"].show(); - } else { - me["ELEC-Line-AC1-TR1"].hide(); - me["ELEC-Line-TR1-DC1"].hide(); - } - - if (systems.ELEC.Relay.tr2Contactor.getValue()) { - if (systems.ELEC.Bus.ac2.getValue() < 110) { - me["ELEC-Line-AC2-TR2"].setColorFill(0.7333,0.3803,0); - } else { - me["ELEC-Line-AC2-TR2"].setColorFill(0.0509,0.7529,0.2941); - } - me["ELEC-Line-AC2-TR2"].show(); - me["ELEC-Line-TR2-DC2"].show(); - } else { - me["ELEC-Line-AC2-TR2"].hide(); - me["ELEC-Line-TR2-DC2"].hide(); - } - - if (systems.ELEC.Relay.dcTie1.getValue()) { - me["ELEC-Line-DC1-DCESS_DCBAT"].show(); - } else { - me["ELEC-Line-DC1-DCESS_DCBAT"].hide(); - } - - if (systems.ELEC.Relay.dcEssFeedBat.getValue()) { - me["ELEC-Line-DC1-DCESS"].show(); - } else { - me["ELEC-Line-DC1-DCESS"].hide(); - } - - if (systems.ELEC.Relay.dcEssFeedBat.getValue() or systems.ELEC.Relay.dcTie1.getValue()) { - me["ELEC-Line-DC1-DCBAT"].show(); - } else { - me["ELEC-Line-DC1-DCBAT"].hide(); - } - - if (systems.ELEC.Relay.dcTie2.getValue()) { - me["ELEC-Line-DC2-DCBAT"].show(); - me["ELEC-Line-DC2-DCESS_DCBAT"].show(); - } else { - me["ELEC-Line-DC2-DCBAT"].hide(); - me["ELEC-Line-DC2-DCESS_DCBAT"].hide(); - } - - if (systems.ELEC.Relay.acEssEmerGenFeed.getValue()) { - me["EMERGEN-out"].show(); - me["ELEC-Line-Emergen-ESSTR"].show(); - } else { - me["EMERGEN-out"].hide(); - me["ELEC-Line-Emergen-ESSTR"].hide(); - } - - if (systems.ELEC.Bus.acEss.getValue() >= 110 and !systems.ELEC.Relay.acEssEmerGenFeed.getValue() and (!systems.ELEC.Relay.tr1Contactor.getValue() or !systems.ELEC.Relay.tr2Contactor.getValue())) { - me["ELEC-Line-ACESS-TRESS"].show(); - } else { - me["ELEC-Line-ACESS-TRESS"].hide(); - } - - if (systems.ELEC.Relay.essTrContactor.getValue()) { - me["ELEC-Line-ESSTR-DCESS"].show(); - } else { - me["ELEC-Line-ESSTR-DCESS"].hide(); - } - - # hide not yet implemented items - me["IDG1-LOPR"].hide(); - me["IDG2-LOPR"].hide(); - me["Shed-label"].hide(); - me["IDG2-RISE-label"].hide(); - me["IDG2-RISE-Value"].hide(); - me["IDG1-RISE-label"].hide(); - me["IDG1-RISE-Value"].hide(); - - me.updateBottomStatus(); - }, -}; - -var canvas_lowerECAM_eng = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_eng, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","OilQT1-needle","OilQT2-needle","OilQT1","OilQT2","OilQT1-decimal","OilQT2-decimal","OilPSI1-needle","OilPSI2-needle","OilPSI1","OilPSI2","FUEL-used-1","FUEL-used-2", "Fused-weight-unit"]; - }, - update: func() { - # Oil Quantity - me["OilQT1"].setText(sprintf("%s", int(oil_qt1_actual.getValue()))); - me["OilQT2"].setText(sprintf("%s", int(oil_qt2_actual.getValue()))); - me["OilQT1-decimal"].setText(sprintf("%s", int(10*math.mod(oil_qt1_actual.getValue(),1)))); - me["OilQT2-decimal"].setText(sprintf("%s", int(10*math.mod(oil_qt2_actual.getValue(),1)))); - - me["OilQT1-needle"].setRotation((oil_qt1.getValue() + 90) * D2R); - me["OilQT2-needle"].setRotation((oil_qt2.getValue() + 90) * D2R); - - # Oil Pressure - if (pts.Engines.Engine.oilPsi[0].getValue() >= 20) { - me["OilPSI1"].setColor(0.0509,0.7529,0.2941); - me["OilPSI1-needle"].setColor(0.0509,0.7529,0.2941); - } else { - me["OilPSI1"].setColor(1,0,0); - me["OilPSI1-needle"].setColor(1,0,0); - } - - if (pts.Engines.Engine.oilPsi[1].getValue() >= 20) { - me["OilPSI2"].setColor(0.0509,0.7529,0.2941); - me["OilPSI2-needle"].setColor(0.0509,0.7529,0.2941); - } else { - me["OilPSI2"].setColor(1,0,0); - me["OilPSI2-needle"].setColor(1,0,0); - } - - me["OilPSI1"].setText(sprintf("%s", math.round(pts.Engines.Engine.oilPsi[0].getValue()))); - me["OilPSI2"].setText(sprintf("%s", math.round(pts.Engines.Engine.oilPsi[1].getValue()))); - - me["OilPSI1-needle"].setRotation((oil_psi1.getValue() + 90) * D2R); - me["OilPSI2-needle"].setRotation((oil_psi2.getValue() + 90) * D2R); - - # Fuel Used - if (acconfig_weight_kgs.getValue()) { - me["FUEL-used-1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue() * LBS2KGS, 10))); - me["FUEL-used-2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue() * LBS2KGS, 10))); - me["Fused-weight-unit"].setText("KG"); - } else { - me["FUEL-used-1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue(), 10))); - me["FUEL-used-2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue(), 10))); - me["Fused-weight-unit"].setText("LBS"); - } - - me.updateBottomStatus(); - }, -}; - -var canvas_lowerECAM_fctl = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_fctl, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","ailL","ailR","elevL","elevR","PTcc","PT","PTupdn","elac1","elac2","sec1","sec2","sec3","ailLblue","ailRblue","elevLblue","elevRblue","rudderblue","ailLgreen","ailRgreen","elevLgreen","ruddergreen","PTgreen", - "elevRyellow","rudderyellow","PTyellow","rudder","spdbrkblue","spdbrkgreen","spdbrkyellow","spoiler1Rex","spoiler1Rrt","spoiler2Rex","spoiler2Rrt","spoiler3Rex","spoiler3Rrt","spoiler4Rex","spoiler4Rrt","spoiler5Rex","spoiler5Rrt","spoiler1Lex", - "spoiler1Lrt","spoiler2Lex","spoiler2Lrt","spoiler3Lex","spoiler3Lrt","spoiler4Lex","spoiler4Lrt","spoiler5Lex","spoiler5Lrt","spoiler1Rf","spoiler2Rf","spoiler3Rf","spoiler4Rf","spoiler5Rf","spoiler1Lf","spoiler2Lf","spoiler3Lf","spoiler4Lf", - "spoiler5Lf","ailLscale","ailRscale","path4249","path4249-3","path4249-3-6-7","path4249-3-6-7-5","path4249-3-6","text4343"]; - }, - update: func() { - blue_psi = systems.HYD.Psi.blue.getValue(); - green_psi = systems.HYD.Psi.green.getValue(); - yellow_psi = systems.HYD.Psi.yellow.getValue(); - elac1Node = fbw.FBW.Computers.elac1.getValue(); - elac2Node = fbw.FBW.Computers.elac2.getValue(); - sec1Node = fbw.FBW.Computers.sec1.getValue(); - sec2Node = fbw.FBW.Computers.sec2.getValue(); - - # Pitch Trim - me["PT"].setText(sprintf("%2.1f", math.round(elevator_trim_deg.getValue(), 0.1))); - - if (math.round(elevator_trim_deg.getValue(), 0.1) >= 0) { - me["PTupdn"].setText(sprintf("UP")); - } else if (math.round(elevator_trim_deg.getValue(), 0.1) < 0) { - me["PTupdn"].setText(sprintf("DN")); - } - - if (green_psi < 1500 and yellow_psi < 1500) { - me["PT"].setColor(0.7333,0.3803,0); - me["PTupdn"].setColor(0.7333,0.3803,0); - me["PTcc"].setColor(0.7333,0.3803,0); - } else { - me["PT"].setColor(0.0509,0.7529,0.2941); - me["PTupdn"].setColor(0.0509,0.7529,0.2941); - me["PTcc"].setColor(0.0509,0.7529,0.2941); - } - - if (fbw.FBW.Failures.ths.getBoolValue()) { - me["text4343"].setColor(0.7333,0.3803,0); - } else { - me["text4343"].setColor(0.8078,0.8039,0.8078); - } - - # Ailerons - me["ailL"].setTranslation(0, aileron_ind_left.getValue() * 100); - me["ailR"].setTranslation(0, aileron_ind_right.getValue() * (-100)); - - if ((blue_psi < 1500 or !elac1Node) and (green_psi < 1500 or !elac2Node)) { - me["ailL"].setColor(0.7333,0.3803,0); - } else { - me["ailL"].setColor(0.0509,0.7529,0.2941); - } - - if ((green_psi < 1500 or !elac1Node) and (blue_psi < 1500 or !elac2Node)) { - me["ailR"].setColor(0.7333,0.3803,0); - } else { - me["ailR"].setColor(0.0509,0.7529,0.2941); - } - - # Elevators - me["elevL"].setTranslation(0, elevator_ind_left.getValue() * 100); - me["elevR"].setTranslation(0, elevator_ind_right.getValue() * 100); - - if ((blue_psi < 1500 or (!elac1Node and !sec1Node)) and (green_psi < 1500 or (!elac2Node and !sec2Node))) { - me["elevL"].setColor(0.7333,0.3803,0); - } else { - me["elevL"].setColor(0.0509,0.7529,0.2941); - } - - if ((blue_psi < 1500 or (!elac1Node and !sec1Node)) and (yellow_psi < 1500 or (!elac2Node and !sec2Node))) { - me["elevR"].setColor(0.7333,0.3803,0); - } else { - me["elevR"].setColor(0.0509,0.7529,0.2941); - } - - # Rudder - me["rudder"].setRotation(final_deg.getValue() * -0.024); - - if (blue_psi < 1500 and yellow_psi < 1500 and green_psi < 1500) { - me["rudder"].setColor(0.7333,0.3803,0); - } else { - me["rudder"].setColor(0.0509,0.7529,0.2941); - } - - # Spoilers - if (spoiler_L1.getValue() < 1.5) { - me["spoiler1Lex"].hide(); - me["spoiler1Lrt"].show(); - } else { - me["spoiler1Lrt"].hide(); - me["spoiler1Lex"].show(); - } - - if (spoiler_L2.getValue() < 1.5) { - me["spoiler2Lex"].hide(); - me["spoiler2Lrt"].show(); - } else { - me["spoiler2Lrt"].hide(); - me["spoiler2Lex"].show(); - } - - if (spoiler_L3.getValue() < 1.5) { - me["spoiler3Lex"].hide(); - me["spoiler3Lrt"].show(); - } else { - me["spoiler3Lrt"].hide(); - me["spoiler3Lex"].show(); - } - - if (spoiler_L4.getValue() < 1.5) { - me["spoiler4Lex"].hide(); - me["spoiler4Lrt"].show(); - } else { - me["spoiler4Lrt"].hide(); - me["spoiler4Lex"].show(); - } - - if (spoiler_L5.getValue() < 1.5) { - me["spoiler5Lex"].hide(); - me["spoiler5Lrt"].show(); - } else { - me["spoiler5Lrt"].hide(); - me["spoiler5Lex"].show(); - } - - if (spoiler_R1.getValue() < 1.5) { - me["spoiler1Rex"].hide(); - me["spoiler1Rrt"].show(); - } else { - me["spoiler1Rrt"].hide(); - me["spoiler1Rex"].show(); - } - - if (spoiler_R2.getValue() < 1.5) { - me["spoiler2Rex"].hide(); - me["spoiler2Rrt"].show(); - } else { - me["spoiler2Rrt"].hide(); - me["spoiler2Rex"].show(); - } - - if (spoiler_R3.getValue() < 1.5) { - me["spoiler3Rex"].hide(); - me["spoiler3Rrt"].show(); - } else { - me["spoiler3Rrt"].hide(); - me["spoiler3Rex"].show(); - } - - if (spoiler_R4.getValue() < 1.5) { - me["spoiler4Rex"].hide(); - me["spoiler4Rrt"].show(); - } else { - me["spoiler4Rrt"].hide(); - me["spoiler4Rex"].show(); - } - - if (spoiler_R5.getValue() < 1.5) { - me["spoiler5Rex"].hide(); - me["spoiler5Rrt"].show(); - } else { - me["spoiler5Rrt"].hide(); - me["spoiler5Rex"].show(); - } - - # Spoiler Fail - if (fbw.FBW.Failures.spoilerl1.getValue() or green_psi < 1500) { - me["spoiler1Lex"].setColor(0.7333,0.3803,0); - me["spoiler1Lrt"].setColor(0.7333,0.3803,0); - if (spoiler_L1.getValue() < 1.5) { - me["spoiler1Lf"].show(); - } else { - me["spoiler1Lf"].hide(); - } - } else { - me["spoiler1Lex"].setColor(0.0509,0.7529,0.2941); - me["spoiler1Lrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler1Lf"].hide(); - } - - if (fbw.FBW.Failures.spoilerl2.getValue() or yellow_psi < 1500) { - me["spoiler2Lex"].setColor(0.7333,0.3803,0); - me["spoiler2Lrt"].setColor(0.7333,0.3803,0); - if (spoiler_L2.getValue() < 1.5) { - me["spoiler2Lf"].show(); - } else { - me["spoiler2Lf"].hide(); - } - } else { - me["spoiler2Lex"].setColor(0.0509,0.7529,0.2941); - me["spoiler2Lrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler2Lf"].hide(); - } - - if (fbw.FBW.Failures.spoilerl3.getValue() or blue_psi < 1500) { - me["spoiler3Lex"].setColor(0.7333,0.3803,0); - me["spoiler3Lrt"].setColor(0.7333,0.3803,0); - if (spoiler_L3.getValue() < 1.5) { - me["spoiler3Lf"].show(); - } else { - me["spoiler3Lf"].hide(); - } - } else { - me["spoiler3Lex"].setColor(0.0509,0.7529,0.2941); - me["spoiler3Lrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler3Lf"].hide(); - } - - if (fbw.FBW.Failures.spoilerl4.getValue() or yellow_psi < 1500) { - me["spoiler4Lex"].setColor(0.7333,0.3803,0); - me["spoiler4Lrt"].setColor(0.7333,0.3803,0); - if (spoiler_L4.getValue() < 1.5) { - me["spoiler4Lf"].show(); - } else { - me["spoiler4Lf"].hide(); - } - } else { - me["spoiler4Lex"].setColor(0.0509,0.7529,0.2941); - me["spoiler4Lrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler4Lf"].hide(); - } - - if (fbw.FBW.Failures.spoilerl5.getValue() or green_psi < 1500) { - me["spoiler5Lex"].setColor(0.7333,0.3803,0); - me["spoiler5Lrt"].setColor(0.7333,0.3803,0); - if (spoiler_L5.getValue() < 1.5) { - me["spoiler5Lf"].show(); - } else { - me["spoiler5Lf"].hide(); - } - } else { - me["spoiler5Lex"].setColor(0.0509,0.7529,0.2941); - me["spoiler5Lrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler5Lf"].hide(); - } - - if (fbw.FBW.Failures.spoilerr1.getValue() or green_psi < 1500) { - me["spoiler1Rex"].setColor(0.7333,0.3803,0); - me["spoiler1Rrt"].setColor(0.7333,0.3803,0); - if (spoiler_R1.getValue() < 1.5) { - me["spoiler1Rf"].show(); - } else { - me["spoiler1Rf"].hide(); - } - } else { - me["spoiler1Rex"].setColor(0.0509,0.7529,0.2941); - me["spoiler1Rrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler1Rf"].hide(); - } - - if (fbw.FBW.Failures.spoilerr2.getValue() or yellow_psi < 1500) { - me["spoiler2Rex"].setColor(0.7333,0.3803,0); - me["spoiler2Rrt"].setColor(0.7333,0.3803,0); - if (spoiler_R2.getValue() < 1.5) { - me["spoiler2Rf"].show(); - } else { - me["spoiler2Rf"].hide(); - } - } else { - me["spoiler2Rex"].setColor(0.0509,0.7529,0.2941); - me["spoiler2Rrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler2Rf"].hide(); - } - - if (fbw.FBW.Failures.spoilerr3.getValue() or blue_psi < 1500) { - me["spoiler3Rex"].setColor(0.7333,0.3803,0); - me["spoiler3Rrt"].setColor(0.7333,0.3803,0); - if (spoiler_R3.getValue() < 1.5) { - me["spoiler3Rf"].show(); - } else { - me["spoiler3Rf"].hide(); - } - } else { - me["spoiler3Rex"].setColor(0.0509,0.7529,0.2941); - me["spoiler3Rrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler3Rf"].hide(); - } - - if (fbw.FBW.Failures.spoilerr4.getValue() or yellow_psi < 1500) { - me["spoiler4Rex"].setColor(0.7333,0.3803,0); - me["spoiler4Rrt"].setColor(0.7333,0.3803,0); - if (spoiler_R4.getValue() < 1.5) { - me["spoiler4Rf"].show(); - } else { - me["spoiler4Rf"].hide(); - } - } else { - me["spoiler4Rex"].setColor(0.0509,0.7529,0.2941); - me["spoiler4Rrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler4Rf"].hide(); - } - - if (fbw.FBW.Failures.spoilerr5.getValue() or green_psi < 1500) { - me["spoiler5Rex"].setColor(0.7333,0.3803,0); - me["spoiler5Rrt"].setColor(0.7333,0.3803,0); - if (spoiler_R5.getValue() < 1.5) { - me["spoiler5Rf"].show(); - } else { - me["spoiler5Rf"].hide(); - } - } else { - me["spoiler5Rex"].setColor(0.0509,0.7529,0.2941); - me["spoiler5Rrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler5Rf"].hide(); - } - - # Flight Computers - if (elac1Node) { - me["elac1"].setColor(0.0509,0.7529,0.2941); - me["path4249"].setColor(0.0509,0.7529,0.2941); - } else if (!elac1Node or fbw.FBW.Failures.elac1.getValue()) { - me["elac1"].setColor(0.7333,0.3803,0); - me["path4249"].setColor(0.7333,0.3803,0); - } - - if (elac2Node) { - me["elac2"].setColor(0.0509,0.7529,0.2941); - me["path4249-3"].setColor(0.0509,0.7529,0.2941); - } else if (!elac2Node or fbw.FBW.Failures.elac2.getValue()) { - me["elac2"].setColor(0.7333,0.3803,0); - me["path4249-3"].setColor(0.7333,0.3803,0); - } - - if (sec1Node) { - me["sec1"].setColor(0.0509,0.7529,0.2941); - me["path4249-3-6-7"].setColor(0.0509,0.7529,0.2941); - } else if (!sec1Node or fbw.FBW.Failures.sec1.getValue()) { - me["sec1"].setColor(0.7333,0.3803,0); - me["path4249-3-6-7"].setColor(0.7333,0.3803,0); - } - - if (sec2Node) { - me["sec2"].setColor(0.0509,0.7529,0.2941); - me["path4249-3-6-7-5"].setColor(0.0509,0.7529,0.2941); - } else if (!sec2Node or fbw.FBW.Failures.sec2.getValue()) { - me["sec2"].setColor(0.7333,0.3803,0); - me["path4249-3-6-7-5"].setColor(0.7333,0.3803,0); - } - - if (fbw.FBW.Computers.sec3.getValue()) { - me["sec3"].setColor(0.0509,0.7529,0.2941); - me["path4249-3-6"].setColor(0.0509,0.7529,0.2941); - } else if (!fbw.FBW.Computers.sec3.getValue() or fbw.FBW.Failures.sec3.getValue()) { - me["sec3"].setColor(0.7333,0.3803,0); - me["path4249-3-6"].setColor(0.7333,0.3803,0); - } - - # Hydraulic Indicators - if (blue_psi >= 1500) { - if (elac1Node) { - me["ailLblue"].setColor(0.0509,0.7529,0.2941); - } else { - me["ailLblue"].setColor(0.7333,0.3803,0); - } - if (elac1Node or sec1Node) { - me["elevLblue"].setColor(0.0509,0.7529,0.2941); - me["elevRblue"].setColor(0.0509,0.7529,0.2941); - } else { - me["elevLblue"].setColor(0.7333,0.3803,0); - me["elevRblue"].setColor(0.7333,0.3803,0); - } - if (elac2Node) { - me["ailRblue"].setColor(0.0509,0.7529,0.2941); - } else { - me["ailRblue"].setColor(0.7333,0.3803,0); - } - me["rudderblue"].setColor(0.0509,0.7529,0.2941); - me["spdbrkblue"].setColor(0.0509,0.7529,0.2941); - } else { - me["ailLblue"].setColor(0.7333,0.3803,0); - me["ailRblue"].setColor(0.7333,0.3803,0); - me["elevLblue"].setColor(0.7333,0.3803,0); - me["elevRblue"].setColor(0.7333,0.3803,0); - me["rudderblue"].setColor(0.7333,0.3803,0); - me["spdbrkblue"].setColor(0.7333,0.3803,0); - } - - if (green_psi >= 1500) { - if (elac2Node or sec2Node) { - me["elevLgreen"].setColor(0.0509,0.7529,0.2941); - } else { - me["elevLgreen"].setColor(0.7333,0.3803,0); - } - - if (elac2Node) { - me["ailLgreen"].setColor(0.0509,0.7529,0.2941); - } else { - me["ailLgreen"].setColor(0.7333,0.3803,0); - } - if (elac1Node) { - me["ailRgreen"].setColor(0.0509,0.7529,0.2941); - } else { - me["ailRgreen"].setColor(0.7333,0.3803,0); - } - me["ruddergreen"].setColor(0.0509,0.7529,0.2941); - me["PTgreen"].setColor(0.0509,0.7529,0.2941); - me["spdbrkgreen"].setColor(0.0509,0.7529,0.2941); - } else { - me["ailLgreen"].setColor(0.7333,0.3803,0); - me["ailRgreen"].setColor(0.7333,0.3803,0); - me["elevLgreen"].setColor(0.7333,0.3803,0); - me["ruddergreen"].setColor(0.7333,0.3803,0); - me["PTgreen"].setColor(0.7333,0.3803,0); - me["spdbrkgreen"].setColor(0.7333,0.3803,0); - } - - if (yellow_psi >= 1500) { - if (elac2Node or sec2Node) { - me["elevRyellow"].setColor(0.0509,0.7529,0.2941); - } else { - me["elevRyellow"].setColor(0.7333,0.3803,0); - } - me["rudderyellow"].setColor(0.0509,0.7529,0.2941); - me["PTyellow"].setColor(0.0509,0.7529,0.2941); - me["spdbrkyellow"].setColor(0.0509,0.7529,0.2941); - } else { - me["elevRyellow"].setColor(0.7333,0.3803,0); - me["rudderyellow"].setColor(0.7333,0.3803,0); - me["PTyellow"].setColor(0.7333,0.3803,0); - me["spdbrkyellow"].setColor(0.7333,0.3803,0); - } - - me.updateBottomStatus(); - }, -}; - -var canvas_lowerECAM_fuel = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_fuel, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","FUEL-Pump-Left-1","FUEL-Pump-Left-2","FUEL-Pump-Center-1","FUEL-Pump-Center-2","FUEL-Pump-Right-1","FUEL-Pump-Right-2","FUEL-Left-blocked","FUEL-Right-blocked","FUEL-Center-blocked","FUEL-Left-Transfer", - "FUEL-Right-Transfer","FUEL-Left-Outer-Inacc","FUEL-Left-Inner-Inacc","FUEL-Center-Inacc","FUEL-Right-Inner-Inacc","FUEL-Right-Outer-Inacc","FUEL-Left-Outer-quantity","FUEL-Left-Inner-quantity","FUEL-Center-quantity","FUEL-Right-Inner-quantity", - "FUEL-Right-Outer-quantity","FUEL-On-Board","FUEL-Flow-per-min","FUEL-APU-arrow","FUEL-APU-line","FUEL-APU-label","FUEL-used-1","FUEL-used-both","FUEL-used-2","FUEL-ENG-Master-1","FUEL-ENG-Master-2","FUEL-XFEED","FUEL-XFEED-pipes","FUEL-Left-Outer-temp", - "FUEL-Left-Inner-temp","FUEL-Right-Inner-temp","FUEL-Right-Outer-temp","FUEL-Pump-Left-1-Closed","FUEL-Pump-Left-1-Open","FUEL-Pump-Left-2-Closed","FUEL-Pump-Left-2-Open","FUEL-Pump-Center-1-Open","FUEL-Pump-Center-1-Closed","FUEL-Pump-Center-2-Closed", - "FUEL-Pump-Center-2-Open","FUEL-Pump-Right-1-Closed","FUEL-Pump-Right-1-Open","FUEL-Pump-Right-2-Closed","FUEL-Pump-Right-2-Open","FUEL-ENG-1-label","FUEL-ENG-2-label","FUEL-ENG-1-pipe","FUEL-ENG-2-pipe","ENG1idFFlow","ENG2idFFlow","FUEL-used-1","FUEL-used-2","FUEL-used-both", - "Fused-weight-unit","FFlow-weight-unit","FOB-weight-unit"]; - }, - update: func() { - _weight_kgs = acconfig_weight_kgs.getValue(); - - if (pts.Engines.Engine.n1Actual[0].getValue() <= 18.8) { - me["ENG1idFFlow"].setColor(0.7333,0.3803,0); - me["FUEL-ENG-1-label"].setColor(0.7333,0.3803,0); - } else { - me["ENG1idFFlow"].setColor(0.8078,0.8039,0.8078); - me["FUEL-ENG-1-label"].setColor(0.8078,0.8039,0.8078); - } - - if (pts.Engines.Engine.n1Actual[1].getValue() <= 18.5) { - me["ENG2idFFlow"].setColor(0.7333,0.3803,0); - me["FUEL-ENG-2-label"].setColor(0.7333,0.3803,0); - } else { - me["ENG2idFFlow"].setColor(0.8078,0.8039,0.8078); - me["FUEL-ENG-2-label"].setColor(0.8078,0.8039,0.8078); - } - - # TODO add FOB half-boxed amber if some fuel is blocked - if (_weight_kgs == 1) +var SystemDisplayPageRecipient = +{ + new: func(_ident, page) + { + var SDRecipient = emesary.Recipient.new(_ident); + SDRecipient.MainScreen = nil; + SDRecipient.Page = page; + SDRecipient.Receive = func(notification) { - me["FUEL-On-Board"].setText(sprintf("%s", math.round(total_fuel_lbs.getValue() * LBS2KGS, 10))); - me["FOB-weight-unit"].setText("KG"); - } else { - me["FUEL-On-Board"].setText(sprintf("%s", math.round(total_fuel_lbs.getValue(), 10))); - me["FOB-weight-unit"].setText("LBS"); - } - - if (_weight_kgs == 1) { - me["FFlow-weight-unit"].setText("KG/MIN"); - } else { - me["FFlow-weight-unit"].setText("LBS/MIN"); - } - - if (fadec.FADEC.Power.powered1.getValue() and fadec.FADEC.Power.powered2.getValue() or fadec.FADEC.Power.powerup.getValue()) { - me["FUEL-Flow-per-min"].setColor(0.0509,0.7529,0.2941); - if (_weight_kgs == 1) { - me["FUEL-Flow-per-min"].setText(sprintf("%s", math.round(((fuel_flow1.getValue() + fuel_flow2.getValue()) * LBS2KGS) / 60, 10))); - } else { - me["FUEL-Flow-per-min"].setText(sprintf("%s", math.round((fuel_flow1.getValue() + fuel_flow2.getValue()) / 60, 10))); - } - } else { - me["FUEL-Flow-per-min"].setColor(0.7333,0.3803,0); - me["FUEL-Flow-per-min"].setText("XX"); - } - - # TODO use the valve prop and add amber if difference between eng master and valve - # TODO add transition state - if (systems.FUEL.Valves.lpValve1.getValue()) { - me["FUEL-ENG-Master-1"].setRotation(0); - me["FUEL-ENG-Master-1"].setColor(0.0509,0.7529,0.2941); - me["FUEL-ENG-Master-1"].setColorFill(0.0509,0.7529,0.2941); - me["FUEL-ENG-1-pipe"].setColor(0.0509,0.7529,0.2941); - } else { - me["FUEL-ENG-Master-1"].setRotation(90 * D2R); - me["FUEL-ENG-Master-1"].setColor(0.7333,0.3803,0); - me["FUEL-ENG-Master-1"].setColorFill(0.7333,0.3803,0); - me["FUEL-ENG-1-pipe"].setColor(0.7333,0.3803,0); - } - - # TODO use the valve prop and add amber if difference between eng master and valve - # TODO add transition state - if (systems.FUEL.Valves.lpValve2.getValue()) { - me["FUEL-ENG-Master-2"].setRotation(0); - me["FUEL-ENG-Master-2"].setColor(0.0509,0.7529,0.2941); - me["FUEL-ENG-Master-2"].setColorFill(0.0509,0.7529,0.2941); - me["FUEL-ENG-2-pipe"].setColor(0.0509,0.7529,0.2941); - } else { - me["FUEL-ENG-Master-2"].setRotation(90 * D2R); - me["FUEL-ENG-Master-2"].setColor(0.7333,0.3803,0); - me["FUEL-ENG-Master-2"].setColorFill(0.7333,0.3803,0); - me["FUEL-ENG-2-pipe"].setColor(0.7333,0.3803,0); - } - - # this is now bound to the XFEED switch - # TODO use the valve prop - # TODO add amber when disagree between switch and btn - # TODO add transition state - if (systems.FUEL.Valves.crossfeed.getBoolValue()) { - me["FUEL-XFEED"].setRotation(0); - me["FUEL-XFEED-pipes"].show(); - } else { - me["FUEL-XFEED"].setRotation(90 * D2R); - me["FUEL-XFEED-pipes"].hide(); - } - - # TODO add LO indication - if (systems.FUEL.Switches.pumpLeft1.getBoolValue()) { - me["FUEL-Pump-Left-1-Open"].show(); - me["FUEL-Pump-Left-1-Closed"].hide(); - me["FUEL-Pump-Left-1"].setColor(0.0509,0.7529,0.2941); - me["FUEL-Pump-Left-1"].setColorFill(0.0509,0.7529,0.2941); - } else { - me["FUEL-Pump-Left-1-Open"].hide(); - me["FUEL-Pump-Left-1-Closed"].show(); - me["FUEL-Pump-Left-1"].setColor(0.7333,0.3803,0); - me["FUEL-Pump-Left-1"].setColorFill(0.7333,0.3803,0); - } - - # TODO add LO indication - if (systems.FUEL.Switches.pumpLeft2.getBoolValue()) { - me["FUEL-Pump-Left-2-Open"].show(); - me["FUEL-Pump-Left-2-Closed"].hide(); - me["FUEL-Pump-Left-2"].setColor(0.0509,0.7529,0.2941); - me["FUEL-Pump-Left-2"].setColorFill(0.0509,0.7529,0.2941); - } else { - me["FUEL-Pump-Left-2-Open"].hide(); - me["FUEL-Pump-Left-2-Closed"].show(); - me["FUEL-Pump-Left-2"].setColor(0.7333,0.3803,0); - me["FUEL-Pump-Left-2"].setColorFill(0.7333,0.3803,0); - } - - # TODO add functionality to match FCOM 1.28.20 "Amber: Transfer valve is open, whereas commanded closed in automatic or manual mode" - if (systems.FUEL.Switches.pumpCenter1.getBoolValue()) { - me["FUEL-Pump-Center-1-Open"].show(); - me["FUEL-Pump-Center-1-Closed"].hide(); - me["FUEL-Pump-Center-1"].setColor(0.0509,0.7529,0.2941); - me["FUEL-Pump-Center-1"].setColorFill(0.0509,0.7529,0.2941); - } else { - me["FUEL-Pump-Center-1-Open"].hide(); - me["FUEL-Pump-Center-1-Closed"].show(); - me["FUEL-Pump-Center-1"].setColor(0.7333,0.3803,0); - me["FUEL-Pump-Center-1"].setColorFill(0.7333,0.3803,0); - } - - # TODO add LO indication - if (systems.FUEL.Switches.pumpCenter2.getBoolValue()) { - me["FUEL-Pump-Center-2-Open"].show(); - me["FUEL-Pump-Center-2-Closed"].hide(); - me["FUEL-Pump-Center-2"].setColor(0.0509,0.7529,0.2941); - me["FUEL-Pump-Center-2"].setColorFill(0.0509,0.7529,0.2941); - } else { - me["FUEL-Pump-Center-2-Open"].hide(); - me["FUEL-Pump-Center-2-Closed"].show(); - me["FUEL-Pump-Center-2"].setColor(0.7333,0.3803,0); - me["FUEL-Pump-Center-2"].setColorFill(0.7333,0.3803,0); - } - - # TODO add LO indication - if (systems.FUEL.Switches.pumpRight1.getBoolValue()) { - me["FUEL-Pump-Right-1-Open"].show(); - me["FUEL-Pump-Right-1-Closed"].hide(); - me["FUEL-Pump-Right-1"].setColor(0.0509,0.7529,0.2941); - me["FUEL-Pump-Right-1"].setColorFill(0.0509,0.7529,0.2941); - } else { - me["FUEL-Pump-Right-1-Open"].hide(); - me["FUEL-Pump-Right-1-Closed"].show(); - me["FUEL-Pump-Right-1"].setColor(0.7333,0.3803,0); - me["FUEL-Pump-Right-1"].setColorFill(0.7333,0.3803,0); - } - - # TODO add LO indication - if (systems.FUEL.Switches.pumpRight2.getBoolValue()) { - me["FUEL-Pump-Right-2-Open"].show(); - me["FUEL-Pump-Right-2-Closed"].hide(); - me["FUEL-Pump-Right-2"].setColor(0.0509,0.7529,0.2941); - me["FUEL-Pump-Right-2"].setColorFill(0.0509,0.7529,0.2941); - } else { - me["FUEL-Pump-Right-2-Open"].hide(); - me["FUEL-Pump-Right-2-Closed"].show(); - me["FUEL-Pump-Right-2"].setColor(0.7333,0.3803,0); - me["FUEL-Pump-Right-2"].setColorFill(0.7333,0.3803,0); - } - - # Fuel Used - if (_weight_kgs == 1) { - me["FUEL-used-1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue() * LBS2KGS, 10))); - me["FUEL-used-2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue() * LBS2KGS, 10))); - me["FUEL-used-both"].setText(sprintf("%s", (math.round(fuel_used_lbs1.getValue() * LBS2KGS, 10) + math.round(fuel_used_lbs2.getValue() * LBS2KGS, 10)))); - me["Fused-weight-unit"].setText("KG"); - } else { - me["FUEL-used-1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue(), 10))); - me["FUEL-used-2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue(), 10))); - me["FUEL-used-both"].setText(sprintf("%s", (math.round(fuel_used_lbs1.getValue(), 10) + math.round(fuel_used_lbs2.getValue(), 10)))); - me["Fused-weight-unit"].setText("LBS"); - } - - # Fuel Temp - me["FUEL-Left-Outer-temp"].setText(sprintf("%s", math.round(fuel_left_outer_temp.getValue()))); - me["FUEL-Left-Inner-temp"].setText(sprintf("%s", math.round(fuel_left_inner_temp.getValue()))); - me["FUEL-Right-Outer-temp"].setText(sprintf("%s", math.round(fuel_right_outer_temp.getValue()))); - me["FUEL-Right-Inner-temp"].setText(sprintf("%s", math.round(fuel_right_inner_temp.getValue()))); - - # Fuel Quantity - # TODO add LO indication - if (_weight_kgs == 1) { - me["FUEL-Left-Outer-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.leftOuter.getValue() * LBS2KGS, 10))); - me["FUEL-Left-Inner-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.leftInner.getValue() * LBS2KGS, 10))); - me["FUEL-Center-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.center.getValue() * LBS2KGS, 10))); - me["FUEL-Right-Inner-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.rightInner.getValue() * LBS2KGS, 10))); - me["FUEL-Right-Outer-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.rightOuter.getValue() * LBS2KGS, 10))); - } else { - me["FUEL-Left-Outer-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.leftOuter.getValue(), 10))); - me["FUEL-Left-Inner-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.leftInner.getValue(), 10))); - me["FUEL-Center-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.center.getValue(), 10))); - me["FUEL-Right-Inner-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.rightInner.getValue(), 10))); - me["FUEL-Right-Outer-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.rightOuter.getValue(), 10))); - } - - if (systems.FUEL.Valves.transfer1.getValue() == 0) { - me["FUEL-Left-Transfer"].hide(); - } else { - if (systems.FUEL.Valves.transfer1.getValue()) { - me["FUEL-Left-Transfer"].setColor(0.0509,0.7529,0.2941); - } else { - me["FUEL-Left-Transfer"].setColor(0.7333,0.3803,0); - } - me["FUEL-Left-Transfer"].show(); - } - - if (systems.FUEL.Valves.transfer2.getValue() == 0) { - me["FUEL-Right-Transfer"].hide(); - } else { - if (systems.FUEL.Valves.transfer2.getValue()) { - me["FUEL-Right-Transfer"].setColor(0.0509,0.7529,0.2941); - } else { - me["FUEL-Right-Transfer"].setColor(0.7333,0.3803,0); - } - me["FUEL-Right-Transfer"].show(); - } - - if (!systems.FUEL.Switches.pumpCenter1.getValue() and !systems.FUEL.Switches.pumpCenter2.getValue()) { - me["FUEL-Center-blocked"].show(); - } else { - me["FUEL-Center-blocked"].hide(); - } - - # APU - if (systems.FUEL.Valves.apu.getValue() and systems.APUNodes.Controls.master.getValue() and !systems.APUNodes.Controls.fire.getValue()) { - me["FUEL-APU-label"].setColor(0.8078, 0.8039, 0.8078); - me["FUEL-APU-line"].setColor(0.0509,0.7529,0.2941); - me["FUEL-APU-arrow"].setColor(0.0509,0.7529,0.2941); - me["FUEL-APU-line"].show(); - me["FUEL-APU-arrow"].show(); - } elsif (systems.FUEL.Valves.apu.getValue() and (!systems.APUNodes.Controls.master.getValue() or systems.APUNodes.Controls.fire.getValue())) { - me["FUEL-APU-label"].setColor(0.7333,0.3803,0); - me["FUEL-APU-line"].setColor(0.7333,0.3803,0); - me["FUEL-APU-arrow"].setColor(0.7333,0.3803,0); - me["FUEL-APU-line"].show(); - me["FUEL-APU-arrow"].show(); - } elsif (systems.FUEL.Valves.apu.getValue() != 1 and (systems.APUNodes.Controls.master.getValue() or systems.APUNodes.Controls.fire.getValue())) { - me["FUEL-APU-label"].setColor(0.7333,0.3803,0); - me["FUEL-APU-line"].hide(); - me["FUEL-APU-arrow"].hide(); - } else { - me["FUEL-APU-label"].setColor(0.8078, 0.8039, 0.8078); - me["FUEL-APU-arrow"].setColor(0.8078, 0.8039, 0.8078); - me["FUEL-APU-line"].hide(); - me["FUEL-APU-arrow"].show(); - } - - # Hide not yet implemented features - # TODO add them - me["FUEL-Left-blocked"].hide(); - me["FUEL-Right-blocked"].hide(); - me["FUEL-Left-Outer-Inacc"].hide(); - me["FUEL-Left-Inner-Inacc"].hide(); - me["FUEL-Right-Outer-Inacc"].hide(); - me["FUEL-Right-Inner-Inacc"].hide(); - me["FUEL-Center-Inacc"].hide(); - me.updateBottomStatus(); - }, -}; - -var canvas_lowerECAM_press = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_press, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit", "PRESS-Cab-VS", "PRESS-Cab-VS-neg", "PRESS-Cab-Alt"]; - }, - update: func() { - me["PRESS-Cab-VS"].setText(sprintf("%4.0f", press_vs_norm.getValue())); - me["PRESS-Cab-Alt"].setText(sprintf("%4.0f", cabinalt.getValue())); - - - me.updateBottomStatus(); - }, -}; - -var canvas_lowerECAM_status = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_status, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; - }, - update: func() { - - me.updateBottomStatus(); - }, -}; - -var canvas_lowerECAM_hyd = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_hyd, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","Green-Indicator","Blue-Indicator","Yellow-Indicator","Press-Green","Press-Blue","Press-Yellow","Green-Line","Blue-Line","Yellow-Line","PTU-Supply-Line","PTU-supply-yellow","PTU-supply-green","PTU-connection", - "PTU-Auto-or-off","RAT-label","RAT-stowed","RAT-not-stowed","ELEC-Yellow-off","ELEC-Yellow-on","ELEC-Yellow-label","ELEC-OVTH-Yellow","ELEC-Blue-label","ELEC-OVHT-Blue","ELEC-OVHT-Yellow","Pump-Green-label","Pump-Yellow-label","Pump-Green", - "Pump-LOPR-Green","Pump-Green-off","Pump-Green-on","Pump-Yellow","Pump-LOPR-Yellow","Pump-Yellow-off","Pump-Yellow-on","Pump-Blue", "Pump-Blue-off","Pump-Blue-on","Fire-Valve-Green","Fire-Valve-Yellow","LO-AIR-PRESS-Green", - "LO-AIR-PRESS-Yellow","LO-AIR-PRESS-Blue","OVHT-Green","OVHT-Blue","OVHT-Yellow","Quantity-Indicator-Green","Quantity-Indicator-Blue","Quantity-Indicator-Yellow","Green-label","Blue-label","Yellow-label"]; - }, - update: func() { - blue_psi = systems.HYD.Psi.blue.getValue(); - green_psi = systems.HYD.Psi.green.getValue(); - yellow_psi = systems.HYD.Psi.yellow.getValue(); - - me["Press-Green"].setText(sprintf("%s", math.round(green_psi, 50))); - me["Press-Blue"].setText(sprintf("%s", math.round(blue_psi, 50))); - me["Press-Yellow"].setText(sprintf("%s", math.round(yellow_psi, 50))); - - if (blue_psi >= 1500) { - me["Blue-Line"].setColor(0.0509,0.7529,0.2941); - me["Blue-Line"].setColorFill(0.0509,0.7529,0.2941); - me["Blue-Indicator"].setColor(0.0509,0.7529,0.2941); - me["Press-Blue"].setColor(0.0509,0.7529,0.2941); - me["Blue-label"].setColor(0.8078,0.8039,0.8078); - } else { - me["Blue-Line"].setColor(0.7333,0.3803,0); - me["Blue-Line"].setColorFill(0.7333,0.3803,0); - me["Blue-Indicator"].setColor(0.7333,0.3803,0); - me["Press-Blue"].setColor(0.7333,0.3803,0); - me["Blue-label"].setColor(0.7333,0.3803,0); - } - - if (yellow_psi >= 1500) { - me["Yellow-Line"].setColor(0.0509,0.7529,0.2941); - me["Yellow-Line"].setColorFill(0.0509,0.7529,0.2941); - me["Yellow-Indicator"].setColor(0.0509,0.7529,0.2941); - me["Press-Yellow"].setColor(0.0509,0.7529,0.2941); - me["Yellow-label"].setColor(0.8078,0.8039,0.8078); - } else { - me["Yellow-Line"].setColor(0.7333,0.3803,0); - me["Yellow-Line"].setColorFill(0.7333,0.3803,0); - me["Yellow-Indicator"].setColor(0.7333,0.3803,0); - me["Press-Yellow"].setColor(0.7333,0.3803,0); - me["Yellow-label"].setColor(0.7333,0.3803,0); - } - - if (green_psi >= 1500) { - me["Green-Line"].setColor(0.0509,0.7529,0.2941); - me["Green-Line"].setColorFill(0.0509,0.7529,0.2941); - me["Green-Indicator"].setColor(0.0509,0.7529,0.2941); - me["Press-Green"].setColor(0.0509,0.7529,0.2941); - me["Green-label"].setColor(0.8078,0.8039,0.8078); - } else { - me["Green-Line"].setColor(0.7333,0.3803,0); - me["Green-Line"].setColorFill(0.7333,0.3803,0); - me["Green-Indicator"].setColor(0.7333,0.3803,0); - me["Press-Green"].setColor(0.7333,0.3803,0); - me["Green-label"].setColor(0.7333,0.3803,0); - } - - if (systems.HYD.Switch.ptu.getValue() and !systems.HYD.Fail.ptuFault.getValue()) { - me["PTU-connection"].setColor(0.0509,0.7529,0.2941); - - if (systems.HYD.Ptu.active.getValue()) { - if (systems.HYD.Ptu.diff.getValue() < 0) { - me["PTU-Supply-Line"].show(); - me["PTU-supply-yellow"].show(); - me["PTU-supply-green"].hide(); - me["PTU-Auto-or-off"].hide(); - } else { - me["PTU-Supply-Line"].show(); - me["PTU-supply-yellow"].hide(); - me["PTU-supply-green"].show(); - me["PTU-Auto-or-off"].hide(); - } - } else { - me["PTU-Auto-or-off"].setColor(0.0509,0.7529,0.2941); - me["PTU-Supply-Line"].hide(); - me["PTU-supply-yellow"].hide(); - me["PTU-supply-green"].hide(); - me["PTU-Auto-or-off"].show(); - } - } else { - me["PTU-connection"].setColor(0.7333,0.3803,0); - me["PTU-Auto-or-off"].setColor(0.7333,0.3803,0); - me["PTU-Supply-Line"].hide(); - me["PTU-supply-yellow"].hide(); - me["PTU-supply-green"].hide(); - me["PTU-Auto-or-off"].show(); - } - - 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 (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); - } - - if (systems.HYD.Switch.greenEDP.getValue()) { - me["Pump-Green-off"].hide(); - if (green_psi >= 1500) { - me["Pump-Green-on"].show(); - me["Pump-LOPR-Green"].hide(); - me["Pump-Green"].setColor(0.0509,0.7529,0.2941); - me["Pump-Green"].setColorFill(0.0509,0.7529,0.2941); - } else { - me["Pump-Green-on"].hide(); - me["Pump-LOPR-Green"].show(); - me["Pump-Green"].setColor(0.7333,0.3803,0); - me["Pump-Green"].setColorFill(0.7333,0.3803,0); - } - } else { - me["Pump-Green-off"].show(); - me["Pump-Green-on"].hide(); - me["Pump-LOPR-Green"].hide(); - me["Pump-Green"].setColor(0.7333,0.3803,0); - } - - if (systems.HYD.Switch.yellowEDP.getValue()) { - me["Pump-Yellow-off"].hide(); - if (yellow_psi >= 1500) { - me["Pump-Yellow-on"].show(); - me["Pump-LOPR-Yellow"].hide(); - me["Pump-Yellow"].setColorFill(0.0509,0.7529,0.2941); - me["Pump-Yellow"].setColor(0.0509,0.7529,0.2941); - } else { - me["Pump-Yellow-on"].hide(); - me["Pump-LOPR-Yellow"].show(); - me["Pump-Yellow"].setColorFill(0.7333,0.3803,0); - me["Pump-Yellow"].setColor(0.7333,0.3803,0); - } - } else { - me["Pump-Yellow-off"].show(); - me["Pump-Yellow-on"].hide(); - me["Pump-LOPR-Yellow"].hide(); - me["Pump-Yellow"].setColorFill(0.7333,0.3803,0); - me["Pump-Yellow"].setColor(0.7333,0.3803,0); - } - - if (systems.HYD.Switch.blueElec.getValue()) { - me["Pump-Blue-off"].hide(); - if (blue_psi >= 1500) { - me["Pump-Blue-on"].show(); - me["Pump-Blue-off"].hide(); - me["Pump-Blue"].setColorFill(0.0509,0.7529,0.2941); - me["Pump-Blue"].setColor(0.0509,0.7529,0.2941); - } else { - me["Pump-Blue-off"].show(); - me["Pump-Blue-on"].hide(); - me["Pump-Blue"].setColorFill(0.7333,0.3803,0); - me["Pump-Blue"].setColor(0.7333,0.3803,0); - } - } else { - me["Pump-Blue-off"].show(); - me["Pump-Blue-on"].hide(); - me["Pump-Blue"].setColorFill(0.7333,0.3803,0); - me["Pump-Blue"].setColor(0.7333,0.3803,0); - } - - if (!systems.HYD.Switch.yellowElec.getValue()) { - me["ELEC-Yellow-on"].hide(); - me["ELEC-Yellow-off"].show(); - } else { - me["ELEC-Yellow-on"].show(); - me["ELEC-Yellow-off"].hide(); - if (yellow_psi >= 1500) { - me["ELEC-Yellow-on"].setColor(0.0509,0.7529,0.2941); - } else { - me["ELEC-Yellow-on"].setColor(0.7333,0.3803,0); - } - } - - if (y_resv_lo_air_press.getValue()) { - me["LO-AIR-PRESS-Yellow"].show(); - } else { - me["LO-AIR-PRESS-Yellow"].hide(); - } - - if (b_resv_lo_air_press.getValue()) { - me["LO-AIR-PRESS-Blue"].show(); - } else { - me["LO-AIR-PRESS-Blue"].hide(); - } - - if (g_resv_lo_air_press.getValue()) { - me["LO-AIR-PRESS-Green"].show(); - } else { - me["LO-AIR-PRESS-Green"].hide(); - } - - if (elec_pump_y_ovht.getValue()) { - me["ELEC-OVHT-Yellow"].show(); - } else { - me["ELEC-OVHT-Yellow"].hide(); - } - - if (elec_pump_b_ovht.getValue()) { - me["ELEC-OVHT-Blue"].show(); - } else { - me["ELEC-OVHT-Blue"].hide(); - } - - if (systems.HYD.Rat.position.getValue()) { - me["RAT-stowed"].hide(); - me["RAT-not-stowed"].show(); - } else { - me["RAT-stowed"].show(); - me["RAT-not-stowed"].hide(); - } - - if (y_resv_ovht.getValue()) { - me["OVHT-Yellow"].show(); - } else { - me["OVHT-Yellow"].hide(); - } - - if (b_resv_ovht.getValue()) { - me["OVHT-Green"].show(); - } else { - me["OVHT-Green"].hide(); - } - - if (g_resv_ovht.getValue()) { - me["OVHT-Blue"].show(); - } else { - me["OVHT-Blue"].hide(); - } - - if (systems.ELEC.Bus.ac1.getValue() >= 110) { - me["ELEC-Blue-label"].setColor(0.8078,0.8039,0.8078); - } else { - me["ELEC-Blue-label"].setColor(0.7333,0.3803,0); - } - - if (systems.ELEC.Bus.ac2.getValue() >= 110) { - me["ELEC-Yellow-label"].setColor(0.8078,0.8039,0.8078); - } else { - me["ELEC-Yellow-label"].setColor(0.7333,0.3803,0); - } - - if (systems.HYD.Valve.yellowFire.getValue() != 0) { - me["Fire-Valve-Yellow"].setColor(0.7333,0.3803,0); - me["Fire-Valve-Yellow"].setRotation(90 * D2R); - } else { - me["Fire-Valve-Yellow"].setColor(0.0509,0.7529,0.2941); - me["Fire-Valve-Yellow"].setRotation(0); - } - - if (systems.HYD.Valve.greenFire.getValue() != 0) { - me["Fire-Valve-Green"].setColor(0.7333,0.3803,0); - me["Fire-Valve-Green"].setRotation(90 * D2R); - } else { - me["Fire-Valve-Green"].setColor(0.0509,0.7529,0.2941); - me["Fire-Valve-Green"].setRotation(0); - } - - me.updateBottomStatus(); - }, -}; - -var canvas_lowerECAM_wheel = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_wheel, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","lgctltext","NORMbrk","NWStext","leftdoor","rightdoor","nosegeardoorL","nosegeardoorR", - "autobrk","autobrkind","NWS","NWSrect","normbrk-rect","altnbrk","normbrkhyd","spoiler1Rex","spoiler1Rrt","spoiler2Rex","spoiler2Rrt","spoiler3Rex", - "spoiler3Rrt","spoiler4Rex","spoiler4Rrt","spoiler5Rex","spoiler5Rrt","spoiler1Lex","spoiler1Lrt","spoiler2Lex","spoiler2Lrt", - "spoiler3Lex","spoiler3Lrt","spoiler4Lex","spoiler4Lrt","spoiler5Lex","spoiler5Lrt","spoiler1Rf","spoiler2Rf","spoiler3Rf","spoiler4Rf","spoiler5Rf", - "spoiler1Lf","spoiler2Lf","spoiler3Lf","spoiler4Lf","spoiler5Lf","ALTNbrk","altnbrkhyd","altnbrk-rect","antiskidtext","brakearrow","accupress_text", - "accuonlyarrow","accuonly","braketemp1","normbrkhyd","braketemp2","braketemp3","braketemp4","toparc1","toparc2","toparc3","toparc4","leftuplock", - "noseuplock","rightuplock","Triangle-Left1","Triangle-Left2","Triangle-Nose1","Triangle-Nose2","Triangle-Right1","Triangle-Right2","BSCUrect1", - "BSCUrect2","BSCU1","BSCU2","tirepress1","tirepress2","tirepress3","tirepress4","tirepress5","tirepress6"]; - }, - update: func() { - blue_psi = systems.HYD.Psi.blue.getValue(); - green_psi = systems.HYD.Psi.green.getValue(); - yellow_psi = systems.HYD.Psi.yellow.getValue(); - autobrakemode = autobreak_mode.getValue(); - nosegear = gear1_pos.getValue(); - leftgear = gear2_pos.getValue(); - rightgear = gear3_pos.getValue(); - leftdoor = gear_door_L.getValue(); - rightdoor = gear_door_R.getValue(); - nosedoor = gear_door_N.getValue(); - gearlvr = gear_down.getValue(); - askidsw = systems.HYD.Switch.nwsSwitch.getBoolValue(); - brakemode = systems.HYD.Brakes.mode.getBoolValue(); - accum = systems.HYD.Brakes.accumPressPsi.getBoolValue(); - - # L/G CTL - if ((leftgear == 0 or nosegear == 0 or rightgear == 0 and gearlvr == 0) or (leftgear == 1 or nosegear == 1 or rightgear == 1 and gearlvr == 1)) { - me["lgctltext"].hide(); - } else { - me["lgctltext"].show(); - } - - # NWS / Antiskid / Brakes - if (askidsw and yellow_psi >= 1500) { - me["NWStext"].hide(); - me["NWS"].hide(); - me["NWSrect"].hide(); - me["antiskidtext"].hide(); - me["BSCUrect1"].hide(); - me["BSCUrect2"].hide(); - me["BSCU1"].hide(); - me["BSCU2"].hide(); - } else if (!askidsw and yellow_psi >= 1500) { - me["NWStext"].show(); - me["NWS"].show(); - me["NWS"].setColor(0.0509,0.7529,0.2941); - me["NWSrect"].show(); - me["antiskidtext"].show(); - me["antiskidtext"].setColor(0.7333,0.3803,0); - me["BSCUrect1"].show(); - me["BSCUrect2"].show(); - me["BSCU1"].show(); - me["BSCU2"].show(); - } else { - me["NWStext"].show(); - me["NWS"].show(); - me["NWS"].setColor(0.7333,0.3803,0); - me["NWSrect"].show(); - me["antiskidtext"].show(); - me["antiskidtext"].setColor(0.7333,0.3803,0); - me["BSCUrect1"].show(); - me["BSCUrect2"].show(); - me["BSCU1"].show(); - me["BSCU2"].show(); - } - - if (green_psi >= 1500 and brakemode == 1) { - me["NORMbrk"].hide(); - me["normbrk-rect"].hide(); - me["normbrkhyd"].hide(); - } else if (green_psi >= 1500 and askidsw) { - me["NORMbrk"].show(); - me["normbrk-rect"].show(); - me["NORMbrk"].setColor(0.7333,0.3803,0); - me["normbrkhyd"].setColor(0.0509,0.7529,0.2941); - } else if (green_psi < 1500 or !askidsw) { - me["NORMbrk"].show(); - me["normbrk-rect"].show(); - me["NORMbrk"].setColor(0.7333,0.3803,0); - me["normbrkhyd"].setColor(0.7333,0.3803,0); - } - - if (brakemode != 2) { - me["ALTNbrk"].hide(); - me["altnbrk-rect"].hide(); - me["altnbrkhyd"].hide(); - } else if (yellow_psi >= 1500) { - me["ALTNbrk"].show(); - me["altnbrk-rect"].show(); - me["altnbrkhyd"].setColor(0.0509,0.7529,0.2941); - } else { - me["ALTNbrk"].show(); - me["altnbrk-rect"].show(); - me["altnbrkhyd"].setColor(0.7333,0.3803,0); - } - - if (brakemode == 2 and accum < 200 and yellow_psi < 1500) { - me["accupress_text"].show(); - me["brakearrow"].hide(); - me["accupress_text"].setColor(0.7333,0.3803,0); - } else if (brakemode == 2 and accum > 200 and yellow_psi >= 1500){ - me["accupress_text"].show(); - me["brakearrow"].show(); - me["accupress_text"].setColor(0.0509,0.7529,0.2941); - } else if (brakemode == 2 and accum > 200 and yellow_psi < 1500) { - me["accuonlyarrow"].show(); - me["accuonly"].show(); - me["brakearrow"].hide(); - me["accupress_text"].hide(); - } else { - me["accuonlyarrow"].hide(); - me["accuonly"].hide(); - me["brakearrow"].hide(); - me["accupress_text"].hide(); - } - - # Gear Doors - me["leftdoor"].setRotation(door_left.getValue() * D2R); - me["rightdoor"].setRotation(door_right.getValue() * D2R); - me["nosegeardoorL"].setRotation(door_nose_left.getValue() * D2R); - me["nosegeardoorR"].setRotation(door_nose_right.getValue() * D2R); - - if (nosedoor == 0) { - me["nosegeardoorL"].setColorFill(0.0509,0.7529,0.2941); - me["nosegeardoorR"].setColorFill(0.0509,0.7529,0.2941); - } else { - me["nosegeardoorL"].setColorFill(0.7333,0.3803,0); - me["nosegeardoorR"].setColorFill(0.7333,0.3803,0); - } - - if (leftdoor == 0) { - me["leftdoor"].setColorFill(0.0509,0.7529,0.2941); - } else { - me["leftdoor"].setColorFill(0.7333,0.3803,0); - } - - if (rightdoor == 0) { - me["rightdoor"].setColorFill(0.0509,0.7529,0.2941); - } else { - me["rightdoor"].setColorFill(0.7333,0.3803,0); - } - - # Triangles - if (leftgear < 0.2 or leftgear > 0.8) { - me["Triangle-Left1"].hide(); - me["Triangle-Left2"].hide(); - } else { - me["Triangle-Left1"].show(); - me["Triangle-Left2"].show(); - } - - if (leftgear == 1) { - me["Triangle-Left1"].setColor(0.0509,0.7529,0.2941); - me["Triangle-Left2"].setColor(0.0509,0.7529,0.2941); - } else { - me["Triangle-Left1"].setColor(1,0,0); - me["Triangle-Left2"].setColor(1,0,0); - } - - if (nosegear < 0.2 or nosegear > 0.8) { - me["Triangle-Nose1"].hide(); - me["Triangle-Nose2"].hide(); - } else { - me["Triangle-Nose1"].show(); - me["Triangle-Nose2"].show(); - } - - if (nosegear == 1) { - me["Triangle-Nose1"].setColor(0.0509,0.7529,0.2941); - me["Triangle-Nose2"].setColor(0.0509,0.7529,0.2941); - } else { - me["Triangle-Nose1"].setColor(1,0,0); - me["Triangle-Nose2"].setColor(1,0,0); - } - - if (rightgear < 0.2 or rightgear > 0.8) { - me["Triangle-Right1"].hide(); - me["Triangle-Right2"].hide(); - } else { - me["Triangle-Right1"].show(); - me["Triangle-Right2"].show(); - } - - if (rightgear == 1) { - me["Triangle-Right1"].setColor(0.0509,0.7529,0.2941); - me["Triangle-Right2"].setColor(0.0509,0.7529,0.2941); - } else { - me["Triangle-Right1"].setColor(1,0,0); - me["Triangle-Right2"].setColor(1,0,0); - } - - # Autobrake - if (autobrakemode == 0) { - me["autobrkind"].hide(); - } elsif (autobrakemode == 1) { - me["autobrkind"].show(); - me["autobrkind"].setText(sprintf("%s", "LO")); - } elsif (autobrakemode == 2) { - me["autobrkind"].show(); - me["autobrkind"].setText(sprintf("%s", "MED")); - } elsif (autobrakemode == 3) { - me["autobrkind"].show(); - me["autobrkind"].setText(sprintf("%s", "MAX")); - } - - if (autobrakemode != 0) { - me["autobrk"].show(); - } elsif (autobrakemode == 0) { - me["autobrk"].hide(); - } - - # Spoilers - if (spoiler_L1.getValue() < 1.5) { - me["spoiler1Lex"].hide(); - me["spoiler1Lrt"].show(); - } else { - me["spoiler1Lrt"].hide(); - me["spoiler1Lex"].show(); - } - - if (spoiler_L2.getValue() < 1.5) { - me["spoiler2Lex"].hide(); - me["spoiler2Lrt"].show(); - } else { - me["spoiler2Lrt"].hide(); - me["spoiler2Lex"].show(); - } - - if (spoiler_L3.getValue() < 1.5) { - me["spoiler3Lex"].hide(); - me["spoiler3Lrt"].show(); - } else { - me["spoiler3Lrt"].hide(); - me["spoiler3Lex"].show(); - } - - if (spoiler_L4.getValue() < 1.5) { - me["spoiler4Lex"].hide(); - me["spoiler4Lrt"].show(); - } else { - me["spoiler4Lrt"].hide(); - me["spoiler4Lex"].show(); - } - - if (spoiler_L5.getValue() < 1.5) { - me["spoiler5Lex"].hide(); - me["spoiler5Lrt"].show(); - } else { - me["spoiler5Lrt"].hide(); - me["spoiler5Lex"].show(); - } - - if (spoiler_R1.getValue() < 1.5) { - me["spoiler1Rex"].hide(); - me["spoiler1Rrt"].show(); - } else { - me["spoiler1Rrt"].hide(); - me["spoiler1Rex"].show(); - } - - if (spoiler_R2.getValue() < 1.5) { - me["spoiler2Rex"].hide(); - me["spoiler2Rrt"].show(); - } else { - me["spoiler2Rrt"].hide(); - me["spoiler2Rex"].show(); - } - - if (spoiler_R3.getValue() < 1.5) { - me["spoiler3Rex"].hide(); - me["spoiler3Rrt"].show(); - } else { - me["spoiler3Rrt"].hide(); - me["spoiler3Rex"].show(); - } - - if (spoiler_R4.getValue() < 1.5) { - me["spoiler4Rex"].hide(); - me["spoiler4Rrt"].show(); - } else { - me["spoiler4Rrt"].hide(); - me["spoiler4Rex"].show(); - } - - if (spoiler_R5.getValue() < 1.5) { - me["spoiler5Rex"].hide(); - me["spoiler5Rrt"].show(); - } else { - me["spoiler5Rrt"].hide(); - me["spoiler5Rex"].show(); - } - - # Spoiler Fail - if (fbw.FBW.Failures.spoilerl1.getValue() or green_psi < 1500) { - me["spoiler1Lex"].setColor(0.7333,0.3803,0); - me["spoiler1Lrt"].setColor(0.7333,0.3803,0); - if (spoiler_L1.getValue() < 1.5) { - me["spoiler1Lf"].show(); - } else { - me["spoiler1Lf"].hide(); - } - } else { - me["spoiler1Lex"].setColor(0.0509,0.7529,0.2941); - me["spoiler1Lrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler1Lf"].hide(); - } - - if (fbw.FBW.Failures.spoilerl2.getValue() or yellow_psi < 1500) { - me["spoiler2Lex"].setColor(0.7333,0.3803,0); - me["spoiler2Lrt"].setColor(0.7333,0.3803,0); - if (spoiler_L2.getValue() < 1.5) { - me["spoiler2Lf"].show(); - } else { - me["spoiler2Lf"].hide(); - } - } else { - me["spoiler2Lex"].setColor(0.0509,0.7529,0.2941); - me["spoiler2Lrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler2Lf"].hide(); - } - - if (fbw.FBW.Failures.spoilerl3.getValue() or blue_psi < 1500) { - me["spoiler3Lex"].setColor(0.7333,0.3803,0); - me["spoiler3Lrt"].setColor(0.7333,0.3803,0); - if (spoiler_L3.getValue() < 1.5) { - me["spoiler3Lf"].show(); - } else { - me["spoiler3Lf"].hide(); - } - } else { - me["spoiler3Lex"].setColor(0.0509,0.7529,0.2941); - me["spoiler3Lrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler3Lf"].hide(); - } - - if (fbw.FBW.Failures.spoilerl4.getValue() or yellow_psi < 1500) { - me["spoiler4Lex"].setColor(0.7333,0.3803,0); - me["spoiler4Lrt"].setColor(0.7333,0.3803,0); - if (spoiler_L4.getValue() < 1.5) { - me["spoiler4Lf"].show(); - } else { - me["spoiler4Lf"].hide(); - } - } else { - me["spoiler4Lex"].setColor(0.0509,0.7529,0.2941); - me["spoiler4Lrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler4Lf"].hide(); - } - - if (fbw.FBW.Failures.spoilerl5.getValue() or green_psi < 1500) { - me["spoiler5Lex"].setColor(0.7333,0.3803,0); - me["spoiler5Lrt"].setColor(0.7333,0.3803,0); - if (spoiler_L5.getValue() < 1.5) { - me["spoiler5Lf"].show(); - } else { - me["spoiler5Lf"].hide(); - } - } else { - me["spoiler5Lex"].setColor(0.0509,0.7529,0.2941); - me["spoiler5Lrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler5Lf"].hide(); - } - - if (fbw.FBW.Failures.spoilerr1.getValue() or green_psi < 1500) { - me["spoiler1Rex"].setColor(0.7333,0.3803,0); - me["spoiler1Rrt"].setColor(0.7333,0.3803,0); - if (spoiler_R1.getValue() < 1.5) { - me["spoiler1Rf"].show(); - } else { - me["spoiler1Rf"].hide(); - } - } else { - me["spoiler1Rex"].setColor(0.0509,0.7529,0.2941); - me["spoiler1Rrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler1Rf"].hide(); - } - - if (fbw.FBW.Failures.spoilerr2.getValue() or yellow_psi < 1500) { - me["spoiler2Rex"].setColor(0.7333,0.3803,0); - me["spoiler2Rrt"].setColor(0.7333,0.3803,0); - if (spoiler_R2.getValue() < 1.5) { - me["spoiler2Rf"].show(); - } else { - me["spoiler2Rf"].hide(); - } - } else { - me["spoiler2Rex"].setColor(0.0509,0.7529,0.2941); - me["spoiler2Rrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler2Rf"].hide(); - } - - if (fbw.FBW.Failures.spoilerr3.getValue() or blue_psi < 1500) { - me["spoiler3Rex"].setColor(0.7333,0.3803,0); - me["spoiler3Rrt"].setColor(0.7333,0.3803,0); - if (spoiler_R3.getValue() < 1.5) { - me["spoiler3Rf"].show(); - } else { - me["spoiler3Rf"].hide(); - } - } else { - me["spoiler3Rex"].setColor(0.0509,0.7529,0.2941); - me["spoiler3Rrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler3Rf"].hide(); - } - - if (fbw.FBW.Failures.spoilerr4.getValue() or yellow_psi < 1500) { - me["spoiler4Rex"].setColor(0.7333,0.3803,0); - me["spoiler4Rrt"].setColor(0.7333,0.3803,0); - if (spoiler_R4.getValue() < 1.5) { - me["spoiler4Rf"].show(); - } else { - me["spoiler4Rf"].hide(); - } - } else { - me["spoiler4Rex"].setColor(0.0509,0.7529,0.2941); - me["spoiler4Rrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler4Rf"].hide(); - } - - if (fbw.FBW.Failures.spoilerr5.getValue() or green_psi < 1500) { - me["spoiler5Rex"].setColor(0.7333,0.3803,0); - me["spoiler5Rrt"].setColor(0.7333,0.3803,0); - if (spoiler_R5.getValue() < 1.5) { - me["spoiler5Rf"].show(); - } else { - me["spoiler5Rf"].hide(); - } - } else { - me["spoiler5Rex"].setColor(0.0509,0.7529,0.2941); - me["spoiler5Rrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler5Rf"].hide(); - } - - # Show Brakes temperature - if (L1BrakeTempc.getValue() > 300) { - me["braketemp1"].setColor(0.7333,0.3803,0); - } else { - me["braketemp1"].setColor(0.0509,0.7529,0.2941); - } - - if (L2BrakeTempc.getValue() > 300) { - me["braketemp2"].setColor(0.7333,0.3803,0); - } else { - me["braketemp2"].setColor(0.0509,0.7529,0.2941); - } - if (R3BrakeTempc.getValue() > 300) { - me["braketemp3"].setColor(0.7333,0.3803,0); - } else { - me["braketemp3"].setColor(0.0509,0.7529,0.2941); - } - if (R4BrakeTempc.getValue() > 300) { - me["braketemp4"].setColor(0.7333,0.3803,0); - } else { - me["braketemp4"].setColor(0.0509,0.7529,0.2941); - } - - # Brake arcs - if (L1BrakeTempc.getValue() > 300) { - me["toparc1"].setColor(0.7333,0.3803,0); - } else - { - if (L1BrakeTempc.getValue() > 100 and L1BrakeTempc.getValue() < 300) + if (notification.NotificationType == "FrameNotification") { - me["toparc1"].setColor(0.0509,0.7529,0.2941); + if (SDRecipient.MainScreen == nil) { + SDRecipient.MainScreen = canvas_lowerECAMPage.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/" ~ SDRecipient.Page ~ ".svg"); + } + if (math.mod(notifications.frameNotification.FrameCount,2) == 0) { + #if (ecam.SystemDisplayController.displayedPage.name == SDRecipient.Page) { + SDRecipient.MainScreen.update(notification); + #} + } + return emesary.Transmitter.ReceiptStatus_OK; } - else { - me["toparc1"].setColor(0.8078,0.8039,0.8078); - } - } - if (L2BrakeTempc.getValue() > 300) { - me["toparc2"].setColor(0.7333,0.3803,0); - } else - { - if (L2BrakeTempc.getValue() > 100 and L2BrakeTempc.getValue() < 300) - { - me["toparc2"].setColor(0.0509,0.7529,0.2941); - } - else { - me["toparc2"].setColor(0.8078,0.8039,0.8078); - } - } - if (R3BrakeTempc.getValue() > 300) { - me["toparc3"].setColor(0.7333,0.3803,0); - } else - { - if (R3BrakeTempc.getValue() > 100 and R3BrakeTempc.getValue() < 300) - { - me["toparc3"].setColor(0.0509,0.7529,0.2941); - } - else { - me["toparc3"].setColor(0.8078,0.8039,0.8078); - } - } - if (R4BrakeTempc.getValue() > 300) { - me["toparc4"].setColor(0.7333,0.3803,0); - } else - { - if (R4BrakeTempc.getValue() > 100 and R4BrakeTempc.getValue() < 300) - { - me["toparc4"].setColor(0.0509,0.7529,0.2941); - } - else { - me["toparc4"].setColor(0.8078,0.8039,0.8078); - } - } - me["braketemp1"].setText(sprintf("%s", math.round(L1BrakeTempc.getValue(), 1))); - me["braketemp2"].setText(sprintf("%s", math.round(L2BrakeTempc.getValue(), 1))); - me["braketemp3"].setText(sprintf("%s", math.round(R3BrakeTempc.getValue(), 1))); - me["braketemp4"].setText(sprintf("%s", math.round(R4BrakeTempc.getValue(), 1))); - me["braketemp1"].show(); - me["braketemp2"].show(); - me["braketemp3"].show(); - me["braketemp4"].show(); - me["toparc1"].show(); - me["toparc2"].show(); - me["toparc3"].show(); - me["toparc4"].show(); - - # Hide not yet implemented stuff - me["leftuplock"].hide(); - me["noseuplock"].hide(); - me["rightuplock"].hide(); - me["tirepress1"].hide(); - me["tirepress2"].hide(); - me["tirepress3"].hide(); - me["tirepress4"].hide(); - me["tirepress5"].hide(); - me["tirepress6"].hide(); - - me.updateBottomStatus(); - }, -}; - -var canvas_lowerECAM_test = { - init: func(canvas_group, file) { - var font_mapper = func(family, weight) { - return "LiberationFonts/LiberationSans-Regular.ttf"; + return emesary.Transmitter.ReceiptStatus_NotProcessed; }; - - canvas.parsesvg(canvas_group, file, {"font-mapper": font_mapper}); - - var svg_keys = me.getKeys(); - foreach(var key; svg_keys) { - me[key] = canvas_group.getElementById(key); - } - - me.page = canvas_group; - - return me; - }, - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_test]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return ["Test_white","Test_text"]; - }, - update: func() { - var elapsedtime = pts.Sim.Time.elapsedSec.getValue(); - if (du4_test_time.getValue() + 1 >= elapsedtime) { - me["Test_white"].show(); - me["Test_text"].hide(); - } else { - me["Test_white"].hide(); - me["Test_text"].show(); - } + return SDRecipient; }, }; -setlistener("/sim/signals/fdm-initialized", func { - lowerECAM_display = canvas.new({ - "name": "lowerECAM", - "size": [1024, 1024], - "view": [1024, 1024], - "mipmapping": 1 - }); - lowerECAM_display.addPlacement({"node": "lecam.screen"}); - var groupApu = lowerECAM_display.createGroup(); - var groupBleed = lowerECAM_display.createGroup(); - var groupCond = lowerECAM_display.createGroup(); - var groupCrz = lowerECAM_display.createGroup(); - var groupDoor = lowerECAM_display.createGroup(); - var groupElec = lowerECAM_display.createGroup(); - var groupEng = lowerECAM_display.createGroup(); - var groupFctl = lowerECAM_display.createGroup(); - var groupFuel = lowerECAM_display.createGroup(); - var groupPress = lowerECAM_display.createGroup(); - var groupStatus = lowerECAM_display.createGroup(); - var groupHyd = lowerECAM_display.createGroup(); - var groupWheel = lowerECAM_display.createGroup(); - var group_test = lowerECAM_display.createGroup(); +var A320SDAPU = SystemDisplayPageRecipient.new("A320 SD", "apu"); +emesary.GlobalTransmitter.Register(A320SDAPU); - lowerECAM_apu = canvas_lowerECAM_apu.new(groupApu, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/apu.svg"); - lowerECAM_bleed = canvas_lowerECAM_bleed.new(groupBleed, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/bleed.svg"); - lowerECAM_cond = canvas_lowerECAM_cond.new(groupCond, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/cond.svg"); - lowerECAM_crz = canvas_lowerECAM_crz.new(groupCrz, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/crz.svg"); - lowerECAM_door = canvas_lowerECAM_door.new(groupDoor, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/door.svg"); - lowerECAM_elec = canvas_lowerECAM_elec.new(groupElec, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/elec.svg"); - lowerECAM_eng = canvas_lowerECAM_eng.new(groupEng, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/eng.svg"); - lowerECAM_fctl = canvas_lowerECAM_fctl.new(groupFctl, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/fctl.svg"); - lowerECAM_fuel = canvas_lowerECAM_fuel.new(groupFuel, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/fuel.svg"); - lowerECAM_press = canvas_lowerECAM_press.new(groupPress, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/press.svg"); - lowerECAM_status = canvas_lowerECAM_status.new(groupStatus, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/status.svg"); - lowerECAM_hyd = canvas_lowerECAM_hyd.new(groupHyd, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/hyd.svg"); - lowerECAM_wheel = canvas_lowerECAM_wheel.new(groupWheel, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/wheel.svg"); - lowerECAM_test = canvas_lowerECAM_test.new(group_test, "Aircraft/A320-family/Models/Instruments/Common/res/du-test.svg"); - lowerECAM_update.start(); - if (rate.getValue() > 1) { - l_rateApply(); - } -}); +var input = { + apuAdr: "/systems/navigation/adr/operating-1", + apuAvailable: "/systems/apu/available", + apuBleed: "/controls/pneumatics/switches/apu", + apuBleedValveCmd: "/systems/pneumatics/valves/apu-bleed-valve-cmd", + apuBleedValvePos: "/systems/pneumatics/valves/apu-bleed-valve", + apuEgt: "/systems/apu/egt-degC", + apuEgtRot: "/ECAM/Lower/APU-EGT", + apuGenPB: "/controls/electrical/switches/apu", + apuGLC: "/systems/electrical/relay/apu-glc/contact-pos", + apuFlap: "/controls/apu/inlet-flap/position-norm", + apuFuelPump: "/systems/fuel/pumps/apu-operate", + apuFuelPumpsOff: "/systems/fuel/pumps/all-eng-pump-off", + apuOilLevel: "/systems/apu/oil/level-l", + apuMaster: "/controls/apu/master", + apuNeedleRot: "/ECAM/Lower/APU-N", + apuRpm: "/engines/engine[2]/n1", + apuPsi: "/systems/pneumatics/source/apu-psi", + apuLoad: "/systems/electrical/extra/apu-load", + apuHertz: "/systems/electrical/sources/apu/output-hertz", + apuVolt: "/systems/electrical/sources/apu/output-volt", +}; -var l_rateApply = func { - lowerECAM_update.restart(0.05 * rate.getValue()); -} - -var lowerECAM_update = maketimer(0.05, func { - canvas_lowerECAM_base.update(); -}); - -var showLowerECAM = func { - var dlg = canvas.Window.new([512, 512], "dialog").set("resize", 1); - dlg.setCanvas(lowerECAM_display); +foreach (var name; keys(input)) { + emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 Lower ECAM", name, input[name])); } setlistener("/systems/electrical/bus/ac-2", func() { - canvas_lowerECAM_base.updateDu4(); -}, 0, 0); + if (A320SDAPU.MainScreen != nil) { A320SDAPU.MainScreen.powerTransient() } +}, 0, 0); \ No newline at end of file diff --git a/Models/Instruments/Lower-ECAM/res/apu.svg b/Models/Instruments/Lower-ECAM/res/apu.svg index 3f443c84..5c375974 100644 --- a/Models/Instruments/Lower-ECAM/res/apu.svg +++ b/Models/Instruments/Lower-ECAM/res/apu.svg @@ -42,8 +42,8 @@ id="namedview371" showgrid="true" inkscape:zoom="0.76543687" - inkscape:cx="663.42185" - inkscape:cy="457.30228" + inkscape:cx="1295.1967" + inkscape:cy="1096.0742" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" @@ -201,7 +201,7 @@ x="465.99081" id="tspan4176" sodipodi:role="line">00 - + id="APUBleedValveCrossBar" + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:label="#rect5105-2" /> LEVEL + OFF diff --git a/Models/Instruments/Upper-ECAM/Upper-ECAM.nas b/Models/Instruments/Upper-ECAM/Upper-ECAM.nas index ae43662d..abe6a09b 100644 --- a/Models/Instruments/Upper-ECAM/Upper-ECAM.nas +++ b/Models/Instruments/Upper-ECAM/Upper-ECAM.nas @@ -990,7 +990,7 @@ var UpperECAMRecipient = var A320EWD = UpperECAMRecipient.new("A320 E/WD"); emesary.GlobalTransmitter.Register(A320EWD); -input = { +var input = { fuelTotalLbs: "/consumables/fuel/total-fuel-lbs", acconfigUnits: "/systems/acconfig/options/weight-kgs", slatLocked: "/fdm/jsbsim/fcs/slat-locked", From 081c075b798f777f10f23b476dd6bdd7bae68519 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Tue, 6 Jul 2021 12:37:18 +0100 Subject: [PATCH 67/96] Bottom part of display --- .../Instruments/Lower-ECAM/Lower-ECAM-old.nas | 80 +---------------- Models/Instruments/Lower-ECAM/Lower-ECAM.nas | 85 ++++++++++++++++++- Models/Instruments/Upper-ECAM/Upper-ECAM.nas | 1 - Nasal/emesary/exec.nas | 1 + 4 files changed, 83 insertions(+), 84 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas index f9a7f0ef..38a590c0 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas @@ -116,7 +116,7 @@ var doorR4_pos = props.globals.getNode("/sim/model/door-positions/doorr4/positio var cargobulk_pos = props.globals.getNode("/sim/model/door-positions/cargobulk/position-norm", 1); var cargofwd_pos = props.globals.getNode("/sim/model/door-positions/cargofwd/position-norm", 1); var cargoaft_pos = props.globals.getNode("/sim/model/door-positions/cargoaft/position-norm", 1); -var gLoad = props.globals.getNode("/ECAM/Lower/g-force-display", 1); +var gLoad = props.globals.getNode("", 1); # Hydraulic var blue_psi = 0; @@ -445,91 +445,13 @@ var canvas_lowerECAM_base = { lowerECAM_wheel.page.hide(); } }, - displayedGForce: 0, updateBottomStatus: func() { - if (dmc.DMController.DMCs[1].outputs[4] != nil) { - me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); - me["SAT"].setColor(0.0509,0.7529,0.2941); - } else { - me["SAT"].setText(sprintf("%s", "XX")); - me["SAT"].setColor(0.7333,0.3803,0); - } - if (dmc.DMController.DMCs[1].outputs[5] != nil) { - me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); - me["TAT"].setColor(0.0509,0.7529,0.2941); - } else { - me["TAT"].setText(sprintf("%s", "XX")); - me["TAT"].setColor(0.7333,0.3803,0); - } - me.gloadStore = gLoad.getValue(); - if ((me.gloadStore == 1 and !me.displayedGForce) or (me.gloadStore != 0 and me.displayedGForce)) { - me.displayedGForce = 1; - me["GLoad"].setText("G.LOAD " ~ sprintf("%3.1f", pts.Accelerations.pilotGDamped.getValue())); - me["GLoad"].show(); - } else { - me.displayedGForce = 0; - me["GLoad"].hide(); - } - me["UTCh"].setText(sprintf("%02d", hour.getValue())); - me["UTCm"].setText(sprintf("%02d", minute.getValue())); - if (fmgc.FMGCInternal.fuelRequest and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating and ecam.phaseNode.getValue() != 1) { - if (acconfig_weight_kgs.getValue()) { - me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000 * LBS2KGS, 100))); - } else { - me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000, 100))); - } - me["GW"].setColor(0.0509,0.7529,0.2941); - } else { - me["GW"].setText(sprintf("%s", "-----")); - me["GW"].setColor(0.0901,0.6039,0.7176); - } - - if (acconfig_weight_kgs.getValue()) { - me["GW-weight-unit"].setText("KG"); - } else { - me["GW-weight-unit"].setText("LBS"); - } }, }; - -var canvas_lowerECAM_apu = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_apu, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","APUN-needle","APUEGT-needle","APUN","APUEGT","APUAvail","APUFlapOpen","APUBleedValve","APUBleedOnline","APUGenOnline","APUGentext","APUGenLoad","APUGenbox","APUGenVolt","APUGenHz","APUBleedPSI","APUfuelLO","APU-low-oil", - "text3724","text3728","text3732"]; - }, - update: func() { - - - - var apu_valve_state2 = apu_valve_state.getValue(); - if (apu_valve_state2 == 1) { - me["APUBleedValve"].setRotation(90 * D2R); - } else { - me["APUBleedValve"].setRotation(0); - } - - if (apu_valve_state2 == apu_valve_state.getValue()) { - me["APUBleedValve"].setColor(0.0509,0.7529,0.2941); - me["APUBleedOnline"].show(); - } else { - me["APUBleedValve"].setColor(0.7333,0.3803,0); - me["APUBleedOnline"].hide(); - } - - me.updateBottomStatus(); - }, -}; - var canvas_lowerECAM_bleed = { new: func(canvas_group, file) { var m = {parents: [canvas_lowerECAM_bleed, canvas_lowerECAM_base]}; diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index fcf37cf6..4ae127b9 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -30,9 +30,12 @@ var canvas_lowerECAMPage = }; canvas.parsesvg(obj.group, svg, {"font-mapper": obj.font_mapper} ); - obj.keysHash = obj.getKeys(); - foreach(var key; obj.keysHash) { + foreach(var key; obj.getKeys()) { + obj[key] = obj.group.getElementById(key); + }; + + foreach(var key; obj.getKeysBottom()) { obj[key] = obj.group.getElementById(key); }; @@ -193,15 +196,77 @@ var canvas_lowerECAMPage = } }), ]; + + obj.displayedGForce = 0; + obj.updateItemsBottom = [ + props.UpdateManager.FromHashValue("acconfigUnits", nil, func(val) { + if (val) { + obj["GW-weight-unit"].setText("KG"); + } else { + obj["GW-weight-unit"].setText("LBS"); + } + }), + props.UpdateManager.FromHashValue("hour", nil, func(val) { + obj["UTCh"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("minute", nil, func(val) { + obj["UTCm"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("gForce", 0.05, func(val) { + if (obj.displayedGForce) { + obj["GLoad"].setText("G.LOAD " ~ sprintf("%3.1f", val)); + } + }), + props.UpdateManager.FromHashValue("gForceDisplay", nil, func(val) { + if ((val == 1 and !obj.displayedGForce) or (val != 0 and obj.displayedGForce)) { + obj.displayedGForce = 1; + obj["GLoad"].show(); + } else { + obj.displayedGForce = 0; + obj["GLoad"].hide(); + } + }), + ]; return obj; }, + getKeysBottom: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; + }, getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","APUN-needle","APUEGT-needle","APUN","APUEGT","APUAvail","APUFlapOpen","APUBleedValve","APUBleedOnline","APUBleedValveCrossBar","APUGenOnline","APUGenOff","APUGentext","APUGenLoad","APUGenbox","APUGenVolt","APUGenHz","APUBleedPSI","APUfuelLO","APU-low-oil", - "text3724","text3728","text3732"]; + return ["APUN-needle","APUEGT-needle","APUN","APUEGT","APUAvail","APUFlapOpen","APUBleedValve","APUBleedOnline","APUBleedValveCrossBar","APUGenOnline","APUGenOff","APUGentext","APUGenLoad","APUGenbox","APUGenVolt","APUGenHz","APUBleedPSI","APUfuelLO","APU-low-oil","text3724","text3728","text3732"]; }, getKeysTest: func() { return ["Test_white","Test_text"]; }, + updateTemperatures: func() { + if (dmc.DMController.DMCs[1].outputs[4] != nil) { + me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["SAT"].setText(sprintf("%s", "XX")); + me["SAT"].setColor(0.7333,0.3803,0); + } + + if (dmc.DMController.DMCs[1].outputs[5] != nil) { + me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["TAT"].setText(sprintf("%s", "XX")); + me["TAT"].setColor(0.7333,0.3803,0); + } + + if (fmgc.FMGCInternal.fuelRequest and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating and ecam.phaseNode.getValue() != 1) { + if (acconfig_weight_kgs.getValue()) { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000 * LBS2KGS, 100))); + } else { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000, 100))); + } + me["GW"].setColor(0.0509,0.7529,0.2941); + } else { + me["GW"].setText(sprintf("%s", "-----")); + me["GW"].setColor(0.0901,0.6039,0.7176); + } + }, update: func(notification) { me.updatePower(); @@ -217,6 +282,13 @@ var canvas_lowerECAMPage = { update_item.update(notification); } + + foreach(var update_item_bottom; me.updateItemsBottom) + { + update_item_bottom.update(notification); + } + + me.updateTemperatures(); }, updateTest: func(notification) { if (du4_test_time.getValue() + 1 >= notification.elapsedTime) { @@ -319,6 +391,11 @@ var input = { apuLoad: "/systems/electrical/extra/apu-load", apuHertz: "/systems/electrical/sources/apu/output-hertz", apuVolt: "/systems/electrical/sources/apu/output-volt", + + gForce: "/accelerations/pilot-gdamped", + gForceDisplay: "/ECAM/Lower/g-force-display", + hour: "/sim/time/utc/hour", + minute: "/sim/time/utc/minute", }; foreach (var name; keys(input)) { diff --git a/Models/Instruments/Upper-ECAM/Upper-ECAM.nas b/Models/Instruments/Upper-ECAM/Upper-ECAM.nas index abe6a09b..ab8f037d 100644 --- a/Models/Instruments/Upper-ECAM/Upper-ECAM.nas +++ b/Models/Instruments/Upper-ECAM/Upper-ECAM.nas @@ -992,7 +992,6 @@ emesary.GlobalTransmitter.Register(A320EWD); var input = { fuelTotalLbs: "/consumables/fuel/total-fuel-lbs", - acconfigUnits: "/systems/acconfig/options/weight-kgs", slatLocked: "/fdm/jsbsim/fcs/slat-locked", # N1 parameters diff --git a/Nasal/emesary/exec.nas b/Nasal/emesary/exec.nas index eda3c5e9..c00a8579 100644 --- a/Nasal/emesary/exec.nas +++ b/Nasal/emesary/exec.nas @@ -42,6 +42,7 @@ input = { frame_rate: "/sim/frame-rate", elapsedTime: "/sim/time/elapsed-sec", FWCPhase: "/ECAM/warning-phase", + acconfigUnits: "/systems/acconfig/options/weight-kgs", # Just about everything uses these properties at some stage, lets add them here! gear0Wow: "/gear/gear[0]/wow", From 593d6be6cf77f43b16ddbfbe0e83f1853c97bbe4 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Tue, 6 Jul 2021 12:44:11 +0100 Subject: [PATCH 68/96] fix nodes --- Models/Instruments/Lower-ECAM/Lower-ECAM.nas | 25 ++++++++++---------- Nasal/ECAM/ECAM-logic.nas | 11 ++++----- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index 4ae127b9..106ee857 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -200,6 +200,7 @@ var canvas_lowerECAMPage = obj.displayedGForce = 0; obj.updateItemsBottom = [ props.UpdateManager.FromHashValue("acconfigUnits", nil, func(val) { + obj.units = val; if (val) { obj["GW-weight-unit"].setText("KG"); } else { @@ -254,18 +255,6 @@ var canvas_lowerECAMPage = me["TAT"].setText(sprintf("%s", "XX")); me["TAT"].setColor(0.7333,0.3803,0); } - - if (fmgc.FMGCInternal.fuelRequest and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating and ecam.phaseNode.getValue() != 1) { - if (acconfig_weight_kgs.getValue()) { - me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000 * LBS2KGS, 100))); - } else { - me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000, 100))); - } - me["GW"].setColor(0.0509,0.7529,0.2941); - } else { - me["GW"].setText(sprintf("%s", "-----")); - me["GW"].setColor(0.0901,0.6039,0.7176); - } }, update: func(notification) { me.updatePower(); @@ -288,6 +277,18 @@ var canvas_lowerECAMPage = update_item_bottom.update(notification); } + if (fmgc.FMGCInternal.fuelRequest and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating and notification.FWCPhase != 1) { + if (me.units) { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000 * LBS2KGS, 100))); + } else { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000, 100))); + } + me["GW"].setColor(0.0509,0.7529,0.2941); + } else { + me["GW"].setText(sprintf("%s", "-----")); + me["GW"].setColor(0.0901,0.6039,0.7176); + } + me.updateTemperatures(); }, updateTest: func(notification) { diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index e5976e0c..f7543c18 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -4,7 +4,6 @@ # props.nas: var dualFailNode = props.globals.initNode("/ECAM/dual-failure-enabled", 0, "BOOL"); -var phaseNode = props.globals.getNode("/ECAM/warning-phase", 1); var apWarn = props.globals.getNode("/it-autoflight/output/ap-warning", 1); var athrWarn = props.globals.getNode("/it-autoflight/output/athr-warning", 1); var emerGen = props.globals.getNode("/controls/electrical/switches/emer-gen", 1); @@ -46,7 +45,7 @@ var _SATval = nil; var ecamConfigTest = props.globals.initNode("/ECAM/to-config-test", 0, "BOOL"); var messages_priority_3 = func { - phaseVar3 = phaseNode.getValue(); + phaseVar3 = pts.ECAM.fwcWarningPhase.getValue(); # Stall # todo - altn law and emer cancel flipflops page 2440 @@ -1161,7 +1160,7 @@ var messages_priority_3 = func { } var messages_priority_2 = func { - phaseVar2 = phaseNode.getValue(); + phaseVar2 = pts.ECAM.fwcWarningPhase.getValue(); if ((phaseVar2 == 2 or phaseVar2 == 3 or phaseVar2 == 9) and warningNodes.Logic.thrLeversNotSet.getValue() and engThrustLvrNotSet.clearFlag == 0) { engThrustLvrNotSet.active = 1; @@ -3130,7 +3129,7 @@ var messages_priority_0 = func { } var messages_config_memo = func { - phaseVarMemo = phaseNode.getValue(); + phaseVarMemo = pts.ECAM.fwcWarningPhase.getValue(); if (pts.Controls.Flight.flapsInput.getValue() == 0 or pts.Controls.Flight.flapsInput.getValue() == 4 or pts.Controls.Flight.speedbrake.getValue() != 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 { @@ -3296,7 +3295,7 @@ var messages_config_memo = func { } var messages_memo = func { - phaseVarMemo2 = phaseNode.getValue(); + phaseVarMemo2 = pts.ECAM.fwcWarningPhase.getValue(); if (getprop("/services/fuel-truck/enable") == 1 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) { refuelg.active = 1; } else { @@ -3399,7 +3398,7 @@ var messages_memo = func { } var messages_right_memo = func { - phaseVarMemo3 = phaseNode.getValue(); + phaseVarMemo3 = pts.ECAM.fwcWarningPhase.getValue(); if (FWC.Timer.toInhibitOutput.getValue() == 1) { to_inhibit.active = 1; } else { From e3c96deecc8152f7e6a64c6bb242eaef23deb7e1 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Tue, 6 Jul 2021 14:00:27 +0100 Subject: [PATCH 69/96] Begin splitting out base and pages --- Models/Instruments/Lower-ECAM/Lower-ECAM.nas | 136 ++++++++++--------- 1 file changed, 74 insertions(+), 62 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index 106ee857..f64db03a 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -10,25 +10,77 @@ var du4_test_time = props.globals.initNode("/instrumentation/du/du4-test-time", var du4_test_amount = props.globals.initNode("/instrumentation/du/du4-test-amount", 0, "DOUBLE"); var du4_offtime = props.globals.initNode("/instrumentation/du/du4-off-time", 0.0, "DOUBLE"); -var canvas_lowerECAMPage = +var canvas_lowerECAM_base = { - new: func(svg) { - var obj = {parents: [canvas_lowerECAMPage] }; - obj.canvas = canvas.new({ + init: func() { + me.canvas = canvas.new({ "name": "lowerECAM", "size": [1024, 1024], "view": [1024, 1024], "mipmapping": 1 }); + me.canvas.addPlacement({"node": "lecam.screen"}); - obj.canvas.addPlacement({"node": "lecam.screen"}); - obj.group = obj.canvas.createGroup(); - obj.test = obj.canvas.createGroup(); - - obj.font_mapper = func(family, weight) { + me.font_mapper = func(family, weight) { return "LiberationFonts/LiberationSans-Regular.ttf"; }; + me.test = me.canvas.createGroup(); + + canvas.parsesvg(me.test, "Aircraft/A320-family/Models/Instruments/Common/res/du-test.svg", {"font-mapper": me.font_mapper} ); + foreach(var key; me.getKeysTest()) { + me[key] = me.test.getElementById(key); + }; + }, + getKeysTest: func() { + return ["Test_white","Test_text"]; + }, + powerTransient: func() { + if (systems.ELEC.Bus.ac2.getValue() >= 110) { + if (du4_offtime.getValue() + 3 < pts.Sim.Time.elapsedSec.getValue()) { + if (pts.Gear.wow[0].getValue()) { + if (!acconfig.getBoolValue() and !du4_test.getBoolValue()) { + du4_test.setValue(1); + du4_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1)); + du4_test_time.setValue(pts.Sim.Time.elapsedSec.getValue()); + } else if (acconfig.getBoolValue() and !du4_test.getBoolValue()) { + du4_test.setValue(1); + du4_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1)); + du4_test_time.setValue(pts.Sim.Time.elapsedSec.getValue() - 30); + } + } else { + du4_test.setValue(1); + du4_test_amount.setValue(0); + du4_test_time.setValue(-100); + } + } + } else { + du4_test.setValue(0); + du4_offtime.setValue(pts.Sim.Time.elapsedSec.getValue()); + } + }, + # Due to weirdness of the parents hash / me reference + # you need to access it using me.Test_white rather than + # me["Test_white"] + updateTest: func(notification) { + if (du4_test_time.getValue() + 1 >= notification.elapsedTime) { + me.Test_white.show(); + me.Test_text.hide(); + } else { + me.Test_white.hide(); + me.Test_text.show(); + } + }, +}; + +canvas_lowerECAM_base.init(); + +var canvas_lowerECAMPage = +{ + new: func(svg) { + var obj = {parents: [canvas_lowerECAMPage,canvas_lowerECAM_base] }; + obj.group = obj.canvas.createGroup(); + canvas.parsesvg(obj.group, svg, {"font-mapper": obj.font_mapper} ); foreach(var key; obj.getKeys()) { @@ -39,11 +91,6 @@ var canvas_lowerECAMPage = obj[key] = obj.group.getElementById(key); }; - canvas.parsesvg(obj.test, "Aircraft/A320-family/Models/Instruments/Common/res/du-test.svg", {"font-mapper": obj.font_mapper} ); - foreach(var key; obj.getKeysTest()) { - obj[key] = obj.test.getElementById(key); - }; - obj.units = acconfig_weight_kgs.getValue(); # init @@ -236,9 +283,6 @@ var canvas_lowerECAMPage = getKeys: func() { return ["APUN-needle","APUEGT-needle","APUN","APUEGT","APUAvail","APUFlapOpen","APUBleedValve","APUBleedOnline","APUBleedValveCrossBar","APUGenOnline","APUGenOff","APUGentext","APUGenLoad","APUGenbox","APUGenVolt","APUGenHz","APUBleedPSI","APUfuelLO","APU-low-oil","text3724","text3728","text3732"]; }, - getKeysTest: func() { - return ["Test_white","Test_text"]; - }, updateTemperatures: func() { if (dmc.DMController.DMCs[1].outputs[4] != nil) { me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); @@ -291,39 +335,6 @@ var canvas_lowerECAMPage = me.updateTemperatures(); }, - updateTest: func(notification) { - if (du4_test_time.getValue() + 1 >= notification.elapsedTime) { - me["Test_white"].show(); - me["Test_text"].hide(); - } else { - me["Test_white"].hide(); - me["Test_text"].show(); - } - }, - powerTransient: func() { - if (systems.ELEC.Bus.ac2.getValue() >= 110) { - if (du4_offtime.getValue() + 3 < pts.Sim.Time.elapsedSec.getValue()) { - if (pts.Gear.wow[0].getValue()) { - if (!acconfig.getBoolValue() and !du4_test.getBoolValue()) { - du4_test.setValue(1); - du4_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1)); - du4_test_time.setValue(pts.Sim.Time.elapsedSec.getValue()); - } else if (acconfig.getBoolValue() and !du4_test.getBoolValue()) { - du4_test.setValue(1); - du4_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1)); - du4_test_time.setValue(pts.Sim.Time.elapsedSec.getValue() - 30); - } - } else { - du4_test.setValue(1); - du4_test_amount.setValue(0); - du4_test_time.setValue(-100); - } - } - } else { - du4_test.setValue(0); - du4_offtime.setValue(pts.Sim.Time.elapsedSec.getValue()); - } - }, updatePower: func() { if (du4_lgt.getValue() > 0.01 and systems.ELEC.Bus.ac2.getValue() >= 110) { if (du4_test_time.getValue() + du4_test_amount.getValue() >= pts.Sim.Time.elapsedSec.getValue()) { @@ -342,22 +353,20 @@ var canvas_lowerECAMPage = var SystemDisplayPageRecipient = { - new: func(_ident, page) + new: func(_ident) { var SDRecipient = emesary.Recipient.new(_ident); - SDRecipient.MainScreen = nil; - SDRecipient.Page = page; + SDRecipient.MainScreen = canvas_lowerECAM_base; + SDRecipient.Page = nil; SDRecipient.Receive = func(notification) { if (notification.NotificationType == "FrameNotification") { - if (SDRecipient.MainScreen == nil) { - SDRecipient.MainScreen = canvas_lowerECAMPage.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/" ~ SDRecipient.Page ~ ".svg"); + if (SDRecipient.Page == nil) { + SDRecipient.Page = SystemDisplayPageRecipient.pageList.apu; } if (math.mod(notifications.frameNotification.FrameCount,2) == 0) { - #if (ecam.SystemDisplayController.displayedPage.name == SDRecipient.Page) { - SDRecipient.MainScreen.update(notification); - #} + SDRecipient.Page.update(notification); } return emesary.Transmitter.ReceiptStatus_OK; } @@ -365,10 +374,13 @@ var SystemDisplayPageRecipient = }; return SDRecipient; }, + pageList: { + apu: canvas_lowerECAMPage.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/apu.svg"), + }, }; -var A320SDAPU = SystemDisplayPageRecipient.new("A320 SD", "apu"); -emesary.GlobalTransmitter.Register(A320SDAPU); +var A320SD = SystemDisplayPageRecipient.new("A320 SD"); +emesary.GlobalTransmitter.Register(A320SD); var input = { @@ -400,9 +412,9 @@ var input = { }; foreach (var name; keys(input)) { - emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 Lower ECAM", name, input[name])); + emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 System Display", name, input[name])); } setlistener("/systems/electrical/bus/ac-2", func() { - if (A320SDAPU.MainScreen != nil) { A320SDAPU.MainScreen.powerTransient() } + A320SD.MainScreen.powerTransient(); }, 0, 0); \ No newline at end of file From a28b6bf89998234d2e2f347a6d5df93468c88d01 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Tue, 6 Jul 2021 20:07:18 +0100 Subject: [PATCH 70/96] Split Lower Ecam pages into different files --- A320-main.xml | 2 + .../Instruments/Lower-ECAM/Lower-ECAM-APU.nas | 309 +++++++++++++++ .../Lower-ECAM/Lower-ECAM-base.nas | 73 ++++ Models/Instruments/Lower-ECAM/Lower-ECAM.nas | 374 +----------------- 4 files changed, 385 insertions(+), 373 deletions(-) create mode 100644 Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas create mode 100644 Models/Instruments/Lower-ECAM/Lower-ECAM-base.nas diff --git a/A320-main.xml b/A320-main.xml index 02cc8599..8daf31d3 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -4734,6 +4734,8 @@ Aircraft/A320-family/Nasal/emesary/exec.nas Aircraft/A320-family/Models/Instruments/Upper-ECAM/Upper-ECAM.nas + Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM-base.nas + Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM.nas diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas new file mode 100644 index 00000000..cb4e9fe5 --- /dev/null +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas @@ -0,0 +1,309 @@ +# A3XX Lower ECAM Canvas +# Copyright (c) 2021 Josh Davidson (Octal450) and Jonathan Redpath + +var apu_load = props.globals.initNode("/systems/electrical/extra/apu-load", 0, "DOUBLE"); +var gen1_load = props.globals.initNode("/systems/electrical/extra/gen1-load", 0, "DOUBLE"); +var gen2_load = props.globals.initNode("/systems/electrical/extra/gen2-load", 0, "DOUBLE"); + +var canvas_lowerECAMPageApu = +{ + new: func(svg) { + var obj = {parents: [canvas_lowerECAMPageApu,canvas_lowerECAM_base] }; + obj.group = obj.canvas.createGroup(); + + canvas.parsesvg(obj.group, svg, {"font-mapper": obj.font_mapper} ); + + foreach(var key; obj.getKeys()) { + obj[key] = obj.group.getElementById(key); + }; + + foreach(var key; obj.getKeysBottom()) { + obj[key] = obj.group.getElementById(key); + }; + + obj.units = acconfig_weight_kgs.getValue(); + + # init + obj["APUGenOff"].hide(); + + obj.update_items = [ + props.UpdateManager.FromHashValue("apuFlap",1, func(val) { + if (val) { + obj["APUFlapOpen"].show(); + } else { + obj["APUFlapOpen"].hide(); + } + }), + props.UpdateManager.FromHashValue("apuNeedleRot",0.1, func(val) { + obj["APUN-needle"].setRotation((val + 90) * D2R); + }), + props.UpdateManager.FromHashValue("apuEgtRot",0.1, func(val) { + obj["APUEGT-needle"].setRotation((val + 90) * D2R); + }), + props.UpdateManager.FromHashValue("apuAvailable", nil, func(val) { + if (val) { + obj["APUAvail"].show(); + } else { + obj["APUAvail"].hide(); + } + }), + props.UpdateManager.FromHashList(["apuRpm","apuEgt","apuMaster","apuGenPB"], nil, func(val) { + if (val.apuRpm > 0.001) { + obj["APUN"].setColor(0.0509,0.7529,0.2941); + obj["APUN"].setText(sprintf("%s", math.round(val.apuRpm))); + obj["APUN-needle"].show(); + obj["APUEGT"].setColor(0.0509,0.7529,0.2941); + obj["APUEGT"].setText(sprintf("%s", math.round(val.apuEgt, 5))); + obj["APUEGT-needle"].show(); + } else { + obj["APUN"].setColor(0.7333,0.3803,0); + obj["APUN"].setText(sprintf("%s", "XX")); + obj["APUN-needle"].hide(); + obj["APUEGT"].setColor(0.7333,0.3803,0); + obj["APUEGT"].setText(sprintf("%s", "XX")); + obj["APUEGT-needle"].hide(); + } + + if (val.apuMaster or val.apuRpm >= 94.9) { + obj["APUGenbox"].show(); + if (val.apuGenPB) { + obj["APUGenOff"].hide(); + obj["APUGentext"].setColor(0.8078,0.8039,0.8078); + obj["APUGenHz"].show(); + obj["APUGenVolt"].show(); + obj["APUGenLoad"].show(); + obj["text3724"].show(); + obj["text3728"].show(); + obj["text3732"].show(); + } else { + obj["APUGenOff"].show(); + obj["APUGentext"].setColor(0.7333,0.3803,0); + obj["APUGenHz"].hide(); + obj["APUGenVolt"].hide(); + obj["APUGenLoad"].hide(); + obj["text3724"].hide(); + obj["text3728"].hide(); + obj["text3732"].hide(); + } + } else { + obj["APUGentext"].setColor(0.8078,0.8039,0.8078); + obj["APUGenbox"].hide(); + obj["APUGenHz"].hide(); + obj["APUGenVolt"].hide(); + obj["APUGenLoad"].hide(); + obj["text3724"].hide(); + obj["text3728"].hide(); + obj["text3732"].hide(); + } + }), + props.UpdateManager.FromHashList(["apuFuelPumpsOff","apuFuelPump"], nil, func(val) { + if (val.apuFuelPumpsOff and !val.apuFuelPump) { + obj["APUfuelLO"].show(); + } else { + obj["APUfuelLO"].hide(); + } + }), + props.UpdateManager.FromHashList(["apuRpm","apuOilLevel","gear0Wow"], nil, func(val) { + if (val.apuRpm >= 94.9 and val.gear0Wow and val.apuOilLevel < 3.69) { + obj["APU-low-oil"].show(); + } else { + obj["APU-low-oil"].hide(); + } + }), + props.UpdateManager.FromHashList(["apuAdr","apuPsi","apuRpm"], nil, func(val) { + if (val.apuAdr and val.apuRpm > 0.001) { + obj["APUBleedPSI"].setColor(0.0509,0.7529,0.2941); + obj["APUBleedPSI"].setText(sprintf("%s", math.round(val.apuPsi))); + } else { + obj["APUBleedPSI"].setColor(0.7333,0.3803,0); + obj["APUBleedPSI"].setText(sprintf("%s", "XX")); + } + }), + props.UpdateManager.FromHashValue("apuLoad", 0.1, func(val) { + obj["APUGenLoad"].setText(sprintf("%s", math.round(val))); + + if (val <= 100) { + obj["APUGenHz"].setColor(0.0509,0.7529,0.2941); + } else { + obj["APUGenHz"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("apuHertz", 1, func(val) { + obj["APUGenHz"].setText(sprintf("%s", math.round(val))); + + if (val >= 390 and val <= 410) { + obj["APUGenHz"].setColor(0.0509,0.7529,0.2941); + } else { + obj["APUGenHz"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("apuVolt", 0.1, func(val) { + obj["APUGenVolt"].setText(sprintf("%s", math.round(val))); + + if (val >= 110 and val <= 120) { + obj["APUGenVolt"].setColor(0.0509,0.7529,0.2941); + } else { + obj["APUGenVolt"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("apuGLC", nil, func(val) { + if (val) { + obj["APUGenOnline"].show(); + } else { + obj["APUGenOnline"].hide(); + } + }), + props.UpdateManager.FromHashList(["apuBleedValvePos","apuBleedValveCmd"], nil, func(val) { + if (val.apuBleedValvePos == 1) { + obj["APUBleedValve"].setRotation(90 * D2R); + obj["APUBleedOnline"].show(); + } else { + obj["APUBleedValve"].setRotation(0); + obj["APUBleedOnline"].hide(); + } + + if (val.apuBleedValveCmd == val.apuBleedValvePos) { + obj["APUBleedValveCrossBar"].setColor(0.0509,0.7529,0.2941); + obj["APUBleedValveCrossBar"].setColorFill(0.0509,0.7529,0.2941); + obj["APUBleedValve"].setColor(0.0509,0.7529,0.2941); + } else { + obj["APUBleedValveCrossBar"].setColor(0.7333,0.3803,0); + obj["APUBleedValveCrossBar"].setColorFill(0.7333,0.3803,0); + obj["APUBleedValve"].setColor(0.7333,0.3803,0); + } + }), + ]; + + obj.displayedGForce = 0; + obj.updateItemsBottom = [ + props.UpdateManager.FromHashValue("acconfigUnits", nil, func(val) { + obj.units = val; + if (val) { + obj["GW-weight-unit"].setText("KG"); + } else { + obj["GW-weight-unit"].setText("LBS"); + } + }), + props.UpdateManager.FromHashValue("hour", nil, func(val) { + obj["UTCh"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("minute", nil, func(val) { + obj["UTCm"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("gForce", 0.05, func(val) { + if (obj.displayedGForce) { + obj["GLoad"].setText("G.LOAD " ~ sprintf("%3.1f", val)); + } + }), + props.UpdateManager.FromHashValue("gForceDisplay", nil, func(val) { + if ((val == 1 and !obj.displayedGForce) or (val != 0 and obj.displayedGForce)) { + obj.displayedGForce = 1; + obj["GLoad"].show(); + } else { + obj.displayedGForce = 0; + obj["GLoad"].hide(); + } + }), + ]; + return obj; + }, + getKeysBottom: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; + }, + getKeys: func() { + return ["APUN-needle","APUEGT-needle","APUN","APUEGT","APUAvail","APUFlapOpen","APUBleedValve","APUBleedOnline","APUBleedValveCrossBar","APUGenOnline","APUGenOff","APUGentext","APUGenLoad","APUGenbox","APUGenVolt","APUGenHz","APUBleedPSI","APUfuelLO","APU-low-oil","text3724","text3728","text3732"]; + }, + updateBottom: func(notification) { + foreach(var update_item_bottom; me.updateItemsBottom) + { + update_item_bottom.update(notification); + } + + if (fmgc.FMGCInternal.fuelRequest and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating and notification.FWCPhase != 1) { + if (me.units) { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000 * LBS2KGS, 100))); + } else { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000, 100))); + } + me["GW"].setColor(0.0509,0.7529,0.2941); + } else { + me["GW"].setText(sprintf("%s", "-----")); + me["GW"].setColor(0.0901,0.6039,0.7176); + } + + if (dmc.DMController.DMCs[1].outputs[4] != nil) { + me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["SAT"].setText(sprintf("%s", "XX")); + me["SAT"].setColor(0.7333,0.3803,0); + } + + if (dmc.DMController.DMCs[1].outputs[5] != nil) { + me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["TAT"].setText(sprintf("%s", "XX")); + me["TAT"].setColor(0.7333,0.3803,0); + } + }, + update: func(notification) { + me.updatePower(); + + if (me.test.getVisible() == 1) { + me.updateTest(notification); + } + + if (me.group.getVisible() == 0) { + return; + } + + foreach(var update_item; me.update_items) + { + update_item.update(notification); + } + + me.updateBottom(notification); + }, + updatePower: func() { + if (du4_lgt.getValue() > 0.01 and systems.ELEC.Bus.ac2.getValue() >= 110) { + if (du4_test_time.getValue() + du4_test_amount.getValue() >= pts.Sim.Time.elapsedSec.getValue()) { + me.group.setVisible(0); + me.test.setVisible(1); + } else { + me.group.setVisible(1); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + }, +}; + +var input = { + apuAdr: "/systems/navigation/adr/operating-1", + apuAvailable: "/systems/apu/available", + apuBleed: "/controls/pneumatics/switches/apu", + apuBleedValveCmd: "/systems/pneumatics/valves/apu-bleed-valve-cmd", + apuBleedValvePos: "/systems/pneumatics/valves/apu-bleed-valve", + apuEgt: "/systems/apu/egt-degC", + apuEgtRot: "/ECAM/Lower/APU-EGT", + apuGenPB: "/controls/electrical/switches/apu", + apuGLC: "/systems/electrical/relay/apu-glc/contact-pos", + apuFlap: "/controls/apu/inlet-flap/position-norm", + apuFuelPump: "/systems/fuel/pumps/apu-operate", + apuFuelPumpsOff: "/systems/fuel/pumps/all-eng-pump-off", + apuOilLevel: "/systems/apu/oil/level-l", + apuMaster: "/controls/apu/master", + apuNeedleRot: "/ECAM/Lower/APU-N", + apuRpm: "/engines/engine[2]/n1", + apuPsi: "/systems/pneumatics/source/apu-psi", + apuLoad: "/systems/electrical/extra/apu-load", + apuHertz: "/systems/electrical/sources/apu/output-hertz", + apuVolt: "/systems/electrical/sources/apu/output-volt", +}; + +foreach (var name; keys(input)) { + emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 System Display", name, input[name])); +} \ No newline at end of file diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-base.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-base.nas new file mode 100644 index 00000000..fbde5c93 --- /dev/null +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-base.nas @@ -0,0 +1,73 @@ +# A3XX Lower ECAM Canvas +# Copyright (c) 2021 Josh Davidson (Octal450) and Jonathan Redpath + +var du4_lgt = props.globals.getNode("/controls/lighting/DU/du4", 1); +var du4_test = props.globals.initNode("/instrumentation/du/du4-test", 0, "BOOL"); +var du4_test_time = props.globals.initNode("/instrumentation/du/du4-test-time", 0, "DOUBLE"); +var du4_test_amount = props.globals.initNode("/instrumentation/du/du4-test-amount", 0, "DOUBLE"); +var du4_offtime = props.globals.initNode("/instrumentation/du/du4-off-time", 0.0, "DOUBLE"); + +var canvas_lowerECAM_base = +{ + init: func() { + me.canvas = canvas.new({ + "name": "lowerECAM", + "size": [1024, 1024], + "view": [1024, 1024], + "mipmapping": 1 + }); + me.canvas.addPlacement({"node": "lecam.screen"}); + + me.font_mapper = func(family, weight) { + return "LiberationFonts/LiberationSans-Regular.ttf"; + }; + + me.test = me.canvas.createGroup(); + + canvas.parsesvg(me.test, "Aircraft/A320-family/Models/Instruments/Common/res/du-test.svg", {"font-mapper": me.font_mapper} ); + foreach(var key; me.getKeysTest()) { + me[key] = me.test.getElementById(key); + }; + }, + getKeysTest: func() { + return ["Test_white","Test_text"]; + }, + powerTransient: func() { + if (systems.ELEC.Bus.ac2.getValue() >= 110) { + if (du4_offtime.getValue() + 3 < pts.Sim.Time.elapsedSec.getValue()) { + if (pts.Gear.wow[0].getValue()) { + if (!acconfig.getBoolValue() and !du4_test.getBoolValue()) { + du4_test.setValue(1); + du4_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1)); + du4_test_time.setValue(pts.Sim.Time.elapsedSec.getValue()); + } else if (acconfig.getBoolValue() and !du4_test.getBoolValue()) { + du4_test.setValue(1); + du4_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1)); + du4_test_time.setValue(pts.Sim.Time.elapsedSec.getValue() - 30); + } + } else { + du4_test.setValue(1); + du4_test_amount.setValue(0); + du4_test_time.setValue(-100); + } + } + } else { + du4_test.setValue(0); + du4_offtime.setValue(pts.Sim.Time.elapsedSec.getValue()); + } + }, + # Due to weirdness of the parents hash / me reference + # you need to access it using me.Test_white rather than + # me["Test_white"] + updateTest: func(notification) { + if (du4_test_time.getValue() + 1 >= notification.elapsedTime) { + me.Test_white.show(); + me.Test_text.hide(); + } else { + me.Test_white.hide(); + me.Test_text.show(); + } + }, +}; + +canvas_lowerECAM_base.init(); \ No newline at end of file diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index f64db03a..12f2954a 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -1,356 +1,6 @@ # A3XX Lower ECAM Canvas # Copyright (c) 2021 Josh Davidson (Octal450) and Jonathan Redpath -var du4_lgt = props.globals.getNode("/controls/lighting/DU/du4", 1); -var apu_load = props.globals.initNode("/systems/electrical/extra/apu-load", 0, "DOUBLE"); -var gen1_load = props.globals.initNode("/systems/electrical/extra/gen1-load", 0, "DOUBLE"); -var gen2_load = props.globals.initNode("/systems/electrical/extra/gen2-load", 0, "DOUBLE"); -var du4_test = props.globals.initNode("/instrumentation/du/du4-test", 0, "BOOL"); -var du4_test_time = props.globals.initNode("/instrumentation/du/du4-test-time", 0, "DOUBLE"); -var du4_test_amount = props.globals.initNode("/instrumentation/du/du4-test-amount", 0, "DOUBLE"); -var du4_offtime = props.globals.initNode("/instrumentation/du/du4-off-time", 0.0, "DOUBLE"); - -var canvas_lowerECAM_base = -{ - init: func() { - me.canvas = canvas.new({ - "name": "lowerECAM", - "size": [1024, 1024], - "view": [1024, 1024], - "mipmapping": 1 - }); - me.canvas.addPlacement({"node": "lecam.screen"}); - - me.font_mapper = func(family, weight) { - return "LiberationFonts/LiberationSans-Regular.ttf"; - }; - - me.test = me.canvas.createGroup(); - - canvas.parsesvg(me.test, "Aircraft/A320-family/Models/Instruments/Common/res/du-test.svg", {"font-mapper": me.font_mapper} ); - foreach(var key; me.getKeysTest()) { - me[key] = me.test.getElementById(key); - }; - }, - getKeysTest: func() { - return ["Test_white","Test_text"]; - }, - powerTransient: func() { - if (systems.ELEC.Bus.ac2.getValue() >= 110) { - if (du4_offtime.getValue() + 3 < pts.Sim.Time.elapsedSec.getValue()) { - if (pts.Gear.wow[0].getValue()) { - if (!acconfig.getBoolValue() and !du4_test.getBoolValue()) { - du4_test.setValue(1); - du4_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1)); - du4_test_time.setValue(pts.Sim.Time.elapsedSec.getValue()); - } else if (acconfig.getBoolValue() and !du4_test.getBoolValue()) { - du4_test.setValue(1); - du4_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1)); - du4_test_time.setValue(pts.Sim.Time.elapsedSec.getValue() - 30); - } - } else { - du4_test.setValue(1); - du4_test_amount.setValue(0); - du4_test_time.setValue(-100); - } - } - } else { - du4_test.setValue(0); - du4_offtime.setValue(pts.Sim.Time.elapsedSec.getValue()); - } - }, - # Due to weirdness of the parents hash / me reference - # you need to access it using me.Test_white rather than - # me["Test_white"] - updateTest: func(notification) { - if (du4_test_time.getValue() + 1 >= notification.elapsedTime) { - me.Test_white.show(); - me.Test_text.hide(); - } else { - me.Test_white.hide(); - me.Test_text.show(); - } - }, -}; - -canvas_lowerECAM_base.init(); - -var canvas_lowerECAMPage = -{ - new: func(svg) { - var obj = {parents: [canvas_lowerECAMPage,canvas_lowerECAM_base] }; - obj.group = obj.canvas.createGroup(); - - canvas.parsesvg(obj.group, svg, {"font-mapper": obj.font_mapper} ); - - foreach(var key; obj.getKeys()) { - obj[key] = obj.group.getElementById(key); - }; - - foreach(var key; obj.getKeysBottom()) { - obj[key] = obj.group.getElementById(key); - }; - - obj.units = acconfig_weight_kgs.getValue(); - - # init - obj["APUGenOff"].hide(); - - obj.update_items = [ - props.UpdateManager.FromHashValue("apuFlap",1, func(val) { - if (val) { - obj["APUFlapOpen"].show(); - } else { - obj["APUFlapOpen"].hide(); - } - }), - props.UpdateManager.FromHashValue("apuNeedleRot",0.1, func(val) { - obj["APUN-needle"].setRotation((val + 90) * D2R); - }), - props.UpdateManager.FromHashValue("apuEgtRot",0.1, func(val) { - obj["APUEGT-needle"].setRotation((val + 90) * D2R); - }), - props.UpdateManager.FromHashValue("apuAvailable", nil, func(val) { - if (val) { - obj["APUAvail"].show(); - } else { - obj["APUAvail"].hide(); - } - }), - props.UpdateManager.FromHashList(["apuRpm","apuEgt","apuMaster","apuGenPB"], nil, func(val) { - if (val.apuRpm > 0.001) { - obj["APUN"].setColor(0.0509,0.7529,0.2941); - obj["APUN"].setText(sprintf("%s", math.round(val.apuRpm))); - obj["APUN-needle"].show(); - obj["APUEGT"].setColor(0.0509,0.7529,0.2941); - obj["APUEGT"].setText(sprintf("%s", math.round(val.apuEgt, 5))); - obj["APUEGT-needle"].show(); - } else { - obj["APUN"].setColor(0.7333,0.3803,0); - obj["APUN"].setText(sprintf("%s", "XX")); - obj["APUN-needle"].hide(); - obj["APUEGT"].setColor(0.7333,0.3803,0); - obj["APUEGT"].setText(sprintf("%s", "XX")); - obj["APUEGT-needle"].hide(); - } - - if (val.apuMaster or val.apuRpm >= 94.9) { - obj["APUGenbox"].show(); - if (val.apuGenPB) { - obj["APUGenOff"].hide(); - obj["APUGentext"].setColor(0.8078,0.8039,0.8078); - obj["APUGenHz"].show(); - obj["APUGenVolt"].show(); - obj["APUGenLoad"].show(); - obj["text3724"].show(); - obj["text3728"].show(); - obj["text3732"].show(); - } else { - obj["APUGenOff"].show(); - obj["APUGentext"].setColor(0.7333,0.3803,0); - obj["APUGenHz"].hide(); - obj["APUGenVolt"].hide(); - obj["APUGenLoad"].hide(); - obj["text3724"].hide(); - obj["text3728"].hide(); - obj["text3732"].hide(); - } - } else { - obj["APUGentext"].setColor(0.8078,0.8039,0.8078); - obj["APUGenbox"].hide(); - obj["APUGenHz"].hide(); - obj["APUGenVolt"].hide(); - obj["APUGenLoad"].hide(); - obj["text3724"].hide(); - obj["text3728"].hide(); - obj["text3732"].hide(); - } - }), - props.UpdateManager.FromHashList(["apuFuelPumpsOff","apuFuelPump"], nil, func(val) { - if (val.apuFuelPumpsOff and !val.apuFuelPump) { - obj["APUfuelLO"].show(); - } else { - obj["APUfuelLO"].hide(); - } - }), - props.UpdateManager.FromHashList(["apuRpm","apuOilLevel","gear0Wow"], nil, func(val) { - if (val.apuRpm >= 94.9 and val.gear0Wow and val.apuOilLevel < 3.69) { - obj["APU-low-oil"].show(); - } else { - obj["APU-low-oil"].hide(); - } - }), - props.UpdateManager.FromHashList(["apuAdr","apuPsi","apuRpm"], nil, func(val) { - if (val.apuAdr and val.apuRpm > 0.001) { - obj["APUBleedPSI"].setColor(0.0509,0.7529,0.2941); - obj["APUBleedPSI"].setText(sprintf("%s", math.round(val.apuPsi))); - } else { - obj["APUBleedPSI"].setColor(0.7333,0.3803,0); - obj["APUBleedPSI"].setText(sprintf("%s", "XX")); - } - }), - props.UpdateManager.FromHashValue("apuLoad", 0.1, func(val) { - obj["APUGenLoad"].setText(sprintf("%s", math.round(val))); - - if (val <= 100) { - obj["APUGenHz"].setColor(0.0509,0.7529,0.2941); - } else { - obj["APUGenHz"].setColor(0.7333,0.3803,0); - } - }), - props.UpdateManager.FromHashValue("apuHertz", 1, func(val) { - obj["APUGenHz"].setText(sprintf("%s", math.round(val))); - - if (val >= 390 and val <= 410) { - obj["APUGenHz"].setColor(0.0509,0.7529,0.2941); - } else { - obj["APUGenHz"].setColor(0.7333,0.3803,0); - } - }), - props.UpdateManager.FromHashValue("apuVolt", 0.1, func(val) { - obj["APUGenVolt"].setText(sprintf("%s", math.round(val))); - - if (val >= 110 and val <= 120) { - obj["APUGenVolt"].setColor(0.0509,0.7529,0.2941); - } else { - obj["APUGenVolt"].setColor(0.7333,0.3803,0); - } - }), - props.UpdateManager.FromHashValue("apuGLC", nil, func(val) { - if (val) { - obj["APUGenOnline"].show(); - } else { - obj["APUGenOnline"].hide(); - } - }), - props.UpdateManager.FromHashList(["apuBleedValvePos","apuBleedValveCmd"], nil, func(val) { - if (val.apuBleedValvePos == 1) { - obj["APUBleedValve"].setRotation(90 * D2R); - obj["APUBleedOnline"].show(); - } else { - obj["APUBleedValve"].setRotation(0); - obj["APUBleedOnline"].hide(); - } - - if (val.apuBleedValveCmd == val.apuBleedValvePos) { - obj["APUBleedValveCrossBar"].setColor(0.0509,0.7529,0.2941); - obj["APUBleedValveCrossBar"].setColorFill(0.0509,0.7529,0.2941); - obj["APUBleedValve"].setColor(0.0509,0.7529,0.2941); - } else { - obj["APUBleedValveCrossBar"].setColor(0.7333,0.3803,0); - obj["APUBleedValveCrossBar"].setColorFill(0.7333,0.3803,0); - obj["APUBleedValve"].setColor(0.7333,0.3803,0); - } - }), - ]; - - obj.displayedGForce = 0; - obj.updateItemsBottom = [ - props.UpdateManager.FromHashValue("acconfigUnits", nil, func(val) { - obj.units = val; - if (val) { - obj["GW-weight-unit"].setText("KG"); - } else { - obj["GW-weight-unit"].setText("LBS"); - } - }), - props.UpdateManager.FromHashValue("hour", nil, func(val) { - obj["UTCh"].setText(sprintf("%02d", val)); - }), - props.UpdateManager.FromHashValue("minute", nil, func(val) { - obj["UTCm"].setText(sprintf("%02d", val)); - }), - props.UpdateManager.FromHashValue("gForce", 0.05, func(val) { - if (obj.displayedGForce) { - obj["GLoad"].setText("G.LOAD " ~ sprintf("%3.1f", val)); - } - }), - props.UpdateManager.FromHashValue("gForceDisplay", nil, func(val) { - if ((val == 1 and !obj.displayedGForce) or (val != 0 and obj.displayedGForce)) { - obj.displayedGForce = 1; - obj["GLoad"].show(); - } else { - obj.displayedGForce = 0; - obj["GLoad"].hide(); - } - }), - ]; - return obj; - }, - getKeysBottom: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; - }, - getKeys: func() { - return ["APUN-needle","APUEGT-needle","APUN","APUEGT","APUAvail","APUFlapOpen","APUBleedValve","APUBleedOnline","APUBleedValveCrossBar","APUGenOnline","APUGenOff","APUGentext","APUGenLoad","APUGenbox","APUGenVolt","APUGenHz","APUBleedPSI","APUfuelLO","APU-low-oil","text3724","text3728","text3732"]; - }, - updateTemperatures: func() { - if (dmc.DMController.DMCs[1].outputs[4] != nil) { - me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); - me["SAT"].setColor(0.0509,0.7529,0.2941); - } else { - me["SAT"].setText(sprintf("%s", "XX")); - me["SAT"].setColor(0.7333,0.3803,0); - } - - if (dmc.DMController.DMCs[1].outputs[5] != nil) { - me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); - me["TAT"].setColor(0.0509,0.7529,0.2941); - } else { - me["TAT"].setText(sprintf("%s", "XX")); - me["TAT"].setColor(0.7333,0.3803,0); - } - }, - update: func(notification) { - me.updatePower(); - - if (me.test.getVisible() == 1) { - me.updateTest(notification); - } - - if (me.group.getVisible() == 0) { - return; - } - - foreach(var update_item; me.update_items) - { - update_item.update(notification); - } - - foreach(var update_item_bottom; me.updateItemsBottom) - { - update_item_bottom.update(notification); - } - - if (fmgc.FMGCInternal.fuelRequest and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating and notification.FWCPhase != 1) { - if (me.units) { - me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000 * LBS2KGS, 100))); - } else { - me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000, 100))); - } - me["GW"].setColor(0.0509,0.7529,0.2941); - } else { - me["GW"].setText(sprintf("%s", "-----")); - me["GW"].setColor(0.0901,0.6039,0.7176); - } - - me.updateTemperatures(); - }, - updatePower: func() { - if (du4_lgt.getValue() > 0.01 and systems.ELEC.Bus.ac2.getValue() >= 110) { - if (du4_test_time.getValue() + du4_test_amount.getValue() >= pts.Sim.Time.elapsedSec.getValue()) { - me.group.setVisible(0); - me.test.setVisible(1); - } else { - me.group.setVisible(1); - me.test.setVisible(0); - } - } else { - me.group.setVisible(0); - me.test.setVisible(0); - } - }, -}; - var SystemDisplayPageRecipient = { new: func(_ident) @@ -375,36 +25,14 @@ var SystemDisplayPageRecipient = return SDRecipient; }, pageList: { - apu: canvas_lowerECAMPage.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/apu.svg"), + apu: canvas_lowerECAMPageApu.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/apu.svg"), }, }; var A320SD = SystemDisplayPageRecipient.new("A320 SD"); emesary.GlobalTransmitter.Register(A320SD); - var input = { - apuAdr: "/systems/navigation/adr/operating-1", - apuAvailable: "/systems/apu/available", - apuBleed: "/controls/pneumatics/switches/apu", - apuBleedValveCmd: "/systems/pneumatics/valves/apu-bleed-valve-cmd", - apuBleedValvePos: "/systems/pneumatics/valves/apu-bleed-valve", - apuEgt: "/systems/apu/egt-degC", - apuEgtRot: "/ECAM/Lower/APU-EGT", - apuGenPB: "/controls/electrical/switches/apu", - apuGLC: "/systems/electrical/relay/apu-glc/contact-pos", - apuFlap: "/controls/apu/inlet-flap/position-norm", - apuFuelPump: "/systems/fuel/pumps/apu-operate", - apuFuelPumpsOff: "/systems/fuel/pumps/all-eng-pump-off", - apuOilLevel: "/systems/apu/oil/level-l", - apuMaster: "/controls/apu/master", - apuNeedleRot: "/ECAM/Lower/APU-N", - apuRpm: "/engines/engine[2]/n1", - apuPsi: "/systems/pneumatics/source/apu-psi", - apuLoad: "/systems/electrical/extra/apu-load", - apuHertz: "/systems/electrical/sources/apu/output-hertz", - apuVolt: "/systems/electrical/sources/apu/output-volt", - gForce: "/accelerations/pilot-gdamped", gForceDisplay: "/ECAM/Lower/g-force-display", hour: "/sim/time/utc/hour", From 8ae0f00f69ef4361d25c65eb99df5768e7053293 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 8 Jul 2021 12:34:30 +0100 Subject: [PATCH 71/96] Add all pages and add switching mechanism --- A320-main.xml | 11 ++ .../Instruments/Lower-ECAM/Lower-ECAM-APU.nas | 18 ++- .../Lower-ECAM/Lower-ECAM-bleed.nas | 147 ++++++++++++++++++ .../Lower-ECAM/Lower-ECAM-cond.nas | 147 ++++++++++++++++++ .../Lower-ECAM/Lower-ECAM-door.nas | 147 ++++++++++++++++++ .../Lower-ECAM/Lower-ECAM-elec.nas | 147 ++++++++++++++++++ .../Instruments/Lower-ECAM/Lower-ECAM-eng.nas | 147 ++++++++++++++++++ .../Lower-ECAM/Lower-ECAM-fctl.nas | 147 ++++++++++++++++++ .../Lower-ECAM/Lower-ECAM-fuel.nas | 147 ++++++++++++++++++ .../Instruments/Lower-ECAM/Lower-ECAM-hyd.nas | 147 ++++++++++++++++++ .../Lower-ECAM/Lower-ECAM-press.nas | 147 ++++++++++++++++++ .../Instruments/Lower-ECAM/Lower-ECAM-sts.nas | 147 ++++++++++++++++++ .../Lower-ECAM/Lower-ECAM-wheel.nas | 147 ++++++++++++++++++ Models/Instruments/Lower-ECAM/Lower-ECAM.nas | 28 +++- 14 files changed, 1665 insertions(+), 9 deletions(-) create mode 100644 Models/Instruments/Lower-ECAM/Lower-ECAM-bleed.nas create mode 100644 Models/Instruments/Lower-ECAM/Lower-ECAM-cond.nas create mode 100644 Models/Instruments/Lower-ECAM/Lower-ECAM-door.nas create mode 100644 Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas create mode 100644 Models/Instruments/Lower-ECAM/Lower-ECAM-eng.nas create mode 100644 Models/Instruments/Lower-ECAM/Lower-ECAM-fctl.nas create mode 100644 Models/Instruments/Lower-ECAM/Lower-ECAM-fuel.nas create mode 100644 Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas create mode 100644 Models/Instruments/Lower-ECAM/Lower-ECAM-press.nas create mode 100644 Models/Instruments/Lower-ECAM/Lower-ECAM-sts.nas create mode 100644 Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas diff --git a/A320-main.xml b/A320-main.xml index 8daf31d3..d503ce7c 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -4736,6 +4736,17 @@ Aircraft/A320-family/Models/Instruments/Upper-ECAM/Upper-ECAM.nas Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM-base.nas Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas + Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM-bleed.nas + Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM-cond.nas + Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM-door.nas + Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas + Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM-eng.nas + Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM-fctl.nas + Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM-fuel.nas + Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas + Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM-press.nas + Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM-sts.nas + Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM.nas diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas index cb4e9fe5..684725cb 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas @@ -7,9 +7,10 @@ var gen2_load = props.globals.initNode("/systems/electrical/extra/gen2-load", 0, var canvas_lowerECAMPageApu = { - new: func(svg) { + new: func(svg,name) { var obj = {parents: [canvas_lowerECAMPageApu,canvas_lowerECAM_base] }; obj.group = obj.canvas.createGroup(); + obj.name = name; canvas.parsesvg(obj.group, svg, {"font-mapper": obj.font_mapper} ); @@ -266,12 +267,17 @@ var canvas_lowerECAMPageApu = me.updateBottom(notification); }, updatePower: func() { - if (du4_lgt.getValue() > 0.01 and systems.ELEC.Bus.ac2.getValue() >= 110) { - if (du4_test_time.getValue() + du4_test_amount.getValue() >= pts.Sim.Time.elapsedSec.getValue()) { - me.group.setVisible(0); - me.test.setVisible(1); + if (me.name == ecam.SystemDisplayController.displayedPage.name) { + if (du4_lgt.getValue() > 0.01 and systems.ELEC.Bus.ac2.getValue() >= 110) { + if (du4_test_time.getValue() + du4_test_amount.getValue() >= pts.Sim.Time.elapsedSec.getValue()) { + me.group.setVisible(0); + me.test.setVisible(1); + } else { + me.group.setVisible(1); + me.test.setVisible(0); + } } else { - me.group.setVisible(1); + me.group.setVisible(0); me.test.setVisible(0); } } else { diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-bleed.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-bleed.nas new file mode 100644 index 00000000..3bf4995f --- /dev/null +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-bleed.nas @@ -0,0 +1,147 @@ +# A3XX Lower ECAM Canvas +# Copyright (c) 2021 Josh Davidson (Octal450) and Jonathan Redpath + +var canvas_lowerECAMPageBleed = +{ + new: func(svg,name) { + var obj = {parents: [canvas_lowerECAMPageBleed,canvas_lowerECAM_base] }; + obj.group = obj.canvas.createGroup(); + obj.name = name; + + canvas.parsesvg(obj.group, svg, {"font-mapper": obj.font_mapper} ); + + foreach(var key; obj.getKeys()) { + obj[key] = obj.group.getElementById(key); + }; + + foreach(var key; obj.getKeysBottom()) { + obj[key] = obj.group.getElementById(key); + }; + + obj.units = acconfig_weight_kgs.getValue(); + + # init + + obj.update_items = [ + ]; + + obj.displayedGForce = 0; + obj.updateItemsBottom = [ + props.UpdateManager.FromHashValue("acconfigUnits", nil, func(val) { + obj.units = val; + if (val) { + obj["GW-weight-unit"].setText("KG"); + } else { + obj["GW-weight-unit"].setText("LBS"); + } + }), + props.UpdateManager.FromHashValue("hour", nil, func(val) { + obj["UTCh"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("minute", nil, func(val) { + obj["UTCm"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("gForce", 0.05, func(val) { + if (obj.displayedGForce) { + obj["GLoad"].setText("G.LOAD " ~ sprintf("%3.1f", val)); + } + }), + props.UpdateManager.FromHashValue("gForceDisplay", nil, func(val) { + if ((val == 1 and !obj.displayedGForce) or (val != 0 and obj.displayedGForce)) { + obj.displayedGForce = 1; + obj["GLoad"].show(); + } else { + obj.displayedGForce = 0; + obj["GLoad"].hide(); + } + }), + ]; + return obj; + }, + getKeysBottom: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; + }, + getKeys: func() { + return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", + "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", + "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", + "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + updateBottom: func(notification) { + foreach(var update_item_bottom; me.updateItemsBottom) + { + update_item_bottom.update(notification); + } + + if (fmgc.FMGCInternal.fuelRequest and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating and notification.FWCPhase != 1) { + if (me.units) { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000 * LBS2KGS, 100))); + } else { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000, 100))); + } + me["GW"].setColor(0.0509,0.7529,0.2941); + } else { + me["GW"].setText(sprintf("%s", "-----")); + me["GW"].setColor(0.0901,0.6039,0.7176); + } + + if (dmc.DMController.DMCs[1].outputs[4] != nil) { + me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["SAT"].setText(sprintf("%s", "XX")); + me["SAT"].setColor(0.7333,0.3803,0); + } + + if (dmc.DMController.DMCs[1].outputs[5] != nil) { + me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["TAT"].setText(sprintf("%s", "XX")); + me["TAT"].setColor(0.7333,0.3803,0); + } + }, + update: func(notification) { + me.updatePower(); + + if (me.test.getVisible() == 1) { + me.updateTest(notification); + } + + if (me.group.getVisible() == 0) { + return; + } + + foreach(var update_item; me.update_items) + { + update_item.update(notification); + } + + me.updateBottom(notification); + }, + updatePower: func() { + if (me.name == ecam.SystemDisplayController.displayedPage.name) { + if (du4_lgt.getValue() > 0.01 and systems.ELEC.Bus.ac2.getValue() >= 110) { + if (du4_test_time.getValue() + du4_test_amount.getValue() >= pts.Sim.Time.elapsedSec.getValue()) { + me.group.setVisible(0); + me.test.setVisible(1); + } else { + me.group.setVisible(1); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + }, +}; + +var input = { +}; + +foreach (var name; keys(input)) { + emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 System Display", name, input[name])); +} \ No newline at end of file diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-cond.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-cond.nas new file mode 100644 index 00000000..8a0ef52c --- /dev/null +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-cond.nas @@ -0,0 +1,147 @@ +# A3XX Lower ECAM Canvas +# Copyright (c) 2021 Josh Davidson (Octal450) and Jonathan Redpath + +var canvas_lowerECAMPageCond = +{ + new: func(svg,name) { + var obj = {parents: [canvas_lowerECAMPageCond,canvas_lowerECAM_base] }; + obj.group = obj.canvas.createGroup(); + obj.name = name; + + canvas.parsesvg(obj.group, svg, {"font-mapper": obj.font_mapper} ); + + foreach(var key; obj.getKeys()) { + obj[key] = obj.group.getElementById(key); + }; + + foreach(var key; obj.getKeysBottom()) { + obj[key] = obj.group.getElementById(key); + }; + + obj.units = acconfig_weight_kgs.getValue(); + + # init + + obj.update_items = [ + ]; + + obj.displayedGForce = 0; + obj.updateItemsBottom = [ + props.UpdateManager.FromHashValue("acconfigUnits", nil, func(val) { + obj.units = val; + if (val) { + obj["GW-weight-unit"].setText("KG"); + } else { + obj["GW-weight-unit"].setText("LBS"); + } + }), + props.UpdateManager.FromHashValue("hour", nil, func(val) { + obj["UTCh"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("minute", nil, func(val) { + obj["UTCm"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("gForce", 0.05, func(val) { + if (obj.displayedGForce) { + obj["GLoad"].setText("G.LOAD " ~ sprintf("%3.1f", val)); + } + }), + props.UpdateManager.FromHashValue("gForceDisplay", nil, func(val) { + if ((val == 1 and !obj.displayedGForce) or (val != 0 and obj.displayedGForce)) { + obj.displayedGForce = 1; + obj["GLoad"].show(); + } else { + obj.displayedGForce = 0; + obj["GLoad"].hide(); + } + }), + ]; + return obj; + }, + getKeysBottom: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; + }, + getKeys: func() { + return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", + "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", + "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", + "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + updateBottom: func(notification) { + foreach(var update_item_bottom; me.updateItemsBottom) + { + update_item_bottom.update(notification); + } + + if (fmgc.FMGCInternal.fuelRequest and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating and notification.FWCPhase != 1) { + if (me.units) { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000 * LBS2KGS, 100))); + } else { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000, 100))); + } + me["GW"].setColor(0.0509,0.7529,0.2941); + } else { + me["GW"].setText(sprintf("%s", "-----")); + me["GW"].setColor(0.0901,0.6039,0.7176); + } + + if (dmc.DMController.DMCs[1].outputs[4] != nil) { + me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["SAT"].setText(sprintf("%s", "XX")); + me["SAT"].setColor(0.7333,0.3803,0); + } + + if (dmc.DMController.DMCs[1].outputs[5] != nil) { + me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["TAT"].setText(sprintf("%s", "XX")); + me["TAT"].setColor(0.7333,0.3803,0); + } + }, + update: func(notification) { + me.updatePower(); + + if (me.test.getVisible() == 1) { + me.updateTest(notification); + } + + if (me.group.getVisible() == 0) { + return; + } + + foreach(var update_item; me.update_items) + { + update_item.update(notification); + } + + me.updateBottom(notification); + }, + updatePower: func() { + if (me.name == ecam.SystemDisplayController.displayedPage.name) { + if (du4_lgt.getValue() > 0.01 and systems.ELEC.Bus.ac2.getValue() >= 110) { + if (du4_test_time.getValue() + du4_test_amount.getValue() >= pts.Sim.Time.elapsedSec.getValue()) { + me.group.setVisible(0); + me.test.setVisible(1); + } else { + me.group.setVisible(1); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + }, +}; + +var input = { +}; + +foreach (var name; keys(input)) { + emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 System Display", name, input[name])); +} \ No newline at end of file diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-door.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-door.nas new file mode 100644 index 00000000..33407b06 --- /dev/null +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-door.nas @@ -0,0 +1,147 @@ +# A3XX Lower ECAM Canvas +# Copyright (c) 2021 Josh Davidson (Octal450) and Jonathan Redpath + +var canvas_lowerECAMPageDoor = +{ + new: func(svg,name) { + var obj = {parents: [canvas_lowerECAMPageDoor,canvas_lowerECAM_base] }; + obj.group = obj.canvas.createGroup(); + obj.name = name; + + canvas.parsesvg(obj.group, svg, {"font-mapper": obj.font_mapper} ); + + foreach(var key; obj.getKeys()) { + obj[key] = obj.group.getElementById(key); + }; + + foreach(var key; obj.getKeysBottom()) { + obj[key] = obj.group.getElementById(key); + }; + + obj.units = acconfig_weight_kgs.getValue(); + + # init + + obj.update_items = [ + ]; + + obj.displayedGForce = 0; + obj.updateItemsBottom = [ + props.UpdateManager.FromHashValue("acconfigUnits", nil, func(val) { + obj.units = val; + if (val) { + obj["GW-weight-unit"].setText("KG"); + } else { + obj["GW-weight-unit"].setText("LBS"); + } + }), + props.UpdateManager.FromHashValue("hour", nil, func(val) { + obj["UTCh"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("minute", nil, func(val) { + obj["UTCm"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("gForce", 0.05, func(val) { + if (obj.displayedGForce) { + obj["GLoad"].setText("G.LOAD " ~ sprintf("%3.1f", val)); + } + }), + props.UpdateManager.FromHashValue("gForceDisplay", nil, func(val) { + if ((val == 1 and !obj.displayedGForce) or (val != 0 and obj.displayedGForce)) { + obj.displayedGForce = 1; + obj["GLoad"].show(); + } else { + obj.displayedGForce = 0; + obj["GLoad"].hide(); + } + }), + ]; + return obj; + }, + getKeysBottom: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; + }, + getKeys: func() { + return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", + "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", + "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", + "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + updateBottom: func(notification) { + foreach(var update_item_bottom; me.updateItemsBottom) + { + update_item_bottom.update(notification); + } + + if (fmgc.FMGCInternal.fuelRequest and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating and notification.FWCPhase != 1) { + if (me.units) { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000 * LBS2KGS, 100))); + } else { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000, 100))); + } + me["GW"].setColor(0.0509,0.7529,0.2941); + } else { + me["GW"].setText(sprintf("%s", "-----")); + me["GW"].setColor(0.0901,0.6039,0.7176); + } + + if (dmc.DMController.DMCs[1].outputs[4] != nil) { + me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["SAT"].setText(sprintf("%s", "XX")); + me["SAT"].setColor(0.7333,0.3803,0); + } + + if (dmc.DMController.DMCs[1].outputs[5] != nil) { + me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["TAT"].setText(sprintf("%s", "XX")); + me["TAT"].setColor(0.7333,0.3803,0); + } + }, + update: func(notification) { + me.updatePower(); + + if (me.test.getVisible() == 1) { + me.updateTest(notification); + } + + if (me.group.getVisible() == 0) { + return; + } + + foreach(var update_item; me.update_items) + { + update_item.update(notification); + } + + me.updateBottom(notification); + }, + updatePower: func() { + if (me.name == ecam.SystemDisplayController.displayedPage.name) { + if (du4_lgt.getValue() > 0.01 and systems.ELEC.Bus.ac2.getValue() >= 110) { + if (du4_test_time.getValue() + du4_test_amount.getValue() >= pts.Sim.Time.elapsedSec.getValue()) { + me.group.setVisible(0); + me.test.setVisible(1); + } else { + me.group.setVisible(1); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + }, +}; + +var input = { +}; + +foreach (var name; keys(input)) { + emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 System Display", name, input[name])); +} \ No newline at end of file diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas new file mode 100644 index 00000000..0ef42285 --- /dev/null +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas @@ -0,0 +1,147 @@ +# A3XX Lower ECAM Canvas +# Copyright (c) 2021 Josh Davidson (Octal450) and Jonathan Redpath + +var canvas_lowerECAMPageElec = +{ + new: func(svg,name) { + var obj = {parents: [canvas_lowerECAMPageElec,canvas_lowerECAM_base] }; + obj.group = obj.canvas.createGroup(); + obj.name = name; + + canvas.parsesvg(obj.group, svg, {"font-mapper": obj.font_mapper} ); + + foreach(var key; obj.getKeys()) { + obj[key] = obj.group.getElementById(key); + }; + + foreach(var key; obj.getKeysBottom()) { + obj[key] = obj.group.getElementById(key); + }; + + obj.units = acconfig_weight_kgs.getValue(); + + # init + + obj.update_items = [ + ]; + + obj.displayedGForce = 0; + obj.updateItemsBottom = [ + props.UpdateManager.FromHashValue("acconfigUnits", nil, func(val) { + obj.units = val; + if (val) { + obj["GW-weight-unit"].setText("KG"); + } else { + obj["GW-weight-unit"].setText("LBS"); + } + }), + props.UpdateManager.FromHashValue("hour", nil, func(val) { + obj["UTCh"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("minute", nil, func(val) { + obj["UTCm"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("gForce", 0.05, func(val) { + if (obj.displayedGForce) { + obj["GLoad"].setText("G.LOAD " ~ sprintf("%3.1f", val)); + } + }), + props.UpdateManager.FromHashValue("gForceDisplay", nil, func(val) { + if ((val == 1 and !obj.displayedGForce) or (val != 0 and obj.displayedGForce)) { + obj.displayedGForce = 1; + obj["GLoad"].show(); + } else { + obj.displayedGForce = 0; + obj["GLoad"].hide(); + } + }), + ]; + return obj; + }, + getKeysBottom: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; + }, + getKeys: func() { + return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", + "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", + "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", + "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + updateBottom: func(notification) { + foreach(var update_item_bottom; me.updateItemsBottom) + { + update_item_bottom.update(notification); + } + + if (fmgc.FMGCInternal.fuelRequest and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating and notification.FWCPhase != 1) { + if (me.units) { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000 * LBS2KGS, 100))); + } else { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000, 100))); + } + me["GW"].setColor(0.0509,0.7529,0.2941); + } else { + me["GW"].setText(sprintf("%s", "-----")); + me["GW"].setColor(0.0901,0.6039,0.7176); + } + + if (dmc.DMController.DMCs[1].outputs[4] != nil) { + me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["SAT"].setText(sprintf("%s", "XX")); + me["SAT"].setColor(0.7333,0.3803,0); + } + + if (dmc.DMController.DMCs[1].outputs[5] != nil) { + me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["TAT"].setText(sprintf("%s", "XX")); + me["TAT"].setColor(0.7333,0.3803,0); + } + }, + update: func(notification) { + me.updatePower(); + + if (me.test.getVisible() == 1) { + me.updateTest(notification); + } + + if (me.group.getVisible() == 0) { + return; + } + + foreach(var update_item; me.update_items) + { + update_item.update(notification); + } + + me.updateBottom(notification); + }, + updatePower: func() { + if (me.name == ecam.SystemDisplayController.displayedPage.name) { + if (du4_lgt.getValue() > 0.01 and systems.ELEC.Bus.ac2.getValue() >= 110) { + if (du4_test_time.getValue() + du4_test_amount.getValue() >= pts.Sim.Time.elapsedSec.getValue()) { + me.group.setVisible(0); + me.test.setVisible(1); + } else { + me.group.setVisible(1); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + }, +}; + +var input = { +}; + +foreach (var name; keys(input)) { + emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 System Display", name, input[name])); +} \ No newline at end of file diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-eng.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-eng.nas new file mode 100644 index 00000000..17d66c1c --- /dev/null +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-eng.nas @@ -0,0 +1,147 @@ +# A3XX Lower ECAM Canvas +# Copyright (c) 2021 Josh Davidson (Octal450) and Jonathan Redpath + +var canvas_lowerECAMPageEng = +{ + new: func(svg,name) { + var obj = {parents: [canvas_lowerECAMPageEng,canvas_lowerECAM_base] }; + obj.group = obj.canvas.createGroup(); + obj.name = name; + + canvas.parsesvg(obj.group, svg, {"font-mapper": obj.font_mapper} ); + + foreach(var key; obj.getKeys()) { + obj[key] = obj.group.getElementById(key); + }; + + foreach(var key; obj.getKeysBottom()) { + obj[key] = obj.group.getElementById(key); + }; + + obj.units = acconfig_weight_kgs.getValue(); + + # init + + obj.update_items = [ + ]; + + obj.displayedGForce = 0; + obj.updateItemsBottom = [ + props.UpdateManager.FromHashValue("acconfigUnits", nil, func(val) { + obj.units = val; + if (val) { + obj["GW-weight-unit"].setText("KG"); + } else { + obj["GW-weight-unit"].setText("LBS"); + } + }), + props.UpdateManager.FromHashValue("hour", nil, func(val) { + obj["UTCh"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("minute", nil, func(val) { + obj["UTCm"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("gForce", 0.05, func(val) { + if (obj.displayedGForce) { + obj["GLoad"].setText("G.LOAD " ~ sprintf("%3.1f", val)); + } + }), + props.UpdateManager.FromHashValue("gForceDisplay", nil, func(val) { + if ((val == 1 and !obj.displayedGForce) or (val != 0 and obj.displayedGForce)) { + obj.displayedGForce = 1; + obj["GLoad"].show(); + } else { + obj.displayedGForce = 0; + obj["GLoad"].hide(); + } + }), + ]; + return obj; + }, + getKeysBottom: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; + }, + getKeys: func() { + return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", + "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", + "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", + "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + updateBottom: func(notification) { + foreach(var update_item_bottom; me.updateItemsBottom) + { + update_item_bottom.update(notification); + } + + if (fmgc.FMGCInternal.fuelRequest and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating and notification.FWCPhase != 1) { + if (me.units) { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000 * LBS2KGS, 100))); + } else { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000, 100))); + } + me["GW"].setColor(0.0509,0.7529,0.2941); + } else { + me["GW"].setText(sprintf("%s", "-----")); + me["GW"].setColor(0.0901,0.6039,0.7176); + } + + if (dmc.DMController.DMCs[1].outputs[4] != nil) { + me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["SAT"].setText(sprintf("%s", "XX")); + me["SAT"].setColor(0.7333,0.3803,0); + } + + if (dmc.DMController.DMCs[1].outputs[5] != nil) { + me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["TAT"].setText(sprintf("%s", "XX")); + me["TAT"].setColor(0.7333,0.3803,0); + } + }, + update: func(notification) { + me.updatePower(); + + if (me.test.getVisible() == 1) { + me.updateTest(notification); + } + + if (me.group.getVisible() == 0) { + return; + } + + foreach(var update_item; me.update_items) + { + update_item.update(notification); + } + + me.updateBottom(notification); + }, + updatePower: func() { + if (me.name == ecam.SystemDisplayController.displayedPage.name) { + if (du4_lgt.getValue() > 0.01 and systems.ELEC.Bus.ac2.getValue() >= 110) { + if (du4_test_time.getValue() + du4_test_amount.getValue() >= pts.Sim.Time.elapsedSec.getValue()) { + me.group.setVisible(0); + me.test.setVisible(1); + } else { + me.group.setVisible(1); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + }, +}; + +var input = { +}; + +foreach (var name; keys(input)) { + emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 System Display", name, input[name])); +} \ No newline at end of file diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-fctl.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-fctl.nas new file mode 100644 index 00000000..7daf17d5 --- /dev/null +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-fctl.nas @@ -0,0 +1,147 @@ +# A3XX Lower ECAM Canvas +# Copyright (c) 2021 Josh Davidson (Octal450) and Jonathan Redpath + +var canvas_lowerECAMPageFctl = +{ + new: func(svg,name) { + var obj = {parents: [canvas_lowerECAMPageFctl,canvas_lowerECAM_base] }; + obj.group = obj.canvas.createGroup(); + obj.name = name; + + canvas.parsesvg(obj.group, svg, {"font-mapper": obj.font_mapper} ); + + foreach(var key; obj.getKeys()) { + obj[key] = obj.group.getElementById(key); + }; + + foreach(var key; obj.getKeysBottom()) { + obj[key] = obj.group.getElementById(key); + }; + + obj.units = acconfig_weight_kgs.getValue(); + + # init + + obj.update_items = [ + ]; + + obj.displayedGForce = 0; + obj.updateItemsBottom = [ + props.UpdateManager.FromHashValue("acconfigUnits", nil, func(val) { + obj.units = val; + if (val) { + obj["GW-weight-unit"].setText("KG"); + } else { + obj["GW-weight-unit"].setText("LBS"); + } + }), + props.UpdateManager.FromHashValue("hour", nil, func(val) { + obj["UTCh"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("minute", nil, func(val) { + obj["UTCm"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("gForce", 0.05, func(val) { + if (obj.displayedGForce) { + obj["GLoad"].setText("G.LOAD " ~ sprintf("%3.1f", val)); + } + }), + props.UpdateManager.FromHashValue("gForceDisplay", nil, func(val) { + if ((val == 1 and !obj.displayedGForce) or (val != 0 and obj.displayedGForce)) { + obj.displayedGForce = 1; + obj["GLoad"].show(); + } else { + obj.displayedGForce = 0; + obj["GLoad"].hide(); + } + }), + ]; + return obj; + }, + getKeysBottom: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; + }, + getKeys: func() { + return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", + "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", + "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", + "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + updateBottom: func(notification) { + foreach(var update_item_bottom; me.updateItemsBottom) + { + update_item_bottom.update(notification); + } + + if (fmgc.FMGCInternal.fuelRequest and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating and notification.FWCPhase != 1) { + if (me.units) { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000 * LBS2KGS, 100))); + } else { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000, 100))); + } + me["GW"].setColor(0.0509,0.7529,0.2941); + } else { + me["GW"].setText(sprintf("%s", "-----")); + me["GW"].setColor(0.0901,0.6039,0.7176); + } + + if (dmc.DMController.DMCs[1].outputs[4] != nil) { + me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["SAT"].setText(sprintf("%s", "XX")); + me["SAT"].setColor(0.7333,0.3803,0); + } + + if (dmc.DMController.DMCs[1].outputs[5] != nil) { + me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["TAT"].setText(sprintf("%s", "XX")); + me["TAT"].setColor(0.7333,0.3803,0); + } + }, + update: func(notification) { + me.updatePower(); + + if (me.test.getVisible() == 1) { + me.updateTest(notification); + } + + if (me.group.getVisible() == 0) { + return; + } + + foreach(var update_item; me.update_items) + { + update_item.update(notification); + } + + me.updateBottom(notification); + }, + updatePower: func() { + if (me.name == ecam.SystemDisplayController.displayedPage.name) { + if (du4_lgt.getValue() > 0.01 and systems.ELEC.Bus.ac2.getValue() >= 110) { + if (du4_test_time.getValue() + du4_test_amount.getValue() >= pts.Sim.Time.elapsedSec.getValue()) { + me.group.setVisible(0); + me.test.setVisible(1); + } else { + me.group.setVisible(1); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + }, +}; + +var input = { +}; + +foreach (var name; keys(input)) { + emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 System Display", name, input[name])); +} \ No newline at end of file diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-fuel.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-fuel.nas new file mode 100644 index 00000000..a0028d58 --- /dev/null +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-fuel.nas @@ -0,0 +1,147 @@ +# A3XX Lower ECAM Canvas +# Copyright (c) 2021 Josh Davidson (Octal450) and Jonathan Redpath + +var canvas_lowerECAMPageFuel = +{ + new: func(svg,name) { + var obj = {parents: [canvas_lowerECAMPageFuel,canvas_lowerECAM_base] }; + obj.group = obj.canvas.createGroup(); + obj.name = name; + + canvas.parsesvg(obj.group, svg, {"font-mapper": obj.font_mapper} ); + + foreach(var key; obj.getKeys()) { + obj[key] = obj.group.getElementById(key); + }; + + foreach(var key; obj.getKeysBottom()) { + obj[key] = obj.group.getElementById(key); + }; + + obj.units = acconfig_weight_kgs.getValue(); + + # init + + obj.update_items = [ + ]; + + obj.displayedGForce = 0; + obj.updateItemsBottom = [ + props.UpdateManager.FromHashValue("acconfigUnits", nil, func(val) { + obj.units = val; + if (val) { + obj["GW-weight-unit"].setText("KG"); + } else { + obj["GW-weight-unit"].setText("LBS"); + } + }), + props.UpdateManager.FromHashValue("hour", nil, func(val) { + obj["UTCh"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("minute", nil, func(val) { + obj["UTCm"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("gForce", 0.05, func(val) { + if (obj.displayedGForce) { + obj["GLoad"].setText("G.LOAD " ~ sprintf("%3.1f", val)); + } + }), + props.UpdateManager.FromHashValue("gForceDisplay", nil, func(val) { + if ((val == 1 and !obj.displayedGForce) or (val != 0 and obj.displayedGForce)) { + obj.displayedGForce = 1; + obj["GLoad"].show(); + } else { + obj.displayedGForce = 0; + obj["GLoad"].hide(); + } + }), + ]; + return obj; + }, + getKeysBottom: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; + }, + getKeys: func() { + return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", + "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", + "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", + "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + updateBottom: func(notification) { + foreach(var update_item_bottom; me.updateItemsBottom) + { + update_item_bottom.update(notification); + } + + if (fmgc.FMGCInternal.fuelRequest and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating and notification.FWCPhase != 1) { + if (me.units) { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000 * LBS2KGS, 100))); + } else { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000, 100))); + } + me["GW"].setColor(0.0509,0.7529,0.2941); + } else { + me["GW"].setText(sprintf("%s", "-----")); + me["GW"].setColor(0.0901,0.6039,0.7176); + } + + if (dmc.DMController.DMCs[1].outputs[4] != nil) { + me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["SAT"].setText(sprintf("%s", "XX")); + me["SAT"].setColor(0.7333,0.3803,0); + } + + if (dmc.DMController.DMCs[1].outputs[5] != nil) { + me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["TAT"].setText(sprintf("%s", "XX")); + me["TAT"].setColor(0.7333,0.3803,0); + } + }, + update: func(notification) { + me.updatePower(); + + if (me.test.getVisible() == 1) { + me.updateTest(notification); + } + + if (me.group.getVisible() == 0) { + return; + } + + foreach(var update_item; me.update_items) + { + update_item.update(notification); + } + + me.updateBottom(notification); + }, + updatePower: func() { + if (me.name == ecam.SystemDisplayController.displayedPage.name) { + if (du4_lgt.getValue() > 0.01 and systems.ELEC.Bus.ac2.getValue() >= 110) { + if (du4_test_time.getValue() + du4_test_amount.getValue() >= pts.Sim.Time.elapsedSec.getValue()) { + me.group.setVisible(0); + me.test.setVisible(1); + } else { + me.group.setVisible(1); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + }, +}; + +var input = { +}; + +foreach (var name; keys(input)) { + emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 System Display", name, input[name])); +} \ No newline at end of file diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas new file mode 100644 index 00000000..d19c0dce --- /dev/null +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas @@ -0,0 +1,147 @@ +# A3XX Lower ECAM Canvas +# Copyright (c) 2021 Josh Davidson (Octal450) and Jonathan Redpath + +var canvas_lowerECAMPageHyd = +{ + new: func(svg,name) { + var obj = {parents: [canvas_lowerECAMPageHyd,canvas_lowerECAM_base] }; + obj.group = obj.canvas.createGroup(); + obj.name = name; + + canvas.parsesvg(obj.group, svg, {"font-mapper": obj.font_mapper} ); + + foreach(var key; obj.getKeys()) { + obj[key] = obj.group.getElementById(key); + }; + + foreach(var key; obj.getKeysBottom()) { + obj[key] = obj.group.getElementById(key); + }; + + obj.units = acconfig_weight_kgs.getValue(); + + # init + + obj.update_items = [ + ]; + + obj.displayedGForce = 0; + obj.updateItemsBottom = [ + props.UpdateManager.FromHashValue("acconfigUnits", nil, func(val) { + obj.units = val; + if (val) { + obj["GW-weight-unit"].setText("KG"); + } else { + obj["GW-weight-unit"].setText("LBS"); + } + }), + props.UpdateManager.FromHashValue("hour", nil, func(val) { + obj["UTCh"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("minute", nil, func(val) { + obj["UTCm"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("gForce", 0.05, func(val) { + if (obj.displayedGForce) { + obj["GLoad"].setText("G.LOAD " ~ sprintf("%3.1f", val)); + } + }), + props.UpdateManager.FromHashValue("gForceDisplay", nil, func(val) { + if ((val == 1 and !obj.displayedGForce) or (val != 0 and obj.displayedGForce)) { + obj.displayedGForce = 1; + obj["GLoad"].show(); + } else { + obj.displayedGForce = 0; + obj["GLoad"].hide(); + } + }), + ]; + return obj; + }, + getKeysBottom: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; + }, + getKeys: func() { + return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", + "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", + "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", + "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + updateBottom: func(notification) { + foreach(var update_item_bottom; me.updateItemsBottom) + { + update_item_bottom.update(notification); + } + + if (fmgc.FMGCInternal.fuelRequest and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating and notification.FWCPhase != 1) { + if (me.units) { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000 * LBS2KGS, 100))); + } else { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000, 100))); + } + me["GW"].setColor(0.0509,0.7529,0.2941); + } else { + me["GW"].setText(sprintf("%s", "-----")); + me["GW"].setColor(0.0901,0.6039,0.7176); + } + + if (dmc.DMController.DMCs[1].outputs[4] != nil) { + me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["SAT"].setText(sprintf("%s", "XX")); + me["SAT"].setColor(0.7333,0.3803,0); + } + + if (dmc.DMController.DMCs[1].outputs[5] != nil) { + me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["TAT"].setText(sprintf("%s", "XX")); + me["TAT"].setColor(0.7333,0.3803,0); + } + }, + update: func(notification) { + me.updatePower(); + + if (me.test.getVisible() == 1) { + me.updateTest(notification); + } + + if (me.group.getVisible() == 0) { + return; + } + + foreach(var update_item; me.update_items) + { + update_item.update(notification); + } + + me.updateBottom(notification); + }, + updatePower: func() { + if (me.name == ecam.SystemDisplayController.displayedPage.name) { + if (du4_lgt.getValue() > 0.01 and systems.ELEC.Bus.ac2.getValue() >= 110) { + if (du4_test_time.getValue() + du4_test_amount.getValue() >= pts.Sim.Time.elapsedSec.getValue()) { + me.group.setVisible(0); + me.test.setVisible(1); + } else { + me.group.setVisible(1); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + }, +}; + +var input = { +}; + +foreach (var name; keys(input)) { + emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 System Display", name, input[name])); +} \ No newline at end of file diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-press.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-press.nas new file mode 100644 index 00000000..e998aab7 --- /dev/null +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-press.nas @@ -0,0 +1,147 @@ +# A3XX Lower ECAM Canvas +# Copyright (c) 2021 Josh Davidson (Octal450) and Jonathan Redpath + +var canvas_lowerECAMPagePress = +{ + new: func(svg,name) { + var obj = {parents: [canvas_lowerECAMPagePress,canvas_lowerECAM_base] }; + obj.group = obj.canvas.createGroup(); + obj.name = name; + + canvas.parsesvg(obj.group, svg, {"font-mapper": obj.font_mapper} ); + + foreach(var key; obj.getKeys()) { + obj[key] = obj.group.getElementById(key); + }; + + foreach(var key; obj.getKeysBottom()) { + obj[key] = obj.group.getElementById(key); + }; + + obj.units = acconfig_weight_kgs.getValue(); + + # init + + obj.update_items = [ + ]; + + obj.displayedGForce = 0; + obj.updateItemsBottom = [ + props.UpdateManager.FromHashValue("acconfigUnits", nil, func(val) { + obj.units = val; + if (val) { + obj["GW-weight-unit"].setText("KG"); + } else { + obj["GW-weight-unit"].setText("LBS"); + } + }), + props.UpdateManager.FromHashValue("hour", nil, func(val) { + obj["UTCh"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("minute", nil, func(val) { + obj["UTCm"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("gForce", 0.05, func(val) { + if (obj.displayedGForce) { + obj["GLoad"].setText("G.LOAD " ~ sprintf("%3.1f", val)); + } + }), + props.UpdateManager.FromHashValue("gForceDisplay", nil, func(val) { + if ((val == 1 and !obj.displayedGForce) or (val != 0 and obj.displayedGForce)) { + obj.displayedGForce = 1; + obj["GLoad"].show(); + } else { + obj.displayedGForce = 0; + obj["GLoad"].hide(); + } + }), + ]; + return obj; + }, + getKeysBottom: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; + }, + getKeys: func() { + return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", + "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", + "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", + "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + updateBottom: func(notification) { + foreach(var update_item_bottom; me.updateItemsBottom) + { + update_item_bottom.update(notification); + } + + if (fmgc.FMGCInternal.fuelRequest and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating and notification.FWCPhase != 1) { + if (me.units) { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000 * LBS2KGS, 100))); + } else { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000, 100))); + } + me["GW"].setColor(0.0509,0.7529,0.2941); + } else { + me["GW"].setText(sprintf("%s", "-----")); + me["GW"].setColor(0.0901,0.6039,0.7176); + } + + if (dmc.DMController.DMCs[1].outputs[4] != nil) { + me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["SAT"].setText(sprintf("%s", "XX")); + me["SAT"].setColor(0.7333,0.3803,0); + } + + if (dmc.DMController.DMCs[1].outputs[5] != nil) { + me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["TAT"].setText(sprintf("%s", "XX")); + me["TAT"].setColor(0.7333,0.3803,0); + } + }, + update: func(notification) { + me.updatePower(); + + if (me.test.getVisible() == 1) { + me.updateTest(notification); + } + + if (me.group.getVisible() == 0) { + return; + } + + foreach(var update_item; me.update_items) + { + update_item.update(notification); + } + + me.updateBottom(notification); + }, + updatePower: func() { + if (me.name == ecam.SystemDisplayController.displayedPage.name) { + if (du4_lgt.getValue() > 0.01 and systems.ELEC.Bus.ac2.getValue() >= 110) { + if (du4_test_time.getValue() + du4_test_amount.getValue() >= pts.Sim.Time.elapsedSec.getValue()) { + me.group.setVisible(0); + me.test.setVisible(1); + } else { + me.group.setVisible(1); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + }, +}; + +var input = { +}; + +foreach (var name; keys(input)) { + emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 System Display", name, input[name])); +} \ No newline at end of file diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-sts.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-sts.nas new file mode 100644 index 00000000..87a0f883 --- /dev/null +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-sts.nas @@ -0,0 +1,147 @@ +# A3XX Lower ECAM Canvas +# Copyright (c) 2021 Josh Davidson (Octal450) and Jonathan Redpath + +var canvas_lowerECAMPageSts = +{ + new: func(svg,name) { + var obj = {parents: [canvas_lowerECAMPageSts,canvas_lowerECAM_base] }; + obj.group = obj.canvas.createGroup(); + obj.name = name; + + canvas.parsesvg(obj.group, svg, {"font-mapper": obj.font_mapper} ); + + foreach(var key; obj.getKeys()) { + obj[key] = obj.group.getElementById(key); + }; + + foreach(var key; obj.getKeysBottom()) { + obj[key] = obj.group.getElementById(key); + }; + + obj.units = acconfig_weight_kgs.getValue(); + + # init + + obj.update_items = [ + ]; + + obj.displayedGForce = 0; + obj.updateItemsBottom = [ + props.UpdateManager.FromHashValue("acconfigUnits", nil, func(val) { + obj.units = val; + if (val) { + obj["GW-weight-unit"].setText("KG"); + } else { + obj["GW-weight-unit"].setText("LBS"); + } + }), + props.UpdateManager.FromHashValue("hour", nil, func(val) { + obj["UTCh"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("minute", nil, func(val) { + obj["UTCm"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("gForce", 0.05, func(val) { + if (obj.displayedGForce) { + obj["GLoad"].setText("G.LOAD " ~ sprintf("%3.1f", val)); + } + }), + props.UpdateManager.FromHashValue("gForceDisplay", nil, func(val) { + if ((val == 1 and !obj.displayedGForce) or (val != 0 and obj.displayedGForce)) { + obj.displayedGForce = 1; + obj["GLoad"].show(); + } else { + obj.displayedGForce = 0; + obj["GLoad"].hide(); + } + }), + ]; + return obj; + }, + getKeysBottom: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; + }, + getKeys: func() { + return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", + "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", + "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", + "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + updateBottom: func(notification) { + foreach(var update_item_bottom; me.updateItemsBottom) + { + update_item_bottom.update(notification); + } + + if (fmgc.FMGCInternal.fuelRequest and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating and notification.FWCPhase != 1) { + if (me.units) { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000 * LBS2KGS, 100))); + } else { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000, 100))); + } + me["GW"].setColor(0.0509,0.7529,0.2941); + } else { + me["GW"].setText(sprintf("%s", "-----")); + me["GW"].setColor(0.0901,0.6039,0.7176); + } + + if (dmc.DMController.DMCs[1].outputs[4] != nil) { + me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["SAT"].setText(sprintf("%s", "XX")); + me["SAT"].setColor(0.7333,0.3803,0); + } + + if (dmc.DMController.DMCs[1].outputs[5] != nil) { + me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["TAT"].setText(sprintf("%s", "XX")); + me["TAT"].setColor(0.7333,0.3803,0); + } + }, + update: func(notification) { + me.updatePower(); + + if (me.test.getVisible() == 1) { + me.updateTest(notification); + } + + if (me.group.getVisible() == 0) { + return; + } + + foreach(var update_item; me.update_items) + { + update_item.update(notification); + } + + me.updateBottom(notification); + }, + updatePower: func() { + if (me.name == ecam.SystemDisplayController.displayedPage.name) { + if (du4_lgt.getValue() > 0.01 and systems.ELEC.Bus.ac2.getValue() >= 110) { + if (du4_test_time.getValue() + du4_test_amount.getValue() >= pts.Sim.Time.elapsedSec.getValue()) { + me.group.setVisible(0); + me.test.setVisible(1); + } else { + me.group.setVisible(1); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + }, +}; + +var input = { +}; + +foreach (var name; keys(input)) { + emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 System Display", name, input[name])); +} \ No newline at end of file diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas new file mode 100644 index 00000000..50fc1d03 --- /dev/null +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas @@ -0,0 +1,147 @@ +# A3XX Lower ECAM Canvas +# Copyright (c) 2021 Josh Davidson (Octal450) and Jonathan Redpath + +var canvas_lowerECAMPageWheel = +{ + new: func(svg,name) { + var obj = {parents: [canvas_lowerECAMPageWheel,canvas_lowerECAM_base] }; + obj.group = obj.canvas.createGroup(); + obj.name = name; + + canvas.parsesvg(obj.group, svg, {"font-mapper": obj.font_mapper} ); + + foreach(var key; obj.getKeys()) { + obj[key] = obj.group.getElementById(key); + }; + + foreach(var key; obj.getKeysBottom()) { + obj[key] = obj.group.getElementById(key); + }; + + obj.units = acconfig_weight_kgs.getValue(); + + # init + + obj.update_items = [ + ]; + + obj.displayedGForce = 0; + obj.updateItemsBottom = [ + props.UpdateManager.FromHashValue("acconfigUnits", nil, func(val) { + obj.units = val; + if (val) { + obj["GW-weight-unit"].setText("KG"); + } else { + obj["GW-weight-unit"].setText("LBS"); + } + }), + props.UpdateManager.FromHashValue("hour", nil, func(val) { + obj["UTCh"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("minute", nil, func(val) { + obj["UTCm"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("gForce", 0.05, func(val) { + if (obj.displayedGForce) { + obj["GLoad"].setText("G.LOAD " ~ sprintf("%3.1f", val)); + } + }), + props.UpdateManager.FromHashValue("gForceDisplay", nil, func(val) { + if ((val == 1 and !obj.displayedGForce) or (val != 0 and obj.displayedGForce)) { + obj.displayedGForce = 1; + obj["GLoad"].show(); + } else { + obj.displayedGForce = 0; + obj["GLoad"].hide(); + } + }), + ]; + return obj; + }, + getKeysBottom: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; + }, + getKeys: func() { + return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", + "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", + "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", + "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + updateBottom: func(notification) { + foreach(var update_item_bottom; me.updateItemsBottom) + { + update_item_bottom.update(notification); + } + + if (fmgc.FMGCInternal.fuelRequest and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating and notification.FWCPhase != 1) { + if (me.units) { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000 * LBS2KGS, 100))); + } else { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000, 100))); + } + me["GW"].setColor(0.0509,0.7529,0.2941); + } else { + me["GW"].setText(sprintf("%s", "-----")); + me["GW"].setColor(0.0901,0.6039,0.7176); + } + + if (dmc.DMController.DMCs[1].outputs[4] != nil) { + me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["SAT"].setText(sprintf("%s", "XX")); + me["SAT"].setColor(0.7333,0.3803,0); + } + + if (dmc.DMController.DMCs[1].outputs[5] != nil) { + me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["TAT"].setText(sprintf("%s", "XX")); + me["TAT"].setColor(0.7333,0.3803,0); + } + }, + update: func(notification) { + me.updatePower(); + + if (me.test.getVisible() == 1) { + me.updateTest(notification); + } + + if (me.group.getVisible() == 0) { + return; + } + + foreach(var update_item; me.update_items) + { + update_item.update(notification); + } + + me.updateBottom(notification); + }, + updatePower: func() { + if (me.name == ecam.SystemDisplayController.displayedPage.name) { + if (du4_lgt.getValue() > 0.01 and systems.ELEC.Bus.ac2.getValue() >= 110) { + if (du4_test_time.getValue() + du4_test_amount.getValue() >= pts.Sim.Time.elapsedSec.getValue()) { + me.group.setVisible(0); + me.test.setVisible(1); + } else { + me.group.setVisible(1); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + }, +}; + +var input = { +}; + +foreach (var name; keys(input)) { + emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 System Display", name, input[name])); +} \ No newline at end of file diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index 12f2954a..819f043b 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -13,10 +13,21 @@ var SystemDisplayPageRecipient = if (notification.NotificationType == "FrameNotification") { if (SDRecipient.Page == nil) { - SDRecipient.Page = SystemDisplayPageRecipient.pageList.apu; + SDRecipient.Page = SystemDisplayPageRecipient.pageList.door; } if (math.mod(notifications.frameNotification.FrameCount,2) == 0) { - SDRecipient.Page.update(notification); + SystemDisplayPageRecipient.pageList.apu.update(notification); + SystemDisplayPageRecipient.pageList.bleed.update(notification); + SystemDisplayPageRecipient.pageList.cond.update(notification); + SystemDisplayPageRecipient.pageList.door.update(notification); + SystemDisplayPageRecipient.pageList.elec.update(notification); + SystemDisplayPageRecipient.pageList.eng.update(notification); + SystemDisplayPageRecipient.pageList.fctl.update(notification); + SystemDisplayPageRecipient.pageList.fuel.update(notification); + SystemDisplayPageRecipient.pageList.hyd.update(notification); + SystemDisplayPageRecipient.pageList.press.update(notification); + SystemDisplayPageRecipient.pageList.sts.update(notification); + SystemDisplayPageRecipient.pageList.wheel.update(notification); } return emesary.Transmitter.ReceiptStatus_OK; } @@ -25,7 +36,18 @@ var SystemDisplayPageRecipient = return SDRecipient; }, pageList: { - apu: canvas_lowerECAMPageApu.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/apu.svg"), + apu: canvas_lowerECAMPageApu.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/apu.svg","apu"), + bleed: canvas_lowerECAMPageBleed.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/bleed.svg","bleed"), + cond: canvas_lowerECAMPageCond.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/cond.svg","cond"), + door: canvas_lowerECAMPageDoor.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/door.svg","door"), + elec: canvas_lowerECAMPageElec.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/elec.svg","elec"), + eng: canvas_lowerECAMPageEng.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/eng.svg","eng"), + fctl: canvas_lowerECAMPageFctl.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/fctl.svg","fctl"), + fuel: canvas_lowerECAMPageFuel.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/fuel.svg","fuel"), + hyd: canvas_lowerECAMPageHyd.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/hyd.svg","hyd"), + press: canvas_lowerECAMPagePress.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/press.svg","press"), + sts: canvas_lowerECAMPageSts.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/status.svg","sts"), + wheel: canvas_lowerECAMPageWheel.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/wheel.svg","wheel") }, }; From 7194d2e691bfbfaf3dcf0e8376b06dd06a2c9455 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 8 Jul 2021 15:38:24 +0100 Subject: [PATCH 72/96] Add temperature plus sign, add cruise page --- A320-main.xml | 1 + .../Instruments/Lower-ECAM/Lower-ECAM-APU.nas | 4 +- .../Lower-ECAM/Lower-ECAM-bleed.nas | 4 +- .../Lower-ECAM/Lower-ECAM-cond.nas | 4 +- .../Lower-ECAM/Lower-ECAM-cruise.nas | 147 ++++++++++++++++++ .../Lower-ECAM/Lower-ECAM-door.nas | 4 +- .../Lower-ECAM/Lower-ECAM-elec.nas | 4 +- .../Instruments/Lower-ECAM/Lower-ECAM-eng.nas | 4 +- .../Lower-ECAM/Lower-ECAM-fctl.nas | 4 +- .../Lower-ECAM/Lower-ECAM-fuel.nas | 4 +- .../Instruments/Lower-ECAM/Lower-ECAM-hyd.nas | 4 +- .../Lower-ECAM/Lower-ECAM-press.nas | 4 +- .../Instruments/Lower-ECAM/Lower-ECAM-sts.nas | 4 +- .../Lower-ECAM/Lower-ECAM-wheel.nas | 4 +- Models/Instruments/Lower-ECAM/Lower-ECAM.nas | 1 + 15 files changed, 173 insertions(+), 24 deletions(-) create mode 100644 Models/Instruments/Lower-ECAM/Lower-ECAM-cruise.nas diff --git a/A320-main.xml b/A320-main.xml index d503ce7c..493ca69c 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -4738,6 +4738,7 @@ Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM-bleed.nas Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM-cond.nas + Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM-cruise.nas Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM-door.nas Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas Aircraft/A320-family/Models/Instruments/Lower-ECAM/Lower-ECAM-eng.nas diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas index 684725cb..6f07e897 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas @@ -233,7 +233,7 @@ var canvas_lowerECAMPageApu = } if (dmc.DMController.DMCs[1].outputs[4] != nil) { - me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); me["SAT"].setColor(0.0509,0.7529,0.2941); } else { me["SAT"].setText(sprintf("%s", "XX")); @@ -241,7 +241,7 @@ var canvas_lowerECAMPageApu = } if (dmc.DMController.DMCs[1].outputs[5] != nil) { - me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); me["TAT"].setColor(0.0509,0.7529,0.2941); } else { me["TAT"].setText(sprintf("%s", "XX")); diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-bleed.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-bleed.nas index 3bf4995f..2ce9816b 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-bleed.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-bleed.nas @@ -85,7 +85,7 @@ var canvas_lowerECAMPageBleed = } if (dmc.DMController.DMCs[1].outputs[4] != nil) { - me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); me["SAT"].setColor(0.0509,0.7529,0.2941); } else { me["SAT"].setText(sprintf("%s", "XX")); @@ -93,7 +93,7 @@ var canvas_lowerECAMPageBleed = } if (dmc.DMController.DMCs[1].outputs[5] != nil) { - me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); me["TAT"].setColor(0.0509,0.7529,0.2941); } else { me["TAT"].setText(sprintf("%s", "XX")); diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-cond.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-cond.nas index 8a0ef52c..b0e7edaf 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-cond.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-cond.nas @@ -85,7 +85,7 @@ var canvas_lowerECAMPageCond = } if (dmc.DMController.DMCs[1].outputs[4] != nil) { - me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); me["SAT"].setColor(0.0509,0.7529,0.2941); } else { me["SAT"].setText(sprintf("%s", "XX")); @@ -93,7 +93,7 @@ var canvas_lowerECAMPageCond = } if (dmc.DMController.DMCs[1].outputs[5] != nil) { - me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); me["TAT"].setColor(0.0509,0.7529,0.2941); } else { me["TAT"].setText(sprintf("%s", "XX")); diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-cruise.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-cruise.nas new file mode 100644 index 00000000..b0aa10f2 --- /dev/null +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-cruise.nas @@ -0,0 +1,147 @@ +# A3XX Lower ECAM Canvas +# Copyright (c) 2021 Josh Davidson (Octal450) and Jonathan Redpath + +var canvas_lowerECAMPageCruise = +{ + new: func(svg,name) { + var obj = {parents: [canvas_lowerECAMPageCruise,canvas_lowerECAM_base] }; + obj.group = obj.canvas.createGroup(); + obj.name = name; + + canvas.parsesvg(obj.group, svg, {"font-mapper": obj.font_mapper} ); + + foreach(var key; obj.getKeys()) { + obj[key] = obj.group.getElementById(key); + }; + + foreach(var key; obj.getKeysBottom()) { + obj[key] = obj.group.getElementById(key); + }; + + obj.units = acconfig_weight_kgs.getValue(); + + # init + + obj.update_items = [ + ]; + + obj.displayedGForce = 0; + obj.updateItemsBottom = [ + props.UpdateManager.FromHashValue("acconfigUnits", nil, func(val) { + obj.units = val; + if (val) { + obj["GW-weight-unit"].setText("KG"); + } else { + obj["GW-weight-unit"].setText("LBS"); + } + }), + props.UpdateManager.FromHashValue("hour", nil, func(val) { + obj["UTCh"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("minute", nil, func(val) { + obj["UTCm"].setText(sprintf("%02d", val)); + }), + props.UpdateManager.FromHashValue("gForce", 0.05, func(val) { + if (obj.displayedGForce) { + obj["GLoad"].setText("G.LOAD " ~ sprintf("%3.1f", val)); + } + }), + props.UpdateManager.FromHashValue("gForceDisplay", nil, func(val) { + if ((val == 1 and !obj.displayedGForce) or (val != 0 and obj.displayedGForce)) { + obj.displayedGForce = 1; + obj["GLoad"].show(); + } else { + obj.displayedGForce = 0; + obj["GLoad"].hide(); + } + }), + ]; + return obj; + }, + getKeysBottom: func() { + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; + }, + getKeys: func() { + return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", + "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", + "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", + "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + updateBottom: func(notification) { + foreach(var update_item_bottom; me.updateItemsBottom) + { + update_item_bottom.update(notification); + } + + if (fmgc.FMGCInternal.fuelRequest and fmgc.FMGCInternal.blockConfirmed and !fmgc.FMGCInternal.fuelCalculating and notification.FWCPhase != 1) { + if (me.units) { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000 * LBS2KGS, 100))); + } else { + me["GW"].setText(sprintf("%s", math.round(fmgc.FMGCInternal.fuelPredGw * 1000, 100))); + } + me["GW"].setColor(0.0509,0.7529,0.2941); + } else { + me["GW"].setText(sprintf("%s", "-----")); + me["GW"].setColor(0.0901,0.6039,0.7176); + } + + if (dmc.DMController.DMCs[1].outputs[4] != nil) { + me["SAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["SAT"].setText(sprintf("%s", "XX")); + me["SAT"].setColor(0.7333,0.3803,0); + } + + if (dmc.DMController.DMCs[1].outputs[5] != nil) { + me["TAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setColor(0.0509,0.7529,0.2941); + } else { + me["TAT"].setText(sprintf("%s", "XX")); + me["TAT"].setColor(0.7333,0.3803,0); + } + }, + update: func(notification) { + me.updatePower(); + + if (me.test.getVisible() == 1) { + me.updateTest(notification); + } + + if (me.group.getVisible() == 0) { + return; + } + + foreach(var update_item; me.update_items) + { + update_item.update(notification); + } + + me.updateBottom(notification); + }, + updatePower: func() { + if (me.name == ecam.SystemDisplayController.displayedPage.name) { + if (du4_lgt.getValue() > 0.01 and systems.ELEC.Bus.ac2.getValue() >= 110) { + if (du4_test_time.getValue() + du4_test_amount.getValue() >= pts.Sim.Time.elapsedSec.getValue()) { + me.group.setVisible(0); + me.test.setVisible(1); + } else { + me.group.setVisible(1); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + } else { + me.group.setVisible(0); + me.test.setVisible(0); + } + }, +}; + +var input = { +}; + +foreach (var name; keys(input)) { + emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 System Display", name, input[name])); +} \ No newline at end of file diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-door.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-door.nas index 33407b06..f01f9f09 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-door.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-door.nas @@ -85,7 +85,7 @@ var canvas_lowerECAMPageDoor = } if (dmc.DMController.DMCs[1].outputs[4] != nil) { - me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); me["SAT"].setColor(0.0509,0.7529,0.2941); } else { me["SAT"].setText(sprintf("%s", "XX")); @@ -93,7 +93,7 @@ var canvas_lowerECAMPageDoor = } if (dmc.DMController.DMCs[1].outputs[5] != nil) { - me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); me["TAT"].setColor(0.0509,0.7529,0.2941); } else { me["TAT"].setText(sprintf("%s", "XX")); diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas index 0ef42285..c33f4446 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas @@ -85,7 +85,7 @@ var canvas_lowerECAMPageElec = } if (dmc.DMController.DMCs[1].outputs[4] != nil) { - me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); me["SAT"].setColor(0.0509,0.7529,0.2941); } else { me["SAT"].setText(sprintf("%s", "XX")); @@ -93,7 +93,7 @@ var canvas_lowerECAMPageElec = } if (dmc.DMController.DMCs[1].outputs[5] != nil) { - me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); me["TAT"].setColor(0.0509,0.7529,0.2941); } else { me["TAT"].setText(sprintf("%s", "XX")); diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-eng.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-eng.nas index 17d66c1c..85a783d3 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-eng.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-eng.nas @@ -85,7 +85,7 @@ var canvas_lowerECAMPageEng = } if (dmc.DMController.DMCs[1].outputs[4] != nil) { - me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); me["SAT"].setColor(0.0509,0.7529,0.2941); } else { me["SAT"].setText(sprintf("%s", "XX")); @@ -93,7 +93,7 @@ var canvas_lowerECAMPageEng = } if (dmc.DMController.DMCs[1].outputs[5] != nil) { - me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); me["TAT"].setColor(0.0509,0.7529,0.2941); } else { me["TAT"].setText(sprintf("%s", "XX")); diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-fctl.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-fctl.nas index 7daf17d5..c005d270 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-fctl.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-fctl.nas @@ -85,7 +85,7 @@ var canvas_lowerECAMPageFctl = } if (dmc.DMController.DMCs[1].outputs[4] != nil) { - me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); me["SAT"].setColor(0.0509,0.7529,0.2941); } else { me["SAT"].setText(sprintf("%s", "XX")); @@ -93,7 +93,7 @@ var canvas_lowerECAMPageFctl = } if (dmc.DMController.DMCs[1].outputs[5] != nil) { - me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); me["TAT"].setColor(0.0509,0.7529,0.2941); } else { me["TAT"].setText(sprintf("%s", "XX")); diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-fuel.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-fuel.nas index a0028d58..ff97a04b 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-fuel.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-fuel.nas @@ -85,7 +85,7 @@ var canvas_lowerECAMPageFuel = } if (dmc.DMController.DMCs[1].outputs[4] != nil) { - me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); me["SAT"].setColor(0.0509,0.7529,0.2941); } else { me["SAT"].setText(sprintf("%s", "XX")); @@ -93,7 +93,7 @@ var canvas_lowerECAMPageFuel = } if (dmc.DMController.DMCs[1].outputs[5] != nil) { - me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); me["TAT"].setColor(0.0509,0.7529,0.2941); } else { me["TAT"].setText(sprintf("%s", "XX")); diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas index d19c0dce..9c2ad593 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas @@ -85,7 +85,7 @@ var canvas_lowerECAMPageHyd = } if (dmc.DMController.DMCs[1].outputs[4] != nil) { - me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); me["SAT"].setColor(0.0509,0.7529,0.2941); } else { me["SAT"].setText(sprintf("%s", "XX")); @@ -93,7 +93,7 @@ var canvas_lowerECAMPageHyd = } if (dmc.DMController.DMCs[1].outputs[5] != nil) { - me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); me["TAT"].setColor(0.0509,0.7529,0.2941); } else { me["TAT"].setText(sprintf("%s", "XX")); diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-press.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-press.nas index e998aab7..e9f692b5 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-press.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-press.nas @@ -85,7 +85,7 @@ var canvas_lowerECAMPagePress = } if (dmc.DMController.DMCs[1].outputs[4] != nil) { - me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); me["SAT"].setColor(0.0509,0.7529,0.2941); } else { me["SAT"].setText(sprintf("%s", "XX")); @@ -93,7 +93,7 @@ var canvas_lowerECAMPagePress = } if (dmc.DMController.DMCs[1].outputs[5] != nil) { - me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); me["TAT"].setColor(0.0509,0.7529,0.2941); } else { me["TAT"].setText(sprintf("%s", "XX")); diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-sts.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-sts.nas index 87a0f883..7ca3bbff 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-sts.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-sts.nas @@ -85,7 +85,7 @@ var canvas_lowerECAMPageSts = } if (dmc.DMController.DMCs[1].outputs[4] != nil) { - me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); me["SAT"].setColor(0.0509,0.7529,0.2941); } else { me["SAT"].setText(sprintf("%s", "XX")); @@ -93,7 +93,7 @@ var canvas_lowerECAMPageSts = } if (dmc.DMController.DMCs[1].outputs[5] != nil) { - me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); me["TAT"].setColor(0.0509,0.7529,0.2941); } else { me["TAT"].setText(sprintf("%s", "XX")); diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas index 50fc1d03..7cfe1a88 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas @@ -85,7 +85,7 @@ var canvas_lowerECAMPageWheel = } if (dmc.DMController.DMCs[1].outputs[4] != nil) { - me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); + me["SAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[4].getValue())); me["SAT"].setColor(0.0509,0.7529,0.2941); } else { me["SAT"].setText(sprintf("%s", "XX")); @@ -93,7 +93,7 @@ var canvas_lowerECAMPageWheel = } if (dmc.DMController.DMCs[1].outputs[5] != nil) { - me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); + me["TAT"].setText(sprintf("%+2.0f", dmc.DMController.DMCs[1].outputs[5].getValue())); me["TAT"].setColor(0.0509,0.7529,0.2941); } else { me["TAT"].setText(sprintf("%s", "XX")); diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index 819f043b..1a1aef57 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -39,6 +39,7 @@ var SystemDisplayPageRecipient = apu: canvas_lowerECAMPageApu.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/apu.svg","apu"), bleed: canvas_lowerECAMPageBleed.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/bleed.svg","bleed"), cond: canvas_lowerECAMPageCond.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/cond.svg","cond"), + cruise: canvas_lowerECAMPageCruise.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/crz.svg","cruise"), door: canvas_lowerECAMPageDoor.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/door.svg","door"), elec: canvas_lowerECAMPageElec.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/elec.svg","elec"), eng: canvas_lowerECAMPageEng.new("Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/eng.svg","eng"), From 4073c0ca799ac8b816e18b2e2d083f1f1ead2c08 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 8 Jul 2021 16:27:43 +0100 Subject: [PATCH 73/96] Pressure page: make features work --- .../Instruments/Lower-ECAM/Lower-ECAM-old.nas | 6 +- .../Lower-ECAM/Lower-ECAM-press.nas | 90 ++++++++++++++++++- Models/Instruments/Lower-ECAM/Lower-ECAM.nas | 1 + Models/Instruments/Lower-ECAM/res/press.svg | 75 ++++------------ 4 files changed, 109 insertions(+), 63 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas index 38a590c0..fc90f10a 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas @@ -169,8 +169,8 @@ var gear_door_L = props.globals.getNode("/systems/hydraulic/gear/door-left", 1); var gear_door_R = props.globals.getNode("/systems/hydraulic/gear/door-right", 1); var gear_door_N = props.globals.getNode("/systems/hydraulic/gear/door-nose", 1); var gear_down = props.globals.getNode("/controls/gear/gear-down", 1); -var press_vs_norm = props.globals.getNode("/systems/pressurization/vs-norm", 1); -var cabinalt = props.globals.getNode("/systems/pressurization/cabinalt-norm", 1); +var press_vs_norm = props.globals.getNode("", 1); +var cabinalt = props.globals.getNode("", 1); var gear0_wow = props.globals.getNode("/gear/gear[0]/wow", 1); # Create Nodes: @@ -2474,7 +2474,7 @@ var canvas_lowerECAM_press = { return m; }, getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit", "PRESS-Cab-VS", "PRESS-Cab-VS-neg", "PRESS-Cab-Alt"]; + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; }, update: func() { me["PRESS-Cab-VS"].setText(sprintf("%4.0f", press_vs_norm.getValue())); diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-press.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-press.nas index e9f692b5..d89bbfe2 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-press.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-press.nas @@ -21,8 +21,83 @@ var canvas_lowerECAMPagePress = obj.units = acconfig_weight_kgs.getValue(); # init + obj["PRESS-Sys-2"].hide(); + obj["PRESS-Outlet-Transit-Failed"].hide(); + obj["PRESS-Inlet-Transit-Failed"].hide(); obj.update_items = [ + props.UpdateManager.FromHashValue("pressDelta", 0.05, func(val) { + if (val > 31.9) { + obj["PRESS-deltaP"].setText(sprintf("%2.1f", 31.9)); + } else if (val < -9.9) { + obj["PRESS-deltaP"].setText(sprintf("%2.1f", -9.9)); + } else { + obj["PRESS-deltaP"].setText(sprintf("%2.1f", val)); + } + + if (val < -0.4 or val > 8.5) { + obj["PRESS-deltaP"].setColor(0.7333,0.3803,0); + } else { + obj["PRESS-deltaP"].setColor(0.0509,0.7529,0.2941); + } + }), + props.UpdateManager.FromHashValue("pressVS", 25, func(val) { + if (val > 9950) { + obj["PRESS-Cab-VS"].setText(sprintf("%4.0f", 9950)); + } else if (val < -9950) { + obj["PRESS-Cab-VS"].setText(sprintf("%4.0f", -9950)); + } else { + obj["PRESS-Cab-VS"].setText(sprintf("%-4.0f", math.round(val,50))); + } + + if (abs(val) > 2000) { + obj["PRESS-Cab-VS"].setColor(0.7333,0.3803,0); + } else { + obj["PRESS-Cab-VS"].setColor(0.0509,0.7529,0.2941); + } + }), + props.UpdateManager.FromHashValue("pressAlt", 25, func(val) { + if (val > 32750) { + obj["PRESS-Cab-Alt"].setText(sprintf("%5.0f", 32750)); + } else if (val < -9950) { + obj["PRESS-Cab-Alt"].setText(sprintf("%5.0f", -9950)); + } else { + obj["PRESS-Cab-Alt"].setText(sprintf("%5.0f", math.round(val,50))); + } + + if (val > 9550) { + obj["PRESS-Cab-Alt"].setColor(1,0,0); + } else { + obj["PRESS-Cab-Alt"].setColor(0.0509,0.7529,0.2941); + } + }), + props.UpdateManager.FromHashValue("pressAuto", nil, func(val) { + if (val) { + obj["PRESS-Man"].hide(); + obj["PRESS-Sys-1"].show(); + } else { + obj["PRESS-Man"].show(); + obj["PRESS-Sys-1"].hide(); + } + }), + props.UpdateManager.FromHashValue("flowCtlValve1", 0.1, func(val) { + if (val == 0) { + obj["PRESS-Pack-1-Triangle"].setColor(0.7333,0.3803,0); + obj["PRESS-Pack-1"].setColor(0.7333,0.3803,0); + } else { + obj["PRESS-Pack-1-Triangle"].setColor(0.0509,0.7529,0.2941); + obj["PRESS-Pack-1"].setColor(0.8078,0.8039,0.8078); + } + }), + props.UpdateManager.FromHashValue("flowCtlValve2", 0.1, func(val) { + if (val == 0) { + obj["PRESS-Pack-2-Triangle"].setColor(0.7333,0.3803,0); + obj["PRESS-Pack-2"].setColor(0.7333,0.3803,0); + } else { + obj["PRESS-Pack-2-Triangle"].setColor(0.0509,0.7529,0.2941); + obj["PRESS-Pack-2"].setColor(0.8078,0.8039,0.8078); + } + }), ]; obj.displayedGForce = 0; @@ -62,10 +137,10 @@ var canvas_lowerECAMPagePress = return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; }, getKeys: func() { - return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", - "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", - "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", - "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + return["PRESS-Cab-VS", "PRESS-Cab-VS-neg", "PRESS-Cab-Alt", "PRESS-deltaP", "PRESS-LDG-Elev", "PRESS-deltaP-needle", "PRESS-VS-needle", "PRESS-Alt-needle", + "PRESS-Man", "PRESS-Sys-1", "PRESS-Sys-2", "PRESS-Outlet-Transit-Failed", "PRESS-Inlet-Transit-Failed", "PRESS-LDG-Elev-mode","PRESS-Pack-1-Triangle","PRESS-Pack-2-Triangle", + "PRESS-Pack-1","PRESS-Pack-2"]; + }, updateBottom: func(notification) { foreach(var update_item_bottom; me.updateItemsBottom) { @@ -140,6 +215,13 @@ var canvas_lowerECAMPagePress = }; var input = { + pressAlt: "/systems/pressurization/cabinalt-norm", + pressAuto: "/systems/pressurization/auto", + pressDelta: "/systems/pressurization/deltap-norm", + pressVS: "/systems/pressurization/vs-norm", + + flowCtlValve1: "/systems/air-conditioning/valves/flow-control-valve-1", + flowCtlValve2: "/systems/air-conditioning/valves/flow-control-valve-2", }; foreach (var name; keys(input)) { diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index 1a1aef57..625f3283 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -19,6 +19,7 @@ var SystemDisplayPageRecipient = SystemDisplayPageRecipient.pageList.apu.update(notification); SystemDisplayPageRecipient.pageList.bleed.update(notification); SystemDisplayPageRecipient.pageList.cond.update(notification); + SystemDisplayPageRecipient.pageList.cruise.update(notification); SystemDisplayPageRecipient.pageList.door.update(notification); SystemDisplayPageRecipient.pageList.elec.update(notification); SystemDisplayPageRecipient.pageList.eng.update(notification); diff --git a/Models/Instruments/Lower-ECAM/res/press.svg b/Models/Instruments/Lower-ECAM/res/press.svg index e2329db1..92a6e964 100644 --- a/Models/Instruments/Lower-ECAM/res/press.svg +++ b/Models/Instruments/Lower-ECAM/res/press.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="press.svg"> @@ -41,9 +41,9 @@ inkscape:window-height="705" id="namedview371" showgrid="true" - inkscape:zoom="0.88" - inkscape:cx="397.64824" - inkscape:cy="880.3857" + inkscape:zoom="0.64" + inkscape:cx="770.48025" + inkscape:cy="620.45739" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" @@ -467,7 +467,7 @@ style="font-size:32.18700027px;line-height:0">SYS2 MAN + style="font-size:32.18700027px;line-height:0;fill:#0dc04b;fill-opacity:1;">MAN PACK 1 + style="font-size:34.92427444px;line-height:1.25;fill:#cecdce;fill-opacity:1;stroke-width:0.87310684;">PACK 1 PACK 2 + style="font-size:34.92399979px;line-height:1.25;fill:#cecdce;fill-opacity:1;">PACK 2 + id="PRESS-Pack-1-Triangle" + inkscape:connector-curvature="0" + inkscape:label="#path5062" /> + id="PRESS-Pack-2-Triangle" + inkscape:connector-curvature="0" + inkscape:label="#path5062-3" /> - - 0 - . - 1 00 - Date: Thu, 8 Jul 2021 17:19:27 +0100 Subject: [PATCH 74/96] COND / PRESS pages completed; fix bug in system display controller --- .../Instruments/Lower-ECAM/Lower-ECAM-APU.nas | 2 +- .../Lower-ECAM/Lower-ECAM-bleed.nas | 2 +- .../Lower-ECAM/Lower-ECAM-cond.nas | 72 +++++++++++++-- .../Lower-ECAM/Lower-ECAM-cruise.nas | 2 +- .../Lower-ECAM/Lower-ECAM-door.nas | 2 +- .../Lower-ECAM/Lower-ECAM-elec.nas | 2 +- .../Instruments/Lower-ECAM/Lower-ECAM-eng.nas | 2 +- .../Lower-ECAM/Lower-ECAM-fctl.nas | 2 +- .../Lower-ECAM/Lower-ECAM-fuel.nas | 2 +- .../Instruments/Lower-ECAM/Lower-ECAM-hyd.nas | 2 +- .../Instruments/Lower-ECAM/Lower-ECAM-old.nas | 89 ------------------- .../Lower-ECAM/Lower-ECAM-press.nas | 6 +- .../Instruments/Lower-ECAM/Lower-ECAM-sts.nas | 2 +- .../Lower-ECAM/Lower-ECAM-wheel.nas | 2 +- Models/Instruments/Lower-ECAM/Lower-ECAM.nas | 5 ++ Models/Instruments/Lower-ECAM/res/cond.svg | 13 +-- Nasal/ECAM/SystemDisplay.nas | 1 + 17 files changed, 94 insertions(+), 114 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas index 6f07e897..b45a809b 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas @@ -282,7 +282,7 @@ var canvas_lowerECAMPageApu = } } else { me.group.setVisible(0); - me.test.setVisible(0); + # don't hide the test group; just let whichever page is active control it } }, }; diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-bleed.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-bleed.nas index 2ce9816b..61f8a7f1 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-bleed.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-bleed.nas @@ -134,7 +134,7 @@ var canvas_lowerECAMPageBleed = } } else { me.group.setVisible(0); - me.test.setVisible(0); + # don't hide the test group; just let whichever page is active control it } }, }; diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-cond.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-cond.nas index b0e7edaf..74b0732a 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-cond.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-cond.nas @@ -21,8 +21,59 @@ var canvas_lowerECAMPageCond = obj.units = acconfig_weight_kgs.getValue(); # init + obj["CONDFanFwdFault"].hide(); + obj["CONDFanAftFault"].hide(); + + # aft cargo ventilation disabled + obj["CargoCond"].hide(); obj.update_items = [ + props.UpdateManager.FromHashValue("condDuctTempCockpit", 0.5, func(val) { + obj["CONDDuctTempCKPT"].setText(sprintf("%2.0f",val)); + }), + props.UpdateManager.FromHashValue("condDuctTempAft", 0.5, func(val) { + obj["CONDDuctTempAFT"].setText(sprintf("%2.0f",val)); + }), + props.UpdateManager.FromHashValue("condDuctTempFwd", 0.5, func(val) { + obj["CONDDuctTempFWD"].setText(sprintf("%2.0f",val)); + }), + props.UpdateManager.FromHashValue("condTempCockpit", 0.5, func(val) { + obj["CONDTempCKPT"].setText(sprintf("%2.0f",val)); + }), + props.UpdateManager.FromHashValue("condTempAft", 0.5, func(val) { + obj["CONDTempAFT"].setText(sprintf("%2.0f",val)); + }), + props.UpdateManager.FromHashValue("condTempFwd", 0.5, func(val) { + obj["CONDTempFWD"].setText(sprintf("%2.0f",val)); + }), + props.UpdateManager.FromHashValue("condTrimCockpit", 0.01, func(val) { + obj["CONDTrimValveCKPT"].setRotation(val * D2R); + }), + props.UpdateManager.FromHashValue("condTrimAft", 0.01, func(val) { + obj["CONDTrimValveAFT"].setRotation(val * D2R); + }), + props.UpdateManager.FromHashValue("condTrimFwd", 0.01, func(val) { + obj["CONDTrimValveFWD"].setRotation(val * D2R); + }), + props.UpdateManager.FromHashList(["condHotAirSwitch","condHotAirValve","condHotAirCmd"], nil, func(val) { + if (!val.condHotAirSwitch or (val.condHotAirCmd == 1 and val.condHotAirValve == 0)) { + obj["CONDHotAirValve"].setRotation(90 * D2R); + obj["CONDHotAirValve"].setColor(0.7333,0.3803,0); + obj["CONDHotAirValveCross"].setColorFill(0.7333,0.3803,0); + } elsif (val.condHotAirCmd == 0 and val.condHotAirValve == 0) { + obj["CONDHotAirValve"].setRotation(90 * D2R); + obj["CONDHotAirValve"].setColor(0.0509,0.7529,0.2941); + obj["CONDHotAirValveCross"].setColorFill(0.0509,0.7529,0.2941); + } elsif (val.condHotAirCmd == 0 and val.condHotAirValve != 0) { + obj["CONDHotAirValve"].setRotation(0); + obj["CONDHotAirValve"].setColor(0.7333,0.3803,0); + obj["CONDHotAirValveCross"].setColorFill(0.7333,0.3803,0); + } else { + obj["CONDHotAirValve"].setRotation(0); + obj["CONDHotAirValve"].setColor(0.0509,0.7529,0.2941); + obj["CONDHotAirValveCross"].setColorFill(0.0509,0.7529,0.2941); + } + }), ]; obj.displayedGForce = 0; @@ -62,10 +113,9 @@ var canvas_lowerECAMPageCond = return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; }, getKeys: func() { - return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", - "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", - "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", - "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + return["CargoCond","CONDHotAirValve","CONDFanFwdFault","CONDFanAftFault","CONDTrimValveCKPT","CONDTrimValveAFT","CONDTrimValveFWD","CONDDuctTempCKPT", + "CONDDuctTempAFT","CONDDuctTempFWD","CONDTempCKPT","CONDTempAFT","CONDTempFWD","CONDHotAirValveCross"]; + }, updateBottom: func(notification) { foreach(var update_item_bottom; me.updateItemsBottom) { @@ -134,12 +184,24 @@ var canvas_lowerECAMPageCond = } } else { me.group.setVisible(0); - me.test.setVisible(0); + # don't hide the test group; just let whichever page is active control it } }, }; var input = { + condDuctTempCockpit: "/systems/air-conditioning/temperatures/cockpit-duct", + condDuctTempAft: "/systems/air-conditioning/temperatures/cabin-aft-duct", + condDuctTempFwd: "/systems/air-conditioning/temperatures/cabin-fwd-duct", + condTempCockpit: "/systems/air-conditioning/temperatures/cockpit-temp", + condTempAft: "/systems/air-conditioning/temperatures/cabin-aft-temp", + condTempFwd: "/systems/air-conditioning/temperatures/cabin-fwd-temp", + condTrimCockpit: "/ECAM/Lower/trim-cockpit-output", + condTrimAft: "/ECAM/Lower/trim-aft-output", + condTrimFwd: "/ECAM/Lower/trim-fwd-output", + condHotAirCmd: "/systems/air-conditioning/valves/hot-air-cmd", + condHotAirSwitch: "/controls/pneumatics/switches/hot-air", + condHotAirValve: "/systems/air-conditioning/valves/hot-air" }; foreach (var name; keys(input)) { diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-cruise.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-cruise.nas index b0aa10f2..5548d196 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-cruise.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-cruise.nas @@ -134,7 +134,7 @@ var canvas_lowerECAMPageCruise = } } else { me.group.setVisible(0); - me.test.setVisible(0); + # don't hide the test group; just let whichever page is active control it } }, }; diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-door.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-door.nas index f01f9f09..acaa3f50 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-door.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-door.nas @@ -134,7 +134,7 @@ var canvas_lowerECAMPageDoor = } } else { me.group.setVisible(0); - me.test.setVisible(0); + # don't hide the test group; just let whichever page is active control it } }, }; diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas index c33f4446..c6f4a8b6 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas @@ -134,7 +134,7 @@ var canvas_lowerECAMPageElec = } } else { me.group.setVisible(0); - me.test.setVisible(0); + # don't hide the test group; just let whichever page is active control it } }, }; diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-eng.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-eng.nas index 85a783d3..76de7471 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-eng.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-eng.nas @@ -134,7 +134,7 @@ var canvas_lowerECAMPageEng = } } else { me.group.setVisible(0); - me.test.setVisible(0); + # don't hide the test group; just let whichever page is active control it } }, }; diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-fctl.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-fctl.nas index c005d270..e29125f1 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-fctl.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-fctl.nas @@ -134,7 +134,7 @@ var canvas_lowerECAMPageFctl = } } else { me.group.setVisible(0); - me.test.setVisible(0); + # don't hide the test group; just let whichever page is active control it } }, }; diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-fuel.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-fuel.nas index ff97a04b..ea3ca35b 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-fuel.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-fuel.nas @@ -134,7 +134,7 @@ var canvas_lowerECAMPageFuel = } } else { me.group.setVisible(0); - me.test.setVisible(0); + # don't hide the test group; just let whichever page is active control it } }, }; diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas index 9c2ad593..f9673996 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas @@ -134,7 +134,7 @@ var canvas_lowerECAMPageHyd = } } else { me.group.setVisible(0); - me.test.setVisible(0); + # don't hide the test group; just let whichever page is active control it } }, }; diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas index fc90f10a..b181dfbf 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas @@ -800,55 +800,6 @@ var canvas_lowerECAM_bleed = { }, }; -var canvas_lowerECAM_cond = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_cond, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","CargoCond","CONDHotAirValve","CONDFanFwdFault","CONDFanAftFault", - "CONDTrimValveCKPT","CONDTrimValveAFT","CONDTrimValveFWD","CONDDuctTempCKPT","CONDDuctTempAFT","CONDDuctTempFWD","CONDTempCKPT","CONDTempAFT","CONDTempFWD"]; - }, - update: func() { - if (systems.PNEU.Valves.hotAir.getValue() == 0) { - me["CONDHotAirValve"].setRotation(90 * D2R); - if (systems.PNEU.Switch.hotAir.getBoolValue()) { - me["CONDHotAirValve"].setColor(0.7333,0.3803,0); - } else { - me["CONDHotAirValve"].setColor(0.0509,0.7529,0.2941); - } - } else { - me["CONDHotAirValve"].setRotation(0); # doesn't show rotation in transit - if (systems.PNEU.Switch.hotAir.getBoolValue()) { - me["CONDHotAirValve"].setColor(0.0509,0.7529,0.2941); - } else { - me["CONDHotAirValve"].setColor(0.7333,0.3803,0); - } - } - - me["CONDTrimValveCKPT"].setRotation(systems.PNEU.Packs.trimCockpit.getValue() * D2R); - me["CONDTrimValveAFT"].setRotation(systems.PNEU.Packs.trimAft.getValue() * D2R); - me["CONDTrimValveFWD"].setRotation(systems.PNEU.Packs.trimFwd.getValue() * D2R); - - me["CONDDuctTempCKPT"].setText(sprintf("%2.0f",math.round(systems.PNEU.Packs.cockpitDuctTemp.getValue()))); - me["CONDDuctTempAFT"].setText(sprintf("%2.0f",math.round(systems.PNEU.Packs.cabinAftDuctTemp.getValue()))); - me["CONDDuctTempFWD"].setText(sprintf("%2.0f",math.round(systems.PNEU.Packs.cabinFwdDuctTemp.getValue()))); - - me["CONDTempCKPT"].setText(sprintf("%2.0f",math.round(systems.PNEU.Packs.cockpitTemp.getValue()))); - me["CONDTempAFT"].setText(sprintf("%2.0f",math.round(systems.PNEU.Packs.cabinAftTemp.getValue()))); - me["CONDTempFWD"].setText(sprintf("%2.0f",math.round(systems.PNEU.Packs.cabinFwdTemp.getValue()))); - - # fans faults not implemented - me["CONDFanFwdFault"].hide(); - me["CONDFanAftFault"].hide(); - - # aft cargo ventilation disabled - me["CargoCond"].hide(); - me.updateBottomStatus(); - }, -}; var canvas_lowerECAM_crz = { new: func(canvas_group, file) { @@ -2466,41 +2417,6 @@ var canvas_lowerECAM_fuel = { }, }; -var canvas_lowerECAM_press = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_press, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; - }, - update: func() { - me["PRESS-Cab-VS"].setText(sprintf("%4.0f", press_vs_norm.getValue())); - me["PRESS-Cab-Alt"].setText(sprintf("%4.0f", cabinalt.getValue())); - - - me.updateBottomStatus(); - }, -}; - -var canvas_lowerECAM_status = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_status, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; - }, - update: func() { - - me.updateBottomStatus(); - }, -}; - var canvas_lowerECAM_hyd = { new: func(canvas_group, file) { var m = {parents: [canvas_lowerECAM_hyd, canvas_lowerECAM_base]}; @@ -3401,11 +3317,6 @@ var lowerECAM_update = maketimer(0.05, func { canvas_lowerECAM_base.update(); }); -var showLowerECAM = func { - var dlg = canvas.Window.new([512, 512], "dialog").set("resize", 1); - dlg.setCanvas(lowerECAM_display); -} - setlistener("/systems/electrical/bus/ac-2", func() { canvas_lowerECAM_base.updateDu4(); }, 0, 0); diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-press.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-press.nas index d89bbfe2..5dceb154 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-press.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-press.nas @@ -80,7 +80,7 @@ var canvas_lowerECAMPagePress = obj["PRESS-Sys-1"].hide(); } }), - props.UpdateManager.FromHashValue("flowCtlValve1", 0.1, func(val) { + props.UpdateManager.FromHashValue("flowCtlValve1", nil, func(val) { if (val == 0) { obj["PRESS-Pack-1-Triangle"].setColor(0.7333,0.3803,0); obj["PRESS-Pack-1"].setColor(0.7333,0.3803,0); @@ -89,7 +89,7 @@ var canvas_lowerECAMPagePress = obj["PRESS-Pack-1"].setColor(0.8078,0.8039,0.8078); } }), - props.UpdateManager.FromHashValue("flowCtlValve2", 0.1, func(val) { + props.UpdateManager.FromHashValue("flowCtlValve2", nil, func(val) { if (val == 0) { obj["PRESS-Pack-2-Triangle"].setColor(0.7333,0.3803,0); obj["PRESS-Pack-2"].setColor(0.7333,0.3803,0); @@ -209,7 +209,7 @@ var canvas_lowerECAMPagePress = } } else { me.group.setVisible(0); - me.test.setVisible(0); + # don't hide the test group; just let whichever page is active control it } }, }; diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-sts.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-sts.nas index 7ca3bbff..009176d4 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-sts.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-sts.nas @@ -134,7 +134,7 @@ var canvas_lowerECAMPageSts = } } else { me.group.setVisible(0); - me.test.setVisible(0); + # don't hide the test group; just let whichever page is active control it } }, }; diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas index 7cfe1a88..87332924 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas @@ -134,7 +134,7 @@ var canvas_lowerECAMPageWheel = } } else { me.group.setVisible(0); - me.test.setVisible(0); + # don't hide the test group; just let whichever page is active control it } }, }; diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index 625f3283..02c0bc3f 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -67,6 +67,11 @@ foreach (var name; keys(input)) { emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 System Display", name, input[name])); } +var showLowerECAM = func { + var dlg = canvas.Window.new([512, 512], "dialog").set("resize", 1); + dlg.setCanvas(canvas_lowerECAM_base.canvas); +} + setlistener("/systems/electrical/bus/ac-2", func() { A320SD.MainScreen.powerTransient(); }, 0, 0); \ No newline at end of file diff --git a/Models/Instruments/Lower-ECAM/res/cond.svg b/Models/Instruments/Lower-ECAM/res/cond.svg index c8319978..20918f92 100644 --- a/Models/Instruments/Lower-ECAM/res/cond.svg +++ b/Models/Instruments/Lower-ECAM/res/cond.svg @@ -41,9 +41,9 @@ inkscape:window-height="705" id="namedview371" showgrid="false" - inkscape:zoom="163.84" - inkscape:cx="931.44175" - inkscape:cy="894.81836" + inkscape:zoom="0.64" + inkscape:cx="695.07573" + inkscape:cy="944.3933" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" @@ -116,8 +116,9 @@ x="817.61298" height="5.1203089" width="53.195583" - id="rect5105-2" - style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + id="CONDHotAirValveCross" + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:label="#rect5105-2" /> 00 - Date: Thu, 8 Jul 2021 17:29:04 +0100 Subject: [PATCH 75/96] PRESS: pack indicator dependso n engines running --- Models/Instruments/Lower-ECAM/Lower-ECAM-press.nas | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-press.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-press.nas index 5dceb154..89d8f3ff 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-press.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-press.nas @@ -80,8 +80,8 @@ var canvas_lowerECAMPagePress = obj["PRESS-Sys-1"].hide(); } }), - props.UpdateManager.FromHashValue("flowCtlValve1", nil, func(val) { - if (val == 0) { + props.UpdateManager.FromHashList(["flowCtlValve1","engine1State"], nil, func(val) { + if (val.flowCtlValve1 == 0 and val.engine1State == 3) { obj["PRESS-Pack-1-Triangle"].setColor(0.7333,0.3803,0); obj["PRESS-Pack-1"].setColor(0.7333,0.3803,0); } else { @@ -89,8 +89,8 @@ var canvas_lowerECAMPagePress = obj["PRESS-Pack-1"].setColor(0.8078,0.8039,0.8078); } }), - props.UpdateManager.FromHashValue("flowCtlValve2", nil, func(val) { - if (val == 0) { + props.UpdateManager.FromHashList(["flowCtlValve2","engine2State"], nil, func(val) { + if (val.flowCtlValve2 == 0 and val.engine2State == 3) { obj["PRESS-Pack-2-Triangle"].setColor(0.7333,0.3803,0); obj["PRESS-Pack-2"].setColor(0.7333,0.3803,0); } else { From 8f1f93b14278f4ff93580e98dcb61b117690ffd9 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 10 Jul 2021 22:33:33 +0100 Subject: [PATCH 76/96] ENG page --- .../Instruments/Lower-ECAM/Lower-ECAM-eng.nas | 119 ++++++++++- .../Instruments/Lower-ECAM/Lower-ECAM-old.nas | 46 +--- Models/Instruments/Lower-ECAM/res/eng.svg | 196 ++++++++++++++---- Nasal/Libraries/property-tree-setup.nas | 1 + 4 files changed, 276 insertions(+), 86 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-eng.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-eng.nas index 76de7471..c00d7e5e 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-eng.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-eng.nas @@ -1,6 +1,11 @@ # A3XX Lower ECAM Canvas # Copyright (c) 2021 Josh Davidson (Octal450) and Jonathan Redpath +var fuel_used_lbs1 = props.globals.getNode("/systems/fuel/fuel-used-1", 1); +var fuel_used_lbs2 = props.globals.getNode("/systems/fuel/fuel-used-2", 1); + +var QT2LTR = 0.946353; + var canvas_lowerECAMPageEng = { new: func(svg,name) { @@ -21,8 +26,108 @@ var canvas_lowerECAMPageEng = obj.units = acconfig_weight_kgs.getValue(); # init + obj["FUEL-clog-1"].hide(); + obj["FUEL-clog-2"].hide(); + obj["OIL-clog-1"].hide(); + obj["OIL-clog-2"].hide(); + + obj.quantity = [nil, nil]; obj.update_items = [ + props.UpdateManager.FromHashValue("engOilQt1", 0.005, func(val) { + if (obj.units) { + obj.quantity[0] = sprintf("%2.1f",(0.1 * math.round(val * QT2LTR * 10,5))); + obj["OilQT1"].setText(sprintf("%s", left(obj.quantity[0], (size(obj.quantity[0]) == 4 ? 2 : 1)))); + obj["OilQT1-decimal"].setText(sprintf("%s", right(obj.quantity[0],1))); + obj["OilQT1-needle"].setRotation(((val * QT2LTR) + 90) * D2R); + } else { + obj.quantity[0] = sprintf("%2.1f",(0.1 * math.round(val * 10,5))); + obj["OilQT1"].setText(sprintf("%s", left(obj.quantity[0], (size(obj.quantity[0]) == 4 ? 2 : 1)))); + obj["OilQT1-decimal"].setText(sprintf("%s", right(obj.quantity[0],1))); + obj["OilQT1-needle"].setRotation((val + 90) * D2R); + } + }), + props.UpdateManager.FromHashValue("engOilQt2", 0.005, func(val) { + if (obj.units) { + obj.quantity[1] = sprintf("%2.1f",(0.1 * math.round(val * QT2LTR * 10,5))); + obj["OilQT2"].setText(sprintf("%s", left(obj.quantity[1], (size(obj.quantity[1]) == 4 ? 2 : 1)))); + obj["OilQT2-decimal"].setText(sprintf("%s", right(obj.quantity[1],1))); + obj["OilQT2-needle"].setRotation(((val * QT2LTR) + 90) * D2R); + } else { + obj.quantity[1] = sprintf("%2.1f",(0.1 * math.round(val * 10,5))); + obj["OilQT2"].setText(sprintf("%s", left(obj.quantity[1], (size(obj.quantity[1]) == 4 ? 2 : 1)))); + obj["OilQT2-decimal"].setText(sprintf("%s", right(obj.quantity[1],1))); + obj["OilQT2-needle"].setRotation((val + 90) * D2R); + } + }), + props.UpdateManager.FromHashValue("engOilPsi1", 0.25, func(val) { + if (val >= 13) { + obj["OilPSI1"].setColor(0.0509,0.7529,0.2941); + obj["OilPSI1-needle"].setColor(0.0509,0.7529,0.2941); + } else { + obj["OilPSI1"].setColor(1,0,0); + obj["OilPSI1-needle"].setColor(1,0,0); + } + + obj["OilPSI1"].setText(sprintf("%s", math.round(val))); + obj["OilPSI1-needle"].setRotation((val + 90) * D2R); + }), + props.UpdateManager.FromHashValue("engOilPsi2", 0.25, func(val) { + if (val >= 13) { + obj["OilPSI2"].setColor(0.0509,0.7529,0.2941); + obj["OilPSI2-needle"].setColor(0.0509,0.7529,0.2941); + } else { + obj["OilPSI2"].setColor(1,0,0); + obj["OilPSI2-needle"].setColor(1,0,0); + } + + obj["OilPSI2"].setText(sprintf("%s", math.round(val))); + obj["OilPSI2-needle"].setRotation((val + 90) * D2R); + }), + props.UpdateManager.FromHashValue("acconfigUnits", nil, func(val) { + if (val) { + obj["Fused-weight-unit"].setText("KG"); + obj["Fused-oil-unit"].setText("LTR"); + # immediately update parameters + obj.quantity[0] = sprintf("%2.1f",(0.1 * math.round(pts.Engines.Engine.oilQt[0].getValue() * QT2LTR * 10,5))); + obj["OilQT1"].setText(sprintf("%s", left(obj.quantity[0], (size(obj.quantity[0]) == 4 ? 2 : 1)))); + obj["OilQT1-decimal"].setText(sprintf("%s", right(obj.quantity[0],1))); + obj["OilQT1-needle"].setRotation(((pts.Engines.Engine.oilQt[0].getValue() * QT2LTR) + 90) * D2R); + obj.quantity[1] = sprintf("%2.1f",(0.1 * math.round(pts.Engines.Engine.oilQt[1].getValue() * QT2LTR * 10,5))); + obj["OilQT2"].setText(sprintf("%s", left(obj.quantity[1], (size(obj.quantity[1]) == 4 ? 2 : 1)))); + obj["OilQT2-decimal"].setText(sprintf("%s", right(obj.quantity[1],1))); + obj["OilQT2-needle"].setRotation(((pts.Engines.Engine.oilQt[1].getValue() * QT2LTR) + 90) * D2R); + obj["FUEL-used-1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue() * LBS2KGS, 10))); + obj["FUEL-used-2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue() * LBS2KGS, 10))); + } else { + obj["Fused-weight-unit"].setText("LBS"); + obj["Fused-oil-unit"].setText("QT"); + obj.quantity[0] = sprintf("%2.1f",(0.1 * math.round(pts.Engines.Engine.oilQt[0].getValue() * 10,5))); + obj["OilQT1"].setText(sprintf("%s", left(obj.quantity[0], (size(obj.quantity[0]) == 4 ? 2 : 1)))); + obj["OilQT1-decimal"].setText(sprintf("%s", right(obj.quantity[0],1))); + obj["OilQT1-needle"].setRotation((pts.Engines.Engine.oilQt[0].getValue() + 90) * D2R); + obj.quantity[1] = sprintf("%2.1f",(0.1 * math.round(pts.Engines.Engine.oilQt[1].getValue() * 10,5))); + obj["OilQT2"].setText(sprintf("%s", left(obj.quantity[1], (size(obj.quantity[1]) == 4 ? 2 : 1)))); + obj["OilQT2-decimal"].setText(sprintf("%s", right(obj.quantity[1],1))); + obj["OilQT2-needle"].setRotation((pts.Engines.Engine.oilQt[1].getValue() + 90) * D2R); + obj["FUEL-used-1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue(), 10))); + obj["FUEL-used-2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue(), 10))); + } + }), + props.UpdateManager.FromHashValue("engFuelUsed1", 1, func(val) { + if (obj.units) { + obj["FUEL-used-1"].setText(sprintf("%s", math.round(val * LBS2KGS, 10))); + } else { + obj["FUEL-used-1"].setText(sprintf("%s", math.round(val, 10))); + } + }), + props.UpdateManager.FromHashValue("engFuelUsed2", 1, func(val) { + if (obj.units) { + obj["FUEL-used-2"].setText(sprintf("%s", math.round(val * LBS2KGS, 10))); + } else { + obj["FUEL-used-2"].setText(sprintf("%s", math.round(val, 10))); + } + }), ]; obj.displayedGForce = 0; @@ -62,10 +167,10 @@ var canvas_lowerECAMPageEng = return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; }, getKeys: func() { - return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", - "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", - "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", - "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + return["OilQT1-needle","OilQT2-needle","OilQT1","OilQT2","OilQT1-decimal","OilQT2-decimal","OilPSI1-needle","OilPSI2-needle","OilPSI1","OilPSI2", + "FUEL-used-1","FUEL-used-2", "Fused-weight-unit","Fused-oil-unit","FUEL-clog-1","FUEL-clog-2","OIL-clog-1","OIL-clog-2","OilTemp1","OilTemp2", + "VIB-N1-1","VIB-N1-2","VIB-N2-1","VIB-N2-2"]; + }, updateBottom: func(notification) { foreach(var update_item_bottom; me.updateItemsBottom) { @@ -140,6 +245,12 @@ var canvas_lowerECAMPageEng = }; var input = { + engFuelUsed1: "/systems/fuel/fuel-used-1", + engFuelUsed2: "/systems/fuel/fuel-used-2", + engOilQt1: "/engines/engine[0]/oil-qt-actual", + engOilQt2: "/engines/engine[1]/oil-qt-actual", + engOilPsi1: "/engines/engine[0]/oil-psi-actual", + engOilPsi2: "/engines/engine[1]/oil-psi-actual", }; foreach (var name; keys(input)) { diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas index b181dfbf..7abf7bd7 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas @@ -46,9 +46,6 @@ var hp_valve_state = 0; var xbleedcmdstate = 0; var ramAirState = 0; -# Conversion factor pounds to kilogram -LBS2KGS = 0.4535924; - # Fetch Nodes var acconfig_weight_kgs = props.globals.getNode("/systems/acconfig/options/weight-kgs", 1); var rate = props.globals.getNode("/systems/acconfig/options/lecam-rate", 1); @@ -105,10 +102,9 @@ var gs_kt = props.globals.getNode("/velocities/groundspeed-kt", 1); var switch_wing_aice = props.globals.getNode("/controls/ice-protection/wing", 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); +var oil_qt1_actual = props.globals.getNode("", 1); var oil_qt2_actual = props.globals.getNode("/engines/engine[1]/oil-qt-actual", 1); -var fuel_used_lbs1 = props.globals.getNode("/systems/fuel/fuel-used-1", 1); -var fuel_used_lbs2 = props.globals.getNode("/systems/fuel/fuel-used-2", 1); +var fuel_used_lbs1 = props.globals.getNode("", 1); var doorL1_pos = props.globals.getNode("/sim/model/door-positions/doorl1/position-norm", 1); var doorR1_pos = props.globals.getNode("/sim/model/door-positions/doorr1/position-norm", 1); var doorL4_pos = props.globals.getNode("/sim/model/door-positions/doorl4/position-norm", 1); @@ -1657,50 +1653,18 @@ var canvas_lowerECAM_eng = { return m; }, getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","OilQT1-needle","OilQT2-needle","OilQT1","OilQT2","OilQT1-decimal","OilQT2-decimal","OilPSI1-needle","OilPSI2-needle","OilPSI1","OilPSI2","FUEL-used-1","FUEL-used-2", "Fused-weight-unit"]; + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit",]; }, update: func() { # Oil Quantity - me["OilQT1"].setText(sprintf("%s", int(oil_qt1_actual.getValue()))); - me["OilQT2"].setText(sprintf("%s", int(oil_qt2_actual.getValue()))); - me["OilQT1-decimal"].setText(sprintf("%s", int(10*math.mod(oil_qt1_actual.getValue(),1)))); - me["OilQT2-decimal"].setText(sprintf("%s", int(10*math.mod(oil_qt2_actual.getValue(),1)))); - - me["OilQT1-needle"].setRotation((oil_qt1.getValue() + 90) * D2R); - me["OilQT2-needle"].setRotation((oil_qt2.getValue() + 90) * D2R); + # Oil Pressure - if (pts.Engines.Engine.oilPsi[0].getValue() >= 20) { - me["OilPSI1"].setColor(0.0509,0.7529,0.2941); - me["OilPSI1-needle"].setColor(0.0509,0.7529,0.2941); - } else { - me["OilPSI1"].setColor(1,0,0); - me["OilPSI1-needle"].setColor(1,0,0); - } - - if (pts.Engines.Engine.oilPsi[1].getValue() >= 20) { - me["OilPSI2"].setColor(0.0509,0.7529,0.2941); - me["OilPSI2-needle"].setColor(0.0509,0.7529,0.2941); - } else { - me["OilPSI2"].setColor(1,0,0); - me["OilPSI2-needle"].setColor(1,0,0); - } - - me["OilPSI1"].setText(sprintf("%s", math.round(pts.Engines.Engine.oilPsi[0].getValue()))); - me["OilPSI2"].setText(sprintf("%s", math.round(pts.Engines.Engine.oilPsi[1].getValue()))); - - me["OilPSI1-needle"].setRotation((oil_psi1.getValue() + 90) * D2R); - me["OilPSI2-needle"].setRotation((oil_psi2.getValue() + 90) * D2R); + # Fuel Used if (acconfig_weight_kgs.getValue()) { - me["FUEL-used-1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue() * LBS2KGS, 10))); - me["FUEL-used-2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue() * LBS2KGS, 10))); - me["Fused-weight-unit"].setText("KG"); } else { - me["FUEL-used-1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue(), 10))); - me["FUEL-used-2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue(), 10))); - me["Fused-weight-unit"].setText("LBS"); } me.updateBottomStatus(); diff --git a/Models/Instruments/Lower-ECAM/res/eng.svg b/Models/Instruments/Lower-ECAM/res/eng.svg index 212bd01f..4056f45c 100644 --- a/Models/Instruments/Lower-ECAM/res/eng.svg +++ b/Models/Instruments/Lower-ECAM/res/eng.svg @@ -12,8 +12,8 @@ viewBox="0 0 1024 1024" version="1.1" id="svg2" - inkscape:version="0.91 r13725" - sodipodi:docname="eng-eis2.svg"> + inkscape:version="0.92.4 (5da689c313, 2019-01-14)" + sodipodi:docname="eng.svg"> @@ -37,14 +37,14 @@ guidetolerance="10" inkscape:pageopacity="1" inkscape:pageshadow="2" - inkscape:window-width="1920" - inkscape:window-height="1030" + inkscape:window-width="1366" + inkscape:window-height="705" id="namedview371" showgrid="true" - inkscape:zoom="0.5" - inkscape:cx="988.67552" - inkscape:cy="398.82462" - inkscape:window-x="1592" + inkscape:zoom="1" + inkscape:cx="593.89152" + inkscape:cy="650.40507" + inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" inkscape:current-layer="svg2"> @@ -81,8 +81,7 @@ style="font-style:normal;font-weight:normal;line-height:0%;font-family:'Liberation Sans';letter-spacing:0px;word-spacing:0px;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" x="500.75214" y="977.31793" - id="text6232" - sodipodi:linespacing="0%">120000 °C G.LOAD 0.6 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#bb6100;fill-opacity:1">G.LOAD 0.6   0000 + x="264.69104" + y="181.87344" + style="font-size:30.0000782px;line-height:1.25;fill:#0dc04b;fill-opacity:1;stroke-width:0.75000191">0000 0000 + CLOG + CLOG + CLOG + CLOG + 22 + 0.6 + 0.1 + 0.6 + 0.1 + 22 diff --git a/Nasal/Libraries/property-tree-setup.nas b/Nasal/Libraries/property-tree-setup.nas index a4d5c988..7280d194 100644 --- a/Nasal/Libraries/property-tree-setup.nas +++ b/Nasal/Libraries/property-tree-setup.nas @@ -87,6 +87,7 @@ var Engines = { 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")], + oilQt: [props.globals.getNode("/engines/engine[0]/oil-qt-actual"), props.globals.getNode("/engines/engine[1]/oil-qt-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")], From daba88a00e3f1e818f5aa9a5fabfd03963c66e80 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Fri, 16 Jul 2021 15:34:17 +0100 Subject: [PATCH 77/96] Wheel page --- .../Instruments/Lower-ECAM/Lower-ECAM-old.nas | 574 +----------------- .../Lower-ECAM/Lower-ECAM-wheel.nas | 555 ++++++++++++++++- Models/Instruments/Lower-ECAM/res/wheel.svg | 14 +- Nasal/FBW/it-fbw.nas | 2 +- Nasal/Libraries/libraries.nas | 2 + 5 files changed, 564 insertions(+), 583 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas index 7abf7bd7..6dbc4edf 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas @@ -138,7 +138,7 @@ var R4BrakeTempc = props.globals.getNode("/gear/gear[2]/R4brake-temp-degc", 1); var eng1_running = props.globals.getNode("/engines/engine[0]/running", 1); var eng2_running = props.globals.getNode("/engines/engine[1]/running", 1); var switch_cart = props.globals.getNode("/controls/electrical/ground-cart", 1); -var spoiler_L1 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l1/final-deg", 1); +var spoiler_L1 = props.globals.getNode("", 1); var spoiler_L2 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l2/final-deg", 1); var spoiler_L3 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l3/final-deg", 1); var spoiler_L4 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l4/final-deg", 1); @@ -1761,11 +1761,9 @@ var canvas_lowerECAM_fctl = { # Spoilers if (spoiler_L1.getValue() < 1.5) { - me["spoiler1Lex"].hide(); - me["spoiler1Lrt"].show(); + } else { - me["spoiler1Lrt"].hide(); - me["spoiler1Lex"].show(); + } if (spoiler_L2.getValue() < 1.5) { @@ -2649,378 +2647,6 @@ var canvas_lowerECAM_hyd = { me.updateBottomStatus(); }, }; - -var canvas_lowerECAM_wheel = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_wheel, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","lgctltext","NORMbrk","NWStext","leftdoor","rightdoor","nosegeardoorL","nosegeardoorR", - "autobrk","autobrkind","NWS","NWSrect","normbrk-rect","altnbrk","normbrkhyd","spoiler1Rex","spoiler1Rrt","spoiler2Rex","spoiler2Rrt","spoiler3Rex", - "spoiler3Rrt","spoiler4Rex","spoiler4Rrt","spoiler5Rex","spoiler5Rrt","spoiler1Lex","spoiler1Lrt","spoiler2Lex","spoiler2Lrt", - "spoiler3Lex","spoiler3Lrt","spoiler4Lex","spoiler4Lrt","spoiler5Lex","spoiler5Lrt","spoiler1Rf","spoiler2Rf","spoiler3Rf","spoiler4Rf","spoiler5Rf", - "spoiler1Lf","spoiler2Lf","spoiler3Lf","spoiler4Lf","spoiler5Lf","ALTNbrk","altnbrkhyd","altnbrk-rect","antiskidtext","brakearrow","accupress_text", - "accuonlyarrow","accuonly","braketemp1","normbrkhyd","braketemp2","braketemp3","braketemp4","toparc1","toparc2","toparc3","toparc4","leftuplock", - "noseuplock","rightuplock","Triangle-Left1","Triangle-Left2","Triangle-Nose1","Triangle-Nose2","Triangle-Right1","Triangle-Right2","BSCUrect1", - "BSCUrect2","BSCU1","BSCU2","tirepress1","tirepress2","tirepress3","tirepress4","tirepress5","tirepress6"]; - }, - update: func() { - blue_psi = systems.HYD.Psi.blue.getValue(); - green_psi = systems.HYD.Psi.green.getValue(); - yellow_psi = systems.HYD.Psi.yellow.getValue(); - autobrakemode = autobreak_mode.getValue(); - nosegear = gear1_pos.getValue(); - leftgear = gear2_pos.getValue(); - rightgear = gear3_pos.getValue(); - leftdoor = gear_door_L.getValue(); - rightdoor = gear_door_R.getValue(); - nosedoor = gear_door_N.getValue(); - gearlvr = gear_down.getValue(); - askidsw = systems.HYD.Switch.nwsSwitch.getBoolValue(); - brakemode = systems.HYD.Brakes.mode.getBoolValue(); - accum = systems.HYD.Brakes.accumPressPsi.getBoolValue(); - - # L/G CTL - if ((leftgear == 0 or nosegear == 0 or rightgear == 0 and gearlvr == 0) or (leftgear == 1 or nosegear == 1 or rightgear == 1 and gearlvr == 1)) { - me["lgctltext"].hide(); - } else { - me["lgctltext"].show(); - } - - # NWS / Antiskid / Brakes - if (askidsw and yellow_psi >= 1500) { - me["NWStext"].hide(); - me["NWS"].hide(); - me["NWSrect"].hide(); - me["antiskidtext"].hide(); - me["BSCUrect1"].hide(); - me["BSCUrect2"].hide(); - me["BSCU1"].hide(); - me["BSCU2"].hide(); - } else if (!askidsw and yellow_psi >= 1500) { - me["NWStext"].show(); - me["NWS"].show(); - me["NWS"].setColor(0.0509,0.7529,0.2941); - me["NWSrect"].show(); - me["antiskidtext"].show(); - me["antiskidtext"].setColor(0.7333,0.3803,0); - me["BSCUrect1"].show(); - me["BSCUrect2"].show(); - me["BSCU1"].show(); - me["BSCU2"].show(); - } else { - me["NWStext"].show(); - me["NWS"].show(); - me["NWS"].setColor(0.7333,0.3803,0); - me["NWSrect"].show(); - me["antiskidtext"].show(); - me["antiskidtext"].setColor(0.7333,0.3803,0); - me["BSCUrect1"].show(); - me["BSCUrect2"].show(); - me["BSCU1"].show(); - me["BSCU2"].show(); - } - - if (green_psi >= 1500 and brakemode == 1) { - me["NORMbrk"].hide(); - me["normbrk-rect"].hide(); - me["normbrkhyd"].hide(); - } else if (green_psi >= 1500 and askidsw) { - me["NORMbrk"].show(); - me["normbrk-rect"].show(); - me["NORMbrk"].setColor(0.7333,0.3803,0); - me["normbrkhyd"].setColor(0.0509,0.7529,0.2941); - } else if (green_psi < 1500 or !askidsw) { - me["NORMbrk"].show(); - me["normbrk-rect"].show(); - me["NORMbrk"].setColor(0.7333,0.3803,0); - me["normbrkhyd"].setColor(0.7333,0.3803,0); - } - - if (brakemode != 2) { - me["ALTNbrk"].hide(); - me["altnbrk-rect"].hide(); - me["altnbrkhyd"].hide(); - } else if (yellow_psi >= 1500) { - me["ALTNbrk"].show(); - me["altnbrk-rect"].show(); - me["altnbrkhyd"].setColor(0.0509,0.7529,0.2941); - } else { - me["ALTNbrk"].show(); - me["altnbrk-rect"].show(); - me["altnbrkhyd"].setColor(0.7333,0.3803,0); - } - - if (brakemode == 2 and accum < 200 and yellow_psi < 1500) { - me["accupress_text"].show(); - me["brakearrow"].hide(); - me["accupress_text"].setColor(0.7333,0.3803,0); - } else if (brakemode == 2 and accum > 200 and yellow_psi >= 1500){ - me["accupress_text"].show(); - me["brakearrow"].show(); - me["accupress_text"].setColor(0.0509,0.7529,0.2941); - } else if (brakemode == 2 and accum > 200 and yellow_psi < 1500) { - me["accuonlyarrow"].show(); - me["accuonly"].show(); - me["brakearrow"].hide(); - me["accupress_text"].hide(); - } else { - me["accuonlyarrow"].hide(); - me["accuonly"].hide(); - me["brakearrow"].hide(); - me["accupress_text"].hide(); - } - - # Gear Doors - me["leftdoor"].setRotation(door_left.getValue() * D2R); - me["rightdoor"].setRotation(door_right.getValue() * D2R); - me["nosegeardoorL"].setRotation(door_nose_left.getValue() * D2R); - me["nosegeardoorR"].setRotation(door_nose_right.getValue() * D2R); - - if (nosedoor == 0) { - me["nosegeardoorL"].setColorFill(0.0509,0.7529,0.2941); - me["nosegeardoorR"].setColorFill(0.0509,0.7529,0.2941); - } else { - me["nosegeardoorL"].setColorFill(0.7333,0.3803,0); - me["nosegeardoorR"].setColorFill(0.7333,0.3803,0); - } - - if (leftdoor == 0) { - me["leftdoor"].setColorFill(0.0509,0.7529,0.2941); - } else { - me["leftdoor"].setColorFill(0.7333,0.3803,0); - } - - if (rightdoor == 0) { - me["rightdoor"].setColorFill(0.0509,0.7529,0.2941); - } else { - me["rightdoor"].setColorFill(0.7333,0.3803,0); - } - - # Triangles - if (leftgear < 0.2 or leftgear > 0.8) { - me["Triangle-Left1"].hide(); - me["Triangle-Left2"].hide(); - } else { - me["Triangle-Left1"].show(); - me["Triangle-Left2"].show(); - } - - if (leftgear == 1) { - me["Triangle-Left1"].setColor(0.0509,0.7529,0.2941); - me["Triangle-Left2"].setColor(0.0509,0.7529,0.2941); - } else { - me["Triangle-Left1"].setColor(1,0,0); - me["Triangle-Left2"].setColor(1,0,0); - } - - if (nosegear < 0.2 or nosegear > 0.8) { - me["Triangle-Nose1"].hide(); - me["Triangle-Nose2"].hide(); - } else { - me["Triangle-Nose1"].show(); - me["Triangle-Nose2"].show(); - } - - if (nosegear == 1) { - me["Triangle-Nose1"].setColor(0.0509,0.7529,0.2941); - me["Triangle-Nose2"].setColor(0.0509,0.7529,0.2941); - } else { - me["Triangle-Nose1"].setColor(1,0,0); - me["Triangle-Nose2"].setColor(1,0,0); - } - - if (rightgear < 0.2 or rightgear > 0.8) { - me["Triangle-Right1"].hide(); - me["Triangle-Right2"].hide(); - } else { - me["Triangle-Right1"].show(); - me["Triangle-Right2"].show(); - } - - if (rightgear == 1) { - me["Triangle-Right1"].setColor(0.0509,0.7529,0.2941); - me["Triangle-Right2"].setColor(0.0509,0.7529,0.2941); - } else { - me["Triangle-Right1"].setColor(1,0,0); - me["Triangle-Right2"].setColor(1,0,0); - } - - # Autobrake - if (autobrakemode == 0) { - me["autobrkind"].hide(); - } elsif (autobrakemode == 1) { - me["autobrkind"].show(); - me["autobrkind"].setText(sprintf("%s", "LO")); - } elsif (autobrakemode == 2) { - me["autobrkind"].show(); - me["autobrkind"].setText(sprintf("%s", "MED")); - } elsif (autobrakemode == 3) { - me["autobrkind"].show(); - me["autobrkind"].setText(sprintf("%s", "MAX")); - } - - if (autobrakemode != 0) { - me["autobrk"].show(); - } elsif (autobrakemode == 0) { - me["autobrk"].hide(); - } - - # Spoilers - if (spoiler_L1.getValue() < 1.5) { - me["spoiler1Lex"].hide(); - me["spoiler1Lrt"].show(); - } else { - me["spoiler1Lrt"].hide(); - me["spoiler1Lex"].show(); - } - - if (spoiler_L2.getValue() < 1.5) { - me["spoiler2Lex"].hide(); - me["spoiler2Lrt"].show(); - } else { - me["spoiler2Lrt"].hide(); - me["spoiler2Lex"].show(); - } - - if (spoiler_L3.getValue() < 1.5) { - me["spoiler3Lex"].hide(); - me["spoiler3Lrt"].show(); - } else { - me["spoiler3Lrt"].hide(); - me["spoiler3Lex"].show(); - } - - if (spoiler_L4.getValue() < 1.5) { - me["spoiler4Lex"].hide(); - me["spoiler4Lrt"].show(); - } else { - me["spoiler4Lrt"].hide(); - me["spoiler4Lex"].show(); - } - - if (spoiler_L5.getValue() < 1.5) { - me["spoiler5Lex"].hide(); - me["spoiler5Lrt"].show(); - } else { - me["spoiler5Lrt"].hide(); - me["spoiler5Lex"].show(); - } - - if (spoiler_R1.getValue() < 1.5) { - me["spoiler1Rex"].hide(); - me["spoiler1Rrt"].show(); - } else { - me["spoiler1Rrt"].hide(); - me["spoiler1Rex"].show(); - } - - if (spoiler_R2.getValue() < 1.5) { - me["spoiler2Rex"].hide(); - me["spoiler2Rrt"].show(); - } else { - me["spoiler2Rrt"].hide(); - me["spoiler2Rex"].show(); - } - - if (spoiler_R3.getValue() < 1.5) { - me["spoiler3Rex"].hide(); - me["spoiler3Rrt"].show(); - } else { - me["spoiler3Rrt"].hide(); - me["spoiler3Rex"].show(); - } - - if (spoiler_R4.getValue() < 1.5) { - me["spoiler4Rex"].hide(); - me["spoiler4Rrt"].show(); - } else { - me["spoiler4Rrt"].hide(); - me["spoiler4Rex"].show(); - } - - if (spoiler_R5.getValue() < 1.5) { - me["spoiler5Rex"].hide(); - me["spoiler5Rrt"].show(); - } else { - me["spoiler5Rrt"].hide(); - me["spoiler5Rex"].show(); - } - - # Spoiler Fail - if (fbw.FBW.Failures.spoilerl1.getValue() or green_psi < 1500) { - me["spoiler1Lex"].setColor(0.7333,0.3803,0); - me["spoiler1Lrt"].setColor(0.7333,0.3803,0); - if (spoiler_L1.getValue() < 1.5) { - me["spoiler1Lf"].show(); - } else { - me["spoiler1Lf"].hide(); - } - } else { - me["spoiler1Lex"].setColor(0.0509,0.7529,0.2941); - me["spoiler1Lrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler1Lf"].hide(); - } - - if (fbw.FBW.Failures.spoilerl2.getValue() or yellow_psi < 1500) { - me["spoiler2Lex"].setColor(0.7333,0.3803,0); - me["spoiler2Lrt"].setColor(0.7333,0.3803,0); - if (spoiler_L2.getValue() < 1.5) { - me["spoiler2Lf"].show(); - } else { - me["spoiler2Lf"].hide(); - } - } else { - me["spoiler2Lex"].setColor(0.0509,0.7529,0.2941); - me["spoiler2Lrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler2Lf"].hide(); - } - - if (fbw.FBW.Failures.spoilerl3.getValue() or blue_psi < 1500) { - me["spoiler3Lex"].setColor(0.7333,0.3803,0); - me["spoiler3Lrt"].setColor(0.7333,0.3803,0); - if (spoiler_L3.getValue() < 1.5) { - me["spoiler3Lf"].show(); - } else { - me["spoiler3Lf"].hide(); - } - } else { - me["spoiler3Lex"].setColor(0.0509,0.7529,0.2941); - me["spoiler3Lrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler3Lf"].hide(); - } - - if (fbw.FBW.Failures.spoilerl4.getValue() or yellow_psi < 1500) { - me["spoiler4Lex"].setColor(0.7333,0.3803,0); - me["spoiler4Lrt"].setColor(0.7333,0.3803,0); - if (spoiler_L4.getValue() < 1.5) { - me["spoiler4Lf"].show(); - } else { - me["spoiler4Lf"].hide(); - } - } else { - me["spoiler4Lex"].setColor(0.0509,0.7529,0.2941); - me["spoiler4Lrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler4Lf"].hide(); - } - - if (fbw.FBW.Failures.spoilerl5.getValue() or green_psi < 1500) { - me["spoiler5Lex"].setColor(0.7333,0.3803,0); - me["spoiler5Lrt"].setColor(0.7333,0.3803,0); - if (spoiler_L5.getValue() < 1.5) { - me["spoiler5Lf"].show(); - } else { - me["spoiler5Lf"].hide(); - } - } else { - me["spoiler5Lex"].setColor(0.0509,0.7529,0.2941); - me["spoiler5Lrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler5Lf"].hide(); - } - if (fbw.FBW.Failures.spoilerr1.getValue() or green_psi < 1500) { me["spoiler1Rex"].setColor(0.7333,0.3803,0); me["spoiler1Rrt"].setColor(0.7333,0.3803,0); @@ -3090,197 +2716,3 @@ var canvas_lowerECAM_wheel = { me["spoiler5Rrt"].setColor(0.0509,0.7529,0.2941); me["spoiler5Rf"].hide(); } - - # Show Brakes temperature - if (L1BrakeTempc.getValue() > 300) { - me["braketemp1"].setColor(0.7333,0.3803,0); - } else { - me["braketemp1"].setColor(0.0509,0.7529,0.2941); - } - - if (L2BrakeTempc.getValue() > 300) { - me["braketemp2"].setColor(0.7333,0.3803,0); - } else { - me["braketemp2"].setColor(0.0509,0.7529,0.2941); - } - if (R3BrakeTempc.getValue() > 300) { - me["braketemp3"].setColor(0.7333,0.3803,0); - } else { - me["braketemp3"].setColor(0.0509,0.7529,0.2941); - } - if (R4BrakeTempc.getValue() > 300) { - me["braketemp4"].setColor(0.7333,0.3803,0); - } else { - me["braketemp4"].setColor(0.0509,0.7529,0.2941); - } - - # Brake arcs - if (L1BrakeTempc.getValue() > 300) { - me["toparc1"].setColor(0.7333,0.3803,0); - } else - { - if (L1BrakeTempc.getValue() > 100 and L1BrakeTempc.getValue() < 300) - { - me["toparc1"].setColor(0.0509,0.7529,0.2941); - } - else { - me["toparc1"].setColor(0.8078,0.8039,0.8078); - } - } - if (L2BrakeTempc.getValue() > 300) { - me["toparc2"].setColor(0.7333,0.3803,0); - } else - { - if (L2BrakeTempc.getValue() > 100 and L2BrakeTempc.getValue() < 300) - { - me["toparc2"].setColor(0.0509,0.7529,0.2941); - } - else { - me["toparc2"].setColor(0.8078,0.8039,0.8078); - } - } - if (R3BrakeTempc.getValue() > 300) { - me["toparc3"].setColor(0.7333,0.3803,0); - } else - { - if (R3BrakeTempc.getValue() > 100 and R3BrakeTempc.getValue() < 300) - { - me["toparc3"].setColor(0.0509,0.7529,0.2941); - } - else { - me["toparc3"].setColor(0.8078,0.8039,0.8078); - } - } - if (R4BrakeTempc.getValue() > 300) { - me["toparc4"].setColor(0.7333,0.3803,0); - } else - { - if (R4BrakeTempc.getValue() > 100 and R4BrakeTempc.getValue() < 300) - { - me["toparc4"].setColor(0.0509,0.7529,0.2941); - } - else { - me["toparc4"].setColor(0.8078,0.8039,0.8078); - } - } - me["braketemp1"].setText(sprintf("%s", math.round(L1BrakeTempc.getValue(), 1))); - me["braketemp2"].setText(sprintf("%s", math.round(L2BrakeTempc.getValue(), 1))); - me["braketemp3"].setText(sprintf("%s", math.round(R3BrakeTempc.getValue(), 1))); - me["braketemp4"].setText(sprintf("%s", math.round(R4BrakeTempc.getValue(), 1))); - me["braketemp1"].show(); - me["braketemp2"].show(); - me["braketemp3"].show(); - me["braketemp4"].show(); - me["toparc1"].show(); - me["toparc2"].show(); - me["toparc3"].show(); - me["toparc4"].show(); - - # Hide not yet implemented stuff - me["leftuplock"].hide(); - me["noseuplock"].hide(); - me["rightuplock"].hide(); - me["tirepress1"].hide(); - me["tirepress2"].hide(); - me["tirepress3"].hide(); - me["tirepress4"].hide(); - me["tirepress5"].hide(); - me["tirepress6"].hide(); - - me.updateBottomStatus(); - }, -}; - -var canvas_lowerECAM_test = { - init: func(canvas_group, file) { - var font_mapper = func(family, weight) { - return "LiberationFonts/LiberationSans-Regular.ttf"; - }; - - canvas.parsesvg(canvas_group, file, {"font-mapper": font_mapper}); - - var svg_keys = me.getKeys(); - foreach(var key; svg_keys) { - me[key] = canvas_group.getElementById(key); - } - - me.page = canvas_group; - - return me; - }, - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_test]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return ["Test_white","Test_text"]; - }, - update: func() { - var elapsedtime = pts.Sim.Time.elapsedSec.getValue(); - if (du4_test_time.getValue() + 1 >= elapsedtime) { - me["Test_white"].show(); - me["Test_text"].hide(); - } else { - me["Test_white"].hide(); - me["Test_text"].show(); - } - }, -}; - -setlistener("/sim/signals/fdm-initialized", func { - lowerECAM_display = canvas.new({ - "name": "lowerECAM", - "size": [1024, 1024], - "view": [1024, 1024], - "mipmapping": 1 - }); - lowerECAM_display.addPlacement({"node": "lecam.screen"}); - var groupApu = lowerECAM_display.createGroup(); - var groupBleed = lowerECAM_display.createGroup(); - var groupCond = lowerECAM_display.createGroup(); - var groupCrz = lowerECAM_display.createGroup(); - var groupDoor = lowerECAM_display.createGroup(); - var groupElec = lowerECAM_display.createGroup(); - var groupEng = lowerECAM_display.createGroup(); - var groupFctl = lowerECAM_display.createGroup(); - var groupFuel = lowerECAM_display.createGroup(); - var groupPress = lowerECAM_display.createGroup(); - var groupStatus = lowerECAM_display.createGroup(); - var groupHyd = lowerECAM_display.createGroup(); - var groupWheel = lowerECAM_display.createGroup(); - var group_test = lowerECAM_display.createGroup(); - - lowerECAM_apu = canvas_lowerECAM_apu.new(groupApu, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/apu.svg"); - lowerECAM_bleed = canvas_lowerECAM_bleed.new(groupBleed, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/bleed.svg"); - lowerECAM_cond = canvas_lowerECAM_cond.new(groupCond, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/cond.svg"); - lowerECAM_crz = canvas_lowerECAM_crz.new(groupCrz, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/crz.svg"); - lowerECAM_door = canvas_lowerECAM_door.new(groupDoor, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/door.svg"); - lowerECAM_elec = canvas_lowerECAM_elec.new(groupElec, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/elec.svg"); - lowerECAM_eng = canvas_lowerECAM_eng.new(groupEng, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/eng.svg"); - lowerECAM_fctl = canvas_lowerECAM_fctl.new(groupFctl, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/fctl.svg"); - lowerECAM_fuel = canvas_lowerECAM_fuel.new(groupFuel, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/fuel.svg"); - lowerECAM_press = canvas_lowerECAM_press.new(groupPress, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/press.svg"); - lowerECAM_status = canvas_lowerECAM_status.new(groupStatus, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/status.svg"); - lowerECAM_hyd = canvas_lowerECAM_hyd.new(groupHyd, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/hyd.svg"); - lowerECAM_wheel = canvas_lowerECAM_wheel.new(groupWheel, "Aircraft/A320-family/Models/Instruments/Lower-ECAM/res/wheel.svg"); - lowerECAM_test = canvas_lowerECAM_test.new(group_test, "Aircraft/A320-family/Models/Instruments/Common/res/du-test.svg"); - - lowerECAM_update.start(); - if (rate.getValue() > 1) { - l_rateApply(); - } -}); - -var l_rateApply = func { - lowerECAM_update.restart(0.05 * rate.getValue()); -} - -var lowerECAM_update = maketimer(0.05, func { - canvas_lowerECAM_base.update(); -}); - -setlistener("/systems/electrical/bus/ac-2", func() { - canvas_lowerECAM_base.updateDu4(); -}, 0, 0); diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas index 87332924..e6586a11 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas @@ -21,8 +21,517 @@ var canvas_lowerECAMPageWheel = obj.units = acconfig_weight_kgs.getValue(); # init + obj["leftuplock"].hide(); + obj["noseuplock"].hide(); + obj["rightuplock"].hide(); + obj["tirepress1"].hide(); + obj["tirepress2"].hide(); + obj["tirepress3"].hide(); + obj["tirepress4"].hide(); + obj["tirepress5"].hide(); + obj["tirepress6"].hide(); + obj.update_items = [ + props.UpdateManager.FromHashList(["gearPosNorm","gearPosNorm1","gearPosNorm2","gearLever"], nil, func(val) { + if (val.gearLever and (val.gearPosNorm != 1 or val.gearPosNorm1 != 1 or val.gearPosNorm2 != 1)) { + obj["lgctltext"].show(); + } elsif (!val.gearLever and (val.gearPosNorm != 0 or val.gearPosNorm1 != 0 or val.gearPosNorm2 != 0)) { + obj["lgctltext"].show(); + } else { + obj["lgctltext"].hide(); + } + }), + props.UpdateManager.FromHashValue("gearPosNorm", 0.01, func(val) { + if (val < 0.2 or val > 0.8) { + obj["Triangle-Nose1"].hide(); + obj["Triangle-Nose2"].hide(); + } else { + obj["Triangle-Nose1"].show(); + obj["Triangle-Nose2"].show(); + } + + if (val == 1) { + obj["Triangle-Nose1"].setColor(0.0509,0.7529,0.2941); + obj["Triangle-Nose2"].setColor(0.0509,0.7529,0.2941); + } else { + obj["Triangle-Nose1"].setColor(1,0,0); + obj["Triangle-Nose2"].setColor(1,0,0); + } + }), + props.UpdateManager.FromHashValue("gearPosNorm1", 0.01, func(val) { + if (val < 0.2 or val > 0.8) { + obj["Triangle-Left1"].hide(); + obj["Triangle-Left2"].hide(); + } else { + obj["Triangle-Left1"].show(); + obj["Triangle-Left2"].show(); + } + + if (val == 1) { + obj["Triangle-Left1"].setColor(0.0509,0.7529,0.2941); + obj["Triangle-Left2"].setColor(0.0509,0.7529,0.2941); + } else { + obj["Triangle-Left1"].setColor(1,0,0); + obj["Triangle-Left2"].setColor(1,0,0); + } + }), + props.UpdateManager.FromHashValue("gearPosNorm2", 0.01, func(val) { + if (val < 0.2 or val > 0.8) { + obj["Triangle-Right1"].hide(); + obj["Triangle-Right2"].hide(); + } else { + obj["Triangle-Right1"].show(); + obj["Triangle-Right2"].show(); + } + + if (val == 1) { + obj["Triangle-Right1"].setColor(0.0509,0.7529,0.2941); + obj["Triangle-Right2"].setColor(0.0509,0.7529,0.2941); + } else { + obj["Triangle-Right1"].setColor(1,0,0); + obj["Triangle-Right2"].setColor(1,0,0); + } + }), + props.UpdateManager.FromHashList(["yellow","green","NWSSwitch","brakesMode","val.accumPressPsiPressPsi"], nil, func(val) { + if (val.NWSSwitch and val.yellow >= 1500) { + obj["NWStext"].hide(); + obj["NWS"].hide(); + obj["NWSrect"].hide(); + obj["antiskidtext"].hide(); + obj["BSCUrect1"].hide(); + obj["BSCUrect2"].hide(); + obj["BSCU1"].hide(); + obj["BSCU2"].hide(); + } else if (!val.NWSSwitch and val.yellow >= 1500) { + obj["NWStext"].show(); + obj["NWS"].show(); + obj["NWS"].setColor(0.0509,0.7529,0.2941); + obj["NWSrect"].show(); + obj["antiskidtext"].show(); + obj["antiskidtext"].setColor(0.7333,0.3803,0); + obj["BSCUrect1"].show(); + obj["BSCUrect2"].show(); + obj["BSCU1"].show(); + obj["BSCU2"].show(); + } else { + obj["NWStext"].show(); + obj["NWS"].show(); + obj["NWS"].setColor(0.7333,0.3803,0); + obj["NWSrect"].show(); + obj["antiskidtext"].show(); + obj["antiskidtext"].setColor(0.7333,0.3803,0); + obj["BSCUrect1"].show(); + obj["BSCUrect2"].show(); + obj["BSCU1"].show(); + obj["BSCU2"].show(); + } + + if (val.green >= 1500 and val.brakesMode == 1) { + obj["NORMbrk"].hide(); + obj["normbrk-rect"].hide(); + obj["normbrkhyd"].hide(); + } else if (val.green >= 1500 and val.NWSSwitch) { + obj["NORMbrk"].show(); + obj["normbrk-rect"].show(); + obj["NORMbrk"].setColor(0.7333,0.3803,0); + obj["normbrkhyd"].setColor(0.0509,0.7529,0.2941); + } else if (val.green < 1500 or !val.NWSSwitch) { + obj["NORMbrk"].show(); + obj["normbrk-rect"].show(); + obj["NORMbrk"].setColor(0.7333,0.3803,0); + obj["normbrkhyd"].setColor(0.7333,0.3803,0); + } + + if (val.brakesMode != 2) { + obj["ALTNbrk"].hide(); + obj["altnbrk-rect"].hide(); + obj["altnbrkhyd"].hide(); + } else if (val.yellow >= 1500) { + obj["ALTNbrk"].show(); + obj["altnbrk-rect"].show(); + obj["altnbrkhyd"].setColor(0.0509,0.7529,0.2941); + } else { + obj["ALTNbrk"].show(); + obj["altnbrk-rect"].show(); + obj["altnbrkhyd"].setColor(0.7333,0.3803,0); + } + + if (val.brakesMode == 2 and val.accumPressPsi < 200 and val.yellow < 1500) { + obj["accupress_text"].show(); + obj["brakearrow"].hide(); + obj["accupress_text"].setColor(0.7333,0.3803,0); + } else if (val.brakesMode == 2 and val.accumPressPsi > 200 and val.yellow >= 1500){ + obj["accupress_text"].show(); + obj["brakearrow"].show(); + obj["accupress_text"].setColor(0.0509,0.7529,0.2941); + } else if (val.brakesMode == 2 and val.accumPressPsi > 200 and val.yellow < 1500) { + obj["accuonlyarrow"].show(); + obj["accuonly"].show(); + obj["brakearrow"].hide(); + obj["accupress_text"].hide(); + } else { + obj["accuonlyarrow"].hide(); + obj["accuonly"].hide(); + obj["brakearrow"].hide(); + obj["accupress_text"].hide(); + } + }), + props.UpdateManager.FromHashList(["brakeAutobrkMode"], nil, func(val) { + if (val.brakeAutobrkMode == 0) { + obj["autobrkind"].hide(); + } elsif (val.brakeAutobrkMode == 1) { + obj["autobrkind"].show(); + obj["autobrkind"].setText(sprintf("%s", "LO")); + } elsif (val.brakeAutobrkMode == 2) { + obj["autobrkind"].show(); + obj["autobrkind"].setText(sprintf("%s", "MED")); + } elsif (val.brakeAutobrkMode == 3) { + obj["autobrkind"].show(); + obj["autobrkind"].setText(sprintf("%s", "MAX")); + } + + if (val.brakeAutobrkMode != 0) { + obj["autobrk"].show(); + } else { + obj["autobrk"].hide(); + } + }), + props.UpdateManager.FromHashValue("brakeLeft1", 0.5, func(val) { + obj["braketemp1"].setText(sprintf("%s", math.round(val, 5))); + + if (val > 300) { + obj["braketemp1"].setColor(0.7333,0.3803,0); + obj["toparc1"].setColor(0.7333,0.3803,0); + } else { + if (val > 100 and val <= 300) { + obj["toparc1"].setColor(0.0509,0.7529,0.2941); + } else { + obj["toparc1"].setColor(0.8078,0.8039,0.8078); + } + obj["braketemp1"].setColor(0.0509,0.7529,0.2941); + } + }), + props.UpdateManager.FromHashValue("brakeLeft2", 0.5, func(val) { + obj["braketemp2"].setText(sprintf("%s", math.round(val, 5))); + + if (val > 300) { + obj["braketemp2"].setColor(0.7333,0.3803,0); + obj["toparc2"].setColor(0.7333,0.3803,0); + } else { + if (val > 100 and val <= 300) { + obj["toparc2"].setColor(0.0509,0.7529,0.2941); + } else { + obj["toparc2"].setColor(0.8078,0.8039,0.8078); + } + obj["braketemp2"].setColor(0.0509,0.7529,0.2941); + } + }), + props.UpdateManager.FromHashValue("brakeRight1", 0.5, func(val) { + obj["braketemp3"].setText(sprintf("%s", math.round(val, 5))); + + if (val > 300) { + obj["braketemp3"].setColor(0.7333,0.3803,0); + obj["toparc3"].setColor(0.7333,0.3803,0); + } else { + if (val > 100 and val <= 300) { + obj["toparc3"].setColor(0.0509,0.7529,0.2941); + } else { + obj["toparc3"].setColor(0.8078,0.8039,0.8078); + } + obj["braketemp3"].setColor(0.0509,0.7529,0.2941); + } + }), + props.UpdateManager.FromHashValue("brakeRight2", 0.5, func(val) { + obj["braketemp4"].setText(sprintf("%s", math.round(val, 5))); + + if (val > 300) { + obj["braketemp4"].setColor(0.7333,0.3803,0); + obj["toparc4"].setColor(0.7333,0.3803,0); + } else { + if (val > 100 and val <= 300) { + obj["toparc4"].setColor(0.0509,0.7529,0.2941); + } else { + obj["toparc4"].setColor(0.8078,0.8039,0.8078); + } + obj["braketemp4"].setColor(0.0509,0.7529,0.2941); + } + }), + props.UpdateManager.FromHashValue("wheelLeftDoor", 0.5, func(val) { + obj["leftdoor"].setRotation(val * D2R); + }), + props.UpdateManager.FromHashValue("wheelNoseLeftDoor", 0.5, func(val) { + obj["nosegeardoorL"].setRotation(val * D2R); + }), + props.UpdateManager.FromHashValue("wheelNoseRightDoor", 0.5, func(val) { + obj["nosegeardoorR"].setRotation(val * D2R); + }), + props.UpdateManager.FromHashValue("wheelRightDoor", 0.5, func(val) { + obj["rightdoor"].setRotation(val * D2R); + }), + props.UpdateManager.FromHashValue("wheelLeftDoorPos", 0.01, func(val) { + if (val == 0) { + obj["leftdoor"].setColorFill(0.0509,0.7529,0.2941); + } else { + obj["leftdoor"].setColorFill(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("wheelNoseDoorPos", 0.01, func(val) { + if (val == 0) { + obj["nosegeardoorL"].setColorFill(0.0509,0.7529,0.2941); + obj["nosegeardoorR"].setColorFill(0.0509,0.7529,0.2941); + } else { + obj["nosegeardoorL"].setColorFill(0.7333,0.3803,0); + obj["nosegeardoorR"].setColorFill(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("wheelRightDoorPos", 0.01, func(val) { + if (val == 0) { + obj["rightdoor"].setColorFill(0.0509,0.7529,0.2941); + } else { + obj["rightdoor"].setColorFill(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("spoilerL1", 0.5, func(val) { + if (val < 1.5) { + obj["spoiler1Lex"].hide(); + obj["spoiler1Lrt"].show(); + } else { + obj["spoiler1Lrt"].hide(); + obj["spoiler1Lex"].show(); + } + }), + props.UpdateManager.FromHashValue("spoilerL2", 0.5, func(val) { + if (val < 1.5) { + obj["spoiler2Lex"].hide(); + obj["spoiler2Lrt"].show(); + } else { + obj["spoiler2Lrt"].hide(); + obj["spoiler2Lex"].show(); + } + }), + props.UpdateManager.FromHashValue("spoilerL3", 0.5, func(val) { + if (val < 1.5) { + obj["spoiler3Lex"].hide(); + obj["spoiler3Lrt"].show(); + } else { + obj["spoiler3Lrt"].hide(); + obj["spoiler3Lex"].show(); + } + }), + props.UpdateManager.FromHashValue("spoilerL4", 0.5, func(val) { + if (val < 1.5) { + obj["spoiler4Lex"].hide(); + obj["spoiler4Lrt"].show(); + } else { + obj["spoiler4Lrt"].hide(); + obj["spoiler4Lex"].show(); + } + }), + props.UpdateManager.FromHashValue("spoilerL5", 0.5, func(val) { + if (val < 1.5) { + obj["spoiler5Lex"].hide(); + obj["spoiler5Lrt"].show(); + } else { + obj["spoiler5Lrt"].hide(); + obj["spoiler5Lex"].show(); + } + }), + props.UpdateManager.FromHashValue("spoilerR1", 0.5, func(val) { + if (val < 1.5) { + obj["spoiler1Rex"].hide(); + obj["spoiler1Rrt"].show(); + } else { + obj["spoiler1Rrt"].hide(); + obj["spoiler1Rex"].show(); + } + }), + props.UpdateManager.FromHashValue("spoilerR2", 0.5, func(val) { + if (val < 1.5) { + obj["spoiler2Rex"].hide(); + obj["spoiler2Rrt"].show(); + } else { + obj["spoiler2Rrt"].hide(); + obj["spoiler2Rex"].show(); + } + }), + props.UpdateManager.FromHashValue("spoilerR3", 0.5, func(val) { + if (val < 1.5) { + obj["spoiler3Rex"].hide(); + obj["spoiler3Rrt"].show(); + } else { + obj["spoiler3Rrt"].hide(); + obj["spoiler3Rex"].show(); + } + }), + props.UpdateManager.FromHashValue("spoilerR4", 0.5, func(val) { + if (val < 1.5) { + obj["spoiler4Rex"].hide(); + obj["spoiler4Rrt"].show(); + } else { + obj["spoiler4Rrt"].hide(); + obj["spoiler4Rex"].show(); + } + }), + props.UpdateManager.FromHashValue("spoilerR5", 0.5, func(val) { + if (val < 1.5) { + obj["spoiler5Rex"].hide(); + obj["spoiler5Rrt"].show(); + } else { + obj["spoiler5Rrt"].hide(); + obj["spoiler5Rex"].show(); + } + }), + props.UpdateManager.FromHashList(["spoilerL1Failure","spoilerL1","green"], nil, func(val) { + if (val.spoilerL1Failure or val.green < 1500) { + obj["spoiler1Lex"].setColor(0.7333,0.3803,0); + obj["spoiler1Lrt"].setColor(0.7333,0.3803,0); + if (val.spoilerL1 < 1.5) { + obj["spoiler1Lf"].show(); + } else { + obj["spoiler1Lf"].hide(); + } + } else { + obj["spoiler1Lex"].setColor(0.0509,0.7529,0.2941); + obj["spoiler1Lrt"].setColor(0.0509,0.7529,0.2941); + obj["spoiler1Lf"].hide(); + } + }), + props.UpdateManager.FromHashList(["spoilerL2Failure","spoilerL2","yellow"], nil, func(val) { + if (val.spoilerL2Failure or val.yellow < 1500) { + obj["spoiler2Lex"].setColor(0.7333,0.3803,0); + obj["spoiler2Lrt"].setColor(0.7333,0.3803,0); + if (val.spoilerL2 < 1.5) { + obj["spoiler2Lf"].show(); + } else { + obj["spoiler2Lf"].hide(); + } + } else { + obj["spoiler2Lex"].setColor(0.0509,0.7529,0.2941); + obj["spoiler2Lrt"].setColor(0.0509,0.7529,0.2941); + obj["spoiler2Lf"].hide(); + } + }), + props.UpdateManager.FromHashList(["spoilerL3Failure","spoilerL3","blue"], nil, func(val) { + if (val.spoilerL3Failure or val.blue < 1500) { + obj["spoiler3Lex"].setColor(0.7333,0.3803,0); + obj["spoiler3Lrt"].setColor(0.7333,0.3803,0); + if (val.spoilerL3 < 1.5) { + obj["spoiler3Lf"].show(); + } else { + obj["spoiler3Lf"].hide(); + } + } else { + obj["spoiler3Lex"].setColor(0.0509,0.7529,0.2941); + obj["spoiler3Lrt"].setColor(0.0509,0.7529,0.2941); + obj["spoiler3Lf"].hide(); + } + }), + props.UpdateManager.FromHashList(["spoilerL4Failure","spoilerL4","yellow"], nil, func(val) { + if (val.spoilerL4Failure or val.yellow < 1500) { + obj["spoiler4Lex"].setColor(0.7333,0.3803,0); + obj["spoiler4Lrt"].setColor(0.7333,0.3803,0); + if (val.spoilerL4 < 1.5) { + obj["spoiler4Lf"].show(); + } else { + obj["spoiler4Lf"].hide(); + } + } else { + obj["spoiler4Lex"].setColor(0.0509,0.7529,0.2941); + obj["spoiler4Lrt"].setColor(0.0509,0.7529,0.2941); + obj["spoiler4Lf"].hide(); + } + }), + props.UpdateManager.FromHashList(["spoilerL5Failure","spoilerL5","green"], nil, func(val) { + if (val.spoilerL5Failure or val.green < 1500) { + obj["spoiler5Lex"].setColor(0.7333,0.3803,0); + obj["spoiler5Lrt"].setColor(0.7333,0.3803,0); + if (val.spoilerL5 < 1.5) { + obj["spoiler5Lf"].show(); + } else { + obj["spoiler5Lf"].hide(); + } + } else { + obj["spoiler5Lex"].setColor(0.0509,0.7529,0.2941); + obj["spoiler5Lrt"].setColor(0.0509,0.7529,0.2941); + obj["spoiler5Lf"].hide(); + } + }), + props.UpdateManager.FromHashList(["spoilerR1Failure","spoilerR1","green"], nil, func(val) { + if (val.spoilerR1Failure or val.green < 1500) { + obj["spoiler1Rex"].setColor(0.7333,0.3803,0); + obj["spoiler1Rrt"].setColor(0.7333,0.3803,0); + if (val.spoilerR1 < 1.5) { + obj["spoiler1Rf"].show(); + } else { + obj["spoiler1Rf"].hide(); + } + } else { + obj["spoiler1Rex"].setColor(0.0509,0.7529,0.2941); + obj["spoiler1Rrt"].setColor(0.0509,0.7529,0.2941); + obj["spoiler1Rf"].hide(); + } + }), + props.UpdateManager.FromHashList(["spoilerR2Failure","spoilerR2","yellow"], nil, func(val) { + if (val.spoilerR2Failure or val.yellow < 1500) { + obj["spoiler2Rex"].setColor(0.7333,0.3803,0); + obj["spoiler2Rrt"].setColor(0.7333,0.3803,0); + if (val.spoilerR2 < 1.5) { + obj["spoiler2Rf"].show(); + } else { + obj["spoiler2Rf"].hide(); + } + } else { + obj["spoiler2Rex"].setColor(0.0509,0.7529,0.2941); + obj["spoiler2Rrt"].setColor(0.0509,0.7529,0.2941); + obj["spoiler2Rf"].hide(); + } + }), + props.UpdateManager.FromHashList(["spoilerR3Failure","spoilerR3","blue"], nil, func(val) { + if (val.spoilerR3Failure or val.blue < 1500) { + obj["spoiler3Rex"].setColor(0.7333,0.3803,0); + obj["spoiler3Rrt"].setColor(0.7333,0.3803,0); + if (val.spoilerR3 < 1.5) { + obj["spoiler3Rf"].show(); + } else { + obj["spoiler3Rf"].hide(); + } + } else { + obj["spoiler3Rex"].setColor(0.0509,0.7529,0.2941); + obj["spoiler3Rrt"].setColor(0.0509,0.7529,0.2941); + obj["spoiler3Rf"].hide(); + } + }), + props.UpdateManager.FromHashList(["spoilerR4Failure","spoilerR4","yellow"], nil, func(val) { + if (val.spoilerR4Failure or val.yellow < 1500) { + obj["spoiler4Rex"].setColor(0.7333,0.3803,0); + obj["spoiler4Rrt"].setColor(0.7333,0.3803,0); + if (val.spoilerR4 < 1.5) { + obj["spoiler4Rf"].show(); + } else { + obj["spoiler4Rf"].hide(); + } + } else { + obj["spoiler4Rex"].setColor(0.0509,0.7529,0.2941); + obj["spoiler4Rrt"].setColor(0.0509,0.7529,0.2941); + obj["spoiler4Rf"].hide(); + } + }), + props.UpdateManager.FromHashList(["spoilerR5Failure","spoilerR5","green"], nil, func(val) { + if (val.spoilerR5Failure or val.green < 1500) { + obj["spoiler5Rex"].setColor(0.7333,0.3803,0); + obj["spoiler5Rrt"].setColor(0.7333,0.3803,0); + if (val.spoilerR5 < 1.5) { + obj["spoiler5Rf"].show(); + } else { + obj["spoiler5Rf"].hide(); + } + } else { + obj["spoiler5Rex"].setColor(0.0509,0.7529,0.2941); + obj["spoiler5Rrt"].setColor(0.0509,0.7529,0.2941); + obj["spoiler5Rf"].hide(); + } + }), ]; obj.displayedGForce = 0; @@ -62,10 +571,15 @@ var canvas_lowerECAMPageWheel = return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; }, getKeys: func() { - return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", - "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", - "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", - "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + return["lgctltext","NORMbrk","NWStext","leftdoor","rightdoor","nosegeardoorL","nosegeardoorR", + "autobrk","autobrkind","NWS","NWSrect","normbrk-rect","altnbrk","normbrkhyd","spoiler1Rex","spoiler1Rrt","spoiler2Rex","spoiler2Rrt","spoiler3Rex", + "spoiler3Rrt","spoiler4Rex","spoiler4Rrt","spoiler5Rex","spoiler5Rrt","spoiler1Lex","spoiler1Lrt","spoiler2Lex","spoiler2Lrt", + "spoiler3Lex","spoiler3Lrt","spoiler4Lex","spoiler4Lrt","spoiler5Lex","spoiler5Lrt","spoiler1Rf","spoiler2Rf","spoiler3Rf","spoiler4Rf","spoiler5Rf", + "spoiler1Lf","spoiler2Lf","spoiler3Lf","spoiler4Lf","spoiler5Lf","ALTNbrk","altnbrkhyd","altnbrk-rect","antiskidtext","brakearrow","accupress_text", + "accuonlyarrow","accuonly","braketemp1","normbrkhyd","braketemp2","braketemp3","braketemp4","toparc1","toparc2","toparc3","toparc4","leftuplock", + "noseuplock","rightuplock","Triangle-Left1","Triangle-Left2","Triangle-Nose1","Triangle-Nose2","Triangle-Right1","Triangle-Right2","BSCUrect1", + "BSCUrect2","BSCU1","BSCU2","tirepress1","tirepress2","tirepress3","tirepress4","tirepress5","tirepress6"]; + }, updateBottom: func(notification) { foreach(var update_item_bottom; me.updateItemsBottom) { @@ -140,6 +654,39 @@ var canvas_lowerECAMPageWheel = }; var input = { + brakeAutobrkMode: "/controls/autobrake/mode", + brakeLeft1: "/gear/gear[1]/L1brake-temp-degc", + brakeLeft2: "/gear/gear[1]/L2brake-temp-degc", + brakeRight1: "/gear/gear[2]/R3brake-temp-degc", + brakeRight2: "/gear/gear[2]/R4brake-temp-degc", + wheelLeftDoor: "/ECAM/Lower/door-left", + wheelNoseLeftDoor: "/ECAM/Lower/door-nose-left", + wheelNoseRightDoor: "/ECAM/Lower/door-nose-right", + wheelRightDoor: "/ECAM/Lower/door-right", + wheelLeftDoorPos: "/systems/hydraulic/gear/door-left", + wheelNoseDoorPos: "/systems/hydraulic/gear/door-nose", + wheelRightDoorPos: "/systems/hydraulic/gear/door-right", + + spoilerL1: "/fdm/jsbsim/hydraulics/spoiler-l1/final-deg", + spoilerL2: "/fdm/jsbsim/hydraulics/spoiler-l2/final-deg", + spoilerL3: "/fdm/jsbsim/hydraulics/spoiler-l3/final-deg", + spoilerL4: "/fdm/jsbsim/hydraulics/spoiler-l4/final-deg", + spoilerL5: "/fdm/jsbsim/hydraulics/spoiler-l5/final-deg", + spoilerR1: "/fdm/jsbsim/hydraulics/spoiler-r1/final-deg", + spoilerR2: "/fdm/jsbsim/hydraulics/spoiler-r2/final-deg", + spoilerR3: "/fdm/jsbsim/hydraulics/spoiler-r3/final-deg", + spoilerR4: "/fdm/jsbsim/hydraulics/spoiler-r4/final-deg", + spoilerR5: "/fdm/jsbsim/hydraulics/spoiler-r5/final-deg", + spoilerL1Failure: "/systems/failures/spoilers/spoiler-l1", + spoilerL2Failure: "/systems/failures/spoilers/spoiler-l2", + spoilerL3Failure: "/systems/failures/spoilers/spoiler-l3", + spoilerL4Failure: "/systems/failures/spoilers/spoiler-l4", + spoilerL5Failure: "/systems/failures/spoilers/spoiler-l5", + spoilerR1Failure: "/systems/failures/spoilers/spoiler-r1", + spoilerR2Failure: "/systems/failures/spoilers/spoiler-r2", + spoilerR3Failure: "/systems/failures/spoilers/spoiler-r3", + spoilerR4Failure: "/systems/failures/spoilers/spoiler-r4", + spoilerR5Failure: "/systems/failures/spoilers/spoiler-r5", }; foreach (var name; keys(input)) { diff --git a/Models/Instruments/Lower-ECAM/res/wheel.svg b/Models/Instruments/Lower-ECAM/res/wheel.svg index 71327dc0..78109a8c 100644 --- a/Models/Instruments/Lower-ECAM/res/wheel.svg +++ b/Models/Instruments/Lower-ECAM/res/wheel.svg @@ -41,9 +41,9 @@ inkscape:window-height="705" id="namedview371" showgrid="true" - inkscape:zoom="2.3145515" - inkscape:cx="701.70396" - inkscape:cy="947.29764" + inkscape:zoom="0.45254834" + inkscape:cx="498.40273" + inkscape:cy="607.76607" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" @@ -1190,14 +1190,14 @@ inkscape:label="#text4289" xml:space="preserve" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';letter-spacing:0px;word-spacing:0px;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="455.59897" - y="707.69037" + x="457.25626" + y="745.80786" id="accuonly">ACCU ONLY + x="457.25626" + y="745.80786">ACCU ONLY Date: Fri, 16 Jul 2021 17:10:56 +0100 Subject: [PATCH 78/96] Door page / cruise page --- .../Lower-ECAM/Lower-ECAM-cruise.nas | 86 +++++- .../Lower-ECAM/Lower-ECAM-door.nas | 174 +++++++++++- .../Instruments/Lower-ECAM/Lower-ECAM-old.nas | 255 +----------------- Models/Instruments/Lower-ECAM/res/crz.svg | 32 +-- Models/Instruments/Lower-ECAM/res/door.svg | 212 ++++++--------- 5 files changed, 360 insertions(+), 399 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-cruise.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-cruise.nas index 5548d196..4b931bca 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-cruise.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-cruise.nas @@ -23,6 +23,86 @@ var canvas_lowerECAMPageCruise = # init obj.update_items = [ + props.UpdateManager.FromHashValue("engOil1", 0.005, func(val) { + if (obj.units) { + obj["Oil1"].setText(sprintf("%2.1f",(0.1 * math.round(val * QT2LTR * 10,5)))); + } else { + obj["Oil1"].setText(sprintf("%2.1f",(0.1 * math.round(val * 10,5)))); + } + }), + props.UpdateManager.FromHashValue("engOil2", 0.005, func(val) { + if (obj.units) { + obj["Oil2"].setText(sprintf("%2.1f",(0.1 * math.round(val * QT2LTR * 10,5)))); + } else { + obj["Oil2"].setText(sprintf("%2.1f",(0.1 * math.round(val * 10,5)))); + } + }), + props.UpdateManager.FromHashValue("acconfigUnits", nil, func(val) { + if (val) { + obj["Fused-weight-unit"].setText("KG"); + obj["OilUnit"].setText("LTR"); + # immediately update parameters + obj["Oil1"].setText(sprintf("%2.1f",(0.1 * math.round(pts.Engines.Engine.oilQt[0].getValue() * QT2LTR * 10,5)))); + obj["Oil2"].setText(sprintf("%2.1f",(0.1 * math.round(pts.Engines.Engine.oilQt[1].getValue() * QT2LTR * 10,5)))); + obj["FUsed1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue() * LBS2KGS, 10))); + obj["FUsed2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue() * LBS2KGS, 10))); + } else { + obj["Fused-weight-unit"].setText("LBS"); + obj["OilUnit"].setText("QT"); + obj["Oil1"].setText(sprintf("%2.1f",(0.1 * math.round(pts.Engines.Engine.oilQt[0].getValue() * 10,5)))); + obj["Oil2"].setText(sprintf("%2.1f",(0.1 * math.round(pts.Engines.Engine.oilQt[1].getValue() * 10,5)))); + obj["FUsed1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue(), 10))); + obj["FUsed2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue(), 10))); + } + }), + props.UpdateManager.FromHashValue("engFuelUsed1", 1, func(val) { + if (obj.units) { + obj["FUsed1"].setText(sprintf("%s", math.round(val * LBS2KGS, 10))); + } else { + obj["FUsed1"].setText(sprintf("%s", math.round(val, 10))); + } + }), + props.UpdateManager.FromHashValue("engFuelUsed2", 1, func(val) { + if (obj.units) { + obj["FUsed2"].setText(sprintf("%s", math.round(val * LBS2KGS, 10))); + } else { + obj["FUsed2"].setText(sprintf("%s", math.round(val, 10))); + } + }), + props.UpdateManager.FromHashList(["engFuelUsed1","engFuelUsed2"], 1, func(val) { + if (obj.units) { + obj["FUsed"].setText(sprintf("%s", math.round((val.engFuelUsed1 + val.engFuelUsed2) * LBS2KGS, 10))); + } else { + obj["FUsed"].setText(sprintf("%s", math.round((val.engFuelUsed1 + val.engFuelUsed2), 10))); + } + }), + props.UpdateManager.FromHashValue("pressDelta", 0.05, func(val) { + if (val > 31.9) { + obj["deltaPSI"].setText(sprintf("%2.1f", 31.9)); + } else if (val < -9.9) { + obj["deltaPSI"].setText(sprintf("%2.1f", -9.9)); + } else { + obj["deltaPSI"].setText(sprintf("%2.1f", val)); + } + }), + props.UpdateManager.FromHashValue("pressVS", 25, func(val) { + if (val > 9950) { + obj["CABVS"].setText(sprintf("%4.0f", 9950)); + } else if (val < -9950) { + obj["CABVS"].setText(sprintf("%4.0f", -9950)); + } else { + obj["CABVS"].setText(sprintf("%-4.0f", math.round(val,50))); + } + }), + props.UpdateManager.FromHashValue("condTempCockpit", 0.5, func(val) { + obj["CKPT-TEMP"].setText(sprintf("%2.0f",val)); + }), + props.UpdateManager.FromHashValue("condTempAft", 0.5, func(val) { + obj["AFT-TEMP"].setText(sprintf("%2.0f",val)); + }), + props.UpdateManager.FromHashValue("condTempFwd", 0.5, func(val) { + obj["FWD-TEMP"].setText(sprintf("%2.0f",val)); + }), ]; obj.displayedGForce = 0; @@ -62,10 +142,8 @@ var canvas_lowerECAMPageCruise = return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; }, getKeys: func() { - return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", - "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", - "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", - "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + return["Oil1","Oil2","FUsed1","FUsed2","FUsed","VIB1N1","VIB1N2","VIB2N1","VIB2N2","deltaPSI","LDGELEV-AUTO","LDGELEV","CABVS","CABALT","VS-Arrow-UP","VS-Arrow-DN","CKPT-TEMP","FWD-TEMP","AFT-TEMP","Fused-weight-unit"]; + }, updateBottom: func(notification) { foreach(var update_item_bottom; me.updateItemsBottom) { diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-door.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-door.nas index acaa3f50..9e279235 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-door.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-door.nas @@ -21,8 +21,171 @@ var canvas_lowerECAMPageDoor = obj.units = acconfig_weight_kgs.getValue(); # init + obj["Cabin2LeftSlide"].hide(); + obj["Cabin2RightSlide"].hide(); + obj["Cabin3LeftSlide"].hide(); + obj["Cabin3RightSlide"].hide(); + + obj["DOOROXY-REGUL-LO-PR"].hide(); + obj["AvionicsLine1"].hide(); + obj["AvionicsLine2"].hide(); + obj["AvionicsLbl1"].hide(); + obj["AvionicsLbl2"].hide(); + obj["ExitLLine"].hide(); + obj["ExitLLbl"].hide(); + obj["ExitRLine"].hide(); + obj["ExitRLbl"].hide(); + obj["Cabin2Left"].hide(); + obj["Cabin2LeftLine"].hide(); + obj["Cabin2LeftLbl"].hide(); + obj["Cabin2Right"].hide(); + obj["Cabin2RightLine"].hide(); + obj["Cabin2RightLbl"].hide(); + obj["Cabin3Left"].hide(); + obj["Cabin3LeftLine"].hide(); + obj["Cabin3LeftLbl"].hide(); + obj["Cabin3Right"].hide(); + obj["Cabin3RightLine"].hide(); + obj["Cabin3RightLbl"].hide(); + obj.update_items = [ + props.UpdateManager.FromHashValue("doorL1", nil, func(val) { + if (val > 0) { + obj["Cabin1Left"].show(); + obj["Cabin1Left"].setColor(0.7333,0.3803,0); + obj["Cabin1Left"].setColorFill(0.7333,0.3803,0); + obj["Cabin1LeftLbl"].show(); + obj["Cabin1LeftLine"].show(); + obj["Cabin1LeftSlide"].hide(); + } else { + obj["Cabin1Left"].setColor(0.0509,0.7529,0.2941); + obj["Cabin1Left"].setColorFill(0,0,0); + obj["Cabin1LeftLbl"].hide(); + obj["Cabin1LeftLine"].hide(); + obj["Cabin1LeftSlide"].show(); + } + }), + props.UpdateManager.FromHashValue("doorL4", nil, func(val) { + if (val > 0) { + obj["Cabin4Left"].show(); + obj["Cabin4Left"].setColor(0.7333,0.3803,0); + obj["Cabin4Left"].setColorFill(0.7333,0.3803,0); + obj["Cabin4LeftLbl"].show(); + obj["Cabin4LeftLine"].show(); + obj["Cabin4LeftSlide"].hide(); + } else { + obj["Cabin4Left"].setColor(0.0509,0.7529,0.2941); + obj["Cabin4Left"].setColorFill(0,0,0); + obj["Cabin4LeftLbl"].hide(); + obj["Cabin4LeftLine"].hide(); + obj["Cabin4LeftSlide"].show(); + } + }), + props.UpdateManager.FromHashValue("doorR1", nil, func(val) { + if (val > 0) { + obj["Cabin1Right"].show(); + obj["Cabin1Right"].setColor(0.7333,0.3803,0); + obj["Cabin1Right"].setColorFill(0.7333,0.3803,0); + obj["Cabin1RightLbl"].show(); + obj["Cabin1RightLine"].show(); + obj["Cabin1RightSlide"].hide(); + } else { + obj["Cabin1Right"].setColor(0.0509,0.7529,0.2941); + obj["Cabin1Right"].setColorFill(0,0,0); + obj["Cabin1RightLbl"].hide(); + obj["Cabin1RightLine"].hide(); + obj["Cabin1RightSlide"].show(); + } + }), + props.UpdateManager.FromHashValue("doorR4", nil, func(val) { + if (val > 0) { + obj["Cabin4Right"].show(); + obj["Cabin4Right"].setColor(0.7333,0.3803,0); + obj["Cabin4Right"].setColorFill(0.7333,0.3803,0); + obj["Cabin4RightLbl"].show(); + obj["Cabin4RightLine"].show(); + obj["Cabin4RightSlide"].hide(); + } else { + obj["Cabin4Right"].setColor(0.0509,0.7529,0.2941); + obj["Cabin4Right"].setColorFill(0,0,0); + obj["Cabin4RightLbl"].hide(); + obj["Cabin4RightLine"].hide(); + obj["Cabin4RightSlide"].show(); + } + }), + props.UpdateManager.FromHashValue("cargoAft", nil, func(val) { + if (val > 0) { + obj["Cargo2Door"].setColor(0.7333,0.3803,0); + obj["Cargo2Door"].setColorFill(0.7333,0.3803,0); + obj["Cargo2Lbl"].show(); + obj["Cargo2Line"].show(); + } else { + obj["Cargo2Door"].setColor(0.0509,0.7529,0.2941); + obj["Cargo2Door"].setColorFill(0,0,0); + obj["Cargo2Lbl"].hide(); + obj["Cargo2Line"].hide(); + } + }), + props.UpdateManager.FromHashValue("cargoBulk", nil, func(val) { + if (val > 0) { + obj["Bulk"].setColor(0.7333,0.3803,0); + obj["Bulk"].setColorFill(0.7333,0.3803,0); + obj["BulkLbl"].show(); + obj["BulkLine"].show(); + } else { + obj["Bulk"].setColor(0.0509,0.7529,0.2941); + obj["Bulk"].setColorFill(0,0,0); + obj["BulkLbl"].hide(); + obj["BulkLine"].hide(); + } + }), + props.UpdateManager.FromHashValue("cargoFwd", nil, func(val) { + if (val > 0) { + obj["Cargo1Door"].setColor(0.7333,0.3803,0); + obj["Cargo1Door"].setColorFill(0.7333,0.3803,0); + obj["Cargo1Lbl"].show(); + obj["Cargo1Line"].show(); + } else { + obj["Cargo1Door"].setColor(0.0509,0.7529,0.2941); + obj["Cargo1Door"].setColorFill(0,0,0); + obj["Cargo1Lbl"].hide(); + obj["Cargo1Line"].hide(); + } + }), + props.UpdateManager.FromHashValue("oxyPB", nil, func(val) { + if (val) { + obj["DOOROXY-OxyIndicator"].setColor(0.8078,0.8039,0.8078); + obj["DOOROXY-PR"].setColor(0.0509,0.7529,0.2941); + obj["DOOROXY-PR"].setText("1300"); + } else { + obj["DOOROXY-OxyIndicator"].setColor(0.7333,0.3803,0); + obj["DOOROXY-PR"].setColor(0.7333,0.3803,0); + obj["DOOROXY-PR"].setText("0"); + } + }), + props.UpdateManager.FromHashValue("pressVS", nil, func(val) { + if (val > 9950) { + obj["DOOR-VS"].setText(sprintf("%+4.0f", 9950)); + } else if (val < -9950) { + obj["DOOR-VS"].setText(sprintf("%+4.0f", -9950)); + } else { + obj["DOOR-VS"].setText(sprintf("%+4.0f", math.round(val,50))); + } + + if (abs(val) > 2000) { + obj["DOOR-VS"].setColor(0.7333,0.3803,0); + } else { + obj["DOOR-VS"].setColor(0.0509,0.7529,0.2941); + } + }), + props.UpdateManager.FromHashValue("FWCPhase", nil, func(val) { + if (val >= 5 and val <= 7) { + obj["DOOR-VS-Container"].show(); + } else { + obj["DOOR-VS-Container"].hide(); + } + }), ]; obj.displayedGForce = 0; @@ -65,7 +228,8 @@ var canvas_lowerECAMPageDoor = return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", - "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR","DOOROXY-PR","DOOROXY-OxyIndicator","DOOR-VS","DOOR-VS-Container"]; + }, updateBottom: func(notification) { foreach(var update_item_bottom; me.updateItemsBottom) { @@ -140,6 +304,14 @@ var canvas_lowerECAMPageDoor = }; var input = { + doorL1: "/sim/model/door-positions/doorl1/position-norm", + doorL4: "/sim/model/door-positions/doorl4/position-norm", + doorR1: "/sim/model/door-positions/doorr1/position-norm", + doorR4: "/sim/model/door-positions/doorr4/position-norm", + cargoAft: "/sim/model/door-positions/cargoaft/position-norm", + cargoBulk: "/sim/model/door-positions/cargobulk/position-norm", + cargoFwd: "/sim/model/door-positions/cargofwd/position-norm", + oxyPB: "/controls/oxygen/crewOxyPB", }; foreach (var name; keys(input)) { diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas index 6dbc4edf..251a7ddd 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas @@ -105,13 +105,6 @@ var pack2_bypass = props.globals.getNode("/systems/pneumatics/pack-2-bypass", 1) var oil_qt1_actual = props.globals.getNode("", 1); var oil_qt2_actual = props.globals.getNode("/engines/engine[1]/oil-qt-actual", 1); var fuel_used_lbs1 = props.globals.getNode("", 1); -var doorL1_pos = props.globals.getNode("/sim/model/door-positions/doorl1/position-norm", 1); -var doorR1_pos = props.globals.getNode("/sim/model/door-positions/doorr1/position-norm", 1); -var doorL4_pos = props.globals.getNode("/sim/model/door-positions/doorl4/position-norm", 1); -var doorR4_pos = props.globals.getNode("/sim/model/door-positions/doorr4/position-norm", 1); -var cargobulk_pos = props.globals.getNode("/sim/model/door-positions/cargobulk/position-norm", 1); -var cargofwd_pos = props.globals.getNode("/sim/model/door-positions/cargofwd/position-norm", 1); -var cargoaft_pos = props.globals.getNode("/sim/model/door-positions/cargoaft/position-norm", 1); var gLoad = props.globals.getNode("", 1); # Hydraulic @@ -796,183 +789,6 @@ var canvas_lowerECAM_bleed = { }, }; - -var canvas_lowerECAM_crz = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_crz, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","Oil1","Oil2","FUsed1","FUsed2","FUsed","VIB1N1","VIB1N2","VIB2N1","VIB2N2","deltaPSI","LDGELEV-AUTO","LDGELEV","CABVS","CABALT","VS-Arrow-UP","VS-Arrow-DN","CKPT-TEMP","FWD-TEMP","AFT-TEMP","Fused-weight-unit"]; - }, - update: func() { - - me["Oil1"].setText(sprintf("%2.1f", oil_qt1_actual.getValue())); - me["Oil2"].setText(sprintf("%2.1f", oil_qt2_actual.getValue())); - - if (acconfig_weight_kgs.getValue()) { - me["Fused-weight-unit"].setText("KG"); - me["FUsed1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue() * LBS2KGS, 10))); - me["FUsed2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue() * LBS2KGS, 10))); - me["FUsed"].setText(sprintf("%s", (math.round(fuel_used_lbs1.getValue() * LBS2KGS, 10) + math.round(fuel_used_lbs2.getValue() * LBS2KGS, 10)))); - } else { - me["Fused-weight-unit"].setText("LBS"); - me["FUsed1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue(), 10))); - me["FUsed2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue(), 10))); - me["FUsed"].setText(sprintf("%s", (math.round(fuel_used_lbs1.getValue(), 10) + math.round(fuel_used_lbs2.getValue(), 10)))); - } - - me.updateBottomStatus(); - }, -}; - -var canvas_lowerECAM_door = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_door, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", - "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", - "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", - "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"]; - }, - update: func() { - # If you make AirBerlin or Allegiant livery add below - - if (doorL1_pos.getValue() > 0) { - me["Cabin1Left"].show(); - me["Cabin1Left"].setColor(0.7333,0.3803,0); - me["Cabin1Left"].setColorFill(0.7333,0.3803,0); - me["Cabin1LeftLbl"].show(); - me["Cabin1LeftLine"].show(); - } else { - me["Cabin1Left"].setColor(0.0509,0.7529,0.2941); - me["Cabin1Left"].setColorFill(0,0,0); - me["Cabin1LeftLbl"].hide(); - me["Cabin1LeftLine"].hide(); - } - - if (doorR1_pos.getValue() > 0) { - me["Cabin1Right"].show(); - me["Cabin1Right"].setColor(0.7333,0.3803,0); - me["Cabin1Right"].setColorFill(0.7333,0.3803,0); - me["Cabin1RightLbl"].show(); - me["Cabin1RightLine"].show(); - } else { - me["Cabin1Right"].setColor(0.0509,0.7529,0.2941); - me["Cabin1Right"].setColorFill(0,0,0); - me["Cabin1RightLbl"].hide(); - me["Cabin1RightLine"].hide(); - } - - if (doorL4_pos.getValue() > 0) { - me["Cabin4Left"].show(); - me["Cabin4Left"].setColor(0.7333,0.3803,0); - me["Cabin4Left"].setColorFill(0.7333,0.3803,0); - me["Cabin4LeftLbl"].show(); - me["Cabin4LeftLine"].show(); - } else { - me["Cabin4Left"].setColor(0.0509,0.7529,0.2941); - me["Cabin4Left"].setColorFill(0,0,0); - me["Cabin4LeftLbl"].hide(); - me["Cabin4LeftLine"].hide(); - } - - if (doorR4_pos.getValue() > 0) { - me["Cabin4Right"].show(); - me["Cabin4Right"].setColor(0.7333,0.3803,0); - me["Cabin4Right"].setColorFill(0.7333,0.3803,0); - me["Cabin4RightLbl"].show(); - me["Cabin4RightLine"].show(); - } else { - me["Cabin4Right"].setColor(0.0509,0.7529,0.2941); - me["Cabin4Right"].setColorFill(0,0,0); - me["Cabin4RightLbl"].hide(); - me["Cabin4RightLine"].hide(); - } - - if (cargobulk_pos.getValue() > 0) { - me["Bulk"].setColor(0.7333,0.3803,0); - me["Bulk"].setColorFill(0.7333,0.3803,0); - me["BulkLbl"].show(); - me["BulkLine"].show(); - } else { - me["Bulk"].setColor(0.0509,0.7529,0.2941); - me["Bulk"].setColorFill(0,0,0); - me["BulkLbl"].hide(); - me["BulkLine"].hide(); - } - - if (cargofwd_pos.getValue() > 0) { - me["Cargo1Door"].setColor(0.7333,0.3803,0); - me["Cargo1Door"].setColorFill(0.7333,0.3803,0); - me["Cargo1Lbl"].show(); - me["Cargo1Line"].show(); - } else { - me["Cargo1Door"].setColor(0.0509,0.7529,0.2941); - me["Cargo1Door"].setColorFill(0,0,0); - me["Cargo1Lbl"].hide(); - me["Cargo1Line"].hide(); - } - - if (cargoaft_pos.getValue() > 0) { - me["Cargo2Door"].setColor(0.7333,0.3803,0); - me["Cargo2Door"].setColorFill(0.7333,0.3803,0); - me["Cargo2Lbl"].show(); - me["Cargo2Line"].show(); - } else { - me["Cargo2Door"].setColor(0.0509,0.7529,0.2941); - me["Cargo2Door"].setColorFill(0,0,0); - me["Cargo2Lbl"].hide(); - me["Cargo2Line"].hide(); - } - - me["Cabin1LeftSlide"].hide(); - me["Cabin1RightSlide"].hide(); - me["Cabin2LeftSlide"].hide(); - me["Cabin2RightSlide"].hide(); - me["Cabin3LeftSlide"].hide(); - me["Cabin3RightSlide"].hide(); - me["Cabin4LeftSlide"].hide(); - me["Cabin4RightSlide"].hide(); - - me["DOOROXY-REGUL-LO-PR"].hide(); - me["AvionicsLine1"].hide(); - me["AvionicsLine2"].hide(); - me["AvionicsLbl1"].hide(); - me["AvionicsLbl2"].hide(); - me["ExitLSlide"].hide(); - me["ExitLLine"].hide(); - me["ExitLLbl"].hide(); - me["ExitRSlide"].hide(); - me["ExitRLine"].hide(); - me["ExitRLbl"].hide(); - me["Cabin1LeftSlide"].hide(); - me["Cabin1RightSlide"].hide(); - me["Cabin4LeftSlide"].hide(); - me["Cabin4RightSlide"].hide(); - me["Cabin2Left"].hide(); - me["Cabin2LeftLine"].hide(); - me["Cabin2LeftLbl"].hide(); - me["Cabin2Right"].hide(); - me["Cabin2RightLine"].hide(); - me["Cabin2RightLbl"].hide(); - me["Cabin3Left"].hide(); - me["Cabin3LeftLine"].hide(); - me["Cabin3LeftLbl"].hide(); - me["Cabin3Right"].hide(); - me["Cabin3RightLine"].hide(); - me["Cabin3RightLbl"].hide(); - - me.updateBottomStatus(); - }, -}; - var canvas_lowerECAM_elec = { new: func(canvas_group, file) { var m = {parents: [canvas_lowerECAM_elec, canvas_lowerECAM_base]}; @@ -2646,73 +2462,4 @@ var canvas_lowerECAM_hyd = { me.updateBottomStatus(); }, -}; - if (fbw.FBW.Failures.spoilerr1.getValue() or green_psi < 1500) { - me["spoiler1Rex"].setColor(0.7333,0.3803,0); - me["spoiler1Rrt"].setColor(0.7333,0.3803,0); - if (spoiler_R1.getValue() < 1.5) { - me["spoiler1Rf"].show(); - } else { - me["spoiler1Rf"].hide(); - } - } else { - me["spoiler1Rex"].setColor(0.0509,0.7529,0.2941); - me["spoiler1Rrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler1Rf"].hide(); - } - - if (fbw.FBW.Failures.spoilerr2.getValue() or yellow_psi < 1500) { - me["spoiler2Rex"].setColor(0.7333,0.3803,0); - me["spoiler2Rrt"].setColor(0.7333,0.3803,0); - if (spoiler_R2.getValue() < 1.5) { - me["spoiler2Rf"].show(); - } else { - me["spoiler2Rf"].hide(); - } - } else { - me["spoiler2Rex"].setColor(0.0509,0.7529,0.2941); - me["spoiler2Rrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler2Rf"].hide(); - } - - if (fbw.FBW.Failures.spoilerr3.getValue() or blue_psi < 1500) { - me["spoiler3Rex"].setColor(0.7333,0.3803,0); - me["spoiler3Rrt"].setColor(0.7333,0.3803,0); - if (spoiler_R3.getValue() < 1.5) { - me["spoiler3Rf"].show(); - } else { - me["spoiler3Rf"].hide(); - } - } else { - me["spoiler3Rex"].setColor(0.0509,0.7529,0.2941); - me["spoiler3Rrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler3Rf"].hide(); - } - - if (fbw.FBW.Failures.spoilerr4.getValue() or yellow_psi < 1500) { - me["spoiler4Rex"].setColor(0.7333,0.3803,0); - me["spoiler4Rrt"].setColor(0.7333,0.3803,0); - if (spoiler_R4.getValue() < 1.5) { - me["spoiler4Rf"].show(); - } else { - me["spoiler4Rf"].hide(); - } - } else { - me["spoiler4Rex"].setColor(0.0509,0.7529,0.2941); - me["spoiler4Rrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler4Rf"].hide(); - } - - if (fbw.FBW.Failures.spoilerr5.getValue() or green_psi < 1500) { - me["spoiler5Rex"].setColor(0.7333,0.3803,0); - me["spoiler5Rrt"].setColor(0.7333,0.3803,0); - if (spoiler_R5.getValue() < 1.5) { - me["spoiler5Rf"].show(); - } else { - me["spoiler5Rf"].hide(); - } - } else { - me["spoiler5Rex"].setColor(0.0509,0.7529,0.2941); - me["spoiler5Rrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler5Rf"].hide(); - } +}; \ No newline at end of file diff --git a/Models/Instruments/Lower-ECAM/res/crz.svg b/Models/Instruments/Lower-ECAM/res/crz.svg index a5626e87..6b0f58fe 100644 --- a/Models/Instruments/Lower-ECAM/res/crz.svg +++ b/Models/Instruments/Lower-ECAM/res/crz.svg @@ -12,7 +12,7 @@ viewBox="0 0 1024 1024" version="1.1" id="svg2" - inkscape:version="0.92.1 r15371" + inkscape:version="0.92.4 (5da689c313, 2019-01-14)" sodipodi:docname="crz.svg"> @@ -37,16 +37,16 @@ guidetolerance="10" inkscape:pageopacity="1" inkscape:pageshadow="2" - inkscape:window-width="1920" - inkscape:window-height="1047" + inkscape:window-width="1366" + inkscape:window-height="705" id="namedview371" showgrid="true" - inkscape:zoom="0.5" - inkscape:cx="703.8872" - inkscape:cy="827.31856" - inkscape:window-x="3840" - inkscape:window-y="33" - inkscape:window-maximized="0" + inkscape:zoom="0.35355339" + inkscape:cx="242.38307" + inkscape:cy="680.25272" + inkscape:window-x="-8" + inkscape:window-y="-8" + inkscape:window-maximized="1" inkscape:current-layer="svg2" inkscape:snap-nodes="false" inkscape:snap-global="false" @@ -298,13 +298,13 @@ 400 0.0 + sodipodi:role="line">0.2 0.0 + sodipodi:role="line">0.3 0.0 + sodipodi:role="line">0.1 0.0 + sodipodi:role="line">0.2 @@ -37,14 +37,14 @@ guidetolerance="10" inkscape:pageopacity="1" inkscape:pageshadow="2" - inkscape:window-width="1920" - inkscape:window-height="1030" + inkscape:window-width="1366" + inkscape:window-height="705" id="namedview371" showgrid="true" - inkscape:zoom="0.7521195" - inkscape:cx="944.15154" - inkscape:cy="187.23728" - inkscape:window-x="1592" + inkscape:zoom="0.35355339" + inkscape:cx="361.49345" + inkscape:cy="1842.4796" + inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" inkscape:current-layer="svg2"> @@ -81,8 +81,7 @@ style="font-style:normal;font-weight:normal;line-height:0%;font-family:'Liberation Sans';letter-spacing:0px;word-spacing:0px;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" x="500.75214" y="977.31793" - id="text6232" - sodipodi:linespacing="0%">120000 °C G.LOAD 0.6 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#bb6100;fill-opacity:1">G.LOAD 0.6 SLIDE + style="font-size:32px;line-height:1.25;fill:#cecdce;fill-opacity:1;">SLIDE SLIDE + style="font-size:32.86256409px;line-height:1.25;fill:#cecdce;fill-opacity:1;">SLIDE SLIDE + y="522.78827" + style="font-size:32.86256409px;line-height:1.25;fill:#cecdce;fill-opacity:1;">SLIDE SLIDE + style="font-size:32.86256409px;line-height:1.25;fill:#cecdce;fill-opacity:1;">SLIDE + inkscape:label="#path4438" + inkscape:connector-curvature="0" /> EMEREXIT EMEREXIT + inkscape:label="#path4464" + inkscape:connector-curvature="0" /> SLIDE + style="font-size:32px;line-height:1.25;fill:#cecdce;fill-opacity:1;">SLIDE SLIDE + style="font-size:32.86256409px;line-height:1.25;fill:#cecdce;fill-opacity:1;">SLIDE OXY + x="852.17371" + y="64.937149" + style="font-size:30.04751396px;line-height:0;fill:#cecdce;fill-opacity:1;stroke-width:2.50395942px;">CKPT OXY REGUL LO PR + x="799.85938" + y="133.49768" + style="font-size:30.04800034px;line-height:0">REGUL LO PR 1300 PSI + x="953.60229" + y="100.29736" + style="font-size:30px;line-height:0">PSI + transform="translate(12.944435,6.250187)"> V/S 1650 FT/MIN - - - + id="DOOR-VS-Arrow-DN" /> - - - + id="DOOR-VS-Arrow-UP" /> From 06175c85413aa5d89a4796e2619079012b9ab46d Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Fri, 16 Jul 2021 20:49:01 +0100 Subject: [PATCH 79/96] FCTL, misc improvements --- .../Lower-ECAM/Lower-ECAM-cruise.nas | 34 +- .../Lower-ECAM/Lower-ECAM-fctl.nas | 472 +++++++++++++++++- .../Instruments/Lower-ECAM/Lower-ECAM-old.nas | 389 +-------------- Models/Instruments/Lower-ECAM/res/crz.svg | 22 +- Models/Instruments/Lower-ECAM/res/door.svg | 12 +- Models/Instruments/Lower-ECAM/res/fctl.svg | 177 +++---- Nasal/FBW/it-fbw.nas | 2 +- 7 files changed, 605 insertions(+), 503 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-cruise.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-cruise.nas index 4b931bca..23445844 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-cruise.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-cruise.nas @@ -84,6 +84,12 @@ var canvas_lowerECAMPageCruise = } else { obj["deltaPSI"].setText(sprintf("%2.1f", val)); } + + if (val < -0.4 or val > 8.5) { + obj["deltaPSI"].setColor(0.7333,0.3803,0); + } else { + obj["deltaPSI"].setColor(0.0509,0.7529,0.2941); + } }), props.UpdateManager.FromHashValue("pressVS", 25, func(val) { if (val > 9950) { @@ -93,6 +99,32 @@ var canvas_lowerECAMPageCruise = } else { obj["CABVS"].setText(sprintf("%-4.0f", math.round(val,50))); } + + if (val >= 25) { + obj["VS-Arrow-UP"].show(); + obj["VS-Arrow-DN"].hide(); + } elsif (val <= -25) { + obj["VS-Arrow-UP"].hide(); + obj["VS-Arrow-DN"].show(); + } else { + obj["VS-Arrow-UP"].hide(); + obj["VS-Arrow-DN"].hide(); + } + }), + props.UpdateManager.FromHashValue("pressAlt", 25, func(val) { + if (val > 32750) { + obj["CABALT"].setText(sprintf("%5.0f", 32750)); + } else if (val < -9950) { + obj["CABALT"].setText(sprintf("%5.0f", -9950)); + } else { + obj["CABALT"].setText(sprintf("%5.0f", math.round(val,50))); + } + + if (val > 9550) { + obj["CABALT"].setColor(1,0,0); + } else { + obj["CABALT"].setColor(0.0509,0.7529,0.2941); + } }), props.UpdateManager.FromHashValue("condTempCockpit", 0.5, func(val) { obj["CKPT-TEMP"].setText(sprintf("%2.0f",val)); @@ -142,7 +174,7 @@ var canvas_lowerECAMPageCruise = return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; }, getKeys: func() { - return["Oil1","Oil2","FUsed1","FUsed2","FUsed","VIB1N1","VIB1N2","VIB2N1","VIB2N2","deltaPSI","LDGELEV-AUTO","LDGELEV","CABVS","CABALT","VS-Arrow-UP","VS-Arrow-DN","CKPT-TEMP","FWD-TEMP","AFT-TEMP","Fused-weight-unit"]; + return["Oil1","Oil2","OilUnit","FUsed1","FUsed2","FUsed","VIB1N1","VIB1N2","VIB2N1","VIB2N2","deltaPSI","LDGELEV-AUTO","LDGELEV","CABVS","CABALT","VS-Arrow-UP","VS-Arrow-DN","CKPT-TEMP","FWD-TEMP","AFT-TEMP","Fused-weight-unit"]; }, updateBottom: func(notification) { foreach(var update_item_bottom; me.updateItemsBottom) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-fctl.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-fctl.nas index e29125f1..931d2a65 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-fctl.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-fctl.nas @@ -23,6 +23,447 @@ var canvas_lowerECAMPageFctl = # init obj.update_items = [ + props.UpdateManager.FromHashList(["green","elac1","elac2","sec2"], nil, func(val) { + if (val.green >= 1450) { + if (val.elac2 or val.sec2) { + obj["elevLgreen"].setColor(0.0509,0.7529,0.2941); + } else { + obj["elevLgreen"].setColor(0.7333,0.3803,0); + } + + if (val.elac2) { + obj["ailLgreen"].setColor(0.0509,0.7529,0.2941); + } else { + obj["ailLgreen"].setColor(0.7333,0.3803,0); + } + if (val.elac1) { + obj["ailRgreen"].setColor(0.0509,0.7529,0.2941); + } else { + obj["ailRgreen"].setColor(0.7333,0.3803,0); + } + obj["ruddergreen"].setColor(0.0509,0.7529,0.2941); + obj["PTgreen"].setColor(0.0509,0.7529,0.2941); + obj["spdbrkgreen"].setColor(0.0509,0.7529,0.2941); + } else { + obj["ailLgreen"].setColor(0.7333,0.3803,0); + obj["ailRgreen"].setColor(0.7333,0.3803,0); + obj["elevLgreen"].setColor(0.7333,0.3803,0); + obj["ruddergreen"].setColor(0.7333,0.3803,0); + obj["PTgreen"].setColor(0.7333,0.3803,0); + obj["spdbrkgreen"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashList(["yellow","elac2","sec2"], nil, func(val) { + if (val.yellow >= 1450) { + if (val.elac2 or val.sec2) { + obj["elevRyellow"].setColor(0.0509,0.7529,0.2941); + } else { + obj["elevRyellow"].setColor(0.7333,0.3803,0); + } + obj["rudderyellow"].setColor(0.0509,0.7529,0.2941); + obj["PTyellow"].setColor(0.0509,0.7529,0.2941); + obj["spdbrkyellow"].setColor(0.0509,0.7529,0.2941); + } else { + obj["elevRyellow"].setColor(0.7333,0.3803,0); + obj["rudderyellow"].setColor(0.7333,0.3803,0); + obj["PTyellow"].setColor(0.7333,0.3803,0); + obj["spdbrkyellow"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashList(["blue","elac1","elac2","sec1"], nil, func(val) { + if (val.blue >= 1500) { + if (val.elac1) { + obj["ailLblue"].setColor(0.0509,0.7529,0.2941); + } else { + obj["ailLblue"].setColor(0.7333,0.3803,0); + } + if (val.elac1 or val.sec1) { + obj["elevLblue"].setColor(0.0509,0.7529,0.2941); + obj["elevRblue"].setColor(0.0509,0.7529,0.2941); + } else { + obj["elevLblue"].setColor(0.7333,0.3803,0); + obj["elevRblue"].setColor(0.7333,0.3803,0); + } + if (val.elac2) { + obj["ailRblue"].setColor(0.0509,0.7529,0.2941); + } else { + obj["ailRblue"].setColor(0.7333,0.3803,0); + } + obj["rudderblue"].setColor(0.0509,0.7529,0.2941); + obj["spdbrkblue"].setColor(0.0509,0.7529,0.2941); + } else { + obj["ailLblue"].setColor(0.7333,0.3803,0); + obj["ailRblue"].setColor(0.7333,0.3803,0); + obj["elevLblue"].setColor(0.7333,0.3803,0); + obj["elevRblue"].setColor(0.7333,0.3803,0); + obj["rudderblue"].setColor(0.7333,0.3803,0); + obj["spdbrkblue"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("fctlAilL", 0.001, func(val) { + obj["ailL"].setTranslation(0, val * 100); + }), + props.UpdateManager.FromHashValue("fctlAilR", 0.001, func(val) { + obj["ailR"].setTranslation(0, val * -100); + }), + props.UpdateManager.FromHashList(["blue","green","elac1","elac2"], nil, func(val) { + if ((val.blue < 1500 or !val.elac1) and (val.green < 1500 or !val.elac2)) { + obj["ailL"].setColor(0.7333,0.3803,0); + } else { + obj["ailL"].setColor(0.0509,0.7529,0.2941); + } + if ((val.green < 1500 or !val.elac1) and (val.blue < 1500 or !val.elac2)) { + obj["ailR"].setColor(0.7333,0.3803,0); + } else { + obj["ailR"].setColor(0.0509,0.7529,0.2941); + } + }), + props.UpdateManager.FromHashValue("fctlElevL", 0.001, func(val) { + obj["elevL"].setTranslation(0, val * 100); + }), + props.UpdateManager.FromHashValue("fctlElevR", 0.001, func(val) { + obj["elevR"].setTranslation(0, val * 100); + }), + props.UpdateManager.FromHashList(["blue","green","yellow","elac1","elac2","sec1","sec2"], nil, func(val) { + if ((val.blue < 1500 or (!val.elac1 and !val.sec1)) and (val.green < 1500 or (!val.elac2 and !val.sec2))) { + obj["elevL"].setColor(0.7333,0.3803,0); + } else { + obj["elevL"].setColor(0.0509,0.7529,0.2941); + } + + if ((val.blue < 1500 or (!val.elac1 and !val.sec1)) and (val.yellow < 1500 or (!val.elac2 and !val.sec2))) { + obj["elevR"].setColor(0.7333,0.3803,0); + } else { + obj["elevR"].setColor(0.0509,0.7529,0.2941); + } + }), + props.UpdateManager.FromHashValue("fctlElevTrim", 0.01, func(val) { + obj["PT"].setText(sprintf("%2.1f", val)); + if (val >= 0.09) { + obj["PTupdn"].setText("UP"); + obj["PTupdn"].show(); + } elsif (val <= -0.09) { + obj["PTupdn"].setText("DN"); + obj["PTupdn"].show(); + } else { + obj["PTupdn"].hide(); + } + }), + props.UpdateManager.FromHashValue("elac1", nil, func(val) { + if (val) { + obj["elac1"].setColor(0.0509,0.7529,0.2941); + obj["path4249"].setColor(0.0509,0.7529,0.2941); + } else { + obj["elac1"].setColor(0.7333,0.3803,0); + obj["path4249"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("elac2", nil, func(val) { + if (val) { + obj["elac2"].setColor(0.0509,0.7529,0.2941); + obj["path4249-3"].setColor(0.0509,0.7529,0.2941); + } else { + obj["elac2"].setColor(0.7333,0.3803,0); + obj["path4249-3"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("sec1", nil, func(val) { + if (val) { + obj["sec1"].setColor(0.0509,0.7529,0.2941); + obj["path4249-3-6-7"].setColor(0.0509,0.7529,0.2941); + } else { + obj["sec1"].setColor(0.7333,0.3803,0); + obj["path4249-3-6-7"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("sec2", nil, func(val) { + if (val) { + obj["sec2"].setColor(0.0509,0.7529,0.2941); + obj["path4249-3-6-7-5"].setColor(0.0509,0.7529,0.2941); + } else { + obj["sec2"].setColor(0.7333,0.3803,0); + obj["path4249-3-6-7-5"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("sec3", nil, func(val) { + if (val) { + obj["sec3"].setColor(0.0509,0.7529,0.2941); + obj["path4249-3-6"].setColor(0.0509,0.7529,0.2941); + } else { + obj["sec3"].setColor(0.7333,0.3803,0); + obj["path4249-3-6"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashList(["blue","yellow","green"], 25, func(val) { + if (val.green < 1500 and val.yellow < 1500) { + obj["PT"].setColor(0.7333,0.3803,0); + obj["PTupdn"].setColor(0.7333,0.3803,0); + obj["PTcc"].setColor(0.7333,0.3803,0); + } else { + obj["PT"].setColor(0.0509,0.7529,0.2941); + obj["PTupdn"].setColor(0.0509,0.7529,0.2941); + obj["PTcc"].setColor(0.0901,0.6039,0.7176); + } + + if (val.blue < 1500 and val.yellow < 1500 and val.green < 1500) { + obj["rudder"].setColor(0.7333,0.3803,0); + } else { + obj["rudder"].setColor(0.0509,0.7529,0.2941); + } + }), + props.UpdateManager.FromHashValue("fctlRudder", 0.001, func(val) { + obj["rudder"].setRotation(val * -0.024); + }), + props.UpdateManager.FromHashValue("fctlRudderTrim", 0.01, func(val) { + obj["rudderTrimInd"].setRotation(val * -0.024); + }), + props.UpdateManager.FromHashValue("fctlTHSJam", nil, func(val) { + if (val) { + obj["pitchTrimStatus"].setColor(0.7333,0.3803,0); + } else { + obj["pitchTrimStatus"].setColor(0.8078,0.8039,0.8078); + } + }), + props.UpdateManager.FromHashValue("spoilerL1", 0.5, func(val) { + if (val < 1.5) { + obj["spoiler1Lex"].hide(); + obj["spoiler1Lrt"].show(); + } else { + obj["spoiler1Lrt"].hide(); + obj["spoiler1Lex"].show(); + } + }), + props.UpdateManager.FromHashValue("spoilerL2", 0.5, func(val) { + if (val < 1.5) { + obj["spoiler2Lex"].hide(); + obj["spoiler2Lrt"].show(); + } else { + obj["spoiler2Lrt"].hide(); + obj["spoiler2Lex"].show(); + } + }), + props.UpdateManager.FromHashValue("spoilerL3", 0.5, func(val) { + if (val < 1.5) { + obj["spoiler3Lex"].hide(); + obj["spoiler3Lrt"].show(); + } else { + obj["spoiler3Lrt"].hide(); + obj["spoiler3Lex"].show(); + } + }), + props.UpdateManager.FromHashValue("spoilerL4", 0.5, func(val) { + if (val < 1.5) { + obj["spoiler4Lex"].hide(); + obj["spoiler4Lrt"].show(); + } else { + obj["spoiler4Lrt"].hide(); + obj["spoiler4Lex"].show(); + } + }), + props.UpdateManager.FromHashValue("spoilerL5", 0.5, func(val) { + if (val < 1.5) { + obj["spoiler5Lex"].hide(); + obj["spoiler5Lrt"].show(); + } else { + obj["spoiler5Lrt"].hide(); + obj["spoiler5Lex"].show(); + } + }), + props.UpdateManager.FromHashValue("spoilerR1", 0.5, func(val) { + if (val < 1.5) { + obj["spoiler1Rex"].hide(); + obj["spoiler1Rrt"].show(); + } else { + obj["spoiler1Rrt"].hide(); + obj["spoiler1Rex"].show(); + } + }), + props.UpdateManager.FromHashValue("spoilerR2", 0.5, func(val) { + if (val < 1.5) { + obj["spoiler2Rex"].hide(); + obj["spoiler2Rrt"].show(); + } else { + obj["spoiler2Rrt"].hide(); + obj["spoiler2Rex"].show(); + } + }), + props.UpdateManager.FromHashValue("spoilerR3", 0.5, func(val) { + if (val < 1.5) { + obj["spoiler3Rex"].hide(); + obj["spoiler3Rrt"].show(); + } else { + obj["spoiler3Rrt"].hide(); + obj["spoiler3Rex"].show(); + } + }), + props.UpdateManager.FromHashValue("spoilerR4", 0.5, func(val) { + if (val < 1.5) { + obj["spoiler4Rex"].hide(); + obj["spoiler4Rrt"].show(); + } else { + obj["spoiler4Rrt"].hide(); + obj["spoiler4Rex"].show(); + } + }), + props.UpdateManager.FromHashValue("spoilerR5", 0.5, func(val) { + if (val < 1.5) { + obj["spoiler5Rex"].hide(); + obj["spoiler5Rrt"].show(); + } else { + obj["spoiler5Rrt"].hide(); + obj["spoiler5Rex"].show(); + } + }), + props.UpdateManager.FromHashList(["spoilerL1Failure","spoilerL1","green"], nil, func(val) { + if (val.spoilerL1Failure or val.green < 1500) { + obj["spoiler1Lex"].setColor(0.7333,0.3803,0); + obj["spoiler1Lrt"].setColor(0.7333,0.3803,0); + if (val.spoilerL1 < 1.5) { + obj["spoiler1Lf"].show(); + } else { + obj["spoiler1Lf"].hide(); + } + } else { + obj["spoiler1Lex"].setColor(0.0509,0.7529,0.2941); + obj["spoiler1Lrt"].setColor(0.0509,0.7529,0.2941); + obj["spoiler1Lf"].hide(); + } + }), + props.UpdateManager.FromHashList(["spoilerL2Failure","spoilerL2","yellow"], nil, func(val) { + if (val.spoilerL2Failure or val.yellow < 1500) { + obj["spoiler2Lex"].setColor(0.7333,0.3803,0); + obj["spoiler2Lrt"].setColor(0.7333,0.3803,0); + if (val.spoilerL2 < 1.5) { + obj["spoiler2Lf"].show(); + } else { + obj["spoiler2Lf"].hide(); + } + } else { + obj["spoiler2Lex"].setColor(0.0509,0.7529,0.2941); + obj["spoiler2Lrt"].setColor(0.0509,0.7529,0.2941); + obj["spoiler2Lf"].hide(); + } + }), + props.UpdateManager.FromHashList(["spoilerL3Failure","spoilerL3","blue"], nil, func(val) { + if (val.spoilerL3Failure or val.blue < 1500) { + obj["spoiler3Lex"].setColor(0.7333,0.3803,0); + obj["spoiler3Lrt"].setColor(0.7333,0.3803,0); + if (val.spoilerL3 < 1.5) { + obj["spoiler3Lf"].show(); + } else { + obj["spoiler3Lf"].hide(); + } + } else { + obj["spoiler3Lex"].setColor(0.0509,0.7529,0.2941); + obj["spoiler3Lrt"].setColor(0.0509,0.7529,0.2941); + obj["spoiler3Lf"].hide(); + } + }), + props.UpdateManager.FromHashList(["spoilerL4Failure","spoilerL4","yellow"], nil, func(val) { + if (val.spoilerL4Failure or val.yellow < 1500) { + obj["spoiler4Lex"].setColor(0.7333,0.3803,0); + obj["spoiler4Lrt"].setColor(0.7333,0.3803,0); + if (val.spoilerL4 < 1.5) { + obj["spoiler4Lf"].show(); + } else { + obj["spoiler4Lf"].hide(); + } + } else { + obj["spoiler4Lex"].setColor(0.0509,0.7529,0.2941); + obj["spoiler4Lrt"].setColor(0.0509,0.7529,0.2941); + obj["spoiler4Lf"].hide(); + } + }), + props.UpdateManager.FromHashList(["spoilerL5Failure","spoilerL5","green"], nil, func(val) { + if (val.spoilerL5Failure or val.green < 1500) { + obj["spoiler5Lex"].setColor(0.7333,0.3803,0); + obj["spoiler5Lrt"].setColor(0.7333,0.3803,0); + if (val.spoilerL5 < 1.5) { + obj["spoiler5Lf"].show(); + } else { + obj["spoiler5Lf"].hide(); + } + } else { + obj["spoiler5Lex"].setColor(0.0509,0.7529,0.2941); + obj["spoiler5Lrt"].setColor(0.0509,0.7529,0.2941); + obj["spoiler5Lf"].hide(); + } + }), + props.UpdateManager.FromHashList(["spoilerR1Failure","spoilerR1","green"], nil, func(val) { + if (val.spoilerR1Failure or val.green < 1500) { + obj["spoiler1Rex"].setColor(0.7333,0.3803,0); + obj["spoiler1Rrt"].setColor(0.7333,0.3803,0); + if (val.spoilerR1 < 1.5) { + obj["spoiler1Rf"].show(); + } else { + obj["spoiler1Rf"].hide(); + } + } else { + obj["spoiler1Rex"].setColor(0.0509,0.7529,0.2941); + obj["spoiler1Rrt"].setColor(0.0509,0.7529,0.2941); + obj["spoiler1Rf"].hide(); + } + }), + props.UpdateManager.FromHashList(["spoilerR2Failure","spoilerR2","yellow"], nil, func(val) { + if (val.spoilerR2Failure or val.yellow < 1500) { + obj["spoiler2Rex"].setColor(0.7333,0.3803,0); + obj["spoiler2Rrt"].setColor(0.7333,0.3803,0); + if (val.spoilerR2 < 1.5) { + obj["spoiler2Rf"].show(); + } else { + obj["spoiler2Rf"].hide(); + } + } else { + obj["spoiler2Rex"].setColor(0.0509,0.7529,0.2941); + obj["spoiler2Rrt"].setColor(0.0509,0.7529,0.2941); + obj["spoiler2Rf"].hide(); + } + }), + props.UpdateManager.FromHashList(["spoilerR3Failure","spoilerR3","blue"], nil, func(val) { + if (val.spoilerR3Failure or val.blue < 1500) { + obj["spoiler3Rex"].setColor(0.7333,0.3803,0); + obj["spoiler3Rrt"].setColor(0.7333,0.3803,0); + if (val.spoilerR3 < 1.5) { + obj["spoiler3Rf"].show(); + } else { + obj["spoiler3Rf"].hide(); + } + } else { + obj["spoiler3Rex"].setColor(0.0509,0.7529,0.2941); + obj["spoiler3Rrt"].setColor(0.0509,0.7529,0.2941); + obj["spoiler3Rf"].hide(); + } + }), + props.UpdateManager.FromHashList(["spoilerR4Failure","spoilerR4","yellow"], nil, func(val) { + if (val.spoilerR4Failure or val.yellow < 1500) { + obj["spoiler4Rex"].setColor(0.7333,0.3803,0); + obj["spoiler4Rrt"].setColor(0.7333,0.3803,0); + if (val.spoilerR4 < 1.5) { + obj["spoiler4Rf"].show(); + } else { + obj["spoiler4Rf"].hide(); + } + } else { + obj["spoiler4Rex"].setColor(0.0509,0.7529,0.2941); + obj["spoiler4Rrt"].setColor(0.0509,0.7529,0.2941); + obj["spoiler4Rf"].hide(); + } + }), + props.UpdateManager.FromHashList(["spoilerR5Failure","spoilerR5","green"], nil, func(val) { + if (val.spoilerR5Failure or val.green < 1500) { + obj["spoiler5Rex"].setColor(0.7333,0.3803,0); + obj["spoiler5Rrt"].setColor(0.7333,0.3803,0); + if (val.spoilerR5 < 1.5) { + obj["spoiler5Rf"].show(); + } else { + obj["spoiler5Rf"].hide(); + } + } else { + obj["spoiler5Rex"].setColor(0.0509,0.7529,0.2941); + obj["spoiler5Rrt"].setColor(0.0509,0.7529,0.2941); + obj["spoiler5Rf"].hide(); + } + }), ]; obj.displayedGForce = 0; @@ -62,10 +503,11 @@ var canvas_lowerECAMPageFctl = return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; }, getKeys: func() { - return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", - "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", - "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", - "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + return["ailL","ailR","elevL","elevR","PTcc","PT","PTupdn","elac1","elac2","sec1","sec2","sec3","ailLblue","ailRblue","elevLblue","elevRblue","rudderblue","ailLgreen","ailRgreen","elevLgreen","ruddergreen","PTgreen", + "elevRyellow","rudderyellow","PTyellow","rudder","spdbrkblue","spdbrkgreen","spdbrkyellow","spoiler1Rex","spoiler1Rrt","spoiler2Rex","spoiler2Rrt","spoiler3Rex","spoiler3Rrt","spoiler4Rex","spoiler4Rrt","spoiler5Rex","spoiler5Rrt","spoiler1Lex", + "spoiler1Lrt","spoiler2Lex","spoiler2Lrt","spoiler3Lex","spoiler3Lrt","spoiler4Lex","spoiler4Lrt","spoiler5Lex","spoiler5Lrt","spoiler1Rf","spoiler2Rf","spoiler3Rf","spoiler4Rf","spoiler5Rf","spoiler1Lf","spoiler2Lf","spoiler3Lf","spoiler4Lf", + "spoiler5Lf","ailLscale","ailRscale","path4249","path4249-3","path4249-3-6-7","path4249-3-6-7-5","path4249-3-6","pitchTrimStatus","rudderTrimInd"]; + }, updateBottom: func(notification) { foreach(var update_item_bottom; me.updateItemsBottom) { @@ -140,6 +582,28 @@ var canvas_lowerECAMPageFctl = }; var input = { + elac1: "/systems/fctl/elac1", + elac2: "/systems/fctl/elac2", + elac1Fail: "/systems/failures/fctl/elac1", + elac2Fail: "/systems/failures/fctl/elac2", + sec1: "/systems/fctl/sec1", + sec2: "/systems/fctl/sec2", + sec3: "/systems/fctl/sec3", + sec1Fail: "/systems/failures/fctl/sec1", + sec2Fail: "/systems/failures/fctl/sec2", + sec3Fail: "/systems/failures/fctl/sec3", + fac1: "/systems/fctl/fac1-healthy-signal", + fac2: "/systems/fctl/fac2-healthy-signal", + fac1Fail: "/systems/failures/fctl/fac1", + fac2Fail: "/systems/failures/fctl/fac2", + fctlAilL: "/ECAM/Lower/aileron-ind-left", + fctlAilR: "/ECAM/Lower/aileron-ind-right", + fctlElevL: "/ECAM/Lower/elevator-ind-left", + fctlElevR: "/ECAM/Lower/elevator-ind-right", + fctlElevTrim: "/ECAM/Lower/elevator-trim-deg", + fctlRudder: "/fdm/jsbsim/hydraulics/rudder/final-deg", + fctlRudderTrim: "/fdm/jsbsim/hydraulics/rudder/trim-deg", + fctlTHSJam: "/systems/failures/fctl/ths-jam", }; foreach (var name; keys(input)) { diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas index 251a7ddd..64dbbd05 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas @@ -67,12 +67,12 @@ var oil_qt2 = props.globals.getNode("/ECAM/Lower/Oil-QT[1]", 1); var oil_psi1 = props.globals.getNode("/ECAM/Lower/Oil-PSI[0]", 1); var oil_psi2 = props.globals.getNode("/ECAM/Lower/Oil-PSI[1]", 1); var bleedapu = props.globals.getNode("", 1); -var aileron_ind_left = props.globals.getNode("/ECAM/Lower/aileron-ind-left", 1); +var aileron_ind_left = props.globals.getNode("", 1); var aileron_ind_right = props.globals.getNode("/ECAM/Lower/aileron-ind-right", 1); -var elevator_ind_left = props.globals.getNode("/ECAM/Lower/elevator-ind-left", 1); +var elevator_ind_left = props.globals.getNode("", 1); var elevator_ind_right = props.globals.getNode("/ECAM/Lower/elevator-ind-right", 1); -var elevator_trim_deg = props.globals.getNode("/ECAM/Lower/elevator-trim-deg", 1); -var final_deg = props.globals.getNode("/fdm/jsbsim/hydraulics/rudder/final-deg", 1); +var elevator_trim_deg = props.globals.getNode("", 1); +var final_deg = props.globals.getNode("", 1); var temperature_degc = props.globals.getNode("/environment/temperature-degc", 1); var tank3_content_lbs = props.globals.getNode("/fdm/jsbsim/propulsion/tank[2]/contents-lbs", 1); var ir2_knob = props.globals.getNode("/controls/adirs/ir[1]/knob", 1); @@ -1487,318 +1487,16 @@ var canvas_lowerECAM_eng = { }, }; -var canvas_lowerECAM_fctl = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_fctl, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","ailL","ailR","elevL","elevR","PTcc","PT","PTupdn","elac1","elac2","sec1","sec2","sec3","ailLblue","ailRblue","elevLblue","elevRblue","rudderblue","ailLgreen","ailRgreen","elevLgreen","ruddergreen","PTgreen", - "elevRyellow","rudderyellow","PTyellow","rudder","spdbrkblue","spdbrkgreen","spdbrkyellow","spoiler1Rex","spoiler1Rrt","spoiler2Rex","spoiler2Rrt","spoiler3Rex","spoiler3Rrt","spoiler4Rex","spoiler4Rrt","spoiler5Rex","spoiler5Rrt","spoiler1Lex", - "spoiler1Lrt","spoiler2Lex","spoiler2Lrt","spoiler3Lex","spoiler3Lrt","spoiler4Lex","spoiler4Lrt","spoiler5Lex","spoiler5Lrt","spoiler1Rf","spoiler2Rf","spoiler3Rf","spoiler4Rf","spoiler5Rf","spoiler1Lf","spoiler2Lf","spoiler3Lf","spoiler4Lf", - "spoiler5Lf","ailLscale","ailRscale","path4249","path4249-3","path4249-3-6-7","path4249-3-6-7-5","path4249-3-6","text4343"]; - }, - update: func() { - blue_psi = systems.HYD.Psi.blue.getValue(); - green_psi = systems.HYD.Psi.green.getValue(); - yellow_psi = systems.HYD.Psi.yellow.getValue(); - elac1Node = fbw.FBW.Computers.elac1.getValue(); - elac2Node = fbw.FBW.Computers.elac2.getValue(); - sec1Node = fbw.FBW.Computers.sec1.getValue(); - sec2Node = fbw.FBW.Computers.sec2.getValue(); - - # Pitch Trim - me["PT"].setText(sprintf("%2.1f", math.round(elevator_trim_deg.getValue(), 0.1))); - - if (math.round(elevator_trim_deg.getValue(), 0.1) >= 0) { - me["PTupdn"].setText(sprintf("UP")); - } else if (math.round(elevator_trim_deg.getValue(), 0.1) < 0) { - me["PTupdn"].setText(sprintf("DN")); - } - - if (green_psi < 1500 and yellow_psi < 1500) { - me["PT"].setColor(0.7333,0.3803,0); - me["PTupdn"].setColor(0.7333,0.3803,0); - me["PTcc"].setColor(0.7333,0.3803,0); - } else { - me["PT"].setColor(0.0509,0.7529,0.2941); - me["PTupdn"].setColor(0.0509,0.7529,0.2941); - me["PTcc"].setColor(0.0509,0.7529,0.2941); - } - if (fbw.FBW.Failures.ths.getBoolValue()) { - me["text4343"].setColor(0.7333,0.3803,0); - } else { - me["text4343"].setColor(0.8078,0.8039,0.8078); - } - - # Ailerons - me["ailL"].setTranslation(0, aileron_ind_left.getValue() * 100); - me["ailR"].setTranslation(0, aileron_ind_right.getValue() * (-100)); - - if ((blue_psi < 1500 or !elac1Node) and (green_psi < 1500 or !elac2Node)) { - me["ailL"].setColor(0.7333,0.3803,0); - } else { - me["ailL"].setColor(0.0509,0.7529,0.2941); - } - if ((green_psi < 1500 or !elac1Node) and (blue_psi < 1500 or !elac2Node)) { - me["ailR"].setColor(0.7333,0.3803,0); - } else { - me["ailR"].setColor(0.0509,0.7529,0.2941); - } # Elevators - me["elevL"].setTranslation(0, elevator_ind_left.getValue() * 100); - me["elevR"].setTranslation(0, elevator_ind_right.getValue() * 100); - - if ((blue_psi < 1500 or (!elac1Node and !sec1Node)) and (green_psi < 1500 or (!elac2Node and !sec2Node))) { - me["elevL"].setColor(0.7333,0.3803,0); - } else { - me["elevL"].setColor(0.0509,0.7529,0.2941); - } - - if ((blue_psi < 1500 or (!elac1Node and !sec1Node)) and (yellow_psi < 1500 or (!elac2Node and !sec2Node))) { - me["elevR"].setColor(0.7333,0.3803,0); - } else { - me["elevR"].setColor(0.0509,0.7529,0.2941); - } - - # Rudder - me["rudder"].setRotation(final_deg.getValue() * -0.024); - - if (blue_psi < 1500 and yellow_psi < 1500 and green_psi < 1500) { - me["rudder"].setColor(0.7333,0.3803,0); - } else { - me["rudder"].setColor(0.0509,0.7529,0.2941); - } - - # Spoilers - if (spoiler_L1.getValue() < 1.5) { - - } else { - - } - - if (spoiler_L2.getValue() < 1.5) { - me["spoiler2Lex"].hide(); - me["spoiler2Lrt"].show(); - } else { - me["spoiler2Lrt"].hide(); - me["spoiler2Lex"].show(); - } - - if (spoiler_L3.getValue() < 1.5) { - me["spoiler3Lex"].hide(); - me["spoiler3Lrt"].show(); - } else { - me["spoiler3Lrt"].hide(); - me["spoiler3Lex"].show(); - } - - if (spoiler_L4.getValue() < 1.5) { - me["spoiler4Lex"].hide(); - me["spoiler4Lrt"].show(); - } else { - me["spoiler4Lrt"].hide(); - me["spoiler4Lex"].show(); - } - - if (spoiler_L5.getValue() < 1.5) { - me["spoiler5Lex"].hide(); - me["spoiler5Lrt"].show(); - } else { - me["spoiler5Lrt"].hide(); - me["spoiler5Lex"].show(); - } - - if (spoiler_R1.getValue() < 1.5) { - me["spoiler1Rex"].hide(); - me["spoiler1Rrt"].show(); - } else { - me["spoiler1Rrt"].hide(); - me["spoiler1Rex"].show(); - } - - if (spoiler_R2.getValue() < 1.5) { - me["spoiler2Rex"].hide(); - me["spoiler2Rrt"].show(); - } else { - me["spoiler2Rrt"].hide(); - me["spoiler2Rex"].show(); - } - - if (spoiler_R3.getValue() < 1.5) { - me["spoiler3Rex"].hide(); - me["spoiler3Rrt"].show(); - } else { - me["spoiler3Rrt"].hide(); - me["spoiler3Rex"].show(); - } - - if (spoiler_R4.getValue() < 1.5) { - me["spoiler4Rex"].hide(); - me["spoiler4Rrt"].show(); - } else { - me["spoiler4Rrt"].hide(); - me["spoiler4Rex"].show(); - } - - if (spoiler_R5.getValue() < 1.5) { - me["spoiler5Rex"].hide(); - me["spoiler5Rrt"].show(); - } else { - me["spoiler5Rrt"].hide(); - me["spoiler5Rex"].show(); - } - - # Spoiler Fail - if (fbw.FBW.Failures.spoilerl1.getValue() or green_psi < 1500) { - me["spoiler1Lex"].setColor(0.7333,0.3803,0); - me["spoiler1Lrt"].setColor(0.7333,0.3803,0); - if (spoiler_L1.getValue() < 1.5) { - me["spoiler1Lf"].show(); - } else { - me["spoiler1Lf"].hide(); - } - } else { - me["spoiler1Lex"].setColor(0.0509,0.7529,0.2941); - me["spoiler1Lrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler1Lf"].hide(); - } - - if (fbw.FBW.Failures.spoilerl2.getValue() or yellow_psi < 1500) { - me["spoiler2Lex"].setColor(0.7333,0.3803,0); - me["spoiler2Lrt"].setColor(0.7333,0.3803,0); - if (spoiler_L2.getValue() < 1.5) { - me["spoiler2Lf"].show(); - } else { - me["spoiler2Lf"].hide(); - } - } else { - me["spoiler2Lex"].setColor(0.0509,0.7529,0.2941); - me["spoiler2Lrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler2Lf"].hide(); - } - - if (fbw.FBW.Failures.spoilerl3.getValue() or blue_psi < 1500) { - me["spoiler3Lex"].setColor(0.7333,0.3803,0); - me["spoiler3Lrt"].setColor(0.7333,0.3803,0); - if (spoiler_L3.getValue() < 1.5) { - me["spoiler3Lf"].show(); - } else { - me["spoiler3Lf"].hide(); - } - } else { - me["spoiler3Lex"].setColor(0.0509,0.7529,0.2941); - me["spoiler3Lrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler3Lf"].hide(); - } - - if (fbw.FBW.Failures.spoilerl4.getValue() or yellow_psi < 1500) { - me["spoiler4Lex"].setColor(0.7333,0.3803,0); - me["spoiler4Lrt"].setColor(0.7333,0.3803,0); - if (spoiler_L4.getValue() < 1.5) { - me["spoiler4Lf"].show(); - } else { - me["spoiler4Lf"].hide(); - } - } else { - me["spoiler4Lex"].setColor(0.0509,0.7529,0.2941); - me["spoiler4Lrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler4Lf"].hide(); - } - - if (fbw.FBW.Failures.spoilerl5.getValue() or green_psi < 1500) { - me["spoiler5Lex"].setColor(0.7333,0.3803,0); - me["spoiler5Lrt"].setColor(0.7333,0.3803,0); - if (spoiler_L5.getValue() < 1.5) { - me["spoiler5Lf"].show(); - } else { - me["spoiler5Lf"].hide(); - } - } else { - me["spoiler5Lex"].setColor(0.0509,0.7529,0.2941); - me["spoiler5Lrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler5Lf"].hide(); - } - - if (fbw.FBW.Failures.spoilerr1.getValue() or green_psi < 1500) { - me["spoiler1Rex"].setColor(0.7333,0.3803,0); - me["spoiler1Rrt"].setColor(0.7333,0.3803,0); - if (spoiler_R1.getValue() < 1.5) { - me["spoiler1Rf"].show(); - } else { - me["spoiler1Rf"].hide(); - } - } else { - me["spoiler1Rex"].setColor(0.0509,0.7529,0.2941); - me["spoiler1Rrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler1Rf"].hide(); - } - - if (fbw.FBW.Failures.spoilerr2.getValue() or yellow_psi < 1500) { - me["spoiler2Rex"].setColor(0.7333,0.3803,0); - me["spoiler2Rrt"].setColor(0.7333,0.3803,0); - if (spoiler_R2.getValue() < 1.5) { - me["spoiler2Rf"].show(); - } else { - me["spoiler2Rf"].hide(); - } - } else { - me["spoiler2Rex"].setColor(0.0509,0.7529,0.2941); - me["spoiler2Rrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler2Rf"].hide(); - } - - if (fbw.FBW.Failures.spoilerr3.getValue() or blue_psi < 1500) { - me["spoiler3Rex"].setColor(0.7333,0.3803,0); - me["spoiler3Rrt"].setColor(0.7333,0.3803,0); - if (spoiler_R3.getValue() < 1.5) { - me["spoiler3Rf"].show(); - } else { - me["spoiler3Rf"].hide(); - } - } else { - me["spoiler3Rex"].setColor(0.0509,0.7529,0.2941); - me["spoiler3Rrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler3Rf"].hide(); - } - - if (fbw.FBW.Failures.spoilerr4.getValue() or yellow_psi < 1500) { - me["spoiler4Rex"].setColor(0.7333,0.3803,0); - me["spoiler4Rrt"].setColor(0.7333,0.3803,0); - if (spoiler_R4.getValue() < 1.5) { - me["spoiler4Rf"].show(); - } else { - me["spoiler4Rf"].hide(); - } - } else { - me["spoiler4Rex"].setColor(0.0509,0.7529,0.2941); - me["spoiler4Rrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler4Rf"].hide(); - } - - if (fbw.FBW.Failures.spoilerr5.getValue() or green_psi < 1500) { - me["spoiler5Rex"].setColor(0.7333,0.3803,0); - me["spoiler5Rrt"].setColor(0.7333,0.3803,0); - if (spoiler_R5.getValue() < 1.5) { - me["spoiler5Rf"].show(); - } else { - me["spoiler5Rf"].hide(); - } - } else { - me["spoiler5Rex"].setColor(0.0509,0.7529,0.2941); - me["spoiler5Rrt"].setColor(0.0509,0.7529,0.2941); - me["spoiler5Rf"].hide(); - } + # Flight Computers if (elac1Node) { me["elac1"].setColor(0.0509,0.7529,0.2941); - me["path4249"].setColor(0.0509,0.7529,0.2941); + me.setColor(0.0509,0.7529,0.2941); } else if (!elac1Node or fbw.FBW.Failures.elac1.getValue()) { me["elac1"].setColor(0.7333,0.3803,0); me["path4249"].setColor(0.7333,0.3803,0); @@ -1806,7 +1504,7 @@ var canvas_lowerECAM_fctl = { if (elac2Node) { me["elac2"].setColor(0.0509,0.7529,0.2941); - me["path4249-3"].setColor(0.0509,0.7529,0.2941); + me.setColor(0.0509,0.7529,0.2941); } else if (!elac2Node or fbw.FBW.Failures.elac2.getValue()) { me["elac2"].setColor(0.7333,0.3803,0); me["path4249-3"].setColor(0.7333,0.3803,0); @@ -1837,79 +1535,8 @@ var canvas_lowerECAM_fctl = { } # Hydraulic Indicators - if (blue_psi >= 1500) { - if (elac1Node) { - me["ailLblue"].setColor(0.0509,0.7529,0.2941); - } else { - me["ailLblue"].setColor(0.7333,0.3803,0); - } - if (elac1Node or sec1Node) { - me["elevLblue"].setColor(0.0509,0.7529,0.2941); - me["elevRblue"].setColor(0.0509,0.7529,0.2941); - } else { - me["elevLblue"].setColor(0.7333,0.3803,0); - me["elevRblue"].setColor(0.7333,0.3803,0); - } - if (elac2Node) { - me["ailRblue"].setColor(0.0509,0.7529,0.2941); - } else { - me["ailRblue"].setColor(0.7333,0.3803,0); - } - me["rudderblue"].setColor(0.0509,0.7529,0.2941); - me["spdbrkblue"].setColor(0.0509,0.7529,0.2941); - } else { - me["ailLblue"].setColor(0.7333,0.3803,0); - me["ailRblue"].setColor(0.7333,0.3803,0); - me["elevLblue"].setColor(0.7333,0.3803,0); - me["elevRblue"].setColor(0.7333,0.3803,0); - me["rudderblue"].setColor(0.7333,0.3803,0); - me["spdbrkblue"].setColor(0.7333,0.3803,0); - } + - if (green_psi >= 1500) { - if (elac2Node or sec2Node) { - me["elevLgreen"].setColor(0.0509,0.7529,0.2941); - } else { - me["elevLgreen"].setColor(0.7333,0.3803,0); - } - - if (elac2Node) { - me["ailLgreen"].setColor(0.0509,0.7529,0.2941); - } else { - me["ailLgreen"].setColor(0.7333,0.3803,0); - } - if (elac1Node) { - me["ailRgreen"].setColor(0.0509,0.7529,0.2941); - } else { - me["ailRgreen"].setColor(0.7333,0.3803,0); - } - me["ruddergreen"].setColor(0.0509,0.7529,0.2941); - me["PTgreen"].setColor(0.0509,0.7529,0.2941); - me["spdbrkgreen"].setColor(0.0509,0.7529,0.2941); - } else { - me["ailLgreen"].setColor(0.7333,0.3803,0); - me["ailRgreen"].setColor(0.7333,0.3803,0); - me["elevLgreen"].setColor(0.7333,0.3803,0); - me["ruddergreen"].setColor(0.7333,0.3803,0); - me["PTgreen"].setColor(0.7333,0.3803,0); - me["spdbrkgreen"].setColor(0.7333,0.3803,0); - } - - if (yellow_psi >= 1500) { - if (elac2Node or sec2Node) { - me["elevRyellow"].setColor(0.0509,0.7529,0.2941); - } else { - me["elevRyellow"].setColor(0.7333,0.3803,0); - } - me["rudderyellow"].setColor(0.0509,0.7529,0.2941); - me["PTyellow"].setColor(0.0509,0.7529,0.2941); - me["spdbrkyellow"].setColor(0.0509,0.7529,0.2941); - } else { - me["elevRyellow"].setColor(0.7333,0.3803,0); - me["rudderyellow"].setColor(0.7333,0.3803,0); - me["PTyellow"].setColor(0.7333,0.3803,0); - me["spdbrkyellow"].setColor(0.7333,0.3803,0); - } me.updateBottomStatus(); }, diff --git a/Models/Instruments/Lower-ECAM/res/crz.svg b/Models/Instruments/Lower-ECAM/res/crz.svg index 6b0f58fe..bfc066bb 100644 --- a/Models/Instruments/Lower-ECAM/res/crz.svg +++ b/Models/Instruments/Lower-ECAM/res/crz.svg @@ -41,9 +41,9 @@ inkscape:window-height="705" id="namedview371" showgrid="true" - inkscape:zoom="0.35355339" - inkscape:cx="242.38307" - inkscape:cy="680.25272" + inkscape:zoom="1" + inkscape:cx="470.5927" + inkscape:cy="1012.5262" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" @@ -337,14 +337,14 @@ xml:space="preserve" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'sans-serif, Normal';text-align:start;letter-spacing:-1.60000002px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#cecdce;fill-opacity:1;stroke:none;stroke-width:4.02423px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" x="399.71744" - y="631.84998" + y="628.96643" id="ELEC-IDG-2-num-label" inkscape:label="#text5149" transform="scale(0.96119963,1.0403666)">P + transform="matrix(-0.55570012,0,0,0.85384443,799.83103,551.6097)" /> N1 0 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:36px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;stroke-width:1px">500 REGUL LO PR 1300 1650 @@ -37,14 +37,14 @@ guidetolerance="10" inkscape:pageopacity="1" inkscape:pageshadow="2" - inkscape:window-width="1920" - inkscape:window-height="1030" + inkscape:window-width="1366" + inkscape:window-height="705" id="namedview371" - showgrid="true" - inkscape:zoom="1" - inkscape:cx="683.58709" - inkscape:cy="286.7536" - inkscape:window-x="1592" + showgrid="false" + inkscape:zoom="1.28" + inkscape:cx="608.14718" + inkscape:cy="323.45523" + inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" inkscape:current-layer="svg2"> @@ -81,8 +81,7 @@ style="font-style:normal;font-weight:normal;line-height:0%;font-family:'Liberation Sans';letter-spacing:0px;word-spacing:0px;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" x="500.75214" y="977.31793" - id="text6232" - sodipodi:linespacing="0%">120000 °C G.LOAD 0.6 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#bb6100;fill-opacity:1">G.LOAD 0.6   - DN ° + style="font-size:32px;line-height:1.25;fill:#179ab7;fill-opacity:1;">°  AIL L  AIL R + y="408.59415" /> G - B + y="408.1442" /> B + y="408.1442" /> G L R + y="408.69415" /> B + y="664.86768" /> B + y="664.86139" /> G + y="663.84418" /> B + y="663.84418" /> Y ELEV ELEV 5 + diff --git a/Nasal/FBW/it-fbw.nas b/Nasal/FBW/it-fbw.nas index 48b5f427..ad04e827 100644 --- a/Nasal/FBW/it-fbw.nas +++ b/Nasal/FBW/it-fbw.nas @@ -67,7 +67,7 @@ var FBW = { rtlu1: props.globals.getNode("/systems/failures/fctl/rtlu-1"), rtlu2: props.globals.getNode("/systems/failures/fctl/rtlu-2"), rtlu2: props.globals.getNode("/systems/failures/fctl/rtlu-2"), - ths: props.globals.getNode("/systems/failures/fctl/ths-jam"), + ths: props.globals.getNode(""), spoilerl1: props.globals.getNode(""), spoilerl2: props.globals.getNode("/systems/failures/spoilers/spoiler-l2"), spoilerl3: props.globals.getNode("/systems/failures/spoilers/spoiler-l3"), From fd46e987a59ad2ecc2556dbc7ed24eea10106174 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 17 Jul 2021 16:55:55 +0100 Subject: [PATCH 80/96] Fuel page --- .../Instruments/Lower-ECAM/Lower-ECAM-APU.nas | 1 + .../Lower-ECAM/Lower-ECAM-fuel.nas | 461 ++++++++++++++++- .../Instruments/Lower-ECAM/Lower-ECAM-old.nas | 346 ------------- Models/Instruments/Lower-ECAM/res/fuel.svg | 474 +++++++++--------- 4 files changed, 707 insertions(+), 575 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas index b45a809b..55015168 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas @@ -297,6 +297,7 @@ var input = { apuEgtRot: "/ECAM/Lower/APU-EGT", apuGenPB: "/controls/electrical/switches/apu", apuGLC: "/systems/electrical/relay/apu-glc/contact-pos", + apuFireBtn: "/controls/apu/fire-btn", apuFlap: "/controls/apu/inlet-flap/position-norm", apuFuelPump: "/systems/fuel/pumps/apu-operate", apuFuelPumpsOff: "/systems/fuel/pumps/all-eng-pump-off", diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-fuel.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-fuel.nas index ea3ca35b..4da77543 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-fuel.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-fuel.nas @@ -1,6 +1,9 @@ # A3XX Lower ECAM Canvas # Copyright (c) 2021 Josh Davidson (Octal450) and Jonathan Redpath +var fuel_used_lbs1 = props.globals.getNode("/systems/fuel/fuel-used-1", 1); +var fuel_used_lbs2 = props.globals.getNode("/systems/fuel/fuel-used-2", 1); + var canvas_lowerECAMPageFuel = { new: func(svg,name) { @@ -21,8 +24,430 @@ var canvas_lowerECAMPageFuel = obj.units = acconfig_weight_kgs.getValue(); # init + obj["FUEL-Left-blocked"].hide(); + obj["FUEL-Right-blocked"].hide(); + obj["FUEL-Left-Outer-Inacc"].hide(); + obj["FUEL-Left-Inner-Inacc"].hide(); + obj["FUEL-Right-Outer-Inacc"].hide(); + obj["FUEL-Right-Inner-Inacc"].hide(); + obj["FUEL-Center-Inacc"].hide(); obj.update_items = [ + props.UpdateManager.FromHashValue("acconfigUnits", nil, func(val) { + if (val) { + obj["FOB-weight-unit"].setText("KG"); + obj["Fused-weight-unit"].setText("KG"); + obj["FFlow-weight-unit"].setText("KG/MIN"); + obj["FUEL-On-Board"].setText(sprintf("%s", math.round(pts.Consumables.Fuel.totalFuelLbs.getValue() * LBS2KGS, 10))); + obj["FUEL-Left-Outer-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.leftOuter.getValue() * LBS2KGS, 10))); + obj["FUEL-Left-Inner-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.leftInner.getValue() * LBS2KGS, 10))); + obj["FUEL-Center-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.center.getValue() * LBS2KGS, 10))); + obj["FUEL-Right-Inner-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.rightInner.getValue() * LBS2KGS, 10))); + obj["FUEL-Right-Outer-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.rightOuter.getValue() * LBS2KGS, 10))); + obj["FUEL-Flow-per-min"].setText(sprintf("%s", math.round(((pts.Engines.Engine.fuelFlow[0].getValue() + pts.Engines.Engine.fuelFlow[1].getValue()) * LBS2KGS) / 60, 10))); + obj["FUEL-used-1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue() * LBS2KGS, 10))); + obj["FUEL-used-2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue() * LBS2KGS, 10))); + obj["FUEL-used-both"].setText(sprintf("%s", (math.round((fuel_used_lbs1.getValue() * LBS2KGS) + (fuel_used_lbs2.getValue() * LBS2KGS), 10)))); + } else { + obj["FUEL-used-1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue(), 10))); + obj["FUEL-used-2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue(), 10))); + obj["FUEL-used-both"].setText(sprintf("%s", (math.round(fuel_used_lbs1.getValue() + fuel_used_lbs2.getValue(), 10)))); + obj["FUEL-Flow-per-min"].setText(sprintf("%s", math.round((pts.Engines.Engine.fuelFlow[0].getValue() + pts.Engines.Engine.fuelFlow[1].getValue()) / 60, 10))); + obj["FOB-weight-unit"].setText("LBS"); + obj["Fused-weight-unit"].setText("LBS"); + obj["FFlow-weight-unit"].setText("LBS/MIN"); + obj["FUEL-On-Board"].setText(sprintf("%s", math.round(pts.Consumables.Fuel.totalFuelLbs.getValue(), 10))); + obj["FUEL-Left-Outer-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.leftOuter.getValue(), 10))); + obj["FUEL-Left-Inner-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.leftInner.getValue(), 10))); + obj["FUEL-Center-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.center.getValue(), 10))); + obj["FUEL-Right-Inner-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.rightInner.getValue(), 10))); + obj["FUEL-Right-Outer-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.rightOuter.getValue(), 10))); + } + }), + props.UpdateManager.FromHashValue("engFuelUsed1", 0.5, func(val) { + if (obj.units) { + obj["FUEL-used-1"].setText(sprintf("%s", math.round(val * LBS2KGS, 10))); + } else { + obj["FUEL-used-1"].setText(sprintf("%s", math.round(val, 10))); + } + }), + props.UpdateManager.FromHashValue("engFuelUsed2", 0.5, func(val) { + if (obj.units) { + obj["FUEL-used-2"].setText(sprintf("%s", math.round(val * LBS2KGS, 10))); + } else { + obj["FUEL-used-2"].setText(sprintf("%s", math.round(val, 10))); + } + }), + props.UpdateManager.FromHashList(["engFuelUsed1","engFuelUsed2"], 0.5, func(val) { + if (obj.units) { + obj["FUEL-used-both"].setText(sprintf("%s", (math.round((val.engFuelUsed1 * LBS2KGS) + (val.engFuelUsed2 * LBS2KGS), 10)))); + } else { + obj["FUEL-used-both"].setText(sprintf("%s", (math.round(val.engFuelUsed1 + val.engFuelUsed2, 10)))); + } + }), + props.UpdateManager.FromHashValue("fuelLeftOuterQty", 0.25, func(val) { + if (obj.units) { + obj["FUEL-Left-Outer-quantity"].setText(sprintf("%s", math.round(val * LBS2KGS, 10))); + } else { + obj["FUEL-Left-Outer-quantity"].setText(sprintf("%s", math.round(val, 10))); + } + }), + props.UpdateManager.FromHashValue("fuelRightOuterQty", 0.25, func(val) { + if (obj.units) { + obj["FUEL-Right-Outer-quantity"].setText(sprintf("%s", math.round(val * LBS2KGS, 10))); + } else { + obj["FUEL-Right-Outer-quantity"].setText(sprintf("%s", math.round(val, 10))); + } + }), + props.UpdateManager.FromHashValue("fuelLeftInnerQty", 0.25, func(val) { + if (obj.units) { + obj["FUEL-Left-Inner-quantity"].setText(sprintf("%s", math.round(val * LBS2KGS, 10))); + } else { + obj["FUEL-Left-Inner-quantity"].setText(sprintf("%s", math.round(val, 10))); + } + }), + props.UpdateManager.FromHashValue("fuelRightInnerQty", 0.25, func(val) { + if (obj.units) { + obj["FUEL-Right-Inner-quantity"].setText(sprintf("%s", math.round(val * LBS2KGS, 10))); + } else { + obj["FUEL-Right-Inner-quantity"].setText(sprintf("%s", math.round(val, 10))); + } + }), + props.UpdateManager.FromHashList(["fadecPower1","fadecPower2","fadecPowerStart","fuelflow_1","fuelflow_2"], nil, func(val) { + if (val.fadecPower1 or val.fadecPower2 or val.fadecPowerStart) { + obj["FUEL-Flow-per-min"].setColor(0.0509,0.7529,0.2941); + if (obj.units) { + obj["FUEL-Flow-per-min"].setText(sprintf("%s", math.round(((val.fuelflow_1 + val.fuelflow_2) * LBS2KGS) / 60, 10))); + } else { + obj["FUEL-Flow-per-min"].setText(sprintf("%s", math.round((val.fuelflow_1 + val.fuelflow_2) / 60, 10))); + } + } else { + obj["FUEL-Flow-per-min"].setColor(0.7333,0.3803,0); + obj["FUEL-Flow-per-min"].setText("XX"); + } + }), + props.UpdateManager.FromHashValue("N1_actual_1", 0.05, func(val) { + if (val <= 18.8) { + obj["ENG1idFFlow"].setColor(0.7333,0.3803,0); + obj["FUEL-ENG-1-label"].setColor(0.7333,0.3803,0); + } else { + obj["ENG1idFFlow"].setColor(0.8078,0.8039,0.8078); + obj["FUEL-ENG-1-label"].setColor(0.8078,0.8039,0.8078); + } + }), + props.UpdateManager.FromHashValue("N1_actual_2", 0.05, func(val) { + if (val <= 18.8) { + obj["ENG2idFFlow"].setColor(0.7333,0.3803,0); + obj["FUEL-ENG-2-label"].setColor(0.7333,0.3803,0); + } else { + obj["ENG2idFFlow"].setColor(0.8078,0.8039,0.8078); + obj["FUEL-ENG-2-label"].setColor(0.8078,0.8039,0.8078); + } + }), + props.UpdateManager.FromHashValue("fuelLeftSwitch1", nil, func(val) { + if (val) { + obj["FUEL-Pump-Left-1-Open"].show(); + obj["FUEL-Pump-Left-1-Closed"].hide(); + obj["FUEL-Pump-Left-1"].setColor(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Left-1"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Left-1-Square"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Left-1-Open"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Left-1-Closed"].setColorFill(0.0509,0.7529,0.2941); + } else { + obj["FUEL-Pump-Left-1-Open"].hide(); + obj["FUEL-Pump-Left-1-Closed"].show(); + obj["FUEL-Pump-Left-1"].setColor(0.7333,0.3803,0); + obj["FUEL-Pump-Left-1-Square"].setColorFill(0.7333,0.3803,0); + obj["FUEL-Pump-Left-1"].setColorFill(0.7333,0.3803,0); + obj["FUEL-Pump-Left-1-Open"].setColorFill(0.7333,0.3803,0); + obj["FUEL-Pump-Left-1-Closed"].setColorFill(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("fuelLeftSwitch2", nil, func(val) { + if (val) { + obj["FUEL-Pump-Left-2-Open"].show(); + obj["FUEL-Pump-Left-2-Closed"].hide(); + obj["FUEL-Pump-Left-2"].setColor(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Left-2"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Left-2-Square"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Left-2-Open"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Left-2-Closed"].setColorFill(0.0509,0.7529,0.2941); + } else { + obj["FUEL-Pump-Left-2-Open"].hide(); + obj["FUEL-Pump-Left-2-Closed"].show(); + obj["FUEL-Pump-Left-2"].setColor(0.7333,0.3803,0); + obj["FUEL-Pump-Left-2"].setColorFill(0.7333,0.3803,0); + obj["FUEL-Pump-Left-2-Square"].setColorFill(0.7333,0.3803,0); + obj["FUEL-Pump-Left-2-Open"].setColorFill(0.7333,0.3803,0); + obj["FUEL-Pump-Left-2-Closed"].setColorFill(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("fuelCenterSwitch1", nil, func(val) { + if (val) { + obj["FUEL-Pump-Center-1-Open"].show(); + obj["FUEL-Pump-Center-1-Closed"].hide(); + obj["FUEL-Pump-Center-1"].setColor(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Center-1"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Center-1-Square"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Center-1-Open"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Center-1-Closed"].setColorFill(0.0509,0.7529,0.2941); + } else { + obj["FUEL-Pump-Center-1-Open"].hide(); + obj["FUEL-Pump-Center-1-Closed"].show(); + obj["FUEL-Pump-Center-1"].setColor(0.7333,0.3803,0); + obj["FUEL-Pump-Center-1"].setColorFill(0.7333,0.3803,0); + obj["FUEL-Pump-Center-1-Square"].setColorFill(0.7333,0.3803,0); + obj["FUEL-Pump-Center-1-Open"].setColorFill(0.7333,0.3803,0); + obj["FUEL-Pump-Center-1-Closed"].setColorFill(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("fuelCenterSwitch2", nil, func(val) { + if (val) { + obj["FUEL-Pump-Center-2-Open"].show(); + obj["FUEL-Pump-Center-2-Closed"].hide(); + obj["FUEL-Pump-Center-2"].setColor(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Center-2"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Center-2-Square"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Center-2-Open"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Center-2-Closed"].setColorFill(0.0509,0.7529,0.2941); + } else { + obj["FUEL-Pump-Center-2-Open"].hide(); + obj["FUEL-Pump-Center-2-Closed"].show(); + obj["FUEL-Pump-Center-2"].setColor(0.7333,0.3803,0); + obj["FUEL-Pump-Center-2"].setColorFill(0.7333,0.3803,0); + obj["FUEL-Pump-Center-2-Square"].setColorFill(0.7333,0.3803,0); + obj["FUEL-Pump-Center-2-Open"].setColorFill(0.7333,0.3803,0); + obj["FUEL-Pump-Center-2-Closed"].setColorFill(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("fuelRightSwitch1", nil, func(val) { + if (val) { + obj["FUEL-Pump-Right-1-Open"].show(); + obj["FUEL-Pump-Right-1-Closed"].hide(); + obj["FUEL-Pump-Right-1"].setColor(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Right-1"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Right-1-Square"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Right-1-Open"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Right-1-Closed"].setColorFill(0.0509,0.7529,0.2941); + } else { + obj["FUEL-Pump-Right-1-Open"].hide(); + obj["FUEL-Pump-Right-1-Closed"].show(); + obj["FUEL-Pump-Right-1"].setColor(0.7333,0.3803,0); + obj["FUEL-Pump-Right-1"].setColorFill(0.7333,0.3803,0); + obj["FUEL-Pump-Right-1-Square"].setColorFill(0.7333,0.3803,0); + obj["FUEL-Pump-Right-1-Open"].setColorFill(0.7333,0.3803,0); + obj["FUEL-Pump-Right-1-Closed"].setColorFill(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("fuelRightSwitch2", nil, func(val) { + if (val) { + obj["FUEL-Pump-Right-2-Open"].show(); + obj["FUEL-Pump-Right-2-Closed"].hide(); + obj["FUEL-Pump-Right-2"].setColor(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Right-2"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Right-2-Square"].setColor(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Right-2-Open"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-Pump-Right-2-Closed"].setColorFill(0.0509,0.7529,0.2941); + } else { + obj["FUEL-Pump-Right-2-Open"].hide(); + obj["FUEL-Pump-Right-2-Closed"].show(); + obj["FUEL-Pump-Right-2"].setColor(0.7333,0.3803,0); + obj["FUEL-Pump-Right-2"].setColorFill(0.7333,0.3803,0); + obj["FUEL-Pump-Right-2-Square"].setColor(0.7333,0.3803,0); + obj["FUEL-Pump-Right-2-Open"].setColorFill(0.7333,0.3803,0); + obj["FUEL-Pump-Right-2-Closed"].setColorFill(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashList(["fuelCenterSwitch1","fuelCenterSwitch2"], nil, func(val) { + if (!val.fuelCenterSwitch1 and !val.fuelCenterSwitch2) { + obj["FUEL-Center-blocked"].show(); + } else { + obj["FUEL-Center-blocked"].hide(); + } + }), + props.UpdateManager.FromHashList(["fuelCrossfeedValve","fuelCrossfeedSwitch"], nil, func(val) { + if (val.fuelCrossfeedValve == 1) { + obj["FUEL-XFEED"].setRotation(0); + obj["FUEL-XFEED-pipes"].show(); + if (val.fuelCrossfeedSwitch) { + obj["FUEL-XFEED"].setColor(0.0509,0.7529,0.2941); + obj["FUEL-XFEED"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-XFEED-Cross"].setColorFill(0.0509,0.7529,0.2941); + } else { + obj["FUEL-XFEED"].setColor(0.7333,0.3803,0); + obj["FUEL-XFEED"].setColorFill(0.7333,0.3803,0); + obj["FUEL-XFEED-Cross"].setColorFill(0.7333,0.3803,0); + } + } elsif (val.fuelCrossfeedValve == 0) { + obj["FUEL-XFEED"].setRotation(90 * D2R); + obj["FUEL-XFEED-pipes"].hide(); + if (!val.fuelCrossfeedSwitch) { + obj["FUEL-XFEED"].setColor(0.0509,0.7529,0.2941); + obj["FUEL-XFEED"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-XFEED-Cross"].setColorFill(0.0509,0.7529,0.2941); + } else { + obj["FUEL-XFEED"].setColor(0.7333,0.3803,0); + obj["FUEL-XFEED"].setColorFill(0.7333,0.3803,0); + obj["FUEL-XFEED-Cross"].setColorFill(0.7333,0.3803,0); + } + } else { + obj["FUEL-XFEED"].setRotation(45 * D2R); + obj["FUEL-XFEED-pipes"].hide(); + obj["FUEL-XFEED"].setColor(0.7333,0.3803,0); + obj["FUEL-XFEED"].setColorFill(0.7333,0.3803,0); + obj["FUEL-XFEED-Cross"].setColorFill(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashList(["fuelEngine1Valve","engineCutoff1"], nil, func(val) { + if (val.fuelEngine1Valve) { + if (val.fuelEngine1Valve == 1) { + obj["FUEL-ENG-Master-1"].setRotation(0); + } else { + obj["FUEL-ENG-Master-1"].setRotation(45 * D2R); + } + if (val.engineCutoff1) { + obj["FUEL-ENG-Master-1"].setColor(0.7333,0.3803,0); + obj["FUEL-ENG-Master-1"].setColorFill(0.7333,0.3803,0); + obj["FUEL-ENG-Master-1-Cross"].setColorFill(0.7333,0.3803,0); + obj["FUEL-ENG-1-pipe"].setColorFill(0.7333,0.3803,0); + obj["FUEL-ENG-1-pipe"].setColorFill(0.7333,0.3803,0); + } else { + obj["FUEL-ENG-Master-1"].setColor(0.0509,0.7529,0.2941); + obj["FUEL-ENG-Master-1"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-ENG-Master-1-Cross"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-ENG-1-pipe"].setColor(0.0509,0.7529,0.2941); + obj["FUEL-ENG-1-pipe"].setColorFill(0.0509,0.7529,0.2941); + } + } else { + obj["FUEL-ENG-Master-1"].setRotation(90 * D2R); + obj["FUEL-ENG-Master-1"].setColor(0.7333,0.3803,0); + obj["FUEL-ENG-Master-1"].setColorFill(0.7333,0.3803,0); + obj["FUEL-ENG-Master-1-Cross"].setColorFill(0.7333,0.3803,0); + obj["FUEL-ENG-1-pipe"].setColor(0.7333,0.3803,0); + obj["FUEL-ENG-1-pipe"].setColorFill(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashList(["fuelEngine2Valve","engineCutoff2"], nil, func(val) { + if (val.fuelEngine2Valve) { + if (val.fuelEngine2Valve == 1) { + obj["FUEL-ENG-Master-2"].setRotation(0); + } else { + obj["FUEL-ENG-Master-2"].setRotation(45 * D2R); + } + if (val.engineCutoff1) { + obj["FUEL-ENG-Master-2"].setColor(0.7333,0.3803,0); + obj["FUEL-ENG-Master-2"].setColorFill(0.7333,0.3803,0); + obj["FUEL-ENG-Master-2-Cross"].setColorFill(0.7333,0.3803,0); + obj["FUEL-ENG-2-pipe"].setColorFill(0.7333,0.3803,0); + obj["FUEL-ENG-2-pipe"].setColorFill(0.7333,0.3803,0); + } else { + obj["FUEL-ENG-Master-2"].setColor(0.0509,0.7529,0.2941); + obj["FUEL-ENG-Master-2"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-ENG-Master-2-Cross"].setColorFill(0.0509,0.7529,0.2941); + obj["FUEL-ENG-2-pipe"].setColor(0.0509,0.7529,0.2941); + obj["FUEL-ENG-2-pipe"].setColorFill(0.0509,0.7529,0.2941); + } + } else { + obj["FUEL-ENG-Master-2"].setRotation(90 * D2R); + obj["FUEL-ENG-Master-2"].setColor(0.7333,0.3803,0); + obj["FUEL-ENG-Master-2"].setColorFill(0.7333,0.3803,0); + obj["FUEL-ENG-Master-2-Cross"].setColorFill(0.7333,0.3803,0); + obj["FUEL-ENG-2-pipe"].setColor(0.7333,0.3803,0); + obj["FUEL-ENG-2-pipe"].setColorFill(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("fuelTransferValve1", nil, func(val) { + if (val == 0) { + obj["FUEL-Left-Transfer"].hide(); + } else { + if (val == 1) { + obj["FUEL-Left-Transfer"].setColor(0.0509,0.7529,0.2941); + } else { + obj["FUEL-Left-Transfer"].setColor(0.7333,0.3803,0); + } + obj["FUEL-Left-Transfer"].show(); + } + }), + props.UpdateManager.FromHashValue("fuelTransferValve2", nil, func(val) { + if (val == 0) { + obj["FUEL-Right-Transfer"].hide(); + } else { + if (val == 1) { + obj["FUEL-Right-Transfer"].setColor(0.0509,0.7529,0.2941); + } else { + obj["FUEL-Right-Transfer"].setColor(0.7333,0.3803,0); + } + obj["FUEL-Right-Transfer"].show(); + } + }), + props.UpdateManager.FromHashValue("fuelTotalLbs", 1, func(val) { + if (obj.units) { + obj["FUEL-On-Board"].setText(sprintf("%s", math.round(val * LBS2KGS, 10))); + } else { + obj["FUEL-On-Board"].setText(sprintf("%s", math.round(val, 10))); + } + }), + props.UpdateManager.FromHashValue("fuelTempLeftOuter", 0.25, func(val) { + obj["FUEL-Left-Outer-temp"].setText(sprintf("%s", math.round(val))); + if (val > 55 or val < -40) { + obj["FUEL-Left-Outer-temp"].setColor(0.7333,0.3803,0); + } else { + obj["FUEL-Left-Outer-temp"].setColor(0.0509,0.7529,0.2941); + } + }), + props.UpdateManager.FromHashValue("fuelTempLeftInner", 0.25, func(val) { + obj["FUEL-Left-Inner-temp"].setText(sprintf("%s", math.round(val))); + if (val > 45 or val < -40) { + obj["FUEL-Left-Inner-temp"].setColor(0.7333,0.3803,0); + } else { + obj["FUEL-Left-Inner-temp"].setColor(0.0509,0.7529,0.2941); + } + }), + props.UpdateManager.FromHashValue("fuelTempRightInner", 0.25, func(val) { + obj["FUEL-Right-Inner-temp"].setText(sprintf("%s", math.round(val))); + if (val > 45 or val < -40) { + obj["FUEL-Right-Inner-temp"].setColor(0.7333,0.3803,0); + } else { + obj["FUEL-Right-Inner-temp"].setColor(0.0509,0.7529,0.2941); + } + }), + props.UpdateManager.FromHashValue("fuelTempRightOuter", 0.25, func(val) { + obj["FUEL-Right-Outer-temp"].setText(sprintf("%s", math.round(val))); + if (val > 55 or val < -40) { + obj["FUEL-Right-Outer-temp"].setColor(0.7333,0.3803,0); + } else { + obj["FUEL-Right-Outer-temp"].setColor(0.0509,0.7529,0.2941); + } + }), + props.UpdateManager.FromHashList(["fuelApuValve","apuMaster","apuFireBtn"], nil, func(val) { + if (val.fuelApuValve == 0) { + if (val.apuMaster or val.apuFireBtn) { + obj["FUEL-APU-label"].setColor(0.7333,0.3803,0); + obj["FUEL-APU-line"].hide(); + obj["FUEL-APU-arrow"].hide(); + } else { + obj["FUEL-APU-label"].setColor(0.8078, 0.8039, 0.8078); + obj["FUEL-APU-arrow"].setColor(0.8078, 0.8039, 0.8078); + obj["FUEL-APU-line"].hide(); + obj["FUEL-APU-arrow"].show(); + } + } else { + if (!val.apuMaster or val.apuFireBtn) { + obj["FUEL-APU-label"].setColor(0.7333,0.3803,0); + obj["FUEL-APU-line"].setColor(0.7333,0.3803,0); + obj["FUEL-APU-line"].setColorFill(0.7333,0.3803,0); + obj["FUEL-APU-arrow"].setColor(0.7333,0.3803,0); + obj["FUEL-APU-line"].show(); + obj["FUEL-APU-arrow"].show(); + } else { + obj["FUEL-APU-label"].setColor(0.8078, 0.8039, 0.8078); + obj["FUEL-APU-line"].setColor(0.0509,0.7529,0.2941); + obj["FUEL-APU-arrow"].setColor(0.0509,0.7529,0.2941); + obj["FUEL-APU-line"].show(); + obj["FUEL-APU-arrow"].show(); + } + } + }), ]; obj.displayedGForce = 0; @@ -62,10 +487,13 @@ var canvas_lowerECAMPageFuel = return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; }, getKeys: func() { - return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", - "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", - "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", - "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + return["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","FUEL-Pump-Left-1","FUEL-Pump-Left-2","FUEL-Pump-Center-1","FUEL-Pump-Center-2","FUEL-Pump-Right-1","FUEL-Pump-Right-2","FUEL-Left-blocked","FUEL-Right-blocked","FUEL-Center-blocked","FUEL-Left-Transfer", + "FUEL-Right-Transfer","FUEL-Left-Outer-Inacc","FUEL-Left-Inner-Inacc","FUEL-Center-Inacc","FUEL-Right-Inner-Inacc","FUEL-Right-Outer-Inacc","FUEL-Left-Outer-quantity","FUEL-Left-Inner-quantity","FUEL-Center-quantity","FUEL-Right-Inner-quantity", + "FUEL-Right-Outer-quantity","FUEL-On-Board","FUEL-Flow-per-min","FUEL-APU-arrow","FUEL-APU-line","FUEL-APU-label","FUEL-used-1","FUEL-used-both","FUEL-used-2","FUEL-ENG-Master-1","FUEL-ENG-Master-2","FUEL-XFEED","FUEL-XFEED-Cross","FUEL-XFEED-pipes","FUEL-Left-Outer-temp", + "FUEL-Left-Inner-temp","FUEL-Right-Inner-temp","FUEL-Right-Outer-temp","FUEL-Pump-Left-1-Closed","FUEL-Pump-Left-1-Open","FUEL-Pump-Left-2-Closed","FUEL-Pump-Left-2-Open","FUEL-Pump-Center-1-Open","FUEL-Pump-Center-1-Closed","FUEL-Pump-Center-2-Closed", + "FUEL-Pump-Center-2-Open","FUEL-Pump-Right-1-Closed","FUEL-Pump-Right-1-Open","FUEL-Pump-Right-2-Closed","FUEL-Pump-Right-2-Open","FUEL-ENG-1-label","FUEL-ENG-2-label","FUEL-ENG-1-pipe","FUEL-ENG-2-pipe","ENG1idFFlow","ENG2idFFlow","FUEL-used-1","FUEL-used-2","FUEL-used-both", + "Fused-weight-unit","FFlow-weight-unit","FOB-weight-unit","FUEL-ENG-Master-1-Cross","FUEL-ENG-Master-2-Cross","FUEL-Pump-Left-1-Square","FUEL-Pump-Left-2-Square","FUEL-Pump-Center-1-Square","FUEL-Pump-Center-2-Square","FUEL-Pump-Right-1-Square","FUEL-Pump-Right-2-Square"]; + }, updateBottom: func(notification) { foreach(var update_item_bottom; me.updateItemsBottom) { @@ -140,6 +568,31 @@ var canvas_lowerECAMPageFuel = }; var input = { + engineCutoff1: "/controls/engines/engine[0]/cutoff-switch", + engineCutoff2: "/controls/engines/engine[1]/cutoff-switch", + fuelApuValve: "/systems/fuel/valves/apu-lp-valve", + fuelCrossfeedSwitch: "/controls/fuel/switches/crossfeed", + fuelCrossfeedValve: "/systems/fuel/valves/crossfeed-valve", + fuelEngine1Valve: "/systems/fuel/valves/engine-1-lp-valve", + fuelEngine2Valve: "/systems/fuel/valves/engine-2-lp-valve", + fuelTransferValve1: "/systems/fuel/valves/outer-inner-transfer-valve-1", + fuelTransferValve2: "/systems/fuel/valves/outer-inner-transfer-valve-2", + fuelLeftSwitch1: "/controls/fuel/switches/pump-left-1", + fuelLeftSwitch2: "/controls/fuel/switches/pump-left-2", + fuelCenterSwitch1: "/controls/fuel/switches/pump-center-1", + fuelCenterSwitch2: "/controls/fuel/switches/pump-center-2", + fuelRightSwitch1: "/controls/fuel/switches/pump-right-1", + fuelRightSwitch2: "/controls/fuel/switches/pump-right-2", + fuelTempLeftOuter: "/consumables/fuel/tank[0]/temperature_degC", + fuelTempLeftInner: "/consumables/fuel/tank[1]/temperature_degC", + fuelTempRightOuter: "/consumables/fuel/tank[4]/temperature_degC", + fuelTempRightInner: "/consumables/fuel/tank[3]/temperature_degC", + fuelLeftOuterQty: "/consumables/fuel/tank[0]/level-lbs", + fuelLeftInnerQty: "/consumables/fuel/tank[1]/level-lbs", + fuelRightOuterQty: "/consumables/fuel/tank[4]/level-lbs", + fuelRightInnerQty: "/consumables/fuel/tank[3]/level-lbs", + fuelCenterQty: "/consumables/fuel/tank[2]/level-lbs", + fuelTotalLbs: "/consumables/fuel/total-fuel-lbs", }; foreach (var name; keys(input)) { diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas index 64dbbd05..f2e2719a 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas @@ -131,23 +131,8 @@ var R4BrakeTempc = props.globals.getNode("/gear/gear[2]/R4brake-temp-degc", 1); var eng1_running = props.globals.getNode("/engines/engine[0]/running", 1); var eng2_running = props.globals.getNode("/engines/engine[1]/running", 1); var switch_cart = props.globals.getNode("/controls/electrical/ground-cart", 1); -var spoiler_L1 = props.globals.getNode("", 1); -var spoiler_L2 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l2/final-deg", 1); -var spoiler_L3 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l3/final-deg", 1); -var spoiler_L4 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l4/final-deg", 1); -var spoiler_L5 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l5/final-deg", 1); -var spoiler_R1 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r1/final-deg", 1); -var spoiler_R2 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r2/final-deg", 1); -var spoiler_R3 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r3/final-deg", 1); -var spoiler_R4 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r4/final-deg", 1); -var spoiler_R5 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r5/final-deg", 1); -var total_fuel_lbs = props.globals.getNode("/consumables/fuel/total-fuel-lbs", 1); var fuel_flow1 = props.globals.getNode("/engines/engine[0]/fuel-flow_actual", 1); var fuel_flow2 = props.globals.getNode("/engines/engine[1]/fuel-flow_actual", 1); -var fuel_left_outer_temp = props.globals.getNode("/consumables/fuel/tank[0]/temperature_degC", 1); -var fuel_left_inner_temp = props.globals.getNode("/consumables/fuel/tank[1]/temperature_degC", 1); -var fuel_right_outer_temp = props.globals.getNode("/consumables/fuel/tank[4]/temperature_degC", 1); -var fuel_right_inner_temp = props.globals.getNode("/consumables/fuel/tank[3]/temperature_degC", 1); var cutoff_switch1 = props.globals.getNode("/controls/engines/engine[0]/cutoff-switch", 1); var cutoff_switch2 = props.globals.getNode("/controls/engines/engine[1]/cutoff-switch", 1); var autobreak_mode = props.globals.getNode("/controls/autobrake/mode", 1); @@ -1486,339 +1471,8 @@ var canvas_lowerECAM_eng = { me.updateBottomStatus(); }, }; - - - # Elevators - - - # Flight Computers - if (elac1Node) { - me["elac1"].setColor(0.0509,0.7529,0.2941); - me.setColor(0.0509,0.7529,0.2941); - } else if (!elac1Node or fbw.FBW.Failures.elac1.getValue()) { - me["elac1"].setColor(0.7333,0.3803,0); - me["path4249"].setColor(0.7333,0.3803,0); - } - - if (elac2Node) { - me["elac2"].setColor(0.0509,0.7529,0.2941); - me.setColor(0.0509,0.7529,0.2941); - } else if (!elac2Node or fbw.FBW.Failures.elac2.getValue()) { - me["elac2"].setColor(0.7333,0.3803,0); - me["path4249-3"].setColor(0.7333,0.3803,0); - } - - if (sec1Node) { - me["sec1"].setColor(0.0509,0.7529,0.2941); - me["path4249-3-6-7"].setColor(0.0509,0.7529,0.2941); - } else if (!sec1Node or fbw.FBW.Failures.sec1.getValue()) { - me["sec1"].setColor(0.7333,0.3803,0); - me["path4249-3-6-7"].setColor(0.7333,0.3803,0); - } - - if (sec2Node) { - me["sec2"].setColor(0.0509,0.7529,0.2941); - me["path4249-3-6-7-5"].setColor(0.0509,0.7529,0.2941); - } else if (!sec2Node or fbw.FBW.Failures.sec2.getValue()) { - me["sec2"].setColor(0.7333,0.3803,0); - me["path4249-3-6-7-5"].setColor(0.7333,0.3803,0); - } - - if (fbw.FBW.Computers.sec3.getValue()) { - me["sec3"].setColor(0.0509,0.7529,0.2941); - me["path4249-3-6"].setColor(0.0509,0.7529,0.2941); - } else if (!fbw.FBW.Computers.sec3.getValue() or fbw.FBW.Failures.sec3.getValue()) { - me["sec3"].setColor(0.7333,0.3803,0); - me["path4249-3-6"].setColor(0.7333,0.3803,0); - } - - # Hydraulic Indicators - - - - me.updateBottomStatus(); - }, -}; - -var canvas_lowerECAM_fuel = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_fuel, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","FUEL-Pump-Left-1","FUEL-Pump-Left-2","FUEL-Pump-Center-1","FUEL-Pump-Center-2","FUEL-Pump-Right-1","FUEL-Pump-Right-2","FUEL-Left-blocked","FUEL-Right-blocked","FUEL-Center-blocked","FUEL-Left-Transfer", - "FUEL-Right-Transfer","FUEL-Left-Outer-Inacc","FUEL-Left-Inner-Inacc","FUEL-Center-Inacc","FUEL-Right-Inner-Inacc","FUEL-Right-Outer-Inacc","FUEL-Left-Outer-quantity","FUEL-Left-Inner-quantity","FUEL-Center-quantity","FUEL-Right-Inner-quantity", - "FUEL-Right-Outer-quantity","FUEL-On-Board","FUEL-Flow-per-min","FUEL-APU-arrow","FUEL-APU-line","FUEL-APU-label","FUEL-used-1","FUEL-used-both","FUEL-used-2","FUEL-ENG-Master-1","FUEL-ENG-Master-2","FUEL-XFEED","FUEL-XFEED-pipes","FUEL-Left-Outer-temp", - "FUEL-Left-Inner-temp","FUEL-Right-Inner-temp","FUEL-Right-Outer-temp","FUEL-Pump-Left-1-Closed","FUEL-Pump-Left-1-Open","FUEL-Pump-Left-2-Closed","FUEL-Pump-Left-2-Open","FUEL-Pump-Center-1-Open","FUEL-Pump-Center-1-Closed","FUEL-Pump-Center-2-Closed", - "FUEL-Pump-Center-2-Open","FUEL-Pump-Right-1-Closed","FUEL-Pump-Right-1-Open","FUEL-Pump-Right-2-Closed","FUEL-Pump-Right-2-Open","FUEL-ENG-1-label","FUEL-ENG-2-label","FUEL-ENG-1-pipe","FUEL-ENG-2-pipe","ENG1idFFlow","ENG2idFFlow","FUEL-used-1","FUEL-used-2","FUEL-used-both", - "Fused-weight-unit","FFlow-weight-unit","FOB-weight-unit"]; - }, - update: func() { - _weight_kgs = acconfig_weight_kgs.getValue(); - - if (pts.Engines.Engine.n1Actual[0].getValue() <= 18.8) { - me["ENG1idFFlow"].setColor(0.7333,0.3803,0); - me["FUEL-ENG-1-label"].setColor(0.7333,0.3803,0); - } else { - me["ENG1idFFlow"].setColor(0.8078,0.8039,0.8078); - me["FUEL-ENG-1-label"].setColor(0.8078,0.8039,0.8078); - } - - if (pts.Engines.Engine.n1Actual[1].getValue() <= 18.5) { - me["ENG2idFFlow"].setColor(0.7333,0.3803,0); - me["FUEL-ENG-2-label"].setColor(0.7333,0.3803,0); - } else { - me["ENG2idFFlow"].setColor(0.8078,0.8039,0.8078); - me["FUEL-ENG-2-label"].setColor(0.8078,0.8039,0.8078); - } - - # TODO add FOB half-boxed amber if some fuel is blocked - if (_weight_kgs == 1) - { - me["FUEL-On-Board"].setText(sprintf("%s", math.round(total_fuel_lbs.getValue() * LBS2KGS, 10))); - me["FOB-weight-unit"].setText("KG"); - } else { - me["FUEL-On-Board"].setText(sprintf("%s", math.round(total_fuel_lbs.getValue(), 10))); - me["FOB-weight-unit"].setText("LBS"); - } - - if (_weight_kgs == 1) { - me["FFlow-weight-unit"].setText("KG/MIN"); - } else { - me["FFlow-weight-unit"].setText("LBS/MIN"); - } - - if (fadec.FADEC.Power.powered1.getValue() and fadec.FADEC.Power.powered2.getValue() or fadec.FADEC.Power.powerup.getValue()) { - me["FUEL-Flow-per-min"].setColor(0.0509,0.7529,0.2941); - if (_weight_kgs == 1) { - me["FUEL-Flow-per-min"].setText(sprintf("%s", math.round(((fuel_flow1.getValue() + fuel_flow2.getValue()) * LBS2KGS) / 60, 10))); - } else { - me["FUEL-Flow-per-min"].setText(sprintf("%s", math.round((fuel_flow1.getValue() + fuel_flow2.getValue()) / 60, 10))); - } - } else { - me["FUEL-Flow-per-min"].setColor(0.7333,0.3803,0); - me["FUEL-Flow-per-min"].setText("XX"); - } - - # TODO use the valve prop and add amber if difference between eng master and valve - # TODO add transition state - if (systems.FUEL.Valves.lpValve1.getValue()) { - me["FUEL-ENG-Master-1"].setRotation(0); - me["FUEL-ENG-Master-1"].setColor(0.0509,0.7529,0.2941); - me["FUEL-ENG-Master-1"].setColorFill(0.0509,0.7529,0.2941); - me["FUEL-ENG-1-pipe"].setColor(0.0509,0.7529,0.2941); - } else { - me["FUEL-ENG-Master-1"].setRotation(90 * D2R); - me["FUEL-ENG-Master-1"].setColor(0.7333,0.3803,0); - me["FUEL-ENG-Master-1"].setColorFill(0.7333,0.3803,0); - me["FUEL-ENG-1-pipe"].setColor(0.7333,0.3803,0); - } - - # TODO use the valve prop and add amber if difference between eng master and valve - # TODO add transition state - if (systems.FUEL.Valves.lpValve2.getValue()) { - me["FUEL-ENG-Master-2"].setRotation(0); - me["FUEL-ENG-Master-2"].setColor(0.0509,0.7529,0.2941); - me["FUEL-ENG-Master-2"].setColorFill(0.0509,0.7529,0.2941); - me["FUEL-ENG-2-pipe"].setColor(0.0509,0.7529,0.2941); - } else { - me["FUEL-ENG-Master-2"].setRotation(90 * D2R); - me["FUEL-ENG-Master-2"].setColor(0.7333,0.3803,0); - me["FUEL-ENG-Master-2"].setColorFill(0.7333,0.3803,0); - me["FUEL-ENG-2-pipe"].setColor(0.7333,0.3803,0); - } - - # this is now bound to the XFEED switch - # TODO use the valve prop - # TODO add amber when disagree between switch and btn - # TODO add transition state - if (systems.FUEL.Valves.crossfeed.getBoolValue()) { - me["FUEL-XFEED"].setRotation(0); - me["FUEL-XFEED-pipes"].show(); - } else { - me["FUEL-XFEED"].setRotation(90 * D2R); - me["FUEL-XFEED-pipes"].hide(); - } - - # TODO add LO indication - if (systems.FUEL.Switches.pumpLeft1.getBoolValue()) { - me["FUEL-Pump-Left-1-Open"].show(); - me["FUEL-Pump-Left-1-Closed"].hide(); - me["FUEL-Pump-Left-1"].setColor(0.0509,0.7529,0.2941); - me["FUEL-Pump-Left-1"].setColorFill(0.0509,0.7529,0.2941); - } else { - me["FUEL-Pump-Left-1-Open"].hide(); - me["FUEL-Pump-Left-1-Closed"].show(); - me["FUEL-Pump-Left-1"].setColor(0.7333,0.3803,0); - me["FUEL-Pump-Left-1"].setColorFill(0.7333,0.3803,0); - } - - # TODO add LO indication - if (systems.FUEL.Switches.pumpLeft2.getBoolValue()) { - me["FUEL-Pump-Left-2-Open"].show(); - me["FUEL-Pump-Left-2-Closed"].hide(); - me["FUEL-Pump-Left-2"].setColor(0.0509,0.7529,0.2941); - me["FUEL-Pump-Left-2"].setColorFill(0.0509,0.7529,0.2941); - } else { - me["FUEL-Pump-Left-2-Open"].hide(); - me["FUEL-Pump-Left-2-Closed"].show(); - me["FUEL-Pump-Left-2"].setColor(0.7333,0.3803,0); - me["FUEL-Pump-Left-2"].setColorFill(0.7333,0.3803,0); - } - - # TODO add functionality to match FCOM 1.28.20 "Amber: Transfer valve is open, whereas commanded closed in automatic or manual mode" - if (systems.FUEL.Switches.pumpCenter1.getBoolValue()) { - me["FUEL-Pump-Center-1-Open"].show(); - me["FUEL-Pump-Center-1-Closed"].hide(); - me["FUEL-Pump-Center-1"].setColor(0.0509,0.7529,0.2941); - me["FUEL-Pump-Center-1"].setColorFill(0.0509,0.7529,0.2941); - } else { - me["FUEL-Pump-Center-1-Open"].hide(); - me["FUEL-Pump-Center-1-Closed"].show(); - me["FUEL-Pump-Center-1"].setColor(0.7333,0.3803,0); - me["FUEL-Pump-Center-1"].setColorFill(0.7333,0.3803,0); - } - - # TODO add LO indication - if (systems.FUEL.Switches.pumpCenter2.getBoolValue()) { - me["FUEL-Pump-Center-2-Open"].show(); - me["FUEL-Pump-Center-2-Closed"].hide(); - me["FUEL-Pump-Center-2"].setColor(0.0509,0.7529,0.2941); - me["FUEL-Pump-Center-2"].setColorFill(0.0509,0.7529,0.2941); - } else { - me["FUEL-Pump-Center-2-Open"].hide(); - me["FUEL-Pump-Center-2-Closed"].show(); - me["FUEL-Pump-Center-2"].setColor(0.7333,0.3803,0); - me["FUEL-Pump-Center-2"].setColorFill(0.7333,0.3803,0); - } - - # TODO add LO indication - if (systems.FUEL.Switches.pumpRight1.getBoolValue()) { - me["FUEL-Pump-Right-1-Open"].show(); - me["FUEL-Pump-Right-1-Closed"].hide(); - me["FUEL-Pump-Right-1"].setColor(0.0509,0.7529,0.2941); - me["FUEL-Pump-Right-1"].setColorFill(0.0509,0.7529,0.2941); - } else { - me["FUEL-Pump-Right-1-Open"].hide(); - me["FUEL-Pump-Right-1-Closed"].show(); - me["FUEL-Pump-Right-1"].setColor(0.7333,0.3803,0); - me["FUEL-Pump-Right-1"].setColorFill(0.7333,0.3803,0); - } - - # TODO add LO indication - if (systems.FUEL.Switches.pumpRight2.getBoolValue()) { - me["FUEL-Pump-Right-2-Open"].show(); - me["FUEL-Pump-Right-2-Closed"].hide(); - me["FUEL-Pump-Right-2"].setColor(0.0509,0.7529,0.2941); - me["FUEL-Pump-Right-2"].setColorFill(0.0509,0.7529,0.2941); - } else { - me["FUEL-Pump-Right-2-Open"].hide(); - me["FUEL-Pump-Right-2-Closed"].show(); - me["FUEL-Pump-Right-2"].setColor(0.7333,0.3803,0); - me["FUEL-Pump-Right-2"].setColorFill(0.7333,0.3803,0); - } - - # Fuel Used - if (_weight_kgs == 1) { - me["FUEL-used-1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue() * LBS2KGS, 10))); - me["FUEL-used-2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue() * LBS2KGS, 10))); - me["FUEL-used-both"].setText(sprintf("%s", (math.round(fuel_used_lbs1.getValue() * LBS2KGS, 10) + math.round(fuel_used_lbs2.getValue() * LBS2KGS, 10)))); - me["Fused-weight-unit"].setText("KG"); - } else { - me["FUEL-used-1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue(), 10))); - me["FUEL-used-2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue(), 10))); - me["FUEL-used-both"].setText(sprintf("%s", (math.round(fuel_used_lbs1.getValue(), 10) + math.round(fuel_used_lbs2.getValue(), 10)))); - me["Fused-weight-unit"].setText("LBS"); - } - - # Fuel Temp - me["FUEL-Left-Outer-temp"].setText(sprintf("%s", math.round(fuel_left_outer_temp.getValue()))); - me["FUEL-Left-Inner-temp"].setText(sprintf("%s", math.round(fuel_left_inner_temp.getValue()))); - me["FUEL-Right-Outer-temp"].setText(sprintf("%s", math.round(fuel_right_outer_temp.getValue()))); - me["FUEL-Right-Inner-temp"].setText(sprintf("%s", math.round(fuel_right_inner_temp.getValue()))); - - # Fuel Quantity - # TODO add LO indication - if (_weight_kgs == 1) { - me["FUEL-Left-Outer-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.leftOuter.getValue() * LBS2KGS, 10))); - me["FUEL-Left-Inner-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.leftInner.getValue() * LBS2KGS, 10))); - me["FUEL-Center-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.center.getValue() * LBS2KGS, 10))); - me["FUEL-Right-Inner-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.rightInner.getValue() * LBS2KGS, 10))); - me["FUEL-Right-Outer-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.rightOuter.getValue() * LBS2KGS, 10))); - } else { - me["FUEL-Left-Outer-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.leftOuter.getValue(), 10))); - me["FUEL-Left-Inner-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.leftInner.getValue(), 10))); - me["FUEL-Center-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.center.getValue(), 10))); - me["FUEL-Right-Inner-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.rightInner.getValue(), 10))); - me["FUEL-Right-Outer-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.rightOuter.getValue(), 10))); - } - - if (systems.FUEL.Valves.transfer1.getValue() == 0) { - me["FUEL-Left-Transfer"].hide(); - } else { - if (systems.FUEL.Valves.transfer1.getValue()) { - me["FUEL-Left-Transfer"].setColor(0.0509,0.7529,0.2941); - } else { - me["FUEL-Left-Transfer"].setColor(0.7333,0.3803,0); - } - me["FUEL-Left-Transfer"].show(); - } - - if (systems.FUEL.Valves.transfer2.getValue() == 0) { - me["FUEL-Right-Transfer"].hide(); - } else { - if (systems.FUEL.Valves.transfer2.getValue()) { - me["FUEL-Right-Transfer"].setColor(0.0509,0.7529,0.2941); - } else { - me["FUEL-Right-Transfer"].setColor(0.7333,0.3803,0); - } - me["FUEL-Right-Transfer"].show(); - } - - if (!systems.FUEL.Switches.pumpCenter1.getValue() and !systems.FUEL.Switches.pumpCenter2.getValue()) { - me["FUEL-Center-blocked"].show(); - } else { - me["FUEL-Center-blocked"].hide(); - } - - # APU - if (systems.FUEL.Valves.apu.getValue() and systems.APUNodes.Controls.master.getValue() and !systems.APUNodes.Controls.fire.getValue()) { - me["FUEL-APU-label"].setColor(0.8078, 0.8039, 0.8078); - me["FUEL-APU-line"].setColor(0.0509,0.7529,0.2941); - me["FUEL-APU-arrow"].setColor(0.0509,0.7529,0.2941); - me["FUEL-APU-line"].show(); - me["FUEL-APU-arrow"].show(); - } elsif (systems.FUEL.Valves.apu.getValue() and (!systems.APUNodes.Controls.master.getValue() or systems.APUNodes.Controls.fire.getValue())) { - me["FUEL-APU-label"].setColor(0.7333,0.3803,0); - me["FUEL-APU-line"].setColor(0.7333,0.3803,0); - me["FUEL-APU-arrow"].setColor(0.7333,0.3803,0); - me["FUEL-APU-line"].show(); - me["FUEL-APU-arrow"].show(); - } elsif (systems.FUEL.Valves.apu.getValue() != 1 and (systems.APUNodes.Controls.master.getValue() or systems.APUNodes.Controls.fire.getValue())) { - me["FUEL-APU-label"].setColor(0.7333,0.3803,0); - me["FUEL-APU-line"].hide(); - me["FUEL-APU-arrow"].hide(); - } else { - me["FUEL-APU-label"].setColor(0.8078, 0.8039, 0.8078); - me["FUEL-APU-arrow"].setColor(0.8078, 0.8039, 0.8078); - me["FUEL-APU-line"].hide(); - me["FUEL-APU-arrow"].show(); - } - - # Hide not yet implemented features - # TODO add them - me["FUEL-Left-blocked"].hide(); - me["FUEL-Right-blocked"].hide(); - me["FUEL-Left-Outer-Inacc"].hide(); - me["FUEL-Left-Inner-Inacc"].hide(); - me["FUEL-Right-Outer-Inacc"].hide(); - me["FUEL-Right-Inner-Inacc"].hide(); - me["FUEL-Center-Inacc"].hide(); - me.updateBottomStatus(); }, }; diff --git a/Models/Instruments/Lower-ECAM/res/fuel.svg b/Models/Instruments/Lower-ECAM/res/fuel.svg index a2d0ce43..d91dff25 100644 --- a/Models/Instruments/Lower-ECAM/res/fuel.svg +++ b/Models/Instruments/Lower-ECAM/res/fuel.svg @@ -50,8 +50,8 @@ id="namedview371" showgrid="false" inkscape:zoom="0.68" - inkscape:cx="817.73616" - inkscape:cy="1022.6281" + inkscape:cx="434.43172" + inkscape:cy="1022.8371" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" @@ -148,8 +148,9 @@ x="817.61298" height="5.1203089" width="53.195583" - id="rect5105-2-5-3" - style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + id="FUEL-XFEED-Cross" + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:label="#rect5105-2-5-3" /> 0000 + style="font-size:30.1989994px;line-height:0;text-align:end;text-anchor:end;">0000 0000 000 + style="font-size:30.1989994px;line-height:0;text-anchor:middle;text-align:center;">000 000 + style="font-size:30.1989994px;line-height:0;text-align:end;text-anchor:end;">000 + id="FUEL-ENG-Master-1-Cross" + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:label="#rect5105-2-5-3-4" /> + id="FUEL-ENG-Master-2-Cross" + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:label="#rect5105-2-5-3-4-3" /> - - - - + + + + + + - - - - + + + + + + - - - - + + + + + + - - + + + + + + - - - - - - + + + + + + - - - - + + + + + + + ry="0" + transform="matrix(0,1,-1,0,0,0)" + y="-261.75253" + x="232.60442" + height="18.894773" + width="5.3955846" + id="FUEL-APU-line" + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1.09431255;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + sodipodi:nodetypes="cccccsc" + inkscape:connector-curvature="0" + id="FUEL-APU-arrow" + d="m 209.24999,234.99999 15.75,-7.5 16.5,-8.25 v 17.25 l 0,15.30854 c 0,0 -1.69343,-0.68362 -19.69533,-10.2091 -11.05467,-5.84944 -12.55467,-6.59944 -12.55467,-6.59944 z" + style="fill:none;stroke:#0dc04b;stroke-width:2.77499986;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4.80000019;stroke-dasharray:none;stroke-opacity:1" /> 0000 + style="font-size:30px;line-height:1.25;text-align:end;text-anchor:end;fill:#0dc04b;fill-opacity:1;stroke-width:0.75;">0000 0000 + style="font-size:30.00000191px;line-height:1.25;text-align:end;text-anchor:end;fill:#0dc04b;fill-opacity:1;stroke-width:0.75;">0000 0000 + style="font-size:30.00000191px;line-height:1.25;text-align:end;text-anchor:end;fill:#0dc04b;fill-opacity:1;stroke-width:0.75;">0000 Date: Sat, 17 Jul 2021 20:52:52 +0100 Subject: [PATCH 81/96] HYD page --- .../Instruments/Lower-ECAM/Lower-ECAM-hyd.nas | 329 +++++++++++++++++- .../Instruments/Lower-ECAM/Lower-ECAM-old.nas | 279 +-------------- Models/Instruments/Lower-ECAM/res/hyd.svg | 60 ++-- 3 files changed, 361 insertions(+), 307 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas index f9673996..4ec5fbce 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas @@ -1,6 +1,15 @@ # A3XX Lower ECAM Canvas # Copyright (c) 2021 Josh Davidson (Octal450) and Jonathan Redpath +var elec_pump_y_ovht = props.globals.initNode("/systems/hydraulic/elec-pump-yellow-ovht", 0, "BOOL"); +var elec_pump_b_ovht = props.globals.initNode("/systems/hydraulic/elec-pump-blue-ovht", 0, "BOOL"); +var y_resv_ovht = props.globals.initNode("/systems/hydraulic/yellow-resv-ovht", 0, "BOOL"); +var b_resv_ovht = props.globals.initNode("/systems/hydraulic/blue-resv-ovht", 0, "BOOL"); +var g_resv_ovht = props.globals.initNode("/systems/hydraulic/green-resv-ovht", 0, "BOOL"); +var y_resv_lo_press = props.globals.initNode("/systems/hydraulic/yellow-resv-lo-air-press", 0, "BOOL"); +var b_resv_lo_press = props.globals.initNode("/systems/hydraulic/blue-resv-lo-air-press", 0, "BOOL"); +var g_resv_lo_press = props.globals.initNode("/systems/hydraulic/green-resv-lo-air-press", 0, "BOOL"); + var canvas_lowerECAMPageHyd = { new: func(svg,name) { @@ -23,6 +32,298 @@ var canvas_lowerECAMPageHyd = # init obj.update_items = [ + props.UpdateManager.FromHashValue("blue", 25, func(val) { + obj["Press-Blue"].setText(sprintf("%s", math.round(val, 50))); + + if (val >= 1500) { + obj["Blue-Line"].setColor(0.0509,0.7529,0.2941); + obj["Blue-Line"].setColorFill(0.0509,0.7529,0.2941); + obj["Blue-Line-Top"].setColorFill(0.0509,0.7529,0.2941); + obj["Blue-Line-Bottom"].setColorFill(0.0509,0.7529,0.2941); + obj["Blue-Indicator"].setColor(0.0509,0.7529,0.2941); + obj["Press-Blue"].setColor(0.0509,0.7529,0.2941); + obj["Blue-label"].setColor(0.8078,0.8039,0.8078); + } else { + obj["Blue-Line"].setColor(0.7333,0.3803,0); + obj["Blue-Line"].setColorFill(0.7333,0.3803,0); + obj["Blue-Line-Top"].setColorFill(0.7333,0.3803,0); + obj["Blue-Line-Bottom"].setColorFill(0.7333,0.3803,0); + obj["Blue-Indicator"].setColor(0.7333,0.3803,0); + obj["Press-Blue"].setColor(0.7333,0.3803,0); + obj["Blue-label"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("yellow", 25, func(val) { + obj["Press-Yellow"].setText(sprintf("%s", math.round(val, 50))); + + if (val >= 1500) { + obj["Yellow-Line"].setColor(0.0509,0.7529,0.2941); + obj["Yellow-Line"].setColorFill(0.0509,0.7529,0.2941); + obj["Yellow-Line-Top"].setColorFill(0.0509,0.7529,0.2941); + obj["Yellow-Line-Middle"].setColorFill(0.0509,0.7529,0.2941); + obj["Yellow-Line-Bottom"].setColorFill(0.0509,0.7529,0.2941); + obj["Yellow-Indicator"].setColor(0.0509,0.7529,0.2941); + obj["Press-Yellow"].setColor(0.0509,0.7529,0.2941); + obj["Yellow-label"].setColor(0.8078,0.8039,0.8078); + } else { + obj["Yellow-Line"].setColor(0.7333,0.3803,0); + obj["Yellow-Line"].setColorFill(0.7333,0.3803,0); + obj["Yellow-Line-Top"].setColorFill(0.7333,0.3803,0); + obj["Yellow-Line-Middle"].setColorFill(0.7333,0.3803,0); + obj["Yellow-Line-Bottom"].setColorFill(0.7333,0.3803,0); + obj["Yellow-Indicator"].setColor(0.7333,0.3803,0); + obj["Press-Yellow"].setColor(0.7333,0.3803,0); + obj["Yellow-label"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("green", 25, func(val) { + obj["Press-Green"].setText(sprintf("%s", math.round(val, 50))); + + if (val >= 1500) { + obj["Green-Line"].setColor(0.0509,0.7529,0.2941); + obj["Green-Line"].setColorFill(0.0509,0.7529,0.2941); + obj["Green-Line-Top"].setColorFill(0.0509,0.7529,0.2941); + obj["Green-Line-Middle"].setColorFill(0.0509,0.7529,0.2941); + obj["Green-Line-Bottom"].setColorFill(0.0509,0.7529,0.2941); + obj["Green-Indicator"].setColor(0.0509,0.7529,0.2941); + obj["Press-Green"].setColor(0.0509,0.7529,0.2941); + obj["Green-label"].setColor(0.8078,0.8039,0.8078); + } else { + obj["Green-Line"].setColor(0.7333,0.3803,0); + obj["Green-Line"].setColorFill(0.7333,0.3803,0); + obj["Green-Line-Top"].setColorFill(0.7333,0.3803,0); + obj["Green-Line-Middle"].setColorFill(0.7333,0.3803,0); + obj["Green-Line-Bottom"].setColorFill(0.7333,0.3803,0); + obj["Green-Indicator"].setColor(0.7333,0.3803,0); + obj["Press-Green"].setColor(0.7333,0.3803,0); + obj["Green-label"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("N2_actual_1", 0.5, func(val) { + if (val >= 59) { + obj["Pump-Green-label"].setColor(0.8078,0.8039,0.8078); + } else { + obj["Pump-Green-label"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("N2_actual_2", 0.5, func(val) { + if (val >= 59) { + obj["Pump-Yellow-label"].setColor(0.8078,0.8039,0.8078); + } else { + obj["Pump-Yellow-label"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("hydBlueResvLoPrs", nil, func(val) { + if (val) { + obj["LO-AIR-PRESS-Blue"].show(); + } else { + obj["LO-AIR-PRESS-Blue"].hide(); + } + }), + props.UpdateManager.FromHashValue("hydGreenResvLoPrs", nil, func(val) { + if (val) { + obj["LO-AIR-PRESS-Green"].show(); + } else { + obj["LO-AIR-PRESS-Green"].hide(); + } + }), + props.UpdateManager.FromHashValue("hydYellowResvLoPrs", nil, func(val) { + if (val) { + obj["LO-AIR-PRESS-Yellow"].show(); + } else { + obj["LO-AIR-PRESS-Yellow"].hide(); + } + }), + props.UpdateManager.FromHashValue("hydYellowElecPumpOvht", nil, func(val) { + if (val) { + obj["ELEC-OVHT-Yellow"].show(); + } else { + obj["ELEC-OVHT-Yellow"].hide(); + } + }), + props.UpdateManager.FromHashValue("hydBlueElecPumpOvht", nil, func(val) { + if (val) { + obj["ELEC-OVHT-Blue"].show(); + } else { + obj["ELEC-OVHT-Blue"].hide(); + } + }), + props.UpdateManager.FromHashValue("hydBlueResvOvht", nil, func(val) { + if (val) { + obj["OVHT-Blue"].show(); + } else { + obj["OVHT-Blue"].hide(); + } + }), + props.UpdateManager.FromHashValue("hydGreenResvOvht", nil, func(val) { + if (val) { + obj["OVHT-Green"].show(); + } else { + obj["OVHT-Green"].hide(); + } + }), + props.UpdateManager.FromHashValue("hydYellowResvOvht", nil, func(val) { + if (val) { + obj["OVHT-Yellow"].show(); + } else { + obj["OVHT-Yellow"].hide(); + } + }), + props.UpdateManager.FromHashValue("hydRATPosition", 0.01, func(val) { + if (val) { + obj["RAT-stowed"].hide(); + obj["RAT-not-stowed"].show(); + } else { + obj["RAT-stowed"].show(); + obj["RAT-not-stowed"].hide(); + } + }), + props.UpdateManager.FromHashValue("hydGreenFireValve", 0.01, func(val) { + if (val != 0) { + obj["Fire-Valve-Green"].setColor(0.7333,0.3803,0); + obj["Fire-Valve-Green-Cross"].setColorFill(0.7333,0.3803,0); + obj["Fire-Valve-Green"].setRotation(90 * D2R); + } else { + obj["Fire-Valve-Green"].setColor(0.0509,0.7529,0.2941); + obj["Fire-Valve-Green-Cross"].setColorFill(0.0509,0.7529,0.2941); + obj["Fire-Valve-Green"].setRotation(0); + } + }), + props.UpdateManager.FromHashValue("hydYellowFireValve", 0.01, func(val) { + if (val != 0) { + obj["Fire-Valve-Yellow"].setColor(0.7333,0.3803,0); + obj["Fire-Valve-Yellow-Cross"].setColorFill(0.7333,0.3803,0); + obj["Fire-Valve-Yellow"].setRotation(90 * D2R); + } else { + obj["Fire-Valve-Yellow"].setColor(0.0509,0.7529,0.2941); + obj["Fire-Valve-Yellow-Cross"].setColorFill(0.0509,0.7529,0.2941); + obj["Fire-Valve-Yellow"].setRotation(0); + } + }), + props.UpdateManager.FromHashValue("elecAC1", 1, func(val) { + if (val >= 110) { + obj["ELEC-Blue-label"].setColor(0.8078,0.8039,0.8078); + } else { + obj["ELEC-Blue-label"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("elecAC2", 1, func(val) { + if (val >= 110) { + obj["ELEC-Yellow-label"].setColor(0.8078,0.8039,0.8078); + } else { + obj["ELEC-Yellow-label"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashList(["yellow","hydYellowElecPumpSwitch"], nil, func(val) { + if (!val.hydYellowElecPumpSwitch) { + obj["ELEC-Yellow-on"].hide(); + obj["ELEC-Yellow-off"].show(); + } else { + obj["ELEC-Yellow-on"].show(); + obj["ELEC-Yellow-off"].hide(); + if (val.yellow >= 1500) { + obj["ELEC-Yellow-on"].setColor(0.0509,0.7529,0.2941); + } else { + obj["ELEC-Yellow-on"].setColor(0.7333,0.3803,0); + } + } + }), + props.UpdateManager.FromHashList(["blue","hydBlueElecPumpSwitch"], nil, func(val) { + if (val.hydBlueElecPumpSwitch) { + obj["Pump-Blue-off"].hide(); + if (val.blue >= 1500) { + obj["Pump-Blue-on"].show(); + obj["Pump-Blue-off"].hide(); + obj["Pump-Blue"].setColorFill(0.0509,0.7529,0.2941); + obj["Pump-Blue"].setColor(0.0509,0.7529,0.2941); + } else { + obj["Pump-Blue-off"].show(); + obj["Pump-Blue-on"].hide(); + obj["Pump-Blue"].setColorFill(0.7333,0.3803,0); + obj["Pump-Blue"].setColor(0.7333,0.3803,0); + } + } else { + obj["Pump-Blue-off"].show(); + obj["Pump-Blue-on"].hide(); + obj["Pump-Blue"].setColorFill(0.7333,0.3803,0); + obj["Pump-Blue"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashList(["yellow","hydYellowEDPPumpSwitch"], nil, func(val) { + if (val.hydYellowEDPPumpSwitch) { + obj["Pump-Yellow-off"].hide(); + if (val.yellow >= 1500) { + obj["Pump-Yellow-on"].show(); + obj["Pump-LOPR-Yellow"].hide(); + obj["Pump-Yellow"].setColorFill(0.0509,0.7529,0.2941); + obj["Pump-Yellow"].setColor(0.0509,0.7529,0.2941); + } else { + obj["Pump-Yellow-on"].hide(); + obj["Pump-LOPR-Yellow"].show(); + obj["Pump-Yellow"].setColorFill(0.7333,0.3803,0); + obj["Pump-Yellow"].setColor(0.7333,0.3803,0); + } + } else { + obj["Pump-Yellow-off"].show(); + obj["Pump-Yellow-on"].hide(); + obj["Pump-LOPR-Yellow"].hide(); + obj["Pump-Yellow"].setColorFill(0.7333,0.3803,0); + obj["Pump-Yellow"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashList(["green","hydGreenEDPPumpSwitch"], nil, func(val) { + if (val.hydGreenEDPPumpSwitch) { + obj["Pump-Green-off"].hide(); + if (val.green >= 1500) { + obj["Pump-Green-on"].show(); + obj["Pump-LOPR-Green"].hide(); + obj["Pump-Green"].setColor(0.0509,0.7529,0.2941); + obj["Pump-Green"].setColorFill(0.0509,0.7529,0.2941); + } else { + obj["Pump-Green-on"].hide(); + obj["Pump-LOPR-Green"].show(); + obj["Pump-Green"].setColor(0.7333,0.3803,0); + obj["Pump-Green"].setColorFill(0.7333,0.3803,0); + } + } else { + obj["Pump-Green-off"].show(); + obj["Pump-Green-on"].hide(); + obj["Pump-LOPR-Green"].hide(); + obj["Pump-Green"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashList(["hydPTUSwitch","hydPTUDiff","hydPTUActive","hydPTUFault"], nil, func(val) { + if (val.hydPTUSwitch and !val.hydPTUFault) { + obj["PTU-connection"].setColor(0.0509,0.7529,0.2941); + + if (val.hydPTUActive) { + if (val.hydPTUDiff < 0) { + obj["PTU-Supply-Line"].show(); + obj["PTU-supply-yellow"].show(); + obj["PTU-supply-green"].hide(); + obj["PTU-Auto-or-off"].hide(); + } else { + obj["PTU-Supply-Line"].show(); + obj["PTU-supply-yellow"].hide(); + obj["PTU-supply-green"].show(); + obj["PTU-Auto-or-off"].hide(); + } + } else { + obj["PTU-Auto-or-off"].setColor(0.0509,0.7529,0.2941); + obj["PTU-Supply-Line"].hide(); + obj["PTU-supply-yellow"].hide(); + obj["PTU-supply-green"].hide(); + obj["PTU-Auto-or-off"].show(); + } + } else { + obj["PTU-connection"].setColor(0.7333,0.3803,0); + obj["PTU-Auto-or-off"].setColor(0.7333,0.3803,0); + obj["PTU-Supply-Line"].hide(); + obj["PTU-supply-yellow"].hide(); + obj["PTU-supply-green"].hide(); + obj["PTU-Auto-or-off"].show(); + } + }), ]; obj.displayedGForce = 0; @@ -62,10 +363,11 @@ var canvas_lowerECAMPageHyd = return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; }, getKeys: func() { - return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", - "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", - "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", - "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","Green-Indicator","Blue-Indicator","Yellow-Indicator","Press-Green","Press-Blue","Press-Yellow","Green-Line","Blue-Line","Yellow-Line","Green-Line-Top","Blue-Line-Top","Yellow-Line-Middle","Green-Line-Middle","Yellow-Line-Bottom","Green-Line-Bottom","Blue-Line-Bottom","Yellow-Line-Top","PTU-Supply-Line","PTU-supply-yellow","PTU-supply-green","PTU-connection", + "PTU-Auto-or-off","RAT-label","RAT-stowed","RAT-not-stowed","ELEC-Yellow-off","ELEC-Yellow-on","ELEC-Yellow-label","ELEC-OVTH-Yellow","ELEC-Blue-label","ELEC-OVHT-Blue","ELEC-OVHT-Yellow","Pump-Green-label","Pump-Yellow-label","Pump-Green", + "Pump-LOPR-Green","Pump-Green-off","Pump-Green-on","Pump-Yellow","Pump-LOPR-Yellow","Pump-Yellow-off","Pump-Yellow-on","Pump-Blue", "Pump-Blue-off","Pump-Blue-on","Fire-Valve-Green","Fire-Valve-Yellow","LO-AIR-PRESS-Green", + "LO-AIR-PRESS-Yellow","LO-AIR-PRESS-Blue","OVHT-Green","OVHT-Blue","OVHT-Yellow","Quantity-Indicator-Green","Quantity-Indicator-Blue","Quantity-Indicator-Yellow","Green-label","Blue-label","Yellow-label","Fire-Valve-Yellow-Cross","Fire-Valve-Green-Cross"]; + }, updateBottom: func(notification) { foreach(var update_item_bottom; me.updateItemsBottom) { @@ -140,6 +442,25 @@ var canvas_lowerECAMPageHyd = }; var input = { + hydBlueResvOvht: "/systems/hydraulic/blue-resv-ovht", + hydGreenResvOvht: "/systems/hydraulic/green-resv-ovht", + hydYellowResvOvht: "/systems/hydraulic/yellow-resv-ovht", + hydBlueResvLoPrs: "/systems/hydraulic/blue-resv-lo-air-press", + hydGreenResvLoPrs: "/systems/hydraulic/green-resv-lo-air-press", + hydYellowResvLoPrs: "/systems/hydraulic/yellow-resv-lo-air-press", + hydYellowElecPumpOvht: "/systems/hydraulic/elec-pump-yellow-ovht", + hydBlueElecPumpOvht: "/systems/hydraulic/elec-pump-blue-ovht", + hydRATPosition: "/systems/hydraulic/sources/rat/position", + hydGreenFireValve: "/systems/hydraulic/sources/green-edp/fire-valve", + hydYellowFireValve: "/systems/hydraulic/sources/yellow-edp/fire-valve", + hydBlueElecPumpSwitch: "/controls/hydraulic/switches/blue-elec", + hydGreenEDPPumpSwitch: "/controls/hydraulic/switches/green-edp", + hydYellowElecPumpSwitch: "/controls/hydraulic/switches/yellow-elec", + hydYellowEDPPumpSwitch: "/controls/hydraulic/switches/yellow-edp", + hydPTUSwitch: "/controls/hydraulic/switches/ptu", + hydPTUFault: "/systems/failures/hydraulic/ptu", + hydPTUActive: "/systems/hydraulic/sources/ptu/ptu-hydraulic-condition", + hydPTUDiff: "/systems/hydraulic/yellow-psi-diff", }; foreach (var name; keys(input)) { diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas index f2e2719a..06ad2546 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas @@ -111,11 +111,6 @@ var gLoad = props.globals.getNode("", 1); var blue_psi = 0; var green_psi = 0; var yellow_psi = 0; -var y_resv_lo_air_press = props.globals.getNode("/systems/hydraulic/yellow-resv-lo-air-press", 1); -var b_resv_lo_air_press = props.globals.getNode("/systems/hydraulic/blue-resv-lo-air-press", 1); -var g_resv_lo_air_press = props.globals.getNode("/systems/hydraulic/green-resv-lo-air-press", 1); -var elec_pump_y_ovht = props.globals.getNode("/systems/hydraulic/elec-pump-yellow-ovht", 1); -var elec_pump_b_ovht = props.globals.getNode("/systems/hydraulic/elec-pump-blue-ovht", 1); var rat_deployed = props.globals.getNode("/controls/hydraulic/rat-deployed", 1); var y_resv_ovht = props.globals.getNode("/systems/hydraulic/yellow-resv-ovht", 1); var b_resv_ovht = props.globals.getNode("/systems/hydraulic/blue-resv-ovht", 1); @@ -1471,276 +1466,4 @@ var canvas_lowerECAM_eng = { me.updateBottomStatus(); }, }; - - - }, -}; - -var canvas_lowerECAM_hyd = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_hyd, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","Green-Indicator","Blue-Indicator","Yellow-Indicator","Press-Green","Press-Blue","Press-Yellow","Green-Line","Blue-Line","Yellow-Line","PTU-Supply-Line","PTU-supply-yellow","PTU-supply-green","PTU-connection", - "PTU-Auto-or-off","RAT-label","RAT-stowed","RAT-not-stowed","ELEC-Yellow-off","ELEC-Yellow-on","ELEC-Yellow-label","ELEC-OVTH-Yellow","ELEC-Blue-label","ELEC-OVHT-Blue","ELEC-OVHT-Yellow","Pump-Green-label","Pump-Yellow-label","Pump-Green", - "Pump-LOPR-Green","Pump-Green-off","Pump-Green-on","Pump-Yellow","Pump-LOPR-Yellow","Pump-Yellow-off","Pump-Yellow-on","Pump-Blue", "Pump-Blue-off","Pump-Blue-on","Fire-Valve-Green","Fire-Valve-Yellow","LO-AIR-PRESS-Green", - "LO-AIR-PRESS-Yellow","LO-AIR-PRESS-Blue","OVHT-Green","OVHT-Blue","OVHT-Yellow","Quantity-Indicator-Green","Quantity-Indicator-Blue","Quantity-Indicator-Yellow","Green-label","Blue-label","Yellow-label"]; - }, - update: func() { - blue_psi = systems.HYD.Psi.blue.getValue(); - green_psi = systems.HYD.Psi.green.getValue(); - yellow_psi = systems.HYD.Psi.yellow.getValue(); - - me["Press-Green"].setText(sprintf("%s", math.round(green_psi, 50))); - me["Press-Blue"].setText(sprintf("%s", math.round(blue_psi, 50))); - me["Press-Yellow"].setText(sprintf("%s", math.round(yellow_psi, 50))); - - if (blue_psi >= 1500) { - me["Blue-Line"].setColor(0.0509,0.7529,0.2941); - me["Blue-Line"].setColorFill(0.0509,0.7529,0.2941); - me["Blue-Indicator"].setColor(0.0509,0.7529,0.2941); - me["Press-Blue"].setColor(0.0509,0.7529,0.2941); - me["Blue-label"].setColor(0.8078,0.8039,0.8078); - } else { - me["Blue-Line"].setColor(0.7333,0.3803,0); - me["Blue-Line"].setColorFill(0.7333,0.3803,0); - me["Blue-Indicator"].setColor(0.7333,0.3803,0); - me["Press-Blue"].setColor(0.7333,0.3803,0); - me["Blue-label"].setColor(0.7333,0.3803,0); - } - - if (yellow_psi >= 1500) { - me["Yellow-Line"].setColor(0.0509,0.7529,0.2941); - me["Yellow-Line"].setColorFill(0.0509,0.7529,0.2941); - me["Yellow-Indicator"].setColor(0.0509,0.7529,0.2941); - me["Press-Yellow"].setColor(0.0509,0.7529,0.2941); - me["Yellow-label"].setColor(0.8078,0.8039,0.8078); - } else { - me["Yellow-Line"].setColor(0.7333,0.3803,0); - me["Yellow-Line"].setColorFill(0.7333,0.3803,0); - me["Yellow-Indicator"].setColor(0.7333,0.3803,0); - me["Press-Yellow"].setColor(0.7333,0.3803,0); - me["Yellow-label"].setColor(0.7333,0.3803,0); - } - - if (green_psi >= 1500) { - me["Green-Line"].setColor(0.0509,0.7529,0.2941); - me["Green-Line"].setColorFill(0.0509,0.7529,0.2941); - me["Green-Indicator"].setColor(0.0509,0.7529,0.2941); - me["Press-Green"].setColor(0.0509,0.7529,0.2941); - me["Green-label"].setColor(0.8078,0.8039,0.8078); - } else { - me["Green-Line"].setColor(0.7333,0.3803,0); - me["Green-Line"].setColorFill(0.7333,0.3803,0); - me["Green-Indicator"].setColor(0.7333,0.3803,0); - me["Press-Green"].setColor(0.7333,0.3803,0); - me["Green-label"].setColor(0.7333,0.3803,0); - } - - if (systems.HYD.Switch.ptu.getValue() and !systems.HYD.Fail.ptuFault.getValue()) { - me["PTU-connection"].setColor(0.0509,0.7529,0.2941); - - if (systems.HYD.Ptu.active.getValue()) { - if (systems.HYD.Ptu.diff.getValue() < 0) { - me["PTU-Supply-Line"].show(); - me["PTU-supply-yellow"].show(); - me["PTU-supply-green"].hide(); - me["PTU-Auto-or-off"].hide(); - } else { - me["PTU-Supply-Line"].show(); - me["PTU-supply-yellow"].hide(); - me["PTU-supply-green"].show(); - me["PTU-Auto-or-off"].hide(); - } - } else { - me["PTU-Auto-or-off"].setColor(0.0509,0.7529,0.2941); - me["PTU-Supply-Line"].hide(); - me["PTU-supply-yellow"].hide(); - me["PTU-supply-green"].hide(); - me["PTU-Auto-or-off"].show(); - } - } else { - me["PTU-connection"].setColor(0.7333,0.3803,0); - me["PTU-Auto-or-off"].setColor(0.7333,0.3803,0); - me["PTU-Supply-Line"].hide(); - me["PTU-supply-yellow"].hide(); - me["PTU-supply-green"].hide(); - me["PTU-Auto-or-off"].show(); - } - - 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 (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); - } - - if (systems.HYD.Switch.greenEDP.getValue()) { - me["Pump-Green-off"].hide(); - if (green_psi >= 1500) { - me["Pump-Green-on"].show(); - me["Pump-LOPR-Green"].hide(); - me["Pump-Green"].setColor(0.0509,0.7529,0.2941); - me["Pump-Green"].setColorFill(0.0509,0.7529,0.2941); - } else { - me["Pump-Green-on"].hide(); - me["Pump-LOPR-Green"].show(); - me["Pump-Green"].setColor(0.7333,0.3803,0); - me["Pump-Green"].setColorFill(0.7333,0.3803,0); - } - } else { - me["Pump-Green-off"].show(); - me["Pump-Green-on"].hide(); - me["Pump-LOPR-Green"].hide(); - me["Pump-Green"].setColor(0.7333,0.3803,0); - } - - if (systems.HYD.Switch.yellowEDP.getValue()) { - me["Pump-Yellow-off"].hide(); - if (yellow_psi >= 1500) { - me["Pump-Yellow-on"].show(); - me["Pump-LOPR-Yellow"].hide(); - me["Pump-Yellow"].setColorFill(0.0509,0.7529,0.2941); - me["Pump-Yellow"].setColor(0.0509,0.7529,0.2941); - } else { - me["Pump-Yellow-on"].hide(); - me["Pump-LOPR-Yellow"].show(); - me["Pump-Yellow"].setColorFill(0.7333,0.3803,0); - me["Pump-Yellow"].setColor(0.7333,0.3803,0); - } - } else { - me["Pump-Yellow-off"].show(); - me["Pump-Yellow-on"].hide(); - me["Pump-LOPR-Yellow"].hide(); - me["Pump-Yellow"].setColorFill(0.7333,0.3803,0); - me["Pump-Yellow"].setColor(0.7333,0.3803,0); - } - - if (systems.HYD.Switch.blueElec.getValue()) { - me["Pump-Blue-off"].hide(); - if (blue_psi >= 1500) { - me["Pump-Blue-on"].show(); - me["Pump-Blue-off"].hide(); - me["Pump-Blue"].setColorFill(0.0509,0.7529,0.2941); - me["Pump-Blue"].setColor(0.0509,0.7529,0.2941); - } else { - me["Pump-Blue-off"].show(); - me["Pump-Blue-on"].hide(); - me["Pump-Blue"].setColorFill(0.7333,0.3803,0); - me["Pump-Blue"].setColor(0.7333,0.3803,0); - } - } else { - me["Pump-Blue-off"].show(); - me["Pump-Blue-on"].hide(); - me["Pump-Blue"].setColorFill(0.7333,0.3803,0); - me["Pump-Blue"].setColor(0.7333,0.3803,0); - } - - if (!systems.HYD.Switch.yellowElec.getValue()) { - me["ELEC-Yellow-on"].hide(); - me["ELEC-Yellow-off"].show(); - } else { - me["ELEC-Yellow-on"].show(); - me["ELEC-Yellow-off"].hide(); - if (yellow_psi >= 1500) { - me["ELEC-Yellow-on"].setColor(0.0509,0.7529,0.2941); - } else { - me["ELEC-Yellow-on"].setColor(0.7333,0.3803,0); - } - } - - if (y_resv_lo_air_press.getValue()) { - me["LO-AIR-PRESS-Yellow"].show(); - } else { - me["LO-AIR-PRESS-Yellow"].hide(); - } - - if (b_resv_lo_air_press.getValue()) { - me["LO-AIR-PRESS-Blue"].show(); - } else { - me["LO-AIR-PRESS-Blue"].hide(); - } - - if (g_resv_lo_air_press.getValue()) { - me["LO-AIR-PRESS-Green"].show(); - } else { - me["LO-AIR-PRESS-Green"].hide(); - } - - if (elec_pump_y_ovht.getValue()) { - me["ELEC-OVHT-Yellow"].show(); - } else { - me["ELEC-OVHT-Yellow"].hide(); - } - - if (elec_pump_b_ovht.getValue()) { - me["ELEC-OVHT-Blue"].show(); - } else { - me["ELEC-OVHT-Blue"].hide(); - } - - if (systems.HYD.Rat.position.getValue()) { - me["RAT-stowed"].hide(); - me["RAT-not-stowed"].show(); - } else { - me["RAT-stowed"].show(); - me["RAT-not-stowed"].hide(); - } - - if (y_resv_ovht.getValue()) { - me["OVHT-Yellow"].show(); - } else { - me["OVHT-Yellow"].hide(); - } - - if (b_resv_ovht.getValue()) { - me["OVHT-Green"].show(); - } else { - me["OVHT-Green"].hide(); - } - - if (g_resv_ovht.getValue()) { - me["OVHT-Blue"].show(); - } else { - me["OVHT-Blue"].hide(); - } - - if (systems.ELEC.Bus.ac1.getValue() >= 110) { - me["ELEC-Blue-label"].setColor(0.8078,0.8039,0.8078); - } else { - me["ELEC-Blue-label"].setColor(0.7333,0.3803,0); - } - - if (systems.ELEC.Bus.ac2.getValue() >= 110) { - me["ELEC-Yellow-label"].setColor(0.8078,0.8039,0.8078); - } else { - me["ELEC-Yellow-label"].setColor(0.7333,0.3803,0); - } - - if (systems.HYD.Valve.yellowFire.getValue() != 0) { - me["Fire-Valve-Yellow"].setColor(0.7333,0.3803,0); - me["Fire-Valve-Yellow"].setRotation(90 * D2R); - } else { - me["Fire-Valve-Yellow"].setColor(0.0509,0.7529,0.2941); - me["Fire-Valve-Yellow"].setRotation(0); - } - - if (systems.HYD.Valve.greenFire.getValue() != 0) { - me["Fire-Valve-Green"].setColor(0.7333,0.3803,0); - me["Fire-Valve-Green"].setRotation(90 * D2R); - } else { - me["Fire-Valve-Green"].setColor(0.0509,0.7529,0.2941); - me["Fire-Valve-Green"].setRotation(0); - } - - me.updateBottomStatus(); - }, -}; \ No newline at end of file + \ No newline at end of file diff --git a/Models/Instruments/Lower-ECAM/res/hyd.svg b/Models/Instruments/Lower-ECAM/res/hyd.svg index 641a4b4c..cf008563 100644 --- a/Models/Instruments/Lower-ECAM/res/hyd.svg +++ b/Models/Instruments/Lower-ECAM/res/hyd.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="hyd.svg"> @@ -56,9 +56,9 @@ inkscape:window-height="705" id="namedview371" showgrid="true" - inkscape:zoom="4.0298682" - inkscape:cx="632.99286" - inkscape:cy="609.55322" + inkscape:zoom="0.71238678" + inkscape:cx="802.52236" + inkscape:cy="594.9486" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" @@ -84,8 +84,9 @@ x="817.61298" height="5.1203089" width="53.195583" - id="rect5105-2-5-3" - style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + id="Fire-Valve-Green-Cross" + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:label="#rect5105-2-5-3" /> + id="Fire-Valve-Yellow-Cross" + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:label="#rect5105-2-5-3-8" /> + id="Green-Line-Bottom" + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1.5107255;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:label="#rect5105-6-0-7-8-6-8-8-7-3-8" /> + id="Green-Line-Middle" + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1.31405532;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:label="#rect5105-6-0-7-8-6-8-8-7-3-8-6" /> + id="Green-Line-Top" + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:3.44869995;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:label="#rect5105-6-0-7-8-6-8-8-7-3-8-6-8" /> + id="Yellow-Line-Bottom" + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1.47072661;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:label="#rect5105-6-0-7-8-6-8-8-7-3-8-8" /> + id="Yellow-Line-Middle" + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1.24083376;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:label="#rect5105-6-0-7-8-6-8-8-7-3-8-6-4" /> + id="Yellow-Line-Top" + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:3.50812292;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:label="#rect5105-6-0-7-8-6-8-8-7-3-8-6-8-3" /> + id="Blue-Line-Top" + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:3.83536959;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:label="#rect5105-6-0-7-8-6-8-8-7-3-8-6-8-9" /> + id="Blue-Line-Bottom" + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:2.05138826;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:label="#rect5105-6-0-7-8-6-8-8-7-3-8-6-8-9-6" /> 00 - Date: Sun, 18 Jul 2021 20:58:09 +0100 Subject: [PATCH 82/96] Bleed page --- .../Lower-ECAM/Lower-ECAM-bleed.nas | 367 +++++++++- .../Lower-ECAM/Lower-ECAM-elec.nas | 20 +- .../Instruments/Lower-ECAM/Lower-ECAM-old.nas | 690 +----------------- Models/Instruments/Lower-ECAM/res/bleed.svg | 34 +- 4 files changed, 402 insertions(+), 709 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-bleed.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-bleed.nas index 61f8a7f1..432df33e 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-bleed.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-bleed.nas @@ -23,6 +23,328 @@ var canvas_lowerECAMPageBleed = # init obj.update_items = [ + props.UpdateManager.FromHashList(["BleedCrossbleedCmd","BleedCrossbleed"], nil, func(val) { + if (val.BleedCrossbleedCmd != val.BleedCrossbleed) { + obj["BLEED-XFEED"].setColor(0.7333,0.3803,0); + obj["BLEED-XFEED-Cross"].setColorFill(0.7333,0.3803,0); + } else { + obj["BLEED-XFEED"].setColor(0.0509,0.7529,0.2941); + obj["BLEED-XFEED-Cross"].setColorFill(0.0509,0.7529,0.2941); + } + + if (val.BleedCrossbleedCmd == val.BleedCrossbleed) { + if (val.BleedCrossbleedCmd) { + obj["BLEED-XFEED"].setRotation(0); + } else { + obj["BLEED-XFEED"].setRotation(90 * D2R); + } + } else { + obj["BLEED-XFEED"].setRotation(45 * D2R); + } + + if (val.BleedCrossbleed == 1) { + obj["BLEED-xbleedCenter"].show(); + obj["BLEED-xbleedRight"].show(); + } else { + obj["BLEED-xbleedCenter"].hide(); + obj["BLEED-xbleedRight"].hide(); + } + }), + props.UpdateManager.FromHashList(["BleedHPValve1","BleedHPValve1Cmd"], nil, func(val) { + if (val.BleedHPValve1Cmd == 1) { + obj["BLEED-HP-Valve-1"].setRotation(90 * D2R); + obj["BLEED-HP-1-connection"].show(); + } else { + obj["BLEED-HP-Valve-1"].setRotation(0); + obj["BLEED-HP-1-connection"].hide(); + } + + if (val.BleedHPValve1Cmd == val.BleedHPValve1) { + obj["BLEED-HP-Valve-1"].setColor(0.0509,0.7529,0.2941); + } else { + obj["BLEED-HP-Valve-1"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashList(["BleedHPValve2","BleedHPValve2Cmd"], nil, func(val) { + if (val.BleedHPValve2Cmd == 1) { + obj["BLEED-HP-Valve-2"].setRotation(90 * D2R); + obj["BLEED-HP-2-connection"].show(); + } else { + obj["BLEED-HP-Valve-2"].setRotation(0); + obj["BLEED-HP-2-connection"].hide(); + } + + if (val.BleedHPValve2Cmd == val.BleedHPValve2) { + obj["BLEED-HP-Valve-2"].setColor(0.0509,0.7529,0.2941); + } else { + obj["BLEED-HP-Valve-2"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashList(["BleedPRVValve1Cmd","BleedPRVValve1"], nil, func(val) { + if (val.BleedPRVValve1 == 0) { + obj["BLEED-ENG-1"].setRotation(0); + } else { + obj["BLEED-ENG-1"].setRotation(90 * D2R); + } + + if (val.BleedPRVValve1Cmd == val.BleedPRVValve1) { + obj["BLEED-ENG-1"].setColor(0.0509,0.7529,0.2941); + obj["BLEED-ENG-1-Cross"].setColorFill(0.0509,0.7529,0.2941); + } else { + obj["BLEED-ENG-1"].setColor(0.7333,0.3803,0); + obj["BLEED-ENG-1-Cross"].setColorFill(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashList(["BleedPRVValve2Cmd","BleedPRVValve2"], nil, func(val) { + if (val.BleedPRVValve2 == 0) { + obj["BLEED-ENG-2"].setRotation(0); + } else { + obj["BLEED-ENG-2"].setRotation(90 * D2R); + } + + if (val.BleedPRVValve2Cmd == val.BleedPRVValve2) { + obj["BLEED-ENG-2"].setColor(0.0509,0.7529,0.2941); + obj["BLEED-ENG-2-Cross"].setColorFill(0.0509,0.7529,0.2941); + } else { + obj["BLEED-ENG-2"].setColor(0.7333,0.3803,0); + obj["BLEED-ENG-2-Cross"].setColorFill(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("gear1Wow", nil, func(val) { + if (val) { + obj["BLEED-GND"].show(); + } else { + obj["BLEED-GND"].hide(); + } + }), + props.UpdateManager.FromHashValue("IceWingSw", nil, func(val) { + if (val) { + obj["BLEED-Anti-Ice-Left"].show(); + obj["BLEED-Anti-Ice-Right"].show(); + } else { + obj["BLEED-Anti-Ice-Left"].hide(); + obj["BLEED-Anti-Ice-Right"].hide(); + } + }), + props.UpdateManager.FromHashValue("N2_actual_1", nil, func(val) { + if (val >= 59) { + obj["BLEED-ENG-1-label"].setColor(0.8078,0.8039,0.8078); + } else { + obj["BLEED-ENG-1-label"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("N2_actual_2", nil, func(val) { + if (val >= 59) { + obj["BLEED-ENG-2-label"].setColor(0.8078,0.8039,0.8078); + } else { + obj["BLEED-ENG-2-label"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashList(["BleedBMC1Working","BleedPreCoolerPSI1"], nil, func(val) { + if (val.BleedBMC1Working) { + obj["BLEED-Precooler-1-Inlet-Press"].setText(sprintf("%s", math.round(val.BleedPreCoolerPSI1))); + if (val.BleedPreCoolerPSI1 < 4 or val.BleedPreCoolerPSI1 > 57) { + obj["BLEED-Precooler-1-Inlet-Press"].setColor(0.7333,0.3803,0); + } else { + obj["BLEED-Precooler-1-Inlet-Press"].setColor(0.0509,0.7529,0.2941); + } + } else { + obj["BLEED-Precooler-1-Inlet-Press"].setText(sprintf("%s", "XX")); + obj["BLEED-Precooler-1-Inlet-Press"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashList(["BleedBMC2Working","BleedPreCoolerPSI2"], nil, func(val) { + if (val.BleedBMC2Working) { + obj["BLEED-Precooler-2-Inlet-Press"].setText(sprintf("%s", math.round(val.BleedPreCoolerPSI2))); + if (val.BleedPreCoolerPSI2 < 4 or val.BleedPreCoolerPSI2 > 57) { + obj["BLEED-Precooler-2-Inlet-Press"].setColor(0.7333,0.3803,0); + } else { + obj["BLEED-Precooler-2-Inlet-Press"].setColor(0.0509,0.7529,0.2941); + } + } else { + obj["BLEED-Precooler-2-Inlet-Press"].setText(sprintf("%s", "XX")); + obj["BLEED-Precooler-2-Inlet-Press"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashList(["BleedBMC1Working","BleedPreCoolerTemp1","BleedPRVValve1Cmd","BleedPreCoolerOvht1"], nil, func(val) { + if (val.BleedBMC1Working) { + obj["BLEED-Precooler-1-Outlet-Temp"].setText(sprintf("%s", math.round(val.BleedPreCoolerTemp1, 5))); + if (val.BleedPRVValve1Cmd and (val.BleedPreCoolerTemp1 < 150 or val.BleedPreCoolerOvht1)) { + obj["BLEED-Precooler-1-Outlet-Temp"].setColor(0.7333,0.3803,0); + } else { + obj["BLEED-Precooler-1-Outlet-Temp"].setColor(0.0509,0.7529,0.2941); + } + } else { + obj["BLEED-Precooler-1-Outlet-Temp"].setText(sprintf("%s", "XX")); + obj["BLEED-Precooler-1-Outlet-Temp"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashList(["BleedBMC2Working","BleedPreCoolerTemp2","BleedPRVValve2Cmd","BleedPreCoolerOvht2"], nil, func(val) { + if (val.BleedBMC2Working) { + obj["BLEED-Precooler-2-Outlet-Temp"].setText(sprintf("%s", math.round(val.BleedPreCoolerTemp2, 5))); + if (val.BleedPRVValve2Cmd and (val.BleedPreCoolerTemp2 < 150 or val.BleedPreCoolerOvht2)) { + obj["BLEED-Precooler-2-Outlet-Temp"].setColor(0.7333,0.3803,0); + } else { + obj["BLEED-Precooler-2-Outlet-Temp"].setColor(0.0509,0.7529,0.2941); + } + } else { + obj["BLEED-Precooler-2-Outlet-Temp"].setText(sprintf("%s", "XX")); + obj["BLEED-Precooler-2-Outlet-Temp"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("Pack1Bypass", 1, func(val) { + obj["BLEED-Pack-1-Bypass-needle"].setRotation((val - 50) * D2R); + }), + props.UpdateManager.FromHashValue("Pack2Bypass", 1, func(val) { + obj["BLEED-Pack-2-Bypass-needle"].setRotation((val - 50) * D2R); + }), + props.UpdateManager.FromHashValue("Pack1OutTemp", 0.25, func(val) { + obj["BLEED-Pack-1-Out-Temp"].setText(sprintf("%s", math.round(val, 5))); + if (val > 90) { + obj["BLEED-Pack-1-Out-Temp"].setColor(0.7333,0.3803,0); + } else { + obj["BLEED-Pack-1-Out-Temp"].setColor(0.0509,0.7529,0.2941); + } + }), + props.UpdateManager.FromHashValue("Pack2OutTemp", 0.25, func(val) { + obj["BLEED-Pack-2-Out-Temp"].setText(sprintf("%s", math.round(val, 5))); + if (val > 90) { + obj["BLEED-Pack-2-Out-Temp"].setColor(0.7333,0.3803,0); + } else { + obj["BLEED-Pack-2-Out-Temp"].setColor(0.0509,0.7529,0.2941); + } + }), + props.UpdateManager.FromHashValue("Pack1OutletTemp", 0.25, func(val) { + obj["BLEED-Pack-1-Comp-Out-Temp"].setText(sprintf("%s", math.round(val, 5))); + if (val > 230) { + obj["BLEED-Pack-1-Comp-Out-Temp"].setColor(0.7333,0.3803,0); + } else { + obj["BLEED-Pack-1-Comp-Out-Temp"].setColor(0.0509,0.7529,0.2941); + } + }), + props.UpdateManager.FromHashValue("Pack2OutletTemp", 0.25, func(val) { + obj["BLEED-Pack-2-Comp-Out-Temp"].setText(sprintf("%s", math.round(val, 5))); + if (val > 230) { + obj["BLEED-Pack-2-Comp-Out-Temp"].setColor(0.7333,0.3803,0); + } else { + obj["BLEED-Pack-2-Comp-Out-Temp"].setColor(0.0509,0.7529,0.2941); + } + }), + props.UpdateManager.FromHashValue("Pack1FlowOutput", 0.5, func(val) { + obj["BLEED-Pack-1-Packflow-needle"].setRotation(val * D2R); + + }), + props.UpdateManager.FromHashValue("Pack2FlowOutput", 0.5, func(val) { + obj["BLEED-Pack-2-Packflow-needle"].setRotation(val * D2R); + }), + props.UpdateManager.FromHashList(["Pack1Switch","flowCtlValve1"], nil, func(val) { + if (val.flowCtlValve1 == 0) { + obj["BLEED-Pack-1-Packflow-needle"].setColorFill(0.7333,0.3803,0); + obj["BLEED-Pack-1-Flow-Valve"].setRotation(90 * D2R); + } else { + obj["BLEED-Pack-1-Packflow-needle"].setColorFill(0.0509,0.7529,0.2941); + obj["BLEED-Pack-1-Flow-Valve"].setRotation(0); + } + + if (val.flowCtlValve1 == val.Pack1Switch) { + obj["BLEED-Pack-1-Flow-Valve"].setColor(0.0509,0.7529,0.2941); + obj["BLEED-Pack-1-Flow-Valve-Cross"].setColorFill(0.0509,0.7529,0.2941); + } else { + obj["BLEED-Pack-1-Flow-Valve"].setColor(0.7333,0.3803,0); + obj["BLEED-Pack-1-Flow-Valve-Cross"].setColorFill(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashList(["Pack2Switch","flowCtlValve2"], nil, func(val) { + if (val.flowCtlValve2 == 0) { + obj["BLEED-Pack-2-Packflow-needle"].setColorFill(0.7333,0.3803,0); + obj["BLEED-Pack-2-Flow-Valve"].setRotation(90 * D2R); + } else { + obj["BLEED-Pack-2-Packflow-needle"].setColorFill(0.0509,0.7529,0.2941); + obj["BLEED-Pack-2-Flow-Valve"].setRotation(0); + } + + if (val.flowCtlValve2 == val.Pack2Switch) { + obj["BLEED-Pack-2-Flow-Valve"].setColor(0.0509,0.7529,0.2941); + obj["BLEED-Pack-2-Flow-Valve-Cross"].setColorFill(0.0509,0.7529,0.2941); + } else { + obj["BLEED-Pack-2-Flow-Valve"].setColor(0.7333,0.3803,0); + obj["BLEED-Pack-2-Flow-Valve-Cross"].setColorFill(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashList(["flowCtlValve1","flowCtlValve2","RamAirValve","gear1Wow"], nil, func(val) { + if (val.RamAirValve == 0) { + obj["BLEED-Ram-Air"].setRotation(90 * D2R); + obj["BLEED-Ram-Air"].setColor(0.0509,0.7529,0.2941); + obj["BLEED-Ram-Air"].setColorFill(0.0509,0.7529,0.2941); + obj["BLEED-Ram-Air-Cross"].setColorFill(0.0509,0.7529,0.2941); + obj["BLEED-Ram-Air-connection"].hide(); + } elsif (val.RamAirValve) { + obj["BLEED-Ram-Air"].setRotation(0); + if (val.gear1Wow) { + obj["BLEED-Ram-Air"].setColor(0.7333,0.3803,0); + obj["BLEED-Ram-Air"].setColorFill(0.7333,0.3803,0); + obj["BLEED-Ram-Air-Cross"].setColorFill(0.7333,0.3803,0); + } else { + obj["BLEED-Ram-Air"].setColor(0.0509,0.7529,0.2941); + obj["BLEED-Ram-Air"].setColorFill(0.0509,0.7529,0.2941); + obj["BLEED-Ram-Air-Cross"].setColorFill(0.0509,0.7529,0.2941); + } + obj["BLEED-Ram-Air-connection"].show(); + } else { + obj["BLEED-Ram-Air"].setRotation(45 * D2R); + obj["BLEED-Ram-Air"].setColor(0.7333,0.3803,0); + obj["BLEED-Ram-Air"].setColorFill(0.7333,0.3803,0); + obj["BLEED-Ram-Air-Cross"].setColorFill(0.7333,0.3803,0); + obj["BLEED-Ram-Air-connection"].show(); + } + + if (val.flowCtlValve1 == 0 and val.flowCtlValve2 == 0) { + if (val.gear1Wow or val.RamAirValve != 1) { + obj["BLEED-cond-1"].setColor(0.7333,0.3803,0); + obj["BLEED-cond-2"].setColor(0.7333,0.3803,0); + obj["BLEED-cond-3"].setColor(0.7333,0.3803,0); + } else { + obj["BLEED-cond-1"].setColor(0.0509,0.7529,0.2941); + obj["BLEED-cond-2"].setColor(0.0509,0.7529,0.2941); + obj["BLEED-cond-3"].setColor(0.0509,0.7529,0.2941); + } + } else { + obj["BLEED-cond-1"].setColor(0.0509,0.7529,0.2941); + obj["BLEED-cond-2"].setColor(0.0509,0.7529,0.2941); + obj["BLEED-cond-3"].setColor(0.0509,0.7529,0.2941); + } + }), + props.UpdateManager.FromHashList(["BleedCrossbleed","apuMaster","apuBleedValvePos","ApuBleedNotOn"], nil, func(val) { + if (val.apuMaster) { + obj["BLEED-APU-LINES"].show(); + if (val.apuBleedValvePos == 1) { + obj["BLEED-APU-CIRCLE"].setRotation(0); + obj["BLEED-APU-connectionTop"].show(); + obj["BLEED-xbleedLeft"].show(); + } else { + obj["BLEED-APU-CIRCLE"].setRotation(90 * D2R); + obj["BLEED-APU-connectionTop"].hide(); + if (val.BleedCrossbleed != 1) { + obj["BLEED-xbleedLeft"].hide(); + } else { + obj["BLEED-xbleedLeft"].show(); + } + } + if (val.ApuBleedNotOn != 1) { + obj["BLEED-APU-CIRCLE"].setColor(0.0509,0.7529,0.2941); + } else { + obj["BLEED-APU-CIRCLE"].setColor(0.7333,0.3803,0); + } + } else { + if (val.BleedCrossbleed != 1) { + obj["BLEED-xbleedLeft"].hide(); + } else { + obj["BLEED-xbleedLeft"].show(); + } + obj["BLEED-APU-LINES"].hide(); + obj["BLEED-APU-connectionTop"].hide(); + } + }), ]; obj.displayedGForce = 0; @@ -62,10 +384,16 @@ var canvas_lowerECAMPageBleed = return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; }, getKeys: func() { - return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", - "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", - "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", - "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + return["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit", "BLEED-XFEED", "BLEED-Ram-Air", "BLEED-Ram-Air-Cross", "BLEED-APU-CIRCLE", "BLEED-HP-Valve-1", "BLEED-XFEED-Cross", + "BLEED-APU-LINES","BLEED-ENG-1", "BLEED-HP-Valve-2", "BLEED-ENG-2", "BLEED-Precooler-1-Inlet-Press", "BLEED-Precooler-1-Outlet-Temp", + "BLEED-Precooler-2-Inlet-Press", "BLEED-Precooler-2-Outlet-Temp", "BLEED-ENG-1-label", "BLEED-ENG-2-label", + "BLEED-GND", "BLEED-Pack-1-Flow-Valve", "BLEED-Pack-2-Flow-Valve", "BLEED-Pack-1-Out-Temp","BLEED-APU-connectionTop", + "BLEED-Pack-1-Comp-Out-Temp", "BLEED-Pack-1-Packflow-needle", "BLEED-Pack-1-Bypass-needle", "BLEED-Pack-2-Out-Temp", + "BLEED-Pack-2-Bypass-needle", "BLEED-Pack-2-Comp-Out-Temp", "BLEED-Pack-2-Packflow-needle", "BLEED-Anti-Ice-Left", + "BLEED-Anti-Ice-Right", "BLEED-HP-2-connection", "BLEED-HP-1-connection", "BLEED-ANTI-ICE-ARROW-LEFT", "BLEED-ANTI-ICE-ARROW-RIGHT", + "BLEED-xbleedLeft","BLEED-xbleedCenter","BLEED-xbleedRight","BLEED-cond-1","BLEED-cond-2","BLEED-cond-3","BLEED-Ram-Air-connection","BLEED-ENG-1-Cross","BLEED-ENG-2-Cross", + "BLEED-Pack-1-Flow-Valve-Cross","BLEED-Pack-2-Flow-Valve-Cross"]; + }, updateBottom: func(notification) { foreach(var update_item_bottom; me.updateItemsBottom) { @@ -140,6 +468,37 @@ var canvas_lowerECAMPageBleed = }; var input = { + ApuBleedNotOn: "/systems/pneumatics/warnings/apu-bleed-not-on", + BleedBMC1Working: "/systems/pneumatics/indicating/bmc1-working", + BleedBMC2Working: "/systems/pneumatics/indicating/bmc2-working", + BleedCrossbleedCmd: "/systems/pneumatics/valves/crossbleed-valve-cmd", + BleedCrossbleed: "/systems/pneumatics/valves/crossbleed-valve", + BleedHPValve1: "/systems/pneumatics/valves/engine-1-hp-valve", + BleedHPValve2: "/systems/pneumatics/valves/engine-2-hp-valve", + BleedHPValve1Cmd: "/systems/pneumatics/valves/engine-1-hp-valve-cmd", + BleedHPValve2Cmd: "/systems/pneumatics/valves/engine-2-hp-valve-cmd", + BleedPRVValve1Cmd: "/controls/pneumatics/switches/bleed-1", + BleedPRVValve2Cmd: "/controls/pneumatics/switches/bleed-2", + BleedPRVValve1: "/systems/pneumatics/valves/engine-1-prv-valve", + BleedPRVValve2: "/systems/pneumatics/valves/engine-2-prv-valve", + BleedPreCoolerPSI1: "/systems/pneumatics/psi/engine-1-psi", + BleedPreCoolerPSI2: "/systems/pneumatics/psi/engine-2-psi", + BleedPreCoolerTemp1: "/systems/pneumatics/precooler/temp-1", + BleedPreCoolerTemp2: "/systems/pneumatics/precooler/temp-2", + BleedPreCoolerOvht1: "/systems/pneumatics/precooler/ovht-1", + BleedPreCoolerOvht2: "/systems/pneumatics/precooler/ovht-2", + Pack1Bypass: "/systems/pneumatics/pack-1-bypass", + Pack2Bypass: "/systems/pneumatics/pack-2-bypass", + Pack1FlowOutput: "/ECAM/Lower/pack-1-flow-output", + Pack2FlowOutput: "/ECAM/Lower/pack-2-flow-output", + Pack1OutTemp: "/systems/air-conditioning/packs/pack-1-output-temp", + Pack2OutTemp: "/systems/air-conditioning/packs/pack-2-output-temp", + Pack1OutletTemp: "/systems/air-conditioning/packs/pack-1-outlet-temp", + Pack2OutletTemp: "/systems/air-conditioning/packs/pack-2-outlet-temp", + Pack1Switch: "/controls/pneumatics/switches/pack-1", + Pack2Switch: "/controls/pneumatics/switches/pack-2", + RamAirValve: "/systems/air-conditioning/valves/ram-air", + IceWingSw: "/controls/ice-protection/wing", }; foreach (var name; keys(input)) { diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas index c6f4a8b6..f42be362 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas @@ -21,6 +21,14 @@ var canvas_lowerECAMPageElec = obj.units = acconfig_weight_kgs.getValue(); # init + obj["IDG1-LOPR"].hide(); + obj["IDG2-LOPR"].hide(); + obj["Shed-label"].hide(); + obj["IDG2-RISE-label"].hide(); + obj["IDG2-RISE-Value"].hide(); + obj["IDG1-RISE-label"].hide(); + obj["IDG1-RISE-Value"].hide(); + obj.update_items = [ ]; @@ -62,10 +70,14 @@ var canvas_lowerECAMPageElec = return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; }, getKeys: func() { - return["Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl", - "Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1", - "AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine", - "Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];}, + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","BAT1-label","Bat1Volt","Bat1Ampere","BAT2-label","Bat2Volt","Bat2Ampere","BAT1-charge","BAT1-discharge","BAT2-charge","BAT2-discharge","ELEC-Line-DC1-DCBAT","ELEC-Line-DC1-DCESS","ELEC-Line-DC2-DCBAT", + "ELEC-Line-DC1-DCESS_DCBAT","ELEC-Line-DC2-DCESS_DCBAT","ELEC-Line-TR1-DC1","ELEC-Line-TR2-DC2","Shed-label","ELEC-Line-ESSTR-DCESS","TR1-label","TR1Volt","TR1Ampere","TR2-label","TR2Volt","TR2Ampere","EMERGEN-group","EmergenVolt","EmergenHz", + "ELEC-Line-Emergen-ESSTR","EMERGEN-Label-off","Emergen-Label","EMERGEN-out","ELEC-Line-ACESS-TRESS","ELEC-Line-AC1-TR1","ELEC-Line-AC2-TR2","ELEC-Line-AC1-ACESS","ELEC-Line-AC2-ACESS","ACESS-SHED","ACESS","AC1-in","AC2-in","ELEC-Line-GEN1-AC1","ELEC-Line-GEN2-AC2", + "ELEC-Line-APU-AC1","ELEC-Line-APU-EXT","ELEC-Line-EXT-AC2","APU-out","EXT-out","EXTPWR-group","ExtVolt","ExtHz","APU-content","APU-border","APUGentext","APUGenLoad","APUGenVolt","APUGenHz","APUGEN-off","GEN1-label","Gen1Load","Gen1Volt","Gen1Hz", + "GEN2-label","Gen2Load","GEN2-off","Gen2Volt","Gen2Hz","ELEC-IDG-1-label","ELEC-IDG-1-num-label","ELEC-IDG-1-Temp","IDG1-LOPR","IDG1-DISC","IDG1-RISE-Value","IDG1-RISE-label","GalleyShed","ELEC-IDG-2-Temp","ELEC-IDG-2-label","ELEC-IDG-2-num-label","IDG2-RISE-label","IDG2-RISE-Value","IDG2-LOPR", + "IDG2-DISC","ESSTR-group","ESSTR","ESSTR-Volt","ESSTR-Ampere","BAT1-content","BAT2-content","BAT1-OFF","BAT2-OFF","GEN1-content","GEN2-content","GEN-1-num-label","GEN-2-num-label","GEN1-off","GEN2-off","GEN1-num-label","GEN2-num-label","EXTPWR-label", + "ELEC-ACESS-SHED-label","ELEC-DCBAT-label","ELEC-DCESS-label","ELEC-DC2-label","ELEC-DC1-label","ELEC-AC1-label","ELEC-AC2-label","ELEC-ACESS-label","ELEC-Line-ESSTR-DCESS-off","ELEC-Line-Emergen-ESSTR-off"]; + }, updateBottom: func(notification) { foreach(var update_item_bottom; me.updateItemsBottom) { diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas index 06ad2546..32c5b1c6 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas @@ -76,25 +76,19 @@ var final_deg = props.globals.getNode("", 1); var temperature_degc = props.globals.getNode("/environment/temperature-degc", 1); var tank3_content_lbs = props.globals.getNode("/fdm/jsbsim/propulsion/tank[2]/contents-lbs", 1); var ir2_knob = props.globals.getNode("/controls/adirs/ir[1]/knob", 1); -var apuBleedNotOn = props.globals.getNode("/systems/pneumatics/warnings/apu-bleed-not-on", 1); +var apuBleedNotOn = props.globals.getNode("", 1); var apu_valve = props.globals.getNode("/systems/pneumatics/valves/apu-bleed-valve-cmd", 1); var apu_valve_state = props.globals.getNode("/systems/pneumatics/valves/apu-bleed-valve", 1); var xbleedcmd = props.globals.getNode("/systems/pneumatics/valves/crossbleed-valve-cmd", 1); var xbleed = props.globals.getNode("/systems/pneumatics/valves/crossbleed-valve", 1); var xbleedstate = nil; -var hp_valve1_state = props.globals.getNode("/systems/pneumatics/valves/engine-1-hp-valve", 1); -var hp_valve2_state = props.globals.getNode("/systems/pneumatics/valves/engine-2-hp-valve", 1); -var hp_valve1 = props.globals.getNode("/systems/pneumatics/valves/engine-1-hp-valve-cmd", 1); -var hp_valve2 = props.globals.getNode("/systems/pneumatics/valves/engine-2-hp-valve-cmd", 1); -var eng_valve1 = props.globals.getNode("/systems/pneumatics/valves/engine-1-prv-valve", 1); -var eng_valve2 = props.globals.getNode("/systems/pneumatics/valves/engine-2-prv-valve", 1); var precooler1_psi = props.globals.getNode("/systems/pneumatics/psi/engine-1-psi", 1); var precooler2_psi = props.globals.getNode("/systems/pneumatics/psi/engine-2-psi", 1); var precooler1_temp = props.globals.getNode("/systems/pneumatics/precooler/temp-1", 1); var precooler2_temp = props.globals.getNode("/systems/pneumatics/precooler/temp-2", 1); var precooler1_ovht = props.globals.getNode("/systems/pneumatics/precooler/ovht-1", 1); var precooler2_ovht = props.globals.getNode("/systems/pneumatics/precooler/ovht-2", 1); -var bmc1working = props.globals.getNode("/systems/pneumatics/indicating/bmc1-working", 1); +var bmc1working = props.globals.getNode("", 1); var bmc2working = props.globals.getNode("/systems/pneumatics/indicating/bmc2-working", 1); var bmc1 = 0; var bmc2 = 0; @@ -142,650 +136,7 @@ var press_vs_norm = props.globals.getNode("", 1); var cabinalt = props.globals.getNode("", 1); var gear0_wow = props.globals.getNode("/gear/gear[0]/wow", 1); -# Create Nodes: - -var canvas_lowerECAM_base = { - init: func(canvas_group, file) { - var font_mapper = func(family, weight) { - return "LiberationFonts/LiberationSans-Regular.ttf"; - }; - - canvas.parsesvg(canvas_group, file, {"font-mapper": font_mapper}); - - var svg_keys = me.getKeys(); - foreach(var key; svg_keys) { - me[key] = canvas_group.getElementById(key); - } - - me.page = canvas_group; - - return me; - }, - getKeys: func() { - return []; - }, - update: func() { - var elapsedtime = pts.Sim.Time.elapsedSec.getValue(); - if (systems.ELEC.Bus.ac2.getValue() >= 110 and lighting_du4.getValue() > 0.01) { - if (du4_test_time.getValue() + du4_test_amount.getValue() >= elapsedtime) { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_test.page.show(); - lowerECAM_test.update(); - } else { - lowerECAM_test.page.hide(); - page = ecam_page.getValue(); - if (page == "apu") { - lowerECAM_apu.page.show(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_apu.update(); - } else if (page == "bleed") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.show(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_bleed.update(); - } else if (page == "cond") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.show(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_cond.update(); - } else if (page == "cruise") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.show(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_crz.update(); - } else if (page == "door") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.show(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_door.update(); - } else if (page == "elec") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.show(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_elec.update(); - } else if (page == "eng") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.show(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_eng.update(); - } else if (page == "fctl") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.show(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_fctl.update(); - } else if (page == "fuel") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.show(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_fuel.update(); - } else if (page == "press") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.show(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_press.update(); - } else if (page == "sts") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.show(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - lowerECAM_status.update(); - } else if (page == "hyd") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.show(); - lowerECAM_wheel.page.hide(); - lowerECAM_hyd.update(); - } else if (page == "wheel") { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.show(); - lowerECAM_wheel.update(); - } else { - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - } - } - } else { - lowerECAM_test.page.hide(); - lowerECAM_apu.page.hide(); - lowerECAM_bleed.page.hide(); - lowerECAM_cond.page.hide(); - lowerECAM_crz.page.hide(); - lowerECAM_door.page.hide(); - lowerECAM_elec.page.hide(); - lowerECAM_eng.page.hide(); - lowerECAM_fctl.page.hide(); - lowerECAM_fuel.page.hide(); - lowerECAM_press.page.hide(); - lowerECAM_status.page.hide(); - lowerECAM_hyd.page.hide(); - lowerECAM_wheel.page.hide(); - } - }, - updateBottomStatus: func() { - - - - - }, -}; -var canvas_lowerECAM_bleed = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_bleed, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit", "BLEED-XFEED", "BLEED-Ram-Air", "BLEED-APU-CIRCLE", "BLEED-HP-Valve-1", - "BLEED-APU-LINES","BLEED-ENG-1", "BLEED-HP-Valve-2", "BLEED-ENG-2", "BLEED-Precooler-1-Inlet-Press", "BLEED-Precooler-1-Outlet-Temp", - "BLEED-Precooler-2-Inlet-Press", "BLEED-Precooler-2-Outlet-Temp", "BLEED-ENG-1-label", "BLEED-ENG-2-label", - "BLEED-GND", "BLEED-Pack-1-Flow-Valve", "BLEED-Pack-2-Flow-Valve", "BLEED-Pack-1-Out-Temp","BLEED-APU-connectionTop", - "BLEED-Pack-1-Comp-Out-Temp", "BLEED-Pack-1-Packflow-needle", "BLEED-Pack-1-Bypass-needle", "BLEED-Pack-2-Out-Temp", - "BLEED-Pack-2-Bypass-needle", "BLEED-Pack-2-Comp-Out-Temp", "BLEED-Pack-2-Packflow-needle", "BLEED-Anti-Ice-Left", - "BLEED-Anti-Ice-Right", "BLEED-HP-2-connection", "BLEED-HP-1-connection", "BLEED-ANTI-ICE-ARROW-LEFT", "BLEED-ANTI-ICE-ARROW-RIGHT", - "BLEED-xbleedLeft","BLEED-xbleedCenter","BLEED-xbleedRight","BLEED-cond-1","BLEED-cond-2","BLEED-cond-3","BLEED-Ram-Air-connection"]; - }, - update: func() { - # X BLEED - xbleedstate = xbleed.getValue(); - xbleedcmdstate = xbleedcmd.getBoolValue(); - if (xbleedcmdstate != xbleedstate) { - me["BLEED-XFEED"].setColor(0.7333,0.3803,0); - } else { - me["BLEED-XFEED"].setColor(0.0509,0.7529,0.2941); - } - - if (xbleedcmdstate == xbleedstate) { - if (xbleedcmdstate) { - me["BLEED-XFEED"].setRotation(0); - } else { - me["BLEED-XFEED"].setRotation(90 * D2R); - } - } else { - me["BLEED-XFEED"].setRotation(45 * D2R); - } - - if (xbleedstate == 1) { - me["BLEED-xbleedCenter"].show(); - me["BLEED-xbleedRight"].show(); - } else { - me["BLEED-xbleedCenter"].hide(); - me["BLEED-xbleedRight"].hide(); - } - - # HP valve 1 - hp_valve_state = hp_valve1_state.getValue(); - - if (hp_valve_state == 1) { - me["BLEED-HP-Valve-1"].setRotation(90 * D2R); - me["BLEED-HP-1-connection"].show(); - } else { - me["BLEED-HP-Valve-1"].setRotation(0); - me["BLEED-HP-1-connection"].hide(); - } - - if (hp_valve_state == hp_valve1.getValue()) { - me["BLEED-HP-Valve-1"].setColor(0.0509,0.7529,0.2941); - } else { - me["BLEED-HP-Valve-1"].setColor(0.7333,0.3803,0); - } - - # HP valve 2 - hp_valve_state = hp_valve2_state.getValue(); - - if (hp_valve_state == 1) { - me["BLEED-HP-Valve-2"].setRotation(90 * D2R); - me["BLEED-HP-2-connection"].show(); - } else { - me["BLEED-HP-Valve-2"].setRotation(0); - me["BLEED-HP-2-connection"].hide(); - } - - if (hp_valve_state == hp_valve2.getValue()) { - me["BLEED-HP-Valve-2"].setColor(0.0509,0.7529,0.2941); - } else { - me["BLEED-HP-Valve-2"].setColor(0.7333,0.3803,0); - } - - # ENG BLEED valve 1 - eng_valve_state = systems.PNEU.Switch.bleed1.getValue(); - bleed_valve_cur = eng_valve1.getValue(); - - if (bleed_valve_cur == 0) { - me["BLEED-ENG-1"].setRotation(0); - } else { - me["BLEED-ENG-1"].setRotation(90 * D2R); - } - - if (eng_valve_state == bleed_valve_cur) { - me["BLEED-ENG-1"].setColor(0.0509,0.7529,0.2941); - } else { - me["BLEED-ENG-1"].setColor(0.7333,0.3803,0); - } - - # APU BLEED valve - var apu_valve_state2 = apu_valve_state.getValue(); - - if (systems.APUNodes.Controls.master.getValue()) { - me["BLEED-APU-LINES"].show(); - if (apu_valve_state2 == 1) { - me["BLEED-APU-CIRCLE"].setRotation(0); - me["BLEED-APU-connectionTop"].show(); - me["BLEED-xbleedLeft"].show(); - } else { - me["BLEED-APU-CIRCLE"].setRotation(90 * D2R); - me["BLEED-APU-connectionTop"].hide(); - if (xbleed.getValue() != 1) { - me["BLEED-xbleedLeft"].hide(); - } else { - me["BLEED-xbleedLeft"].show(); - } - } - if (apuBleedNotOn.getValue() != 1) { - me["BLEED-APU-CIRCLE"].setColor(0.0509,0.7529,0.2941); - } else { - me["BLEED-APU-CIRCLE"].setColor(0.7333,0.3803,0); - } - } else { - if (xbleed.getValue() != 1) { - me["BLEED-xbleedLeft"].hide(); - } else { - me["BLEED-xbleedLeft"].show(); - } - me["BLEED-APU-LINES"].hide(); - me["BLEED-APU-connectionTop"].hide(); - } - - # ENG BLEED valve 2 - eng_valve_state = systems.PNEU.Switch.bleed2.getValue(); - bleed_valve_cur = eng_valve2.getValue(); - - if (bleed_valve_cur == 0) { - me["BLEED-ENG-2"].setRotation(0); - } else { - me["BLEED-ENG-2"].setRotation(90 * D2R); - } - - if (eng_valve_state == bleed_valve_cur) { - me["BLEED-ENG-2"].setColor(0.0509,0.7529,0.2941); - } else { - me["BLEED-ENG-2"].setColor(0.7333,0.3803,0); - } - - # Precooler inlet 1 - bmc1 = bmc1working.getValue(); - bmc2 = bmc2working.getValue(); - - if (bmc1) { - var precooler_psi = precooler1_psi.getValue(); - me["BLEED-Precooler-1-Inlet-Press"].setText(sprintf("%s", math.round(precooler_psi))); - if (precooler_psi < 4 or precooler_psi > 57) { - me["BLEED-Precooler-1-Inlet-Press"].setColor(0.7333,0.3803,0); - } else { - me["BLEED-Precooler-1-Inlet-Press"].setColor(0.0509,0.7529,0.2941); - } - } else { - me["BLEED-Precooler-1-Inlet-Press"].setText(sprintf("%s", "XX")); - me["BLEED-Precooler-1-Inlet-Press"].setColor(0.7333,0.3803,0); - } - - # Precooler inlet 2 - if (bmc2) { - var precooler_psi = precooler2_psi.getValue(); - me["BLEED-Precooler-2-Inlet-Press"].setText(sprintf("%s", math.round(precooler_psi))); - if (precooler_psi < 4 or precooler_psi > 57) { - me["BLEED-Precooler-2-Inlet-Press"].setColor(0.7333,0.3803,0); - } else { - me["BLEED-Precooler-2-Inlet-Press"].setColor(0.0509,0.7529,0.2941); - } - } else { - me["BLEED-Precooler-2-Inlet-Press"].setText(sprintf("%s", "XX")); - me["BLEED-Precooler-2-Inlet-Press"].setColor(0.7333,0.3803,0); - } - - # Precooler outlet 1 - if (bmc1) { - var precooler_temp = precooler1_temp.getValue(); - me["BLEED-Precooler-1-Outlet-Temp"].setText(sprintf("%s", math.round(precooler_temp, 5))); - if (systems.PNEU.Switch.bleed1.getValue() and (precooler_temp < 150 or precooler1_ovht.getValue())) { - me["BLEED-Precooler-1-Outlet-Temp"].setColor(0.7333,0.3803,0); - } else { - me["BLEED-Precooler-1-Outlet-Temp"].setColor(0.0509,0.7529,0.2941); - } - } else { - me["BLEED-Precooler-1-Outlet-Temp"].setText(sprintf("%s", "XX")); - me["BLEED-Precooler-1-Outlet-Temp"].setColor(0.7333,0.3803,0); - } - - # Precooler outlet 2 - if (bmc2) { - var precooler_temp = precooler2_temp.getValue(); - me["BLEED-Precooler-2-Outlet-Temp"].setText(sprintf("%s", math.round(precooler_temp, 5))); - if (systems.PNEU.Switch.bleed2.getValue() and (precooler_temp < 150 or precooler2_ovht.getValue())) { - me["BLEED-Precooler-2-Outlet-Temp"].setColor(0.7333,0.3803,0); - } else { - me["BLEED-Precooler-2-Outlet-Temp"].setColor(0.0509,0.7529,0.2941); - } - } else { - me["BLEED-Precooler-2-Outlet-Temp"].setText(sprintf("%s", "XX")); - me["BLEED-Precooler-2-Outlet-Temp"].setColor(0.7333,0.3803,0); - } - - # GND air - if (pts.Gear.wow[1].getValue()) { - me["BLEED-GND"].show(); - } else { - me["BLEED-GND"].hide(); - } - - # WING ANTI ICE - if (switch_wing_aice.getValue()) { - me["BLEED-Anti-Ice-Left"].show(); - me["BLEED-Anti-Ice-Right"].show(); - } else { - me["BLEED-Anti-Ice-Left"].hide(); - me["BLEED-Anti-Ice-Right"].hide(); - } - - # ENG 1 label - 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 (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); - } - - # PACK 1 ----------------------------------------- - packValveState = systems.PNEU.Valves.pack1.getValue(); - me["BLEED-Pack-1-Out-Temp"].setText(sprintf("%s", math.round(systems.PNEU.Packs.pack1OutTemp.getValue(), 5))); - me["BLEED-Pack-1-Comp-Out-Temp"].setText(sprintf("%s", math.round(systems.PNEU.Packs.pack1OutletTemp.getValue(), 5))); - - if (systems.PNEU.Packs.pack1OutTemp.getValue() > 90) { - me["BLEED-Pack-1-Out-Temp"].setColor(0.7333,0.3803,0); - } else { - me["BLEED-Pack-1-Out-Temp"].setColor(0.0509,0.7529,0.2941); - } - - # `-50` cause the middel position from where we move the needle is at 50 - me["BLEED-Pack-1-Bypass-needle"].setRotation((pack1_bypass.getValue() - 50) * D2R); - - if (systems.PNEU.Packs.pack1OutletTemp.getValue() > 230) { - me["BLEED-Pack-1-Comp-Out-Temp"].setColor(0.7333,0.3803,0); - } else { - me["BLEED-Pack-1-Comp-Out-Temp"].setColor(0.0509,0.7529,0.2941); - } - - me["BLEED-Pack-1-Packflow-needle"].setRotation(systems.PNEU.Packs.packFlow1.getValue() * D2R); - - if (packValveState == 0) { - me["BLEED-Pack-1-Packflow-needle"].setColorFill(0.7333,0.3803,0); - me["BLEED-Pack-1-Flow-Valve"].setRotation(90 * D2R); - } else { - me["BLEED-Pack-1-Packflow-needle"].setColorFill(0.0509,0.7529,0.2941); - me["BLEED-Pack-1-Flow-Valve"].setRotation(0); - } - - if (packValveState == systems.PNEU.Switch.pack1.getValue()) { - me["BLEED-Pack-1-Flow-Valve"].setColor(0.0509,0.7529,0.2941); - } else { - me["BLEED-Pack-1-Flow-Valve"].setColor(0.7333,0.3803,0); - } - - # PACK 2 ----------------------------------------- - packValveState = systems.PNEU.Valves.pack2.getValue(); - me["BLEED-Pack-2-Out-Temp"].setText(sprintf("%s", math.round(systems.PNEU.Packs.pack2OutTemp.getValue(), 5))); - me["BLEED-Pack-2-Comp-Out-Temp"].setText(sprintf("%s", math.round(systems.PNEU.Packs.pack2OutletTemp.getValue(), 5))); - - if (systems.PNEU.Packs.pack2OutTemp.getValue() > 90) { - me["BLEED-Pack-2-Out-Temp"].setColor(0.7333,0.3803,0); - } else { - me["BLEED-Pack-2-Out-Temp"].setColor(0.0509,0.7529,0.2941); - } - - me["BLEED-Pack-2-Bypass-needle"].setRotation((pack2_bypass.getValue() - 50) * D2R); - - if (systems.PNEU.Packs.pack2OutletTemp.getValue() > 230) { - me["BLEED-Pack-2-Comp-Out-Temp"].setColor(0.7333,0.3803,0); - } else { - me["BLEED-Pack-2-Comp-Out-Temp"].setColor(0.0509,0.7529,0.2941); - } - - me["BLEED-Pack-2-Packflow-needle"].setRotation(systems.PNEU.Packs.packFlow2.getValue() * D2R); - - if (packValveState == 0) { - me["BLEED-Pack-2-Packflow-needle"].setColorFill(0.7333,0.3803,0); - me["BLEED-Pack-2-Flow-Valve"].setRotation(90 * D2R); - } else { - me["BLEED-Pack-2-Packflow-needle"].setColorFill(0.0509,0.7529,0.2941); - me["BLEED-Pack-2-Flow-Valve"].setRotation(0); - } - - if (packValveState == systems.PNEU.Switch.pack2.getValue()) { - me["BLEED-Pack-2-Flow-Valve"].setColor(0.0509,0.7529,0.2941); - } else { - me["BLEED-Pack-2-Flow-Valve"].setColor(0.7333,0.3803,0); - } - - # Ram Air - ramAirState = systems.PNEU.Valves.ramAir.getValue(); - if (ramAirState == 0) { - me["BLEED-Ram-Air"].setRotation(90 * D2R); - me["BLEED-Ram-Air"].setColor(0.0509,0.7529,0.2941); - me["BLEED-Ram-Air"].setColorFill(0.0509,0.7529,0.2941); - me["BLEED-Ram-Air-connection"].hide(); - } elsif (ramAirState) { - me["BLEED-Ram-Air"].setRotation(0); - if (pts.Gear.wow[1].getValue()) { - me["BLEED-Ram-Air"].setColor(0.7333,0.3803,0); - me["BLEED-Ram-Air"].setColorFill(0.7333,0.3803,0); - } else { - me["BLEED-Ram-Air"].setColor(0.0509,0.7529,0.2941); - me["BLEED-Ram-Air"].setColorFill(0.0509,0.7529,0.2941); - } - me["BLEED-Ram-Air-connection"].show(); - } else { - me["BLEED-Ram-Air"].setRotation(45 * D2R); - me["BLEED-Ram-Air"].setColor(0.7333,0.3803,0); - me["BLEED-Ram-Air"].setColorFill(0.7333,0.3803,0); - me["BLEED-Ram-Air-connection"].show(); - } - - # Triangles - if (systems.PNEU.Valves.pack1.getValue() == 0 and systems.PNEU.Valves.pack2.getValue() == 0) { - if (pts.Gear.wow[1].getValue() or ramAirState != 1) { - me["BLEED-cond-1"].setColor(0.7333,0.3803,0); - me["BLEED-cond-2"].setColor(0.7333,0.3803,0); - me["BLEED-cond-3"].setColor(0.7333,0.3803,0); - } else { - me["BLEED-cond-1"].setColor(0.0509,0.7529,0.2941); - me["BLEED-cond-2"].setColor(0.0509,0.7529,0.2941); - me["BLEED-cond-3"].setColor(0.0509,0.7529,0.2941); - } - } else { - me["BLEED-cond-1"].setColor(0.0509,0.7529,0.2941); - me["BLEED-cond-2"].setColor(0.0509,0.7529,0.2941); - me["BLEED-cond-3"].setColor(0.0509,0.7529,0.2941); - } - me.updateBottomStatus(); - }, -}; - -var canvas_lowerECAM_elec = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_elec, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","BAT1-label","Bat1Volt","Bat1Ampere","BAT2-label","Bat2Volt","Bat2Ampere","BAT1-charge","BAT1-discharge","BAT2-charge","BAT2-discharge","ELEC-Line-DC1-DCBAT","ELEC-Line-DC1-DCESS","ELEC-Line-DC2-DCBAT", - "ELEC-Line-DC1-DCESS_DCBAT","ELEC-Line-DC2-DCESS_DCBAT","ELEC-Line-TR1-DC1","ELEC-Line-TR2-DC2","Shed-label","ELEC-Line-ESSTR-DCESS","TR1-label","TR1Volt","TR1Ampere","TR2-label","TR2Volt","TR2Ampere","EMERGEN-group","EmergenVolt","EmergenHz", - "ELEC-Line-Emergen-ESSTR","EMERGEN-Label-off","Emergen-Label","EMERGEN-out","ELEC-Line-ACESS-TRESS","ELEC-Line-AC1-TR1","ELEC-Line-AC2-TR2","ELEC-Line-AC1-ACESS","ELEC-Line-AC2-ACESS","ACESS-SHED","ACESS","AC1-in","AC2-in","ELEC-Line-GEN1-AC1","ELEC-Line-GEN2-AC2", - "ELEC-Line-APU-AC1","ELEC-Line-APU-EXT","ELEC-Line-EXT-AC2","APU-out","EXT-out","EXTPWR-group","ExtVolt","ExtHz","APU-content","APU-border","APUGentext","APUGenLoad","APUGenVolt","APUGenHz","APUGEN-off","GEN1-label","Gen1Load","Gen1Volt","Gen1Hz", - "GEN2-label","Gen2Load","GEN2-off","Gen2Volt","Gen2Hz","ELEC-IDG-1-label","ELEC-IDG-1-num-label","ELEC-IDG-1-Temp","IDG1-LOPR","IDG1-DISC","IDG1-RISE-Value","IDG1-RISE-label","GalleyShed","ELEC-IDG-2-Temp","ELEC-IDG-2-label","ELEC-IDG-2-num-label","IDG2-RISE-label","IDG2-RISE-Value","IDG2-LOPR", - "IDG2-DISC","ESSTR-group","ESSTR","ESSTR-Volt","ESSTR-Ampere","BAT1-content","BAT2-content","BAT1-OFF","BAT2-OFF","GEN1-content","GEN2-content","GEN-1-num-label","GEN-2-num-label","GEN1-off","GEN2-off","GEN1-num-label","GEN2-num-label","EXTPWR-label", - "ELEC-ACESS-SHED-label","ELEC-DCBAT-label","ELEC-DCESS-label","ELEC-DC2-label","ELEC-DC1-label","ELEC-AC1-label","ELEC-AC2-label","ELEC-ACESS-label","ELEC-Line-ESSTR-DCESS-off","ELEC-Line-Emergen-ESSTR-off"]; - }, - update: func() { # BAT1 if (systems.ELEC.Switch.bat1.getValue() == 0) { @@ -1429,41 +780,6 @@ var canvas_lowerECAM_elec = { } # hide not yet implemented items - me["IDG1-LOPR"].hide(); - me["IDG2-LOPR"].hide(); - me["Shed-label"].hide(); - me["IDG2-RISE-label"].hide(); - me["IDG2-RISE-Value"].hide(); - me["IDG1-RISE-label"].hide(); - me["IDG1-RISE-Value"].hide(); - me.updateBottomStatus(); }, -}; - -var canvas_lowerECAM_eng = { - new: func(canvas_group, file) { - var m = {parents: [canvas_lowerECAM_eng, canvas_lowerECAM_base]}; - m.init(canvas_group, file); - - return m; - }, - getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit",]; - }, - update: func() { - # Oil Quantity - - - # Oil Pressure - - - # Fuel Used - if (acconfig_weight_kgs.getValue()) { - } else { - } - - me.updateBottomStatus(); - }, -}; - \ No newline at end of file +}; \ No newline at end of file diff --git a/Models/Instruments/Lower-ECAM/res/bleed.svg b/Models/Instruments/Lower-ECAM/res/bleed.svg index 2bc0a2b7..d08a757a 100644 --- a/Models/Instruments/Lower-ECAM/res/bleed.svg +++ b/Models/Instruments/Lower-ECAM/res/bleed.svg @@ -42,8 +42,8 @@ id="namedview371" showgrid="true" inkscape:zoom="0.73868665" - inkscape:cx="272.22904" - inkscape:cy="280.96379" + inkscape:cx="201.82373" + inkscape:cy="930.76571" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" @@ -67,8 +67,9 @@ x="817.61298" height="5.1203089" width="53.195583" - id="rect5105-2" - style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + id="BLEED-XFEED-Cross" + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:label="#rect5105-2" /> + id="BLEED-ENG-1-Cross" + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:label="#rect5105-2-5-7" /> + id="BLEED-Ram-Air-Cross" + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:label="#rect5105-2-5-3" /> + id="BLEED-Pack-1-Flow-Valve-Cross" + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:label="#rect5105-2-5-3-6-9" /> + id="BLEED-Pack-2-Flow-Valve-Cross" + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:label="#rect5105-2-5-3-6-9-2" /> + id="BLEED-ENG-2-Cross" + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:label="#rect5105-2-5-7-7" /> Date: Sat, 24 Jul 2021 12:29:58 +0100 Subject: [PATCH 83/96] Start elec --- .../Instruments/Lower-ECAM/Lower-ECAM-APU.nas | 6 +- .../Lower-ECAM/Lower-ECAM-elec.nas | 396 +++++++++++++++++- .../Instruments/Lower-ECAM/Lower-ECAM-old.nas | 368 +--------------- Nasal/Libraries/libraries.nas | 2 + 4 files changed, 403 insertions(+), 369 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas index 55015168..83d47a84 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas @@ -130,7 +130,11 @@ var canvas_lowerECAMPageApu = } }), props.UpdateManager.FromHashValue("apuHertz", 1, func(val) { - obj["APUGenHz"].setText(sprintf("%s", math.round(val))); + if (val == 0) { + obj["APUGenHz"].setText(sprintf("XX")); + } else { + obj["APUGenHz"].setText(sprintf("%s", math.round(val))); + } if (val >= 390 and val <= 410) { obj["APUGenHz"].setColor(0.0509,0.7529,0.2941); diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas index f42be362..dc550a7b 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas @@ -29,8 +29,377 @@ var canvas_lowerECAMPageElec = obj["IDG1-RISE-label"].hide(); obj["IDG1-RISE-Value"].hide(); - obj.update_items = [ + props.UpdateManager.FromHashValue("apuLoad", 0.1, func(val) { + obj["APUGenLoad"].setText(sprintf("%s", math.round(val))); + + if (val < 110) { + obj["APUGenHz"].setColor(0.0509,0.7529,0.2941); + } else { + obj["APUGenHz"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("apuHertz", 0.5, func(val) { + if (val == 0) { + obj["APUGenHz"].setText(sprintf("XX")); + } else { + obj["APUGenHz"].setText(sprintf("%s", math.round(val))); + } + + if (val >= 390 and val <= 410) { + obj["APUGenHz"].setColor(0.0509,0.7529,0.2941); + } else { + obj["APUGenHz"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("apuVolt", 0.1, func(val) { + obj["APUGenVolt"].setText(sprintf("%s", math.round(val))); + + if (val >= 110 and val <= 120) { + obj["APUGenVolt"].setColor(0.0509,0.7529,0.2941); + } else { + obj["APUGenVolt"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashList(["apuMaster","apuVolt","apuLoad","apuHertz","apuGLC"], nil, func(val) { + if (val.apuMaster == 0) { + obj["APUGentext"].setColor(0.8078,0.8039,0.8078); + } else { + if (val.apuGLC == 0) { + obj["APUGentext"].setColor(0.7333,0.3803,0); + } else if (val.apuVolt > 120 or val.apuVolt < 110 or val.apuHertz > 410 or val.apuHertz < 390 or val.apuLoad >= 100) { + obj["APUGentext"].setColor(0.7333,0.3803,0); + } else { + obj["APUGentext"].setColor(0.8078,0.8039,0.8078); + } + } + }), + props.UpdateManager.FromHashList(["apuMaster","apuGLC"], nil, func(val) { + if (val.apuMaster == 0) { + obj["APU-content"].hide(); + obj["APUGEN-off"].hide(); + obj["APU-border"].hide(); + } else { + obj["APU-border"].show(); + if (val.apuGLC == 0) { + obj["APU-content"].hide(); + obj["APUGEN-off"].show(); + } else { + obj["APU-content"].show(); + obj["APUGEN-off"].hide(); + } + } + }), + props.UpdateManager.FromHashValue("elecIDG1Disc", nil, func(val) { + if (!val) { + obj["IDG1-DISC"].show(); + obj["ELEC-IDG-1-label"].setColor(0.7333,0.3803,0); + } else { + obj["IDG1-DISC"].hide(); + obj["ELEC-IDG-1-label"].setColor(0.8078,0.8039,0.8078); + } + }), + props.UpdateManager.FromHashValue("elecIDG2Disc", nil, func(val) { + if (!val) { + obj["IDG2-DISC"].show(); + obj["ELEC-IDG-2-label"].setColor(0.7333,0.3803,0); + } else { + obj["IDG2-DISC"].hide(); + obj["ELEC-IDG-2-label"].setColor(0.8078,0.8039,0.8078); + } + }), + props.UpdateManager.FromHashValue("engine1Running", nil, func(val) { + if (val == 0) { + obj["ELEC-IDG-1-num-label"].setColor(0.7333,0.3803,0); + } else { + obj["ELEC-IDG-1-num-label"].setColor(0.8078,0.8039,0.8078); + } + }), + props.UpdateManager.FromHashValue("engine2Running", nil, func(val) { + if (val == 0) { + obj["ELEC-IDG-2-num-label"].setColor(0.7333,0.3803,0); + } else { + obj["ELEC-IDG-2-num-label"].setColor(0.8078,0.8039,0.8078); + } + }), + props.UpdateManager.FromHashValue("dc1", 0.5, func(val) { + if (val > 25) { + obj["ELEC-DC1-label"].setColor(0.0509,0.7529,0.2941); + } else { + obj["ELEC-DC1-label"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("dc2", 0.5, func(val) { + if (val > 25) { + obj["ELEC-DC2-label"].setColor(0.0509,0.7529,0.2941); + } else { + obj["ELEC-DC2-label"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("dcEss", 0.5, func(val) { + if (val > 25) { + obj["ELEC-DCESS-label"].setColor(0.0509,0.7529,0.2941); + } else { + obj["ELEC-DCESS-label"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("ac1", 0.5, func(val) { + if (val >= 110) { + obj["ELEC-AC1-label"].setColor(0.0509,0.7529,0.2941); + obj["AC1-in"].show(); + } else { + obj["ELEC-AC1-label"].setColor(0.7333,0.3803,0); + obj["AC1-in"].hide(); + } + }), + props.UpdateManager.FromHashValue("ac2", 0.5, func(val) { + if (val >= 110) { + obj["ELEC-AC2-label"].setColor(0.0509,0.7529,0.2941); + obj["AC2-in"].show(); + } else { + obj["ELEC-AC2-label"].setColor(0.7333,0.3803,0); + obj["AC2-in"].hide(); + } + }), + props.UpdateManager.FromHashValue("acEss", 0.5, func(val) { + if (val >= 110) { + obj["ELEC-ACESS-label"].setColor(0.0509,0.7529,0.2941); + } else { + obj["ELEC-ACESS-label"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("acEssShed", 0.5, func(val) { + if (val >= 110) { + obj["ACESS-SHED"].hide(); + } else { + obj["ACESS-SHED"].show(); + } + }), + props.UpdateManager.FromHashValue("ElecGalleyShed", nil, func(val) { + if (val) { + obj["GalleyShed"].show(); + } else { + obj["GalleyShed"].hide(); + } + }), + props.UpdateManager.FromHashList(["elecBat1Switch","elecBat2Switch","dcBat"], nil, func(val) { + if (val.elecBat1Switch or val.elecBat2Switch) { + obj["ELEC-DCBAT-label"].setText("DC BAT"); + if (val.dcBat > 25) { + obj["ELEC-DCBAT-label"].setColor(0.0509,0.7529,0.2941); + } else { + obj["ELEC-DCBAT-label"].setColor(0.7333,0.3803,0); + } + } else { + obj["ELEC-DCBAT-label"].setText("XX"); # BCL not powered hence no voltage info supplied from BCL + obj["ELEC-DCBAT-label"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashList(["elecBat1Switch","elecBat1Volt","elecBat1Amp","elecBat1Direction","elecBat1Fault"], nil, func(val) { + if (val.elecBat1Switch == 0) { + obj["BAT1-OFF"].show(); + obj["BAT1-content"].hide(); + obj["BAT1-discharge"].hide(); + obj["BAT1-charge"].hide(); + } else { + obj["BAT1-OFF"].hide(); + obj["BAT1-content"].show(); + obj["Bat1Ampere"].setText(sprintf("%s", val.elecBat1Amp)); + obj["Bat1Volt"].setText(sprintf("%s", val.elecBat1Volt)); + + if (val.elecBat1Volt >= 24.95 and val.elecBat1Volt <= 31.05) { + obj["Bat1Volt"].setColor(0.0509,0.7529,0.2941); + } else { + obj["Bat1Volt"].setColor(0.7333,0.3803,0); + } + + if (val.elecBat1Amp > 5) { + obj["Bat1Ampere"].setColor(0.7333,0.3803,0); + } else { + obj["Bat1Ampere"].setColor(0.0509,0.7529,0.2941); + } + + if (val.elecBat1Direction == 0) { + obj["BAT1-discharge"].hide(); + obj["BAT1-charge"].hide(); + } else { + if (val.elecBat1Direction == -1) { + obj["BAT1-charge"].show(); + obj["BAT1-discharge"].hide(); + } else { + obj["BAT1-discharge"].show(); + obj["BAT1-charge"].hide(); + } + } + } + + if (val.elecBat1Fault or val.elecBat1Volt < 25 or val.elecBat1Volt > 31 or val.elecBat1Amp > 5) { + obj["BAT1-label"].setColor(0.7333,0.3803,0); + } else { + obj["BAT1-label"].setColor(0.8078,0.8039,0.8078); + } + }), + props.UpdateManager.FromHashList(["elecBat2Switch","elecBat2Volt","elecBat2Amp","elecBat2Direction","elecBat2Fault"], nil, func(val) { + if (val.elecBat2Switch == 0) { + obj["BAT2-OFF"].show(); + obj["BAT2-content"].hide(); + obj["BAT2-discharge"].hide(); + obj["BAT2-charge"].hide(); + } else { + obj["BAT2-OFF"].hide(); + obj["BAT2-content"].show(); + obj["Bat2Ampere"].setText(sprintf("%s", val.elecBat2Amp)); + obj["Bat2Volt"].setText(sprintf("%s", val.elecBat2Volt)); + + if (val.elecBat2Volt >= 24.95 and val.elecBat2Volt <= 31.05) { + obj["Bat2Volt"].setColor(0.0509,0.7529,0.2941); + } else { + obj["Bat2Volt"].setColor(0.7333,0.3803,0); + } + + if (val.elecBat2Amp > 5) { + obj["Bat2Ampere"].setColor(0.7333,0.3803,0); + } else { + obj["Bat2Ampere"].setColor(0.0509,0.7529,0.2941); + } + + if (val.elecBat2Direction == 0) { + obj["BAT2-discharge"].hide(); + obj["BAT2-charge"].hide(); + } else { + if (val.elecBat2Direction == -1) { + obj["BAT2-charge"].show(); + obj["BAT2-discharge"].hide(); + } else { + obj["BAT2-discharge"].show(); + obj["BAT2-charge"].hide(); + } + } + } + + if (val.elecBat2Fault or val.elecBat2Volt < 25 or val.elecBat2Volt > 31 or val.elecBat2Amp > 5) { + obj["BAT2-label"].setColor(0.7333,0.3803,0); + } else { + obj["BAT2-label"].setColor(0.8078,0.8039,0.8078); + } + }), + props.UpdateManager.FromHashList(["elecTR1Amp","elecTR1Volt"], nil, func(val) { + obj["TR1Volt"].setText(sprintf("%s", math.round(val.elecTR1Volt))); + obj["TR1Ampere"].setText(sprintf("%s", math.round(val.elecTR1Amp))); + + if (val.elecTR1Volt < 25 or val.elecTR1Volt > 31 or val.elecTR1Amp < 5) { + obj["TR1-label"].setColor(0.7333,0.3803,0); + } else { + obj["TR1-label"].setColor(0.8078,0.8039,0.8078); + } + + if (val.elecTR1Volt < 25 or val.elecTR1Volt > 31) { + obj["TR1Volt"].setColor(0.7333,0.3803,0); + } else { + obj["TR1Volt"].setColor(0.0509,0.7529,0.2941); + } + + if (val.elecTR1Amp < 5) { + obj["TR1Ampere"].setColor(0.7333,0.3803,0); + } else { + obj["TR1Ampere"].setColor(0.0509,0.7529,0.2941); + } + }), + props.UpdateManager.FromHashList(["elecTR2Amp","elecTR2Volt"], nil, func(val) { + obj["TR2Volt"].setText(sprintf("%s", math.round(val.elecTR2Volt))); + obj["TR2Ampere"].setText(sprintf("%s", math.round(val.elecTR2Amp))); + + if (val.elecTR2Volt < 25 or val.elecTR2Volt > 31 or val.elecTR2Amp < 5) { + obj["TR2-label"].setColor(0.7333,0.3803,0); + } else { + obj["TR2-label"].setColor(0.8078,0.8039,0.8078); + } + + if (val.elecTR2Volt < 25 or val.elecTR2Volt > 31) { + obj["TR2Volt"].setColor(0.7333,0.3803,0); + } else { + obj["TR2Volt"].setColor(0.0509,0.7529,0.2941); + } + + if (val.elecTR2Amp < 5) { + obj["TR2Ampere"].setColor(0.7333,0.3803,0); + } else { + obj["TR2Ampere"].setColor(0.0509,0.7529,0.2941); + } + }), + props.UpdateManager.FromHashList(["elecExtHertz","elecExtVolt","elecGroundCart"], nil, func(val) { + if (val.elecGroundCart == 0) { + obj["EXTPWR-group"].hide(); + } else { + obj["EXTPWR-group"].show(); + obj["ExtVolt"].setText(sprintf("%s", math.round(val.elecExtVolt))); + obj["ExtHz"].setText(sprintf("%s", math.round(val.elecExtHertz))); + + if (val.elecExtHertz > 410 or val.elecExtHertz < 390 or val.elecExtVolt > 120 or val.elecExtVolt < 110) { + obj["EXTPWR-label"].setColor(0.7333,0.3803,0); + } else { + obj["EXTPWR-label"].setColor(0.0509,0.7529,0.2941); + } + + if (val.elecExtHertz > 410 or val.elecExtHertz < 390) { + obj["ExtHz"].setColor(0.7333,0.3803,0); + } else { + obj["ExtHz"].setColor(0.0509,0.7529,0.2941); + } + + if (val.elecExtVolt > 120 or val.elecExtVolt < 110) { + obj["ExtVolt"].setColor(0.7333,0.3803,0); + } else { + obj["ExtVolt"].setColor(0.0509,0.7529,0.2941); + } + } + }), + props.UpdateManager.FromHashValue("elecDCTie1", nil, func(val) { + if (val) { + obj["ELEC-Line-DC1-DCESS_DCBAT"].show(); + } else { + obj["ELEC-Line-DC1-DCESS_DCBAT"].hide(); + } + }), + props.UpdateManager.FromHashValue("elecDCTie2", nil, func(val) { + if (val) { + obj["ELEC-Line-DC2-DCESS_DCBAT"].show(); + obj["ELEC-Line-DC2-DCBAT"].show(); + } else { + obj["ELEC-Line-DC2-DCESS_DCBAT"].hide(); + obj["ELEC-Line-DC2-DCBAT"].show(); + } + }), + props.UpdateManager.FromHashList(["elecDcEssFeedBat","elecDCTie1"], nil, func(val) { + if (val.elecDcEssFeedBat or val.elecDCTie1) { + obj["ELEC-Line-DC1-DCBAT"].show(); + } else { + obj["ELEC-Line-DC1-DCBAT"].hide(); + } + }), + props.UpdateManager.FromHashValue("elecDcEssFeedBat", nil, func(val) { + if (val) { + obj["ELEC-Line-DC1-DCESS"].show(); + } else { + obj["ELEC-Line-DC1-DCESS"].hide(); + } + }), + props.UpdateManager.FromHashValue("elecDcEssFeedTr", nil, func(val) { + if (val) { + obj["ELEC-Line-ESSTR-DCESS"].show(); + } else { + obj["ELEC-Line-ESSTR-DCESS"].hide(); + } + }), + props.UpdateManager.FromHashValue("elecAcEssEmerGenFeed", nil, func(val) { + if (val) { + obj["EMERGEN-out"].show(); + obj["ELEC-Line-Emergen-ESSTR"].show(); + } else { + obj["EMERGEN-out"].hide(); + obj["ELEC-Line-Emergen-ESSTR"].hide(); + } + }), ]; obj.displayedGForce = 0; @@ -152,6 +521,31 @@ var canvas_lowerECAMPageElec = }; var input = { + elecBat1Amp: "/systems/electrical/sources/bat-1/amps", + elecBat2Amp: "/systems/electrical/sources/bat-2/amps", + elecBat1Direction: "/systems/electrical/sources/bat-1/direction", + elecBat2Direction: "/systems/electrical/sources/bat-2/direction", + elecBat1Fault: "/systems/electrical/light/bat-1-fault", + elecBat2Fault: "/systems/electrical/light/bat-2-fault", + elecBat1Volt: "/systems/electrical/sources/bat-1/volt", + elecBat2Volt: "/systems/electrical/sources/bat-2/volt", + elecBat1Switch: "/controls/electrical/switches/bat-1", + elecBat2Switch: "/controls/electrical/switches/bat-2", + elecTR1Amp: "/systems/electrical/relay/tr-contactor-1/output-amp", + elecTR2Amp: "/systems/electrical/relay/tr-contactor-2/output-amp", + elecTR1Volt: "/systems/electrical/relay/tr-contactor-1/output", + elecTR2Volt: "/systems/electrical/relay/tr-contactor-2/output", + elecIDG1Disc: "/controls/electrical/switches/idg-1-disc", + elecIDG2Disc: "/controls/electrical/switches/idg-2-disc", + elecGroundCart: "/controls/electrical/ground-cart", + elecExtHertz: "/systems/electrical/sources/ext/output-hertz", + elecExtVolt: "/systems/electrical/sources/ext/output-volt", + elecDCTie1: "/systems/electrical/relay/dc-bus-tie-dc-1/contact-pos", + elecDCTie2: "/systems/electrical/relay/dc-bus-tie-dc-2/contact-pos", + elecDcEssFeedBat: "/systems/electrical/relay/dc-ess-feed-bat/contact-pos", + elecDcEssFeedTr: "/systems/electrical/relay/dc-ess-feed-tr/contact-pos", + elecAcEssEmerGenFeed: "/systems/electrical/relay/ac-ess-feed-emer-gen/contact-pos", + ElecGalleyShed: "/systems/electrical/some-electric-thingie/galley-shed", }; foreach (var name; keys(input)) { diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas index 32c5b1c6..beb1adfb 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas @@ -117,8 +117,6 @@ var L2BrakeTempc = props.globals.getNode("/gear/gear[1]/L2brake-temp-degc", 1); var R3BrakeTempc = props.globals.getNode("/gear/gear[2]/R3brake-temp-degc", 1); var R4BrakeTempc = props.globals.getNode("/gear/gear[2]/R4brake-temp-degc", 1); -var eng1_running = props.globals.getNode("/engines/engine[0]/running", 1); -var eng2_running = props.globals.getNode("/engines/engine[1]/running", 1); var switch_cart = props.globals.getNode("/controls/electrical/ground-cart", 1); var fuel_flow1 = props.globals.getNode("/engines/engine[0]/fuel-flow_actual", 1); var fuel_flow2 = props.globals.getNode("/engines/engine[1]/fuel-flow_actual", 1); @@ -137,147 +135,6 @@ var cabinalt = props.globals.getNode("", 1); var gear0_wow = props.globals.getNode("/gear/gear[0]/wow", 1); - - # BAT1 - if (systems.ELEC.Switch.bat1.getValue() == 0) { - me["BAT1-OFF"].show(); - me["BAT1-content"].hide(); - me["BAT1-discharge"].hide(); - me["BAT1-charge"].hide(); - } else { - me["BAT1-OFF"].hide(); - me["BAT1-content"].show(); - me["Bat1Ampere"].setText(sprintf("%s", math.round(systems.ELEC.Source.Bat1.amps.getValue()))); - me["Bat1Volt"].setText(sprintf("%s", math.round(systems.ELEC.Source.Bat1.volt.getValue()))); - - if (systems.ELEC.Source.Bat1.volt.getValue() >= 24.95 and systems.ELEC.Source.Bat1.volt.getValue() <= 31.05) { - me["Bat1Volt"].setColor(0.0509,0.7529,0.2941); - } else { - me["Bat1Volt"].setColor(0.7333,0.3803,0); - } - - if (systems.ELEC.Source.Bat1.amps.getValue() > 5) { - me["Bat1Ampere"].setColor(0.7333,0.3803,0); - } else { - me["Bat1Ampere"].setColor(0.0509,0.7529,0.2941); - } - - if (systems.ELEC.Source.Bat1.direction.getValue() == 0) { - me["BAT1-discharge"].hide(); - me["BAT1-charge"].hide(); - } else { - if (systems.ELEC.Source.Bat1.direction.getValue() == -1) { - me["BAT1-charge"].show(); - me["BAT1-discharge"].hide(); - } else { - me["BAT1-discharge"].show(); - me["BAT1-charge"].hide(); - } - } - } - - if (systems.ELEC.Light.bat1Fault.getValue() or systems.ELEC.Source.Bat1.volt.getValue() < 25 or systems.ELEC.Source.Bat1.volt.getValue() > 31 or systems.ELEC.Source.Bat1.amps.getValue() > 5) { - me["BAT1-label"].setColor(0.7333,0.3803,0); - } else { - me["BAT1-label"].setColor(0.8078,0.8039,0.8078); - } - - # BAT2 - if (systems.ELEC.Switch.bat2.getValue() == 0) { - me["BAT2-OFF"].show(); - me["BAT2-content"].hide(); - me["BAT2-discharge"].hide(); - me["BAT2-charge"].hide(); - } else { - me["BAT2-OFF"].hide(); - me["BAT2-content"].show(); - me["Bat2Ampere"].setText(sprintf("%s", math.round(systems.ELEC.Source.Bat2.amps.getValue()))); - me["Bat2Volt"].setText(sprintf("%s", math.round(systems.ELEC.Source.Bat2.volt.getValue()))); - - if (systems.ELEC.Source.Bat2.volt.getValue() >= 24.95 and systems.ELEC.Source.Bat2.volt.getValue() <= 31.05) { - me["Bat2Volt"].setColor(0.0509,0.7529,0.2941); - } else { - me["Bat2Volt"].setColor(0.7333,0.3803,0); - } - - if (systems.ELEC.Source.Bat2.amps.getValue() > 5) { - me["Bat2Ampere"].setColor(0.7333,0.3803,0); - } else { - me["Bat2Ampere"].setColor(0.0509,0.7529,0.2941); - } - - if (systems.ELEC.Source.Bat2.direction.getValue() == 0) { - me["BAT2-discharge"].hide(); - me["BAT2-charge"].hide(); - } else { - if (systems.ELEC.Source.Bat2.direction.getValue() == -1) { - me["BAT2-charge"].show(); - me["BAT2-discharge"].hide(); - } else { - me["BAT2-discharge"].show(); - me["BAT2-charge"].hide(); - } - } - } - - if (systems.ELEC.Light.bat2Fault.getValue() or systems.ELEC.Source.Bat2.volt.getValue() < 25 or systems.ELEC.Source.Bat2.volt.getValue() > 31 or systems.ELEC.Source.Bat2.amps.getValue() > 5) { - me["BAT2-label"].setColor(0.7333,0.3803,0); - } else { - me["BAT2-label"].setColor(0.8078,0.8039,0.8078); - } - - # TR1 - # is only powered when ac1 has power - tr1_v = systems.ELEC.Source.tr1.outputVolt.getValue(); - tr1_a = systems.ELEC.Source.tr1.outputAmp.getValue(); - - me["TR1Volt"].setText(sprintf("%s", math.round(tr1_v))); - me["TR1Ampere"].setText(sprintf("%s", math.round(tr1_a))); - - if (tr1_v < 25 or tr1_v > 31 or tr1_a < 5) { - me["TR1-label"].setColor(0.7333,0.3803,0); - } else { - me["TR1-label"].setColor(0.8078,0.8039,0.8078); - } - - if (tr1_v < 25 or tr1_v > 31) { - me["TR1Volt"].setColor(0.7333,0.3803,0); - } else { - me["TR1Volt"].setColor(0.0509,0.7529,0.2941); - } - - if (tr1_a < 5) { - me["TR1Ampere"].setColor(0.7333,0.3803,0); - } else { - me["TR1Ampere"].setColor(0.0509,0.7529,0.2941); - } - - # TR2 - # is only powered when ac2 has power - tr2_v = systems.ELEC.Source.tr2.outputVolt.getValue(); - tr2_a = systems.ELEC.Source.tr2.outputAmp.getValue(); - - me["TR2Volt"].setText(sprintf("%s", math.round(tr2_v))); - me["TR2Ampere"].setText(sprintf("%s", math.round(tr2_a))); - - if (tr2_v < 25 or tr2_v > 31 or tr2_a < 5) { - me["TR2-label"].setColor(0.7333,0.3803,0); - } else { - me["TR2-label"].setColor(0.8078,0.8039,0.8078); - } - - if (tr2_v < 25 or tr2_v > 31) { - me["TR2Volt"].setColor(0.7333,0.3803,0); - } else { - me["TR2Volt"].setColor(0.0509,0.7529,0.2941); - } - - if (tr2_a < 5) { - me["TR2Ampere"].setColor(0.7333,0.3803,0); - } else { - me["TR2Ampere"].setColor(0.0509,0.7529,0.2941); - } - # ESS TR essTrvolts = systems.ELEC.Source.trEss.outputVoltRelay.getValue(); essTramps = systems.ELEC.Source.trEss.outputAmpRelay.getValue(); @@ -341,35 +198,7 @@ var gear0_wow = props.globals.getNode("/gear/gear[0]/wow", 1); } } - # IDG 1 - if (!systems.ELEC.Switch.idg1Disc.getBoolValue()) { - me["IDG1-DISC"].show(); - me["ELEC-IDG-1-label"].setColor(0.7333,0.3803,0); - } else { - me["IDG1-DISC"].hide(); - me["ELEC-IDG-1-label"].setColor(0.8078,0.8039,0.8078); - } - - if (eng1_running.getValue() == 0) { - me["ELEC-IDG-1-num-label"].setColor(0.7333,0.3803,0); - } else { - me["ELEC-IDG-1-num-label"].setColor(0.8078,0.8039,0.8078); - } - if (eng2_running.getValue() == 0) { - me["ELEC-IDG-2-num-label"].setColor(0.7333,0.3803,0); - } else { - me["ELEC-IDG-2-num-label"].setColor(0.8078,0.8039,0.8078); - } - - # IDG 2 - if (!systems.ELEC.Switch.idg2Disc.getBoolValue()) { - me["IDG2-DISC"].show(); - me["ELEC-IDG-2-label"].setColor(0.7333,0.3803,0); - } else { - me["IDG2-DISC"].hide(); - me["ELEC-IDG-2-label"].setColor(0.8078,0.8039,0.8078); - } # GEN1 if (systems.ELEC.Switch.gen1.getValue() == 0) { @@ -487,144 +316,6 @@ var gear0_wow = props.globals.getNode("/gear/gear[0]/wow", 1); } } - # APU - if (systems.APUNodes.Controls.master.getValue() == 0) { - me["APU-content"].hide(); - me["APUGEN-off"].hide(); - me["APU-border"].hide(); - me["APUGentext"].setColor(0.8078,0.8039,0.8078); - } else { - me["APU-border"].show(); - if (systems.ELEC.Source.APU.contact.getValue() == 0) { - me["APU-content"].hide(); - me["APUGEN-off"].show(); - me["APUGentext"].setColor(0.7333,0.3803,0); - } else { - me["APU-content"].show(); - me["APUGEN-off"].hide(); - # me["APUGenLoad"].setText(sprintf("%s", math.round(apu_load.getValue()))); - me["APUGenVolt"].setText(sprintf("%s", math.round(systems.ELEC.Source.APU.volts.getValue()))); - - if (systems.ELEC.Source.APU.hertz.getValue() == 0) { - me["APUGenHz"].setText(sprintf("XX")); - } else { - me["APUGenHz"].setText(sprintf("%s", math.round(systems.ELEC.Source.APU.hertz.getValue()))); - } - - if (systems.ELEC.Source.APU.volts.getValue() > 120 or systems.ELEC.Source.APU.volts.getValue() < 110 or systems.ELEC.Source.APU.hertz.getValue() > 410 or systems.ELEC.Source.APU.hertz.getValue() < 390 or apu_load.getValue() >= 110) { - me["APUGentext"].setColor(0.7333,0.3803,0); - } else { - me["APUGentext"].setColor(0.8078,0.8039,0.8078); - } - - if(apu_load.getValue() >= 110) { - me["APUGenLoad"].setColor(0.7333,0.3803,0); - } else { - me["APUGenLoad"].setColor(0.0509,0.7529,0.2941); - } - - if (systems.ELEC.Source.APU.volts.getValue() > 120 or systems.ELEC.Source.APU.volts.getValue() < 110) { - me["APUGenVolt"].setColor(0.7333,0.3803,0); - } else { - me["APUGenVolt"].setColor(0.0509,0.7529,0.2941); - } - - if (systems.ELEC.Source.APU.hertz.getValue() > 410 or systems.ELEC.Source.APU.hertz.getValue() < 390) { - me["APUGenHz"].setColor(0.7333,0.3803,0); - } else { - me["APUGenHz"].setColor(0.0509,0.7529,0.2941); - } - } - } - - # EXT PWR - - if (switch_cart.getValue() == 0) { - me["EXTPWR-group"].hide(); - } else { - me["EXTPWR-group"].show(); - me["ExtVolt"].setText(sprintf("%s", math.round(systems.ELEC.Source.Ext.volts.getValue()))); - me["ExtHz"].setText(sprintf("%s", math.round(systems.ELEC.Source.Ext.hertz.getValue()))); - - if (systems.ELEC.Source.Ext.hertz.getValue() > 410 or systems.ELEC.Source.Ext.hertz.getValue() < 390 or systems.ELEC.Source.Ext.volts.getValue() > 120 or systems.ELEC.Source.Ext.volts.getValue() < 110) { - me["EXTPWR-label"].setColor(0.7333,0.3803,0); - } else { - me["EXTPWR-label"].setColor(0.0509,0.7529,0.2941); - } - - if (systems.ELEC.Source.Ext.hertz.getValue() > 410 or systems.ELEC.Source.Ext.hertz.getValue() < 390) { - me["ExtHz"].setColor(0.7333,0.3803,0); - } else { - me["ExtHz"].setColor(0.0509,0.7529,0.2941); - } - - if (systems.ELEC.Source.Ext.volts.getValue() > 120 or systems.ELEC.Source.Ext.volts.getValue() < 110) { - me["ExtVolt"].setColor(0.7333,0.3803,0); - } else { - me["ExtVolt"].setColor(0.0509,0.7529,0.2941); - } - } - - if (systems.ELEC.SomeThing.galley.getValue()) { - me["GalleyShed"].show(); - } else { - me["GalleyShed"].hide(); - } - - # Bus indicators - if (systems.ELEC.Switch.bat1.getValue() or systems.ELEC.Switch.bat2.getValue()) { - me["ELEC-DCBAT-label"].setText("DC BAT"); - if (systems.ELEC.Bus.dcBat.getValue() > 25) { - me["ELEC-DCBAT-label"].setColor(0.0509,0.7529,0.2941); - } else { - me["ELEC-DCBAT-label"].setColor(0.7333,0.3803,0); - } - } else { - me["ELEC-DCBAT-label"].setText("XX"); # BCL not powered hence no voltage info supplied from BCL - me["ELEC-DCBAT-label"].setColor(0.7333,0.3803,0); - } - - if (systems.ELEC.Bus.dc1.getValue() > 25) { - me["ELEC-DC1-label"].setColor(0.0509,0.7529,0.2941); - } else { - me["ELEC-DC1-label"].setColor(0.7333,0.3803,0); - } - - if (systems.ELEC.Bus.dc2.getValue() > 25) { - me["ELEC-DC2-label"].setColor(0.0509,0.7529,0.2941); - } else { - me["ELEC-DC2-label"].setColor(0.7333,0.3803,0); - } - - if (systems.ELEC.Bus.dcEss.getValue() > 25) { - me["ELEC-DCESS-label"].setColor(0.0509,0.7529,0.2941); - } else { - me["ELEC-DCESS-label"].setColor(0.7333,0.3803,0); - } - - if (systems.ELEC.Bus.acEss.getValue() >= 110) { - me["ELEC-ACESS-label"].setColor(0.0509,0.7529,0.2941); - } else { - me["ELEC-ACESS-label"].setColor(0.7333,0.3803,0); - } - - if (systems.ELEC.Bus.acEssShed.getValue() >= 110) { - me["ACESS-SHED"].hide(); - } else { - me["ACESS-SHED"].show(); - } - - if (systems.ELEC.Bus.ac1.getValue() >= 110) { - me["ELEC-AC1-label"].setColor(0.0509,0.7529,0.2941); - } else { - me["ELEC-AC1-label"].setColor(0.7333,0.3803,0); - } - - if (systems.ELEC.Bus.ac2.getValue() >= 110) { - me["ELEC-AC2-label"].setColor(0.0509,0.7529,0.2941); - } else { - me["ELEC-AC2-label"].setColor(0.7333,0.3803,0); - } # Managment of the connecting lines between the components @@ -652,18 +343,6 @@ var gear0_wow = props.globals.getNode("/gear/gear[0]/wow", 1); me["ELEC-Line-GEN2-AC2"].hide(); } - if (systems.ELEC.Bus.ac1.getValue() >= 110) { - me["AC1-in"].show(); - } else { - me["AC1-in"].hide(); - } - - if (systems.ELEC.Bus.ac2.getValue() >= 110) { - me["AC2-in"].show(); - } else { - me["AC2-in"].hide(); - } - if (systems.ELEC.Relay.acTie1.getValue() and systems.ELEC.Relay.acTie2.getValue()) { me["ELEC-Line-APU-AC1"].show(); me["ELEC-Line-APU-EXT"].show(); @@ -733,53 +412,8 @@ var gear0_wow = props.globals.getNode("/gear/gear[0]/wow", 1); me["ELEC-Line-TR2-DC2"].hide(); } - if (systems.ELEC.Relay.dcTie1.getValue()) { - me["ELEC-Line-DC1-DCESS_DCBAT"].show(); - } else { - me["ELEC-Line-DC1-DCESS_DCBAT"].hide(); - } - - if (systems.ELEC.Relay.dcEssFeedBat.getValue()) { - me["ELEC-Line-DC1-DCESS"].show(); - } else { - me["ELEC-Line-DC1-DCESS"].hide(); - } - - if (systems.ELEC.Relay.dcEssFeedBat.getValue() or systems.ELEC.Relay.dcTie1.getValue()) { - me["ELEC-Line-DC1-DCBAT"].show(); - } else { - me["ELEC-Line-DC1-DCBAT"].hide(); - } - - if (systems.ELEC.Relay.dcTie2.getValue()) { - me["ELEC-Line-DC2-DCBAT"].show(); - me["ELEC-Line-DC2-DCESS_DCBAT"].show(); - } else { - me["ELEC-Line-DC2-DCBAT"].hide(); - me["ELEC-Line-DC2-DCESS_DCBAT"].hide(); - } - - if (systems.ELEC.Relay.acEssEmerGenFeed.getValue()) { - me["EMERGEN-out"].show(); - me["ELEC-Line-Emergen-ESSTR"].show(); - } else { - me["EMERGEN-out"].hide(); - me["ELEC-Line-Emergen-ESSTR"].hide(); - } - if (systems.ELEC.Bus.acEss.getValue() >= 110 and !systems.ELEC.Relay.acEssEmerGenFeed.getValue() and (!systems.ELEC.Relay.tr1Contactor.getValue() or !systems.ELEC.Relay.tr2Contactor.getValue())) { me["ELEC-Line-ACESS-TRESS"].show(); } else { me["ELEC-Line-ACESS-TRESS"].hide(); - } - - if (systems.ELEC.Relay.essTrContactor.getValue()) { - me["ELEC-Line-ESSTR-DCESS"].show(); - } else { - me["ELEC-Line-ESSTR-DCESS"].hide(); - } - - # hide not yet implemented items - me.updateBottomStatus(); - }, -}; \ No newline at end of file + } \ No newline at end of file diff --git a/Nasal/Libraries/libraries.nas b/Nasal/Libraries/libraries.nas index 33567b4a..244f97e9 100644 --- a/Nasal/Libraries/libraries.nas +++ b/Nasal/Libraries/libraries.nas @@ -397,6 +397,8 @@ var input = { "gearPosNorm": "/gear/gear[0]/position-norm", "gearPosNorm1": "/gear/gear[1]/position-norm", "gearPosNorm2": "/gear/gear[2]/position-norm", + "engine1Running": "/engines/engine[0]/running", + "engine2Running": "/engines/engine[1]/running", }; foreach (var name; keys(input)) { From 6bd342f9f8ad6042f69b34b0d76bed60bbd26f24 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 24 Jul 2021 12:42:25 +0100 Subject: [PATCH 84/96] Fix Chime sound --- Sounds/A320-common-sound.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sounds/A320-common-sound.xml b/Sounds/A320-common-sound.xml index 7514ae02..af9ce4c8 100644 --- a/Sounds/A320-common-sound.xml +++ b/Sounds/A320-common-sound.xml @@ -1914,7 +1914,7 @@ - Chime + Click Aircraft/A320-family/Sounds/Cockpit/click.wav once avionics From 1775bb0e169440efbcb87fe43b98f2889d63ca8d Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 24 Jul 2021 13:58:03 +0100 Subject: [PATCH 85/96] Finish ELEC --- .../Lower-ECAM/Lower-ECAM-elec.nas | 292 +++++++++++- .../Instruments/Lower-ECAM/Lower-ECAM-old.nas | 419 ------------------ 2 files changed, 282 insertions(+), 429 deletions(-) delete mode 100644 Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas index dc550a7b..6299ad50 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas @@ -111,15 +111,19 @@ var canvas_lowerECAMPageElec = props.UpdateManager.FromHashValue("engine1Running", nil, func(val) { if (val == 0) { obj["ELEC-IDG-1-num-label"].setColor(0.7333,0.3803,0); + obj["GEN1-num-label"].setColor(0.7333,0.3803,0); } else { obj["ELEC-IDG-1-num-label"].setColor(0.8078,0.8039,0.8078); + obj["GEN1-num-label"].setColor(0.8078,0.8039,0.8078); } }), props.UpdateManager.FromHashValue("engine2Running", nil, func(val) { if (val == 0) { obj["ELEC-IDG-2-num-label"].setColor(0.7333,0.3803,0); + obj["GEN2-num-label"].setColor(0.7333,0.3803,0); } else { obj["ELEC-IDG-2-num-label"].setColor(0.8078,0.8039,0.8078); + obj["GEN2-num-label"].setColor(0.8078,0.8039,0.8078); } }), props.UpdateManager.FromHashValue("dc1", 0.5, func(val) { @@ -143,7 +147,7 @@ var canvas_lowerECAMPageElec = obj["ELEC-DCESS-label"].setColor(0.7333,0.3803,0); } }), - props.UpdateManager.FromHashValue("ac1", 0.5, func(val) { + props.UpdateManager.FromHashValue("elecAC1", 0.5, func(val) { if (val >= 110) { obj["ELEC-AC1-label"].setColor(0.0509,0.7529,0.2941); obj["AC1-in"].show(); @@ -152,7 +156,7 @@ var canvas_lowerECAMPageElec = obj["AC1-in"].hide(); } }), - props.UpdateManager.FromHashValue("ac2", 0.5, func(val) { + props.UpdateManager.FromHashValue("elecAC2", 0.5, func(val) { if (val >= 110) { obj["ELEC-AC2-label"].setColor(0.0509,0.7529,0.2941); obj["AC2-in"].show(); @@ -161,14 +165,14 @@ var canvas_lowerECAMPageElec = obj["AC2-in"].hide(); } }), - props.UpdateManager.FromHashValue("acEss", 0.5, func(val) { + props.UpdateManager.FromHashValue("elecACEss", 0.5, func(val) { if (val >= 110) { obj["ELEC-ACESS-label"].setColor(0.0509,0.7529,0.2941); } else { obj["ELEC-ACESS-label"].setColor(0.7333,0.3803,0); } }), - props.UpdateManager.FromHashValue("acEssShed", 0.5, func(val) { + props.UpdateManager.FromHashValue("elecACEssShed", 0.5, func(val) { if (val >= 110) { obj["ACESS-SHED"].hide(); } else { @@ -204,8 +208,8 @@ var canvas_lowerECAMPageElec = } else { obj["BAT1-OFF"].hide(); obj["BAT1-content"].show(); - obj["Bat1Ampere"].setText(sprintf("%s", val.elecBat1Amp)); - obj["Bat1Volt"].setText(sprintf("%s", val.elecBat1Volt)); + obj["Bat1Ampere"].setText(sprintf("%2.0f", val.elecBat1Amp)); + obj["Bat1Volt"].setText(sprintf("%2.0f", val.elecBat1Volt)); if (val.elecBat1Volt >= 24.95 and val.elecBat1Volt <= 31.05) { obj["Bat1Volt"].setColor(0.0509,0.7529,0.2941); @@ -248,8 +252,8 @@ var canvas_lowerECAMPageElec = } else { obj["BAT2-OFF"].hide(); obj["BAT2-content"].show(); - obj["Bat2Ampere"].setText(sprintf("%s", val.elecBat2Amp)); - obj["Bat2Volt"].setText(sprintf("%s", val.elecBat2Volt)); + obj["Bat2Ampere"].setText(sprintf("%2.0f", val.elecBat2Amp)); + obj["Bat2Volt"].setText(sprintf("%2.0f", val.elecBat2Volt)); if (val.elecBat2Volt >= 24.95 and val.elecBat2Volt <= 31.05) { obj["Bat2Volt"].setColor(0.0509,0.7529,0.2941); @@ -384,7 +388,7 @@ var canvas_lowerECAMPageElec = obj["ELEC-Line-DC1-DCESS"].hide(); } }), - props.UpdateManager.FromHashValue("elecDcEssFeedTr", nil, func(val) { + props.UpdateManager.FromHashValue("elecTrEssContact", nil, func(val) { if (val) { obj["ELEC-Line-ESSTR-DCESS"].show(); } else { @@ -400,6 +404,252 @@ var canvas_lowerECAMPageElec = obj["ELEC-Line-Emergen-ESSTR"].hide(); } }), + props.UpdateManager.FromHashList(["elecTREssAmp","elecTREssVolt","elecTrEssContact"], nil, func(val) { + if (val.elecTrEssContact) { + obj["ESSTR-group"].show(); + obj["ESSTR-Volt"].setText(sprintf("%s", math.round(val.elecTREssVolt))); + obj["ESSTR-Ampere"].setText(sprintf("%s", math.round(val.elecTREssAmp))); + + if (val.elecTREssVolt < 25 or val.elecTREssVolt > 31 or val.elecTREssAmp < 5) { + obj["ESSTR"].setColor(0.7333,0.3803,0); + } else { + obj["ESSTR"].setColor(0.8078,0.8039,0.8078); + } + + if (val.elecTREssVolt < 25 or val.elecTREssVolt > 31) { + obj["ESSTR-Volt"].setColor(0.7333,0.3803,0); + } else { + obj["ESSTR-Volt"].setColor(0.0509,0.7529,0.2941); + } + + if (val.elecTREssAmp < 5) { + obj["ESSTR-Ampere"].setColor(0.7333,0.3803,0); + } else { + obj["ESSTR-Ampere"].setColor(0.0509,0.7529,0.2941); + } + } else { + obj["ESSTR-group"].hide(); + } + }), + props.UpdateManager.FromHashList(["elecEmerGenHertz","elecEmerGenVolts","elecEmerGenVoltsRelay"], nil, func(val) { + if (val.elecEmerGenVolts == 0) { + obj["EMERGEN-group"].hide(); + obj["ELEC-Line-Emergen-ESSTR"].hide(); + obj["ELEC-Line-Emergen-ESSTR-off"].show(); + obj["EMERGEN-Label-off"].show(); + } else { + obj["EMERGEN-group"].show(); + obj["ELEC-Line-Emergen-ESSTR"].show(); + obj["ELEC-Line-Emergen-ESSTR-off"].hide(); + obj["EMERGEN-Label-off"].hide(); + + obj["EmergenVolt"].setText(sprintf("%s", math.round(val.elecEmerGenVoltsRelay))); + obj["EmergenHz"].setText(sprintf("%s", math.round(val.elecEmerGenHertz))); + + if (val.elecEmerGenVoltsRelay > 120 or val.elecEmerGenVoltsRelay < 110 or val.elecEmerGenHertz > 410 or val.elecEmerGenHertz < 390) { + obj["Emergen-Label"].setColor(0.7333,0.3803,0); + } else { + obj["Emergen-Label"].setColor(0.8078,0.8039,0.8078); + } + + if (val.elecEmerGenVoltsRelay > 120 or val.elecEmerGenVoltsRelay < 110) { + obj["EmergenVolt"].setColor(0.7333,0.3803,0); + } else { + obj["EmergenVolt"].setColor(0.0509,0.7529,0.2941); + } + + if (val.elecEmerGenHertz > 410 or val.elecEmerGenHertz < 390) { + obj["EmergenHz"].setColor(0.7333,0.3803,0); + } else { + obj["EmergenHz"].setColor(0.0509,0.7529,0.2941); + } + } + }), + props.UpdateManager.FromHashList(["elecGen1Switch","elecGen1Hertz","elecGen1Volt","engine1Running","elecGen1Relay"], nil, func(val) { + if (val.elecGen1Switch == 0) { + obj["GEN1-content"].hide(); + obj["GEN1-off"].show(); + if (val.elecGen1Relay) { + obj["GEN1-label"].setColor(0.7333,0.3803,0); + } else { + obj["GEN1-label"].setColor(0.8078,0.8039,0.8078); + } + } else { + obj["GEN1-content"].show(); + obj["GEN1-off"].hide(); + obj["Gen1Volt"].setText(sprintf("%s", math.round(val.elecGen1Volt))); + + if (val.elecGen1Hertz == 0) { + obj["Gen1Hz"].setText(sprintf("XX")); + } else { + obj["Gen1Hz"].setText(sprintf("%s", math.round(val.elecGen1Hertz))); + } + + if (val.elecGen1Volt > 120 or val.elecGen1Volt < 110 or val.elecGen1Hertz > 410 or val.elecGen1Hertz < 390) { + obj["GEN1-label"].setColor(0.7333,0.3803,0); + } else { + obj["GEN1-label"].setColor(0.8078,0.8039,0.8078); + } + + if (val.elecGen1Volt > 120 or val.elecGen1Volt < 110) { + obj["Gen1Volt"].setColor(0.7333,0.3803,0); + } else { + obj["Gen1Volt"].setColor(0.0509,0.7529,0.2941); + } + + if (val.elecGen1Hertz > 410 or val.elecGen1Hertz < 390) { + obj["Gen1Hz"].setColor(0.7333,0.3803,0); + } else { + obj["Gen1Hz"].setColor(0.0509,0.7529,0.2941); + } + } + }), + props.UpdateManager.FromHashList(["elecGen2Switch","elecGen2Hertz","elecGen2Volt","engine1Running","elecGen2Relay"], nil, func(val) { + if (val.elecGen2Switch == 0) { + obj["GEN2-content"].hide(); + obj["GEN2-off"].show(); + if (val.elecGen2Relay) { + obj["GEN2-label"].setColor(0.7333,0.3803,0); + } else { + obj["GEN2-label"].setColor(0.8078,0.8039,0.8078); + } + } else { + obj["GEN2-content"].show(); + obj["GEN2-off"].hide(); + obj["Gen2Volt"].setText(sprintf("%s", math.round(val.elecGen2Volt))); + + if (val.elecGen2Hertz == 0) { + obj["Gen2Hz"].setText(sprintf("XX")); + } else { + obj["Gen2Hz"].setText(sprintf("%s", math.round(val.elecGen2Hertz))); + } + + if (val.elecGen2Volt > 120 or val.elecGen2Volt < 110 or val.elecGen2Hertz > 410 or val.elecGen2Hertz < 390) { + obj["GEN2-label"].setColor(0.7333,0.3803,0); + } else { + obj["GEN2-label"].setColor(0.8078,0.8039,0.8078); + } + + if (val.elecGen2Volt > 120 or val.elecGen2Volt < 110) { + obj["Gen2Volt"].setColor(0.7333,0.3803,0); + } else { + obj["Gen2Volt"].setColor(0.0509,0.7529,0.2941); + } + + if (val.elecGen2Hertz > 410 or val.elecGen2Hertz < 390) { + obj["Gen2Hz"].setColor(0.7333,0.3803,0); + } else { + obj["Gen2Hz"].setColor(0.0509,0.7529,0.2941); + } + } + }), + props.UpdateManager.FromHashList(["elecTR1Contact","elecAC1"], nil, func(val) { + if (val.elecTR1Contact) { + if (val.elecAC1 < 110) { + obj["ELEC-Line-AC1-TR1"].setColorFill(0.7333,0.3803,0); + } else { + obj["ELEC-Line-AC1-TR1"].setColorFill(0.0509,0.7529,0.2941); + } + obj["ELEC-Line-AC1-TR1"].show(); + obj["ELEC-Line-TR1-DC1"].show(); + } else { + obj["ELEC-Line-AC1-TR1"].hide(); + obj["ELEC-Line-TR1-DC1"].hide(); + } + }), + props.UpdateManager.FromHashList(["elecTR2Contact","elecAC2"], nil, func(val) { + if (val.elecTR2Contact) { + if (val.elecAC2 < 110) { + obj["ELEC-Line-AC2-TR2"].setColorFill(0.7333,0.3803,0); + } else { + obj["ELEC-Line-AC2-TR2"].setColorFill(0.0509,0.7529,0.2941); + } + obj["ELEC-Line-AC2-TR2"].show(); + obj["ELEC-Line-TR2-DC2"].show(); + } else { + obj["ELEC-Line-AC2-TR2"].hide(); + obj["ELEC-Line-TR2-DC2"].hide(); + } + }), + props.UpdateManager.FromHashList(["elecAcEssFeed1","elecAcEssFeed2","elecAC1","elecAC2"], nil, func(val) { + if (val.elecAcEssFeed1) { + if (val.elecAC1 >= 110) { + obj["ELEC-Line-AC1-ACESS"].show(); + } else { + obj["ELEC-Line-AC1-ACESS"].hide(); + } + obj["ELEC-Line-AC2-ACESS"].hide(); + } elsif (val.elecAcEssFeed2) { + obj["ELEC-Line-AC1-ACESS"].hide(); + if (val.elecAC2 >= 110) { + obj["ELEC-Line-AC2-ACESS"].show(); + } else { + obj["ELEC-Line-AC2-ACESS"].hide(); + } + } else { + obj["ELEC-Line-AC1-ACESS"].hide(); + obj["ELEC-Line-AC2-ACESS"].hide(); + } + }), + props.UpdateManager.FromHashList(["elecGen1Volt","elecGen1GLC"], nil, func(val) { + if (val.elecGen1Volt >= 110 and val.elecGen1GLC) { + obj["ELEC-Line-GEN1-AC1"].show(); + } else { + obj["ELEC-Line-GEN1-AC1"].hide(); + } + }), + props.UpdateManager.FromHashList(["elecGen2Volt","elecGen2GLC"], nil, func(val) { + if (val.elecGen2Volt >= 110 and val.elecGen2GLC) { + obj["ELEC-Line-GEN1-AC1"].show(); + } else { + obj["ELEC-Line-GEN1-AC1"].hide(); + } + }), + props.UpdateManager.FromHashList(["elecAcTie1","elecAcTie2","apuGLC","elecExtEPC","elecGen1GLC","elecGen2GLC"], nil, func(val) { + if (val.apuGLC and (val.elecAcTie1 or val.elecAcTie2)) { + obj["APU-out"].show(); + } else { + obj["APU-out"].hide(); + } + + if (val.elecExtEPC and (val.elecAcTie1 or val.elecAcTie2)) { + obj["EXT-out"].show(); + } else { + obj["EXT-out"].hide(); + } + + + if (val.elecAcTie1 and val.elecAcTie2) { + obj["ELEC-Line-APU-AC1"].show(); + obj["ELEC-Line-APU-EXT"].show(); + obj["ELEC-Line-EXT-AC2"].show(); + } else { + if (val.elecAcTie1) { + obj["ELEC-Line-APU-AC1"].show(); + } else { + obj["ELEC-Line-APU-AC1"].hide(); + } + + if ((val.elecAcTie2 and val.apuGLC and !val.elecGen2GLC) or (val.elecAcTie1 and val.elecExtEPC and !val.elecGen1GLC)) { + obj["ELEC-Line-APU-EXT"].show(); + } else { + obj["ELEC-Line-APU-EXT"].hide(); + } + + if (val.elecAcTie2) { + obj["ELEC-Line-EXT-AC2"].show(); + } else { + obj["ELEC-Line-EXT-AC2"].hide(); + } + } + }), + props.UpdateManager.FromHashList(["elecACEss"], nil, func(val) { + if (val.elecACEss >= 110 and !val.elecAcEssEmerGenFeed and (!val.elecTR1Contact or !val.elecTR2Contact)) { + obj["ELEC-Line-ACESS-TRESS"].show(); + } else { + obj["ELEC-Line-ACESS-TRESS"].hide(); + } + }), ]; obj.displayedGForce = 0; @@ -521,6 +771,8 @@ var canvas_lowerECAMPageElec = }; var input = { + elecAcEssFeed1: "/systems/electrical/relay/ac-ess-feed-1/contact-pos", + elecAcEssFeed2: "/systems/electrical/relay/ac-ess-feed-2/contact-pos", elecBat1Amp: "/systems/electrical/sources/bat-1/amps", elecBat2Amp: "/systems/electrical/sources/bat-2/amps", elecBat1Direction: "/systems/electrical/sources/bat-1/direction", @@ -535,6 +787,11 @@ var input = { elecTR2Amp: "/systems/electrical/relay/tr-contactor-2/output-amp", elecTR1Volt: "/systems/electrical/relay/tr-contactor-1/output", elecTR2Volt: "/systems/electrical/relay/tr-contactor-2/output", + elecTR1Contact: "/systems/electrical/relay/tr-contactor-1/contact-pos", + elecTR2Contact: "/systems/electrical/relay/tr-contactor-2/contact-pos", + elecTREssAmp: "/systems/electrical/relay/dc-ess-feed-tr/output-amp", + elecTrEssContact: "/systems/electrical/relay/dc-ess-feed-tr/contact-pos", + elecTREssVolt: "/systems/electrical/relay/dc-ess-feed-tr/output", elecIDG1Disc: "/controls/electrical/switches/idg-1-disc", elecIDG2Disc: "/controls/electrical/switches/idg-2-disc", elecGroundCart: "/controls/electrical/ground-cart", @@ -543,8 +800,23 @@ var input = { elecDCTie1: "/systems/electrical/relay/dc-bus-tie-dc-1/contact-pos", elecDCTie2: "/systems/electrical/relay/dc-bus-tie-dc-2/contact-pos", elecDcEssFeedBat: "/systems/electrical/relay/dc-ess-feed-bat/contact-pos", - elecDcEssFeedTr: "/systems/electrical/relay/dc-ess-feed-tr/contact-pos", elecAcEssEmerGenFeed: "/systems/electrical/relay/ac-ess-feed-emer-gen/contact-pos", + elecEmerGenVolts: "/systems/electrical/sources/emer-gen/output-volt", + elecEmerGenVoltsRelay: "/systems/electrical/relay/emer-glc/output", + elecEmerGenHertz: "/systems/electrical/sources/emer-gen/output-hertz", + elecGen1Switch: "/controls/electrical/switches/gen-1", + elecGen1Hertz: "/systems/electrical/sources/idg-1/output-hertz", + elecGen1Volt: "/systems/electrical/sources/idg-1/output-volt", + elecGen1Relay: "/systems/electrical/sources/idg-1/gcr-relay", + elecGen1GLC: "/systems/electrical/relay/gen-1-glc/contact-pos", + elecGen2Switch: "/controls/electrical/switches/gen-2", + elecGen2Hertz: "/systems/electrical/sources/idg-2/output-hertz", + elecGen2Volt: "/systems/electrical/sources/idg-2/output-volt", + elecGen2Relay: "/systems/electrical/sources/idg-2/gcr-relay", + elecGen2GLC: "/systems/electrical/relay/gen-2-glc/contact-pos", + elecAcTie1: "/systems/electrical/relay/ac-bus-ac-bus-tie-1/contact-pos", + elecAcTie2: "/systems/electrical/relay/ac-bus-ac-bus-tie-2/contact-pos", + elecExtEPC: "/systems/electrical/relay/ext-epc/contact-pos", ElecGalleyShed: "/systems/electrical/some-electric-thingie/galley-shed", }; diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas deleted file mode 100644 index beb1adfb..00000000 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-old.nas +++ /dev/null @@ -1,419 +0,0 @@ -# A3XX Lower ECAM Canvas - -# Copyright (c) 2020 Josh Davidson (Octal450) - -var lowerECAM_apu = nil; -var lowerECAM_bleed = nil; -var lowerECAM_cond = nil; -var lowerECAM_crz = nil; -var lowerECAM_door = nil; -var lowerECAM_elec = nil; -var lowerECAM_eng = nil; -var lowerECAM_fctl = nil; -var lowerECAM_fuel = nil; -var lowerECAM_hyd = nil; -var lowerECAM_press = nil; -var lowerECAM_status = nil; -var lowerECAM_wheel = nil; -var lowerECAM_test = nil; -var lowerECAM_display = nil; -var page = "fctl"; -var blue_psi = 0; -var green_psi = 0; -var yellow_psi = 0; -var autobrakemode = 0; -var nosegear = 0; -var leftgear = 0; -var rightgear = 0; -var leftdoor = 0; -var rightdoor = 0; -var nosedoor = 0; -var gearlvr = 0; -var elapsedtime = 0; -var tr1_v = 0; -var tr1_a = 0; -var tr2_v = 0; -var tr2_a = 0; -var essTramps = 0; -var essTrvolts = 0; -var elac1Node = 0; -var elac2Node = 0; -var sec1Node = 0; -var sec2Node = 0; -var eng_valve_state = 0; -var bleed_valve_cur = 0; -var hp_valve_state = 0; -var xbleedcmdstate = 0; -var ramAirState = 0; - -# Fetch Nodes -var acconfig_weight_kgs = props.globals.getNode("/systems/acconfig/options/weight-kgs", 1); -var rate = props.globals.getNode("/systems/acconfig/options/lecam-rate", 1); -var autoconfig_running = props.globals.getNode("/systems/acconfig/autoconfig-running", 1); -var ecam_page = props.globals.getNode("/ECAM/Lower/page", 1); -var hour = props.globals.getNode("/sim/time/utc/hour", 1); -var minute = props.globals.getNode("/sim/time/utc/minute", 1); -var apu_flap = props.globals.getNode("/controls/apu/inlet-flap/position-norm", 1); -var apu_rpm = props.globals.getNode("/engines/engine[2]/n1", 1); -var apu_egt = props.globals.getNode("/systems/apu/egt-degC", 1); -var door_left = props.globals.getNode("/ECAM/Lower/door-left", 1); -var door_right = props.globals.getNode("/ECAM/Lower/door-right", 1); -var door_nose_left = props.globals.getNode("/ECAM/Lower/door-nose-left", 1); -var door_nose_right = props.globals.getNode("/ECAM/Lower/door-nose-right", 1); -var apu_rpm_rot = props.globals.getNode("/ECAM/Lower/APU-N", 1); -var apu_egt_rot = props.globals.getNode("/ECAM/Lower/APU-EGT", 1); -var oil_qt1 = props.globals.getNode("/ECAM/Lower/Oil-QT[0]", 1); -var oil_qt2 = props.globals.getNode("/ECAM/Lower/Oil-QT[1]", 1); -var oil_psi1 = props.globals.getNode("/ECAM/Lower/Oil-PSI[0]", 1); -var oil_psi2 = props.globals.getNode("/ECAM/Lower/Oil-PSI[1]", 1); -var bleedapu = props.globals.getNode("", 1); -var aileron_ind_left = props.globals.getNode("", 1); -var aileron_ind_right = props.globals.getNode("/ECAM/Lower/aileron-ind-right", 1); -var elevator_ind_left = props.globals.getNode("", 1); -var elevator_ind_right = props.globals.getNode("/ECAM/Lower/elevator-ind-right", 1); -var elevator_trim_deg = props.globals.getNode("", 1); -var final_deg = props.globals.getNode("", 1); -var temperature_degc = props.globals.getNode("/environment/temperature-degc", 1); -var tank3_content_lbs = props.globals.getNode("/fdm/jsbsim/propulsion/tank[2]/contents-lbs", 1); -var ir2_knob = props.globals.getNode("/controls/adirs/ir[1]/knob", 1); -var apuBleedNotOn = props.globals.getNode("", 1); -var apu_valve = props.globals.getNode("/systems/pneumatics/valves/apu-bleed-valve-cmd", 1); -var apu_valve_state = props.globals.getNode("/systems/pneumatics/valves/apu-bleed-valve", 1); -var xbleedcmd = props.globals.getNode("/systems/pneumatics/valves/crossbleed-valve-cmd", 1); -var xbleed = props.globals.getNode("/systems/pneumatics/valves/crossbleed-valve", 1); -var xbleedstate = nil; -var precooler1_psi = props.globals.getNode("/systems/pneumatics/psi/engine-1-psi", 1); -var precooler2_psi = props.globals.getNode("/systems/pneumatics/psi/engine-2-psi", 1); -var precooler1_temp = props.globals.getNode("/systems/pneumatics/precooler/temp-1", 1); -var precooler2_temp = props.globals.getNode("/systems/pneumatics/precooler/temp-2", 1); -var precooler1_ovht = props.globals.getNode("/systems/pneumatics/precooler/ovht-1", 1); -var precooler2_ovht = props.globals.getNode("/systems/pneumatics/precooler/ovht-2", 1); -var bmc1working = props.globals.getNode("", 1); -var bmc2working = props.globals.getNode("/systems/pneumatics/indicating/bmc2-working", 1); -var bmc1 = 0; -var bmc2 = 0; -var gs_kt = props.globals.getNode("/velocities/groundspeed-kt", 1); -var switch_wing_aice = props.globals.getNode("/controls/ice-protection/wing", 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("", 1); -var oil_qt2_actual = props.globals.getNode("/engines/engine[1]/oil-qt-actual", 1); -var fuel_used_lbs1 = props.globals.getNode("", 1); -var gLoad = props.globals.getNode("", 1); - -# Hydraulic -var blue_psi = 0; -var green_psi = 0; -var yellow_psi = 0; -var rat_deployed = props.globals.getNode("/controls/hydraulic/rat-deployed", 1); -var y_resv_ovht = props.globals.getNode("/systems/hydraulic/yellow-resv-ovht", 1); -var b_resv_ovht = props.globals.getNode("/systems/hydraulic/blue-resv-ovht", 1); -var g_resv_ovht = props.globals.getNode("/systems/hydraulic/green-resv-ovht", 1); -var askidsw = 0; -var brakemode = 0; -var accum = 0; -var L1BrakeTempc = props.globals.getNode("/gear/gear[1]/L1brake-temp-degc", 1); -var L2BrakeTempc = props.globals.getNode("/gear/gear[1]/L2brake-temp-degc", 1); -var R3BrakeTempc = props.globals.getNode("/gear/gear[2]/R3brake-temp-degc", 1); -var R4BrakeTempc = props.globals.getNode("/gear/gear[2]/R4brake-temp-degc", 1); - -var switch_cart = props.globals.getNode("/controls/electrical/ground-cart", 1); -var fuel_flow1 = props.globals.getNode("/engines/engine[0]/fuel-flow_actual", 1); -var fuel_flow2 = props.globals.getNode("/engines/engine[1]/fuel-flow_actual", 1); -var cutoff_switch1 = props.globals.getNode("/controls/engines/engine[0]/cutoff-switch", 1); -var cutoff_switch2 = props.globals.getNode("/controls/engines/engine[1]/cutoff-switch", 1); -var autobreak_mode = props.globals.getNode("/controls/autobrake/mode", 1); -var gear1_pos = props.globals.getNode("/gear/gear[0]/position-norm", 1); -var gear2_pos = props.globals.getNode("/gear/gear[1]/position-norm", 1); -var gear3_pos = props.globals.getNode("/gear/gear[2]/position-norm", 1); -var gear_door_L = props.globals.getNode("/systems/hydraulic/gear/door-left", 1); -var gear_door_R = props.globals.getNode("/systems/hydraulic/gear/door-right", 1); -var gear_door_N = props.globals.getNode("/systems/hydraulic/gear/door-nose", 1); -var gear_down = props.globals.getNode("/controls/gear/gear-down", 1); -var press_vs_norm = props.globals.getNode("", 1); -var cabinalt = props.globals.getNode("", 1); -var gear0_wow = props.globals.getNode("/gear/gear[0]/wow", 1); - - - # ESS TR - essTrvolts = systems.ELEC.Source.trEss.outputVoltRelay.getValue(); - essTramps = systems.ELEC.Source.trEss.outputAmpRelay.getValue(); - if (systems.ELEC.Relay.essTrContactor.getValue()) { - me["ESSTR-group"].show(); - me["ESSTR-Volt"].setText(sprintf("%s", math.round(essTrvolts))); - me["ESSTR-Ampere"].setText(sprintf("%s", math.round(essTramps))); - - if (essTrvolts < 25 or essTrvolts > 31 or essTramps < 5) { - me["ESSTR"].setColor(0.7333,0.3803,0); - } else { - me["ESSTR"].setColor(0.8078,0.8039,0.8078); - } - - if (essTrvolts < 25 or essTrvolts > 31) { - me["ESSTR-Volt"].setColor(0.7333,0.3803,0); - } else { - me["ESSTR-Volt"].setColor(0.0509,0.7529,0.2941); - } - - if (essTramps < 5) { - me["ESSTR-Ampere"].setColor(0.7333,0.3803,0); - } else { - me["ESSTR-Ampere"].setColor(0.0509,0.7529,0.2941); - } - } else { - me["ESSTR-group"].hide(); - } - - # EMER GEN - if (systems.ELEC.Source.EmerGen.volts.getValue() == 0) { - me["EMERGEN-group"].hide(); - me["ELEC-Line-Emergen-ESSTR"].hide(); - me["ELEC-Line-Emergen-ESSTR-off"].show(); - me["EMERGEN-Label-off"].show(); - } else { - me["EMERGEN-group"].show(); - me["ELEC-Line-Emergen-ESSTR"].show(); - me["ELEC-Line-Emergen-ESSTR-off"].hide(); - me["EMERGEN-Label-off"].hide(); - - me["EmergenVolt"].setText(sprintf("%s", math.round(systems.ELEC.Source.EmerGen.voltsRelay.getValue()))); - me["EmergenHz"].setText(sprintf("%s", math.round(systems.ELEC.Source.EmerGen.hertz.getValue()))); - - if (systems.ELEC.Source.EmerGen.voltsRelay.getValue() > 120 or systems.ELEC.Source.EmerGen.voltsRelay.getValue() < 110 or systems.ELEC.Source.EmerGen.hertz.getValue() > 410 or systems.ELEC.Source.EmerGen.hertz.getValue() < 390) { - me["Emergen-Label"].setColor(0.7333,0.3803,0); - } else { - me["Emergen-Label"].setColor(0.8078,0.8039,0.8078); - } - - if (systems.ELEC.Source.EmerGen.voltsRelay.getValue() > 120 or systems.ELEC.Source.EmerGen.voltsRelay.getValue() < 110) { - me["EmergenVolt"].setColor(0.7333,0.3803,0); - } else { - me["EmergenVolt"].setColor(0.0509,0.7529,0.2941); - } - - if (systems.ELEC.Source.EmerGen.hertz.getValue() > 410 or systems.ELEC.Source.EmerGen.hertz.getValue() < 390) { - me["EmergenHz"].setColor(0.7333,0.3803,0); - } else { - me["EmergenHz"].setColor(0.0509,0.7529,0.2941); - } - } - - - - # GEN1 - if (systems.ELEC.Switch.gen1.getValue() == 0) { - me["GEN1-content"].hide(); - me["GEN1-off"].show(); - if (systems.ELEC.Source.IDG1.gcrRelay.getValue()) { - me["GEN1-label"].setColor(0.7333,0.3803,0); - } else { - me["GEN1-label"].setColor(0.8078,0.8039,0.8078); - } - - if (eng1_running.getValue() == 0) { - me["GEN1-num-label"].setColor(0.7333,0.3803,0); - } else { - me["GEN1-num-label"].setColor(0.8078,0.8039,0.8078); - } - } else { - me["GEN1-content"].show(); - me["GEN1-off"].hide(); - # me["Gen1Load"].setText(sprintf("%s", math.round(gen1_load.getValue()))); - me["Gen1Volt"].setText(sprintf("%s", math.round(systems.ELEC.Source.IDG1.volts.getValue()))); - - if (systems.ELEC.Source.IDG1.hertz.getValue() == 0) { - me["Gen1Hz"].setText(sprintf("XX")); - } else { - me["Gen1Hz"].setText(sprintf("%s", math.round(systems.ELEC.Source.IDG1.hertz.getValue()))); - } - - if (eng1_running.getValue() == 0) { - me["GEN1-num-label"].setColor(0.7333,0.3803,0); - } else { - me["GEN1-num-label"].setColor(0.8078,0.8039,0.8078); - } - - if (systems.ELEC.Source.IDG1.volts.getValue() > 120 or systems.ELEC.Source.IDG1.volts.getValue() < 110 or systems.ELEC.Source.IDG1.hertz.getValue() > 410 or systems.ELEC.Source.IDG1.hertz.getValue() < 390 or gen1_load.getValue() >= 110) { - me["GEN1-label"].setColor(0.7333,0.3803,0); - } else { - me["GEN1-label"].setColor(0.8078,0.8039,0.8078); - } - - if (gen1_load.getValue() >= 110) { - me["Gen1Load"].setColor(0.7333,0.3803,0); - } else { - me["Gen1Load"].setColor(0.0509,0.7529,0.2941); - } - - if (systems.ELEC.Source.IDG1.volts.getValue() > 120 or systems.ELEC.Source.IDG1.volts.getValue() < 110) { - me["Gen1Volt"].setColor(0.7333,0.3803,0); - } else { - me["Gen1Volt"].setColor(0.0509,0.7529,0.2941); - } - - if (systems.ELEC.Source.IDG1.hertz.getValue() > 410 or systems.ELEC.Source.IDG1.hertz.getValue() < 390) { - me["Gen1Hz"].setColor(0.7333,0.3803,0); - } else { - me["Gen1Hz"].setColor(0.0509,0.7529,0.2941); - } - } - - # GEN2 - if (systems.ELEC.Switch.gen2.getValue() == 0) { - me["GEN2-content"].hide(); - me["GEN2-off"].show(); - if (systems.ELEC.Source.IDG2.gcrRelay.getValue()) { - me["GEN2-label"].setColor(0.7333,0.3803,0); - } else { - me["GEN2-label"].setColor(0.8078,0.8039,0.8078); - } - - if (eng2_running.getValue() == 0) { - me["GEN2-num-label"].setColor(0.7333,0.3803,0); - } else { - me["GEN2-num-label"].setColor(0.8078,0.8039,0.8078); - } - } else { - me["GEN2-content"].show(); - me["GEN2-off"].hide(); - # me["Gen2Load"].setText(sprintf("%s", math.round(gen2_load.getValue()))); - me["Gen2Volt"].setText(sprintf("%s", math.round(systems.ELEC.Source.IDG2.volts.getValue()))); - if (systems.ELEC.Source.IDG2.hertz.getValue() == 0) { - me["Gen2Hz"].setText(sprintf("XX")); - } else { - me["Gen2Hz"].setText(sprintf("%s", math.round(systems.ELEC.Source.IDG2.hertz.getValue()))); - } - - if (eng2_running.getValue() == 0) { - me["GEN2-num-label"].setColor(0.7333,0.3803,0); - } else { - me["GEN2-num-label"].setColor(0.8078,0.8039,0.8078); - } - - if (systems.ELEC.Source.IDG2.volts.getValue() > 120 or systems.ELEC.Source.IDG2.volts.getValue() < 110 or systems.ELEC.Source.IDG2.hertz.getValue() > 410 or systems.ELEC.Source.IDG2.hertz.getValue() < 390 or gen2_load.getValue() >= 110) { - me["GEN2-label"].setColor(0.7333,0.3803,0); - } else { - me["GEN2-label"].setColor(0.8078,0.8039,0.8078); - } - - if (gen2_load.getValue() >= 110) { - me["Gen2Load"].setColor(0.7333,0.3803,0); - } else { - me["Gen2Load"].setColor(0.0509,0.7529,0.2941); - } - - - if (systems.ELEC.Source.IDG2.volts.getValue() > 120 or systems.ELEC.Source.IDG2.volts.getValue() < 110) { - me["Gen2Volt"].setColor(0.7333,0.3803,0); - } else { - me["Gen2Volt"].setColor(0.0509,0.7529,0.2941); - } - - if (systems.ELEC.Source.IDG2.hertz.getValue() > 410 or systems.ELEC.Source.IDG2.hertz.getValue() < 390) { - me["Gen2Hz"].setColor(0.7333,0.3803,0); - } else { - me["Gen2Hz"].setColor(0.0509,0.7529,0.2941); - } - } - - - - # Managment of the connecting lines between the components - if (systems.ELEC.Relay.apuGlc.getValue() and (systems.ELEC.Relay.acTie1.getValue() or systems.ELEC.Relay.acTie2.getValue())) { - me["APU-out"].show(); - } else { - me["APU-out"].hide(); - } - - if (systems.ELEC.Relay.extEpc.getValue() and (systems.ELEC.Relay.acTie1.getValue() or systems.ELEC.Relay.acTie2.getValue())) { - me["EXT-out"].show(); - } else { - me["EXT-out"].hide(); - } - - if (systems.ELEC.Source.IDG1.volts.getValue() >= 110 and systems.ELEC.Relay.glc1.getValue()) { - me["ELEC-Line-GEN1-AC1"].show(); - } else { - me["ELEC-Line-GEN1-AC1"].hide(); - } - - if (systems.ELEC.Source.IDG2.volts.getValue() >= 110 and systems.ELEC.Relay.glc2.getValue()) { - me["ELEC-Line-GEN2-AC2"].show(); - } else { - me["ELEC-Line-GEN2-AC2"].hide(); - } - - if (systems.ELEC.Relay.acTie1.getValue() and systems.ELEC.Relay.acTie2.getValue()) { - me["ELEC-Line-APU-AC1"].show(); - me["ELEC-Line-APU-EXT"].show(); - me["ELEC-Line-EXT-AC2"].show(); - } else { - if (systems.ELEC.Relay.acTie1.getValue()) { - me["ELEC-Line-APU-AC1"].show(); - } else { - me["ELEC-Line-APU-AC1"].hide(); - } - - if ((systems.ELEC.Relay.acTie2.getValue() and systems.ELEC.Relay.apuGlc.getValue() and !systems.ELEC.Relay.glc2.getValue()) or (systems.ELEC.Relay.acTie1.getValue() and systems.ELEC.Relay.extEpc.getValue() and !systems.ELEC.Relay.glc1.getValue())) { - me["ELEC-Line-APU-EXT"].show(); - } else { - me["ELEC-Line-APU-EXT"].hide(); - } - - if (systems.ELEC.Relay.acTie2.getValue()) { - me["ELEC-Line-EXT-AC2"].show(); - } else { - me["ELEC-Line-EXT-AC2"].hide(); - } - } - - if (systems.ELEC.Relay.acEssFeed1.getValue()) { - if (systems.ELEC.Bus.ac1.getValue() >= 110) { - me["ELEC-Line-AC1-ACESS"].show(); - } else { - me["ELEC-Line-AC1-ACESS"].hide(); - } - me["ELEC-Line-AC2-ACESS"].hide(); - } elsif (systems.ELEC.Relay.acEssFeed2.getValue()) { - me["ELEC-Line-AC1-ACESS"].hide(); - if (systems.ELEC.Bus.ac2.getValue() >= 110) { - me["ELEC-Line-AC2-ACESS"].show(); - } else { - me["ELEC-Line-AC2-ACESS"].hide(); - } - } else { - me["ELEC-Line-AC1-ACESS"].hide(); - me["ELEC-Line-AC2-ACESS"].hide(); - } - - if (systems.ELEC.Relay.tr1Contactor.getValue()) { - if (systems.ELEC.Bus.ac1.getValue() < 110) { - me["ELEC-Line-AC1-TR1"].setColorFill(0.7333,0.3803,0); - } else { - me["ELEC-Line-AC1-TR1"].setColorFill(0.0509,0.7529,0.2941); - } - me["ELEC-Line-AC1-TR1"].show(); - me["ELEC-Line-TR1-DC1"].show(); - } else { - me["ELEC-Line-AC1-TR1"].hide(); - me["ELEC-Line-TR1-DC1"].hide(); - } - - if (systems.ELEC.Relay.tr2Contactor.getValue()) { - if (systems.ELEC.Bus.ac2.getValue() < 110) { - me["ELEC-Line-AC2-TR2"].setColorFill(0.7333,0.3803,0); - } else { - me["ELEC-Line-AC2-TR2"].setColorFill(0.0509,0.7529,0.2941); - } - me["ELEC-Line-AC2-TR2"].show(); - me["ELEC-Line-TR2-DC2"].show(); - } else { - me["ELEC-Line-AC2-TR2"].hide(); - me["ELEC-Line-TR2-DC2"].hide(); - } - - if (systems.ELEC.Bus.acEss.getValue() >= 110 and !systems.ELEC.Relay.acEssEmerGenFeed.getValue() and (!systems.ELEC.Relay.tr1Contactor.getValue() or !systems.ELEC.Relay.tr2Contactor.getValue())) { - me["ELEC-Line-ACESS-TRESS"].show(); - } else { - me["ELEC-Line-ACESS-TRESS"].hide(); - } \ No newline at end of file From 878ec89e4827dacfe30b7c836d37c31e58117663 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 24 Jul 2021 19:38:49 +0100 Subject: [PATCH 86/96] Hydraulics page - improve and add quantity indicators --- .../Instruments/Lower-ECAM/Lower-ECAM-hyd.nas | 104 ++++++++++++--- Models/Instruments/Lower-ECAM/res/hyd.svg | 125 ++++++++++++------ Nasal/Systems/hydraulics.nas | 6 +- 3 files changed, 167 insertions(+), 68 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas index 4ec5fbce..d87f4901 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas @@ -21,6 +21,20 @@ var canvas_lowerECAMPageHyd = foreach(var key; obj.getKeys()) { obj[key] = obj.group.getElementById(key); + + var clip_el = obj.group.getElementById(key ~ "_clip"); + if (clip_el != nil) { + clip_el.setVisible(0); + var tran_rect = clip_el.getTransformedBounds(); + + var clip_rect = sprintf("rect(%d,%d, %d,%d)", + tran_rect[1], + tran_rect[2], + tran_rect[3], + tran_rect[0]); + obj[key].set("clip", clip_rect); + obj[key].set("clip-frame", canvas.Element.PARENT); + } }; foreach(var key; obj.getKeysBottom()) { @@ -33,9 +47,13 @@ var canvas_lowerECAMPageHyd = obj.update_items = [ props.UpdateManager.FromHashValue("blue", 25, func(val) { - obj["Press-Blue"].setText(sprintf("%s", math.round(val, 50))); + if (val >= 100) { + obj["Press-Blue"].setText(sprintf("%s", math.round(val, 50))); + } else { + obj["Press-Blue"].setText(sprintf("%s", 0)); + } - if (val >= 1500) { + if (val > 1450) { obj["Blue-Line"].setColor(0.0509,0.7529,0.2941); obj["Blue-Line"].setColorFill(0.0509,0.7529,0.2941); obj["Blue-Line-Top"].setColorFill(0.0509,0.7529,0.2941); @@ -54,9 +72,13 @@ var canvas_lowerECAMPageHyd = } }), props.UpdateManager.FromHashValue("yellow", 25, func(val) { - obj["Press-Yellow"].setText(sprintf("%s", math.round(val, 50))); + if (val >= 100) { + obj["Press-Yellow"].setText(sprintf("%s", math.round(val, 50))); + } else { + obj["Press-Yellow"].setText(sprintf("%s", 0)); + } - if (val >= 1500) { + if (val > 1450) { obj["Yellow-Line"].setColor(0.0509,0.7529,0.2941); obj["Yellow-Line"].setColorFill(0.0509,0.7529,0.2941); obj["Yellow-Line-Top"].setColorFill(0.0509,0.7529,0.2941); @@ -77,9 +99,13 @@ var canvas_lowerECAMPageHyd = } }), props.UpdateManager.FromHashValue("green", 25, func(val) { - obj["Press-Green"].setText(sprintf("%s", math.round(val, 50))); + if (val >= 100) { + obj["Press-Green"].setText(sprintf("%s", math.round(val, 50))); + } else { + obj["Press-Green"].setText(sprintf("%s", 0)); + } - if (val >= 1500) { + if (val > 1450) { obj["Green-Line"].setColor(0.0509,0.7529,0.2941); obj["Green-Line"].setColorFill(0.0509,0.7529,0.2941); obj["Green-Line-Top"].setColorFill(0.0509,0.7529,0.2941); @@ -169,7 +195,7 @@ var canvas_lowerECAMPageHyd = obj["OVHT-Yellow"].hide(); } }), - props.UpdateManager.FromHashValue("hydRATPosition", 0.01, func(val) { + props.UpdateManager.FromHashValue("hydRATPosition", nil, func(val) { if (val) { obj["RAT-stowed"].hide(); obj["RAT-not-stowed"].show(); @@ -178,7 +204,7 @@ var canvas_lowerECAMPageHyd = obj["RAT-not-stowed"].hide(); } }), - props.UpdateManager.FromHashValue("hydGreenFireValve", 0.01, func(val) { + props.UpdateManager.FromHashValue("hydGreenFireValve", nil, func(val) { if (val != 0) { obj["Fire-Valve-Green"].setColor(0.7333,0.3803,0); obj["Fire-Valve-Green-Cross"].setColorFill(0.7333,0.3803,0); @@ -189,7 +215,7 @@ var canvas_lowerECAMPageHyd = obj["Fire-Valve-Green"].setRotation(0); } }), - props.UpdateManager.FromHashValue("hydYellowFireValve", 0.01, func(val) { + props.UpdateManager.FromHashValue("hydYellowFireValve", nil, func(val) { if (val != 0) { obj["Fire-Valve-Yellow"].setColor(0.7333,0.3803,0); obj["Fire-Valve-Yellow-Cross"].setColorFill(0.7333,0.3803,0); @@ -200,15 +226,15 @@ var canvas_lowerECAMPageHyd = obj["Fire-Valve-Yellow"].setRotation(0); } }), - props.UpdateManager.FromHashValue("elecAC1", 1, func(val) { - if (val >= 110) { + props.UpdateManager.FromHashList(["elecAC1","dcEss"], 1, func(val) { + if (val.elecAC1 >= 110 and val.dcEss >= 25) { obj["ELEC-Blue-label"].setColor(0.8078,0.8039,0.8078); } else { obj["ELEC-Blue-label"].setColor(0.7333,0.3803,0); } }), - props.UpdateManager.FromHashValue("elecAC2", 1, func(val) { - if (val >= 110) { + props.UpdateManager.FromHashList(["elecAC2","dc2"], 1, func(val) { + if (val.elecAC2 >= 110 and val.dc2 >= 25) { obj["ELEC-Yellow-label"].setColor(0.8078,0.8039,0.8078); } else { obj["ELEC-Yellow-label"].setColor(0.7333,0.3803,0); @@ -221,7 +247,7 @@ var canvas_lowerECAMPageHyd = } else { obj["ELEC-Yellow-on"].show(); obj["ELEC-Yellow-off"].hide(); - if (val.yellow >= 1500) { + if (val.yellow > 1450) { obj["ELEC-Yellow-on"].setColor(0.0509,0.7529,0.2941); } else { obj["ELEC-Yellow-on"].setColor(0.7333,0.3803,0); @@ -231,20 +257,21 @@ var canvas_lowerECAMPageHyd = props.UpdateManager.FromHashList(["blue","hydBlueElecPumpSwitch"], nil, func(val) { if (val.hydBlueElecPumpSwitch) { obj["Pump-Blue-off"].hide(); - if (val.blue >= 1500) { + if (val.blue > 1450) { obj["Pump-Blue-on"].show(); - obj["Pump-Blue-off"].hide(); + obj["Pump-LOPR-Blue"].hide(); obj["Pump-Blue"].setColorFill(0.0509,0.7529,0.2941); obj["Pump-Blue"].setColor(0.0509,0.7529,0.2941); } else { - obj["Pump-Blue-off"].show(); obj["Pump-Blue-on"].hide(); + obj["Pump-LOPR-Blue"].show(); obj["Pump-Blue"].setColorFill(0.7333,0.3803,0); obj["Pump-Blue"].setColor(0.7333,0.3803,0); } } else { obj["Pump-Blue-off"].show(); obj["Pump-Blue-on"].hide(); + obj["Pump-LOPR-Blue"].hide(); obj["Pump-Blue"].setColorFill(0.7333,0.3803,0); obj["Pump-Blue"].setColor(0.7333,0.3803,0); } @@ -252,7 +279,7 @@ var canvas_lowerECAMPageHyd = props.UpdateManager.FromHashList(["yellow","hydYellowEDPPumpSwitch"], nil, func(val) { if (val.hydYellowEDPPumpSwitch) { obj["Pump-Yellow-off"].hide(); - if (val.yellow >= 1500) { + if (val.yellow > 1450) { obj["Pump-Yellow-on"].show(); obj["Pump-LOPR-Yellow"].hide(); obj["Pump-Yellow"].setColorFill(0.0509,0.7529,0.2941); @@ -274,7 +301,7 @@ var canvas_lowerECAMPageHyd = props.UpdateManager.FromHashList(["green","hydGreenEDPPumpSwitch"], nil, func(val) { if (val.hydGreenEDPPumpSwitch) { obj["Pump-Green-off"].hide(); - if (val.green >= 1500) { + if (val.green > 1450) { obj["Pump-Green-on"].show(); obj["Pump-LOPR-Green"].hide(); obj["Pump-Green"].setColor(0.0509,0.7529,0.2941); @@ -324,6 +351,36 @@ var canvas_lowerECAMPageHyd = obj["PTU-Auto-or-off"].show(); } }), + props.UpdateManager.FromHashValue("hydBlueQTY", 0.05, func(val) { + obj["Quantity-Indicator-Blue"].setTranslation(0,((val / 8) * -140) + 140); + if (val >= 2.4) { + obj["Quantity-Indicator-Blue"].setColor(0.0509,0.7529,0.2941); + obj["path5561-4"].setColor(0.0509,0.7529,0.2941); + } else { + obj["Quantity-Indicator-Blue"].setColor(0.7333,0.3803,0); + obj["path5561-4"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("hydGreenQTY", 0.05, func(val) { + obj["Quantity-Indicator-Green"].setTranslation(0,((val / 18) * -140) + 140); + if (val >= 3.5) { + obj["Quantity-Indicator-Green"].setColor(0.0509,0.7529,0.2941); + obj["path5561-5"].setColor(0.0509,0.7529,0.2941); + } else { + obj["Quantity-Indicator-Green"].setColor(0.7333,0.3803,0); + obj["path5561-5"].setColor(0.7333,0.3803,0); + } + }), + props.UpdateManager.FromHashValue("hydYellowQTY", 0.05, func(val) { + obj["Quantity-Indicator-Yellow"].setTranslation(0,((val / 15) * -140) + 140); + if (val >= 3.5) { + obj["Quantity-Indicator-Yellow"].setColor(0.0509,0.7529,0.2941); + obj["path5561"].setColor(0.0509,0.7529,0.2941); + } else { + obj["Quantity-Indicator-Yellow"].setColor(0.7333,0.3803,0); + obj["path5561"].setColor(0.7333,0.3803,0); + } + }), ]; obj.displayedGForce = 0; @@ -363,10 +420,10 @@ var canvas_lowerECAMPageHyd = return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit"]; }, getKeys: func() { - return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","Green-Indicator","Blue-Indicator","Yellow-Indicator","Press-Green","Press-Blue","Press-Yellow","Green-Line","Blue-Line","Yellow-Line","Green-Line-Top","Blue-Line-Top","Yellow-Line-Middle","Green-Line-Middle","Yellow-Line-Bottom","Green-Line-Bottom","Blue-Line-Bottom","Yellow-Line-Top","PTU-Supply-Line","PTU-supply-yellow","PTU-supply-green","PTU-connection", + return ["TAT","SAT","GW","UTCh","UTCm","GLoad","GW-weight-unit","Green-Indicator","HYD-Quantity-Group-Blue","HYD-Quantity-Group-Yellow","HYD-Quantity-Group-Green","Blue-Indicator","Yellow-Indicator","Press-Green","Press-Blue","Press-Yellow","Green-Line","Blue-Line","Yellow-Line","Green-Line-Top","Blue-Line-Top","Yellow-Line-Middle","Green-Line-Middle","Yellow-Line-Bottom","Green-Line-Bottom","Blue-Line-Bottom","Yellow-Line-Top","PTU-Supply-Line","PTU-supply-yellow","PTU-supply-green","PTU-connection", "PTU-Auto-or-off","RAT-label","RAT-stowed","RAT-not-stowed","ELEC-Yellow-off","ELEC-Yellow-on","ELEC-Yellow-label","ELEC-OVTH-Yellow","ELEC-Blue-label","ELEC-OVHT-Blue","ELEC-OVHT-Yellow","Pump-Green-label","Pump-Yellow-label","Pump-Green", - "Pump-LOPR-Green","Pump-Green-off","Pump-Green-on","Pump-Yellow","Pump-LOPR-Yellow","Pump-Yellow-off","Pump-Yellow-on","Pump-Blue", "Pump-Blue-off","Pump-Blue-on","Fire-Valve-Green","Fire-Valve-Yellow","LO-AIR-PRESS-Green", - "LO-AIR-PRESS-Yellow","LO-AIR-PRESS-Blue","OVHT-Green","OVHT-Blue","OVHT-Yellow","Quantity-Indicator-Green","Quantity-Indicator-Blue","Quantity-Indicator-Yellow","Green-label","Blue-label","Yellow-label","Fire-Valve-Yellow-Cross","Fire-Valve-Green-Cross"]; + "Pump-LOPR-Green","Pump-Green-off","Pump-Green-on","Pump-Yellow","Pump-LOPR-Yellow","Pump-Yellow-off","Pump-Yellow-on","Pump-Blue","Pump-LOPR-Blue","Pump-Blue-off","Pump-Blue-on","Fire-Valve-Green","Fire-Valve-Yellow","LO-AIR-PRESS-Green", + "LO-AIR-PRESS-Yellow","LO-AIR-PRESS-Blue","OVHT-Green","OVHT-Blue","OVHT-Yellow","Quantity-Indicator-Green","Quantity-Indicator-Blue","Quantity-Indicator-Yellow","Green-label","Blue-label","Yellow-label","Fire-Valve-Yellow-Cross","Fire-Valve-Green-Cross","path5561","path5561-4","path5561-5"]; }, updateBottom: func(notification) { foreach(var update_item_bottom; me.updateItemsBottom) @@ -461,6 +518,9 @@ var input = { hydPTUFault: "/systems/failures/hydraulic/ptu", hydPTUActive: "/systems/hydraulic/sources/ptu/ptu-hydraulic-condition", hydPTUDiff: "/systems/hydraulic/yellow-psi-diff", + hydBlueQTY: "/systems/hydraulic/blue-qty", + hydGreenQTY: "/systems/hydraulic/green-qty", + hydYellowQTY: "/systems/hydraulic/yellow-qty", }; foreach (var name; keys(input)) { diff --git a/Models/Instruments/Lower-ECAM/res/hyd.svg b/Models/Instruments/Lower-ECAM/res/hyd.svg index cf008563..54de4b5e 100644 --- a/Models/Instruments/Lower-ECAM/res/hyd.svg +++ b/Models/Instruments/Lower-ECAM/res/hyd.svg @@ -55,10 +55,10 @@ inkscape:window-width="1366" inkscape:window-height="705" id="namedview371" - showgrid="true" - inkscape:zoom="0.71238678" - inkscape:cx="802.52236" - inkscape:cy="594.9486" + showgrid="false" + inkscape:zoom="5.6568542" + inkscape:cx="1081.6807" + inkscape:cy="259.15874" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" @@ -118,7 +118,7 @@ transform="translate(-504.6045,133.35439)" id="Pump-Green" inkscape:label="#g5620" - style="stroke:none;stroke-opacity:1;fill:#0dc04b;fill-opacity:1;stroke-width:0.99974997;stroke-miterlimit:4;stroke-dasharray:none"> + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:0.99974996;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"> + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:0.99974996;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:0.99974996;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:0.99974996;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:0.99974996;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - + - + + @@ -892,7 +902,7 @@ sodipodi:nodetypes="cc" inkscape:connector-curvature="0" id="path5561" - d="m 812.24998,856.74997 h -17.25" + d="m 812.24998,856.74997 h -17.0677" style="fill:none;stroke:#0dc04b;stroke-width:2.625;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="fill:#cecdce;fill-opacity:1;stroke:none;stroke-width:2.57043672;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + d="m 813.15523,823.32891 h 11.71524 v 33.68651 h -11.71524 z" + style="fill:none;stroke:#bb6100;stroke-width:2.10803151;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + + style="fill:#cecdce;fill-opacity:1;stroke:none;stroke-width:2.49036217;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + d="m 813.26886,814.62253 h 11.48798 v 42.27926 h -11.48798 z" + style="fill:none;stroke:#bb6100;stroke-width:2.33861709;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + + style="fill:#cecdce;fill-opacity:1;stroke:none;stroke-width:2.63435125;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + d="m 812.88109,830.65833 h 12.26352 v 26.63123 h -12.26352 z" + style="fill:none;stroke:#bb6100;stroke-width:1.91768491;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> 00 + LO diff --git a/Nasal/Systems/hydraulics.nas b/Nasal/Systems/hydraulics.nas index 04bef4bc..7e75f138 100644 --- a/Nasal/Systems/hydraulics.nas +++ b/Nasal/Systems/hydraulics.nas @@ -64,9 +64,9 @@ var HYD = { }, init: func() { me.resetFail(); - me.Qty.blueInput.setValue(math.round((rand() * 4) + 8 , 0.1)); # Random between 8 and 12 - me.Qty.greenInput.setValue(math.round((rand() * 4) + 8 , 0.1)); # Random between 8 and 12 - me.Qty.yellowInput.setValue(math.round((rand() * 4) + 8 , 0.1)); # Random between 8 and 12 + me.Qty.blueInput.setValue(math.round((rand() * 2) + 6 , 0.1)); # Random between 6 and 8 + me.Qty.greenInput.setValue(math.round((rand() * 4) + 14 , 0.1)); # Random between 14 and 18 + me.Qty.yellowInput.setValue(math.round((rand() * 4) + 10 , 0.1)); # Random between 10 and 14 me.Switch.blueElec.setValue(1); me.Switch.blueElecOvrd.setValue(0); me.Switch.greenEDP.setValue(1); From 796ca2435cf02451a54f6417129fe4f5b573bb39 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 24 Jul 2021 21:09:25 +0100 Subject: [PATCH 87/96] Bleed page: minor corrections --- .../Lower-ECAM/Lower-ECAM-bleed.nas | 51 +++++++++++++++++-- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-bleed.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-bleed.nas index 432df33e..7c104add 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-bleed.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-bleed.nas @@ -142,7 +142,11 @@ var canvas_lowerECAMPageBleed = }), props.UpdateManager.FromHashList(["BleedBMC1Working","BleedPreCoolerPSI1"], nil, func(val) { if (val.BleedBMC1Working) { - obj["BLEED-Precooler-1-Inlet-Press"].setText(sprintf("%s", math.round(val.BleedPreCoolerPSI1))); + if (val.BleedPreCoolerPSI1 >= 98) { + obj["BLEED-Precooler-1-Inlet-Press"].setText(sprintf("%s", 98)); + } else { + obj["BLEED-Precooler-1-Inlet-Press"].setText(sprintf("%s", math.round(val.BleedPreCoolerPSI1,2))); + } if (val.BleedPreCoolerPSI1 < 4 or val.BleedPreCoolerPSI1 > 57) { obj["BLEED-Precooler-1-Inlet-Press"].setColor(0.7333,0.3803,0); } else { @@ -155,7 +159,12 @@ var canvas_lowerECAMPageBleed = }), props.UpdateManager.FromHashList(["BleedBMC2Working","BleedPreCoolerPSI2"], nil, func(val) { if (val.BleedBMC2Working) { - obj["BLEED-Precooler-2-Inlet-Press"].setText(sprintf("%s", math.round(val.BleedPreCoolerPSI2))); + if (val.BleedPreCoolerPSI2 >= 98) { + obj["BLEED-Precooler-2-Inlet-Press"].setText(sprintf("%s", 98)); + } else { + obj["BLEED-Precooler-2-Inlet-Press"].setText(sprintf("%s", math.round(val.BleedPreCoolerPSI2,2))); + } + if (val.BleedPreCoolerPSI2 < 4 or val.BleedPreCoolerPSI2 > 57) { obj["BLEED-Precooler-2-Inlet-Press"].setColor(0.7333,0.3803,0); } else { @@ -168,7 +177,12 @@ var canvas_lowerECAMPageBleed = }), props.UpdateManager.FromHashList(["BleedBMC1Working","BleedPreCoolerTemp1","BleedPRVValve1Cmd","BleedPreCoolerOvht1"], nil, func(val) { if (val.BleedBMC1Working) { - obj["BLEED-Precooler-1-Outlet-Temp"].setText(sprintf("%s", math.round(val.BleedPreCoolerTemp1, 5))); + if (val.BleedPreCoolerTemp1 >= 510) { + obj["BLEED-Precooler-1-Outlet-Temp"].setText(sprintf("%s", 510)); + } else { + obj["BLEED-Precooler-1-Outlet-Temp"].setText(sprintf("%s", math.round(val.BleedPreCoolerTemp1, 5))); + } + if (val.BleedPRVValve1Cmd and (val.BleedPreCoolerTemp1 < 150 or val.BleedPreCoolerOvht1)) { obj["BLEED-Precooler-1-Outlet-Temp"].setColor(0.7333,0.3803,0); } else { @@ -181,7 +195,12 @@ var canvas_lowerECAMPageBleed = }), props.UpdateManager.FromHashList(["BleedBMC2Working","BleedPreCoolerTemp2","BleedPRVValve2Cmd","BleedPreCoolerOvht2"], nil, func(val) { if (val.BleedBMC2Working) { - obj["BLEED-Precooler-2-Outlet-Temp"].setText(sprintf("%s", math.round(val.BleedPreCoolerTemp2, 5))); + if (val.BleedPreCoolerTemp2 >= 510) { + obj["BLEED-Precooler-2-Outlet-Temp"].setText(sprintf("%s", 510)); + } else { + obj["BLEED-Precooler-2-Outlet-Temp"].setText(sprintf("%s", math.round(val.BleedPreCoolerTemp2, 5))); + } + if (val.BleedPRVValve2Cmd and (val.BleedPreCoolerTemp2 < 150 or val.BleedPreCoolerOvht2)) { obj["BLEED-Precooler-2-Outlet-Temp"].setColor(0.7333,0.3803,0); } else { @@ -284,10 +303,14 @@ var canvas_lowerECAMPageBleed = obj["BLEED-Ram-Air"].setColor(0.7333,0.3803,0); obj["BLEED-Ram-Air"].setColorFill(0.7333,0.3803,0); obj["BLEED-Ram-Air-Cross"].setColorFill(0.7333,0.3803,0); + obj["BLEED-Ram-Air-connection"].setColorFill(0.7333,0.3803,0); + obj["BLEED-Ram-Air-connection"].setColorFill(0.7333,0.3803,0); } else { obj["BLEED-Ram-Air"].setColor(0.0509,0.7529,0.2941); obj["BLEED-Ram-Air"].setColorFill(0.0509,0.7529,0.2941); obj["BLEED-Ram-Air-Cross"].setColorFill(0.0509,0.7529,0.2941); + obj["BLEED-Ram-Air-connection"].setColor(0.0509,0.7529,0.2941); + obj["BLEED-Ram-Air-connection"].setColorFill(0.0509,0.7529,0.2941); } obj["BLEED-Ram-Air-connection"].show(); } else { @@ -295,6 +318,8 @@ var canvas_lowerECAMPageBleed = obj["BLEED-Ram-Air"].setColor(0.7333,0.3803,0); obj["BLEED-Ram-Air"].setColorFill(0.7333,0.3803,0); obj["BLEED-Ram-Air-Cross"].setColorFill(0.7333,0.3803,0); + obj["BLEED-Ram-Air-connection"].setColorFill(0.7333,0.3803,0); + obj["BLEED-Ram-Air-connection"].setColorFill(0.7333,0.3803,0); obj["BLEED-Ram-Air-connection"].show(); } @@ -313,6 +338,22 @@ var canvas_lowerECAMPageBleed = obj["BLEED-cond-2"].setColor(0.0509,0.7529,0.2941); obj["BLEED-cond-3"].setColor(0.0509,0.7529,0.2941); } + + if (val.flowCtlValve1 == 0) { + obj["BLEED-Pack-1-connection"].setColor(0.7333,0.3803,0); + obj["BLEED-Pack-1-connection"].setColorFill(0.7333,0.3803,0); + } else { + obj["BLEED-Pack-1-connection"].setColor(0.0509,0.7529,0.2941); + obj["BLEED-Pack-1-connection"].setColorFill(0.0509,0.7529,0.2941); + } + + if (val.flowCtlValve2 == 0) { + obj["BLEED-Pack-2-connection"].setColor(0.7333,0.3803,0); + obj["BLEED-Pack-2-connection"].setColorFill(0.7333,0.3803,0); + } else { + obj["BLEED-Pack-2-connection"].setColor(0.0509,0.7529,0.2941); + obj["BLEED-Pack-2-connection"].setColorFill(0.0509,0.7529,0.2941); + } }), props.UpdateManager.FromHashList(["BleedCrossbleed","apuMaster","apuBleedValvePos","ApuBleedNotOn"], nil, func(val) { if (val.apuMaster) { @@ -392,7 +433,7 @@ var canvas_lowerECAMPageBleed = "BLEED-Pack-2-Bypass-needle", "BLEED-Pack-2-Comp-Out-Temp", "BLEED-Pack-2-Packflow-needle", "BLEED-Anti-Ice-Left", "BLEED-Anti-Ice-Right", "BLEED-HP-2-connection", "BLEED-HP-1-connection", "BLEED-ANTI-ICE-ARROW-LEFT", "BLEED-ANTI-ICE-ARROW-RIGHT", "BLEED-xbleedLeft","BLEED-xbleedCenter","BLEED-xbleedRight","BLEED-cond-1","BLEED-cond-2","BLEED-cond-3","BLEED-Ram-Air-connection","BLEED-ENG-1-Cross","BLEED-ENG-2-Cross", - "BLEED-Pack-1-Flow-Valve-Cross","BLEED-Pack-2-Flow-Valve-Cross"]; + "BLEED-Pack-1-Flow-Valve-Cross","BLEED-Pack-2-Flow-Valve-Cross","BLEED-Pack-1-connection","BLEED-Pack-2-connection"]; }, updateBottom: func(notification) { foreach(var update_item_bottom; me.updateItemsBottom) From 973bd4f900b5622901bf82bc8088bc23d98528ad Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 24 Jul 2021 21:48:06 +0100 Subject: [PATCH 88/96] Fix ELEC page --- .../Lower-ECAM/Lower-ECAM-elec.nas | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas index 6299ad50..6b7ab26e 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas @@ -74,14 +74,14 @@ var canvas_lowerECAMPageElec = } } }), - props.UpdateManager.FromHashList(["apuMaster","apuGLC"], nil, func(val) { + props.UpdateManager.FromHashList(["apuMaster","apuGenPB"], nil, func(val) { if (val.apuMaster == 0) { obj["APU-content"].hide(); obj["APUGEN-off"].hide(); obj["APU-border"].hide(); } else { obj["APU-border"].show(); - if (val.apuGLC == 0) { + if (val.apuGenPB == 0) { obj["APU-content"].hide(); obj["APUGEN-off"].show(); } else { @@ -151,18 +151,22 @@ var canvas_lowerECAMPageElec = if (val >= 110) { obj["ELEC-AC1-label"].setColor(0.0509,0.7529,0.2941); obj["AC1-in"].show(); + obj["ELEC-Line-AC1-TR1"].show(); } else { obj["ELEC-AC1-label"].setColor(0.7333,0.3803,0); obj["AC1-in"].hide(); + obj["ELEC-Line-AC1-TR1"].hide(); } }), props.UpdateManager.FromHashValue("elecAC2", 0.5, func(val) { if (val >= 110) { obj["ELEC-AC2-label"].setColor(0.0509,0.7529,0.2941); obj["AC2-in"].show(); + obj["ELEC-Line-AC2-TR2"].show(); } else { obj["ELEC-AC2-label"].setColor(0.7333,0.3803,0); obj["AC2-in"].hide(); + obj["ELEC-Line-AC2-TR2"].hide(); } }), props.UpdateManager.FromHashValue("elecACEss", 0.5, func(val) { @@ -209,6 +213,7 @@ var canvas_lowerECAMPageElec = obj["BAT1-OFF"].hide(); obj["BAT1-content"].show(); obj["Bat1Ampere"].setText(sprintf("%2.0f", val.elecBat1Amp)); + obj["Bat1Volt"].setText(sprintf("%2.0f", val.elecBat1Volt)); if (val.elecBat1Volt >= 24.95 and val.elecBat1Volt <= 31.05) { @@ -217,7 +222,7 @@ var canvas_lowerECAMPageElec = obj["Bat1Volt"].setColor(0.7333,0.3803,0); } - if (val.elecBat1Amp > 5) { + if (val.elecBat1Amp > 5 and val.elecBat1Direction == 1) { obj["Bat1Ampere"].setColor(0.7333,0.3803,0); } else { obj["Bat1Ampere"].setColor(0.0509,0.7529,0.2941); @@ -253,6 +258,7 @@ var canvas_lowerECAMPageElec = obj["BAT2-OFF"].hide(); obj["BAT2-content"].show(); obj["Bat2Ampere"].setText(sprintf("%2.0f", val.elecBat2Amp)); + obj["Bat2Volt"].setText(sprintf("%2.0f", val.elecBat2Volt)); if (val.elecBat2Volt >= 24.95 and val.elecBat2Volt <= 31.05) { @@ -261,7 +267,7 @@ var canvas_lowerECAMPageElec = obj["Bat2Volt"].setColor(0.7333,0.3803,0); } - if (val.elecBat2Amp > 5) { + if (val.elecBat2Amp > 5 and val.elecBat2Direction == 1) { obj["Bat2Ampere"].setColor(0.7333,0.3803,0); } else { obj["Bat2Ampere"].setColor(0.0509,0.7529,0.2941); @@ -371,7 +377,7 @@ var canvas_lowerECAMPageElec = obj["ELEC-Line-DC2-DCBAT"].show(); } else { obj["ELEC-Line-DC2-DCESS_DCBAT"].hide(); - obj["ELEC-Line-DC2-DCBAT"].show(); + obj["ELEC-Line-DC2-DCBAT"].hide(); } }), props.UpdateManager.FromHashList(["elecDcEssFeedBat","elecDCTie1"], nil, func(val) { @@ -550,10 +556,8 @@ var canvas_lowerECAMPageElec = } else { obj["ELEC-Line-AC1-TR1"].setColorFill(0.0509,0.7529,0.2941); } - obj["ELEC-Line-AC1-TR1"].show(); obj["ELEC-Line-TR1-DC1"].show(); } else { - obj["ELEC-Line-AC1-TR1"].hide(); obj["ELEC-Line-TR1-DC1"].hide(); } }), @@ -564,10 +568,8 @@ var canvas_lowerECAMPageElec = } else { obj["ELEC-Line-AC2-TR2"].setColorFill(0.0509,0.7529,0.2941); } - obj["ELEC-Line-AC2-TR2"].show(); obj["ELEC-Line-TR2-DC2"].show(); } else { - obj["ELEC-Line-AC2-TR2"].hide(); obj["ELEC-Line-TR2-DC2"].hide(); } }), @@ -643,7 +645,7 @@ var canvas_lowerECAMPageElec = } } }), - props.UpdateManager.FromHashList(["elecACEss"], nil, func(val) { + props.UpdateManager.FromHashList(["elecACEss","ELEC-Line-ACESS-TRESS","elecTR1Contact","elecTR2Contact"], nil, func(val) { if (val.elecACEss >= 110 and !val.elecAcEssEmerGenFeed and (!val.elecTR1Contact or !val.elecTR2Contact)) { obj["ELEC-Line-ACESS-TRESS"].show(); } else { From 95ba5c6a7056b50d15c920c8c3322efe1403ed49 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sun, 25 Jul 2021 01:12:54 +0100 Subject: [PATCH 89/96] WHEEL page: improvements (unfinished) --- .../Lower-ECAM/Lower-ECAM-wheel.nas | 132 ++++++++++++------ Models/Instruments/Lower-ECAM/res/wheel.svg | 60 ++++---- Systems/a320-hydraulic.xml | 14 +- 3 files changed, 135 insertions(+), 71 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas index e6586a11..0f0a8ae4 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas @@ -42,8 +42,8 @@ var canvas_lowerECAMPageWheel = obj["lgctltext"].hide(); } }), - props.UpdateManager.FromHashValue("gearPosNorm", 0.01, func(val) { - if (val < 0.2 or val > 0.8) { + props.UpdateManager.FromHashValue("gearPosNorm", nil, func(val) { + if (val == 0) { obj["Triangle-Nose1"].hide(); obj["Triangle-Nose2"].hide(); } else { @@ -59,8 +59,8 @@ var canvas_lowerECAMPageWheel = obj["Triangle-Nose2"].setColor(1,0,0); } }), - props.UpdateManager.FromHashValue("gearPosNorm1", 0.01, func(val) { - if (val < 0.2 or val > 0.8) { + props.UpdateManager.FromHashValue("gearPosNorm1", nil, func(val) { + if (val == 0) { obj["Triangle-Left1"].hide(); obj["Triangle-Left2"].hide(); } else { @@ -76,8 +76,8 @@ var canvas_lowerECAMPageWheel = obj["Triangle-Left2"].setColor(1,0,0); } }), - props.UpdateManager.FromHashValue("gearPosNorm2", 0.01, func(val) { - if (val < 0.2 or val > 0.8) { + props.UpdateManager.FromHashValue("gearPosNorm2", nil, func(val) { + if (val == 0) { obj["Triangle-Right1"].hide(); obj["Triangle-Right2"].hide(); } else { @@ -93,75 +93,85 @@ var canvas_lowerECAMPageWheel = obj["Triangle-Right2"].setColor(1,0,0); } }), - props.UpdateManager.FromHashList(["yellow","green","NWSSwitch","brakesMode","val.accumPressPsiPressPsi"], nil, func(val) { + props.UpdateManager.FromHashList(["yellow","green","NWSSwitch","brakesMode","val.accumPressPsiPressPsi","leftBrakeFCS","rightBrakeFCS"], nil, func(val) { if (val.NWSSwitch and val.yellow >= 1500) { obj["NWStext"].hide(); obj["NWS"].hide(); obj["NWSrect"].hide(); - obj["antiskidtext"].hide(); - obj["BSCUrect1"].hide(); - obj["BSCUrect2"].hide(); - obj["BSCU1"].hide(); - obj["BSCU2"].hide(); } else if (!val.NWSSwitch and val.yellow >= 1500) { obj["NWStext"].show(); obj["NWS"].show(); obj["NWS"].setColor(0.0509,0.7529,0.2941); obj["NWSrect"].show(); - obj["antiskidtext"].show(); - obj["antiskidtext"].setColor(0.7333,0.3803,0); - obj["BSCUrect1"].show(); - obj["BSCUrect2"].show(); - obj["BSCU1"].show(); - obj["BSCU2"].show(); } else { obj["NWStext"].show(); obj["NWS"].show(); obj["NWS"].setColor(0.7333,0.3803,0); obj["NWSrect"].show(); + } + + if ((val.yellow < 1500 and val.brakesMode == 1) or !val.NWSSwitch) { obj["antiskidtext"].show(); obj["antiskidtext"].setColor(0.7333,0.3803,0); obj["BSCUrect1"].show(); obj["BSCUrect2"].show(); obj["BSCU1"].show(); obj["BSCU2"].show(); + } else { + obj["antiskidtext"].hide(); + obj["BSCUrect1"].hide(); + obj["BSCUrect2"].hide(); + obj["BSCU1"].hide(); + obj["BSCU2"].hide(); } - - if (val.green >= 1500 and val.brakesMode == 1) { + + if (val.green >= 1500) { + obj["normbrkhyd"].setColor(0.0509,0.7529,0.2941); + } else { + obj["normbrkhyd"].setColor(0.7333,0.3803,0); + } + + if (val.yellow >= 1500) { + obj["altnbrkhyd"].setColor(0.0509,0.7529,0.2941); + } else { + obj["altnbrkhyd"].setColor(0.7333,0.3803,0); + } + + if (!val.NWSSwitch or val.green < 1500) { + obj["NORMbrk"].show(); + obj["normbrk-rect"].show(); + obj["normbrkhyd"].show(); + } else { obj["NORMbrk"].hide(); obj["normbrk-rect"].hide(); obj["normbrkhyd"].hide(); - } else if (val.green >= 1500 and val.NWSSwitch) { - obj["NORMbrk"].show(); - obj["normbrk-rect"].show(); - obj["NORMbrk"].setColor(0.7333,0.3803,0); - obj["normbrkhyd"].setColor(0.0509,0.7529,0.2941); - } else if (val.green < 1500 or !val.NWSSwitch) { - obj["NORMbrk"].show(); - obj["normbrk-rect"].show(); - obj["NORMbrk"].setColor(0.7333,0.3803,0); - obj["normbrkhyd"].setColor(0.7333,0.3803,0); } - - if (val.brakesMode != 2) { + + if (val.brakesMode != 2 or val.green < 1500 or val.yellow < 1500 or !val.NWSSwitch) { obj["ALTNbrk"].hide(); obj["altnbrk-rect"].hide(); obj["altnbrkhyd"].hide(); - } else if (val.yellow >= 1500) { - obj["ALTNbrk"].show(); - obj["altnbrk-rect"].show(); - obj["altnbrkhyd"].setColor(0.0509,0.7529,0.2941); } else { obj["ALTNbrk"].show(); obj["altnbrk-rect"].show(); - obj["altnbrkhyd"].setColor(0.7333,0.3803,0); + obj["altnbrkhyd"].show(); + if (val.yellow < 1500 and val.accumPressPsi < 1500) { + obj["ALTNbrk"].setColor(0.7333,0.3803,0); + } else { + obj["ALTNbrk"].setColor(0.0509,0.7529,0.2941); + } } + # TODO check the parking brake with nws switch off if (val.brakesMode == 2 and val.accumPressPsi < 200 and val.yellow < 1500) { + obj["accuonlyarrow"].hide(); + obj["accuonly"].hide(); obj["accupress_text"].show(); obj["brakearrow"].hide(); obj["accupress_text"].setColor(0.7333,0.3803,0); } else if (val.brakesMode == 2 and val.accumPressPsi > 200 and val.yellow >= 1500){ + obj["accuonlyarrow"].hide(); + obj["accuonly"].hide(); obj["accupress_text"].show(); obj["brakearrow"].show(); obj["accupress_text"].setColor(0.0509,0.7529,0.2941); @@ -176,8 +186,43 @@ var canvas_lowerECAMPageWheel = obj["brakearrow"].hide(); obj["accupress_text"].hide(); } + + if (val.brakesMode == 1) { + obj["releaseL1"].hide(); + obj["releaseL2"].hide(); + obj["releaseL3"].hide(); + obj["releaseL4"].hide(); + obj["releaseR1"].hide(); + obj["releaseR2"].hide(); + obj["releaseR3"].hide(); + obj["releaseR4"].hide(); + } else { # Display if the brakes are released and in alternate braking + if (val.leftBrakeFCS == 0) { + obj["releaseL1"].show(); + obj["releaseL2"].show(); + obj["releaseL3"].show(); + obj["releaseL4"].show(); + } else { + obj["releaseL1"].hide(); + obj["releaseL2"].hide(); + obj["releaseL3"].hide(); + obj["releaseL4"].hide(); + } + + if (val.rightBrakeFCS == 0) { + obj["releaseR1"].show(); + obj["releaseR2"].show(); + obj["releaseR3"].show(); + obj["releaseR4"].show(); + } else { + obj["releaseR1"].hide(); + obj["releaseR2"].hide(); + obj["releaseR3"].hide(); + obj["releaseR4"].hide(); + } + } }), - props.UpdateManager.FromHashList(["brakeAutobrkMode"], nil, func(val) { + props.UpdateManager.FromHashList(["brakeAutobrkMode","NWSSwitch"], nil, func(val) { if (val.brakeAutobrkMode == 0) { obj["autobrkind"].hide(); } elsif (val.brakeAutobrkMode == 1) { @@ -191,11 +236,17 @@ var canvas_lowerECAMPageWheel = obj["autobrkind"].setText(sprintf("%s", "MAX")); } - if (val.brakeAutobrkMode != 0) { + if (val.brakeAutobrkMode != 0 or !val.NWSSwitch) { obj["autobrk"].show(); } else { obj["autobrk"].hide(); } + + if (!val.NWSSwitch) { + obj["autobrk"].setColor(0.7333,0.3803,0); + } else { + obj["autobrk"].setColor(0.0509,0.7529,0.2941); + } }), props.UpdateManager.FromHashValue("brakeLeft1", 0.5, func(val) { obj["braketemp1"].setText(sprintf("%s", math.round(val, 5))); @@ -578,7 +629,8 @@ var canvas_lowerECAMPageWheel = "spoiler1Lf","spoiler2Lf","spoiler3Lf","spoiler4Lf","spoiler5Lf","ALTNbrk","altnbrkhyd","altnbrk-rect","antiskidtext","brakearrow","accupress_text", "accuonlyarrow","accuonly","braketemp1","normbrkhyd","braketemp2","braketemp3","braketemp4","toparc1","toparc2","toparc3","toparc4","leftuplock", "noseuplock","rightuplock","Triangle-Left1","Triangle-Left2","Triangle-Nose1","Triangle-Nose2","Triangle-Right1","Triangle-Right2","BSCUrect1", - "BSCUrect2","BSCU1","BSCU2","tirepress1","tirepress2","tirepress3","tirepress4","tirepress5","tirepress6"]; + "BSCUrect2","BSCU1","BSCU2","tirepress1","tirepress2","tirepress3","tirepress4","tirepress5","tirepress6","releaseL1","releaseL2","releaseR1","releaseR2", + "releaseL3","releaseL4","releaseR3","releaseR4"]; }, updateBottom: func(notification) { foreach(var update_item_bottom; me.updateItemsBottom) diff --git a/Models/Instruments/Lower-ECAM/res/wheel.svg b/Models/Instruments/Lower-ECAM/res/wheel.svg index 78109a8c..e8db3c71 100644 --- a/Models/Instruments/Lower-ECAM/res/wheel.svg +++ b/Models/Instruments/Lower-ECAM/res/wheel.svg @@ -41,9 +41,9 @@ inkscape:window-height="705" id="namedview371" showgrid="true" - inkscape:zoom="0.45254834" - inkscape:cx="498.40273" - inkscape:cy="607.76607" + inkscape:zoom="0.64" + inkscape:cx="1071.5554" + inkscape:cy="763.4389" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" @@ -370,14 +370,14 @@ id="NORMbrk" y="616.38831" x="426.55933" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';letter-spacing:0px;word-spacing:0px;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';letter-spacing:0px;word-spacing:0px;fill:#bb6100;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;" xml:space="preserve" inkscape:label="#text4285">NORM BRK + style="font-size:32px;line-height:1.25;fill:#bb6100;fill-opacity:1;">NORM BRK 999 ||| + style="font-size:21.63888741px;line-height:1.25;fill:#bb6100;fill-opacity:1;">||| ||| + style="font-size:21.63888741px;line-height:1.25;fill:#bb6100;fill-opacity:1;">||| ||| + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:21.63888741px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#bb6100;fill-opacity:1;">||| REL ||| + style="font-size:23.3301487px;line-height:1.25;fill:#bb6100;fill-opacity:1;">||| ||| + style="font-size:23.3301487px;line-height:1.25;fill:#bb6100;fill-opacity:1;">||| ||| + style="font-size:23.3301487px;line-height:1.25;fill:#bb6100;fill-opacity:1;">||| ||| + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:23.3301487px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#bb6100;fill-opacity:1;">||| 2 + style="font-size:32px;line-height:1.25;fill:#0dc04b;fill-opacity:1;">2 1 + style="font-size:32px;line-height:1.25;fill:#0dc04b;fill-opacity:1;">1 ||| + style="font-size:21.63888741px;line-height:1.25;stroke-width:1px;fill:#bb6100;fill-opacity:1;">||| ACCU ONLY + x="441.43594" + y="707.69073">ACCU ONLY - + /systems/failures/hydraulic/green-leak eq 1 + + + + /systems/hydraulic/green-qty-cmd-cmd + + 2.1 + /gear/gear[0]/position-norm + + + + + From 3855b4a14133835afc4cd795a4d44e8aed7a306f Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sun, 25 Jul 2021 17:41:07 +0100 Subject: [PATCH 90/96] Fix SD --- Nasal/ECAM/SystemDisplay.nas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nasal/ECAM/SystemDisplay.nas b/Nasal/ECAM/SystemDisplay.nas index de1d4d5c..d5724414 100644 --- a/Nasal/ECAM/SystemDisplay.nas +++ b/Nasal/ECAM/SystemDisplay.nas @@ -28,7 +28,7 @@ var SystemDisplayController = { displayedPage: nil, lastDisplayedPage: nil, lastMode: nil, - mode: 0, # 0 = man, 1 = warning, 2 = advisory (not used yet), 3 = auto + mode: 3, # 0 = man, 1 = warning, 2 = advisory (not used yet), 3 = auto tempFWCPhase: nil, tempElapsedTime: nil, tempEngineModeSel: nil, From a3270214312bceca5fe7bbf40553bfd71d1b19d2 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sun, 25 Jul 2021 17:46:55 +0100 Subject: [PATCH 91/96] Fix WHEEL --- Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas index 0f0a8ae4..29435278 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas @@ -162,14 +162,13 @@ var canvas_lowerECAMPageWheel = } } - # TODO check the parking brake with nws switch off if (val.brakesMode == 2 and val.accumPressPsi < 200 and val.yellow < 1500) { obj["accuonlyarrow"].hide(); obj["accuonly"].hide(); obj["accupress_text"].show(); obj["brakearrow"].hide(); obj["accupress_text"].setColor(0.7333,0.3803,0); - } else if (val.brakesMode == 2 and val.accumPressPsi > 200 and val.yellow >= 1500){ + } else if (val.brakesMode == 2 and val.NWSSwitch and val.accumPressPsi > 200 and val.yellow >= 1500){ obj["accuonlyarrow"].hide(); obj["accuonly"].hide(); obj["accupress_text"].show(); From 1703a47083eb77d6dcad6d4622cbedb7116d0881 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sun, 25 Jul 2021 17:49:24 +0100 Subject: [PATCH 92/96] Fix wheel triangles --- Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas index 29435278..816e95b5 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas @@ -43,7 +43,7 @@ var canvas_lowerECAMPageWheel = } }), props.UpdateManager.FromHashValue("gearPosNorm", nil, func(val) { - if (val == 0) { + if (val < 0.2 and val > 0.8) { obj["Triangle-Nose1"].hide(); obj["Triangle-Nose2"].hide(); } else { @@ -60,7 +60,7 @@ var canvas_lowerECAMPageWheel = } }), props.UpdateManager.FromHashValue("gearPosNorm1", nil, func(val) { - if (val == 0) { + if (val < 0.2 and val > 0.8) { obj["Triangle-Left1"].hide(); obj["Triangle-Left2"].hide(); } else { @@ -77,7 +77,7 @@ var canvas_lowerECAMPageWheel = } }), props.UpdateManager.FromHashValue("gearPosNorm2", nil, func(val) { - if (val == 0) { + if (val < 0.2 and val > 0.8) { obj["Triangle-Right1"].hide(); obj["Triangle-Right2"].hide(); } else { From a9cf9aa0b416d87b4969272a012bdff632902031 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sun, 25 Jul 2021 17:51:40 +0100 Subject: [PATCH 93/96] Actually fix them --- Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas index 816e95b5..18578846 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas @@ -43,7 +43,7 @@ var canvas_lowerECAMPageWheel = } }), props.UpdateManager.FromHashValue("gearPosNorm", nil, func(val) { - if (val < 0.2 and val > 0.8) { + if (val < 0.2 or val > 0.8) { obj["Triangle-Nose1"].hide(); obj["Triangle-Nose2"].hide(); } else { @@ -60,7 +60,7 @@ var canvas_lowerECAMPageWheel = } }), props.UpdateManager.FromHashValue("gearPosNorm1", nil, func(val) { - if (val < 0.2 and val > 0.8) { + if (val < 0.2 or val > 0.8) { obj["Triangle-Left1"].hide(); obj["Triangle-Left2"].hide(); } else { @@ -77,7 +77,7 @@ var canvas_lowerECAMPageWheel = } }), props.UpdateManager.FromHashValue("gearPosNorm2", nil, func(val) { - if (val < 0.2 and val > 0.8) { + if (val < 0.2 or val > 0.8) { obj["Triangle-Right1"].hide(); obj["Triangle-Right2"].hide(); } else { From 58c59d2c02b9db3a3797ed5f0bb42686bf976114 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sun, 25 Jul 2021 17:54:17 +0100 Subject: [PATCH 94/96] Actually fix it 2.0 --- Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas index 18578846..3746763d 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-wheel.nas @@ -43,7 +43,7 @@ var canvas_lowerECAMPageWheel = } }), props.UpdateManager.FromHashValue("gearPosNorm", nil, func(val) { - if (val < 0.2 or val > 0.8) { + if (val < 0.2) { obj["Triangle-Nose1"].hide(); obj["Triangle-Nose2"].hide(); } else { @@ -60,7 +60,7 @@ var canvas_lowerECAMPageWheel = } }), props.UpdateManager.FromHashValue("gearPosNorm1", nil, func(val) { - if (val < 0.2 or val > 0.8) { + if (val < 0.2) { obj["Triangle-Left1"].hide(); obj["Triangle-Left2"].hide(); } else { @@ -77,7 +77,7 @@ var canvas_lowerECAMPageWheel = } }), props.UpdateManager.FromHashValue("gearPosNorm2", nil, func(val) { - if (val < 0.2 or val > 0.8) { + if (val < 0.2) { obj["Triangle-Right1"].hide(); obj["Triangle-Right2"].hide(); } else { From 3dce3ef1ea0ca42b77d0748f174fd95a4bdf3a58 Mon Sep 17 00:00:00 2001 From: Matthew Maring <56924612+mattmaring@users.noreply.github.com> Date: Mon, 26 Jul 2021 09:17:28 -0400 Subject: [PATCH 95/96] Fix issue #240 --- Nasal/MCDU/INITA.nas | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Nasal/MCDU/INITA.nas b/Nasal/MCDU/INITA.nas index 0ddced4e..9dfae813 100644 --- a/Nasal/MCDU/INITA.nas +++ b/Nasal/MCDU/INITA.nas @@ -138,10 +138,10 @@ var initInputA = func(key, i) { } else if (find("/", scratchpad) != -1) { var crztemp = split("/", scratchpad); if (find("FL", crztemp[0]) != -1) { - var crz = int(substr(crztemp[0], 2)); + var crz = substr(crztemp[0], 2); var crzs = size(substr(crztemp[0], 2)); } else { - var crz = int(crztemp[0]); + var crz = crztemp[0]; var crzs = size(crztemp[0]); } var temp = int(crztemp[1]); @@ -160,17 +160,17 @@ var initInputA = func(key, i) { } else { mcdu_message(i, "NOT ALLOWED"); } - } else if (crzs >= 1 and crzs <= 3 and crz != nil and temps >= 1 and temps <= 3 and temp != nil) { + } else if (find(".", crz) == -1 and crzs >= 1 and crzs <= 3 and crz != nil and temps >= 1 and temps <= 3 and temp != nil) { if (crz > 0 and crz <= 390 and temp >= -99 and temp <= 99) { - fmgc.FMGCInternal.crzFt = crz * 100; - fmgc.FMGCInternal.crzFl = crz; + fmgc.FMGCInternal.crzFt = int(crz) * 100; + fmgc.FMGCInternal.crzFl = int(crz); fmgc.altvert(); fmgc.updateRouteManagerAlt(); fmgc.FMGCInternal.crzSet = 1; updateCrzLvlCallback(); fmgc.FMGCInternal.crzTemp = temp; fmgc.FMGCInternal.crzTempSet = 1; - fmgc.FMGCInternal.crzProg = crz; + fmgc.FMGCInternal.crzProg = int(crz); if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 0; fmgc.fuelCalculating.setValue(0); @@ -186,21 +186,21 @@ var initInputA = func(key, i) { } } else { if (find("FL", scratchpad) != -1) { - var crz = int(substr(scratchpad, 2)); + var crz = substr(scratchpad, 2); var crzs = size(substr(scratchpad, 2)); } else { - var crz = int(scratchpad); + var crz = scratchpad; var crzs = size(scratchpad); } - if (crzs >= 1 and crzs <= 3 and crz != nil) { + if (find(".", crz) == -1 and crzs >= 1 and crzs <= 3 and crz != nil) { if (crz > 0 and crz <= 390) { - fmgc.FMGCInternal.crzFt = crz * 100; - fmgc.FMGCInternal.crzFl = crz; + fmgc.FMGCInternal.crzFt = int(crz) * 100; + fmgc.FMGCInternal.crzFl = int(crz); fmgc.altvert(); fmgc.updateRouteManagerAlt(); fmgc.FMGCInternal.crzSet = 1; updateCrzLvlCallback(); - fmgc.FMGCInternal.crzProg = crz; + fmgc.FMGCInternal.crzProg = int(crz); if (fmgc.FMGCInternal.blockConfirmed) { fmgc.FMGCInternal.fuelCalculating = 0; fmgc.fuelCalculating.setValue(0); From acd55d9a3663bae4e626ca8c5c0790dd8a8a21de Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Mon, 26 Jul 2021 14:42:32 +0100 Subject: [PATCH 96/96] ACCONFIG: set oxygen switch to on --- AircraftConfig/acconfig.nas | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AircraftConfig/acconfig.nas b/AircraftConfig/acconfig.nas index c941efc8..dbe1ceba 100644 --- a/AircraftConfig/acconfig.nas +++ b/AircraftConfig/acconfig.nas @@ -323,6 +323,7 @@ var beforestart = func { setprop("/controls/flight/elevator-trim", 0); libraries.systemsInit(); libraries.variousReset(); + setprop("/controls/oxygen/crewOxyPB", 1); failResetOld(); # Now the Startup! @@ -418,6 +419,7 @@ var taxi = func { setprop("/controls/flight/elevator-trim", 0); libraries.systemsInit(); libraries.variousReset(); + setprop("/controls/oxygen/crewOxyPB", 1); failResetOld(); # Now the Startup!