updates for thermal module in DHB
This commit is contained in:
parent
8b4f73a97b
commit
dac2d210b5
@ -222,12 +222,11 @@ ReturnValue_t DeviceHandlerBase::initialize() {
|
|||||||
fillCommandAndReplyMap();
|
fillCommandAndReplyMap();
|
||||||
|
|
||||||
if (thermalSet != nullptr) {
|
if (thermalSet != nullptr) {
|
||||||
|
PoolReadGuard pg(thermalSet);
|
||||||
// Set temperature target state to NON_OP.
|
// Set temperature target state to NON_OP.
|
||||||
result = thermalSet->read();
|
if (pg.getReadResult() == returnvalue::OK) {
|
||||||
if (result == returnvalue::OK) {
|
|
||||||
thermalSet->heaterRequest.value = ThermalComponentIF::STATE_REQUEST_NON_OPERATIONAL;
|
thermalSet->heaterRequest.value = ThermalComponentIF::STATE_REQUEST_NON_OPERATIONAL;
|
||||||
thermalSet->heaterRequest.setValid(true);
|
thermalSet->heaterRequest.setValid(true);
|
||||||
thermalSet->commit();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -589,12 +588,12 @@ void DeviceHandlerBase::setMode(Mode_t newMode, uint8_t newSubmode) {
|
|||||||
Clock::getUptime(&timeoutStart);
|
Clock::getUptime(&timeoutStart);
|
||||||
|
|
||||||
if (mode == MODE_OFF and thermalSet != nullptr) {
|
if (mode == MODE_OFF and thermalSet != nullptr) {
|
||||||
ReturnValue_t result = thermalSet->read();
|
PoolReadGuard pg(thermalSet);
|
||||||
if (result == returnvalue::OK) {
|
if (pg.getReadResult() == returnvalue::OK) {
|
||||||
if (thermalSet->heaterRequest.value != ThermalComponentIF::STATE_REQUEST_IGNORE) {
|
if (thermalSet->heaterRequest.value != ThermalComponentIF::STATE_REQUEST_IGNORE) {
|
||||||
thermalSet->heaterRequest.value = ThermalComponentIF::STATE_REQUEST_NON_OPERATIONAL;
|
thermalSet->heaterRequest.value = ThermalComponentIF::STATE_REQUEST_NON_OPERATIONAL;
|
||||||
}
|
}
|
||||||
thermalSet->heaterRequest.commit(PoolVariableIF::VALID);
|
thermalSet->heaterRequest.setValid(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* TODO: This will probably be done by the LocalDataPoolManager now */
|
/* TODO: This will probably be done by the LocalDataPoolManager now */
|
||||||
@ -1083,8 +1082,8 @@ ReturnValue_t DeviceHandlerBase::checkModeCommand(Mode_t commandedMode, Submode_
|
|||||||
// Do not check thermal state for MODE_RAW
|
// Do not check thermal state for MODE_RAW
|
||||||
if ((mode == MODE_OFF) and ((commandedMode == MODE_ON) or (commandedMode == MODE_NORMAL)) and
|
if ((mode == MODE_OFF) and ((commandedMode == MODE_ON) or (commandedMode == MODE_NORMAL)) and
|
||||||
(thermalSet != nullptr)) {
|
(thermalSet != nullptr)) {
|
||||||
ReturnValue_t result = thermalSet->read();
|
PoolReadGuard pg(thermalSet);
|
||||||
if (result == returnvalue::OK) {
|
if (pg.getReadResult() == returnvalue::OK) {
|
||||||
if ((thermalSet->heaterRequest.value != ThermalComponentIF::STATE_REQUEST_IGNORE) and
|
if ((thermalSet->heaterRequest.value != ThermalComponentIF::STATE_REQUEST_IGNORE) and
|
||||||
(not ThermalComponentIF::isOperational(thermalSet->thermalState.value))) {
|
(not ThermalComponentIF::isOperational(thermalSet->thermalState.value))) {
|
||||||
triggerEvent(ThermalComponentIF::TEMP_NOT_IN_OP_RANGE, thermalSet->thermalState.value);
|
triggerEvent(ThermalComponentIF::TEMP_NOT_IN_OP_RANGE, thermalSet->thermalState.value);
|
||||||
@ -1145,11 +1144,10 @@ void DeviceHandlerBase::handleTransitionToOnMode(Mode_t commandedMode, Submode_t
|
|||||||
childTransitionDelay = getTransitionDelayMs(_MODE_START_UP, MODE_ON);
|
childTransitionDelay = getTransitionDelayMs(_MODE_START_UP, MODE_ON);
|
||||||
triggerEvent(CHANGING_MODE, commandedMode, commandedSubmode);
|
triggerEvent(CHANGING_MODE, commandedMode, commandedSubmode);
|
||||||
if (thermalSet != nullptr) {
|
if (thermalSet != nullptr) {
|
||||||
ReturnValue_t result = thermalSet->read();
|
PoolReadGuard pg(thermalSet);
|
||||||
if (result == returnvalue::OK) {
|
if (pg.getReadResult() == returnvalue::OK) {
|
||||||
if (thermalSet->heaterRequest != ThermalComponentIF::STATE_REQUEST_IGNORE) {
|
if (thermalSet->heaterRequest != ThermalComponentIF::STATE_REQUEST_IGNORE) {
|
||||||
thermalSet->heaterRequest = ThermalComponentIF::STATE_REQUEST_OPERATIONAL;
|
thermalSet->heaterRequest = ThermalComponentIF::STATE_REQUEST_OPERATIONAL;
|
||||||
thermalSet->commit();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user