cleaning up a bit
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
2023-03-28 19:38:02 +02:00
parent 520b41c53b
commit def7eca2f2
5 changed files with 156 additions and 56 deletions

View File

@ -53,9 +53,12 @@ struct ThermalState {
struct HeaterState {
bool switchTransition;
uint8_t heaterSwitchControlErrorCounter;
HeaterHandler::SwitchState target;
uint8_t heaterSwitchControlCycles;
};
using HeaterSwitchStates = std::array<HeaterHandler::SwitchState, heater::NUMBER_OF_SWITCHES>;
enum ThermalComponents : uint8_t {
NONE = 0,
ACS_BOARD = 1,
@ -94,7 +97,7 @@ class ThermalController : public ExtendedControllerBase {
ReturnValue_t initialize() override;
protected:
void performThermalModuleCtrl();
void performThermalModuleCtrl(const HeaterSwitchStates& heaterSwitchStates);
ReturnValue_t handleCommandMessage(CommandMessage* message) override;
void performControlOperation() override;
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
@ -245,6 +248,7 @@ class ThermalController : public ExtendedControllerBase {
bool rwTooHotFlag = false;
bool transitionToOff = false;
uint32_t transitionToOffCycles = 0;
uint32_t cycles = 0;
std::array<ThermalState, 30> thermalStates{};
std::array<HeaterState, 7> heaterStates{};
@ -281,6 +285,11 @@ class ThermalController : public ExtendedControllerBase {
const TempLimits& tempLimit);
void checkLimitsAndCtrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr,
const TempLimits& tempLimit);
bool heaterCtrlCheckUpperLimits(heater::Switchers switchNr, heater::Switchers redSwitchNr,
bool doHeaterHandling, const TempLimits& tempLimit);
void heaterCtrlTempTooHighHandler(heater::Switchers switchNr, heater::Switchers redSwitchNr,
const char* whatLimit);
bool chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr);
bool selectAndReadSensorTemp();
@ -307,10 +316,11 @@ class ThermalController : public ExtendedControllerBase {
void ctrlTx();
void ctrlMpa();
void ctrlScexBoard();
void heaterTransitionControl();
void heaterTransitionControl(const HeaterSwitchStates& currentHeaterStates);
void setMode(Mode_t mode);
uint32_t tempFloatToU32() const;
void tooHotHandler(object_id_t object, bool& oneShotFlag);
bool tooHotHandler(object_id_t object, bool& oneShotFlag);
void tooHotHandlerWhichClearsOneShotFlag(object_id_t object, bool& oneShotFlag);
};
#endif /* MISSION_CONTROLLER_THERMALCONTROLLER_H_ */