From c300665c796becfb511e60a38e1853e38471c050 Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Thu, 25 Jan 2018 14:22:40 -0400 Subject: [PATCH] fix DCBAT / DC1 / DC2 logic --- Nasal/electrical.nas | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Nasal/electrical.nas b/Nasal/electrical.nas index 7415a233..0fc8d2d2 100644 --- a/Nasal/electrical.nas +++ b/Nasal/electrical.nas @@ -302,7 +302,7 @@ var ELEC = { setprop("/systems/electrical/battery2-amps", 0); } - if (getprop("/systems/electrical/battery1-amps") > 120 or getprop("/systems/electrical/battery2-amps") > 120) { + if (getprop("/systems/electrical/dc1") > 25 or or getprop("/systems/electrical/dc2") > 25) { setprop("/systems/electrical/bus/dcbat", dc_volt_std); } else { setprop("/systems/electrical/bus/dcbat", 0); @@ -367,6 +367,10 @@ var ELEC = { 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 (dc2 > 25 and dcbat > 25) { + 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 (emergen) { setprop("/systems/electrical/bus/dc1", 0); setprop("/systems/electrical/bus/dc-ess", dc_volt_std); @@ -394,6 +398,10 @@ var ELEC = { } else if (apu_ext_crosstie_sw == 1 and xtieR) { setprop("/systems/electrical/bus/dc2", dc_volt_std); setprop("/systems/electrical/bus/dc2-amps", dc_amps_std); + } else if (dc1 > 25 and dcbat > 25) { + 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 (emergen) { setprop("/systems/electrical/bus/dc2", 0); setprop("/systems/electrical/bus/dc2-amps", 0);