SoC Calculator #754

Merged
muellerr merged 74 commits from soc-calculator into main 2023-10-11 10:50:48 +02:00
Showing only changes of commit 9472faf899 - Show all commits

View File

@ -98,6 +98,11 @@ void PowerController::performControlOperation() {
calculateStateOfCharge(); calculateStateOfCharge();
if (mode == MODE_NORMAL) { if (mode == MODE_NORMAL) {
watchStateOfCharge(); watchStateOfCharge();
} else {
PoolReadGuard pg(&enablePl);
if (pg.getReadResult() == returnvalue::OK) {
enablePl.setValidity(false, true);
}
} }
} }
break; break;
@ -229,13 +234,13 @@ void PowerController::watchStateOfCharge() {
PoolReadGuard pg(&enablePl); PoolReadGuard pg(&enablePl);
if (pg.getReadResult() == returnvalue::OK) { if (pg.getReadResult() == returnvalue::OK) {
enablePl.plUseAllowed.value = false; enablePl.plUseAllowed.value = false;
enablePl.plUseAllowed.setValid(true); enablePl.setValidity(true, true);
} }
} else { } else {
PoolReadGuard pg(&enablePl); PoolReadGuard pg(&enablePl);
if (pg.getReadResult() == returnvalue::OK) { if (pg.getReadResult() == returnvalue::OK) {
enablePl.plUseAllowed.value = true; enablePl.plUseAllowed.value = true;
enablePl.plUseAllowed.setValid(true); enablePl.setValidity(true, true);
} }
} }
if (not pwrLvlLowFlag and pwrCtrlCoreHk.coulombCounterCharge.value < payloadOpLimitLow) { if (not pwrLvlLowFlag and pwrCtrlCoreHk.coulombCounterCharge.value < payloadOpLimitLow) {
@ -254,7 +259,7 @@ void PowerController::watchStateOfCharge() {
PoolReadGuard pg(&enablePl); PoolReadGuard pg(&enablePl);
if (pg.getReadResult() == returnvalue::OK) { if (pg.getReadResult() == returnvalue::OK) {
enablePl.plUseAllowed.value = false; enablePl.plUseAllowed.value = false;
enablePl.plUseAllowed.setValid(true); enablePl.setValidity(true, true);
} }
} }
} }