added library json

This commit is contained in:
hidaba
2023-05-14 11:02:22 +02:00
parent c60123ce97
commit ab8de582d8
421 changed files with 51080 additions and 6 deletions

View File

@ -428,22 +428,22 @@ struct batteryStack
}
// power in Wh in charge
long powerIN() const
float powerIN() const
{
if (currentDC > 0) {
return (long)(((double)currentDC/1000.0)*((double)avgVoltage/1000.0));
return (float)(((double)currentDC/1000.0)*((double)avgVoltage/1000.0));
} else {
return (long)(0);
return (float)(0);
}
}
// power in Wh in discharge
long powerOUT() const
float powerOUT() const
{
if (currentDC < 0) {
return (long)(((double)currentDC/1000.0)*((double)avgVoltage/1000.0)*-1);
return (float)(((double)currentDC/1000.0)*((double)avgVoltage/1000.0)*-1);
} else {
return (long)(0);
return (float)(0);
}
}