enum ThermalComponents
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
Irini Kosmidou 2023-02-10 12:18:16 +01:00
parent d73946e005
commit 77b7433caf
2 changed files with 70 additions and 15 deletions

View File

@ -966,6 +966,7 @@ void ThermalController::ctrlAcsBoard() {
heater::Switchers redSwitchNr = heater::HEATER_0_OBC_BRD;
// A side
thermalComponent = acsBoard;
sensors[0].first = deviceTemperatures.gyro0SideA.isValid();
sensors[0].second = deviceTemperatures.gyro0SideA.value;
sensors[1].first = deviceTemperatures.mgm0SideA.isValid();
@ -1008,6 +1009,7 @@ void ThermalController::ctrlAcsBoard() {
}
void ThermalController::ctrlMgt() {
thermalComponent = mgt;
PoolReadGuard pg(&imtqThermalSet);
auto heaterReq =
static_cast<ThermalComponentIF::StateRequest>(imtqThermalSet.heaterRequest.value);
@ -1027,6 +1029,7 @@ void ThermalController::ctrlMgt() {
void ThermalController::ctrlRw() {
// TODO: better solution?
// RW1
thermalComponent = rw;
sensors[0].first = sensorTemperatures.sensor_rw1.isValid();
sensors[0].second = sensorTemperatures.sensor_rw1.value;
sensors[1].first = deviceTemperatures.rw1.isValid();
@ -1039,6 +1042,7 @@ void ThermalController::ctrlRw() {
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits);
// RW2
thermalComponent = rw;
sensors[0].first = deviceTemperatures.rw2.isValid();
sensors[0].second = deviceTemperatures.rw2.value;
sensors[1].first = deviceTemperatures.rw3.isValid();
@ -1051,6 +1055,7 @@ void ThermalController::ctrlRw() {
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits);
// RW3
thermalComponent = rw;
sensors[0].first = deviceTemperatures.rw3.isValid();
sensors[0].second = deviceTemperatures.rw3.value;
sensors[1].first = deviceTemperatures.rw4.isValid();
@ -1063,6 +1068,7 @@ void ThermalController::ctrlRw() {
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits);
// RW4
thermalComponent = rw;
sensors[0].first = deviceTemperatures.rw4.isValid();
sensors[0].second = deviceTemperatures.rw4.value;
sensors[1].first = deviceTemperatures.rw1.isValid();
@ -1076,6 +1082,7 @@ void ThermalController::ctrlRw() {
}
void ThermalController::ctrlStr() {
thermalComponent = str;
sensors[0].first = sensorTemperatures.sensor_startracker.isValid();
sensors[0].second = sensorTemperatures.sensor_startracker.value;
sensors[1].first = deviceTemperatures.startracker.isValid();
@ -1087,6 +1094,7 @@ void ThermalController::ctrlStr() {
}
void ThermalController::ctrlIfBoard() {
thermalComponent = ifBoard;
sensors[0].first = sensorTemperatures.tmp1075IfBrd.isValid();
sensors[0].second = sensorTemperatures.tmp1075IfBrd.value;
sensors[1].first = sensorTemperatures.sensor_magnettorquer.isValid();
@ -1098,6 +1106,7 @@ void ThermalController::ctrlIfBoard() {
}
void ThermalController::ctrlTcsBoard() {
thermalComponent = tcsBoard;
sensors[0].first = sensorTemperatures.sensor_tcs_board.isValid();
sensors[0].second = sensorTemperatures.sensor_tcs_board.value;
sensors[1].first = sensorTemperatures.tmp1075Tcs0.isValid();
@ -1109,6 +1118,7 @@ void ThermalController::ctrlTcsBoard() {
}
void ThermalController::ctrlObc() {
thermalComponent = obc;
sensors[0].first = deviceTemperatures.q7s.isValid();
sensors[0].second = deviceTemperatures.q7s.value;
sensors[1].first = sensorTemperatures.tmp1075Tcs1.isValid();
@ -1123,6 +1133,7 @@ void ThermalController::ctrlObc() {
}
void ThermalController::ctrlObcIfBoard() {
thermalComponent = obcIfBoard;
sensors[0].first = deviceTemperatures.q7s.isValid();
sensors[0].second = deviceTemperatures.q7s.value;
sensors[1].first = sensorTemperatures.tmp1075Tcs0.isValid();
@ -1134,6 +1145,7 @@ void ThermalController::ctrlObcIfBoard() {
}
void ThermalController::ctrlSBandTransceiver() {
thermalComponent = sBandTransceiver;
sensors[0].first = deviceTemperatures.syrlinksPowerAmplifier.isValid();
sensors[0].second = deviceTemperatures.syrlinksPowerAmplifier.value;
sensors[1].first = deviceTemperatures.syrlinksBasebandBoard.isValid();
@ -1148,6 +1160,7 @@ void ThermalController::ctrlSBandTransceiver() {
}
}
void ThermalController::ctrlPcduP60Board() {
thermalComponent = pcduP60Board;
sensors[0].first = deviceTemperatures.temp1P60dock.isValid();
sensors[0].second = deviceTemperatures.temp1P60dock.value;
sensors[1].first = deviceTemperatures.temp2P60dock.isValid();
@ -1157,6 +1170,7 @@ void ThermalController::ctrlPcduP60Board() {
}
void ThermalController::ctrlPcduAcu() {
thermalComponent = pcduAcu;
heater::Switchers switchNr = heater::HEATER_3_PCDU_PDU;
heater::Switchers redSwitchNr = heater::HEATER_2_ACS_BRD;
@ -1172,7 +1186,7 @@ void ThermalController::ctrlPcduAcu() {
} else if (sensorTemperatures.sensor_acu.isValid()) {
sensorTemp = sensorTemperatures.sensor_acu.value;
} else {
triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr);
triggerEvent(NO_VALID_SENSOR_TEMPERATURE, thermalComponent);
sensorTempAvailable = false;
}
if (sensorTempAvailable) {
@ -1182,6 +1196,7 @@ void ThermalController::ctrlPcduAcu() {
}
void ThermalController::ctrlPcduPdu() {
thermalComponent = pcduPdu;
sensors[0].first = deviceTemperatures.pdu1.isValid();
sensors[0].second = deviceTemperatures.pdu1.value;
sensors[1].first = deviceTemperatures.pdu2.isValid();
@ -1193,6 +1208,7 @@ void ThermalController::ctrlPcduPdu() {
}
void ThermalController::ctrlPlPcduBoard() {
thermalComponent = plPcduBoard;
sensors[0].first = sensorTemperatures.tmp1075PlPcdu0.isValid();
sensors[0].second = sensorTemperatures.tmp1075PlPcdu0.value;
sensors[1].first = sensorTemperatures.tmp1075PlPcdu1.isValid();
@ -1209,6 +1225,7 @@ void ThermalController::ctrlPlPcduBoard() {
}
void ThermalController::ctrlPlocMissionBoard() {
thermalComponent = plocMissionBoard;
sensors[0].first = sensorTemperatures.sensor_ploc_heatspreader.isValid();
sensors[0].second = sensorTemperatures.sensor_ploc_heatspreader.value;
sensors[1].first = sensorTemperatures.sensor_ploc_missionboard.isValid();
@ -1224,6 +1241,7 @@ void ThermalController::ctrlPlocMissionBoard() {
}
void ThermalController::ctrlPlocProcessingBoard() {
thermalComponent = plocProcessingBoard;
sensors[0].first = sensorTemperatures.sensor_ploc_missionboard.isValid();
sensors[0].second = sensorTemperatures.sensor_ploc_missionboard.value;
sensors[1].first = sensorTemperatures.sensor_ploc_heatspreader.isValid();
@ -1236,6 +1254,7 @@ void ThermalController::ctrlPlocProcessingBoard() {
}
void ThermalController::ctrlDac() {
thermalComponent = dac;
sensors[0].first = sensorTemperatures.sensor_dac_heatspreader.isValid();
sensors[0].second = sensorTemperatures.sensor_dac_heatspreader.value;
sensors[1].first = sensorTemperatures.sensor_ploc_missionboard.isValid();
@ -1247,6 +1266,7 @@ void ThermalController::ctrlDac() {
}
void ThermalController::ctrlCameraBody() {
thermalComponent = camera;
sensors[0].first = sensorTemperatures.sensor_4k_camera.isValid();
sensors[0].second = sensorTemperatures.sensor_4k_camera.value;
sensors[1].first = sensorTemperatures.sensor_dro.isValid();
@ -1258,6 +1278,7 @@ void ThermalController::ctrlCameraBody() {
}
void ThermalController::ctrlDro() {
thermalComponent = dro;
sensors[0].first = sensorTemperatures.sensor_dro.isValid();
sensors[0].second = sensorTemperatures.sensor_dro.value;
sensors[1].first = sensorTemperatures.sensor_4k_camera.isValid();
@ -1269,6 +1290,7 @@ void ThermalController::ctrlDro() {
}
void ThermalController::ctrlX8() {
thermalComponent = x8;
sensors[0].first = sensorTemperatures.sensor_x8.isValid();
sensors[0].second = sensorTemperatures.sensor_x8.value;
sensors[1].first = sensorTemperatures.sensor_hpa.isValid();
@ -1280,6 +1302,7 @@ void ThermalController::ctrlX8() {
}
void ThermalController::ctrlTx() {
thermalComponent = tx;
sensors[0].first = sensorTemperatures.sensor_tx_modul.isValid();
sensors[0].second = sensorTemperatures.sensor_tx_modul.value;
sensors[1].first = sensorTemperatures.sensor_x8.isValid();
@ -1291,6 +1314,7 @@ void ThermalController::ctrlTx() {
}
void ThermalController::ctrlMpa() {
thermalComponent = mpa;
sensors[0].first = sensorTemperatures.sensor_mpa.isValid();
sensors[0].second = sensorTemperatures.sensor_mpa.value;
sensors[1].first = sensorTemperatures.sensor_hpa.isValid();
@ -1302,6 +1326,7 @@ void ThermalController::ctrlMpa() {
}
void ThermalController::ctrlHpa() {
thermalComponent = hpa;
sensors[0].first = sensorTemperatures.sensor_hpa.isValid();
sensors[0].second = sensorTemperatures.sensor_hpa.value;
sensors[1].first = sensorTemperatures.sensor_x8.isValid();
@ -1315,6 +1340,18 @@ void ThermalController::ctrlHpa() {
}
}
void ThermalController::ctrlScexBoard() {
thermalComponent = scexBoard;
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);
}
void ThermalController::performThermalModuleCtrl() {
ctrlCameraBody();
ctrlAcsBoard();
@ -1325,6 +1362,7 @@ void ThermalController::performThermalModuleCtrl() {
ctrlAcsBoard();
ctrlObc();
ctrlObcIfBoard();
ctrlTcsBoard(); // Todo: warum wurde das weggelassen?
ctrlSBandTransceiver();
ctrlPcduP60Board();
ctrlPcduAcu();
@ -1333,7 +1371,6 @@ void ThermalController::performThermalModuleCtrl() {
ctrlPlocMissionBoard();
ctrlPlocProcessingBoard();
ctrlDac();
ctrlDro();
ctrlX8();
ctrlHpa();
@ -1342,17 +1379,6 @@ void ThermalController::performThermalModuleCtrl() {
ctrlScexBoard();
}
void ThermalController::ctrlScexBoard() {
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);
}
void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr,
struct TempLimits& tempLimit) {
componentAboveCutOffLimit = false;
@ -1403,7 +1429,7 @@ bool ThermalController::selectAndReadSensorTemp() {
return true;
}
}
triggerEvent(NO_VALID_SENSOR_TEMPERATURE);
triggerEvent(NO_VALID_SENSOR_TEMPERATURE, thermalComponent);
return false;
}
@ -1432,4 +1458,5 @@ void ThermalController::resetSensorsArray() {
validValuePair.first = false;
validValuePair.second = INVALID_TEMPERATURE;
}
thermalComponent = none;
}

View File

@ -34,6 +34,33 @@ struct TempLimits {
float nopUpperLimit;
};
enum ThermalComponents {
none,
acsBoard,
mgt,
rw,
str,
ifBoard,
tcsBoard,
obc,
obcIfBoard,
sBandTransceiver,
pcduP60Board,
pcduAcu,
pcduPdu,
plPcduBoard,
plocMissionBoard,
plocProcessingBoard,
dac,
camera,
dro,
x8,
hpa,
tx,
mpa,
scexBoard
};
class ThermalController : public ExtendedControllerBase {
public:
static const uint16_t INVALID_TEMPERATURE = 999;
@ -146,6 +173,7 @@ class ThermalController : public ExtendedControllerBase {
TempLimits scexBoardLimits = TempLimits(-60.0, -40.0, 80.0, 85.0, 150.0);
double sensorTemp = INVALID_TEMPERATURE;
ThermalComponents thermalComponent = none;
bool redSwitchNrInUse = false;
bool componentAboveCutOffLimit = false;