Heater: Correction for switch enumeration #679

Merged
muellerr merged 2 commits from heater-ordering-enum-fixes into main 2023-06-14 03:35:25 +02:00
3 changed files with 23 additions and 16 deletions

View File

@ -18,6 +18,13 @@ will consitute of a breaking change warranting a new major release:
# [v4.0.0] to be released # [v4.0.0] to be released
# [v3.1.0]
## Fixed
- TCS heater switch enumeration naming was old/wrong and was not updated in sync with the object ID
update. This lead to the TCS controller commanding the wrong heaters.
# [v3.0.0] 2023-06-11 # [v3.0.0] 2023-06-11
- `eive-tmtc` version v4.0.0 - `eive-tmtc` version v4.0.0

View File

@ -1002,7 +1002,7 @@ void ThermalController::copyDevices() {
void ThermalController::ctrlAcsBoard() { void ThermalController::ctrlAcsBoard() {
heater::Switch switchNr = heater::HEATER_2_ACS_BRD; heater::Switch switchNr = heater::HEATER_2_ACS_BRD;
heater::Switch redSwitchNr = heater::HEATER_0_OBC_BRD; heater::Switch redSwitchNr = heater::HEATER_3_OBC_BRD;
// A side // A side
thermalComponent = ACS_BOARD; thermalComponent = ACS_BOARD;
@ -1067,7 +1067,7 @@ void ThermalController::ctrlMgt() {
sensors[2].first = sensorTemperatures.plpcduHeatspreader.isValid(); sensors[2].first = sensorTemperatures.plpcduHeatspreader.isValid();
sensors[2].second = sensorTemperatures.plpcduHeatspreader.value; sensors[2].second = sensorTemperatures.plpcduHeatspreader.value;
numSensors = 3; numSensors = 3;
HeaterContext htrCtx(heater::HEATER_2_ACS_BRD, heater::HEATER_3_PCDU_PDU, mgtLimits); HeaterContext htrCtx(heater::HEATER_2_ACS_BRD, heater::HEATER_1_PCDU_PDU, mgtLimits);
ctrlComponentTemperature(htrCtx); ctrlComponentTemperature(htrCtx);
if (componentAboveUpperLimit and not mgtTooHotFlag) { if (componentAboveUpperLimit and not mgtTooHotFlag) {
triggerEvent(tcsCtrl::MGT_OVERHEATING, tempFloatToU32()); triggerEvent(tcsCtrl::MGT_OVERHEATING, tempFloatToU32());
@ -1206,7 +1206,7 @@ void ThermalController::ctrlIfBoard() {
sensors[2].first = deviceTemperatures.mgm2SideB.isValid(); sensors[2].first = deviceTemperatures.mgm2SideB.isValid();
sensors[2].second = deviceTemperatures.mgm2SideB.value; sensors[2].second = deviceTemperatures.mgm2SideB.value;
numSensors = 3; numSensors = 3;
HeaterContext htrCtx(heater::HEATER_2_ACS_BRD, heater::HEATER_3_PCDU_PDU, ifBoardLimits); HeaterContext htrCtx(heater::HEATER_2_ACS_BRD, heater::HEATER_1_PCDU_PDU, ifBoardLimits);
ctrlComponentTemperature(htrCtx); ctrlComponentTemperature(htrCtx);
// TODO: special event overheating + could go back to safe mode // TODO: special event overheating + could go back to safe mode
} }
@ -1220,7 +1220,7 @@ void ThermalController::ctrlTcsBoard() {
sensors[2].first = sensorTemperatures.tmp1075Tcs1.isValid(); sensors[2].first = sensorTemperatures.tmp1075Tcs1.isValid();
sensors[2].second = sensorTemperatures.tmp1075Tcs1.value; sensors[2].second = sensorTemperatures.tmp1075Tcs1.value;
numSensors = 3; numSensors = 3;
HeaterContext htrCtx(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, tcsBoardLimits); HeaterContext htrCtx(heater::HEATER_3_OBC_BRD, heater::HEATER_2_ACS_BRD, tcsBoardLimits);
ctrlComponentTemperature(htrCtx); ctrlComponentTemperature(htrCtx);
// TODO: special event overheating + could go back to safe mode // TODO: special event overheating + could go back to safe mode
} }
@ -1234,7 +1234,7 @@ void ThermalController::ctrlObc() {
sensors[2].first = sensorTemperatures.tmp1075Tcs0.isValid(); sensors[2].first = sensorTemperatures.tmp1075Tcs0.isValid();
sensors[2].second = sensorTemperatures.tmp1075Tcs0.value; sensors[2].second = sensorTemperatures.tmp1075Tcs0.value;
numSensors = 3; numSensors = 3;
HeaterContext htrCtx(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, obcLimits); HeaterContext htrCtx(heater::HEATER_3_OBC_BRD, heater::HEATER_2_ACS_BRD, obcLimits);
ctrlComponentTemperature(htrCtx); ctrlComponentTemperature(htrCtx);
if (componentAboveUpperLimit and not obcTooHotFlag) { if (componentAboveUpperLimit and not obcTooHotFlag) {
triggerEvent(tcsCtrl::OBC_OVERHEATING, tempFloatToU32()); triggerEvent(tcsCtrl::OBC_OVERHEATING, tempFloatToU32());
@ -1253,7 +1253,7 @@ void ThermalController::ctrlObcIfBoard() {
sensors[2].first = sensorTemperatures.tmp1075Tcs1.isValid(); sensors[2].first = sensorTemperatures.tmp1075Tcs1.isValid();
sensors[2].second = sensorTemperatures.tmp1075Tcs1.value; sensors[2].second = sensorTemperatures.tmp1075Tcs1.value;
numSensors = 3; numSensors = 3;
HeaterContext htrCtx(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, obcIfBoardLimits); HeaterContext htrCtx(heater::HEATER_3_OBC_BRD, heater::HEATER_2_ACS_BRD, obcIfBoardLimits);
ctrlComponentTemperature(htrCtx); ctrlComponentTemperature(htrCtx);
if (componentAboveUpperLimit and not obcTooHotFlag) { if (componentAboveUpperLimit and not obcTooHotFlag) {
triggerEvent(tcsCtrl::OBC_OVERHEATING, tempFloatToU32()); triggerEvent(tcsCtrl::OBC_OVERHEATING, tempFloatToU32());
@ -1288,7 +1288,7 @@ void ThermalController::ctrlPcduP60Board() {
sensors[1].first = deviceTemperatures.temp2P60dock.isValid(); sensors[1].first = deviceTemperatures.temp2P60dock.isValid();
sensors[1].second = deviceTemperatures.temp2P60dock.value; sensors[1].second = deviceTemperatures.temp2P60dock.value;
numSensors = 2; numSensors = 2;
HeaterContext htrCtx(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, pcduP60BoardLimits); HeaterContext htrCtx(heater::HEATER_1_PCDU_PDU, heater::HEATER_2_ACS_BRD, pcduP60BoardLimits);
ctrlComponentTemperature(htrCtx); ctrlComponentTemperature(htrCtx);
if (componentAboveUpperLimit and not pcduSystemTooHotFlag) { if (componentAboveUpperLimit and not pcduSystemTooHotFlag) {
triggerEvent(tcsCtrl::PCDU_SYSTEM_OVERHEATING, tempFloatToU32()); triggerEvent(tcsCtrl::PCDU_SYSTEM_OVERHEATING, tempFloatToU32());
@ -1300,7 +1300,7 @@ void ThermalController::ctrlPcduP60Board() {
void ThermalController::ctrlPcduAcu() { void ThermalController::ctrlPcduAcu() {
thermalComponent = PCDUACU; thermalComponent = PCDUACU;
heater::Switch switchNr = heater::HEATER_3_PCDU_PDU; heater::Switch switchNr = heater::HEATER_1_PCDU_PDU;
heater::Switch redSwitchNr = heater::HEATER_2_ACS_BRD; heater::Switch redSwitchNr = heater::HEATER_2_ACS_BRD;
if (chooseHeater(switchNr, redSwitchNr)) { if (chooseHeater(switchNr, redSwitchNr)) {
@ -1340,7 +1340,7 @@ void ThermalController::ctrlPcduPdu() {
sensors[2].first = sensorTemperatures.tmp1075Tcs0.isValid(); sensors[2].first = sensorTemperatures.tmp1075Tcs0.isValid();
sensors[2].second = sensorTemperatures.tmp1075Tcs0.value; sensors[2].second = sensorTemperatures.tmp1075Tcs0.value;
numSensors = 3; numSensors = 3;
HeaterContext htrCtx(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, pcduPduLimits); HeaterContext htrCtx(heater::HEATER_1_PCDU_PDU, heater::HEATER_2_ACS_BRD, pcduPduLimits);
ctrlComponentTemperature(htrCtx); ctrlComponentTemperature(htrCtx);
if (componentAboveUpperLimit and not pcduSystemTooHotFlag) { if (componentAboveUpperLimit and not pcduSystemTooHotFlag) {
triggerEvent(tcsCtrl::PCDU_SYSTEM_OVERHEATING, tempFloatToU32()); triggerEvent(tcsCtrl::PCDU_SYSTEM_OVERHEATING, tempFloatToU32());
@ -1361,7 +1361,7 @@ void ThermalController::ctrlPlPcduBoard() {
sensors[3].first = sensorTemperatures.plpcduHeatspreader.isValid(); sensors[3].first = sensorTemperatures.plpcduHeatspreader.isValid();
sensors[3].second = sensorTemperatures.plpcduHeatspreader.value; sensors[3].second = sensorTemperatures.plpcduHeatspreader.value;
numSensors = 4; numSensors = 4;
HeaterContext htrCtx(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, plPcduBoardLimits); HeaterContext htrCtx(heater::HEATER_1_PCDU_PDU, heater::HEATER_2_ACS_BRD, plPcduBoardLimits);
ctrlComponentTemperature(htrCtx); ctrlComponentTemperature(htrCtx);
tooHotHandler(objects::PLPCDU_HANDLER, eBandTooHotFlag); tooHotHandler(objects::PLPCDU_HANDLER, eBandTooHotFlag);
} }
@ -1375,7 +1375,7 @@ void ThermalController::ctrlPlocMissionBoard() {
sensors[2].first = sensorTemperatures.dacHeatspreader.isValid(); sensors[2].first = sensorTemperatures.dacHeatspreader.isValid();
sensors[2].second = sensorTemperatures.dacHeatspreader.value; sensors[2].second = sensorTemperatures.dacHeatspreader.value;
numSensors = 3; numSensors = 3;
HeaterContext htrCtx(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, HeaterContext htrCtx(heater::HEATER_0_PLOC_PROC_BRD, heater::HEATER_3_OBC_BRD,
plocMissionBoardLimits); plocMissionBoardLimits);
ctrlComponentTemperature(htrCtx); ctrlComponentTemperature(htrCtx);
tooHotHandler(objects::PLOC_SUPERVISOR_HANDLER, plocTooHotFlag); tooHotHandler(objects::PLOC_SUPERVISOR_HANDLER, plocTooHotFlag);
@ -1390,7 +1390,7 @@ void ThermalController::ctrlPlocProcessingBoard() {
sensors[2].first = sensorTemperatures.dacHeatspreader.isValid(); sensors[2].first = sensorTemperatures.dacHeatspreader.isValid();
sensors[2].second = sensorTemperatures.dacHeatspreader.value; sensors[2].second = sensorTemperatures.dacHeatspreader.value;
numSensors = 3; numSensors = 3;
HeaterContext htrCtx(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, HeaterContext htrCtx(heater::HEATER_0_PLOC_PROC_BRD, heater::HEATER_3_OBC_BRD,
plocProcessingBoardLimits); plocProcessingBoardLimits);
ctrlComponentTemperature(htrCtx); ctrlComponentTemperature(htrCtx);
tooHotHandler(objects::PLOC_SUPERVISOR_HANDLER, plocTooHotFlag); tooHotHandler(objects::PLOC_SUPERVISOR_HANDLER, plocTooHotFlag);
@ -1405,7 +1405,7 @@ void ThermalController::ctrlDac() {
sensors[2].first = sensorTemperatures.plocHeatspreader.isValid(); sensors[2].first = sensorTemperatures.plocHeatspreader.isValid();
sensors[2].second = sensorTemperatures.plocHeatspreader.value; sensors[2].second = sensorTemperatures.plocHeatspreader.value;
numSensors = 3; numSensors = 3;
HeaterContext htrCtx(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, dacLimits); HeaterContext htrCtx(heater::HEATER_0_PLOC_PROC_BRD, heater::HEATER_3_OBC_BRD, dacLimits);
ctrlComponentTemperature(htrCtx); ctrlComponentTemperature(htrCtx);
tooHotHandler(objects::PLPCDU_HANDLER, eBandTooHotFlag); tooHotHandler(objects::PLPCDU_HANDLER, eBandTooHotFlag);
} }

View File

@ -5,10 +5,10 @@
namespace heater { namespace heater {
enum Switch : uint8_t { enum Switch : uint8_t {
HEATER_0_OBC_BRD, HEATER_0_PLOC_PROC_BRD,
HEATER_1_PLOC_PROC_BRD, HEATER_1_PCDU_PDU,
HEATER_2_ACS_BRD, HEATER_2_ACS_BRD,
HEATER_3_PCDU_PDU, HEATER_3_OBC_BRD,
HEATER_4_CAMERA, HEATER_4_CAMERA,
HEATER_5_STR, HEATER_5_STR,
HEATER_6_DRO, HEATER_6_DRO,