FillsNode.hh
4.58 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/*
* FillsNode.hh
*
* Created on: 14/08/2014
* Author: AKKA
*/
#ifndef FILLSNODE_HH_
#define FILLSNODE_HH_
#include "NodeCfg.hh"
#include "CommonNode.hh"
#include "FillSerieConstant.hh"
#include "FillSerieSerie.hh"
namespace plot {
class FillSerieConstantNode: public AMDA::XMLConfigurator::NodeCfg {
public:
FillSerieConstantNode() : AMDA::XMLConfigurator::NodeCfg() {
}
virtual ~FillSerieConstantNode() {}
void proceed(xmlNodePtr pNode, const AMDA::Parameters::CfgContext& pContext) {
LOG4CXX_DEBUG(gLogger, "FillSerieConstantNode::proceed");
xmlChar* value = NULL;
// Retrieve panel where to store fills informations
Panel* panel = pContext.get<Panel*>();
// Build a new FillSerieConstant and populate it...
boost::shared_ptr<FillSerieConstant> fillSerieConstant (new FillSerieConstant ());
// -- serieId
value = xmlGetProp(pNode, (const xmlChar *) "serieId");
if (value) {
fillSerieConstant->setSerieId(atoi((const char*) value));
xmlFree(value);
}
// -- constantId
value = xmlGetProp(pNode, (const xmlChar *) "constantId");
if (value) {
fillSerieConstant->setConstantId(atoi((const char*) value));
xmlFree(value);
}
// -- colorGreater (ColorGreaterSpecified set To false if no color specified in the request)
value = xmlGetProp(pNode, (const xmlChar *) "colorGreater");
if (value) {
fillSerieConstant->setColorGreaterSpecified(true);
updateColor( fillSerieConstant->getColorGreater(), pNode,(const xmlChar*)"colorGreater",(const xmlChar*)"colorMapIndex");
xmlFree(value);
} else {
fillSerieConstant->setColorGreaterSpecified(false);
}
// -- colorLess (ColorLessSpecified set To false if no color specified in the request)
value = xmlGetProp(pNode, (const xmlChar *) "colorLess");
if (value) {
fillSerieConstant->setColorLessSpecified(true);
updateColor( fillSerieConstant->getColorLess(), pNode,(const xmlChar*)"colorLess",(const xmlChar*)"colorMapIndex");
xmlFree(value);
} else {
fillSerieConstant->setColorLessSpecified(false);
}
// Add the new FillSerieConstant informations to the panel
panel->_fillSerieConstants.push_back (fillSerieConstant);
}
};
class FillSerieSerieNode: public AMDA::XMLConfigurator::NodeCfg {
public:
FillSerieSerieNode() : AMDA::XMLConfigurator::NodeCfg() {
}
virtual ~FillSerieSerieNode() {}
void proceed(xmlNodePtr pNode, const AMDA::Parameters::CfgContext& pContext) {
LOG4CXX_DEBUG(gLogger, "FillSerieSerieNode::proceed");
xmlChar* value = NULL;
// Retrieve panel where to store fills informations
Panel* panel = pContext.get<Panel*>();
// Build a new FillSerieSerie and populate it...
boost::shared_ptr<FillSerieSerie> fillSerieSerie (new FillSerieSerie ());
// -- firstSerieId
value = xmlGetProp(pNode, (const xmlChar *) "firstSerieId");
if (value) {
fillSerieSerie->setFirstSerieId(atoi((const char*) value));
xmlFree(value);
}
// -- secondSerieId
value = xmlGetProp(pNode, (const xmlChar *) "secondSerieId");
if (value) {
fillSerieSerie->setSecondSerieId(atoi((const char*) value));
xmlFree(value);
}
// -- colorGreater (ColorGreaterSpecified set To false if no color specified in the request)
value = xmlGetProp(pNode, (const xmlChar *) "colorGreater");
if (value) {
fillSerieSerie->setColorGreaterSpecified(true);
updateColor( fillSerieSerie->getColorGreater(), pNode,(const xmlChar*)"colorGreater",(const xmlChar*)"colorMapIndex");
xmlFree(value);
} else {
fillSerieSerie->setColorGreaterSpecified(false);
}
// -- colorLess (ColorLessSpecified set To false if no color specified in the request)
value = xmlGetProp(pNode, (const xmlChar *) "colorLess");
if (value) {
fillSerieSerie->setColorLessSpecified(true);
updateColor( fillSerieSerie->getColorLess(), pNode,(const xmlChar*)"colorLess",(const xmlChar*)"colorMapIndex");
xmlFree(value);
} else {
fillSerieSerie->setColorLessSpecified(false);
}
// Add the new FillSerieSerie informations to the panel
panel->_fillSerieSeries.push_back (fillSerieSerie);
}
};
class FillsNode: public AMDA::XMLConfigurator::NodeGrpCfg {
public:
FillsNode() : NodeGrpCfg() {
getChildList()["fillSerieConstant"] = AMDA::XMLConfigurator::NodeCfgSPtr(new FillSerieConstantNode());
getChildList()["fillSerieSerie"] = AMDA::XMLConfigurator::NodeCfgSPtr(new FillSerieSerieNode());
}
virtual ~FillsNode() {}
void proceed(xmlNodePtr pNode, const AMDA::Parameters::CfgContext& pContext) {
LOG4CXX_DEBUG(gLogger, "FillsNode::proceed");
// proceed children
AMDA::XMLConfigurator::NodeGrpCfg::proceed(pNode, pContext);
}
};
} /* namespace plot */
#endif /* FILLSNODE_HH_ */