This commit is contained in:
parent
977e9f366f
commit
ff7d0b3989
@ -1693,7 +1693,7 @@ void ThermalController::checkLimitsAndCtrlHeater(HeaterContext& htrCtx) {
|
|||||||
if (sensorTemp < htrCtx.tempLimit.opLowerLimit and heaterCtrlAllowed()) {
|
if (sensorTemp < htrCtx.tempLimit.opLowerLimit and heaterCtrlAllowed()) {
|
||||||
sif::info << "TCS: Heater " << static_cast<int>(htrCtx.switchNr) << " for component "
|
sif::info << "TCS: Heater " << static_cast<int>(htrCtx.switchNr) << " for component "
|
||||||
<< static_cast<int>(currThermalComponent) << " ON" << std::endl;
|
<< static_cast<int>(currThermalComponent) << " ON" << std::endl;
|
||||||
heaterSwitchHelper(htrCtx.switchNr, HeaterHandler::SwitchState::ON, thermalComponent);
|
heaterSwitchHelper(htrCtx.switchNr, HeaterHandler::SwitchState::ON, currThermalComponent);
|
||||||
} else {
|
} else {
|
||||||
// Even if heater control is now allowed, we can update the state.
|
// Even if heater control is now allowed, we can update the state.
|
||||||
thermalStates[currThermalComponent].heating = false;
|
thermalStates[currThermalComponent].heating = false;
|
||||||
@ -1790,6 +1790,8 @@ void ThermalController::heaterMaxDurationControl(const HeaterSwitchStates& curre
|
|||||||
// The heater might still be one for some thermal components, so cross-check
|
// The heater might still be one for some thermal components, so cross-check
|
||||||
// those components
|
// those components
|
||||||
crossCheckHeaterStateOfComponentsWhenHeaterGoesOff(static_cast<heater::Switch>(i));
|
crossCheckHeaterStateOfComponentsWhenHeaterGoesOff(static_cast<heater::Switch>(i));
|
||||||
|
} else if (currentHeaterStates[i] == HeaterHandler::SwitchState::OFF) {
|
||||||
|
heaterStates[i].heaterOnPeriod.resetTimer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1841,8 +1843,8 @@ void ThermalController::heaterSwitchHelper(heater::Switch switchNr,
|
|||||||
unsigned componentIdx) {
|
unsigned componentIdx) {
|
||||||
timeval currentTime;
|
timeval currentTime;
|
||||||
Clock::getClockMonotonic(¤tTime);
|
Clock::getClockMonotonic(¤tTime);
|
||||||
if (state == HeaterHandler::SwitchState::ON) {
|
if (targetState == HeaterHandler::SwitchState::ON) {
|
||||||
heaterHandler.switchHeater(switchNr, state);
|
heaterHandler.switchHeater(switchNr, targetState);
|
||||||
heaterStates[switchNr].target = HeaterHandler::SwitchState::ON;
|
heaterStates[switchNr].target = HeaterHandler::SwitchState::ON;
|
||||||
heaterStates[switchNr].switchTransition = true;
|
heaterStates[switchNr].switchTransition = true;
|
||||||
thermalStates[componentIdx].sensorIndex = currentSensorIndex;
|
thermalStates[componentIdx].sensorIndex = currentSensorIndex;
|
||||||
@ -1852,7 +1854,7 @@ void ThermalController::heaterSwitchHelper(heater::Switch switchNr,
|
|||||||
triggerEvent(tcsCtrl::TCS_SWITCHING_HEATER_ON, static_cast<uint32_t>(currThermalComponent),
|
triggerEvent(tcsCtrl::TCS_SWITCHING_HEATER_ON, static_cast<uint32_t>(currThermalComponent),
|
||||||
static_cast<uint32_t>(switchNr));
|
static_cast<uint32_t>(switchNr));
|
||||||
} else {
|
} else {
|
||||||
heaterHandler.switchHeater(switchNr, state);
|
heaterHandler.switchHeater(switchNr, targetState);
|
||||||
thermalStates[componentIdx].heating = false;
|
thermalStates[componentIdx].heating = false;
|
||||||
thermalStates[componentIdx].heaterEndTime = currentTime.tv_sec;
|
thermalStates[componentIdx].heaterEndTime = currentTime.tv_sec;
|
||||||
triggerEvent(tcsCtrl::TCS_SWITCHING_HEATER_OFF, static_cast<uint32_t>(currThermalComponent),
|
triggerEvent(tcsCtrl::TCS_SWITCHING_HEATER_OFF, static_cast<uint32_t>(currThermalComponent),
|
||||||
|
Loading…
Reference in New Issue
Block a user