ParamPlotNode.cc
1.1 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
/*
* ParamPlotNode.cc
*
* Created on: Nov 14, 2014
* Author: m.mazel
*/
#include "ParamPlotNode.hh"
#include "ParamPlotParser.hh"
#include "PlotLogger.hh"
// #include "Helper.hh"
#include "Properties.hh"
namespace plot {
void ParamPlotNode::proceed(xmlNodePtr pNode, const AMDA::Parameters::CfgContext& pContext) {
LOG4CXX_DEBUG(gLogger, "ParamPlotNode::proceed");
xmlChar* value = NULL;
// -- paramId for the parameter containing plot definition
value = xmlGetProp(pNode, (const xmlChar *) "id");
if (value) {
std::string id = std::string ((const char*) value);
xmlFree(value);
// Retrieve application properties
AMDA::helpers::Properties lProperties("app.properties");
// Build a param file parser for the parameter (<plot> element) node
ParamPlotParser parser(lProperties["app.parameter.xsd"].c_str());
// Build xml filename associated with the parameter
std::string xmlFileName = lProperties["app.param.path"] + "/" + id + ".xml";
// Parse parameter xml file (<plot> element section) and build the associated plot
parser.parse (xmlFileName, pContext);
}
}
} /* namespace plot */