From 193183ca5b67941655f08859146b212d97b6dcc2 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Tue, 17 Nov 2020 10:15:52 +0100 Subject: [PATCH] Give the possibility to define some parameters time restriction in a request + Apply time restriction on paramaters (#5768) --- config/xsd/request/request.xsd | 13 +++++++++++++ src/ParamGetImpl/DDServerInterface/ParamGetDDBase.cc | 25 +++---------------------- src/ParamGetImpl/DDServerInterface/ParamGetDDBase.hh | 6 ------ src/ParamGetImpl/DDServerInterface/Pusher.hh | 231 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------- src/ParamGetImpl/DDServerInterface/VirtualInstrument.cc | 5 ++++- src/ParamGetImpl/DDServerInterface/VirtualInstrument.hh | 2 +- src/Parameters/ParamOutput.cc | 10 ++++++++++ src/Parameters/Parameter.cc | 1 + src/Parameters/Parameter.hh | 10 ++++++++++ src/Parameters/ParameterManager.hh | 13 +++++++++++++ src/XMLRequest/XMLRequestParser.cc | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 11 files changed, 252 insertions(+), 111 deletions(-) diff --git a/config/xsd/request/request.xsd b/config/xsd/request/request.xsd index 2883965..67f7d2f 100644 --- a/config/xsd/request/request.xsd +++ b/config/xsd/request/request.xsd @@ -27,6 +27,19 @@ + + + + + + + + + + + + + diff --git a/src/ParamGetImpl/DDServerInterface/ParamGetDDBase.cc b/src/ParamGetImpl/DDServerInterface/ParamGetDDBase.cc index 043e5bd..6e6497e 100644 --- a/src/ParamGetImpl/DDServerInterface/ParamGetDDBase.cc +++ b/src/ParamGetImpl/DDServerInterface/ParamGetDDBase.cc @@ -55,7 +55,7 @@ namespace AMDA { /// Create ParamData _vi = VirtualInstrumentManager::getInstance()->getVirtualInstrument( _viName); - _pusher = _vi->getParamPusher(_parName, _maxDim1Size, _maxDim2Size, _maxDim3Size, _dim3Num, _dim3CutIndex, _minSumIndex, _maxSumIndex); + _pusher = _vi->getParamPusher(_parName, _maxDim1Size, _maxDim2Size, _maxDim3Size, _dim3Num, _dim3CutIndex, _minSumIndex, _maxSumIndex, _parameter.getTimeRestriction()); //Param info AMDA::Info::ParamInfoSPtr paramInfo = AMDA::Info::ParamMgr::getInstance()->getParamInfoFromId(_parameter.getInfoId(),true); if ((paramInfo != nullptr) && (isnan(_pusher->getFillValue())) && (!isnan(paramInfo->getOriginalFillValue()))) @@ -114,8 +114,8 @@ namespace AMDA { else { do { result += lPacket->data->VarNumber; - _pusher->put(lPacket->data.get()); - updateTimeInParamData(lPacket->time.get()); + LOG4CXX_DEBUG(gLogger, "put data " << lPacket->data->VarNumber); + _pusher->put(lPacket->data.get(), lPacket->time.get()); delete lPacket; } while( ( lPacket = _paramFlow->tryGet())); @@ -144,25 +144,6 @@ namespace AMDA { return result; } - void ParamGetDDBase::updateTimeInParamData(DD_data_t* data) { - LOG4CXX_DEBUG(gLogger, "updateTimeInParamData data->VarNumber = " << data->VarNumber); - //ParamData is created, add data - //The capacity must be == at Data - double t = 0.; - for (int index = 0; index < data->VarNumber; index++) { - if (data->type == DD_CHAR) { - t = DD_Time2Double((char *) data->Variables[index]); - } - else if (data->type == DD_DOUBLE) { - t = *((double*)data->Variables[index]); - } - else { - BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::ex_msg("Unknown time type")); - } - _paramData->getTimeList().push_back(t); - } - } - void ParamGetDDBase::getDDInfo() { for (InfoRequestList::iterator lIt = _infoRequestList.begin(); lIt != _infoRequestList.end(); ++lIt) { diff --git a/src/ParamGetImpl/DDServerInterface/ParamGetDDBase.hh b/src/ParamGetImpl/DDServerInterface/ParamGetDDBase.hh index fbacb0f..1ae7ef2 100644 --- a/src/ParamGetImpl/DDServerInterface/ParamGetDDBase.hh +++ b/src/ParamGetImpl/DDServerInterface/ParamGetDDBase.hh @@ -141,12 +141,6 @@ namespace AMDA { private: /** - * @brief update time in the ParamData - * @details Must be call after createParamData - */ - void updateTimeInParamData(DD_data_t *data); - - /** * Create ParamData from getDataTypeInfo. */ void createParamData(); diff --git a/src/ParamGetImpl/DDServerInterface/Pusher.hh b/src/ParamGetImpl/DDServerInterface/Pusher.hh index 33527d5..a498eba 100644 --- a/src/ParamGetImpl/DDServerInterface/Pusher.hh +++ b/src/ParamGetImpl/DDServerInterface/Pusher.hh @@ -24,9 +24,9 @@ namespace Base { * of the corresponding type ( scalar or vector or Tab2D of short or int or float or double or ... type). */ struct Pusher { - Pusher (int maxDim1Size=1,int maxDim2Size=1) : _maxDim1Size(maxDim1Size), _maxDim2Size(maxDim2Size), _paramData(NULL), _fillValue(NAN) {} + Pusher (int maxDim1Size=1,int maxDim2Size=1) : _maxDim1Size(maxDim1Size), _maxDim2Size(maxDim2Size), _paramData(NULL), _fillValue(NAN), _timeRestriction(NAN) {} virtual ~Pusher() {} - virtual void put(DD_data_t *data) = 0; + virtual void put(DD_data_t *data, DD_data_t *timeData) = 0; virtual void putNaN() = 0; void setFillValue(double pFillValue) { _fillValue = pFillValue; @@ -34,11 +34,35 @@ namespace Base { double getFillValue() { return _fillValue; } + void setTimeRestriction(double timeRestriction) { + _timeRestriction = timeRestriction; + } + double getTimeRestriction() { + return _timeRestriction; + } + + double getTimeByIndex(DD_data_t* data, int index) { + if (index >= data->VarNumber) { + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::ex_msg("Try to access to a time outside of the available range")); + } + if (data->type == DD_CHAR) { + return DD_Time2Double((char *) data->Variables[index]); + } + else if (data->type == DD_DOUBLE) { + return *((double*)data->Variables[index]); + } + else { + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::ex_msg("Unknown time type")); + } + return 0.; + } + int _maxDim1Size; /*!< Used for vector and Tab2D */ int _maxDim2Size; /*!< Used for Tab2D */ ParamData* _paramData; /*!< return ParamData to a Process*/ protected: float _fillValue; /*!< When this value is different of NAN, into the raw data, it is replaced by NAN into ParamData. */ + double _timeRestriction; }; } @@ -85,102 +109,117 @@ public: _paramData = _specParamData = createParamData(); } - void put(DD_data_t *data) { + void put(DD_data_t *data, DD_data_t *timeData) { BaseElemenType **lData = reinterpret_cast(data->Variables); //ParamData is created, add data _specParamData->getDataList().resize(data->VarNumber); + if(_dim3CutIndex == -1 && _minSumIndex != -1 && _maxSumIndex != -1){ + for (int index = 0; index < data->VarNumber; index++) { + double t = getTimeByIndex(timeData, index); + _paramData->getTimeList().push_back(t); - if(_dim3CutIndex == -1 && _minSumIndex != -1 && _maxSumIndex != -1){ - for (int index = 0; index < data->VarNumber; index++) { - ElemenType elem = ElemenType(_maxDim1Size,_maxDim2Size); - elem << NotANumber(); - for (int dim1Index= 0; dim1Index < data->Dimensions[_dim1Num]; ++dim1Index) - { - for (int dim2Index= 0; dim2Index < data->Dimensions[_dim2Num]; ++dim2Index) - { - BaseElemenType cumulatedElement; - cumulatedElement << NotANumber() ; - for(int sumIndex=_minSumIndex; sumIndex <= _maxSumIndex; ++sumIndex){ - int dataIndex = 0; - if (_dim3Num >= 0 && _dim3Num < 3 && data->DimNumber == 3) { - int curentIndex = (sumIndex >= 0 && sumIndex < data->Dimensions[_dim3Num]) ? sumIndex : 0; - if (_dim3Num == 0) { - dataIndex = curentIndex*data->Dimensions[_dim1Num]*data->Dimensions[_dim2Num] + dim1Index*data->Dimensions[_dim2Num] + dim2Index; - } - else if (_dim3Num == 1) { - dataIndex = dim1Index*data->Dimensions[_dim2Num]*data->Dimensions[_dim3Num] + curentIndex*data->Dimensions[_dim2Num] + dim2Index; - } - else { - dataIndex = dim1Index*data->Dimensions[_dim2Num]*data->Dimensions[_dim3Num] + dim2Index*data->Dimensions[_dim3Num] + curentIndex; - } + if ((getTimeRestriction() > 0) && !isnan(getTimeRestriction())) { + if (t >= getTimeRestriction()) { + putNaN(); + continue; } - else { - dataIndex = dim1Index*data->Dimensions[_dim2Num]+dim2Index; - } - BaseElemenType baseElem = lData[index][dataIndex]; - if (!isnan(_fillValue)) - { - double crt_val = baseElem; - bool is_fill_value = isApproximatelyEqual(crt_val, _fillValue); - if(is_fill_value) - baseElem << NotANumber(); + } + + ElemenType elem = ElemenType(_maxDim1Size,_maxDim2Size); + elem << NotANumber(); + for (int dim1Index= 0; dim1Index < data->Dimensions[_dim1Num]; ++dim1Index) + { + for (int dim2Index= 0; dim2Index < data->Dimensions[_dim2Num]; ++dim2Index) + { + BaseElemenType cumulatedElement; + cumulatedElement << NotANumber() ; + for(int sumIndex=_minSumIndex; sumIndex <= _maxSumIndex; ++sumIndex){ + int dataIndex = 0; + if (_dim3Num >= 0 && _dim3Num < 3 && data->DimNumber == 3) { + int curentIndex = (sumIndex >= 0 && sumIndex < data->Dimensions[_dim3Num]) ? sumIndex : 0; + if (_dim3Num == 0) { + dataIndex = curentIndex*data->Dimensions[_dim1Num]*data->Dimensions[_dim2Num] + dim1Index*data->Dimensions[_dim2Num] + dim2Index; + } + else if (_dim3Num == 1) { + dataIndex = dim1Index*data->Dimensions[_dim2Num]*data->Dimensions[_dim3Num] + curentIndex*data->Dimensions[_dim2Num] + dim2Index; + } + else { + dataIndex = dim1Index*data->Dimensions[_dim2Num]*data->Dimensions[_dim3Num] + dim2Index*data->Dimensions[_dim3Num] + curentIndex; + } + } + else { + dataIndex = dim1Index*data->Dimensions[_dim2Num]+dim2Index; + } + BaseElemenType baseElem = lData[index][dataIndex]; + if (!isnan(_fillValue)) + { + double crt_val = baseElem; + bool is_fill_value = isApproximatelyEqual(crt_val, _fillValue); + if(is_fill_value) + baseElem << NotANumber(); + } + if (!isNAN(baseElem)) { + if (isNAN(cumulatedElement)) + cumulatedElement << ElemNull(); + cumulatedElement += baseElem; + } + } + elem[dim1Index][dim2Index] = cumulatedElement; } - if (!isNAN(baseElem)) { - if (isNAN(cumulatedElement)) - cumulatedElement << ElemNull(); - cumulatedElement += baseElem; - } - } - elem[dim1Index][dim2Index] = cumulatedElement; - } - } - _specParamData->getDataList().push_back(elem); + _specParamData->getDataList().push_back(elem); } - - - - }else{ - for (int index = 0; index < data->VarNumber; index++) { - ElemenType elem = ElemenType(_maxDim1Size,_maxDim2Size); - elem << NotANumber(); - for (int dim1Index= 0; dim1Index < data->Dimensions[_dim1Num]; ++dim1Index) - { - for (int dim2Index= 0; dim2Index < data->Dimensions[_dim2Num]; ++dim2Index) + }else{ + for (int index = 0; index < data->VarNumber; index++) { + double t = getTimeByIndex(timeData, index); + _paramData->getTimeList().push_back(t); + + if ((getTimeRestriction() > 0) && !isnan(getTimeRestriction())) { + if (getTimeByIndex(data, index) >= getTimeRestriction()) { + putNaN(); + continue; + } + } + + ElemenType elem = ElemenType(_maxDim1Size,_maxDim2Size); + elem << NotANumber(); + for (int dim1Index= 0; dim1Index < data->Dimensions[_dim1Num]; ++dim1Index) { - int dataIndex = 0; - if (_dim3Num >= 0 && _dim3Num < 3 && data->DimNumber == 3) { - int cutIndex = (_dim3CutIndex >= 0 && _dim3CutIndex < data->Dimensions[_dim3Num]) ? _dim3CutIndex : 0; - if (_dim3Num == 0) { - dataIndex = cutIndex*data->Dimensions[_dim1Num]*data->Dimensions[_dim2Num] + dim1Index*data->Dimensions[_dim2Num] + dim2Index; - } - else if (_dim3Num == 1) { - dataIndex = dim1Index*data->Dimensions[_dim2Num]*data->Dimensions[_dim3Num] + cutIndex*data->Dimensions[_dim2Num] + dim2Index; + for (int dim2Index= 0; dim2Index < data->Dimensions[_dim2Num]; ++dim2Index) + { + int dataIndex = 0; + if (_dim3Num >= 0 && _dim3Num < 3 && data->DimNumber == 3) { + int cutIndex = (_dim3CutIndex >= 0 && _dim3CutIndex < data->Dimensions[_dim3Num]) ? _dim3CutIndex : 0; + if (_dim3Num == 0) { + dataIndex = cutIndex*data->Dimensions[_dim1Num]*data->Dimensions[_dim2Num] + dim1Index*data->Dimensions[_dim2Num] + dim2Index; + } + else if (_dim3Num == 1) { + dataIndex = dim1Index*data->Dimensions[_dim2Num]*data->Dimensions[_dim3Num] + cutIndex*data->Dimensions[_dim2Num] + dim2Index; + } + else { + dataIndex = dim1Index*data->Dimensions[_dim2Num]*data->Dimensions[_dim3Num] + dim2Index*data->Dimensions[_dim3Num] + cutIndex; + } } else { - dataIndex = dim1Index*data->Dimensions[_dim2Num]*data->Dimensions[_dim3Num] + dim2Index*data->Dimensions[_dim3Num] + cutIndex; + dataIndex = dim1Index*data->Dimensions[_dim2Num]+dim2Index; } + BaseElemenType baseElem = lData[index][dataIndex]; + if (!isnan(_fillValue)) + { + double crt_val = baseElem; + bool is_fill_value = isApproximatelyEqual(crt_val, _fillValue); + if(is_fill_value) + baseElem << NotANumber(); + } + elem[dim1Index][dim2Index] = baseElem; } - else { - dataIndex = dim1Index*data->Dimensions[_dim2Num]+dim2Index; - } - BaseElemenType baseElem = lData[index][dataIndex]; - if (!isnan(_fillValue)) - { - double crt_val = baseElem; - bool is_fill_value = isApproximatelyEqual(crt_val, _fillValue); - if(is_fill_value) - baseElem << NotANumber(); - } - elem[dim1Index][dim2Index] = baseElem; } + _specParamData->getDataList().push_back(elem); } - _specParamData->getDataList().push_back(elem); } - } } void putNaN() { @@ -231,13 +270,23 @@ public: _paramData = _specParamData = createParamData(); } - void put(DD_data_t *data) { + void put(DD_data_t *data, DD_data_t *timeData) { BaseElemenType **lData = reinterpret_cast(data->Variables); //ParamData is created, add data _specParamData->getDataList().resize(data->VarNumber); for (int index = 0; index < data->VarNumber; index++) { + double t = getTimeByIndex(timeData, index); + _paramData->getTimeList().push_back(t); + + if ((getTimeRestriction() > 0) && !isnan(getTimeRestriction())) { + if (t >= getTimeRestriction()) { + putNaN(); + continue; + } + } + ElemenType elem = ElemenType(); elem.resize(_maxDim1Size); elem << NotANumber(); @@ -290,7 +339,7 @@ public: _paramData = _specParamData = createParamData(); } - void put(DD_data_t *data) { + void put(DD_data_t *data, DD_data_t *timeData) { BaseElemenType **lData = reinterpret_cast(data->Variables); //ParamData is created, add data @@ -303,6 +352,16 @@ public: BaseElemenType nanElem; nanElem << NotANumber(); for (int index = 0; index < data->VarNumber; index++) { + double t = getTimeByIndex(timeData, index); + _paramData->getTimeList().push_back(t); + + if ((getTimeRestriction() > 0) && !isnan(getTimeRestriction())) { + if (t >= getTimeRestriction()) { + putNaN(); + continue; + } + } + double crt_val = *lData[index]; bool is_fill_value = isApproximatelyEqual(crt_val, _fillValue); if(!is_fill_value) { @@ -314,6 +373,16 @@ public: } else { for (int index = 0; index < data->VarNumber; index++) { + double t = getTimeByIndex(timeData, index); + _paramData->getTimeList().push_back(t); + + if ((getTimeRestriction() > 0) && !isnan(getTimeRestriction())) { + if (t >= getTimeRestriction()) { + putNaN(); + continue; + } + } + _specParamData->getDataList().push_back(*lData[index]); } diff --git a/src/ParamGetImpl/DDServerInterface/VirtualInstrument.cc b/src/ParamGetImpl/DDServerInterface/VirtualInstrument.cc index 87f186f..2bac3f7 100644 --- a/src/ParamGetImpl/DDServerInterface/VirtualInstrument.cc +++ b/src/ParamGetImpl/DDServerInterface/VirtualInstrument.cc @@ -196,7 +196,7 @@ namespace DDServerInterface { } //TODO Replace by DD_Client::getParamType - AMDA::Parameters::Base::Pusher* VirtualInstrument::getParamPusher( const std::string& pParName, int maxDim1Size, int maxDim2Size, int maxDim3Size, int dim3Num, int dim3CutIndex, int minSumIndex, int maxSumIndex) { + AMDA::Parameters::Base::Pusher* VirtualInstrument::getParamPusher( const std::string& pParName, int maxDim1Size, int maxDim2Size, int maxDim3Size, int dim3Num, int dim3CutIndex, int minSumIndex, int maxSumIndex, double timeRestriction) { AMDA::Parameters::Base::Pusher* lPusher = nullptr; int error = 0; @@ -340,6 +340,9 @@ namespace DDServerInterface { BOOST_THROW_EXCEPTION(exception() << errno_code(AMDA_TYPE_DATA_UNKNOWN)); } lPusher->setFillValue(_fillValue); + if (timeRestriction > 0. && !isnan(timeRestriction)) { + lPusher->setTimeRestriction(timeRestriction); + } } else { LOG4CXX_INFO(gLogger, "VirtualInstrument::getParamPusher( "<< lId <<", " << pParName << ") returns = (" << error << ")"); lDDClient.DD_Close(lId); diff --git a/src/ParamGetImpl/DDServerInterface/VirtualInstrument.hh b/src/ParamGetImpl/DDServerInterface/VirtualInstrument.hh index ab37c5a..7c53661 100644 --- a/src/ParamGetImpl/DDServerInterface/VirtualInstrument.hh +++ b/src/ParamGetImpl/DDServerInterface/VirtualInstrument.hh @@ -83,7 +83,7 @@ public: /** * @brief Responsible push data into the good container. */ - AMDA::Parameters::Base::Pusher* getParamPusher(const std::string& pParName, int maxDim1Size, int maxDim2Size, int maxDim3Size, int dim3Num, int dim3CutIndex, int minSumIndex, int maxSumIndex); + AMDA::Parameters::Base::Pusher* getParamPusher(const std::string& pParName, int maxDim1Size, int maxDim2Size, int maxDim3Size, int dim3Num, int dim3CutIndex, int minSumIndex, int maxSumIndex, double timeRestriction); /** * @return a ParamFlowSPtr on the specified interval. diff --git a/src/Parameters/ParamOutput.cc b/src/Parameters/ParamOutput.cc index c93c4c8..7436368 100644 --- a/src/Parameters/ParamOutput.cc +++ b/src/Parameters/ParamOutput.cc @@ -46,6 +46,16 @@ void ParamOutput::init(TimeIntervalListSPtr pTimeIntervalList) { } _currentTimeInterval = _timeIntervalList->begin(); + + // Update params time restrictions + std::map paramsTimeRestrictions = _parameterManager.getParamsTimeRestrictions(); + for (std::map::iterator it = paramsTimeRestrictions.begin(); it != paramsTimeRestrictions.end(); ++it) { + ParameterSPtr p = _parameterManager.getParameter(it->first); + if (p != nullptr) { + p->setTimeRestriction(it->second); + } + } + init(); } diff --git a/src/Parameters/Parameter.cc b/src/Parameters/Parameter.cc index 47d0c91..9ba42b3 100644 --- a/src/Parameters/Parameter.cc +++ b/src/Parameters/Parameter.cc @@ -34,6 +34,7 @@ namespace Parameters { _timeResolution(0) , _gapThreshold(pParamMng.getDefaultGapThreshold()) , _referenceParameter(""), + _timeRestriction(NAN), establishConnectionToDo(true){ } diff --git a/src/Parameters/Parameter.hh b/src/Parameters/Parameter.hh index 8002826..d9159eb 100644 --- a/src/Parameters/Parameter.hh +++ b/src/Parameters/Parameter.hh @@ -196,6 +196,14 @@ namespace AMDA { return _isTableIndexParam; } + void setTimeRestriction(double restriction) { + _timeRestriction = restriction; + } + + double getTimeRestriction() { + return _timeRestriction; + } + protected: typedef std::map DataClientList; @@ -270,6 +278,8 @@ namespace AMDA { static bool _isTableIndexParam; + double _timeRestriction; + private: bool establishConnectionToDo; }; diff --git a/src/Parameters/ParameterManager.hh b/src/Parameters/ParameterManager.hh index 4ebddcf..9472045 100644 --- a/src/Parameters/ParameterManager.hh +++ b/src/Parameters/ParameterManager.hh @@ -155,6 +155,14 @@ namespace AMDA ParameterSPtr findParamInParameterList(const std::string& paramId); + void addParamTimeRestriction(const std::string& paramId, double restriction) { + _paramsTimeRestrictions[paramId] = restriction; + } + + std::map getParamsTimeRestrictions() { + return _paramsTimeRestrictions; + } + protected: /** * @return The real parameter if the process is empty. @@ -197,6 +205,11 @@ private: * @brief default value for the gap threshold of all parameters */ double _defaultGapThreshold; + + /* + * @bried define some parameters time restrictions + */ + std::map _paramsTimeRestrictions; }; } /* namespace Parameters */ diff --git a/src/XMLRequest/XMLRequestParser.cc b/src/XMLRequest/XMLRequestParser.cc index 14aa69f..ed115da 100644 --- a/src/XMLRequest/XMLRequestParser.cc +++ b/src/XMLRequest/XMLRequestParser.cc @@ -28,6 +28,7 @@ #include "Catalog.hh" #include +#include // Using namespace using namespace log4cxx; @@ -297,6 +298,43 @@ public: } }; +class ParamTimeRestrictionNode : public NodeCfg +{ +public: + void proceed(xmlNodePtr pNode,const AMDA::Parameters::CfgContext& pContext) { + ParameterManager* lParameterManager = pContext.get(); + + xmlChar* lParamName = xmlGetProp(pNode, (const xmlChar *) "id"); + std::string paramNameStr; + if (lParamName) { + paramNameStr = std::string((char*)lParamName); + xmlFree(lParamName); + } + else { + ERROR_EXCEPTION( ERROR_MANDATORY_ATTRIBUTE_MISSING << pNode->name << "@id") + } + + xmlChar* lRestrictionTime = xmlGetProp(pNode, (const xmlChar *) "restriction"); + double restrictionTime = NAN; + if (lRestrictionTime) { + std::string restrictionTimeStr = std::string((char*)lRestrictionTime); + xmlFree(lRestrictionTime); + try + { + restrictionTime = boost::lexical_cast(restrictionTimeStr); + } + catch (boost::bad_lexical_cast &) + { + } + } + else { + ERROR_EXCEPTION( ERROR_MANDATORY_ATTRIBUTE_MISSING << pNode->name << "@restriction") + } + + lParameterManager->addParamTimeRestriction(paramNameStr, restrictionTime); + } +}; + XMLRequestParser::XMLRequestParser(const char* pXSDFile) : XMLConfigurator(pXSDFile,false) { /* @@ -310,6 +348,9 @@ XMLRequestParser::XMLRequestParser(const char* pXSDFile) : XMLConfigurator(pXSDF 0000000100000000 + + + ISO @@ -352,6 +393,12 @@ XMLRequestParser::XMLRequestParser(const char* pXSDFile) : XMLConfigurator(pXSDF } } { + // Params time restrictions node + NodeGrpCfg* lParamsTimeRestrictionsNode = new NodeGrpCfg(); + lRequestNode->getChildList()["paramsTimeRestrictions"] = NodeCfgSPtr(lParamsTimeRestrictionsNode); + lParamsTimeRestrictionsNode->getChildList()["param"] = NodeCfgSPtr(new ParamTimeRestrictionNode); + } + { // Output group node NodeGrpCfg* lOutputNode = new NodeGrpCfg(); lRequestNode->getChildList()["outputs"] = NodeCfgSPtr(lOutputNode); -- libgit2 0.21.2