no message
This commit is contained in:
@@ -629,6 +629,34 @@ private function CalculateBatteryDistribution(float $pEvW, float $pSdlW): array
|
||||
}
|
||||
|
||||
|
||||
$sumReq = (abs($pEvW) + abs($pSdlW));
|
||||
$sumReqRel = ($pEvW + $pSdlW);
|
||||
|
||||
if($sumReq==0){
|
||||
|
||||
$this->SetValue("Aktuelle_Leistung_EV", $totalPower_ist / 2);
|
||||
$this->SetValue("Aktuelle_Leistung_SDL", $totalPower_ist / 2);
|
||||
|
||||
}else{
|
||||
|
||||
if($pEvW>=0){
|
||||
|
||||
$this->SetValue("Aktuelle_Leistung_EV",((1+($totalPower_ist-$sumReqRel) / $sumReq)) * $pEvW);
|
||||
|
||||
}else{
|
||||
$this->SetValue("Aktuelle_Leistung_EV",((1-($totalPower_ist-$sumReqRel) / $sumReq)) * $pEvW);
|
||||
|
||||
}
|
||||
|
||||
if($pSdlW>=0){
|
||||
$this->SetValue("Aktuelle_Leistung_SDL",((1+($totalPower_ist-$sumReqRel) / $sumReq)) * $pSdlW);
|
||||
|
||||
}else{
|
||||
$this->SetValue("Aktuelle_Leistung_SDL",((1-($totalPower_ist-$sumReqRel) / $sumReq)) * $pSdlW);
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
$sumReq = (float)($pEvW + $pSdlW);
|
||||
|
||||
if (!is_finite($sumReq) || abs($sumReq) < 0.01) {
|
||||
@@ -643,6 +671,9 @@ private function CalculateBatteryDistribution(float $pEvW, float $pSdlW): array
|
||||
$this->SetValue("Aktuelle_Leistung_SDL",($totalPower_ist / $sumReq) * $pSdlW);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
return $finalOutput;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user