Commit 99a73aaf91ec7018442e386cf6c467aed6d1befe

Authored by Benjamin Renard
1 parent 381f60f0

Add panel index support

config/DataBaseParameters/xsd/request/plot.xsd
... ... @@ -562,6 +562,7 @@
562 562 type="xs:string">
563 563 </xs:attribute>
564 564 <xs:attribute name="id" type="xs:integer"></xs:attribute>
  565 + <xs:attribute name="index" type="xs:integer"></xs:attribute>
565 566 </xs:complexType>
566 567 </xs:element>
567 568 </xs:sequence>
... ...
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&amp; 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&lt;plstream&gt;&amp; 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
... ... @@ -148,6 +148,11 @@ public:
148 148 int _id;
149 149  
150 150 /**
  151 + * @brief Panel index
  152 + */
  153 + int _index;
  154 +
  155 + /**
151 156 * @brief Number of points per plot
152 157 */
153 158 int _resolution;
... ...
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);
... ...