From bac8166611090c85c9ce71bb9e477a884c4c8ed0 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Tue, 20 Dec 2022 15:47:40 +0100 Subject: [PATCH] changes thermal control --- mission/controller/ThermalController.cpp | 17 ++++++++++------- mission/controller/ThermalController.h | 3 ++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index d0456c54..380b70cf 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -105,7 +105,8 @@ void ThermalController::performControlOperation() { } // TODO: Heater control - ctrlAcsBoard(); + ctrlCameraBody(); + /*ctrlAcsBoard(); ctrlMgt(); ctrlRw(); ctrlStr(); @@ -121,13 +122,13 @@ void ThermalController::performControlOperation() { ctrlPlocMissionBoard(); ctrlPlocProcessingBoard(); ctrlDac(); - ctrlCameraBody(); + ctrlDro(); ctrlX8(); ctrlHpa(); ctrlTx(); ctrlMpa(); - ctrlScexBoard(); + ctrlScexBoard();*/ } ReturnValue_t ThermalController::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, @@ -1121,7 +1122,7 @@ void ThermalController::ctrlCameraBody() { heater::Switchers switchNr = heater::HEATER_4_CAMERA; heater::Switchers redSwitchNr = heater::HEATER_6_DRO; - chooseHeater(switchNr, redSwitchNr); + //chooseHeater(switchNr, redSwitchNr); if (heaterAvailable) { chooseSensor(switchNr, sensorTemperatures.sensor_4k_camera.value, @@ -1130,7 +1131,7 @@ void ThermalController::ctrlCameraBody() { sensorTemperatures.sensor_dro.isValid(), sensorTemperatures.sensor_mpa.isValid()); if (sensorTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, &cameraLimits); + //ctrlHeater(switchNr, redSwitchNr, &cameraLimits); } } } @@ -1191,7 +1192,8 @@ void ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switch redSwitchNrInUse = true; } else { heaterAvailable = false; - // TODO: triggerEvent ? + //TODO: triggerEvent(NO_HEALTHY_HEATER_AVAILABLE, switchNr, redSwitchNr); + sif::error << "ThermalController::chooseSensor: Both heater: "<< switchNr << " + " << redSwitchNr << " not healthy" << std::endl; } } else { redSwitchNrInUse = false; @@ -1213,7 +1215,8 @@ void ThermalController::chooseSensor(heater::Switchers switchNr, float sensorVal if (heaterHandler.checkSwitchState(switchNr)) { heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); } - triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); + //TODO: triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); + sif::error << "ThermalController::chooseSensor: No valid Sensor found"<< std::endl; sensorTempAvailable = false; } } diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 874297fd..5611b67f 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -55,7 +55,8 @@ class ThermalController : public ExtendedControllerBase { private: static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::HEATER_HANDLER; - static constexpr Event NO_VALID_SENSOR_TEMPERATURE = MAKE_EVENT(0, severity::LOW); + static constexpr Event NO_VALID_SENSOR_TEMPERATURE = MAKE_EVENT(8, severity::MEDIUM); + static constexpr Event NO_HEALTHY_HEATER_AVAILABLE = MAKE_EVENT(9, severity::MEDIUM); static const uint32_t DELAY = 500;