Merge branch 'tcs-heater-event-fix' of https://egit.irs.uni-stuttgart.de/eive/eive-obsw into tcs-heater-event-fix
Some checks are pending
EIVE/eive-obsw/pipeline/pr-v2.1.0-dev Build started...

This commit is contained in:
Robin Müller 2023-05-30 16:45:36 +02:00
commit 6aa856563e
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 9 additions and 3 deletions

View File

@ -88,6 +88,7 @@ will consitute of a breaking change warranting a new major release:
scaled correctly between 1Am² and 0.2Am².
- TCS Heater Handler: Always trigger mode event if a heater goes `OFF` or `ON`. This event might
soon replace the `HEATER_WENT_ON` and `HEATER_WENT_OFF` events.
- Prevent spam of TCS controller heater unavailability event if all heaters are in external control.
# [v2.0.5] 2023-05-11

View File

@ -1631,13 +1631,18 @@ bool ThermalController::selectAndReadSensorTemp(HeaterContext& htrCtx) {
bool ThermalController::chooseHeater(heater::Switch& switchNr, heater::Switch redSwitchNr) {
bool heaterAvailable = true;
if (heaterHandler.getHealth(switchNr) != HasHealthIF::HEALTHY) {
if (heaterHandler.getHealth(redSwitchNr) == HasHealthIF::HEALTHY) {
HasHealthIF::HealthState mainHealth = heaterHandler.getHealth(switchNr);
HasHealthIF::HealthState redHealth = heaterHandler.getHealth(redSwitchNr);
if (mainHealth != HasHealthIF::HEALTHY) {
if (redHealth == HasHealthIF::HEALTHY) {
switchNr = redSwitchNr;
redSwitchNrInUse = true;
} else {
heaterAvailable = false;
triggerEvent(tcsCtrl::NO_HEALTHY_HEATER_AVAILABLE, switchNr, redSwitchNr);
// Special case: Ground might command/do something with the heaters, so prevent spam.
if (not(mainHealth == EXTERNAL_CONTROL and redHealth == EXTERNAL_CONTROL)) {
triggerEvent(tcsCtrl::NO_HEALTHY_HEATER_AVAILABLE, switchNr, redSwitchNr);
}
}
} else {
redSwitchNrInUse = false;