From e7a96d5ad8dd7169818e624943bcf15b651c0af1 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Mon, 30 Nov 2020 14:13:52 +0100 Subject: [PATCH] it doesnt work? comment it ! --- datapoollocal/LocalDataPoolManager.h | 2 +- datapoollocal/LocalPoolVariable.h | 2 +- datapoollocal/LocalPoolVariable.tpp | 5 +- internalError/InternalErrorDataset.h | 12 +-- thermal/ThermalComponent.cpp | 18 ++-- thermal/ThermalComponent.h | 6 +- thermal/ThermalComponentCore.cpp | 147 ++++++++++++++------------- thermal/ThermalComponentCore.h | 6 +- 8 files changed, 99 insertions(+), 99 deletions(-) diff --git a/datapoollocal/LocalDataPoolManager.h b/datapoollocal/LocalDataPoolManager.h index aca0d4f6..95d48303 100644 --- a/datapoollocal/LocalDataPoolManager.h +++ b/datapoollocal/LocalDataPoolManager.h @@ -20,7 +20,7 @@ namespace Factory { void setStaticFrameworkObjectIds(); } -class LocalDataSetBase; +class LocalPoolDataSetBase; class HousekeepingPacketUpdate; /** diff --git a/datapoollocal/LocalPoolVariable.h b/datapoollocal/LocalPoolVariable.h index 85d86420..75cf570e 100644 --- a/datapoollocal/LocalPoolVariable.h +++ b/datapoollocal/LocalPoolVariable.h @@ -43,7 +43,7 @@ public: * If nullptr, the variable is not registered. * @param setReadWriteMode Specify the read-write mode of the pool variable. */ - LocalPoolVar(lp_id_t poolId, HasLocalDataPoolIF* hkOwner, + LocalPoolVar(HasLocalDataPoolIF* hkOwner, lp_id_t poolId, DataSetIF* dataSet = nullptr, pool_rwm_t setReadWriteMode = pool_rwm_t::VAR_READ_WRITE); diff --git a/datapoollocal/LocalPoolVariable.tpp b/datapoollocal/LocalPoolVariable.tpp index 7025e462..26500e3b 100644 --- a/datapoollocal/LocalPoolVariable.tpp +++ b/datapoollocal/LocalPoolVariable.tpp @@ -6,9 +6,8 @@ #endif template -inline LocalPoolVar::LocalPoolVar(lp_id_t poolId, - HasLocalDataPoolIF* hkOwner, DataSetIF* dataSet, - pool_rwm_t setReadWriteMode): +inline LocalPoolVar::LocalPoolVar(HasLocalDataPoolIF* hkOwner, + lp_id_t poolId, DataSetIF* dataSet, pool_rwm_t setReadWriteMode): LocalPoolObjectBase(poolId, hkOwner, dataSet, setReadWriteMode) {} template diff --git a/internalError/InternalErrorDataset.h b/internalError/InternalErrorDataset.h index 52a4b632..fa91116d 100644 --- a/internalError/InternalErrorDataset.h +++ b/internalError/InternalErrorDataset.h @@ -21,12 +21,12 @@ public: InternalErrorDataset(object_id_t objectId): StaticLocalDataSet(sid_t(objectId , ERROR_SET_ID)) {} - lp_var_t tmHits = lp_var_t(TM_HITS, - hkManager->getOwner(), this); - lp_var_t queueHits = lp_var_t(QUEUE_HITS, - hkManager->getOwner(), this); - lp_var_t storeHits = lp_var_t(STORE_HITS, - hkManager->getOwner(), this); + lp_var_t tmHits = lp_var_t(hkManager->getOwner(), + TM_HITS, this); + lp_var_t queueHits = lp_var_t(hkManager->getOwner(), + QUEUE_HITS, this); + lp_var_t storeHits = lp_var_t(hkManager->getOwner(), + STORE_HITS, this); }; diff --git a/thermal/ThermalComponent.cpp b/thermal/ThermalComponent.cpp index 78b14efd..54bd67bd 100644 --- a/thermal/ThermalComponent.cpp +++ b/thermal/ThermalComponent.cpp @@ -1,9 +1,9 @@ #include "ThermalComponent.h" ThermalComponent::ThermalComponent(object_id_t reportingObjectId, - uint8_t domainId, uint32_t temperaturePoolId, - uint32_t targetStatePoolId, uint32_t currentStatePoolId, - uint32_t requestPoolId, GlobDataSet* dataSet, + uint8_t domainId, gp_id_t temperaturePoolId, + gp_id_t targetStatePoolId, gp_id_t currentStatePoolId, + gp_id_t requestPoolId, LocalPoolDataSetBase* dataSet, AbstractTemperatureSensor* sensor, AbstractTemperatureSensor* firstRedundantSensor, AbstractTemperatureSensor* secondRedundantSensor, @@ -78,13 +78,13 @@ ThermalComponentIF::State ThermalComponent::getState(float temperature, } void ThermalComponent::checkLimits(ThermalComponentIF::State state) { - if (targetState == STATE_REQUEST_OPERATIONAL || targetState == STATE_REQUEST_IGNORE) { - ThermalComponentCore::checkLimits(state); - return; - } + //if (targetState == STATE_REQUEST_OPERATIONAL || targetState == STATE_REQUEST_IGNORE) { + // ThermalComponentCore::checkLimits(state); + // return; + //} //If component is not operational, it checks the NOP limits. - temperatureMonitor.translateState(state, temperature.value, - nopParameters.lowerNopLimit, nopParameters.upperNopLimit, false); + //temperatureMonitor.translateState(state, temperature.value, + // nopParameters.lowerNopLimit, nopParameters.upperNopLimit, false); } ThermalComponentIF::HeaterRequest ThermalComponent::getHeaterRequest( diff --git a/thermal/ThermalComponent.h b/thermal/ThermalComponent.h index d61ff01e..0785a914 100644 --- a/thermal/ThermalComponent.h +++ b/thermal/ThermalComponent.h @@ -45,9 +45,9 @@ public: * @param priority */ ThermalComponent(object_id_t reportingObjectId, uint8_t domainId, - uint32_t temperaturePoolId, uint32_t targetStatePoolId, - uint32_t currentStatePoolId, uint32_t requestPoolId, - GlobDataSet *dataSet, AbstractTemperatureSensor *sensor, + gp_id_t temperaturePoolId, gp_id_t targetStatePoolId, + gp_id_t currentStatePoolId, gp_id_t requestPoolId, + LocalPoolDataSetBase *dataSet, AbstractTemperatureSensor *sensor, AbstractTemperatureSensor *firstRedundantSensor, AbstractTemperatureSensor *secondRedundantSensor, ThermalModuleIF *thermalModule, Parameters parameters, diff --git a/thermal/ThermalComponentCore.cpp b/thermal/ThermalComponentCore.cpp index 07649bf3..53eeb58f 100644 --- a/thermal/ThermalComponentCore.cpp +++ b/thermal/ThermalComponentCore.cpp @@ -3,22 +3,22 @@ ThermalComponentCore::ThermalComponentCore(object_id_t reportingObjectId, uint8_t domainId, gp_id_t temperaturePoolId, gp_id_t targetStatePoolId, gp_id_t currentStatePoolId, - gp_id_t requestPoolId, LocalDataSetBase* dataSet, Parameters parameters, - StateRequest initialTargetState) : + gp_id_t requestPoolId, LocalPoolDataSetBase* dataSet, + Parameters parameters, StateRequest initialTargetState) : temperature(temperaturePoolId, dataSet, PoolVariableIF::VAR_WRITE), targetState(targetStatePoolId, dataSet, PoolVariableIF::VAR_READ), currentState(currentStatePoolId, dataSet, PoolVariableIF::VAR_WRITE), heaterRequest(requestPoolId, dataSet, PoolVariableIF::VAR_WRITE), - parameters(parameters), - temperatureMonitor(reportingObjectId, domainId + 1, - GlobalDataPool::poolIdAndPositionToPid(temperaturePoolId, 0), - COMPONENT_TEMP_CONFIRMATION), domainId(domainId) { + parameters(parameters), domainId(domainId) { + //temperatureMonitor(reportingObjectId, domainId + 1, + // GlobalDataPool::poolIdAndPositionToPid(temperaturePoolId, 0), + // COMPONENT_TEMP_CONFIRMATION), domainId(domainId) { //Set thermal state once, then leave to operator. - GlobDataSet mySet; - gp_uint8_t writableTargetState(targetStatePoolId, &mySet, - PoolVariableIF::VAR_WRITE); - writableTargetState = initialTargetState; - mySet.commit(PoolVariableIF::VALID); + //GlobDataSet mySet; + //gp_uint8_t writableTargetState(targetStatePoolId, &mySet, + // PoolVariableIF::VAR_WRITE); + //writableTargetState = initialTargetState; + //mySet.commit(PoolVariableIF::VALID); } void ThermalComponentCore::addSensor(AbstractTemperatureSensor* sensor) { @@ -57,19 +57,19 @@ ThermalComponentIF::HeaterRequest ThermalComponentCore::performOperation( HeaterRequest request = HEATER_DONT_CARE; //SHOULDDO: Better pass db_float_t* to getTemperature and set it invalid if invalid. temperature = getTemperature(); - updateMinMaxTemp(); - if ((temperature != INVALID_TEMPERATURE)) { - temperature.setValid(PoolVariableIF::VALID); - State state = getState(temperature, getParameters(), targetState); - currentState = state; - checkLimits(state); - request = getHeaterRequest(targetState, temperature, getParameters()); - } else { - temperatureMonitor.setToInvalid(); - temperature.setValid(PoolVariableIF::INVALID); - currentState = UNKNOWN; - request = HEATER_DONT_CARE; - } + //updateMinMaxTemp(); + //if ((temperature != INVALID_TEMPERATURE)) { + //temperature.setValid(PoolVariableIF::VALID); + //State state = getState(temperature, getParameters(), targetState); + //currentState = state; + //checkLimits(state); + //request = getHeaterRequest(targetState, temperature, getParameters()); + //} else { + // temperatureMonitor.setToInvalid(); + // temperature.setValid(PoolVariableIF::INVALID); + // currentState = UNKNOWN; + // request = HEATER_DONT_CARE; + //} currentState.setValid(PoolVariableIF::VALID); heaterRequest = request; heaterRequest.setValid(PoolVariableIF::VALID); @@ -77,11 +77,12 @@ ThermalComponentIF::HeaterRequest ThermalComponentCore::performOperation( } void ThermalComponentCore::markStateIgnored() { - currentState = getIgnoredState(currentState); + //currentState = getIgnoredState(currentState); } object_id_t ThermalComponentCore::getObjectId() { - return temperatureMonitor.getReporterId(); + //return temperatureMonitor.getReporterId(); + return 0; } float ThermalComponentCore::getLowerOpLimit() { @@ -119,7 +120,7 @@ void ThermalComponentCore::setOutputInvalid() { currentState.setValid(PoolVariableIF::INVALID); heaterRequest = HEATER_DONT_CARE; heaterRequest.setValid(PoolVariableIF::INVALID); - temperatureMonitor.setToUnchecked(); + //temperatureMonitor.setToUnchecked(); } float ThermalComponentCore::getTemperature() { @@ -169,8 +170,8 @@ ThermalComponentIF::State ThermalComponentCore::getState(float temperature, void ThermalComponentCore::checkLimits(ThermalComponentIF::State state) { //Checks operational limits only. - temperatureMonitor.translateState(state, temperature.value, - getParameters().lowerOpLimit, getParameters().upperOpLimit); + //temperatureMonitor.translateState(state, temperature.value, + // getParameters().lowerOpLimit, getParameters().upperOpLimit); } @@ -220,17 +221,17 @@ ThermalComponentIF::State ThermalComponentCore::getIgnoredState(int8_t state) { } } -void ThermalComponentCore::updateMinMaxTemp() { - if (temperature == INVALID_TEMPERATURE) { - return; - } - if (temperature < minTemp) { - minTemp = temperature; - } - if (temperature > maxTemp) { - maxTemp = temperature; - } -} +//void ThermalComponentCore::updateMinMaxTemp() { +// if (temperature == INVALID_TEMPERATURE) { +// return; +// } +// if (temperature < minTemp) { +// minTemp = temperature; +// } +// if (temperature > maxTemp) { +// maxTemp = temperature; +// } +//} uint8_t ThermalComponentCore::getDomainId() const { return domainId; @@ -243,38 +244,38 @@ ThermalComponentCore::Parameters ThermalComponentCore::getParameters() { ReturnValue_t ThermalComponentCore::getParameter(uint8_t domainId, uint16_t parameterId, ParameterWrapper* parameterWrapper, const ParameterWrapper* newValues, uint16_t startAtIndex) { - ReturnValue_t result = temperatureMonitor.getParameter(domainId, - parameterId, parameterWrapper, newValues, startAtIndex); - if (result != INVALID_DOMAIN_ID) { - return result; - } - if (domainId != this->domainId) { - return INVALID_DOMAIN_ID; - } - switch (parameterId) { - case 0: - parameterWrapper->set(parameters.heaterOn); - break; - case 1: - parameterWrapper->set(parameters.hysteresis); - break; - case 2: - parameterWrapper->set(parameters.heaterSwitchoff); - break; - case 3: - parameterWrapper->set(minTemp); - break; - case 4: - parameterWrapper->set(maxTemp); - break; - case 10: - parameterWrapper->set(parameters.lowerOpLimit); - break; - case 11: - parameterWrapper->set(parameters.upperOpLimit); - break; - default: - return INVALID_IDENTIFIER_ID; - } + //ReturnValue_t result = temperatureMonitor.getParameter(domainId, + // parameterId, parameterWrapper, newValues, startAtIndex); +// if (result != INVALID_DOMAIN_ID) { +// return result; +// } +// if (domainId != this->domainId) { +// return INVALID_DOMAIN_ID; +// } +// switch (parameterId) { +// case 0: +// parameterWrapper->set(parameters.heaterOn); +// break; +// case 1: +// parameterWrapper->set(parameters.hysteresis); +// break; +// case 2: +// parameterWrapper->set(parameters.heaterSwitchoff); +// break; +// case 3: +// parameterWrapper->set(minTemp); +// break; +// case 4: +// parameterWrapper->set(maxTemp); +// break; +// case 10: +// parameterWrapper->set(parameters.lowerOpLimit); +// break; +// case 11: +// parameterWrapper->set(parameters.upperOpLimit); +// break; +// default: +// return INVALID_IDENTIFIER_ID; +// } return HasReturnvaluesIF::RETURN_OK; } diff --git a/thermal/ThermalComponentCore.h b/thermal/ThermalComponentCore.h index 49ca098e..6ef59058 100644 --- a/thermal/ThermalComponentCore.h +++ b/thermal/ThermalComponentCore.h @@ -41,7 +41,7 @@ public: ThermalComponentCore(object_id_t reportingObjectId, uint8_t domainId, gp_id_t temperaturePoolId, gp_id_t targetStatePoolId, gp_id_t currentStatePoolId, gp_id_t requestPoolId, - LocalDataSetBase* dataSet, Parameters parameters, + LocalPoolDataSetBase* dataSet, Parameters parameters, StateRequest initialTargetState = ThermalComponentIF::STATE_REQUEST_OPERATIONAL); @@ -96,7 +96,7 @@ protected: Parameters parameters; - ThermalMonitorReporter temperatureMonitor; + //ThermalMonitorReporter temperatureMonitor; const uint8_t domainId; @@ -111,7 +111,7 @@ protected: virtual State getIgnoredState(int8_t state); - void updateMinMaxTemp(); + //void updateMinMaxTemp(); virtual Parameters getParameters(); };