Commit 7d84634e49761091d7cdd099c471635254dbdba0
1 parent
86756f46
Exists in
master
and in
55 other branches
Fix plot request with new plot object
Showing
4 changed files
with
196 additions
and
326 deletions
Show diff stats
src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
... | ... | @@ -15,8 +15,6 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
15 | 15 | |
16 | 16 | private $isInstantPlot = false; |
17 | 17 | |
18 | - private $interactiveRequestRealIndexes = array(); | |
19 | - private $interactiveMultiPlotState = array(); | |
20 | 18 | private $interactiveTimeSelectionState = array(); |
21 | 19 | private $interactiveCrtTTFileIndex = -1; |
22 | 20 | private $interactivePreview = false; |
... | ... | @@ -26,8 +24,6 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
26 | 24 | */ |
27 | 25 | protected function unmarshallRequest($input) |
28 | 26 | { |
29 | - $this->interactiveRequestRealIndexes = array(); | |
30 | - | |
31 | 27 | $forceTimeZoomReset = false; |
32 | 28 | |
33 | 29 | if (isset($input->{'action'})) |
... | ... | @@ -43,251 +39,189 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
43 | 39 | } |
44 | 40 | |
45 | 41 | //Request |
46 | - $requestIndexInParamData = 0; | |
47 | - $tabRequestIndex = 0; | |
48 | 42 | $this->isInteractiveRequest = ($input->{'file-output'} == 'INTERACTIVE'); |
49 | 43 | $this->isFromWS = ($input->{'file-output'} == 'WS'); |
50 | 44 | $postProcessCmd = ""; |
51 | - foreach ($input->tabs as $tab) | |
52 | - { | |
53 | - if (isset($activeTab)) | |
54 | - { | |
55 | - if ($this->isInteractiveRequest) | |
56 | - { | |
57 | - if ($activeTab->{'multi-plot-linked'} && !$tab->{'multi-plot-linked'}) | |
58 | - { | |
59 | - ++$tabRequestIndex; | |
60 | - //Tab is not linked to the Multi Plot Mode | |
61 | - continue; | |
62 | - } | |
63 | - else if (!$activeTab->{'multi-plot-linked'} && ($tab->{'id'} != $activeTab->{'id'})) | |
64 | - { | |
65 | - ++$tabRequestIndex; | |
66 | - //Plot only current active tab | |
67 | - continue; | |
68 | - } | |
69 | - else if (isset($input->{'force-single-replot'}) && $input->{'force-single-replot'} && ($tab->{'id'} != $activeTab->{'id'})) | |
70 | - { | |
71 | - ++$tabRequestIndex; | |
72 | - //Plot only current active tab when 'force-single-replot' is active | |
73 | - continue; | |
74 | - } | |
75 | - //Reset zoom list if needed | |
76 | - if ($forceTimeZoomReset) | |
77 | - $this->resetZoomListForTab($tab->{'id'}, $forceTimeZoomReset); | |
78 | - } | |
79 | - else | |
80 | - { | |
81 | - if ($tab->{'id'} != $activeTab->{'id'}) | |
82 | - { | |
83 | - ++$tabRequestIndex; | |
84 | - //In no interactive request, plot only active tab | |
85 | - continue; | |
86 | - } | |
87 | - //Reset zoom list if needed | |
88 | - if ($forceTimeZoomReset) | |
89 | - $this->resetZoomListForTab($tab->{'id'}, $forceTimeZoomReset); | |
90 | - } | |
91 | - } | |
45 | + | |
46 | + if ($forceTimeZoomReset) | |
47 | + $this->resetZoomListForTab($input->{'id'}, $forceTimeZoomReset); | |
92 | 48 | |
93 | - $requestNode = $this->paramsData->addRequestNode(); | |
94 | - $requestNode->setRealIndex($tabRequestIndex); | |
95 | - $outputsNode = $requestNode->getOutputsNode(); | |
96 | - $paramsNode = $requestNode->getParamsNode(); | |
49 | + $requestNode = $this->paramsData->addRequestNode(); | |
50 | + $outputsNode = $requestNode->getOutputsNode(); | |
51 | + $paramsNode = $requestNode->getParamsNode(); | |
97 | 52 | |
98 | - //unmarshall time definition | |
99 | - if ($tab->{'multi-plot-linked'}) | |
100 | - { | |
101 | - $isIntervalRequest = ($input->timesrc == 'Interval'); | |
102 | - $ttFileIndex = -1; | |
103 | - $ttIntIndex = -1; | |
104 | - if ($this->isInteractiveRequest && !$isIntervalRequest && !$tab->{'page-superpose-mode'}) | |
105 | - { | |
106 | - $ttFileIndex = !isset($input->{'ttFileIndex'}) ? 0 : $input->{'ttFileIndex'}; | |
107 | - $ttIntIndex = !isset($input->{'intIndex'}) ? 0 : $input->{'intIndex'}; | |
108 | - } | |
109 | - $this->unmarshallTimeDefinition($input, $requestIndexInParamData, $ttFileIndex, $ttIntIndex); | |
110 | - } | |
111 | - else | |
112 | - { | |
113 | - $isIntervalRequest = ($tab->timesrc == 'Interval'); | |
114 | - $ttFileIndex = -1; | |
115 | - $ttIntIndex = -1; | |
116 | - if ($this->isInteractiveRequest && !$isIntervalRequest && !$tab->{'page-superpose-mode'}) | |
117 | - { | |
118 | - $ttFileIndex = !isset($activeTab->{'ttFileIndex'}) ? 0 : $activeTab->{'ttFileIndex'}; | |
119 | - $ttIntIndex = !isset($activeTab->{'intIndex'}) ? 0 : $activeTab->{'intIndex'}; | |
120 | - } | |
121 | - $this->unmarshallTimeDefinition($tab, $requestIndexInParamData, $ttFileIndex, $ttIntIndex); | |
122 | - } | |
53 | + //unmarshall time definition | |
54 | + $isIntervalRequest = ($input->timesrc == 'Interval'); | |
55 | + $ttFileIndex = -1; | |
56 | + $ttIntIndex = -1; | |
57 | + if ($this->isInteractiveRequest && !$isIntervalRequest && !$input->{'page-superpose-mode'}) | |
58 | + { | |
59 | + $ttFileIndex = !isset($input->{'ttFileIndex'}) ? 0 : $input->{'ttFileIndex'}; | |
60 | + $ttIntIndex = !isset($input->{'intIndex'}) ? 0 : $input->{'intIndex'}; | |
61 | + } | |
62 | + $this->unmarshallTimeDefinition($input, 0, $ttFileIndex, $ttIntIndex); | |
123 | 63 | |
124 | - $this->interactiveCrtTTFileIndex = $ttFileIndex; | |
64 | + $this->interactiveCrtTTFileIndex = $ttFileIndex; | |
125 | 65 | |
126 | - $plotOutputNode = $outputsNode->addNewOutput(RequestOutputTypeEnum::PLOT); | |
66 | + $plotOutputNode = $outputsNode->addNewOutput(RequestOutputTypeEnum::PLOT); | |
127 | 67 | |
128 | - $plotOutputNode->setWriteContextFile($this->isInteractiveRequest ? "true" : "false"); | |
68 | + $plotOutputNode->setWriteContextFile($this->isInteractiveRequest ? "true" : "false"); | |
129 | 69 | |
130 | - $compression = ""; | |
131 | - if (!$this->isInteractiveRequest && !$this->isFromWS) | |
70 | + $compression = ""; | |
71 | + if (!$this->isInteractiveRequest && !$this->isFromWS) | |
72 | + { | |
73 | + switch ($input->{'file-output'}) | |
132 | 74 | { |
133 | - switch ($input->{'file-output'}) | |
134 | - { | |
135 | - case 'TGZ' : | |
136 | - $plotOutputNode->addPostProcessing(RequestOutputPostProcessingEnumClass::TAR); | |
137 | - $plotOutputNode->addPostProcessing(RequestOutputPostProcessingEnumClass::GZIP); | |
138 | - $compression = ".tar.gz"; | |
139 | - break; | |
140 | - case 'ZIP' : | |
141 | - $plotOutputNode->addPostProcessing(RequestOutputPostProcessingEnumClass::ZIP); | |
142 | - $compression = ".zip"; | |
143 | - break; | |
144 | - default: | |
145 | - throw new Exception('Compression not implemented.'); | |
146 | - } | |
75 | + case 'TGZ' : | |
76 | + $plotOutputNode->addPostProcessing(RequestOutputPostProcessingEnumClass::TAR); | |
77 | + $plotOutputNode->addPostProcessing(RequestOutputPostProcessingEnumClass::GZIP); | |
78 | + $compression = ".tar.gz"; | |
79 | + break; | |
80 | + case 'ZIP' : | |
81 | + $plotOutputNode->addPostProcessing(RequestOutputPostProcessingEnumClass::ZIP); | |
82 | + $compression = ".zip"; | |
83 | + break; | |
84 | + default: | |
85 | + throw new Exception('Compression not implemented.'); | |
147 | 86 | } |
87 | + } | |
148 | 88 | |
149 | - if ($input->{'one-file-per-interval'}) | |
150 | - $plotOutputNode->setStructure(RequestOutputPlotStructureEnum::ONE_FILE_PER_INTERVAL); | |
151 | - else | |
152 | - $plotOutputNode->setStructure(RequestOutputPlotStructureEnum::ONE_FILE); | |
89 | + if ($input->{'one-file-per-interval'}) | |
90 | + $plotOutputNode->setStructure(RequestOutputPlotStructureEnum::ONE_FILE_PER_INTERVAL); | |
91 | + else | |
92 | + $plotOutputNode->setStructure(RequestOutputPlotStructureEnum::ONE_FILE); | |
153 | 93 | |
154 | - //prefix | |
155 | - $filePrefix = "plot_"; | |
156 | - if ($input->{'file-prefix'} && ($input->{'file-prefix'} != "")) | |
157 | - $filePrefix = $input->{'file-prefix'}; | |
158 | - $filePrefix .= $tab->{'id'}; | |
94 | + //prefix | |
95 | + $filePrefix = "plot_"; | |
96 | + if ($input->{'file-prefix'} && ($input->{'file-prefix'} != "")) | |
97 | + $filePrefix = $input->{'file-prefix'}; | |
98 | + $filePrefix .= $input->{'id'}; | |
159 | 99 | |
160 | - $plotOutputNode->setFilePrefix($filePrefix); | |
100 | + $plotOutputNode->setFilePrefix($filePrefix); | |
161 | 101 | |
162 | - //page | |
163 | - $pageNode = $plotOutputNode->getPage(); | |
102 | + //page | |
103 | + $pageNode = $plotOutputNode->getPage(); | |
164 | 104 | |
165 | - $fileFormat = RequestOutputPlotPageFormatEnum::PNG; | |
166 | - $extension = ".png"; | |
167 | - switch ($input->{'file-format'}) | |
168 | - { | |
169 | - case 'PNG' : | |
170 | - $fileFormat = RequestOutputPlotPageFormatEnum::PNG; | |
171 | - $extension = ".png"; | |
172 | - break; | |
173 | - case 'PDF' : | |
174 | - $fileFormat = RequestOutputPlotPageFormatEnum::PDF; | |
175 | - $extension = ".pdf"; | |
176 | - break; | |
177 | - case 'PS' : | |
178 | - $fileFormat = RequestOutputPlotPageFormatEnum::PS; | |
179 | - $extension = ".ps"; | |
180 | - break; | |
181 | - case 'SVG' : | |
182 | - $fileFormat = RequestOutputPlotPageFormatEnum::SVG; | |
183 | - $extension = ".svg"; | |
184 | - break; | |
185 | - default: | |
186 | - throw new Exception('File format not implemented.'); | |
187 | - } | |
105 | + $fileFormat = RequestOutputPlotPageFormatEnum::PNG; | |
106 | + $extension = ".png"; | |
107 | + switch ($input->{'file-format'}) | |
108 | + { | |
109 | + case 'PNG' : | |
110 | + $fileFormat = RequestOutputPlotPageFormatEnum::PNG; | |
111 | + $extension = ".png"; | |
112 | + break; | |
113 | + case 'PDF' : | |
114 | + $fileFormat = RequestOutputPlotPageFormatEnum::PDF; | |
115 | + $extension = ".pdf"; | |
116 | + break; | |
117 | + case 'PS' : | |
118 | + $fileFormat = RequestOutputPlotPageFormatEnum::PS; | |
119 | + $extension = ".ps"; | |
120 | + break; | |
121 | + case 'SVG' : | |
122 | + $fileFormat = RequestOutputPlotPageFormatEnum::SVG; | |
123 | + $extension = ".svg"; | |
124 | + break; | |
125 | + default: | |
126 | + throw new Exception('File format not implemented.'); | |
127 | + } | |
188 | 128 | |
189 | - $pageNode->setFormat($fileFormat); | |
129 | + $pageNode->setFormat($fileFormat); | |
190 | 130 | |
191 | - $this->unmarshallTitle($tab, 'page-title', $pageNode->getTitle()); | |
131 | + $this->unmarshallTitle($input, 'page-title', $pageNode->getTitle()); | |
192 | 132 | |
193 | - $isPortrait = false; | |
194 | - switch ($tab->{'page-orientation'}) | |
195 | - { | |
196 | - case 'landscape' : | |
197 | - $pageNode->setOrientation(RequestOutputPlotPageOrientationEnum::LANDSCAPE); | |
198 | - break; | |
199 | - case 'portrait' : | |
200 | - $pageNode->setOrientation(RequestOutputPlotPageOrientationEnum::PORTRAIT); | |
201 | - $isPortrait = true; | |
202 | - break; | |
203 | - } | |
133 | + $isPortrait = false; | |
134 | + switch ($input->{'page-orientation'}) | |
135 | + { | |
136 | + case 'landscape' : | |
137 | + $pageNode->setOrientation(RequestOutputPlotPageOrientationEnum::LANDSCAPE); | |
138 | + break; | |
139 | + case 'portrait' : | |
140 | + $pageNode->setOrientation(RequestOutputPlotPageOrientationEnum::PORTRAIT); | |
141 | + $isPortrait = true; | |
142 | + break; | |
143 | + } | |
204 | 144 | |
205 | - switch ($tab->{'page-dimension'}) | |
206 | - { | |
207 | - case 'ISO A4' : | |
208 | - $pageNode->setDimension(RequestOutputPlotPageDimensionEnum::ISO_A4); | |
209 | - break; | |
210 | - case 'US letter' : | |
211 | - $pageNode->setDimension(RequestOutputPlotPageDimensionEnum::US_LETTER); | |
212 | - break; | |
213 | - default: | |
214 | - throw new Exception('Page dimension not implemented.'); | |
215 | - } | |
145 | + switch ($input->{'page-dimension'}) | |
146 | + { | |
147 | + case 'ISO A4' : | |
148 | + $pageNode->setDimension(RequestOutputPlotPageDimensionEnum::ISO_A4); | |
149 | + break; | |
150 | + case 'US letter' : | |
151 | + $pageNode->setDimension(RequestOutputPlotPageDimensionEnum::US_LETTER); | |
152 | + break; | |
153 | + default: | |
154 | + throw new Exception('Page dimension not implemented.'); | |
155 | + } | |
216 | 156 | |
217 | - switch ($tab->{'page-mode'}) | |
218 | - { | |
157 | + switch ($input->{'page-mode'}) | |
158 | + { | |
219 | 159 | |
220 | - case 'grayscale' : | |
221 | - $pageNode->setMode(RequestOutputPlotPageModeEnum::GRAYSCALE); | |
222 | - break; | |
223 | - case 'color' : | |
224 | - default: | |
225 | - $pageNode->setMode(RequestOutputPlotPageModeEnum::COLOR); | |
226 | - break; | |
227 | - } | |
228 | - | |
229 | - if ($tab->{'page-margins-activated'}) | |
230 | - { | |
231 | - $pageNode->getMargins()->setHorizontal($tab->{'page-margin-x'}); | |
232 | - $pageNode->getMargins()->setVertical($tab->{'page-margin-y'}); | |
233 | - } | |
160 | + case 'grayscale' : | |
161 | + $pageNode->setMode(RequestOutputPlotPageModeEnum::GRAYSCALE); | |
162 | + break; | |
163 | + case 'color' : | |
164 | + default: | |
165 | + $pageNode->setMode(RequestOutputPlotPageModeEnum::COLOR); | |
166 | + break; | |
167 | + } | |
234 | 168 | |
235 | - if ($tab->{'page-font-activated'}) | |
236 | - $this->unmarshallFont($tab, 'page-font', $pageNode->getFont()); | |
169 | + if ($input->{'page-margins-activated'}) | |
170 | + { | |
171 | + $pageNode->getMargins()->setHorizontal($input->{'page-margin-x'}); | |
172 | + $pageNode->getMargins()->setVertical($input->{'page-margin-y'}); | |
173 | + } | |
237 | 174 | |
238 | - //Superpose mode | |
239 | - $pageNode->setSuperposeMode($tab->{'page-superpose-mode'} ? "true": "false"); | |
175 | + if ($input->{'page-font-activated'}) | |
176 | + $this->unmarshallFont($input, 'page-font', $pageNode->getFont()); | |
240 | 177 | |
241 | - //Layout | |
242 | - $this->unmarshallLayout($tab, $pageNode); | |
178 | + //Superpose mode | |
179 | + $pageNode->setSuperposeMode($input->{'page-superpose-mode'} ? "true": "false"); | |
243 | 180 | |
244 | - foreach ($tab->{'panels'} as $panelData) | |
245 | - $this->unmarshallPanel($panelData, $pageNode, $paramsNode); | |
181 | + //Layout | |
182 | + $this->unmarshallLayout($input, $pageNode); | |
246 | 183 | |
247 | - if ($this->isInteractiveRequest || $this->isFromWS) | |
248 | - { | |
249 | - $resultFile = $filePrefix."_*".$extension; | |
250 | - $waitingResultFile = $filePrefix.$extension; | |
251 | - } | |
252 | - else | |
253 | - { | |
254 | - $resultFile = $filePrefix."_*".$compression; | |
255 | - $waitingResultFile = $filePrefix.$compression; | |
256 | - } | |
184 | + foreach ($input->{'panels'} as $panelData) | |
185 | + $this->unmarshallPanel($panelData, $pageNode, $paramsNode); | |
257 | 186 | |
258 | - if ($this->isInteractiveRequest) | |
259 | - { | |
260 | - $this->interactiveRequestRealIndexes[PLOT_RESULT_FILE_KEY."_".$tab->{'id'}] = $tabRequestIndex; | |
261 | - $this->interactiveMultiPlotState[PLOT_RESULT_FILE_KEY."_".$tab->{'id'}] = $tab->{'multi-plot-linked'}; | |
262 | - $this->interactiveTimeSelectionState[PLOT_RESULT_FILE_KEY."_".$tab->{'id'}] = $isIntervalRequest; | |
263 | - $this->interactivePreview = isset($input->{'interactive-preview'}) && ($input->{'interactive-preview'}); | |
264 | - $this->paramsData->addWaitingResult(PLOT_RESULT_FILE_KEY."_".$tab->{'id'}, $waitingResultFile); | |
265 | - } | |
266 | - else | |
267 | - $this->paramsData->addWaitingResult(PLOT_RESULT_FILE_KEY, $waitingResultFile); | |
187 | + if ($this->isInteractiveRequest || $this->isFromWS) | |
188 | + { | |
189 | + $resultFile = $filePrefix."_*".$extension; | |
190 | + $waitingResultFile = $filePrefix.$extension; | |
191 | + } | |
192 | + else | |
193 | + { | |
194 | + $resultFile = $filePrefix."_*".$compression; | |
195 | + $waitingResultFile = $filePrefix.$compression; | |
196 | + } | |
268 | 197 | |
269 | - //Remove old result files | |
270 | - foreach (glob($this->paramsData->getWorkingPath().$resultFile) as $oldFile) { | |
271 | - unlink($oldFile); | |
272 | - } | |
198 | + if ($this->isInteractiveRequest) | |
199 | + { | |
200 | + $this->interactiveTimeSelectionState[PLOT_RESULT_FILE_KEY."_".$input->{'id'}] = $isIntervalRequest; | |
201 | + $this->interactivePreview = isset($input->{'interactive-preview'}) && ($input->{'interactive-preview'}); | |
202 | + $this->paramsData->addWaitingResult(PLOT_RESULT_FILE_KEY."_".$input->{'id'}, $waitingResultFile); | |
203 | + } | |
204 | + else | |
205 | + $this->paramsData->addWaitingResult(PLOT_RESULT_FILE_KEY, $waitingResultFile); | |
273 | 206 | |
274 | - //Post process command to apply to the result file | |
275 | - if ($postProcessCmd != "") | |
276 | - $postProcessCmd .= " | "; | |
277 | - $postProcessCmd .= "mv ".$resultFile." ".$waitingResultFile; | |
207 | + //Remove old result files | |
208 | + foreach (glob($this->paramsData->getWorkingPath().$resultFile) as $oldFile) { | |
209 | + unlink($oldFile); | |
210 | + } | |
278 | 211 | |
279 | - if (($this->isInteractiveRequest) && $isPortrait) | |
280 | - $postProcessCmd .= " | convert ".$waitingResultFile." -rotate -90 ".$waitingResultFile; | |
281 | - else if ($this->isFromWS) | |
282 | - { | |
283 | - if ($isPortrait) | |
284 | - $postProcessCmd .= " | convert ".$waitingResultFile." -rotate -90 ".$input->{"ws-result-file"}; | |
285 | - else | |
286 | - $postProcessCmd .= " | mv ".$waitingResultFile." ".$input->{"ws-result-file"}; | |
287 | - } | |
212 | + //Post process command to apply to the result file | |
213 | + if ($postProcessCmd != "") | |
214 | + $postProcessCmd .= " | "; | |
215 | + $postProcessCmd .= "mv ".$resultFile." ".$waitingResultFile; | |
288 | 216 | |
289 | - ++$tabRequestIndex; | |
290 | - ++$requestIndexInParamData; | |
217 | + if (($this->isInteractiveRequest) && $isPortrait) | |
218 | + $postProcessCmd .= " | convert ".$waitingResultFile." -rotate -90 ".$waitingResultFile; | |
219 | + else if ($this->isFromWS) | |
220 | + { | |
221 | + if ($isPortrait) | |
222 | + $postProcessCmd .= " | convert ".$waitingResultFile." -rotate -90 ".$input->{"ws-result-file"}; | |
223 | + else | |
224 | + $postProcessCmd .= " | mv ".$waitingResultFile." ".$input->{"ws-result-file"}; | |
291 | 225 | } |
292 | 226 | |
293 | 227 | $this->paramsData->setBatchEnable(!(($fileFormat == RequestOutputPlotPageFormatEnum::PNG) && $this->isInteractiveRequest)); |
... | ... | @@ -296,39 +230,39 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
296 | 230 | return $this->paramsData; |
297 | 231 | } |
298 | 232 | |
299 | - protected function unmarshallLayout($tab, $pageNode) | |
233 | + protected function unmarshallLayout($request, $pageNode) | |
300 | 234 | { |
301 | - switch ($tab->{'page-layout-type'}) | |
235 | + switch ($request->{'page-layout-type'}) | |
302 | 236 | { |
303 | 237 | case 'vertical' : |
304 | 238 | $pageNode->getLayout()->setType(RequestOutputPlotLayoutTypeEnum::VERTICAL); |
305 | - $pageNode->getLayout()->setPanelHeight($tab->{'page-layout-object'}->{'layout-panel-height'}); | |
306 | - $pageNode->getLayout()->setPanelSpacing($tab->{'page-layout-object'}->{'layout-panel-spacing'}); | |
307 | - $pageNode->getLayout()->setExpand($tab->{'page-layout-object'}->{'layout-expand'} ? "true" : "false"); | |
308 | - $pageNode->getLayout()->setOnlyLowerTimeAxesLegend($tab->{'page-layout-object'}->{'layout-timeaxes-legend-lowerone'} ? "true" : "false"); | |
309 | - //if ($tab->{'page-layout-object'}->{'layout-timeplot-width'} > 0) | |
310 | - // $pageNode->setDefaultTimePlotWidth($tab->{'page-layout-object'}->{'layout-timeplot-width'}); | |
311 | - if ($tab->{'page-layout-object'}->{'layout-timeplot-height'} > 0) | |
312 | - $pageNode->setDefaultTimePlotHeight($tab->{'page-layout-object'}->{'layout-timeplot-height'}); | |
313 | - if ($tab->{'page-layout-object'}->{'layout-xyplot-width'} > 0) | |
314 | - $pageNode->setDefaultXYPlotWidth($tab->{'page-layout-object'}->{'layout-xyplot-width'}); | |
315 | - if ($tab->{'page-layout-object'}->{'layout-xyplot-height'} > 0) | |
316 | - $pageNode->setDefaultXYPlotHeight($tab->{'page-layout-object'}->{'layout-xyplot-height'}); | |
239 | + $pageNode->getLayout()->setPanelHeight($request->{'page-layout-object'}->{'layout-panel-height'}); | |
240 | + $pageNode->getLayout()->setPanelSpacing($request->{'page-layout-object'}->{'layout-panel-spacing'}); | |
241 | + $pageNode->getLayout()->setExpand($request->{'page-layout-object'}->{'layout-expand'} ? "true" : "false"); | |
242 | + $pageNode->getLayout()->setOnlyLowerTimeAxesLegend($request->{'page-layout-object'}->{'layout-timeaxes-legend-lowerone'} ? "true" : "false"); | |
243 | + //if ($request->{'page-layout-object'}->{'layout-timeplot-width'} > 0) | |
244 | + // $pageNode->setDefaultTimePlotWidth($request->{'page-layout-object'}->{'layout-timeplot-width'}); | |
245 | + if ($request->{'page-layout-object'}->{'layout-timeplot-height'} > 0) | |
246 | + $pageNode->setDefaultTimePlotHeight($request->{'page-layout-object'}->{'layout-timeplot-height'}); | |
247 | + if ($request->{'page-layout-object'}->{'layout-xyplot-width'} > 0) | |
248 | + $pageNode->setDefaultXYPlotWidth($request->{'page-layout-object'}->{'layout-xyplot-width'}); | |
249 | + if ($request->{'page-layout-object'}->{'layout-xyplot-height'} > 0) | |
250 | + $pageNode->setDefaultXYPlotHeight($request->{'page-layout-object'}->{'layout-xyplot-height'}); | |
317 | 251 | break; |
318 | 252 | case 'auto' : |
319 | 253 | $pageNode->getLayout()->setType(RequestOutputPlotLayoutTypeEnum::AUTO); |
320 | - $pageNode->getLayout()->setPanelHeight($tab->{'page-layout-object'}->{'layout-panel-height'}); | |
321 | - $pageNode->getLayout()->setPanelSpacing($tab->{'page-layout-object'}->{'layout-panel-spacing'}); | |
322 | - $pageNode->getLayout()->setExpand($tab->{'page-layout-object'}->{'layout-expand'} ? "true" : "false"); | |
323 | - $pageNode->getLayout()->setOnlyLowerTimeAxesLegend($tab->{'page-layout-object'}->{'layout-timeaxes-legend-lowerone'} ? "true" : "false"); | |
254 | + $pageNode->getLayout()->setPanelHeight($request->{'page-layout-object'}->{'layout-panel-height'}); | |
255 | + $pageNode->getLayout()->setPanelSpacing($request->{'page-layout-object'}->{'layout-panel-spacing'}); | |
256 | + $pageNode->getLayout()->setExpand($request->{'page-layout-object'}->{'layout-expand'} ? "true" : "false"); | |
257 | + $pageNode->getLayout()->setOnlyLowerTimeAxesLegend($request->{'page-layout-object'}->{'layout-timeaxes-legend-lowerone'} ? "true" : "false"); | |
324 | 258 | break; |
325 | 259 | case 'manual' : |
326 | 260 | $pageNode->getLayout()->setType(RequestOutputPlotLayoutTypeEnum::MANUAL); |
327 | - $timePlotLeftMargin = $tab->{'page-layout-object'}->{'layout-timeplot-margin-left'} ? $tab->{'page-layout-object'}->{'layout-timeplot-margin-left'} : -1; | |
328 | - $timePlotRightMargin = $tab->{'page-layout-object'}->{'layout-timeplot-margin-right'} ? $tab->{'page-layout-object'}->{'layout-timeplot-margin-right'} : -1; | |
261 | + $timePlotLeftMargin = $request->{'page-layout-object'}->{'layout-timeplot-margin-left'} ? $request->{'page-layout-object'}->{'layout-timeplot-margin-left'} : -1; | |
262 | + $timePlotRightMargin = $request->{'page-layout-object'}->{'layout-timeplot-margin-right'} ? $request->{'page-layout-object'}->{'layout-timeplot-margin-right'} : -1; | |
329 | 263 | $pageNode->setDefaultTimePlotXMargin($timePlotLeftMargin, $timePlotRightMargin); |
330 | - $xyPlotLeftMargin = $tab->{'page-layout-object'}->{'layout-xyplot-margin-left'} ? $tab->{'page-layout-object'}->{'layout-xyplot-margin-left'} : -1; | |
331 | - $xyPlotRightMargin = $tab->{'page-layout-object'}->{'layout-xyplot-margin-right'} ? $tab->{'page-layout-object'}->{'layout-xyplot-margin-right'} : -1; | |
264 | + $xyPlotLeftMargin = $request->{'page-layout-object'}->{'layout-xyplot-margin-left'} ? $request->{'page-layout-object'}->{'layout-xyplot-margin-left'} : -1; | |
265 | + $xyPlotRightMargin = $request->{'page-layout-object'}->{'layout-xyplot-margin-right'} ? $request->{'page-layout-object'}->{'layout-xyplot-margin-right'} : -1; | |
332 | 266 | $pageNode->setDefaultXYPlotXMargin($xyPlotLeftMargin, $xyPlotRightMargin); |
333 | 267 | break; |
334 | 268 | default: |
... | ... | @@ -1470,8 +1404,6 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
1470 | 1404 | |
1471 | 1405 | $result[] = array( |
1472 | 1406 | "id" => $key, |
1473 | - "index" => $this->interactiveRequestRealIndexes[$key], | |
1474 | - "multiplot" => $this->interactiveMultiPlotState[$key], | |
1475 | 1407 | "preview" => $this->interactivePreview, |
1476 | 1408 | "isInterval" => $this->interactiveTimeSelectionState[$key], |
1477 | 1409 | "ttFileIndex" => $this->interactiveCrtTTFileIndex, |
... | ... | @@ -1709,43 +1641,21 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
1709 | 1641 | if ($input->{'axeId'} == 'timeAxis') |
1710 | 1642 | { |
1711 | 1643 | //Zoom on Time Axis |
1712 | - if ($crtTab->{'multi-plot-linked'}) | |
1644 | + if ($crtTab->{'timesrc'} != 'Interval') | |
1713 | 1645 | { |
1714 | - //Update multi plot time definition | |
1715 | - if ($plotInput->{'timesrc'} != 'Interval') | |
1716 | - { | |
1717 | - $plotInput->{'timesrc'} = 'Interval'; | |
1718 | - if (!$isUndo) | |
1719 | - $this->addZoomInList($input,false, | |
1720 | - isset($plotInput->{'ttFileIndex'}) ? $plotInput->{'ttFileIndex'}: 0, | |
1721 | - isset($plotInput->{'intIndex'}) ? $plotInput->{'intIndex'}: 0); | |
1722 | - } | |
1723 | - else | |
1724 | - { | |
1725 | - if (!$isUndo) | |
1726 | - $this->addZoomInList($input,true,$plotInput->{'startDate'},$plotInput->{'stopDate'}); | |
1727 | - } | |
1728 | - $plotInput->{'startDate'} = $input->{'min'}; | |
1729 | - $plotInput->{'stopDate'} = $input->{'max'}; | |
1646 | + $crtTab->{'timesrc'} = 'Interval'; | |
1647 | + if (!$isUndo) | |
1648 | + $this->addZoomInList($input,false, | |
1649 | + isset($crtTab->{'ttFileIndex'}) ? $crtTab->{'ttFileIndex'} : 0, | |
1650 | + isset($crtTab->{'intIndex'}) ? $crtTab->{'intIndex'} : 0); | |
1730 | 1651 | } |
1731 | 1652 | else |
1732 | 1653 | { |
1733 | - if ($crtTab->{'timesrc'} != 'Interval') | |
1734 | - { | |
1735 | - $crtTab->{'timesrc'} = 'Interval'; | |
1736 | - if (!$isUndo) | |
1737 | - $this->addZoomInList($input,false, | |
1738 | - isset($crtTab->{'ttFileIndex'}) ? $crtTab->{'ttFileIndex'} : 0, | |
1739 | - isset($crtTab->{'intIndex'}) ? $crtTab->{'intIndex'} : 0); | |
1740 | - } | |
1741 | - else | |
1742 | - { | |
1743 | - if (!$isUndo) | |
1744 | - $this->addZoomInList($input,true,$crtTab->{'startDate'},$crtTab->{'stopDate'}); | |
1745 | - } | |
1746 | - $crtTab->{'startDate'} = $input->{'min'}; | |
1747 | - $crtTab->{'stopDate'} = $input->{'max'}; | |
1654 | + if (!$isUndo) | |
1655 | + $this->addZoomInList($input,true,$crtTab->{'startDate'},$crtTab->{'stopDate'}); | |
1748 | 1656 | } |
1657 | + $crtTab->{'startDate'} = $input->{'min'}; | |
1658 | + $crtTab->{'stopDate'} = $input->{'max'}; | |
1749 | 1659 | |
1750 | 1660 | $plotInput->{'last-plotted-tab'} = $crtTab->{'id'}; |
1751 | 1661 | $plotInput->{'force-time-zoom-reset'} = false; |
... | ... | @@ -1820,16 +1730,8 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
1820 | 1730 | if (!$crtTab) |
1821 | 1731 | throw new Exception('Cannot retrieve plot tab for navigation action.'); |
1822 | 1732 | |
1823 | - if ($crtTab->{'multi-plot-linked'}) | |
1824 | - { | |
1825 | - $startTime = $plotInput->{'startDate'}; | |
1826 | - $stopTime = $plotInput->{'stopDate'}; | |
1827 | - } | |
1828 | - else | |
1829 | - { | |
1830 | - $startTime = $crtTab->{'startDate'}; | |
1831 | - $stopTime = $crtTab->{'stopDate'}; | |
1832 | - } | |
1733 | + $startTime = $crtTab->{'startDate'}; | |
1734 | + $stopTime = $crtTab->{'stopDate'}; | |
1833 | 1735 | |
1834 | 1736 | //Compute new start / stop time |
1835 | 1737 | date_default_timezone_set('UTC'); |
... | ... | @@ -1872,16 +1774,8 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
1872 | 1774 | $stopTime = date("Y-m-d\TH:i:s",$stopTimeStamp); |
1873 | 1775 | |
1874 | 1776 | //Update request |
1875 | - if ($crtTab->{'multi-plot-linked'}) | |
1876 | - { | |
1877 | - $plotInput->{'startDate'} = $startTime; | |
1878 | - $plotInput->{'stopDate'} = $stopTime; | |
1879 | - } | |
1880 | - else | |
1881 | - { | |
1882 | - $crtTab->{'startDate'} = $startTime; | |
1883 | - $crtTab->{'stopDate'} = $stopTime; | |
1884 | - } | |
1777 | + $crtTab->{'startDate'} = $startTime; | |
1778 | + $crtTab->{'stopDate'} = $stopTime; | |
1885 | 1779 | |
1886 | 1780 | $plotInput->{'last-plotted-tab'} = $crtTab->{'id'}; |
1887 | 1781 | $plotInput->{'force-time-zoom-reset'} = true; |
... | ... | @@ -1907,18 +1801,9 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
1907 | 1801 | |
1908 | 1802 | $plotInput->{'last-plotted-tab'} = $crtTab->{'id'}; |
1909 | 1803 | |
1910 | - if ($crtTab->{'multi-plot-linked'}) | |
1911 | - { | |
1912 | - $plotInput->{'timesrc'} = 'TimeTable'; | |
1913 | - $plotInput->{'ttFileIndex'} = $input->{'ttFileIndex'}; | |
1914 | - $plotInput->{'intIndex'} = $input->{'intIndex'}; | |
1915 | - } | |
1916 | - else | |
1917 | - { | |
1918 | - $crtTab->{'timesrc'} = 'TimeTable'; | |
1919 | - $crtTab->{'ttFileIndex'} = $input->{'ttFileIndex'}; | |
1920 | - $crtTab->{'intIndex'} = $input->{'intIndex'}; | |
1921 | - } | |
1804 | + $crtTab->{'timesrc'} = 'TimeTable'; | |
1805 | + $crtTab->{'ttFileIndex'} = $input->{'ttFileIndex'}; | |
1806 | + $crtTab->{'intIndex'} = $input->{'intIndex'}; | |
1922 | 1807 | |
1923 | 1808 | $plotInput->{'force-time-zoom-reset'} = true; |
1924 | 1809 | $this->saveIHMRequest($plotInput); |
... | ... | @@ -2017,7 +1902,6 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
2017 | 1902 | |
2018 | 1903 | $instantTab = (Object)array( |
2019 | 1904 | "id" => 1, |
2020 | - "multi-plot-linked" => true, | |
2021 | 1905 | "page-margins-activated" => $crtTab->{"page-margins-activated"}, |
2022 | 1906 | "page-margin-x" => $crtTab->{"page-margin-x"}, |
2023 | 1907 | "page-margin-y" => $crtTab->{"page-margin-y"}, |
... | ... |
src/InputOutput/WSImpl/Params/PlotImpl/WSInputOutputParamsPlotClass.php
... | ... | @@ -22,12 +22,10 @@ class WSInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
22 | 22 | { |
23 | 23 | //Request |
24 | 24 | $requestIndexInParamData = 0; |
25 | - $tabRequestIndex = 1; | |
26 | 25 | |
27 | 26 | $postProcessCmd = ""; |
28 | 27 | |
29 | 28 | $requestNode = $this->paramsData->addRequestNode(); |
30 | - $requestNode->setRealIndex($tabRequestIndex); | |
31 | 29 | $outputsNode = $requestNode->getOutputsNode(); |
32 | 30 | $paramsNode = $requestNode->getParamsNode(); |
33 | 31 | |
... | ... |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestNodeClass.php
... | ... | @@ -82,8 +82,6 @@ define ("REQUEST_NAME", "request"); |
82 | 82 | */ |
83 | 83 | class RequestNodeClass extends NodeClass |
84 | 84 | { |
85 | - private $realIndex = 0; | |
86 | - | |
87 | 85 | public function __construct() |
88 | 86 | { |
89 | 87 | parent::__construct(REQUEST_NAME); |
... | ... | @@ -108,16 +106,6 @@ class RequestNodeClass extends NodeClass |
108 | 106 | return $this->getFirstChildByName(REQUESTOUTPUTS_NAME); |
109 | 107 | } |
110 | 108 | |
111 | - public function setRealIndex($index) | |
112 | - { | |
113 | - $this->realIndex = $index; | |
114 | - } | |
115 | - | |
116 | - public function getRealIndex() | |
117 | - { | |
118 | - return $this->realIndex; | |
119 | - } | |
120 | - | |
121 | 109 | public function loadFromNode($xmlNode) |
122 | 110 | { |
123 | 111 | $paramsXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTPARAMS_NAME); |
... | ... | @@ -135,4 +123,4 @@ class RequestNodeClass extends NodeClass |
135 | 123 | } |
136 | 124 | } |
137 | 125 | |
138 | -?> | |
139 | 126 | \ No newline at end of file |
127 | +?> | |
... | ... |
src/Request/ParamsRequestImpl/ParamsRequestClass.php
... | ... | @@ -27,7 +27,7 @@ class ParamsRequestClass extends ProcessRequestClass |
27 | 27 | { |
28 | 28 | if ($cmd != "") |
29 | 29 | $cmd .= " && "; |
30 | - $cmd .= KernelConfigClass::getKernelBinPath()."amdaXMLRequestorTool ".$this->getRequestFilePath($requestNode->getRealIndex()); | |
30 | + $cmd .= KernelConfigClass::getKernelBinPath()."amdaXMLRequestorTool ".$this->getRequestFilePath(0); | |
31 | 31 | } |
32 | 32 | $this->requestData->setCmd($cmd); |
33 | 33 | break; |
... | ... | @@ -72,15 +72,15 @@ class ParamsRequestClass extends ProcessRequestClass |
72 | 72 | |
73 | 73 | if (!$xmlNode = $requestNode->toXMLNode($doc)) |
74 | 74 | { |
75 | - $this->requestData->setLastErrorMessage('Cannot create params request XML file for request '.$requestNode->getRealIndex()); | |
75 | + $this->requestData->setLastErrorMessage('Cannot create params request XML file for request'); | |
76 | 76 | return false; |
77 | 77 | } |
78 | 78 | |
79 | 79 | $doc->appendChild($xmlNode); |
80 | 80 | |
81 | - if (!$doc->save($this->getRequestFilePath($requestNode->getRealIndex()))) | |
81 | + if (!$doc->save($this->getRequestFilePath(0))) | |
82 | 82 | { |
83 | - $this->requestData->setLastErrorMessage('Cannot save params request XML file for request '.$requestNode->getRealIndex()); | |
83 | + $this->requestData->setLastErrorMessage('Cannot save params request XML file for request'); | |
84 | 84 | return false; |
85 | 85 | } |
86 | 86 | |
... | ... | @@ -96,7 +96,7 @@ class ParamsRequestClass extends ProcessRequestClass |
96 | 96 | //} |
97 | 97 | //libxml_clear_errors(); |
98 | 98 | |
99 | - $this->requestData->setLastErrorMessage('Params request XML file not valid for request '.$requestNode->getRealIndex()/*.' ('.$error_msg.')'*/); | |
99 | + $this->requestData->setLastErrorMessage('Params request XML file not valid for request'/*.' ('.$error_msg.')'*/); | |
100 | 100 | return false; |
101 | 101 | } |
102 | 102 | //libxml_use_internal_errors(false); |
... | ... |