1
0
Fork 0

Prepare to add DU switching

This commit is contained in:
legoboyvdlp R 2021-07-27 17:36:09 +01:00
parent 795cc17df8
commit 55bd42fe72
7 changed files with 226 additions and 38 deletions

View file

@ -2159,6 +2159,18 @@
<command>nasal</command> <command>nasal</command>
<script>ecam.ECAMControlPanel.stsBtn();</script> <script>ecam.ECAMControlPanel.stsBtn();</script>
</binding> </binding>
<mod-up>
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("REL");</script>
</binding>
</mod-up>
</action> </action>
</animation> </animation>
@ -2178,6 +2190,18 @@
<command>nasal</command> <command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("apuPage");</script> <script>ecam.ECAMControlPanel.sysPageBtn("apuPage");</script>
</binding> </binding>
<mod-up>
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("REL");</script>
</binding>
</mod-up>
</action> </action>
</animation> </animation>
@ -2197,6 +2221,18 @@
<command>nasal</command> <command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("bleedPage");</script> <script>ecam.ECAMControlPanel.sysPageBtn("bleedPage");</script>
</binding> </binding>
<mod-up>
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("REL");</script>
</binding>
</mod-up>
</action> </action>
</animation> </animation>
@ -2216,6 +2252,18 @@
<command>nasal</command> <command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("cabPressPage");</script> <script>ecam.ECAMControlPanel.sysPageBtn("cabPressPage");</script>
</binding> </binding>
<mod-up>
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("REL");</script>
</binding>
</mod-up>
</action> </action>
</animation> </animation>
@ -2235,6 +2283,18 @@
<command>nasal</command> <command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("elecPage");</script> <script>ecam.ECAMControlPanel.sysPageBtn("elecPage");</script>
</binding> </binding>
<mod-up>
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("REL");</script>
</binding>
</mod-up>
</action> </action>
</animation> </animation>
@ -2254,6 +2314,18 @@
<command>nasal</command> <command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("hydraulicPage");</script> <script>ecam.ECAMControlPanel.sysPageBtn("hydraulicPage");</script>
</binding> </binding>
<mod-up>
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("REL");</script>
</binding>
</mod-up>
</action> </action>
</animation> </animation>
@ -2273,6 +2345,18 @@
<command>nasal</command> <command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("fuelPage");</script> <script>ecam.ECAMControlPanel.sysPageBtn("fuelPage");</script>
</binding> </binding>
<mod-up>
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("REL");</script>
</binding>
</mod-up>
</action> </action>
</animation> </animation>
@ -2292,6 +2376,18 @@
<command>nasal</command> <command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("enginePage");</script> <script>ecam.ECAMControlPanel.sysPageBtn("enginePage");</script>
</binding> </binding>
<mod-up>
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("REL");</script>
</binding>
</mod-up>
</action> </action>
</animation> </animation>
@ -2311,6 +2407,18 @@
<command>nasal</command> <command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("condPage");</script> <script>ecam.ECAMControlPanel.sysPageBtn("condPage");</script>
</binding> </binding>
<mod-up>
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("REL");</script>
</binding>
</mod-up>
</action> </action>
</animation> </animation>
@ -2330,6 +2438,18 @@
<command>nasal</command> <command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("doorPage");</script> <script>ecam.ECAMControlPanel.sysPageBtn("doorPage");</script>
</binding> </binding>
<mod-up>
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("REL");</script>
</binding>
</mod-up>
</action> </action>
</animation> </animation>
@ -2349,6 +2469,18 @@
<command>nasal</command> <command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("wheelPage");</script> <script>ecam.ECAMControlPanel.sysPageBtn("wheelPage");</script>
</binding> </binding>
<mod-up>
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("REL");</script>
</binding>
</mod-up>
</action> </action>
</animation> </animation>
@ -2368,6 +2500,18 @@
<command>nasal</command> <command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("fctlPage");</script> <script>ecam.ECAMControlPanel.sysPageBtn("fctlPage");</script>
</binding> </binding>
<mod-up>
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>nasal</command>
<script>ecam.ECAMControlPanel.sysPageBtn("REL");</script>
</binding>
</mod-up>
</action> </action>
</animation> </animation>

View file

