local pool replacement

This commit is contained in:
Robin Müller 2020-11-30 16:28:16 +01:00
parent f581b37fcf
commit f108ae883c

View File

@ -96,26 +96,25 @@ float ThermalComponentCore::getLowerOpLimit() {
ReturnValue_t ThermalComponentCore::setTargetState(int8_t newState) {
// GlobDataSet mySet;
// gp_uint8_t writableTargetState(targetState.getDataPoolId(),
// &mySet, PoolVariableIF::VAR_READ_WRITE);
// mySet.read();
// if ((writableTargetState == STATE_REQUEST_OPERATIONAL)
// && (newState != STATE_REQUEST_IGNORE)) {
// return HasReturnvaluesIF::RETURN_FAILED;
// }
// switch (newState) {
// case STATE_REQUEST_HEATING:
// case STATE_REQUEST_IGNORE:
// case STATE_REQUEST_OPERATIONAL:
// writableTargetState = newState;
// break;
// case STATE_REQUEST_NON_OPERATIONAL:
// default:
// return INVALID_TARGET_STATE;
// }
// mySet.commit(PoolVariableIF::VALID);
// return HasReturnvaluesIF::RETURN_OK;
targetState.setReadWriteMode(pool_rwm_t::VAR_READ_WRITE);
targetState.read();
if((targetState == STATE_REQUEST_OPERATIONAL) and
(newState != STATE_REQUEST_IGNORE)) {
return HasReturnvaluesIF::RETURN_FAILED;
}
switch (newState) {
case STATE_REQUEST_HEATING:
case STATE_REQUEST_IGNORE:
case STATE_REQUEST_OPERATIONAL:
targetState = newState;
break;
case STATE_REQUEST_NON_OPERATIONAL:
default:
return INVALID_TARGET_STATE;
}
targetState.setValid(true);
targetState.commit();
return HasReturnvaluesIF::RETURN_OK;
}