diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 88058ecc..f932c762 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -1706,7 +1706,7 @@ void ThermalController::checkLimitsAndCtrlHeater(HeaterContext& htrCtx) { } htrCtx.switchState = - static_cast(heaterInfo.heaterSwitchState[htrCtx.switchNr]); + static_cast(heaterInfo.heaterSwitchState[htrCtx.switchNr]); // Heater off if (htrCtx.switchState == heater::SwitchState::OFF) { if (ctrlCtx.sensorTemp < htrCtx.tempLimit.opLowerLimit and heaterCtrlAllowed()) { @@ -1780,7 +1780,7 @@ void ThermalController::heaterTransitionControl( if (heaterStates[i].switchTransition) { if (currentHeaterStates[i] == heaterStates[i].target) { // Required for max heater period control - if (currentHeaterStates[i] == HeaterHandler::SwitchState::ON) { + if (currentHeaterStates[i] == heater::SwitchState::ON) { heaterStates[i].heaterOnPeriod.setTimeout(MAX_HEATER_ON_DURATIONS_MS[i]); heaterStates[i].heaterOnPeriod.resetTimer(); } else { @@ -1808,13 +1808,13 @@ void ThermalController::heaterMaxDurationControl( heaterStates[i].heaterOnPeriod.hasTimedOut()) { heaterStates[i].switchTransition = false; heaterStates[i].heaterSwitchControlCycles = 0; - heaterHandler.switchHeater(static_cast(i), HeaterHandler::SwitchState::OFF); + heaterHandler.switchHeater(static_cast(i), heater::SwitchState::OFF); triggerEvent(tcsCtrl::TCS_HEATER_MAX_BURN_TIME_REACHED, static_cast(i), MAX_HEATER_ON_DURATIONS_MS[i]); // The heater might still be one for some thermal components, so cross-check // those components crossCheckHeaterStateOfComponentsWhenHeaterGoesOff(static_cast(i)); - } else if (currentHeaterStates[i] == HeaterHandler::SwitchState::OFF) { + } else if (currentHeaterStates[i] == heater::SwitchState::OFF) { heaterStates[i].heaterOnPeriod.resetTimer(); } } @@ -1874,13 +1874,13 @@ void ThermalController::heaterSwitchHelper(heater::Switch switchNr, heater::Swit thermalStates[componentIdx].heaterSwitch = switchNr; thermalStates[componentIdx].heating = true; thermalStates[componentIdx].heaterStartTime = currentTime.tv_sec; - triggerEvent(tcsCtrl::TCS_SWITCHING_HEATER_ON, static_cast(currThermalComponent), + triggerEvent(tcsCtrl::TCS_SWITCHING_HEATER_ON, static_cast(ctrlCtx.thermalComponent), static_cast(switchNr)); } else { heaterHandler.switchHeater(switchNr, targetState); thermalStates[componentIdx].heating = false; thermalStates[componentIdx].heaterEndTime = currentTime.tv_sec; - triggerEvent(tcsCtrl::TCS_SWITCHING_HEATER_OFF, static_cast(currThermalComponent), + triggerEvent(tcsCtrl::TCS_SWITCHING_HEATER_OFF, static_cast(ctrlCtx.thermalComponent), static_cast(switchNr)); } } diff --git a/mission/tcs/HeaterHandler.cpp b/mission/tcs/HeaterHandler.cpp index a1964d74..b88dfe75 100644 --- a/mission/tcs/HeaterHandler.cpp +++ b/mission/tcs/HeaterHandler.cpp @@ -421,7 +421,7 @@ ReturnValue_t HeaterHandler::getAllSwitchStates(std::array