ProcessMexVexElsDecode.cc
2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
* ProcessMexVexElsDecode.cc
*
* Created on: Oct 14, 2016
* Author: elena
*/
#include <stdlib.h>
#include <string>
#include <boost/lexical_cast.hpp>
#include "DicError.hh"
#include "AMDA_exception.hh"
#include "Operation.hh"
#include "ParameterManager.hh"
#include "ProcessMexVexElsDecode.hh"
#include "MexVexElsDecodeCreator.hh"
//#include "MexVexElsDecode.hh"
#include "ParamMgr.hh"
#include "ParameterCreatorFromExpression.hh"
using namespace std;
using namespace boost;
using namespace log4cxx;
namespace AMDA {
namespace Parameters {
ProcessMexVexElsDecode::ProcessMexVexElsDecode(Parameter ¶meter) : MultiParamProcess_CRTP(parameter) {
}
ProcessMexVexElsDecode::ProcessMexVexElsDecode(const ProcessMexVexElsDecode& pProcess, Parameter ¶meter)
: MultiParamProcess_CRTP(pProcess,parameter), _energyTableName(pProcess._energyTableName), _inputParamName(pProcess._inputParamName) {
}
ProcessMexVexElsDecode::~ProcessMexVexElsDecode() {
}
void ProcessMexVexElsDecode::parse() {
ParameterCreatorFromExpression creator(_parameter.getParameterManager());
ParameterSPtr lParameter = creator.getOneParameterFromExpression(_parameter,_expression, isUserProcess());
_paramNameList[lParameter->getId()].first = lParameter;
_inputParamName = lParameter->getId();
if (_attributList.size() != 1) {
BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_PROCESS_ERR) << AMDA::ex_msg(std::string("ProcessMexVexElsDecode::parse require one attribute'")));
}
if (_attributList[0] != _expression) {
lParameter = creator.getOneParameterFromExpression(_parameter,_attributList[0], isUserProcess());
_paramNameList[lParameter->getId()].first = lParameter;
_energyTableName = lParameter->getId();
}
else {
_energyTableName = lParameter->getId();
}
}
void ProcessMexVexElsDecode::establishConnection() {
parse();
MultiParamProcess::establishConnection();
}
TimeStamp ProcessMexVexElsDecode::init() {
TimeStamp timeStamp = MultiParamProcess::init();
ParamData* lmainParamInput = _paramNameList[_inputParamName].first->getParamData(this).get();
ParamData* lenergyTableParamInput = _paramNameList[_energyTableName].first->getParamData(this).get();
MexVexElsDecodeCreator lMexVexElsDecodeCreator(*this, *lmainParamInput, *lenergyTableParamInput);
_operation = lMexVexElsDecodeCreator.getOperation();
_paramData = ParamDataSPtr(_operation->getParamOutput());
_paramData->setMinSampling(lmainParamInput->getMinSampling());
return timeStamp;
}
} /* namespace Parameters */
} /* namespace AMDA */