diff --git a/Models/Instruments/ECAM/page-elec.xml b/Models/Instruments/ECAM/page-elec.xml
index 609c7472..a184f9a5 100644
--- a/Models/Instruments/ECAM/page-elec.xml
+++ b/Models/Instruments/ECAM/page-elec.xml
@@ -24,9 +24,8 @@
-
text
- BAT1
+ BAT1-voltage
0
1.0
@@ -37,7 +36,7 @@
number-value
- /systems/electrical/suppliers/battery
+ /systems/electrical/battery1-volts
%3.1f
@@ -51,12 +50,18 @@
-68
+
+
+ /controls/electrical/switches/battery1
+ 1
+
+
text
- BAT2
+ BAT2-voltage
0
1.0
@@ -67,7 +72,7 @@
number-value
- /systems/electrical/suppliers/battery
+ /systems/electrical/battery2-volts
%3.1f
@@ -81,7 +86,141 @@
38
+
+
+ /controls/electrical/switches/battery2
+ 1
+
+
+
+ battery1off
+ true
+ 42
+ 42
+
+ Aircraft/A320Family/Models/Instruments/ECAM/res/elec-bat1off.png
+
+
+
+ y-shift
+ 102
+
+
+ x-shift
+ -53
+
+
+
+
+ /controls/electrical/switches/battery1
+ 0
+
+
+
+
+ battery2off
+ true
+ 42
+ 42
+
+ Aircraft/A320Family/Models/Instruments/ECAM/res/elec-bat2off.png
+
+
+
+ y-shift
+ 102
+
+
+ x-shift
+ 54
+
+
+
+
+ /controls/electrical/switches/battery2
+ 0
+
+
+
+
+ text
+ BAT1-amps
+
+ 0
+ 1.0
+ 0
+
+ helvetica_bold
+ 11
+
+
+ number-value
+ /systems/electrical/battery1-amps
+ %3.0f
+
+
+
+
+ y-shift
+ 88
+
+
+ x-shift
+ -68
+
+
+
+
+ /controls/electrical/switches/battery1
+ 1
+
+
+
+
+
+
+ text
+ BAT2-amps
+
+ 0
+ 1.0
+ 0
+
+ helvetica_bold
+ 11
+
+
+ number-value
+ /systems/electrical/battery2-amps
+ %3.0f
+
+
+
+
+ y-shift
+ 88
+
+
+ x-shift
+ 38
+
+
+
+
+ /controls/electrical/switches/battery2
+ 1
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Models/Instruments/ECAM/res/elec-bat1off.png b/Models/Instruments/ECAM/res/elec-bat1off.png
new file mode 100644
index 00000000..4ab1645b
Binary files /dev/null and b/Models/Instruments/ECAM/res/elec-bat1off.png differ
diff --git a/Models/Instruments/ECAM/res/page-elec.png b/Models/Instruments/ECAM/res/page-elec.png
index 40e99480..cf640f70 100644
Binary files a/Models/Instruments/ECAM/res/page-elec.png and b/Models/Instruments/ECAM/res/page-elec.png differ
diff --git a/Nasal/electrical.nas b/Nasal/electrical.nas
index e2de8936..9f30b2ab 100644
--- a/Nasal/electrical.nas
+++ b/Nasal/electrical.nas
@@ -8,6 +8,8 @@ var ac_volt_std = 115;
var ac_volt_min = 110;
var dc_volt_std = 28;
var dc_volt_min = 25;
+var dc_amps_std = 150;
+var ac_hz_std = 400;
var elec_init = func {
setprop("/controls/switches/annun-test", 0);
@@ -24,11 +26,17 @@ var elec_init = func {
setprop("/controls/electrical/switches/battery2", 0);
setprop("/systems/electrical/battery1-volts", 25.9);
setprop("/systems/electrical/battery2-volts", 25.9);
+ setprop("/systems/electrical/battery1-amps", 0);
+ setprop("/systems/electrical/battery2-amps", 0);
setprop("/systems/electrical/bus/dc1", 0);
setprop("/systems/electrical/bus/dc2", 0);
+ setprop("/systems/electrical/bus/dc1-amps", 0);
+ setprop("/systems/electrical/bus/dc2-amps", 0);
setprop("/systems/electrical/bus/dc-ess", 0);
setprop("/systems/electrical/bus/ac1", 0);
setprop("/systems/electrical/bus/ac2", 0);
+ setprop("/systems/electrical/bus/ac1-hz", 0);
+ setprop("/systems/electrical/bus/ac2-hz", 0);
setprop("/systems/electrical/bus/ac-ess", 0);
setprop("systems/electrical/on", 0);
setprop("/controls/electrical/xtie/xtieL", 0);
@@ -96,6 +104,7 @@ var master_elec = func {
var dc_ess = getprop("/systems/electrical/bus/dc-ess");
+
# Left cross tie yes?
if (extpwr_on and gen_ext_sw) {
setprop("/controls/electrical/xtie/xtieR", 1);
@@ -121,30 +130,35 @@ var master_elec = func {
# Left AC/DC bus yes?
if (extpwr_on and gen_ext_sw) {
setprop("/systems/electrical/bus/ac1", ac_volt_std);
- setprop("/systems/electrical/bus/ac-ess", ac_volt_std);
+ setprop("/systems/electrical/bus/ac-ess", ac_volt_std);
setprop("/systems/electrical/bus/dc1", dc_volt_std);
setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
+ setprop("/systems/electrical/bus/dc1-amps", dc_amps_std);
} else if (rpmapu >= 94.9 and gen_apu_sw) {
setprop("/systems/electrical/bus/ac1", ac_volt_std);
setprop("/systems/electrical/bus/ac-ess", ac_volt_std);
setprop("/systems/electrical/bus/dc1", dc_volt_std);
setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
+ setprop("/systems/electrical/bus/dc1-amps", dc_amps_std);
} else if (stateL == 3 and gen1_sw) {
setprop("/systems/electrical/bus/ac1", ac_volt_std);
setprop("/systems/electrical/bus/ac-ess", ac_volt_std);
setprop("/systems/electrical/bus/dc1", dc_volt_std);
setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
+ setprop("/systems/electrical/bus/dc1-amps", dc_amps_std);
} else if (apu_ext_crosstie_sw == 1 and xtieL) {
setprop("/systems/electrical/bus/ac1", ac_volt_std);
setprop("/systems/electrical/bus/ac-ess", ac_volt_std);
setprop("/systems/electrical/bus/dc1", dc_volt_std);
setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
+ setprop("/systems/electrical/bus/dc1-amps", dc_amps_std);
} else {
setprop("/systems/electrical/bus/ac1", 0);
if (getprop("/systems/electrical/bus/ac2") == 0) {
setprop("/systems/electrical/bus/ac-ess", 0);
}
setprop("/systems/electrical/bus/dc1", 0);
+ setprop("/systems/electrical/bus/dc1-amps", 0);
if (getprop("/systems/electrical/bus/dc2") == 0) {
setprop("/systems/electrical/bus/dc-ess", 0);
}
@@ -156,27 +170,32 @@ var master_elec = func {
setprop("/systems/electrical/bus/ac-ess", ac_volt_std);
setprop("/systems/electrical/bus/dc2", dc_volt_std);
setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
+ setprop("/systems/electrical/bus/dc2-amps", dc_amps_std);
} else if (rpmapu >= 94.9 and gen_apu_sw) {
setprop("/systems/electrical/bus/ac2", ac_volt_std);
setprop("/systems/electrical/bus/ac-ess", ac_volt_std);
setprop("/systems/electrical/bus/dc2", dc_volt_std);
setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
+ setprop("/systems/electrical/bus/dc2-amps", dc_amps_std);
} else if (stateR == 3 and gen2_sw) {
setprop("/systems/electrical/bus/ac2", ac_volt_std);
setprop("/systems/electrical/bus/ac-ess", ac_volt_std);
setprop("/systems/electrical/bus/dc2", dc_volt_std);
setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
+ setprop("/systems/electrical/bus/dc2-amps", dc_amps_std);
} else if (apu_ext_crosstie_sw == 1 and xtieR) {
setprop("/systems/electrical/bus/ac2", ac_volt_std);
setprop("/systems/electrical/bus/ac-ess", ac_volt_std);
setprop("/systems/electrical/bus/dc2", dc_volt_std);
setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
+ setprop("/systems/electrical/bus/dc2-amps", dc_amps_std);
} else {
setprop("/systems/electrical/bus/ac2", 0);
if (getprop("/systems/electrical/bus/ac1") == 0) {
setprop("/systems/electrical/bus/ac-ess", 0);
}
setprop("/systems/electrical/bus/dc2", 0);
+ setprop("/systems/electrical/bus/dc2-amps", 0);
if (getprop("/systems/electrical/bus/dc1") == 0) {
setprop("/systems/electrical/bus/dc-ess", 0);
}
@@ -192,6 +211,19 @@ var master_elec = func {
setprop("/systems/electrical/bus/galley", 0);
}
+ # Battery Amps
+ if (battery1_sw) {
+ setprop("/systems/electrical/battery1-amps", dc_amps_std);
+ } else {
+ setprop("/systems/electrical/battery1-amps", 0);
+ }
+
+ if (battery2_sw) {
+ setprop("/systems/electrical/battery2-amps", dc_amps_std);
+ } else {
+ setprop("/systems/electrical/battery2-amps", 0);
+ }
+
if (getprop("/systems/electrical/bus/ac-ess") == 0) {
setprop("systems/electrical/on", 0);
# ai_spin.setValue(0.2);