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") }, };