IntervalTickNode.cc
1.9 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
/*
* IntervalTickNode.cc
*
* Created on: Jan 26, 2015
* Author: AKKA
*/
#include "IntervalTickNode.hh"
#include "NodeCfg.hh"
#include "PlotLogger.hh"
#include "SeriesProperties.hh"
#include "CommonNode.hh"
namespace plot {
void IntervalTickNode::proceed(xmlNodePtr pNode_,const AMDA::Parameters::CfgContext& pContext_){
LOG4CXX_DEBUG(gLogger, "IntervalTickNode::proceed");
DrawingProperties* props = pContext_.get<DrawingProperties*>();
IntervalTickProperties & itProps = props->getIntervalTickProperties();
// read attributes :
xmlChar* value = NULL;
// TODO see if we have some default config values to retrieve...
// overwrites default values if any...
// -- color attributes
updateColor (itProps.getColor(), pNode_, (const xmlChar *)"color", (const xmlChar *)"colorMapIndex");
// -- mode attributes
value = xmlGetProp(pNode_, (const xmlChar *)"mode");
if( value ){
if (strcmp((const char*)value, "symbol-only") == 0)
itProps.setMode(IntervalTickMode::SYMBOL_ONLY);
else if (strcmp((const char*)value, "interval-index") == 0)
itProps.setMode(IntervalTickMode::INTERVAL_INDEX);
else if (strcmp((const char*)value, "start-time") == 0)
itProps.setMode(IntervalTickMode::START_TIME);
else if (strcmp((const char*)value, "start-stop-time") == 0)
itProps.setMode(IntervalTickMode::START_STOP_TIME);
else
{
LOG4CXX_WARN(gLogger,
"Unknown interval tick mode => set to IntervalTickMode::SYMBOL_ONLY");
itProps.setMode(IntervalTickMode::SYMBOL_ONLY);
}
xmlFree(value);
}
else
itProps.setMode(IntervalTickMode::SYMBOL_ONLY);
// Push DrawingProperties & IntervalTickProperties in a new context
// before proceeding childs node
AMDA::Parameters::CfgContext context;
context.push<DrawingProperties *> (props);
context.push<IntervalTickProperties *> (&itProps);
// proceed children
AMDA::XMLConfigurator::NodeGrpCfg::proceed(pNode_, context);
}
} /* namespace plot */