mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 17:59:27 +02:00
Move Battery2 power calculation outside SOC scaling function
This commit is contained in:
parent
9afa16c7ae
commit
0a31337334
1 changed files with 6 additions and 4 deletions
|
@ -355,6 +355,12 @@ void update_calculated_values() {
|
|||
datalayer.battery.status.active_power_W =
|
||||
(datalayer.battery.status.current_dA * (datalayer.battery.status.voltage_dV / 100));
|
||||
|
||||
#ifdef DOUBLE_BATTERY
|
||||
/* Calculate active power based on voltage and current for battery 2*/
|
||||
datalayer.battery2.status.active_power_W =
|
||||
(datalayer.battery2.status.current_dA * (datalayer.battery2.status.voltage_dV / 100));
|
||||
#endif // DOUBLE_BATTERY
|
||||
|
||||
if (datalayer.battery.settings.soc_scaling_active) {
|
||||
/** SOC Scaling
|
||||
*
|
||||
|
@ -404,10 +410,6 @@ void update_calculated_values() {
|
|||
}
|
||||
|
||||
#ifdef DOUBLE_BATTERY
|
||||
/* Calculate active power based on voltage and current*/
|
||||
datalayer.battery2.status.active_power_W =
|
||||
(datalayer.battery2.status.current_dA * (datalayer.battery2.status.voltage_dV / 100));
|
||||
|
||||
// Calculate the scaled remaining capacity in Wh
|
||||
if (datalayer.battery2.info.total_capacity_Wh > 0 && datalayer.battery2.status.real_soc > 0) {
|
||||
calc_max_capacity =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue