From 1c93f51f69c657ddf406646f8f0fc279f2781e93 Mon Sep 17 00:00:00 2001 From: meggert Date: Sat, 16 Mar 2024 13:48:49 +0100 Subject: [PATCH] prevent switching of heaters in external control --- mission/controller/ThermalController.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 2729cec0..7d8d99a0 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -1792,7 +1792,8 @@ void ThermalController::heaterMaxDurationControl( for (unsigned i = 0; i < heater::Switch::NUMBER_OF_SWITCHES; i++) { // Right now, we only track the maximum duration for heater which were commanded by the TCS // controller. - if (currentHeaterStates[i] == heater::SwitchState::ON and + if (heaterHandler.getHealth(static_cast(i)) != HasHealthIF::EXTERNAL_CONTROL and + currentHeaterStates[i] == heater::SwitchState::ON and heaterStates[i].trackHeaterMaxBurnTime and heaterStates[i].heaterOnMaxBurnTime.hasTimedOut()) { heaterStates[i].switchTransition = false;