@ -17,6 +17,7 @@ var canvas_lowerECAM_base =
"mipmapping": 1 "mipmapping": 1
}); });
me.canvas.addPlacement({"node": "lecam.screen"}); me.canvas.addPlacement({"node": "lecam.screen"});
me.canvas.addPlacement({"node": "uecam.screen2"});
me.font_mapper = func(family, weight) { me.font_mapper = func(family, weight) {
return "LiberationFonts/LiberationSans-Regular.ttf"; return "LiberationFonts/LiberationSans-Regular.ttf";

View file

@ -14,22 +14,22 @@ var ND_2_test = nil;
var elapsedtime = 0; var elapsedtime = 0;
# Fetch nodes: # Fetch nodes:
var du1_test = props.globals.getNode("instrumentation/du/du1-test"); var du1_test = props.globals.getNode("/instrumentation/du/du1-test");
var du1_test_time = props.globals.getNode("instrumentation/du/du1-test-time"); var du1_test_time = props.globals.getNode("/instrumentation/du/du1-test-time");
var du1_test_amount = props.globals.getNode("instrumentation/du/du1-test-amount"); var du1_test_amount = props.globals.getNode("/instrumentation/du/du1-test-amount");
var du2_test = props.globals.getNode("instrumentation/du/du2-test"); var du2_test = props.globals.getNode("/instrumentation/du/du2-test");
var du2_test_time = props.globals.getNode("instrumentation/du/du2-test-time"); var du2_test_time = props.globals.getNode("/instrumentation/du/du2-test-time");
var du2_test_amount = props.globals.getNode("instrumentation/du/du2-test-amount"); var du2_test_amount = props.globals.getNode("/instrumentation/du/du2-test-amount");
var du2_offtime = props.globals.initNode("/instrumentation/du/du2-off-time", 0.0, "DOUBLE"); var du2_offtime = props.globals.initNode("/instrumentation/du/du2-off-time", 0.0, "DOUBLE");
var du5_test = props.globals.getNode("instrumentation/du/du5-test"); var du5_test = props.globals.getNode("/instrumentation/du/du5-test");
var du5_test_time = props.globals.getNode("instrumentation/du/du5-test-time"); var du5_test_time = props.globals.getNode("/instrumentation/du/du5-test-time");
var du5_offtime = props.globals.initNode("/instrumentation/du/du5-off-time", 0.0, "DOUBLE"); var du5_offtime = props.globals.initNode("/instrumentation/du/du5-off-time", 0.0, "DOUBLE");
var du5_test_amount = props.globals.getNode("instrumentation/du/du5-test-amount"); var du5_test_amount = props.globals.getNode("/instrumentation/du/du5-test-amount");
var du6_test = props.globals.getNode("instrumentation/du/du6-test"); var du6_test = props.globals.getNode("/instrumentation/du/du6-test");
var du6_test_time = props.globals.getNode("instrumentation/du/du6-test-time"); var du6_test_time = props.globals.getNode("/instrumentation/du/du6-test-time");
var du6_test_amount = props.globals.getNode("instrumentation/du/du6-test-amount"); var du6_test_amount = props.globals.getNode("/instrumentation/du/du6-test-amount");
var cpt_du_xfr = props.globals.getNode("modes/cpt-du-xfr"); var cpt_du_xfr = props.globals.getNode("/modes/cpt-du-xfr");
var fo_du_xfr = props.globals.getNode("modes/fo-du-xfr"); var fo_du_xfr = props.globals.getNode("/modes/fo-du-xfr");
var wow0 = props.globals.getNode("gear/gear[0]/wow"); var wow0 = props.globals.getNode("gear/gear[0]/wow");
var nd_display = {}; var nd_display = {};
@ -204,7 +204,7 @@ var canvas_ND_1 = {
m.init(canvas_group); m.init(canvas_group);
# here we make the ND: # here we make the ND:
me.NDCpt = ND.new("instrumentation/efis", myCockpit_switches, "Airbus"); me.NDCpt = ND.new("/instrumentation/efis", myCockpit_switches, "Airbus");
me.NDCpt.attitude_heading_setting = -1; me.NDCpt.attitude_heading_setting = -1;
me.NDCpt.adirs_property = props.globals.getNode("/instrumentation/efis[0]/nd/ir-1",1); me.NDCpt.adirs_property = props.globals.getNode("/instrumentation/efis[0]/nd/ir-1",1);
me.NDCpt.newMFD(canvas_group); me.NDCpt.newMFD(canvas_group);
@ -229,7 +229,7 @@ var canvas_ND_2 = {
# here we make the ND: # here we make the ND:
myCockpit_switches["ADIRS"]= {path: "/nd/ir-2", value: 0, type: "BOOL"}; myCockpit_switches["ADIRS"]= {path: "/nd/ir-2", value: 0, type: "BOOL"};
me.NDFo = ND.new("instrumentation/efis[1]", myCockpit_switches, "Airbus"); me.NDFo = ND.new("/instrumentation/efis[1]", myCockpit_switches, "Airbus");
me.NDFo.attitude_heading_setting = 1; me.NDFo.attitude_heading_setting = 1;
me.NDFo.adirs_property = props.globals.getNode("/instrumentation/efis[1]/nd/ir-2",1); me.NDFo.adirs_property = props.globals.getNode("/instrumentation/efis[1]/nd/ir-2",1);
me.NDFo.newMFD(canvas_group); me.NDFo.newMFD(canvas_group);
@ -275,11 +275,11 @@ var canvas_ND_1_test = {
}, },
update: func() { update: func() {
elapsedtime = getprop("sim/time/elapsed-sec") or 0; elapsedtime = getprop("sim/time/elapsed-sec") or 0;
if ((du2_test_time.getValue() + 1 >= elapsedtime) and getprop("modes/cpt-du-xfr") != 1) { if ((du2_test_time.getValue() + 1 >= elapsedtime) and getprop("/modes/cpt-du-xfr") != 1) {
me["Test_white"].show(); me["Test_white"].show();
me["Test_text"].hide(); me["Test_text"].hide();
} else if ((du1_test_time.getValue() + 1 >= elapsedtime) and getprop("modes/cpt-du-xfr") != 0) { } else if ((du1_test_time.getValue() + 1 >= elapsedtime) and getprop("/modes/cpt-du-xfr") != 0) {
print(getprop("modes/cpt-du-xfr")); print(getprop("/modes/cpt-du-xfr"));
me["Test_white"].show(); me["Test_white"].show();
me["Test_text"].hide(); me["Test_text"].hide();
} else { } else {
@ -317,10 +317,10 @@ var canvas_ND_2_test = {
}, },
update: func() { update: func() {
elapsedtime = getprop("sim/time/elapsed-sec") or 0; elapsedtime = getprop("sim/time/elapsed-sec") or 0;
if ((du5_test_time.getValue() + 1 >= elapsedtime) and getprop("modes/cpt-du-xfr") != 1) { if ((du5_test_time.getValue() + 1 >= elapsedtime) and getprop("/modes/cpt-du-xfr") != 1) {
me["Test_white"].show(); me["Test_white"].show();
me["Test_text"].hide(); me["Test_text"].hide();
} else if ((du6_test_time.getValue() + 1 >= elapsedtime) and getprop("modes/cpt-du-xfr") != 0) { } else if ((du6_test_time.getValue() + 1 >= elapsedtime) and getprop("/modes/cpt-du-xfr") != 0) {
me["Test_white"].show(); me["Test_white"].show();
me["Test_text"].hide(); me["Test_text"].hide();
} else { } else {
@ -331,8 +331,8 @@ 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[0]/inputs/plan-wpt-index", -1);
setprop("instrumentation/efis[1]/inputs/plan-wpt-index", -1); setprop("/instrumentation/efis[1]/inputs/plan-wpt-index", -1);
nd_display.main = canvas.new({ nd_display.main = canvas.new({
"name": "ND1", "name": "ND1",
@ -430,7 +430,7 @@ for (i = 0; i < 2; i = i + 1 ) {
var idx = par.getIndex(); var idx = par.getIndex();
var canvas_mode = "/instrumentation/efis["~idx~"]/nd/canvas-display-mode"; var canvas_mode = "/instrumentation/efis["~idx~"]/nd/canvas-display-mode";
var nd_centered = "/instrumentation/efis["~idx~"]/inputs/nd-centered"; var nd_centered = "/instrumentation/efis["~idx~"]/inputs/nd-centered";
var mode = getprop("instrumentation/efis["~idx~"]/nd/display-mode"); var mode = getprop("/instrumentation/efis["~idx~"]/nd/display-mode");
var cvs_mode = "NAV"; var cvs_mode = "NAV";
var centered = 1; var centered = 1;
if (mode == "ILS") { if (mode == "ILS") {
@ -463,7 +463,7 @@ var startChangePhase = func(nd,txt) {
} }
#setlistener("/instrumentation/efis[0]/nd/terrain-on-nd", func{ #setlistener("/instrumentation/efis[0]/nd/terrain-on-nd", func{
# var terr_on_hd = getprop("instrumentation/efis[0]/nd/terrain-on-nd"); # var terr_on_hd = getprop("/instrumentation/efis[0]/nd/terrain-on-nd");
# var alpha = 1; # var alpha = 1;
# if (terr_on_hd) { # if (terr_on_hd) {
# alpha = 0.5; # alpha = 0.5;
@ -473,10 +473,10 @@ var startChangePhase = func(nd,txt) {
setlistener("/flight-management/control/capture-leg", func(n) { setlistener("/flight-management/control/capture-leg", func(n) {
var capture_leg = n.getValue(); var capture_leg = n.getValue();
setprop("instrumentation/efis[0]/nd/xtrk-error", capture_leg); setprop("/instrumentation/efis[0]/nd/xtrk-error", capture_leg);
setprop("instrumentation/efis[1]/nd/xtrk-error", capture_leg); setprop("/instrumentation/efis[1]/nd/xtrk-error", capture_leg);
setprop("instrumentation/efis[0]/nd/trk-line", capture_leg); setprop("/instrumentation/efis[0]/nd/trk-line", capture_leg);
setprop("instrumentation/efis[1]/nd/trk-line", capture_leg); setprop("/instrumentation/efis[1]/nd/trk-line", capture_leg);
}, 0, 0); }, 0, 0);
var showNd = func(nd = nil) { var showNd = func(nd = nil) {

View file

@ -19,6 +19,22 @@
</action> </action>
</animation> </animation>
<animation>
<type>select</type>
<object-name>uecam.screen</object-name>
<condition>
<not><property>modes/ecam-du-xfr</property></not>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>uecam.screen2</object-name>
<condition>
<property>modes/ecam-du-xfr</property>
</condition>
</animation>
<animation> <animation>
<type>material</type> <type>material</type>
<object-name>uecam.screen</object-name> <object-name>uecam.screen</object-name>

View file

@ -1,26 +1,44 @@
AC3Db AC3Db
MATERIAL "buttonlights.001" rgb 1.000 1.000 1.000 amb 1.000 1.000 1.000 emis 1.000 1.000 1.000 spec 0.000 0.000 0.000 shi 0 trans 0.000 MATERIAL "buttonlights.001" rgb 1 1 1 amb 1 1 1 emis 1 1 1 spec 0 0 0 shi 0 trans 0
OBJECT world OBJECT world
name "Blender_exporter_v2.26__Upper-ECAM.ac" kids 2
kids 1
OBJECT poly OBJECT poly
name "uecam.screen" name "uecam.screen"
data 21 data 21
uecam.screen.mesh.008 uecam.screen.mesh.008
crease 30.0
texture "screen.png" texture "screen.png"
texrep 1 1 crease 30.000000
numvert 4
-0.58049 0.30536 0.06855
-0.53427 0.14966 0.06855
-0.53427 0.14966 -0.09384
-0.58049 0.30536 -0.09384
numsurf 1
SURF 0x0
mat 0
refs 4
3 1.00067 0.999407
0 4.5e-005 0.999407
1 4.5e-005 0.000756
2 1.00067 0.000756
kids 0
OBJECT poly
name "uecam.screen2"
data 21
uecam.screen.mesh.008
texture "screen.png"
crease 30.000000
numvert 4 numvert 4
-0.58049 0.30536 -0.09384 -0.58049 0.30536 -0.09384
-0.53427 0.14966 -0.09384 -0.53427 0.14966 -0.09384
-0.53427 0.14966 0.06855 -0.53427 0.14966 0.06855
-0.58049 0.30536 0.06855 -0.58049 0.30536 0.06855
numsurf 1 numsurf 1
SURF 0X0 SURF 0x0
mat 0 mat 0
refs 4 refs 4
0 1.00067 0.999407 0 1.00067 0.999407
3 0.000045 0.999407 3 4.5e-005 0.999407
2 0.000045 0.000756 2 4.5e-005 0.000756
1 1.00067 0.000756 1 1.00067 0.000756
kids 0 kids 0

View file

@ -133,7 +133,12 @@ var ECAM = {
var ECAMControlPanel = { var ECAMControlPanel = {
sysPageBtn: func(page) { sysPageBtn: func(page) {
SystemDisplayController.manCall(page); if (page == "REL") {
pts.Modes.EcamDuXfr.setBoolValue(0);
} else {
pts.Modes.EcamDuXfr.setBoolValue(1);
SystemDisplayController.manCall(page);
}
}, },
rclBtn: func() { rclBtn: func() {
ecam.ECAM_controller.recall(); ecam.ECAM_controller.recall();

View file

@ -212,6 +212,10 @@ var Instrumentation = {
}, },
}; };
var Modes = {
EcamDuXfr: props.globals.getNode("/modes/ecam-du-xfr"),
};
var Options = { var Options = {
eng: props.globals.getNode("/options/eng"), eng: props.globals.getNode("/options/eng"),
}; };