Commit 99a73aaf91ec7018442e386cf6c467aed6d1befe
1 parent
381f60f0
Exists in
master
and in
100 other branches
Add panel index support
Showing
4 changed files
with
27 additions
and
3 deletions
Show diff stats
config/DataBaseParameters/xsd/request/plot.xsd
src/ParamOutputImpl/Plot/Panel.cc
... | ... | @@ -20,6 +20,7 @@ int Panel::PANEL_COUNTER = -1; |
20 | 20 | |
21 | 21 | Panel::Panel() : |
22 | 22 | _id(--PANEL_COUNTER), |
23 | + _index(-1), | |
23 | 24 | _resolution(0), |
24 | 25 | _updateTitleOnNextInterval(false), |
25 | 26 | _bounds(Bounds()), |
... | ... | @@ -43,6 +44,7 @@ Panel::Panel() : |
43 | 44 | |
44 | 45 | Panel::Panel(DefaultPlotConfiguration& defaults) : |
45 | 46 | _id(--PANEL_COUNTER), |
47 | + _index(defaults._defaultPanel._index), | |
46 | 48 | _resolution(defaults._defaultPanel._resolution), |
47 | 49 | _updateTitleOnNextInterval(false), |
48 | 50 | _bounds(Bounds()), |
... | ... | @@ -65,6 +67,7 @@ Panel::Panel(DefaultPlotConfiguration& defaults) : |
65 | 67 | |
66 | 68 | Panel::Panel(Page* page) : |
67 | 69 | _id(--PANEL_COUNTER), |
70 | + _index(-1), | |
68 | 71 | _resolution(DefaultPlotConfiguration::getInstance()._defaultPanel._resolution), |
69 | 72 | _updateTitleOnNextInterval(false), |
70 | 73 | _bounds(Bounds()), |
... | ... | @@ -283,9 +286,18 @@ void Panel::drawEmptyPanel(std::shared_ptr<plstream>& pls) |
283 | 286 | |
284 | 287 | //Draw text |
285 | 288 | PlPlotUtil::setPlFont(_font); |
286 | - std::string emptyText = "Empty panel (Id : "; | |
287 | - emptyText += std::to_string(_id); | |
288 | - emptyText += ")"; | |
289 | + std::string emptyText = "Empty panel "; | |
290 | + if (_index > -1) | |
291 | + { | |
292 | + emptyText += "#"; | |
293 | + emptyText += std::to_string(_index); | |
294 | + } | |
295 | + else { | |
296 | + emptyText += "(Id : "; | |
297 | + emptyText += std::to_string(_id); | |
298 | + emptyText += ")"; | |
299 | + } | |
300 | + | |
289 | 301 | pls->ptex (0.5, 0.5, 0.5, 0, 0.5, emptyText.c_str()); |
290 | 302 | |
291 | 303 | // Set window size. | ... | ... |
src/ParamOutputImpl/Plot/Panel.hh
src/ParamOutputImpl/Plot/PanelNode.cc
... | ... | @@ -57,6 +57,12 @@ void PanelNode::proceed(xmlNodePtr pNode, |
57 | 57 | xmlFree(value); |
58 | 58 | } |
59 | 59 | |
60 | + // -- index | |
61 | + if ((value = xmlGetProp(pNode, (const xmlChar *) "index"))) { | |
62 | + panel->_index = atoi((const char*) value); | |
63 | + xmlFree(value); | |
64 | + } | |
65 | + | |
60 | 66 | // -- resolution |
61 | 67 | if ((value = xmlGetProp(pNode, (const xmlChar *) "resolution"))) { |
62 | 68 | panel->_resolution = atoi((const char*) value); | ... | ... |