Commit c0e7e5be9e68e526cc88ddc2de7f1d3410b2567b
1 parent
17f69bd1
Exists in
master
and in
66 other branches
Add integration for epoch plot and layouts definitions
Showing
11 changed files
with
477 additions
and
15 deletions
Show diff stats
@@ -0,0 +1,20 @@ | @@ -0,0 +1,20 @@ | ||
1 | +<?xml version="1.0"?> | ||
2 | +<timetable xml:id="cat_0"> | ||
3 | + <name>epoch-plot-test</name> | ||
4 | + <created>2015-08-25T06:42:17</created> | ||
5 | + <description>Catalog used to test epoch plot</description> | ||
6 | + <nbIntervals>2</nbIntervals> | ||
7 | + <parameters> | ||
8 | + <parameter id="center_time" name="Event center time" size="1" type="String" unit="" description="Event center time" ucd="time.epoch" utype=""/> | ||
9 | + </parameters> | ||
10 | + <intervals> | ||
11 | + <start>2008-01-01T00:00:00</start> | ||
12 | + <stop>2008-01-02T00:00:00</stop> | ||
13 | + <param>2008-01-01T06:00:00</param> | ||
14 | + </intervals> | ||
15 | + <intervals> | ||
16 | + <start>2008-01-03T00:00:00</start> | ||
17 | + <stop>2008-01-04T00:00:00</stop> | ||
18 | + <param>2008-01-03T18:00:00</param> | ||
19 | + </intervals> | ||
20 | +</timetable> |
src/InputOutput/IHMImpl/Params/IHMInputOutputParamsAbstractClass.php
@@ -52,7 +52,7 @@ abstract class IHMInputOutputParamsAbstractClass implements InputOutputInterface | @@ -52,7 +52,7 @@ abstract class IHMInputOutputParamsAbstractClass implements InputOutputInterface | ||
52 | /* | 52 | /* |
53 | * @brief Unmarshall the time definition from the IHM request | 53 | * @brief Unmarshall the time definition from the IHM request |
54 | */ | 54 | */ |
55 | - protected function unmarshallTimeDefinition($input, $requestIndex) | 55 | + protected function unmarshallTimeDefinition($input, $requestIndex, $initTTIndex = false) |
56 | { | 56 | { |
57 | $timesNode = $this->paramsData->getRequestNodes()[$requestIndex]->getTimesNode(); | 57 | $timesNode = $this->paramsData->getRequestNodes()[$requestIndex]->getTimesNode(); |
58 | 58 | ||
@@ -66,7 +66,10 @@ abstract class IHMInputOutputParamsAbstractClass implements InputOutputInterface | @@ -66,7 +66,10 @@ abstract class IHMInputOutputParamsAbstractClass implements InputOutputInterface | ||
66 | else | 66 | else |
67 | $ttPath = IHMConfigClass::getUserTTPath(); | 67 | $ttPath = IHMConfigClass::getUserTTPath(); |
68 | $ttPath .= ($tt->id.".xml"); | 68 | $ttPath .= ($tt->id.".xml"); |
69 | - $timesNode->addTimeTable($ttPath); | 69 | + if (strpos($tt->id, "cat_") === 0) |
70 | + $timesNode->addCatalog($ttPath,$initTTIndex ? 0 : -1); | ||
71 | + else | ||
72 | + $timesNode->addTimeTable($ttPath,$initTTIndex ? 0 : -1); | ||
70 | } | 73 | } |
71 | break; | 74 | break; |
72 | case "Interval" : | 75 | case "Interval" : |
src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
@@ -30,7 +30,7 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | @@ -30,7 +30,7 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | ||
30 | $paramsNode = $requestNode->getParamsNode(); | 30 | $paramsNode = $requestNode->getParamsNode(); |
31 | 31 | ||
32 | //unmarshall time definition | 32 | //unmarshall time definition |
33 | - $this->unmarshallTimeDefinition($input, $requestIndex); | 33 | + $this->unmarshallTimeDefinition($input, $requestIndex, !$tab->{'page-superpose-mode'}); |
34 | 34 | ||
35 | $plotOutputNode = $outputsNode->addNewOutput(RequestOutputTypeEnum::PLOT); | 35 | $plotOutputNode = $outputsNode->addNewOutput(RequestOutputTypeEnum::PLOT); |
36 | 36 | ||
@@ -144,7 +144,11 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | @@ -144,7 +144,11 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | ||
144 | if ($tab->{'page-font-activated'}) | 144 | if ($tab->{'page-font-activated'}) |
145 | $this->unmarshallFont($tab, 'page', $pageNode->getFont()); | 145 | $this->unmarshallFont($tab, 'page', $pageNode->getFont()); |
146 | 146 | ||
147 | - $pageNode->getLayout()->setType(RequestOutputPlotLayoutTypeEnum::VERTICAL); | 147 | + //Superpose mode |
148 | + $pageNode->setSuperposeMode($tab->{'page-superpose-mode'} ? "true": "false"); | ||
149 | + | ||
150 | + //Layout | ||
151 | + $this->unmarshallLayout($tab, $pageNode); | ||
148 | 152 | ||
149 | foreach ($tab->{'panels'} as $panelData) | 153 | foreach ($tab->{'panels'} as $panelData) |
150 | $this->unmarshallPanel($panelData, $pageNode, $paramsNode); | 154 | $this->unmarshallPanel($panelData, $pageNode, $paramsNode); |
@@ -184,10 +188,74 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | @@ -184,10 +188,74 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | ||
184 | return $this->paramsData; | 188 | return $this->paramsData; |
185 | } | 189 | } |
186 | 190 | ||
191 | + protected function unmarshallLayout($tab, $pageNode) | ||
192 | + { | ||
193 | + switch ($tab->{'page-layout-type'}) | ||
194 | + { | ||
195 | + case 'vertical' : | ||
196 | + $pageNode->getLayout()->setType(RequestOutputPlotLayoutTypeEnum::VERTICAL); | ||
197 | + $pageNode->getLayout()->setPanelHeight($tab->{'page-layout-object'}->{'layout-panel-height'}); | ||
198 | + $pageNode->getLayout()->setPanelSpacing($tab->{'page-layout-object'}->{'layout-panel-spacing'}); | ||
199 | + $pageNode->getLayout()->setExpand($tab->{'page-layout-object'}->{'layout-expand'} ? "true" : "false"); | ||
200 | + //if ($tab->{'page-layout-object'}->{'layout-timeplot-width'} > 0) | ||
201 | + // $pageNode->setDefaultTimePlotWidth($tab->{'page-layout-object'}->{'layout-timeplot-width'}); | ||
202 | + if ($tab->{'page-layout-object'}->{'layout-timeplot-height'} > 0) | ||
203 | + $pageNode->setDefaultTimePlotHeight($tab->{'page-layout-object'}->{'layout-timeplot-height'}); | ||
204 | + if ($tab->{'page-layout-object'}->{'layout-xyplot-width'} > 0) | ||
205 | + $pageNode->setDefaultXYPlotWidth($tab->{'page-layout-object'}->{'layout-xyplot-width'}); | ||
206 | + if ($tab->{'page-layout-object'}->{'layout-xyplot-height'} > 0) | ||
207 | + $pageNode->setDefaultXYPlotHeight($tab->{'page-layout-object'}->{'layout-xyplot-height'}); | ||
208 | + break; | ||
209 | + case 'auto' : | ||
210 | + $pageNode->getLayout()->setType(RequestOutputPlotLayoutTypeEnum::AUTO); | ||
211 | + $pageNode->getLayout()->setPanelHeight($tab->{'page-layout-object'}->{'layout-panel-height'}); | ||
212 | + $pageNode->getLayout()->setPanelSpacing($tab->{'page-layout-object'}->{'layout-panel-spacing'}); | ||
213 | + $pageNode->getLayout()->setExpand($tab->{'page-layout-object'}->{'layout-expand'} ? "true" : "false"); | ||
214 | + break; | ||
215 | + case 'manual' : | ||
216 | + $pageNode->getLayout()->setType(RequestOutputPlotLayoutTypeEnum::MANUAL); | ||
217 | + $timePlotLeftMargin = $tab->{'page-layout-object'}->{'layout-timeplot-margin-left'} ? $tab->{'page-layout-object'}->{'layout-timeplot-margin-left'} : -1; | ||
218 | + $timePlotRightMargin = $tab->{'page-layout-object'}->{'layout-timeplot-margin-right'} ? $tab->{'page-layout-object'}->{'layout-timeplot-margin-right'} : -1; | ||
219 | + $pageNode->setDefaultTimePlotXMargin($timePlotLeftMargin, $timePlotRightMargin); | ||
220 | + $xyPlotLeftMargin = $tab->{'page-layout-object'}->{'layout-xyplot-margin-left'} ? $tab->{'page-layout-object'}->{'layout-xyplot-margin-left'} : -1; | ||
221 | + $xyPlotRightMargin = $tab->{'page-layout-object'}->{'layout-xyplot-margin-right'} ? $tab->{'page-layout-object'}->{'layout-xyplot-margin-right'} : -1; | ||
222 | + $pageNode->setDefaultXYPlotXMargin($xyPlotLeftMargin, $xyPlotRightMargin); | ||
223 | + break; | ||
224 | + default: | ||
225 | + throw new Exception('Layout type not implemented.'); | ||
226 | + } | ||
227 | + | ||
228 | + } | ||
229 | + | ||
187 | protected function unmarshallPanel($panelData, $pageNode, $paramsNode) | 230 | protected function unmarshallPanel($panelData, $pageNode, $paramsNode) |
188 | { | 231 | { |
189 | $panelNode = $pageNode->addPanel(); | 232 | $panelNode = $pageNode->addPanel(); |
190 | 233 | ||
234 | + | ||
235 | + switch ($pageNode->getLayout()->getType()) | ||
236 | + { | ||
237 | + case RequestOutputPlotLayoutTypeEnum::MANUAL : | ||
238 | + //Panel bounds | ||
239 | + $panelNode->getBounds()->setX($panelData->{'panel-bounds-x'}); | ||
240 | + $panelNode->getBounds()->setY($panelData->{'panel-bounds-y'}); | ||
241 | + $panelNode->getBounds()->setWidth($panelData->{'panel-bounds-width'}); | ||
242 | + $panelNode->getBounds()->setHeight($panelData->{'panel-bounds-height'}); | ||
243 | + //Panel margins | ||
244 | + $leftMargin = $panelData->{'panel-margin-left'} ? $panelData->{'panel-margin-left'} : -1; | ||
245 | + $rightMargin = $panelData->{'panel-margin-right'} ? $panelData->{'panel-margin-right'} : -1; | ||
246 | + $panelNode->setXMargin($leftMargin, $rightMargin); | ||
247 | + break; | ||
248 | + case RequestOutputPlotLayoutTypeEnum::VERTICAL : | ||
249 | + //Panel prefered dimensions | ||
250 | + if ($panelData->{'panel-prefered-width'} > 0) | ||
251 | + $panelNode->setPreferedWidth($panelData->{'panel-prefered-width'}); | ||
252 | + if ($panelData->{'panel-prefered-height'} > 0) | ||
253 | + $panelNode->setPreferedHeight($panelData->{'panel-prefered-height'}); | ||
254 | + break; | ||
255 | + default : | ||
256 | + //Nothing to do | ||
257 | + } | ||
258 | + | ||
191 | //Panel background color | 259 | //Panel background color |
192 | if (($panelData->{'panel-background-color'} != 'none') && ($panelData->{'panel-background-color'} != '')) | 260 | if (($panelData->{'panel-background-color'} != 'none') && ($panelData->{'panel-background-color'} != '')) |
193 | $panelNode->setBackgroundColor($this->hexColor2KernelColor($panelData->{'panel-background-color'})); | 261 | $panelNode->setBackgroundColor($this->hexColor2KernelColor($panelData->{'panel-background-color'})); |
@@ -252,6 +320,7 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | @@ -252,6 +320,7 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | ||
252 | break; | 320 | break; |
253 | case 'xyPlot' : | 321 | case 'xyPlot' : |
254 | $plotNode = $panelNode->addPlotElement(RequestOutputPlotElementTypeEnum::XYPLOT); | 322 | $plotNode = $panelNode->addPlotElement(RequestOutputPlotElementTypeEnum::XYPLOT); |
323 | + $plotNode->setIsIsotropic($panelData->{'panel-scatter-isotropic'}); | ||
255 | break; | 324 | break; |
256 | case 'statusPlot' : | 325 | case 'statusPlot' : |
257 | $plotNode = $panelNode->addPlotElement(RequestOutputPlotElementTypeEnum::STATUSPLOT); | 326 | $plotNode = $panelNode->addPlotElement(RequestOutputPlotElementTypeEnum::STATUSPLOT); |
@@ -271,6 +340,12 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | @@ -271,6 +340,12 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | ||
271 | if ($panelData->{'panel-tick-format'} != '') | 340 | if ($panelData->{'panel-tick-format'} != '') |
272 | $plotNode->setFormat($panelData->{'panel-tick-format'}); | 341 | $plotNode->setFormat($panelData->{'panel-tick-format'}); |
273 | break; | 342 | break; |
343 | + case 'epochPlot' : | ||
344 | + $plotNode = $panelNode->addPlotElement(RequestOutputPlotElementTypeEnum::EPOCHPLOT); | ||
345 | + if ($panelData->{'panel-epoch-centertimeid'} == '') | ||
346 | + throw new Exception('Center Time Id not defined for an Epoch Plot.'); | ||
347 | + $plotNode->setCenterTimeId($panelData->{'panel-epoch-centertimeid'}); | ||
348 | + break; | ||
274 | default: | 349 | default: |
275 | throw new Exception('Plot type not implemented.'); | 350 | throw new Exception('Plot type not implemented.'); |
276 | } | 351 | } |
@@ -483,6 +558,19 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | @@ -483,6 +558,19 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | ||
483 | 558 | ||
484 | foreach ($serieNodes as $serieNode) | 559 | foreach ($serieNodes as $serieNode) |
485 | { | 560 | { |
561 | + //Resampling | ||
562 | + if ($plotNode->getName() == REQUESTOUTPUTPLOTELEMENTXY_NAME) | ||
563 | + { | ||
564 | + switch ($paramDrawingData->{'serie-resampling-mode'}) | ||
565 | + { | ||
566 | + case 'yparam' : | ||
567 | + $serieNode->getResampling()->setType(RequestOutputPlotResamplingTypeEnum::YPARAM); | ||
568 | + break; | ||
569 | + case 'xparam' : | ||
570 | + default : | ||
571 | + $serieNode->getResampling()->setType(RequestOutputPlotResamplingTypeEnum::XPARAM); | ||
572 | + } | ||
573 | + } | ||
486 | //Line | 574 | //Line |
487 | $this->unmarshallLine($paramDrawingData, 'serie', $serieNode->getLine()); | 575 | $this->unmarshallLine($paramDrawingData, 'serie', $serieNode->getLine()); |
488 | //Symbol | 576 | //Symbol |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotAxesNodeClass.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | require_once("RequestOutputPlotTimeAxisNodeClass.php"); | 3 | require_once("RequestOutputPlotTimeAxisNodeClass.php"); |
4 | +require_once("RequestOutputPlotEpochAxisNodeClass.php"); | ||
4 | require_once("RequestOutputPlotDigitalAxisNodeClass.php"); | 5 | require_once("RequestOutputPlotDigitalAxisNodeClass.php"); |
5 | require_once("RequestOutputPlotColorAxisNodeClass.php"); | 6 | require_once("RequestOutputPlotColorAxisNodeClass.php"); |
6 | 7 | ||
@@ -74,6 +75,19 @@ class RequestOutputPlotAxesNodeClass extends NodeClass | @@ -74,6 +75,19 @@ class RequestOutputPlotAxesNodeClass extends NodeClass | ||
74 | 75 | ||
75 | return $timeAxisNode; | 76 | return $timeAxisNode; |
76 | } | 77 | } |
78 | + | ||
79 | + public function getEpochAxis() | ||
80 | + { | ||
81 | + $axisNode = $this->getChildInstanceByName(RequestOutputPlotAxisTypeEnum::XAXIS); | ||
82 | + $epochAxisNode = $axisNode->getFirstChildByName(REQUESTOUTPUTPLOTEPOCHAXIS_NAME); | ||
83 | + if (!isset($epochAxisNode)) | ||
84 | + { | ||
85 | + $epochAxisNode = new RequestOutputPlotEpochAxisNodeClass(); | ||
86 | + $axisNode->addChild($epochAxisNode); | ||
87 | + } | ||
88 | + | ||
89 | + return $epochAxisNode; | ||
90 | + } | ||
77 | 91 | ||
78 | public function getColorAxis() | 92 | public function getColorAxis() |
79 | { | 93 | { |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementEpochNodeClass.php
0 → 100644
@@ -0,0 +1,55 @@ | @@ -0,0 +1,55 @@ | ||
1 | +<?php | ||
2 | + | ||
3 | +require_once("RequestOutputPlotElementNodeClass.php"); | ||
4 | + | ||
5 | +define ("REQUESTOUTPUTPLOTELEMENTEPOCH_NAME", "epochPlot"); | ||
6 | +define ("REQUESTOUTPUTPLOTELEMENTEPOCH_CENTERTIMEID", "centerTimeId"); | ||
7 | + | ||
8 | +/** | ||
9 | + * @class RequestOutputPlotElementEpochNodeClass | ||
10 | + * @brief Definition of a epoch plot element for a panel of a plot request | ||
11 | + * @details | ||
12 | +*/ | ||
13 | +class RequestOutputPlotElementEpochNodeClass extends RequestOutputPlotElementNodeClass | ||
14 | +{ | ||
15 | + public function __construct() | ||
16 | + { | ||
17 | + parent::__construct(REQUESTOUTPUTPLOTELEMENTEPOCH_NAME,true,true,true,false,false,false); | ||
18 | + //force epoch axis creation | ||
19 | + $this->getAxes()->getEpochAxis(); | ||
20 | + //force color axis creation | ||
21 | + $this->getAxes()->getColorAxis(); | ||
22 | + } | ||
23 | + | ||
24 | + public function getEpochAxis() | ||
25 | + { | ||
26 | + return $this->getAxes()->getEpochAxis(); | ||
27 | + } | ||
28 | + | ||
29 | + public function addYAxis($id) | ||
30 | + { | ||
31 | + return $this->getAxes()->addDigitalAxis(RequestOutputPlotAxisTypeEnum::YAXIS,$id); | ||
32 | + } | ||
33 | + | ||
34 | + public function getYAxis($id) | ||
35 | + { | ||
36 | + return $this->getAxes()->getDigitalAxis(RequestOutputPlotAxisTypeEnum::YAXIS,$id); | ||
37 | + } | ||
38 | + | ||
39 | + public function getZAxis() | ||
40 | + { | ||
41 | + return $this->getAxes()->getColorAxis(); | ||
42 | + } | ||
43 | + | ||
44 | + public function setCenterTimeId($centerTimeId) | ||
45 | + { | ||
46 | + $this->setAttribute(REQUESTOUTPUTPLOTELEMENTEPOCH_CENTERTIMEID, $centerTimeId); | ||
47 | + } | ||
48 | + | ||
49 | + public function getCenterTimeId() | ||
50 | + { | ||
51 | + return $this->getAttribute(REQUESTOUTPUTPLOTELEMENTEPOCH_CENTERTIMEID); | ||
52 | + } | ||
53 | +} | ||
54 | + | ||
55 | +?> | ||
0 | \ No newline at end of file | 56 | \ No newline at end of file |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotPageNodeClass.php
@@ -9,6 +9,13 @@ define ("REQUESTOUTPUTPLOTPAGE_FORMAT", "format"); | @@ -9,6 +9,13 @@ define ("REQUESTOUTPUTPLOTPAGE_FORMAT", "format"); | ||
9 | define ("REQUESTOUTPUTPLOTPAGE_DIMENSION", "dimension"); | 9 | define ("REQUESTOUTPUTPLOTPAGE_DIMENSION", "dimension"); |
10 | define ("REQUESTOUTPUTPLOTPAGE_ORIENTATION", "orientation"); | 10 | define ("REQUESTOUTPUTPLOTPAGE_ORIENTATION", "orientation"); |
11 | define ("REQUESTOUTPUTPLOTPAGE_MODE", "mode"); | 11 | define ("REQUESTOUTPUTPLOTPAGE_MODE", "mode"); |
12 | +define ("REQUESTOUTPUTPLOTPAGE_SUPERPOSEMODE", "superposeMode"); | ||
13 | +define ("REQUESTOUTPUTPLOTPAGE_DEFAULTTIMEPLOTWIDTH", "defaultTimePlotWidth"); | ||
14 | +define ("REQUESTOUTPUTPLOTPAGE_DEFAULTTIMEPLOTHEIGHT", "defaultTimePlotHeight"); | ||
15 | +define ("REQUESTOUTPUTPLOTPAGE_DEFAULTXYPLOTWIDTH", "defaultXYPlotWidth"); | ||
16 | +define ("REQUESTOUTPUTPLOTPAGE_DEFAULTXYPLOTHEIGHT", "defaultXYPlotHeight"); | ||
17 | +define ("REQUESTOUTPUTPLOTPAGE_DEFAULTTIMEPLOTXMARGIN", "defaultTimePlotXMargin"); | ||
18 | +define ("REQUESTOUTPUTPLOTPAGE_DEFAULTXYPLOTXMARGIN", "defaultXYPlotXMargin"); | ||
12 | 19 | ||
13 | abstract class RequestOutputPlotPageFormatEnum | 20 | abstract class RequestOutputPlotPageFormatEnum |
14 | { | 21 | { |
@@ -156,6 +163,66 @@ class RequestOutputPlotPageNodeClass extends NodeClass | @@ -156,6 +163,66 @@ class RequestOutputPlotPageNodeClass extends NodeClass | ||
156 | { | 163 | { |
157 | return $this->getAttribute(REQUESTOUTPUTPLOTPAGE_MODE); | 164 | return $this->getAttribute(REQUESTOUTPUTPLOTPAGE_MODE); |
158 | } | 165 | } |
166 | + | ||
167 | + public function setSuperposeMode($superposeMode) | ||
168 | + { | ||
169 | + $this->setAttribute(REQUESTOUTPUTPLOTPAGE_SUPERPOSEMODE, $superposeMode); | ||
170 | + } | ||
171 | + | ||
172 | + public function getSuperposeMode() | ||
173 | + { | ||
174 | + return $this->getAttribute(REQUESTOUTPUTPLOTPAGE_SUPERPOSEMODE); | ||
175 | + } | ||
176 | + | ||
177 | + public function setDefaultTimePlotWidth($width) | ||
178 | + { | ||
179 | + $this->setAttribute(REQUESTOUTPUTPLOTPAGE_DEFAULTTIMEPLOTWIDTH, $width); | ||
180 | + } | ||
181 | + | ||
182 | + public function getDefaultTimePlotWidth() | ||
183 | + { | ||
184 | + return $this->getAttribute(REQUESTOUTPUTPLOTPAGE_DEFAULTTIMEPLOTWIDTH); | ||
185 | + } | ||
186 | + | ||
187 | + public function setDefaultTimePlotHeight($height) | ||
188 | + { | ||
189 | + $this->setAttribute(REQUESTOUTPUTPLOTPAGE_DEFAULTTIMEPLOTHEIGHT, $height); | ||
190 | + } | ||
191 | + | ||
192 | + public function getDefaultTimePlotHeight() | ||
193 | + { | ||
194 | + return $this->getAttribute(REQUESTOUTPUTPLOTPAGE_DEFAULTTIMEPLOTHEIGHT); | ||
195 | + } | ||
196 | + | ||
197 | + public function setDefaultXYPlotWidth($width) | ||
198 | + { | ||
199 | + $this->setAttribute(REQUESTOUTPUTPLOTPAGE_DEFAULTXYPLOTWIDTH, $width); | ||
200 | + } | ||
201 | + | ||
202 | + public function getDefaultXYPlotWidth() | ||
203 | + { | ||
204 | + return $this->getAttribute(REQUESTOUTPUTPLOTPAGE_DEFAULTXYPLOTWIDTH); | ||
205 | + } | ||
206 | + | ||
207 | + public function setDefaultXYPlotHeight($height) | ||
208 | + { | ||
209 | + $this->setAttribute(REQUESTOUTPUTPLOTPAGE_DEFAULTXYPLOTHEIGHT, $height); | ||
210 | + } | ||
211 | + | ||
212 | + public function getDefaultXYPlotHeight() | ||
213 | + { | ||
214 | + return $this->getAttribute(REQUESTOUTPUTPLOTPAGE_DEFAULTXYPLOTHEIGHT); | ||
215 | + } | ||
216 | + | ||
217 | + public function setDefaultTimePlotXMargin($left, $right) | ||
218 | + { | ||
219 | + $this->setAttribute(REQUESTOUTPUTPLOTPAGE_DEFAULTTIMEPLOTXMARGIN, "[".$left.",".$right."]"); | ||
220 | + } | ||
221 | + | ||
222 | + public function setDefaultXYPlotXMargin($left, $right) | ||
223 | + { | ||
224 | + $this->setAttribute(REQUESTOUTPUTPLOTPAGE_DEFAULTXYPLOTXMARGIN, "[".$left.",".$right."]"); | ||
225 | + } | ||
159 | } | 226 | } |
160 | 227 | ||
161 | ?> | 228 | ?> |
162 | \ No newline at end of file | 229 | \ No newline at end of file |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotPanelBoundsNodeClass.php
0 → 100644
@@ -0,0 +1,62 @@ | @@ -0,0 +1,62 @@ | ||
1 | +<?php | ||
2 | + | ||
3 | +define ("REQUESTOUTPUTPLOTPANELBOUNDS_NAME", "bounds"); | ||
4 | +define ("REQUESTOUTPUTPLOTPANELBOUNDS_X", "x"); | ||
5 | +define ("REQUESTOUTPUTPLOTPANELBOUNDS_Y", "y"); | ||
6 | +define ("REQUESTOUTPUTPLOTPANELBOUNDS_WIDTH", "width"); | ||
7 | +define ("REQUESTOUTPUTPLOTPANELBOUNDS_HEIGHT", "height"); | ||
8 | + | ||
9 | +/** | ||
10 | + * @class RequestOutputPlotPanelBoundsNodeClass | ||
11 | + * @brief Definition of panel bounds for a plot request | ||
12 | + * @details | ||
13 | +*/ | ||
14 | +class RequestOutputPlotPanelBoundsNodeClass extends NodeClass | ||
15 | +{ | ||
16 | + public function __construct() | ||
17 | + { | ||
18 | + parent::__construct(REQUESTOUTPUTPLOTPANELBOUNDS_NAME); | ||
19 | + } | ||
20 | + | ||
21 | + public function setX($x) | ||
22 | + { | ||
23 | + $this->setAttribute(REQUESTOUTPUTPLOTPANELBOUNDS_X, $x); | ||
24 | + } | ||
25 | + | ||
26 | + public function getX() | ||
27 | + { | ||
28 | + return $this->getAttribute(REQUESTOUTPUTPLOTPANELBOUNDS_X); | ||
29 | + } | ||
30 | + | ||
31 | + public function setY($y) | ||
32 | + { | ||
33 | + $this->setAttribute(REQUESTOUTPUTPLOTPANELBOUNDS_Y, $y); | ||
34 | + } | ||
35 | + | ||
36 | + public function getY() | ||
37 | + { | ||
38 | + return $this->getAttribute(REQUESTOUTPUTPLOTPANELBOUNDS_Y); | ||
39 | + } | ||
40 | + | ||
41 | + public function setWidth($width) | ||
42 | + { | ||
43 | + $this->setAttribute(REQUESTOUTPUTPLOTPANELBOUNDS_WIDTH, $width); | ||
44 | + } | ||
45 | + | ||
46 | + public function getWidth() | ||
47 | + { | ||
48 | + return $this->getAttribute(REQUESTOUTPUTPLOTPANELBOUNDS_WIDTH); | ||
49 | + } | ||
50 | + | ||
51 | + public function setHeight($height) | ||
52 | + { | ||
53 | + $this->setAttribute(REQUESTOUTPUTPLOTPANELBOUNDS_HEIGHT, $height); | ||
54 | + } | ||
55 | + | ||
56 | + public function getHeight() | ||
57 | + { | ||
58 | + return $this->getAttribute(REQUESTOUTPUTPLOTPANELBOUNDS_HEIGHT); | ||
59 | + } | ||
60 | +} | ||
61 | + | ||
62 | +?> | ||
0 | \ No newline at end of file | 63 | \ No newline at end of file |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotPanelNodeClass.php
@@ -8,13 +8,17 @@ require_once("RequestOutputPlotElementTickNodeClass.php"); | @@ -8,13 +8,17 @@ require_once("RequestOutputPlotElementTickNodeClass.php"); | ||
8 | define ("REQUESTOUTPUTPLOTPANEL_NAME", "panel"); | 8 | define ("REQUESTOUTPUTPLOTPANEL_NAME", "panel"); |
9 | define ("REQUESTOUTPUTPLOTPANEL_TITLE", "title"); | 9 | define ("REQUESTOUTPUTPLOTPANEL_TITLE", "title"); |
10 | define ("REQUESTOUTPUTPLOTPANEL_BACKGROUNDCOLOR", "backgroundColor"); | 10 | define ("REQUESTOUTPUTPLOTPANEL_BACKGROUNDCOLOR", "backgroundColor"); |
11 | +define ("REQUESTOUTPUTPLOTPANEL_XMARGIN", "xMargin"); | ||
12 | +define ("REQUESTOUTPUTPLOTPANEL_PREFEREDWIDTH", "preferedWidth"); | ||
13 | +define ("REQUESTOUTPUTPLOTPANEL_PREFEREDHEIGHT", "preferedHeight"); | ||
11 | 14 | ||
12 | abstract class RequestOutputPlotElementTypeEnum | 15 | abstract class RequestOutputPlotElementTypeEnum |
13 | { | 16 | { |
14 | - const TIMEPLOT = "TimePlot"; | ||
15 | - const XYPLOT = "XYPlot"; | 17 | + const TIMEPLOT = "TimePlot"; |
18 | + const XYPLOT = "XYPlot"; | ||
16 | const STATUSPLOT = "StatusPlot"; | 19 | const STATUSPLOT = "StatusPlot"; |
17 | - const TICKPLOT = "TickPlot"; | 20 | + const TICKPLOT = "TickPlot"; |
21 | + const EPOCHPLOT = "EpochPlot"; | ||
18 | } | 22 | } |
19 | 23 | ||
20 | /** | 24 | /** |
@@ -39,7 +43,18 @@ class RequestOutputPlotPanelNodeClass extends NodeClass | @@ -39,7 +43,18 @@ class RequestOutputPlotPanelNodeClass extends NodeClass | ||
39 | return $this->getAttribute(REQUESTOUTPUTPLOTPANEL_BACKGROUNDCOLOR); | 43 | return $this->getAttribute(REQUESTOUTPUTPLOTPANEL_BACKGROUNDCOLOR); |
40 | } | 44 | } |
41 | 45 | ||
42 | - /* ToDo bounds */ | 46 | + public function getBounds() |
47 | + { | ||
48 | + $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTPANELBOUNDS_NAME); | ||
49 | + | ||
50 | + if (!isset($node)) | ||
51 | + { | ||
52 | + $node = new RequestOutputPlotPanelBoundsNodeClass(); | ||
53 | + $this->addChild($node); | ||
54 | + } | ||
55 | + | ||
56 | + return $node; | ||
57 | + } | ||
43 | 58 | ||
44 | public function getFont() | 59 | public function getFont() |
45 | { | 60 | { |
@@ -83,6 +98,9 @@ class RequestOutputPlotPanelNodeClass extends NodeClass | @@ -83,6 +98,9 @@ class RequestOutputPlotPanelNodeClass extends NodeClass | ||
83 | case RequestOutputPlotElementTypeEnum::TICKPLOT : | 98 | case RequestOutputPlotElementTypeEnum::TICKPLOT : |
84 | $node = new RequestOutputPlotElementTickNodeClass($noAxes); | 99 | $node = new RequestOutputPlotElementTickNodeClass($noAxes); |
85 | break; | 100 | break; |
101 | + case RequestOutputPlotElementTypeEnum::EPOCHPLOT : | ||
102 | + $node = new RequestOutputPlotElementEpochNodeClass(); | ||
103 | + break; | ||
86 | default : | 104 | default : |
87 | return NULL; | 105 | return NULL; |
88 | } | 106 | } |
@@ -90,11 +108,30 @@ class RequestOutputPlotPanelNodeClass extends NodeClass | @@ -90,11 +108,30 @@ class RequestOutputPlotPanelNodeClass extends NodeClass | ||
90 | return $node; | 108 | return $node; |
91 | } | 109 | } |
92 | 110 | ||
111 | + public function setPreferedWidth($width) | ||
112 | + { | ||
113 | + $this->setAttribute(REQUESTOUTPUTPLOTPANEL_PREFEREDWIDTH, $width); | ||
114 | + } | ||
115 | + | ||
116 | + public function getPreferedWidth() | ||
117 | + { | ||
118 | + return $this->getAttribute(REQUESTOUTPUTPLOTPANEL_PREFEREDWIDTH); | ||
119 | + } | ||
120 | + | ||
121 | + public function setPreferedHeight($height) | ||
122 | + { | ||
123 | + $this->setAttribute(REQUESTOUTPUTPLOTPANEL_PREFEREDHEIGHT, $height); | ||
124 | + } | ||
125 | + | ||
126 | + public function getPreferedHeight() | ||
127 | + { | ||
128 | + return $this->getAttribute(REQUESTOUTPUTPLOTPANEL_PREFEREDHEIGHT); | ||
129 | + } | ||
93 | 130 | ||
94 | - | ||
95 | - /* ToDo prefered size */ | ||
96 | - | ||
97 | - /* ToDo x y margins */ | 131 | + public function setXMargin($left, $right) |
132 | + { | ||
133 | + $this->setAttribute(REQUESTOUTPUTPLOTPANEL_XMARGIN, "[".$left.",".$right."]"); | ||
134 | + } | ||
98 | } | 135 | } |
99 | 136 | ||
100 | ?> | 137 | ?> |
101 | \ No newline at end of file | 138 | \ No newline at end of file |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotResamplingNodeClass.php
0 → 100644
@@ -0,0 +1,47 @@ | @@ -0,0 +1,47 @@ | ||
1 | +<?php | ||
2 | + | ||
3 | +define ("REQUESTOUTPUTPLOTRESAMPLING_TYPE", "type"); | ||
4 | +define ("REQUESTOUTPUTPLOTRESAMPLING_VALUE", "value"); | ||
5 | + | ||
6 | +abstract class RequestOutputPlotResamplingTypeEnum | ||
7 | +{ | ||
8 | + const AUTO = "auto"; | ||
9 | + const XPARAM = "xparam"; | ||
10 | + const YPARAM = "yparam"; | ||
11 | + const MANUAL = "manual"; | ||
12 | +} | ||
13 | + | ||
14 | +/** | ||
15 | + * @class RequestOutputPlotLineNodeClass | ||
16 | + * @brief Definition of a line element for a plot | ||
17 | + * @details | ||
18 | + */ | ||
19 | +class RequestOutputPlotResamplingNodeClass extends NodeClass | ||
20 | +{ | ||
21 | + public function __construct($name) | ||
22 | + { | ||
23 | + parent::__construct($name); | ||
24 | + } | ||
25 | + | ||
26 | + public function setType($type) | ||
27 | + { | ||
28 | + $this->setAttribute(REQUESTOUTPUTPLOTRESAMPLING_TYPE, $type); | ||
29 | + } | ||
30 | + | ||
31 | + public function getType() | ||
32 | + { | ||
33 | + $this->getAttribute(REQUESTOUTPUTPLOTRESAMPLING_TYPE); | ||
34 | + } | ||
35 | + | ||
36 | + public function setValue($value) | ||
37 | + { | ||
38 | + $this->setAttribute(REQUESTOUTPUTPLOTRESAMPLING_VALUE, $value); | ||
39 | + } | ||
40 | + | ||
41 | + public function getValue() | ||
42 | + { | ||
43 | + $this->getAttribute(REQUESTOUTPUTPLOTRESAMPLING_VALUE); | ||
44 | + } | ||
45 | +} | ||
46 | + | ||
47 | +?> | ||
0 | \ No newline at end of file | 48 | \ No newline at end of file |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotYSerieNodeClass.php
@@ -7,6 +7,7 @@ define ("REQUESTOUTPUTPLOTYSERIE_YAXIS", "yAxis"); | @@ -7,6 +7,7 @@ define ("REQUESTOUTPUTPLOTYSERIE_YAXIS", "yAxis"); | ||
7 | define ("REQUESTOUTPUTPLOTYSERIE_XAXIS", "xAxis"); | 7 | define ("REQUESTOUTPUTPLOTYSERIE_XAXIS", "xAxis"); |
8 | define ("REQUESTOUTPUTPLOTYSERIE_INDEX", "index"); | 8 | define ("REQUESTOUTPUTPLOTYSERIE_INDEX", "index"); |
9 | define ("REQUESTOUTPUTPLOTYSERIE_COLORSERIEID", "colorSerieId"); | 9 | define ("REQUESTOUTPUTPLOTYSERIE_COLORSERIEID", "colorSerieId"); |
10 | +define ("REQUESTOUTPUTPLOTYSERIE_RESAMPLING", "resampling"); | ||
10 | define ("REQUESTOUTPUTPLOTYSERIE_LINE", "line"); | 11 | define ("REQUESTOUTPUTPLOTYSERIE_LINE", "line"); |
11 | define ("REQUESTOUTPUTPLOTYSERIE_SYMBOL", "symbol"); | 12 | define ("REQUESTOUTPUTPLOTYSERIE_SYMBOL", "symbol"); |
12 | 13 | ||
@@ -62,6 +63,19 @@ class RequestOutputPlotYSerieNodeClass extends NodeClass | @@ -62,6 +63,19 @@ class RequestOutputPlotYSerieNodeClass extends NodeClass | ||
62 | return $this->getAttribute(REQUESTOUTPUTPLOTYSERIE_COLORSERIEID); | 63 | return $this->getAttribute(REQUESTOUTPUTPLOTYSERIE_COLORSERIEID); |
63 | } | 64 | } |
64 | 65 | ||
66 | + public function getResampling() | ||
67 | + { | ||
68 | + $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTYSERIE_RESAMPLING); | ||
69 | + | ||
70 | + if (!isset($node)) | ||
71 | + { | ||
72 | + $node = new RequestOutputPlotResamplingNodeClass(REQUESTOUTPUTPLOTYSERIE_RESAMPLING); | ||
73 | + $this->addChild($node); | ||
74 | + } | ||
75 | + | ||
76 | + return $node; | ||
77 | + } | ||
78 | + | ||
65 | public function getLine() | 79 | public function getLine() |
66 | { | 80 | { |
67 | $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTYSERIE_LINE); | 81 | $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTYSERIE_LINE); |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestTimesNodeClass.php
@@ -43,6 +43,7 @@ class RequestTimesIntervalNodeClass extends NodeClass | @@ -43,6 +43,7 @@ class RequestTimesIntervalNodeClass extends NodeClass | ||
43 | 43 | ||
44 | define ("REQUESTTIMETABLE_NAME", "timetable"); | 44 | define ("REQUESTTIMETABLE_NAME", "timetable"); |
45 | define ("REQUESTTIMETABLE_ID", "id"); | 45 | define ("REQUESTTIMETABLE_ID", "id"); |
46 | +define ("REQUESTTIMETABLE_INDEX", "index"); | ||
46 | 47 | ||
47 | /** | 48 | /** |
48 | * @class RequestTimesTimeTableNodeClass | 49 | * @class RequestTimesTimeTableNodeClass |
@@ -65,6 +66,53 @@ class RequestTimesTimeTableNodeClass extends NodeClass | @@ -65,6 +66,53 @@ class RequestTimesTimeTableNodeClass extends NodeClass | ||
65 | { | 66 | { |
66 | return $this->getAttribute(REQUESTTIMETABLE_ID); | 67 | return $this->getAttribute(REQUESTTIMETABLE_ID); |
67 | } | 68 | } |
69 | + | ||
70 | + public function setIndex($index) | ||
71 | + { | ||
72 | + $this->setAttribute(REQUESTTIMETABLE_INDEX, $index); | ||
73 | + } | ||
74 | + | ||
75 | + public function getIndex() | ||
76 | + { | ||
77 | + return $this->getAttribute(REQUESTTIMETABLE_INDEX); | ||
78 | + } | ||
79 | +} | ||
80 | + | ||
81 | +define ("REQUESTCATALOG_NAME", "catalog"); | ||
82 | +define ("REQUESTCATALOG_ID", "id"); | ||
83 | +define ("REQUESTCATALOG_INDEX", "index"); | ||
84 | + | ||
85 | +/** | ||
86 | + * @class RequestCatalogNodeClass | ||
87 | + * @brief Definition of a request catalog node for AMDA_Kernel | ||
88 | + * @details | ||
89 | + */ | ||
90 | +class RequestCatalogNodeClass extends NodeClass | ||
91 | +{ | ||
92 | + public function __construct() | ||
93 | + { | ||
94 | + parent::__construct(REQUESTCATALOG_NAME); | ||
95 | + } | ||
96 | + | ||
97 | + public function setId($id) | ||
98 | + { | ||
99 | + $this->setAttribute(REQUESTCATALOG_ID, $id); | ||
100 | + } | ||
101 | + | ||
102 | + public function getId() | ||
103 | + { | ||
104 | + return $this->getAttribute(REQUESTCATALOG_ID); | ||
105 | + } | ||
106 | + | ||
107 | + public function setIndex($index) | ||
108 | + { | ||
109 | + $this->setAttribute(REQUESTCATALOG_INDEX, $index); | ||
110 | + } | ||
111 | + | ||
112 | + public function getIndex() | ||
113 | + { | ||
114 | + return $this->getAttribute(REQUESTCATALOG_INDEX); | ||
115 | + } | ||
68 | } | 116 | } |
69 | 117 | ||
70 | define ("REQUESTTIMES_NAME", "times"); | 118 | define ("REQUESTTIMES_NAME", "times"); |
@@ -93,17 +141,24 @@ class RequestTimesNodeClass extends NodeClass | @@ -93,17 +141,24 @@ class RequestTimesNodeClass extends NodeClass | ||
93 | return $this->getChildrenByName(REQUESTTIMEINTERVAL_NAME); | 141 | return $this->getChildrenByName(REQUESTTIMEINTERVAL_NAME); |
94 | } | 142 | } |
95 | 143 | ||
96 | - public function addTimeTable($id) | 144 | + public function addTimeTable($id, $index = -1) |
97 | { | 145 | { |
98 | $timeTable = new RequestTimesTimeTableNodeClass(); | 146 | $timeTable = new RequestTimesTimeTableNodeClass(); |
99 | $timeTable->setId($id); | 147 | $timeTable->setId($id); |
148 | + if ($index >= 0) | ||
149 | + $timeTable->setIndex($index); | ||
100 | $this->addChild($timeTable); | 150 | $this->addChild($timeTable); |
101 | } | 151 | } |
102 | 152 | ||
103 | - public function getTimeTables() | 153 | + public function addCatalog($id, $index = -1) |
104 | { | 154 | { |
105 | - return $this->getChildrenByName(REQUESTTIMETABLE_NAME); | 155 | + $catalogNode = new RequestCatalogNodeClass(); |
156 | + $catalogNode->setId($id); | ||
157 | + if ($index >= 0) | ||
158 | + $catalogNode->setIndex($index); | ||
159 | + $this->addChild($catalogNode); | ||
106 | } | 160 | } |
161 | + | ||
107 | } | 162 | } |
108 | 163 | ||
109 | ?> | 164 | ?> |
110 | \ No newline at end of file | 165 | \ No newline at end of file |