ErrorBarNode.cc
2.29 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
81
82
83
84
85
86
87
88
/*
* ErrorBarNode.cc
*
* Created on: July 22, 2014
* Author: AKKA
*/
#include "ErrorBarNode.hh"
#include <libxml/tree.h>
#include <iosfwd>
#include "NodeCfg.hh"
#include "PlotLogger.hh"
#include "SeriesProperties.hh"
#include "ErrorBarProperties.hh"
#include "CommonNode.hh"
namespace plot {
void ErrorMinMaxNode::proceed(xmlNodePtr pNode,const AMDA::Parameters::CfgContext& pContext_){
LOG4CXX_DEBUG(gLogger, "ErrorMinMaxNode::proceed");
ErrorBarProperties* errorBarProps = pContext_.get<ErrorBarProperties*>();
boost::shared_ptr<ErrorMinMaxProperties> errorMinMax(new ErrorMinMaxProperties ());
xmlChar* value = NULL;
// -- paramMin
if ((value = xmlGetProp(pNode, (const xmlChar *) "paramMin"))) {
errorMinMax->setOriginalParamMin((const char*) value);
xmlFree(value);
}
// -- paramMax
if ((value = xmlGetProp(pNode, (const xmlChar *) "paramMax"))) {
errorMinMax->setOriginalParamMax((const char*) value);
xmlFree(value);
}
errorBarProps->setErrorMinMax(errorMinMax);
// proceed children
AMDA::XMLConfigurator::NodeGrpCfg::proceed(pNode, pContext_);
}
void ErrorDeltaNode::proceed(xmlNodePtr pNode,const AMDA::Parameters::CfgContext& pContext_){
LOG4CXX_DEBUG(gLogger, "ErrorDeltaNode::proceed");
ErrorBarProperties* errorBarProps = pContext_.get<ErrorBarProperties*>();
boost::shared_ptr<ErrorMinMaxProperties> errorDelta(new ErrorMinMaxProperties ());
xmlChar* value = NULL;
// -- param
if ((value = xmlGetProp(pNode, (const xmlChar *) "param"))) {
errorDelta->setOriginalParamMin((const char*) value);
errorDelta->setOriginalParamMax((const char*) value);
xmlFree(value);
}
errorBarProps->setErrorMinMax(errorDelta);
// proceed children
AMDA::XMLConfigurator::NodeGrpCfg::proceed(pNode, pContext_);
}
void ErrorBarNode::proceed(xmlNodePtr pNode_,const AMDA::Parameters::CfgContext& pContext_){
LOG4CXX_DEBUG(gLogger, "ErrorBarNode::proceed");
DrawingProperties* props = pContext_.get<DrawingProperties*>();
ErrorBarProperties & ebProps = props->getErrorBarProperties();
// Push DrawingProperties & TimeTickProperties in a new context
// before proceeding childs node
AMDA::Parameters::CfgContext context;
context.push<ErrorBarProperties *> (&ebProps);
// proceed children
AMDA::XMLConfigurator::NodeGrpCfg::proceed(pNode_, context);
}
} /* namespace plot */