2021-01-08 09:34:43 +01:00
|
|
|
#include "ThermalController.h"
|
2022-01-17 15:58:27 +01:00
|
|
|
|
2022-06-10 12:18:23 +02:00
|
|
|
#include <bsp_q7s/core/CoreDefinitions.h>
|
2022-06-16 07:00:09 +02:00
|
|
|
#include <fsfw/datapool/PoolReadGuard.h>
|
2023-01-17 15:45:54 +01:00
|
|
|
#include <fsfw/thermal/ThermalComponentIF.h>
|
2023-02-26 21:26:49 +01:00
|
|
|
#include <fsfw_hal/devicehandlers/devicedefinitions/mgmLis3Helpers.h>
|
2022-06-16 07:00:09 +02:00
|
|
|
#include <linux/devices/devicedefinitions/StarTrackerDefinitions.h>
|
2022-06-01 10:48:18 +02:00
|
|
|
#include <mission/devices/devicedefinitions/BpxBatteryDefinitions.h>
|
|
|
|
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
|
|
|
|
#include <mission/devices/devicedefinitions/GyroL3GD20Definitions.h>
|
2022-06-16 07:00:09 +02:00
|
|
|
#include <mission/devices/devicedefinitions/SyrlinksDefinitions.h>
|
2023-02-26 14:55:33 +01:00
|
|
|
#include <mission/devices/devicedefinitions/gyroAdisHelpers.h>
|
2023-02-19 12:25:26 +01:00
|
|
|
#include <mission/devices/devicedefinitions/imtqHelpers.h>
|
2022-06-01 10:48:18 +02:00
|
|
|
#include <mission/devices/devicedefinitions/payloadPcduDefinitions.h>
|
2023-02-15 17:02:22 +01:00
|
|
|
#include <mission/devices/devicedefinitions/rwHelpers.h>
|
2022-06-16 07:00:09 +02:00
|
|
|
#include <objects/systemObjectList.h>
|
2022-05-19 23:08:54 +02:00
|
|
|
|
2022-11-23 19:38:30 +01:00
|
|
|
ThermalController::ThermalController(object_id_t objectId, HeaterHandler& heater)
|
2022-09-29 19:40:00 +02:00
|
|
|
: ExtendedControllerBase(objectId),
|
2022-11-24 16:40:59 +01:00
|
|
|
heaterHandler(heater),
|
2022-02-14 13:49:12 +01:00
|
|
|
sensorTemperatures(this),
|
2022-05-24 16:52:21 +02:00
|
|
|
susTemperatures(this),
|
2022-05-23 00:37:49 +02:00
|
|
|
deviceTemperatures(this),
|
2023-01-24 15:24:39 +01:00
|
|
|
heaterInfo(this),
|
2023-02-17 11:50:14 +01:00
|
|
|
imtqThermalSet(objects::IMTQ_HANDLER, ThermalStateCfg()),
|
2022-06-16 07:00:09 +02:00
|
|
|
max31865Set0(objects::RTD_0_IC3_PLOC_HEATSPREADER,
|
|
|
|
EiveMax31855::RtdCommands::EXCHANGE_SET_ID),
|
|
|
|
max31865Set1(objects::RTD_1_IC4_PLOC_MISSIONBOARD,
|
|
|
|
EiveMax31855::RtdCommands::EXCHANGE_SET_ID),
|
2022-05-30 14:32:50 +02:00
|
|
|
max31865Set2(objects::RTD_2_IC5_4K_CAMERA, EiveMax31855::RtdCommands::EXCHANGE_SET_ID),
|
|
|
|
max31865Set3(objects::RTD_3_IC6_DAC_HEATSPREADER, EiveMax31855::RtdCommands::EXCHANGE_SET_ID),
|
|
|
|
max31865Set4(objects::RTD_4_IC7_STARTRACKER, EiveMax31855::RtdCommands::EXCHANGE_SET_ID),
|
|
|
|
max31865Set5(objects::RTD_5_IC8_RW1_MX_MY, EiveMax31855::RtdCommands::EXCHANGE_SET_ID),
|
|
|
|
max31865Set6(objects::RTD_6_IC9_DRO, EiveMax31855::RtdCommands::EXCHANGE_SET_ID),
|
|
|
|
max31865Set7(objects::RTD_7_IC10_SCEX, EiveMax31855::RtdCommands::EXCHANGE_SET_ID),
|
|
|
|
max31865Set8(objects::RTD_8_IC11_X8, EiveMax31855::RtdCommands::EXCHANGE_SET_ID),
|
|
|
|
max31865Set9(objects::RTD_9_IC12_HPA, EiveMax31855::RtdCommands::EXCHANGE_SET_ID),
|
|
|
|
max31865Set10(objects::RTD_10_IC13_PL_TX, EiveMax31855::RtdCommands::EXCHANGE_SET_ID),
|
|
|
|
max31865Set11(objects::RTD_11_IC14_MPA, EiveMax31855::RtdCommands::EXCHANGE_SET_ID),
|
|
|
|
max31865Set12(objects::RTD_12_IC15_ACU, EiveMax31855::RtdCommands::EXCHANGE_SET_ID),
|
2022-06-16 07:00:09 +02:00
|
|
|
max31865Set13(objects::RTD_13_IC16_PLPCDU_HEATSPREADER,
|
|
|
|
EiveMax31855::RtdCommands::EXCHANGE_SET_ID),
|
2022-05-30 14:32:50 +02:00
|
|
|
max31865Set14(objects::RTD_14_IC17_TCS_BOARD, EiveMax31855::RtdCommands::EXCHANGE_SET_ID),
|
|
|
|
max31865Set15(objects::RTD_15_IC18_IMTQ, EiveMax31855::RtdCommands::EXCHANGE_SET_ID),
|
2022-11-14 10:04:41 +01:00
|
|
|
tmp1075SetTcs0(objects::TMP1075_HANDLER_TCS_0),
|
|
|
|
tmp1075SetTcs1(objects::TMP1075_HANDLER_TCS_1),
|
|
|
|
tmp1075SetPlPcdu0(objects::TMP1075_HANDLER_PLPCDU_0),
|
2023-01-09 11:57:48 +01:00
|
|
|
// damaged
|
|
|
|
// tmp1075SetPlPcdu1(objects::TMP1075_HANDLER_PLPCDU_1),
|
2022-11-14 10:04:41 +01:00
|
|
|
tmp1075SetIfBoard(objects::TMP1075_HANDLER_IF_BOARD),
|
2022-05-24 16:52:21 +02:00
|
|
|
susSet0(objects::SUS_0_N_LOC_XFYFZM_PT_XF),
|
|
|
|
susSet1(objects::SUS_1_N_LOC_XBYFZM_PT_XB),
|
|
|
|
susSet2(objects::SUS_2_N_LOC_XFYBZB_PT_YB),
|
|
|
|
susSet3(objects::SUS_3_N_LOC_XFYBZF_PT_YF),
|
|
|
|
susSet4(objects::SUS_4_N_LOC_XMYFZF_PT_ZF),
|
|
|
|
susSet5(objects::SUS_5_N_LOC_XFYMZB_PT_ZB),
|
|
|
|
susSet6(objects::SUS_6_R_LOC_XFYBZM_PT_XF),
|
|
|
|
susSet7(objects::SUS_7_R_LOC_XBYBZM_PT_XB),
|
|
|
|
susSet8(objects::SUS_8_R_LOC_XBYBZB_PT_YB),
|
|
|
|
susSet9(objects::SUS_9_R_LOC_XBYBZB_PT_YF),
|
|
|
|
susSet10(objects::SUS_10_N_LOC_XMYBZF_PT_ZF),
|
2023-02-06 17:10:09 +01:00
|
|
|
susSet11(objects::SUS_11_R_LOC_XBYMZB_PT_ZB) {
|
|
|
|
resetSensorsArray();
|
|
|
|
}
|
2021-01-08 09:34:43 +01:00
|
|
|
|
2022-05-19 00:40:42 +02:00
|
|
|
ReturnValue_t ThermalController::initialize() {
|
|
|
|
auto result = ExtendedControllerBase::initialize();
|
|
|
|
return result;
|
|
|
|
}
|
2022-02-10 18:54:09 +01:00
|
|
|
|
|
|
|
ReturnValue_t ThermalController::handleCommandMessage(CommandMessage* message) {
|
2022-08-24 17:27:47 +02:00
|
|
|
return returnvalue::FAILED;
|
2022-02-10 18:54:09 +01:00
|
|
|
}
|
2022-05-19 23:08:54 +02:00
|
|
|
|
2022-02-14 13:49:12 +01:00
|
|
|
void ThermalController::performControlOperation() {
|
2023-02-14 11:18:51 +01:00
|
|
|
#if OBSW_THREAD_TRACING == 1
|
|
|
|
trace::threadTrace(opCounter, "TCS Task");
|
|
|
|
#endif
|
2022-06-16 07:00:09 +02:00
|
|
|
switch (internalState) {
|
|
|
|
case InternalState::STARTUP: {
|
|
|
|
initialCountdown.resetTimer();
|
|
|
|
internalState = InternalState::INITIAL_DELAY;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
case InternalState::INITIAL_DELAY: {
|
|
|
|
if (initialCountdown.hasTimedOut()) {
|
|
|
|
internalState = InternalState::READY;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
case InternalState::READY: {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2022-02-14 13:49:12 +01:00
|
|
|
ReturnValue_t result = sensorTemperatures.read();
|
2022-08-24 17:27:47 +02:00
|
|
|
if (result == returnvalue::OK) {
|
2022-05-23 00:37:49 +02:00
|
|
|
copySensors();
|
|
|
|
sensorTemperatures.commit();
|
2022-02-14 13:49:12 +01:00
|
|
|
}
|
2022-05-19 23:08:54 +02:00
|
|
|
|
2022-05-24 16:52:21 +02:00
|
|
|
result = susTemperatures.read();
|
2022-08-24 17:27:47 +02:00
|
|
|
if (result == returnvalue::OK) {
|
2022-05-24 16:52:21 +02:00
|
|
|
copySus();
|
|
|
|
susTemperatures.commit();
|
|
|
|
}
|
|
|
|
|
2022-06-16 07:00:09 +02:00
|
|
|
result = deviceTemperatures.read();
|
2022-08-24 17:27:47 +02:00
|
|
|
if (result == returnvalue::OK) {
|
2022-06-16 07:00:09 +02:00
|
|
|
copyDevices();
|
|
|
|
deviceTemperatures.commit();
|
2022-02-14 13:49:12 +01:00
|
|
|
}
|
2023-01-24 15:46:20 +01:00
|
|
|
|
2023-02-21 02:28:57 +01:00
|
|
|
std::array<HeaterHandler::SwitchState, 8> heaterStates;
|
|
|
|
heaterHandler.getAllSwitchStates(heaterStates);
|
2023-01-24 15:46:20 +01:00
|
|
|
{
|
|
|
|
PoolReadGuard pg(&heaterInfo);
|
2023-02-21 02:28:57 +01:00
|
|
|
std::memcpy(heaterInfo.heaterSwitchState.value, heaterStates.data(), 8);
|
|
|
|
{
|
|
|
|
PoolReadGuard pg2(¤tVecPdu2);
|
|
|
|
if (pg.getReadResult() == returnvalue::OK and pg2.getReadResult() == returnvalue::OK) {
|
|
|
|
heaterInfo.heaterCurrent.value = currentVecPdu2.value[PDU2::Channels::TCS_HEATER_IN];
|
|
|
|
}
|
2023-01-24 15:46:20 +01:00
|
|
|
}
|
|
|
|
}
|
2023-02-08 21:41:19 +01:00
|
|
|
|
2023-02-10 14:02:27 +01:00
|
|
|
// performThermalModuleCtrl();
|
2022-02-14 13:49:12 +01:00
|
|
|
}
|
|
|
|
|
2022-02-10 18:54:09 +01:00
|
|
|
ReturnValue_t ThermalController::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
|
|
|
LocalDataPoolManager& poolManager) {
|
2023-02-21 01:53:23 +01:00
|
|
|
localDataPoolMap.emplace(tcsCtrl::SENSOR_PLOC_HEATSPREADER, new PoolEntry<float>({0.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SENSOR_PLOC_MISSIONBOARD, new PoolEntry<float>({1.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SENSOR_4K_CAMERA, new PoolEntry<float>({2.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SENSOR_DAC_HEATSPREADER, new PoolEntry<float>({3.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SENSOR_STARTRACKER, new PoolEntry<float>({4.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SENSOR_RW1, new PoolEntry<float>({5.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SENSOR_DRO, new PoolEntry<float>({6.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SENSOR_SCEX, new PoolEntry<float>({7.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SENSOR_X8, new PoolEntry<float>({8.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SENSOR_HPA, new PoolEntry<float>({9.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SENSOR_TX_MODUL, new PoolEntry<float>({10.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SENSOR_MPA, new PoolEntry<float>({11.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SENSOR_ACU, new PoolEntry<float>({12.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SENSOR_PLPCDU_HEATSPREADER, new PoolEntry<float>({13.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SENSOR_TCS_BOARD, new PoolEntry<float>({14.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SENSOR_MAGNETTORQUER, new PoolEntry<float>({15.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SENSOR_TMP1075_TCS_0, &tmp1075Tcs0);
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SENSOR_TMP1075_TCS_1, &tmp1075Tcs1);
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SENSOR_TMP1075_PLPCDU_0, &tmp1075PlPcdu0);
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SENSOR_TMP1075_PLPCDU_1, &tmp1075PlPcdu1);
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SENSOR_TMP1075_IF_BOARD, &tmp1075IfBrd);
|
|
|
|
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SUS_0_N_LOC_XFYFZM_PT_XF, new PoolEntry<float>({0.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SUS_6_R_LOC_XFYBZM_PT_XF, new PoolEntry<float>({0.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SUS_1_N_LOC_XBYFZM_PT_XB, new PoolEntry<float>({0.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SUS_7_R_LOC_XBYBZM_PT_XB, new PoolEntry<float>({0.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SUS_2_N_LOC_XFYBZB_PT_YB, new PoolEntry<float>({0.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SUS_8_R_LOC_XBYBZB_PT_YB, new PoolEntry<float>({0.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SUS_3_N_LOC_XFYBZF_PT_YF, new PoolEntry<float>({0.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SUS_9_R_LOC_XBYBZB_PT_YF, new PoolEntry<float>({0.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SUS_4_N_LOC_XMYFZF_PT_ZF, new PoolEntry<float>({0.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SUS_10_N_LOC_XMYBZF_PT_ZF, new PoolEntry<float>({0.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SUS_5_N_LOC_XFYMZB_PT_ZB, new PoolEntry<float>({0.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::SUS_11_R_LOC_XBYMZB_PT_ZB, new PoolEntry<float>({0.0}));
|
|
|
|
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::COMPONENT_RW, new PoolEntry<float>({0.0}));
|
|
|
|
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::TEMP_Q7S, new PoolEntry<float>({0.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::BATTERY_TEMP_1, new PoolEntry<int16_t>({0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::BATTERY_TEMP_2, new PoolEntry<int16_t>({0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::BATTERY_TEMP_3, new PoolEntry<int16_t>({0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::BATTERY_TEMP_4, new PoolEntry<int16_t>({0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::TEMP_RW1, new PoolEntry<int32_t>({0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::TEMP_RW2, new PoolEntry<int32_t>({0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::TEMP_RW3, new PoolEntry<int32_t>({0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::TEMP_RW4, new PoolEntry<int32_t>({0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::TEMP_STAR_TRACKER, new PoolEntry<float>({0.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::TEMP_SYRLINKS_POWER_AMPLIFIER, new PoolEntry<float>({0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::TEMP_SYRLINKS_BASEBAND_BOARD, new PoolEntry<float>({0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::TEMP_MGT, new PoolEntry<int16_t>({0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::TEMP_ACU, new PoolEntry<float>({0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::TEMP_PDU1, new PoolEntry<float>({0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::TEMP_PDU2, new PoolEntry<float>({0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::TEMP_1_P60DOCK, new PoolEntry<float>({0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::TEMP_2_P60DOCK, new PoolEntry<float>({0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::TEMP_GYRO_0_SIDE_A, new PoolEntry<float>({0.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::TEMP_GYRO_1_SIDE_A, new PoolEntry<float>({0.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::TEMP_GYRO_2_SIDE_B, new PoolEntry<float>({0.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::TEMP_GYRO_3_SIDE_B, new PoolEntry<float>({0.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::TEMP_MGM_0_SIDE_A, new PoolEntry<float>({0.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::TEMP_MGM_2_SIDE_B, new PoolEntry<float>({0.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::TEMP_ADC_PAYLOAD_PCDU, new PoolEntry<float>({0.0}));
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::HEATER_SWITCH_LIST, &heaterSwitchStates);
|
|
|
|
localDataPoolMap.emplace(tcsCtrl::HEATER_CURRENT, &heaterCurrent);
|
2022-06-01 10:48:18 +02:00
|
|
|
|
2022-08-15 11:57:57 +02:00
|
|
|
poolManager.subscribeForRegularPeriodicPacket(
|
|
|
|
subdp::RegularHkPeriodicParams(sensorTemperatures.getSid(), false, 10.0));
|
|
|
|
poolManager.subscribeForRegularPeriodicPacket(
|
|
|
|
subdp::RegularHkPeriodicParams(susTemperatures.getSid(), false, 10.0));
|
|
|
|
poolManager.subscribeForRegularPeriodicPacket(
|
|
|
|
subdp::RegularHkPeriodicParams(deviceTemperatures.getSid(), false, 10.0));
|
2023-01-24 15:35:56 +01:00
|
|
|
poolManager.subscribeForDiagPeriodicPacket(
|
|
|
|
subdp::DiagnosticsHkPeriodicParams(heaterInfo.getSid(), false, 10.0));
|
2022-08-24 17:27:47 +02:00
|
|
|
return returnvalue::OK;
|
2022-02-10 18:54:09 +01:00
|
|
|
}
|
2022-05-19 00:40:42 +02:00
|
|
|
|
|
|
|
LocalPoolDataSetBase* ThermalController::getDataSetHandle(sid_t sid) {
|
|
|
|
switch (sid.ownerSetId) {
|
2023-02-21 01:53:23 +01:00
|
|
|
case tcsCtrl::SENSOR_TEMPERATURES:
|
2022-05-19 00:40:42 +02:00
|
|
|
return &sensorTemperatures;
|
2023-02-21 01:53:23 +01:00
|
|
|
case tcsCtrl::SUS_TEMPERATURES:
|
2022-05-24 16:52:21 +02:00
|
|
|
return &susTemperatures;
|
2023-02-21 01:53:23 +01:00
|
|
|
case tcsCtrl::DEVICE_TEMPERATURES:
|
2022-06-16 07:00:09 +02:00
|
|
|
return &deviceTemperatures;
|
2023-02-21 01:53:23 +01:00
|
|
|
case tcsCtrl::HEATER_SET:
|
|
|
|
return &heaterInfo;
|
2022-05-19 00:40:42 +02:00
|
|
|
default:
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
}
|
2022-02-10 18:54:09 +01:00
|
|
|
|
|
|
|
ReturnValue_t ThermalController::checkModeCommand(Mode_t mode, Submode_t submode,
|
|
|
|
uint32_t* msToReachTheMode) {
|
2022-02-14 13:49:12 +01:00
|
|
|
if (submode != SUBMODE_NONE) {
|
|
|
|
return INVALID_SUBMODE;
|
|
|
|
}
|
|
|
|
if ((mode != MODE_OFF) && (mode != MODE_ON) && (mode != MODE_NORMAL)) {
|
2022-03-08 09:48:18 +01:00
|
|
|
return INVALID_MODE;
|
2022-02-14 13:49:12 +01:00
|
|
|
}
|
2022-08-24 17:27:47 +02:00
|
|
|
return returnvalue::OK;
|
2022-03-08 09:37:23 +01:00
|
|
|
}
|
2022-05-19 23:08:54 +02:00
|
|
|
|
|
|
|
void ThermalController::copySensors() {
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg0(&max31865Set0, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg0.getReadResult() == returnvalue::OK) {
|
|
|
|
sensorTemperatures.sensor_ploc_heatspreader.value = max31865Set0.temperatureCelcius.value;
|
2022-10-11 22:58:31 +02:00
|
|
|
sensorTemperatures.sensor_ploc_heatspreader.setValid(
|
|
|
|
max31865Set0.temperatureCelcius.isValid());
|
2022-10-10 18:29:06 +02:00
|
|
|
if (not sensorTemperatures.sensor_ploc_heatspreader.isValid()) {
|
|
|
|
sensorTemperatures.sensor_ploc_heatspreader.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
2022-05-19 23:08:54 +02:00
|
|
|
}
|
2022-05-23 00:37:49 +02:00
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg1(&max31865Set1, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg1.getReadResult() == returnvalue::OK) {
|
|
|
|
sensorTemperatures.sensor_ploc_missionboard.value = max31865Set1.temperatureCelcius.value;
|
2022-10-11 22:58:31 +02:00
|
|
|
sensorTemperatures.sensor_ploc_missionboard.setValid(
|
|
|
|
max31865Set1.temperatureCelcius.isValid());
|
2022-10-10 18:29:06 +02:00
|
|
|
if (not sensorTemperatures.sensor_ploc_missionboard.isValid()) {
|
|
|
|
sensorTemperatures.sensor_ploc_missionboard.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
2022-05-19 23:08:54 +02:00
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg2(&max31865Set2, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg2.getReadResult() == returnvalue::OK) {
|
|
|
|
sensorTemperatures.sensor_4k_camera.value = max31865Set2.temperatureCelcius.value;
|
|
|
|
sensorTemperatures.sensor_4k_camera.setValid(max31865Set2.temperatureCelcius.isValid());
|
|
|
|
if (not sensorTemperatures.sensor_4k_camera.isValid()) {
|
|
|
|
sensorTemperatures.sensor_4k_camera.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
2022-05-19 23:08:54 +02:00
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg3(&max31865Set3, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg3.getReadResult() == returnvalue::OK) {
|
|
|
|
sensorTemperatures.sensor_dac_heatspreader.value = max31865Set3.temperatureCelcius.value;
|
2022-10-11 22:58:31 +02:00
|
|
|
sensorTemperatures.sensor_dac_heatspreader.setValid(
|
|
|
|
max31865Set3.temperatureCelcius.isValid());
|
2022-10-10 18:29:06 +02:00
|
|
|
if (not sensorTemperatures.sensor_dac_heatspreader.isValid()) {
|
|
|
|
sensorTemperatures.sensor_dac_heatspreader.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
2022-05-19 23:08:54 +02:00
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg4(&max31865Set4, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg4.getReadResult() == returnvalue::OK) {
|
|
|
|
sensorTemperatures.sensor_startracker.value = max31865Set4.temperatureCelcius.value;
|
|
|
|
sensorTemperatures.sensor_startracker.setValid(max31865Set4.temperatureCelcius.isValid());
|
|
|
|
if (not sensorTemperatures.sensor_startracker.isValid()) {
|
|
|
|
sensorTemperatures.sensor_startracker.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
2022-05-19 23:08:54 +02:00
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg5(&max31865Set5, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg5.getReadResult() == returnvalue::OK) {
|
|
|
|
sensorTemperatures.sensor_rw1.value = max31865Set5.temperatureCelcius.value;
|
|
|
|
sensorTemperatures.sensor_rw1.setValid(max31865Set5.temperatureCelcius.isValid());
|
|
|
|
if (not sensorTemperatures.sensor_rw1.isValid()) {
|
|
|
|
sensorTemperatures.sensor_rw1.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
2022-05-19 23:08:54 +02:00
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg6(&max31865Set6, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg6.getReadResult() == returnvalue::OK) {
|
|
|
|
sensorTemperatures.sensor_dro.value = max31865Set6.temperatureCelcius.value;
|
|
|
|
sensorTemperatures.sensor_dro.setValid(max31865Set6.temperatureCelcius.isValid());
|
|
|
|
if (not sensorTemperatures.sensor_dro.isValid()) {
|
|
|
|
sensorTemperatures.sensor_dro.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
2022-05-19 23:08:54 +02:00
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg7(&max31865Set7, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg7.getReadResult() == returnvalue::OK) {
|
|
|
|
sensorTemperatures.sensor_scex.value = max31865Set7.temperatureCelcius.value;
|
|
|
|
sensorTemperatures.sensor_scex.setValid(max31865Set7.temperatureCelcius.isValid());
|
|
|
|
if (not sensorTemperatures.sensor_scex.isValid()) {
|
|
|
|
sensorTemperatures.sensor_scex.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
2022-05-19 23:08:54 +02:00
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg8(&max31865Set8, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg8.getReadResult() == returnvalue::OK) {
|
|
|
|
sensorTemperatures.sensor_x8.value = max31865Set8.temperatureCelcius.value;
|
|
|
|
sensorTemperatures.sensor_x8.setValid(max31865Set8.temperatureCelcius.isValid());
|
|
|
|
if (not sensorTemperatures.sensor_x8.isValid()) {
|
|
|
|
sensorTemperatures.sensor_x8.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
2022-05-19 23:08:54 +02:00
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg9(&max31865Set9, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg9.getReadResult() == returnvalue::OK) {
|
|
|
|
sensorTemperatures.sensor_hpa.value = max31865Set9.temperatureCelcius.value;
|
|
|
|
sensorTemperatures.sensor_hpa.setValid(max31865Set9.temperatureCelcius.isValid());
|
|
|
|
if (not sensorTemperatures.sensor_hpa.isValid()) {
|
|
|
|
sensorTemperatures.sensor_hpa.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
2022-05-19 23:08:54 +02:00
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg10(&max31865Set10, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg10.getReadResult() == returnvalue::OK) {
|
|
|
|
sensorTemperatures.sensor_tx_modul.value = max31865Set10.temperatureCelcius.value;
|
|
|
|
sensorTemperatures.sensor_tx_modul.setValid(max31865Set10.temperatureCelcius.isValid());
|
|
|
|
if (not sensorTemperatures.sensor_tx_modul.isValid()) {
|
|
|
|
sensorTemperatures.sensor_tx_modul.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
2022-05-19 23:08:54 +02:00
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg11(&max31865Set11, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg11.getReadResult() == returnvalue::OK) {
|
|
|
|
sensorTemperatures.sensor_mpa.value = max31865Set11.temperatureCelcius.value;
|
|
|
|
sensorTemperatures.sensor_mpa.setValid(max31865Set11.temperatureCelcius.isValid());
|
|
|
|
if (not sensorTemperatures.sensor_mpa.isValid()) {
|
|
|
|
sensorTemperatures.sensor_mpa.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
2022-05-19 23:08:54 +02:00
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg12(&max31865Set12, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg12.getReadResult() == returnvalue::OK) {
|
|
|
|
sensorTemperatures.sensor_acu.value = max31865Set12.temperatureCelcius.value;
|
|
|
|
sensorTemperatures.sensor_acu.setValid(max31865Set12.temperatureCelcius.isValid());
|
|
|
|
if (not sensorTemperatures.sensor_acu.isValid()) {
|
|
|
|
sensorTemperatures.sensor_acu.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
2022-05-19 23:08:54 +02:00
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg13(&max31865Set13, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg13.getReadResult() == returnvalue::OK) {
|
|
|
|
sensorTemperatures.sensor_plpcdu_heatspreader.value = max31865Set13.temperatureCelcius.value;
|
|
|
|
sensorTemperatures.sensor_plpcdu_heatspreader.setValid(
|
|
|
|
max31865Set13.temperatureCelcius.isValid());
|
|
|
|
if (not sensorTemperatures.sensor_plpcdu_heatspreader.isValid()) {
|
|
|
|
sensorTemperatures.sensor_plpcdu_heatspreader.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
2022-05-19 23:08:54 +02:00
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg14(&max31865Set14, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg14.getReadResult() == returnvalue::OK) {
|
|
|
|
sensorTemperatures.sensor_tcs_board.value = max31865Set14.temperatureCelcius.value;
|
|
|
|
sensorTemperatures.sensor_tcs_board.setValid(max31865Set14.temperatureCelcius.isValid());
|
|
|
|
if (not sensorTemperatures.sensor_tcs_board.isValid()) {
|
|
|
|
sensorTemperatures.sensor_tcs_board.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
2022-05-19 23:08:54 +02:00
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg15(&max31865Set15, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg15.getReadResult() == returnvalue::OK) {
|
|
|
|
sensorTemperatures.sensor_magnettorquer.value = max31865Set15.temperatureCelcius.value;
|
|
|
|
sensorTemperatures.sensor_magnettorquer.setValid(max31865Set15.temperatureCelcius.isValid());
|
|
|
|
if (not sensorTemperatures.sensor_magnettorquer.isValid()) {
|
|
|
|
sensorTemperatures.sensor_magnettorquer.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
2022-05-19 23:08:54 +02:00
|
|
|
}
|
2022-10-10 18:29:06 +02:00
|
|
|
|
|
|
|
{
|
2022-11-14 10:04:41 +01:00
|
|
|
PoolReadGuard pg(&tmp1075SetTcs0, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() == returnvalue::OK) {
|
|
|
|
sensorTemperatures.tmp1075Tcs0.value = tmp1075SetTcs0.temperatureCelcius.value;
|
|
|
|
sensorTemperatures.tmp1075Tcs0.setValid(tmp1075SetTcs0.temperatureCelcius.isValid());
|
|
|
|
if (not tmp1075SetTcs0.temperatureCelcius.isValid()) {
|
|
|
|
sensorTemperatures.tmp1075Tcs0.value = INVALID_TEMPERATURE;
|
2022-10-10 18:29:06 +02:00
|
|
|
}
|
2022-05-23 00:37:49 +02:00
|
|
|
}
|
|
|
|
}
|
2022-10-10 18:29:06 +02:00
|
|
|
|
|
|
|
{
|
2022-11-14 10:04:41 +01:00
|
|
|
PoolReadGuard pg(&tmp1075SetTcs1, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() == returnvalue::OK) {
|
|
|
|
sensorTemperatures.tmp1075Tcs1.value = tmp1075SetTcs1.temperatureCelcius.value;
|
|
|
|
sensorTemperatures.tmp1075Tcs1.setValid(tmp1075SetTcs1.temperatureCelcius.isValid());
|
|
|
|
if (not tmp1075SetTcs1.temperatureCelcius.isValid()) {
|
|
|
|
sensorTemperatures.tmp1075Tcs1.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&tmp1075SetPlPcdu0, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() == returnvalue::OK) {
|
|
|
|
sensorTemperatures.tmp1075PlPcdu0.value = tmp1075SetPlPcdu0.temperatureCelcius.value;
|
|
|
|
sensorTemperatures.tmp1075PlPcdu0.setValid(tmp1075SetPlPcdu0.temperatureCelcius.isValid());
|
|
|
|
if (not tmp1075SetPlPcdu0.temperatureCelcius.isValid()) {
|
|
|
|
sensorTemperatures.tmp1075PlPcdu0.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-01-09 11:57:48 +01:00
|
|
|
// damaged
|
|
|
|
/*
|
2022-11-14 10:04:41 +01:00
|
|
|
{
|
|
|
|
PoolReadGuard pg(&tmp1075SetPlPcdu1, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() == returnvalue::OK) {
|
|
|
|
sensorTemperatures.tmp1075PlPcdu1.value = tmp1075SetPlPcdu1.temperatureCelcius.value;
|
|
|
|
sensorTemperatures.tmp1075PlPcdu1.setValid(tmp1075SetPlPcdu1.temperatureCelcius.isValid());
|
|
|
|
if (not tmp1075SetPlPcdu1.temperatureCelcius.isValid()) {
|
|
|
|
sensorTemperatures.tmp1075PlPcdu1.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-01-09 11:57:48 +01:00
|
|
|
*/
|
2022-11-14 10:04:41 +01:00
|
|
|
{
|
|
|
|
PoolReadGuard pg(&tmp1075SetIfBoard, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() == returnvalue::OK) {
|
|
|
|
sensorTemperatures.tmp1075IfBrd.value = tmp1075SetIfBoard.temperatureCelcius.value;
|
|
|
|
sensorTemperatures.tmp1075IfBrd.setValid(tmp1075SetIfBoard.temperatureCelcius.isValid());
|
|
|
|
if (not tmp1075SetIfBoard.temperatureCelcius.isValid()) {
|
|
|
|
sensorTemperatures.tmp1075IfBrd.value = INVALID_TEMPERATURE;
|
2022-10-10 18:29:06 +02:00
|
|
|
}
|
2022-05-23 00:37:49 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-24 16:52:21 +02:00
|
|
|
void ThermalController::copySus() {
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg0(&susSet0, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg0.getReadResult() == returnvalue::OK) {
|
2023-03-01 16:36:21 +01:00
|
|
|
susTemperatures.sus_0_n_loc_xfyfzm_pt_xf.value = susSet0.tempC.value;
|
|
|
|
susTemperatures.sus_0_n_loc_xfyfzm_pt_xf.setValid(susSet0.tempC.isValid());
|
2022-10-10 18:29:06 +02:00
|
|
|
if (not susTemperatures.sus_0_n_loc_xfyfzm_pt_xf.isValid()) {
|
|
|
|
susTemperatures.sus_0_n_loc_xfyfzm_pt_xf.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg1(&susSet1, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg1.getReadResult() == returnvalue::OK) {
|
2023-03-01 16:36:21 +01:00
|
|
|
susTemperatures.sus_6_r_loc_xfybzm_pt_xf.value = susSet1.tempC.value;
|
|
|
|
susTemperatures.sus_6_r_loc_xfybzm_pt_xf.setValid(susSet1.tempC.isValid());
|
2022-10-10 18:29:06 +02:00
|
|
|
if (not susTemperatures.sus_6_r_loc_xfybzm_pt_xf.isValid()) {
|
|
|
|
susTemperatures.sus_6_r_loc_xfybzm_pt_xf.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg2(&susSet2, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg2.getReadResult() == returnvalue::OK) {
|
2023-03-01 16:36:21 +01:00
|
|
|
susTemperatures.sus_1_n_loc_xbyfzm_pt_xb.value = susSet2.tempC.value;
|
|
|
|
susTemperatures.sus_1_n_loc_xbyfzm_pt_xb.setValid(susSet2.tempC.isValid());
|
2022-10-10 18:29:06 +02:00
|
|
|
if (not susTemperatures.sus_1_n_loc_xbyfzm_pt_xb.isValid()) {
|
|
|
|
susTemperatures.sus_1_n_loc_xbyfzm_pt_xb.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg3(&susSet3, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg3.getReadResult() == returnvalue::OK) {
|
2023-03-01 16:36:21 +01:00
|
|
|
susTemperatures.sus_7_r_loc_xbybzm_pt_xb.value = susSet3.tempC.value;
|
|
|
|
susTemperatures.sus_7_r_loc_xbybzm_pt_xb.setValid(susSet3.tempC.isValid());
|
2022-10-10 18:29:06 +02:00
|
|
|
if (not susTemperatures.sus_7_r_loc_xbybzm_pt_xb.isValid()) {
|
|
|
|
susTemperatures.sus_7_r_loc_xbybzm_pt_xb.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg4(&susSet4, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg4.getReadResult() == returnvalue::OK) {
|
2023-03-01 16:36:21 +01:00
|
|
|
susTemperatures.sus_2_n_loc_xfybzb_pt_yb.value = susSet4.tempC.value;
|
|
|
|
susTemperatures.sus_2_n_loc_xfybzb_pt_yb.setValid(susSet4.tempC.isValid());
|
2022-10-10 18:29:06 +02:00
|
|
|
if (not susTemperatures.sus_2_n_loc_xfybzb_pt_yb.isValid()) {
|
|
|
|
susTemperatures.sus_2_n_loc_xfybzb_pt_yb.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg5(&susSet5, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg5.getReadResult() == returnvalue::OK) {
|
2023-03-01 16:36:21 +01:00
|
|
|
susTemperatures.sus_8_r_loc_xbybzb_pt_yb.value = susSet5.tempC.value;
|
|
|
|
susTemperatures.sus_8_r_loc_xbybzb_pt_yb.setValid(susSet5.tempC.isValid());
|
2022-10-10 18:29:06 +02:00
|
|
|
if (not susTemperatures.sus_8_r_loc_xbybzb_pt_yb.isValid()) {
|
|
|
|
susTemperatures.sus_8_r_loc_xbybzb_pt_yb.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg6(&susSet6, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg6.getReadResult() == returnvalue::OK) {
|
2023-03-01 16:36:21 +01:00
|
|
|
susTemperatures.sus_3_n_loc_xfybzf_pt_yf.value = susSet6.tempC.value;
|
|
|
|
susTemperatures.sus_3_n_loc_xfybzf_pt_yf.setValid(susSet6.tempC.isValid());
|
2022-10-10 18:29:06 +02:00
|
|
|
if (not susTemperatures.sus_3_n_loc_xfybzf_pt_yf.isValid()) {
|
|
|
|
susTemperatures.sus_3_n_loc_xfybzf_pt_yf.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg7(&susSet7, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg7.getReadResult() == returnvalue::OK) {
|
2023-03-01 16:36:21 +01:00
|
|
|
susTemperatures.sus_9_r_loc_xbybzb_pt_yf.value = susSet7.tempC.value;
|
|
|
|
susTemperatures.sus_9_r_loc_xbybzb_pt_yf.setValid(susSet7.tempC.isValid());
|
2022-10-10 18:29:06 +02:00
|
|
|
if (not susTemperatures.sus_9_r_loc_xbybzb_pt_yf.isValid()) {
|
|
|
|
susTemperatures.sus_9_r_loc_xbybzb_pt_yf.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg8(&susSet8, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg8.getReadResult() == returnvalue::OK) {
|
2023-03-01 16:36:21 +01:00
|
|
|
susTemperatures.sus_4_n_loc_xmyfzf_pt_zf.value = susSet8.tempC.value;
|
|
|
|
susTemperatures.sus_4_n_loc_xmyfzf_pt_zf.setValid(susSet8.tempC.isValid());
|
2022-10-10 18:29:06 +02:00
|
|
|
if (not susTemperatures.sus_4_n_loc_xmyfzf_pt_zf.isValid()) {
|
|
|
|
susTemperatures.sus_4_n_loc_xmyfzf_pt_zf.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg9(&susSet9, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg9.getReadResult() == returnvalue::OK) {
|
2023-03-01 16:36:21 +01:00
|
|
|
susTemperatures.sus_10_n_loc_xmybzf_pt_zf.value = susSet9.tempC.value;
|
|
|
|
susTemperatures.sus_10_n_loc_xmybzf_pt_zf.setValid(susSet9.tempC.isValid());
|
2022-10-10 18:29:06 +02:00
|
|
|
if (not susTemperatures.sus_10_n_loc_xmybzf_pt_zf.isValid()) {
|
|
|
|
susTemperatures.sus_10_n_loc_xmybzf_pt_zf.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg10(&susSet10, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg10.getReadResult() == returnvalue::OK) {
|
2023-03-01 16:36:21 +01:00
|
|
|
susTemperatures.sus_5_n_loc_xfymzb_pt_zb.value = susSet10.tempC.value;
|
|
|
|
susTemperatures.sus_5_n_loc_xfymzb_pt_zb.setValid(susSet10.tempC.isValid());
|
2022-10-10 18:29:06 +02:00
|
|
|
if (not susTemperatures.sus_5_n_loc_xfymzb_pt_zb.isValid()) {
|
|
|
|
susTemperatures.sus_5_n_loc_xfymzb_pt_zb.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-10 18:29:06 +02:00
|
|
|
{
|
2022-10-18 14:08:26 +02:00
|
|
|
PoolReadGuard pg11(&susSet11, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-10-10 18:29:06 +02:00
|
|
|
if (pg11.getReadResult() == returnvalue::OK) {
|
2023-03-01 16:36:21 +01:00
|
|
|
susTemperatures.sus_11_r_loc_xbymzb_pt_zb.value = susSet11.tempC.value;
|
|
|
|
susTemperatures.sus_11_r_loc_xbymzb_pt_zb.setValid(susSet11.tempC.isValid());
|
2022-10-10 18:29:06 +02:00
|
|
|
if (not susTemperatures.sus_11_r_loc_xbymzb_pt_zb.isValid()) {
|
|
|
|
susTemperatures.sus_11_r_loc_xbymzb_pt_zb.value = INVALID_TEMPERATURE;
|
|
|
|
}
|
2022-05-24 16:52:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-01 10:48:18 +02:00
|
|
|
void ThermalController::copyDevices() {
|
2022-11-03 16:13:53 +01:00
|
|
|
{
|
|
|
|
PoolReadGuard pg(&tempQ7s, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
2022-11-03 16:14:57 +01:00
|
|
|
if (pg.getReadResult() == returnvalue::OK) {
|
2022-11-03 16:13:53 +01:00
|
|
|
deviceTemperatures.q7s = tempQ7s;
|
|
|
|
deviceTemperatures.q7s.setValid(tempQ7s.isValid());
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.q7s.setValid(false);
|
|
|
|
deviceTemperatures.q7s = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&battTemp1, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read battery temperature 1" << std::endl;
|
|
|
|
deviceTemperatures.batteryTemp1.setValid(false);
|
|
|
|
deviceTemperatures.batteryTemp1 = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.batteryTemp1 = battTemp1;
|
|
|
|
deviceTemperatures.batteryTemp1.setValid(battTemp1.isValid());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&battTemp2, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read battery temperature 2" << std::endl;
|
|
|
|
deviceTemperatures.batteryTemp2.setValid(false);
|
|
|
|
deviceTemperatures.batteryTemp2 = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.batteryTemp2 = battTemp2;
|
|
|
|
deviceTemperatures.batteryTemp2.setValid(battTemp2.isValid());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&battTemp3, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read battery temperature 3" << std::endl;
|
|
|
|
deviceTemperatures.batteryTemp3.setValid(false);
|
|
|
|
deviceTemperatures.batteryTemp3 = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.batteryTemp3 = battTemp3;
|
|
|
|
deviceTemperatures.batteryTemp3.setValid(battTemp3.isValid());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&battTemp4, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read battery temperature 4" << std::endl;
|
|
|
|
deviceTemperatures.batteryTemp4.setValid(false);
|
|
|
|
deviceTemperatures.batteryTemp4 = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.batteryTemp4 = battTemp4;
|
|
|
|
deviceTemperatures.batteryTemp4.setValid(battTemp4.isValid());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&tempRw1, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read reaction wheel 1 temperature" << std::endl;
|
|
|
|
deviceTemperatures.rw1.setValid(false);
|
|
|
|
deviceTemperatures.rw1 = static_cast<int32_t>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.rw1.setValid(tempRw1.isValid());
|
|
|
|
deviceTemperatures.rw1 = tempRw1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&tempRw2, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read reaction wheel 2 temperature" << std::endl;
|
|
|
|
deviceTemperatures.rw2.setValid(false);
|
|
|
|
deviceTemperatures.rw2 = static_cast<int32_t>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.rw2.setValid(tempRw2.isValid());
|
|
|
|
deviceTemperatures.rw2 = tempRw2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&tempRw3, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read reaction wheel 3 temperature" << std::endl;
|
|
|
|
deviceTemperatures.rw3.setValid(false);
|
|
|
|
deviceTemperatures.rw3 = static_cast<int32_t>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.rw3.setValid(tempRw3.isValid());
|
|
|
|
deviceTemperatures.rw3 = tempRw3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&tempRw4, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read reaction wheel 4 temperature" << std::endl;
|
|
|
|
deviceTemperatures.rw4.setValid(false);
|
|
|
|
deviceTemperatures.rw4 = static_cast<int32_t>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.rw4.setValid(tempRw4.isValid());
|
|
|
|
deviceTemperatures.rw4 = tempRw4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&tempStartracker, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read startracker temperature" << std::endl;
|
|
|
|
deviceTemperatures.startracker.setValid(false);
|
|
|
|
deviceTemperatures.startracker = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.startracker.setValid(tempStartracker.isValid());
|
|
|
|
deviceTemperatures.startracker = tempStartracker;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&tempSyrlinksPowerAmplifier, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read syrlinks power amplifier temperature"
|
|
|
|
<< std::endl;
|
|
|
|
deviceTemperatures.syrlinksPowerAmplifier.setValid(false);
|
|
|
|
deviceTemperatures.syrlinksPowerAmplifier = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.syrlinksPowerAmplifier.setValid(tempSyrlinksPowerAmplifier.isValid());
|
|
|
|
deviceTemperatures.syrlinksPowerAmplifier = tempSyrlinksPowerAmplifier;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&tempSyrlinksBasebandBoard, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read syrlinks baseband board temperature"
|
|
|
|
<< std::endl;
|
|
|
|
deviceTemperatures.syrlinksBasebandBoard.setValid(false);
|
|
|
|
deviceTemperatures.syrlinksBasebandBoard = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.syrlinksBasebandBoard.setValid(tempSyrlinksBasebandBoard.isValid());
|
|
|
|
deviceTemperatures.syrlinksBasebandBoard = tempSyrlinksBasebandBoard;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&tempMgt, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read MGT temperature" << std::endl;
|
|
|
|
deviceTemperatures.mgt.setValid(false);
|
|
|
|
deviceTemperatures.mgt = static_cast<int16_t>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.mgt.setValid(tempMgt.isValid());
|
|
|
|
deviceTemperatures.mgt = tempMgt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&tempAcu, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read ACU temperatures" << std::endl;
|
|
|
|
deviceTemperatures.acu.setValid(false);
|
|
|
|
deviceTemperatures.acu[0] = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
deviceTemperatures.acu[1] = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
deviceTemperatures.acu[2] = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.acu.setValid(tempAcu.isValid());
|
|
|
|
deviceTemperatures.acu = tempAcu;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&tempPdu1, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read PDU1 temperature" << std::endl;
|
|
|
|
deviceTemperatures.pdu1.setValid(false);
|
|
|
|
deviceTemperatures.pdu1 = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.pdu1.setValid(tempPdu1.isValid());
|
|
|
|
deviceTemperatures.pdu1 = tempPdu1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&tempPdu2, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read PDU2 temperature" << std::endl;
|
|
|
|
deviceTemperatures.pdu2.setValid(false);
|
|
|
|
deviceTemperatures.pdu2 = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.pdu2.setValid(tempPdu2.isValid());
|
|
|
|
deviceTemperatures.pdu2 = tempPdu2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&temp1P60dock, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read P60 dock temperature 1" << std::endl;
|
|
|
|
deviceTemperatures.temp1P60dock.setValid(false);
|
|
|
|
deviceTemperatures.temp1P60dock = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.temp1P60dock.setValid(temp1P60dock.isValid());
|
|
|
|
deviceTemperatures.temp1P60dock = temp1P60dock;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&temp2P60dock, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read P60 dock temperature 2" << std::endl;
|
|
|
|
deviceTemperatures.temp2P60dock.setValid(false);
|
|
|
|
deviceTemperatures.temp2P60dock = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.temp2P60dock.setValid(temp2P60dock.isValid());
|
|
|
|
deviceTemperatures.temp2P60dock = temp2P60dock;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&tempGyro0, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read gyro 0 temperature" << std::endl;
|
|
|
|
deviceTemperatures.gyro0SideA.setValid(false);
|
|
|
|
deviceTemperatures.gyro0SideA = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.gyro0SideA.setValid(tempGyro0.isValid());
|
|
|
|
deviceTemperatures.gyro0SideA = tempGyro0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&tempGyro1, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read gyro 1 temperature" << std::endl;
|
|
|
|
deviceTemperatures.gyro1SideA.setValid(false);
|
|
|
|
deviceTemperatures.gyro1SideA = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.gyro1SideA.setValid(tempGyro1.isValid());
|
|
|
|
deviceTemperatures.gyro1SideA = tempGyro1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&tempGyro2, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read gyro 2 temperature" << std::endl;
|
|
|
|
deviceTemperatures.gyro2SideB.setValid(false);
|
|
|
|
deviceTemperatures.gyro2SideB = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.gyro2SideB.setValid(tempGyro2.isValid());
|
|
|
|
deviceTemperatures.gyro2SideB = tempGyro2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&tempGyro3, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read gyro 3 temperature" << std::endl;
|
|
|
|
deviceTemperatures.gyro3SideB.setValid(false);
|
|
|
|
deviceTemperatures.gyro3SideB = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.gyro3SideB.setValid(tempGyro3.isValid());
|
|
|
|
deviceTemperatures.gyro3SideB = tempGyro3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&tempMgm0, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read MGM 0 temperature" << std::endl;
|
|
|
|
deviceTemperatures.mgm0SideA.setValid(false);
|
|
|
|
deviceTemperatures.mgm0SideA = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.mgm0SideA.setValid(tempMgm0.isValid());
|
|
|
|
deviceTemperatures.mgm0SideA = tempMgm0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&tempMgm2, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read MGM 2 temperature" << std::endl;
|
|
|
|
deviceTemperatures.mgm2SideB.setValid(false);
|
|
|
|
deviceTemperatures.mgm2SideB = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.mgm2SideB.setValid(tempMgm2.isValid());
|
|
|
|
deviceTemperatures.mgm2SideB = tempMgm2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
PoolReadGuard pg(&tempAdcPayloadPcdu, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
sif::warning << "ThermalController: Failed to read payload PCDU ADC temperature" << std::endl;
|
|
|
|
deviceTemperatures.adcPayloadPcdu.setValid(false);
|
|
|
|
deviceTemperatures.adcPayloadPcdu = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
} else {
|
|
|
|
deviceTemperatures.adcPayloadPcdu.setValid(tempAdcPayloadPcdu.isValid());
|
|
|
|
deviceTemperatures.adcPayloadPcdu = tempAdcPayloadPcdu;
|
|
|
|
}
|
2022-06-01 10:48:18 +02:00
|
|
|
}
|
|
|
|
}
|
2022-11-28 17:40:29 +01:00
|
|
|
|
2022-12-19 18:30:22 +01:00
|
|
|
void ThermalController::ctrlAcsBoard() {
|
2023-02-07 14:28:42 +01:00
|
|
|
// TODO: check
|
2023-01-22 20:37:51 +01:00
|
|
|
heater::Switchers switchNr = heater::HEATER_2_ACS_BRD;
|
|
|
|
heater::Switchers redSwitchNr = heater::HEATER_0_OBC_BRD;
|
|
|
|
|
2023-02-07 14:28:42 +01:00
|
|
|
// A side
|
|
|
|
sensors[0].first = deviceTemperatures.gyro0SideA.isValid();
|
|
|
|
sensors[0].second = deviceTemperatures.gyro0SideA.value;
|
|
|
|
sensors[1].first = deviceTemperatures.mgm0SideA.isValid();
|
|
|
|
sensors[1].second = deviceTemperatures.mgm0SideA.value;
|
|
|
|
sensors[2].first = deviceTemperatures.gyro1SideA.isValid();
|
|
|
|
sensors[2].second = deviceTemperatures.gyro1SideA.value;
|
|
|
|
sensors[3].first = sensorTemperatures.sensor_tcs_board.isValid();
|
|
|
|
sensors[3].second = sensorTemperatures.sensor_tcs_board.value;
|
|
|
|
numSensors = 4;
|
|
|
|
if (selectAndReadSensorTemp()) {
|
|
|
|
if (chooseHeater(switchNr, redSwitchNr)) {
|
2023-02-06 21:13:17 +01:00
|
|
|
ctrlHeater(switchNr, redSwitchNr, acsBoardLimits);
|
2023-01-23 22:29:29 +01:00
|
|
|
}
|
2023-02-07 14:28:42 +01:00
|
|
|
resetSensorsArray();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// B side
|
|
|
|
sensors[0].first = deviceTemperatures.gyro2SideB.isValid();
|
|
|
|
sensors[0].second = deviceTemperatures.gyro2SideB.value;
|
|
|
|
sensors[1].first = deviceTemperatures.mgm2SideB.isValid();
|
|
|
|
sensors[1].second = deviceTemperatures.mgm2SideB.value;
|
|
|
|
sensors[2].first = deviceTemperatures.gyro3SideB.isValid();
|
|
|
|
sensors[2].second = deviceTemperatures.gyro3SideB.value;
|
|
|
|
sensors[3].first = sensorTemperatures.sensor_tcs_board.isValid();
|
|
|
|
sensors[3].second = sensorTemperatures.sensor_tcs_board.value;
|
|
|
|
if (selectAndReadSensorTemp()) {
|
|
|
|
if (chooseHeater(switchNr, redSwitchNr)) {
|
2023-02-06 21:13:17 +01:00
|
|
|
ctrlHeater(switchNr, redSwitchNr, acsBoardLimits);
|
2023-01-22 20:37:51 +01:00
|
|
|
}
|
2023-02-07 14:28:42 +01:00
|
|
|
} else {
|
|
|
|
if (chooseHeater(switchNr, redSwitchNr)) {
|
|
|
|
if (heaterHandler.checkSwitchState(switchNr)) {
|
|
|
|
heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF);
|
|
|
|
sif::info << "ThermalController::ctrlHeater: Heater" << switchNr << " OFF" << std::endl;
|
|
|
|
}
|
|
|
|
}
|
2023-01-22 20:37:51 +01:00
|
|
|
}
|
2023-02-07 14:28:42 +01:00
|
|
|
resetSensorsArray();
|
2022-12-19 18:30:22 +01:00
|
|
|
}
|
2022-12-19 18:45:08 +01:00
|
|
|
|
2022-12-13 12:08:53 +01:00
|
|
|
void ThermalController::ctrlMgt() {
|
2023-01-17 15:45:54 +01:00
|
|
|
PoolReadGuard pg(&imtqThermalSet);
|
2023-01-28 22:51:51 +01:00
|
|
|
auto heaterReq =
|
2023-01-17 15:55:36 +01:00
|
|
|
static_cast<ThermalComponentIF::StateRequest>(imtqThermalSet.heaterRequest.value);
|
2023-01-23 22:29:29 +01:00
|
|
|
|
|
|
|
if (heaterReq == ThermalComponentIF::STATE_REQUEST_OPERATIONAL) {
|
2023-02-06 21:13:17 +01:00
|
|
|
sensors[0].first = sensorTemperatures.sensor_magnettorquer.isValid();
|
|
|
|
sensors[0].second = sensorTemperatures.sensor_magnettorquer.value;
|
|
|
|
sensors[1].first = deviceTemperatures.mgt.isValid();
|
|
|
|
sensors[1].second = deviceTemperatures.mgt.value;
|
|
|
|
sensors[2].first = sensorTemperatures.sensor_plpcdu_heatspreader.isValid();
|
|
|
|
sensors[2].second = sensorTemperatures.sensor_plpcdu_heatspreader.value;
|
|
|
|
numSensors = 3;
|
2023-02-07 14:28:42 +01:00
|
|
|
ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_3_PCDU_PDU, mgtLimits);
|
2023-01-23 22:29:29 +01:00
|
|
|
}
|
2022-12-19 10:51:31 +01:00
|
|
|
}
|
|
|
|
|
2022-12-19 18:30:22 +01:00
|
|
|
void ThermalController::ctrlRw() {
|
2023-02-07 14:28:42 +01:00
|
|
|
// TODO: better solution?
|
|
|
|
// RW1
|
|
|
|
sensors[0].first = sensorTemperatures.sensor_rw1.isValid();
|
|
|
|
sensors[0].second = sensorTemperatures.sensor_rw1.value;
|
|
|
|
sensors[1].first = deviceTemperatures.rw1.isValid();
|
|
|
|
sensors[1].second = deviceTemperatures.rw1.value;
|
|
|
|
sensors[2].first = deviceTemperatures.rw4.isValid();
|
|
|
|
sensors[2].second = deviceTemperatures.rw4.value;
|
|
|
|
sensors[3].first = sensorTemperatures.sensor_dro.isValid();
|
|
|
|
sensors[3].second = sensorTemperatures.sensor_dro.value;
|
|
|
|
numSensors = 4;
|
|
|
|
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits);
|
|
|
|
|
|
|
|
// RW2
|
|
|
|
sensors[0].first = deviceTemperatures.rw2.isValid();
|
|
|
|
sensors[0].second = deviceTemperatures.rw2.value;
|
|
|
|
sensors[1].first = deviceTemperatures.rw3.isValid();
|
|
|
|
sensors[1].second = deviceTemperatures.rw3.value;
|
|
|
|
sensors[2].first = sensorTemperatures.sensor_rw1.isValid();
|
|
|
|
sensors[2].second = sensorTemperatures.sensor_rw1.value;
|
|
|
|
sensors[3].first = sensorTemperatures.sensor_dro.isValid();
|
|
|
|
sensors[3].second = sensorTemperatures.sensor_dro.value;
|
|
|
|
numSensors = 4;
|
|
|
|
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits);
|
|
|
|
|
|
|
|
// RW3
|
|
|
|
sensors[0].first = deviceTemperatures.rw3.isValid();
|
|
|
|
sensors[0].second = deviceTemperatures.rw3.value;
|
|
|
|
sensors[1].first = deviceTemperatures.rw4.isValid();
|
|
|
|
sensors[1].second = deviceTemperatures.rw4.value;
|
|
|
|
sensors[2].first = sensorTemperatures.sensor_rw1.isValid();
|
|
|
|
sensors[2].second = sensorTemperatures.sensor_rw1.value;
|
|
|
|
sensors[3].first = sensorTemperatures.sensor_dro.isValid();
|
|
|
|
sensors[3].second = sensorTemperatures.sensor_dro.value;
|
|
|
|
numSensors = 4;
|
|
|
|
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits);
|
|
|
|
|
|
|
|
// RW4
|
|
|
|
sensors[0].first = deviceTemperatures.rw4.isValid();
|
|
|
|
sensors[0].second = deviceTemperatures.rw4.value;
|
|
|
|
sensors[1].first = deviceTemperatures.rw1.isValid();
|
|
|
|
sensors[1].second = deviceTemperatures.rw1.value;
|
|
|
|
sensors[2].first = sensorTemperatures.sensor_rw1.isValid();
|
|
|
|
sensors[2].second = sensorTemperatures.sensor_rw1.value;
|
|
|
|
sensors[3].first = sensorTemperatures.sensor_dro.isValid();
|
|
|
|
sensors[3].second = sensorTemperatures.sensor_dro.value;
|
|
|
|
numSensors = 4;
|
|
|
|
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits);
|
2022-12-19 18:30:22 +01:00
|
|
|
}
|
2022-12-19 10:51:31 +01:00
|
|
|
|
|
|
|
void ThermalController::ctrlStr() {
|
2023-02-06 17:10:09 +01:00
|
|
|
sensors[0].first = sensorTemperatures.sensor_startracker.isValid();
|
|
|
|
sensors[0].second = sensorTemperatures.sensor_startracker.value;
|
|
|
|
sensors[1].first = deviceTemperatures.startracker.isValid();
|
|
|
|
sensors[1].second = deviceTemperatures.startracker.value;
|
|
|
|
sensors[2].first = sensorTemperatures.sensor_dro.isValid();
|
|
|
|
sensors[2].second = sensorTemperatures.sensor_dro.value;
|
|
|
|
numSensors = 3;
|
2023-02-07 14:28:42 +01:00
|
|
|
ctrlComponentTemperature(heater::HEATER_5_STR, heater::HEATER_6_DRO, strLimits);
|
2022-12-19 10:51:31 +01:00
|
|
|
}
|
2022-12-19 18:45:08 +01:00
|
|
|
|
2022-12-19 10:51:31 +01:00
|
|
|
void ThermalController::ctrlIfBoard() {
|
2023-02-07 14:28:42 +01:00
|
|
|
sensors[0].first = sensorTemperatures.tmp1075IfBrd.isValid();
|
|
|
|
sensors[0].second = sensorTemperatures.tmp1075IfBrd.value;
|
|
|
|
sensors[1].first = sensorTemperatures.sensor_magnettorquer.isValid();
|
|
|
|
sensors[1].second = sensorTemperatures.sensor_magnettorquer.value;
|
|
|
|
sensors[2].first = deviceTemperatures.mgm2SideB.isValid();
|
|
|
|
sensors[2].second = deviceTemperatures.mgm2SideB.value;
|
|
|
|
numSensors = 3;
|
2023-02-06 17:10:09 +01:00
|
|
|
ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_3_PCDU_PDU, ifBoardLimits);
|
2022-12-13 12:08:53 +01:00
|
|
|
}
|
2022-12-19 18:45:08 +01:00
|
|
|
|
2022-12-19 18:30:22 +01:00
|
|
|
void ThermalController::ctrlTcsBoard() {
|
2023-02-06 17:10:09 +01:00
|
|
|
sensors[0].first = sensorTemperatures.sensor_tcs_board.isValid();
|
|
|
|
sensors[0].second = sensorTemperatures.sensor_tcs_board.value;
|
|
|
|
sensors[1].first = sensorTemperatures.tmp1075Tcs0.isValid();
|
|
|
|
sensors[1].second = sensorTemperatures.tmp1075Tcs0.value;
|
|
|
|
sensors[2].first = sensorTemperatures.tmp1075Tcs1.isValid();
|
|
|
|
sensors[2].second = sensorTemperatures.tmp1075Tcs1.value;
|
|
|
|
numSensors = 3;
|
|
|
|
ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, tcsBoardLimits);
|
2022-12-19 18:30:22 +01:00
|
|
|
}
|
2022-12-19 18:45:08 +01:00
|
|
|
|
2022-12-19 18:30:22 +01:00
|
|
|
void ThermalController::ctrlObc() {
|
2023-02-06 21:13:17 +01:00
|
|
|
sensors[0].first = deviceTemperatures.q7s.isValid();
|
|
|
|
sensors[0].second = deviceTemperatures.q7s.value;
|
|
|
|
sensors[1].first = sensorTemperatures.tmp1075Tcs1.isValid();
|
|
|
|
sensors[1].second = sensorTemperatures.tmp1075Tcs1.value;
|
|
|
|
sensors[2].first = sensorTemperatures.tmp1075Tcs0.isValid();
|
|
|
|
sensors[2].second = sensorTemperatures.tmp1075Tcs0.value;
|
|
|
|
numSensors = 3;
|
|
|
|
ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, obcLimits);
|
2023-02-06 17:10:09 +01:00
|
|
|
if (componentAboveCutOffLimit) {
|
2023-02-03 13:19:39 +01:00
|
|
|
triggerEvent(OBC_OVERHEATING);
|
|
|
|
}
|
2022-12-19 18:30:22 +01:00
|
|
|
}
|
2022-12-19 18:45:08 +01:00
|
|
|
|
2022-12-19 18:30:22 +01:00
|
|
|
void ThermalController::ctrlObcIfBoard() {
|
2023-02-06 21:13:17 +01:00
|
|
|
sensors[0].first = deviceTemperatures.q7s.isValid();
|
|
|
|
sensors[0].second = deviceTemperatures.q7s.value;
|
|
|
|
sensors[1].first = sensorTemperatures.tmp1075Tcs0.isValid();
|
|
|
|
sensors[1].second = sensorTemperatures.tmp1075Tcs0.value;
|
|
|
|
sensors[2].first = sensorTemperatures.tmp1075Tcs1.isValid();
|
|
|
|
sensors[2].second = sensorTemperatures.tmp1075Tcs1.value;
|
|
|
|
numSensors = 3;
|
|
|
|
ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, obcIfBoardLimits);
|
2022-12-19 18:30:22 +01:00
|
|
|
}
|
2022-12-19 18:45:08 +01:00
|
|
|
|
2022-12-19 18:30:22 +01:00
|
|
|
void ThermalController::ctrlSBandTransceiver() {
|
2023-02-06 21:13:17 +01:00
|
|
|
sensors[0].first = deviceTemperatures.syrlinksPowerAmplifier.isValid();
|
|
|
|
sensors[0].second = deviceTemperatures.syrlinksPowerAmplifier.value;
|
|
|
|
sensors[1].first = deviceTemperatures.syrlinksBasebandBoard.isValid();
|
|
|
|
sensors[1].second = deviceTemperatures.syrlinksBasebandBoard.value;
|
|
|
|
sensors[2].first = sensorTemperatures.sensor_4k_camera.isValid();
|
|
|
|
sensors[2].second = sensorTemperatures.sensor_4k_camera.value;
|
|
|
|
numSensors = 3;
|
2023-02-07 14:28:42 +01:00
|
|
|
ctrlComponentTemperature(heater::HEATER_7_S_BAND, heater::HEATER_4_CAMERA,
|
|
|
|
sBandTransceiverLimits);
|
2023-02-06 17:10:09 +01:00
|
|
|
if (componentAboveCutOffLimit) {
|
2023-02-03 13:19:39 +01:00
|
|
|
triggerEvent(SYRLINKS_OVERHEATING);
|
|
|
|
}
|
2022-12-19 18:30:22 +01:00
|
|
|
}
|
|
|
|
void ThermalController::ctrlPcduP60Board() {
|
2023-02-06 21:13:17 +01:00
|
|
|
sensors[0].first = deviceTemperatures.temp1P60dock.isValid();
|
|
|
|
sensors[0].second = deviceTemperatures.temp1P60dock.value;
|
|
|
|
sensors[1].first = deviceTemperatures.temp2P60dock.isValid();
|
|
|
|
sensors[1].second = deviceTemperatures.temp2P60dock.value;
|
|
|
|
numSensors = 2;
|
|
|
|
ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, pcduP60BoardLimits);
|
2022-12-19 18:30:22 +01:00
|
|
|
}
|
2022-12-19 18:45:08 +01:00
|
|
|
|
2022-12-19 18:30:22 +01:00
|
|
|
void ThermalController::ctrlPcduAcu() {
|
2023-01-22 21:04:55 +01:00
|
|
|
heater::Switchers switchNr = heater::HEATER_3_PCDU_PDU;
|
|
|
|
heater::Switchers redSwitchNr = heater::HEATER_2_ACS_BRD;
|
|
|
|
|
2023-02-06 17:10:09 +01:00
|
|
|
if (chooseHeater(switchNr, redSwitchNr)) {
|
|
|
|
bool sensorTempAvailable = true;
|
2023-01-22 21:04:55 +01:00
|
|
|
|
2023-01-29 17:55:43 +01:00
|
|
|
if (deviceTemperatures.acu.value[0] != INVALID_TEMPERATURE) {
|
2023-01-28 22:51:51 +01:00
|
|
|
sensorTemp = deviceTemperatures.acu.value[0];
|
2023-01-29 17:55:43 +01:00
|
|
|
} else if (deviceTemperatures.acu.value[1] != INVALID_TEMPERATURE) {
|
2023-01-22 21:04:55 +01:00
|
|
|
sensorTemp = deviceTemperatures.acu.value[1];
|
2023-01-29 17:55:43 +01:00
|
|
|
} else if (deviceTemperatures.acu.value[2] != INVALID_TEMPERATURE) {
|
|
|
|
sensorTemp = deviceTemperatures.acu.value[2];
|
2023-01-22 21:04:55 +01:00
|
|
|
} else if (sensorTemperatures.sensor_acu.isValid()) {
|
|
|
|
sensorTemp = sensorTemperatures.sensor_acu.value;
|
|
|
|
} else {
|
|
|
|
triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr);
|
|
|
|
sensorTempAvailable = false;
|
2023-01-23 22:29:29 +01:00
|
|
|
}
|
|
|
|
if (sensorTempAvailable) {
|
2023-02-06 21:13:17 +01:00
|
|
|
ctrlHeater(switchNr, redSwitchNr, pcduAcuLimits);
|
2023-01-22 21:04:55 +01:00
|
|
|
}
|
|
|
|
}
|
2022-12-19 18:30:22 +01:00
|
|
|
}
|
2022-12-19 18:45:08 +01:00
|
|
|
|
2022-12-19 18:30:22 +01:00
|
|
|
void ThermalController::ctrlPcduPdu() {
|
2023-02-06 21:13:17 +01:00
|
|
|
sensors[0].first = deviceTemperatures.pdu1.isValid();
|
|
|
|
sensors[0].second = deviceTemperatures.pdu1.value;
|
|
|
|
sensors[1].first = deviceTemperatures.pdu2.isValid();
|
|
|
|
sensors[1].second = deviceTemperatures.pdu2.value;
|
|
|
|
sensors[2].first = sensorTemperatures.tmp1075Tcs0.isValid();
|
|
|
|
sensors[2].second = sensorTemperatures.tmp1075Tcs0.value;
|
|
|
|
numSensors = 2;
|
|
|
|
ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, pcduPduLimits);
|
2022-12-19 18:30:22 +01:00
|
|
|
}
|
2022-12-19 18:45:08 +01:00
|
|
|
|
2022-12-19 18:30:22 +01:00
|
|
|
void ThermalController::ctrlPlPcduBoard() {
|
2023-02-06 21:13:17 +01:00
|
|
|
sensors[0].first = sensorTemperatures.tmp1075PlPcdu0.isValid();
|
|
|
|
sensors[0].second = sensorTemperatures.tmp1075PlPcdu0.value;
|
|
|
|
sensors[1].first = sensorTemperatures.tmp1075PlPcdu1.isValid();
|
|
|
|
sensors[1].second = sensorTemperatures.tmp1075PlPcdu1.value;
|
|
|
|
sensors[2].first = deviceTemperatures.adcPayloadPcdu.isValid();
|
|
|
|
sensors[2].second = deviceTemperatures.adcPayloadPcdu.value;
|
|
|
|
sensors[3].first = sensorTemperatures.sensor_plpcdu_heatspreader.isValid();
|
|
|
|
sensors[3].second = sensorTemperatures.sensor_plpcdu_heatspreader.value;
|
|
|
|
numSensors = 4;
|
|
|
|
ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, plPcduBoardLimits);
|
|
|
|
if (componentAboveCutOffLimit) {
|
|
|
|
triggerEvent(PLPCDU_OVERHEATING);
|
2023-01-22 21:04:55 +01:00
|
|
|
}
|
2022-12-19 18:30:22 +01:00
|
|
|
}
|
2022-12-19 18:45:08 +01:00
|
|
|
|
2022-12-19 18:30:22 +01:00
|
|
|
void ThermalController::ctrlPlocMissionBoard() {
|
2023-02-06 21:13:17 +01:00
|
|
|
sensors[0].first = sensorTemperatures.sensor_ploc_heatspreader.isValid();
|
|
|
|
sensors[0].second = sensorTemperatures.sensor_ploc_heatspreader.value;
|
|
|
|
sensors[1].first = sensorTemperatures.sensor_ploc_missionboard.isValid();
|
|
|
|
sensors[1].second = sensorTemperatures.sensor_ploc_missionboard.value;
|
|
|
|
sensors[2].first = sensorTemperatures.sensor_dac_heatspreader.isValid();
|
|
|
|
sensors[2].second = sensorTemperatures.sensor_dac_heatspreader.value;
|
|
|
|
numSensors = 3;
|
2023-02-07 14:28:42 +01:00
|
|
|
ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD,
|
|
|
|
plocMissionBoardLimits);
|
2023-02-06 17:10:09 +01:00
|
|
|
if (componentAboveCutOffLimit) {
|
2023-02-03 13:19:39 +01:00
|
|
|
triggerEvent(PLOC_OVERHEATING);
|
|
|
|
}
|
2022-12-19 18:30:22 +01:00
|
|
|
}
|
2022-12-19 18:45:08 +01:00
|
|
|
|
2022-12-19 18:30:22 +01:00
|
|
|
void ThermalController::ctrlPlocProcessingBoard() {
|
2023-02-06 21:13:17 +01:00
|
|
|
sensors[0].first = sensorTemperatures.sensor_ploc_missionboard.isValid();
|
|
|
|
sensors[0].second = sensorTemperatures.sensor_ploc_missionboard.value;
|
|
|
|
sensors[1].first = sensorTemperatures.sensor_ploc_heatspreader.isValid();
|
|
|
|
sensors[1].second = sensorTemperatures.sensor_ploc_heatspreader.value;
|
|
|
|
sensors[2].first = sensorTemperatures.sensor_dac_heatspreader.isValid();
|
|
|
|
sensors[2].second = sensorTemperatures.sensor_dac_heatspreader.value;
|
|
|
|
numSensors = 3;
|
2023-02-07 14:28:42 +01:00
|
|
|
ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD,
|
|
|
|
plocProcessingBoardLimits);
|
2022-12-19 18:30:22 +01:00
|
|
|
}
|
2022-12-19 18:45:08 +01:00
|
|
|
|
2022-12-19 18:30:22 +01:00
|
|
|
void ThermalController::ctrlDac() {
|
2023-02-06 21:13:17 +01:00
|
|
|
sensors[0].first = sensorTemperatures.sensor_dac_heatspreader.isValid();
|
|
|
|
sensors[0].second = sensorTemperatures.sensor_dac_heatspreader.value;
|
|
|
|
sensors[1].first = sensorTemperatures.sensor_ploc_missionboard.isValid();
|
|
|
|
sensors[1].second = sensorTemperatures.sensor_ploc_missionboard.value;
|
|
|
|
sensors[2].first = sensorTemperatures.sensor_ploc_heatspreader.isValid();
|
|
|
|
sensors[2].second = sensorTemperatures.sensor_ploc_heatspreader.value;
|
|
|
|
numSensors = 3;
|
|
|
|
ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, dacLimits);
|
2022-12-19 18:30:22 +01:00
|
|
|
}
|
2023-01-04 19:03:01 +01:00
|
|
|
|
2022-12-13 12:08:53 +01:00
|
|
|
void ThermalController::ctrlCameraBody() {
|
2023-02-06 21:13:17 +01:00
|
|
|
sensors[0].first = sensorTemperatures.sensor_4k_camera.isValid();
|
|
|
|
sensors[0].second = sensorTemperatures.sensor_4k_camera.value;
|
|
|
|
sensors[1].first = sensorTemperatures.sensor_dro.isValid();
|
|
|
|
sensors[1].second = sensorTemperatures.sensor_dro.value;
|
|
|
|
sensors[2].first = sensorTemperatures.sensor_mpa.isValid();
|
|
|
|
sensors[2].second = sensorTemperatures.sensor_mpa.value;
|
|
|
|
numSensors = 3;
|
|
|
|
ctrlComponentTemperature(heater::HEATER_4_CAMERA, heater::HEATER_6_DRO, cameraLimits);
|
2022-12-13 12:08:53 +01:00
|
|
|
}
|
2023-01-04 19:03:01 +01:00
|
|
|
|
2022-12-19 18:45:08 +01:00
|
|
|
void ThermalController::ctrlDro() {
|
2023-02-06 21:13:17 +01:00
|
|
|
sensors[0].first = sensorTemperatures.sensor_dro.isValid();
|
|
|
|
sensors[0].second = sensorTemperatures.sensor_dro.value;
|
|
|
|
sensors[1].first = sensorTemperatures.sensor_4k_camera.isValid();
|
|
|
|
sensors[1].second = sensorTemperatures.sensor_4k_camera.value;
|
|
|
|
sensors[2].first = sensorTemperatures.sensor_mpa.isValid();
|
|
|
|
sensors[2].second = sensorTemperatures.sensor_mpa.value;
|
|
|
|
numSensors = 3;
|
|
|
|
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, droLimits);
|
2022-12-19 18:45:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void ThermalController::ctrlX8() {
|
2023-02-06 21:13:17 +01:00
|
|
|
sensors[0].first = sensorTemperatures.sensor_x8.isValid();
|
|
|
|
sensors[0].second = sensorTemperatures.sensor_x8.value;
|
|
|
|
sensors[1].first = sensorTemperatures.sensor_hpa.isValid();
|
|
|
|
sensors[1].second = sensorTemperatures.sensor_hpa.value;
|
|
|
|
sensors[2].first = sensorTemperatures.sensor_tx_modul.isValid();
|
|
|
|
sensors[2].second = sensorTemperatures.sensor_tx_modul.value;
|
|
|
|
numSensors = 3;
|
|
|
|
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, x8Limits);
|
2022-12-19 18:45:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void ThermalController::ctrlTx() {
|
2023-02-06 21:13:17 +01:00
|
|
|
sensors[0].first = sensorTemperatures.sensor_tx_modul.isValid();
|
|
|
|
sensors[0].second = sensorTemperatures.sensor_tx_modul.value;
|
|
|
|
sensors[1].first = sensorTemperatures.sensor_x8.isValid();
|
|
|
|
sensors[1].second = sensorTemperatures.sensor_x8.value;
|
|
|
|
sensors[2].first = sensorTemperatures.sensor_mpa.isValid();
|
|
|
|
sensors[2].second = sensorTemperatures.sensor_mpa.value;
|
|
|
|
numSensors = 3;
|
|
|
|
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, txLimits);
|
2022-12-19 18:45:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void ThermalController::ctrlMpa() {
|
2023-02-06 21:13:17 +01:00
|
|
|
sensors[0].first = sensorTemperatures.sensor_mpa.isValid();
|
|
|
|
sensors[0].second = sensorTemperatures.sensor_mpa.value;
|
|
|
|
sensors[1].first = sensorTemperatures.sensor_hpa.isValid();
|
|
|
|
sensors[1].second = sensorTemperatures.sensor_hpa.value;
|
|
|
|
sensors[2].first = sensorTemperatures.sensor_tx_modul.isValid();
|
|
|
|
sensors[2].second = sensorTemperatures.sensor_tx_modul.value;
|
|
|
|
numSensors = 3;
|
|
|
|
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, mpaLimits);
|
2022-12-19 18:45:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void ThermalController::ctrlHpa() {
|
2023-02-06 21:13:17 +01:00
|
|
|
sensors[0].first = sensorTemperatures.sensor_hpa.isValid();
|
|
|
|
sensors[0].second = sensorTemperatures.sensor_hpa.value;
|
|
|
|
sensors[1].first = sensorTemperatures.sensor_x8.isValid();
|
|
|
|
sensors[1].second = sensorTemperatures.sensor_x8.value;
|
|
|
|
sensors[2].first = sensorTemperatures.sensor_mpa.isValid();
|
|
|
|
sensors[2].second = sensorTemperatures.sensor_mpa.value;
|
|
|
|
numSensors = 3;
|
|
|
|
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, hpaLimits);
|
2023-02-06 17:10:09 +01:00
|
|
|
if (componentAboveCutOffLimit) {
|
2023-02-03 13:19:39 +01:00
|
|
|
triggerEvent(HPA_OVERHEATING);
|
|
|
|
}
|
2022-12-19 18:45:08 +01:00
|
|
|
}
|
|
|
|
|
2023-02-09 17:32:40 +01:00
|
|
|
void ThermalController::performThermalModuleCtrl() {
|
|
|
|
ctrlCameraBody();
|
|
|
|
ctrlAcsBoard();
|
|
|
|
ctrlMgt();
|
|
|
|
ctrlRw();
|
|
|
|
ctrlStr();
|
|
|
|
ctrlIfBoard();
|
|
|
|
ctrlAcsBoard();
|
|
|
|
ctrlObc();
|
|
|
|
ctrlObcIfBoard();
|
|
|
|
ctrlSBandTransceiver();
|
|
|
|
ctrlPcduP60Board();
|
|
|
|
ctrlPcduAcu();
|
|
|
|
ctrlPcduPdu();
|
|
|
|
ctrlPlPcduBoard();
|
|
|
|
ctrlPlocMissionBoard();
|
|
|
|
ctrlPlocProcessingBoard();
|
|
|
|
ctrlDac();
|
|
|
|
|
|
|
|
ctrlDro();
|
|
|
|
ctrlX8();
|
|
|
|
ctrlHpa();
|
|
|
|
ctrlTx();
|
|
|
|
ctrlMpa();
|
|
|
|
ctrlScexBoard();
|
|
|
|
}
|
|
|
|
|
2022-12-19 18:45:08 +01:00
|
|
|
void ThermalController::ctrlScexBoard() {
|
2023-02-06 21:13:17 +01:00
|
|
|
sensors[0].first = sensorTemperatures.sensor_scex.isValid();
|
|
|
|
sensors[0].second = sensorTemperatures.sensor_scex.value;
|
|
|
|
sensors[1].first = sensorTemperatures.sensor_x8.isValid();
|
|
|
|
sensors[1].second = sensorTemperatures.sensor_x8.value;
|
|
|
|
sensors[2].first = sensorTemperatures.sensor_hpa.isValid();
|
|
|
|
sensors[2].second = sensorTemperatures.sensor_hpa.value;
|
|
|
|
numSensors = 3;
|
|
|
|
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_5_STR, scexBoardLimits);
|
2022-12-19 18:45:08 +01:00
|
|
|
}
|
2023-01-05 19:39:51 +01:00
|
|
|
|
2022-12-19 18:30:22 +01:00
|
|
|
void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr,
|
2023-02-06 17:10:09 +01:00
|
|
|
struct TempLimits& tempLimit) {
|
|
|
|
componentAboveCutOffLimit = false;
|
2022-12-13 12:08:53 +01:00
|
|
|
// Heater off
|
|
|
|
if (not heaterHandler.checkSwitchState(switchNr)) {
|
2023-02-06 17:10:09 +01:00
|
|
|
if (sensorTemp < tempLimit.opLowerLimit) {
|
2022-12-13 12:08:53 +01:00
|
|
|
heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::ON);
|
2023-02-03 13:19:39 +01:00
|
|
|
sif::info << "ThermalController::ctrlHeater: Heater" << switchNr << " ON" << std::endl;
|
2022-12-13 12:08:53 +01:00
|
|
|
}
|
|
|
|
// Heater on
|
|
|
|
} else if (heaterHandler.checkSwitchState(switchNr)) {
|
2023-02-06 17:10:09 +01:00
|
|
|
if (sensorTemp >= tempLimit.opLowerLimit + TEMP_OFFSET) {
|
2022-12-13 12:08:53 +01:00
|
|
|
heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF);
|
2023-02-03 13:19:39 +01:00
|
|
|
sif::info << "ThermalController::ctrlHeater: Heater" << switchNr << " OFF" << std::endl;
|
2022-12-13 12:08:53 +01:00
|
|
|
}
|
|
|
|
} else if (not redSwitchNrInUse) {
|
|
|
|
if (heaterHandler.checkSwitchState(redSwitchNr)) {
|
2023-02-06 17:10:09 +01:00
|
|
|
if (sensorTemp >= tempLimit.cutOffLimit) {
|
|
|
|
componentAboveCutOffLimit = true;
|
2022-12-13 12:08:53 +01:00
|
|
|
heaterHandler.switchHeater(redSwitchNr, HeaterHandler::SwitchState::OFF);
|
2023-02-03 13:19:39 +01:00
|
|
|
sif::info << "ThermalController::ctrlHeater: Heater" << redSwitchNr << " OFF" << std::endl;
|
2022-12-12 21:33:12 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-12-13 12:08:53 +01:00
|
|
|
}
|
|
|
|
|
2023-02-06 17:10:09 +01:00
|
|
|
bool ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr) {
|
|
|
|
bool heaterAvailable = true;
|
2022-12-14 11:24:03 +01:00
|
|
|
|
2022-12-13 12:08:53 +01:00
|
|
|
if (heaterHandler.getHealth(switchNr) != HasHealthIF::HEALTHY) {
|
|
|
|
if (heaterHandler.getHealth(redSwitchNr) == HasHealthIF::HEALTHY) {
|
|
|
|
switchNr = redSwitchNr;
|
|
|
|
redSwitchNrInUse = true;
|
|
|
|
} else {
|
|
|
|
heaterAvailable = false;
|
2023-01-17 15:55:36 +01:00
|
|
|
triggerEvent(NO_HEALTHY_HEATER_AVAILABLE, switchNr, redSwitchNr);
|
2022-12-13 12:08:53 +01:00
|
|
|
}
|
2022-12-14 11:24:03 +01:00
|
|
|
} else {
|
|
|
|
redSwitchNrInUse = false;
|
|
|
|
}
|
2023-02-06 17:10:09 +01:00
|
|
|
return heaterAvailable;
|
2022-12-14 11:24:03 +01:00
|
|
|
}
|
|
|
|
|
2023-02-07 14:28:42 +01:00
|
|
|
bool ThermalController::selectAndReadSensorTemp() {
|
|
|
|
for (unsigned i = 0; i < numSensors; i++) {
|
2023-02-06 17:10:09 +01:00
|
|
|
if (sensors[i].first and sensors[i].second != INVALID_TEMPERATURE) {
|
|
|
|
sensorTemp = sensors[i].second;
|
|
|
|
return true;
|
2023-01-04 17:30:17 +01:00
|
|
|
}
|
|
|
|
}
|
2023-02-07 14:28:42 +01:00
|
|
|
triggerEvent(NO_VALID_SENSOR_TEMPERATURE);
|
|
|
|
return false;
|
2023-01-04 17:30:17 +01:00
|
|
|
}
|
|
|
|
|
2023-01-05 19:39:51 +01:00
|
|
|
void ThermalController::ctrlComponentTemperature(heater::Switchers switchNr,
|
|
|
|
heater::Switchers redSwitchNr,
|
2023-02-06 17:10:09 +01:00
|
|
|
TempLimits& tempLimit) {
|
2023-02-07 14:28:42 +01:00
|
|
|
if (selectAndReadSensorTemp()) {
|
2023-02-06 17:10:09 +01:00
|
|
|
if (chooseHeater(switchNr, redSwitchNr)) {
|
2022-12-19 18:30:22 +01:00
|
|
|
ctrlHeater(switchNr, redSwitchNr, tempLimit);
|
|
|
|
}
|
2023-01-22 20:37:51 +01:00
|
|
|
} else {
|
2023-02-07 14:28:42 +01:00
|
|
|
if (chooseHeater(switchNr,
|
|
|
|
redSwitchNr)) { // TODO: muss der Heater dann wirklich abgeschalten werden?
|
|
|
|
if (heaterHandler.checkSwitchState(switchNr)) {
|
|
|
|
heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF);
|
|
|
|
sif::info << "ThermalController::ctrlHeater: Heater" << switchNr << " OFF" << std::endl;
|
|
|
|
}
|
2023-01-22 20:37:51 +01:00
|
|
|
}
|
2023-02-06 17:10:09 +01:00
|
|
|
}
|
|
|
|
resetSensorsArray();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ThermalController::resetSensorsArray() {
|
2023-02-09 14:25:29 +01:00
|
|
|
// TODO: müssen auch andere Variablen resettet werden? senstemp?
|
2023-02-07 14:28:42 +01:00
|
|
|
for (auto& validValuePair : sensors) {
|
2023-02-06 17:10:09 +01:00
|
|
|
validValuePair.first = false;
|
|
|
|
validValuePair.second = INVALID_TEMPERATURE;
|
2023-01-22 20:37:51 +01:00
|
|
|
}
|
|
|
|
}
|