From 336c77bf281fa28a179378354567801158ca078b Mon Sep 17 00:00:00 2001 From: Joshua Davidson <joshuadavidson2000@gmail.com> Date: Thu, 17 May 2018 10:16:51 -0400 Subject: [PATCH] Systems: Fix charge/discharge offset values --- Nasal/electrical.nas | 16 ++++++++-------- revision.txt | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Nasal/electrical.nas b/Nasal/electrical.nas index 988a96dd..e5ebbc3a 100644 --- a/Nasal/electrical.nas +++ b/Nasal/electrical.nas @@ -613,8 +613,8 @@ var ELEC = { dc2 = getprop("/systems/electrical/bus/dc2"); if (battery1_percent < 100 and (dc1 > 25 or dc2 > 25) and battery1_sw and !batt1_fail) { - if (getprop("/systems/electrical/battery1-time") + 30 < getprop("/sim/time/elapsed-sec")) { - battery1_percent_calc = battery1_percent + 4.5; # Roughly 90 percent every 10 mins + if (getprop("/systems/electrical/battery1-time") + 5 < getprop("/sim/time/elapsed-sec")) { + battery1_percent_calc = battery1_percent + 0.75; # Roughly 90 percent every 10 mins if (battery1_percent_calc > 100) { battery1_percent_calc = 100; } @@ -622,8 +622,8 @@ var ELEC = { setprop("/systems/electrical/battery1-time", getprop("/sim/time/elapsed-sec")); } } else if (battery1_amps >= 120 and battery1_sw and !batt1_fail) { - if (getprop("/systems/electrical/battery1-time") + 30 < getprop("/sim/time/elapsed-sec")) { - battery1_percent_calc = battery1_percent - 1.5; # Roughly 90 percent every 30 mins + if (getprop("/systems/electrical/battery1-time") + 5 < getprop("/sim/time/elapsed-sec")) { + battery1_percent_calc = battery1_percent - 0.25; # Roughly 90 percent every 30 mins if (battery1_percent_calc < 0) { battery1_percent_calc = 0; } @@ -635,8 +635,8 @@ var ELEC = { } if (battery2_percent < 100 and (dc1 > 25 or dc2 > 25) and battery2_sw and !batt2_fail) { - if (getprop("/systems/electrical/battery2-time") + 30 < getprop("/sim/time/elapsed-sec")) { - battery2_percent_calc = battery2_percent + 4.5; # Roughly 90 percent every 10 mins + if (getprop("/systems/electrical/battery2-time") + 5 < getprop("/sim/time/elapsed-sec")) { + battery2_percent_calc = battery2_percent + 0.75; # Roughly 90 percent every 10 mins if (battery2_percent_calc > 100) { battery2_percent_calc = 100; } @@ -644,8 +644,8 @@ var ELEC = { setprop("/systems/electrical/battery2-time", getprop("/sim/time/elapsed-sec")); } } else if (battery2_amps >= 120 and battery2_sw and !batt2_fail) { - if (getprop("/systems/electrical/battery2-time") + 30 < getprop("/sim/time/elapsed-sec")) { - battery2_percent_calc = battery2_percent - 1.5; # Roughly 90 percent every 30 mins + if (getprop("/systems/electrical/battery2-time") + 5 < getprop("/sim/time/elapsed-sec")) { + battery2_percent_calc = battery2_percent - 0.25; # Roughly 90 percent every 30 mins if (battery2_percent_calc < 0) { battery2_percent_calc = 0; } diff --git a/revision.txt b/revision.txt index fd09341e..561b3919 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -4411 \ No newline at end of file +4412 \ No newline at end of file