Commit 00a22067dff6a9af74cef8f1e242aba547be8cae
1 parent
eebc2bb6
Exists in
master
and in
66 other branches
TT navigation
Showing
6 changed files
with
216 additions
and
99 deletions
Show diff stats
src/InputOutput/IHMImpl/Params/IHMInputOutputParamsAbstractClass.php
@@ -52,24 +52,36 @@ abstract class IHMInputOutputParamsAbstractClass implements InputOutputInterface | @@ -52,24 +52,36 @@ 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, $initTTIndex = false) | 55 | + protected function unmarshallTimeDefinition($input, $requestIndex, $ttFileIndex = -1, $ttIntIndex = -1) |
56 | { | 56 | { |
57 | $timesNode = $this->paramsData->getRequestNodes()[$requestIndex]->getTimesNode(); | 57 | $timesNode = $this->paramsData->getRequestNodes()[$requestIndex]->getTimesNode(); |
58 | 58 | ||
59 | switch ($input->timesrc) | 59 | switch ($input->timesrc) |
60 | { | 60 | { |
61 | case "TimeTable" : | 61 | case "TimeTable" : |
62 | + if (($ttFileIndex >= 0) && ($ttFileIndex >= count($input->timeTables))) | ||
63 | + throw new Exception('Try to use a non-existing Time table index in the request.'); | ||
64 | + | ||
65 | + $crtIndex = 0; | ||
62 | foreach ($input->timeTables as $tt) | 66 | foreach ($input->timeTables as $tt) |
63 | { | 67 | { |
68 | + if (($ttFileIndex >= 0 ) && ($ttFileIndex != $crtIndex)) | ||
69 | + { | ||
70 | + // Do not plot this TT | ||
71 | + ++$crtIndex; | ||
72 | + continue; | ||
73 | + } | ||
74 | + | ||
64 | if (strpos($tt->id, "sharedtt_") === 0) | 75 | if (strpos($tt->id, "sharedtt_") === 0) |
65 | $ttPath = IHMConfigClass::getSharedTTPath(); | 76 | $ttPath = IHMConfigClass::getSharedTTPath(); |
66 | else | 77 | else |
67 | $ttPath = IHMConfigClass::getUserTTPath(); | 78 | $ttPath = IHMConfigClass::getUserTTPath(); |
68 | $ttPath .= ($tt->id.".xml"); | 79 | $ttPath .= ($tt->id.".xml"); |
69 | if (strpos($tt->id, "cat_") === 0) | 80 | if (strpos($tt->id, "cat_") === 0) |
70 | - $timesNode->addCatalog($ttPath,$initTTIndex ? 0 : -1); | 81 | + $timesNode->addCatalog($ttPath, $tt->{'timeTableName'}, $ttIntIndex); |
71 | else | 82 | else |
72 | - $timesNode->addTimeTable($ttPath,$initTTIndex ? 0 : -1); | 83 | + $timesNode->addTimeTable($ttPath, $tt->{'timeTableName'}, $ttIntIndex); |
84 | + ++$crtIndex; | ||
73 | } | 85 | } |
74 | break; | 86 | break; |
75 | case "Interval" : | 87 | case "Interval" : |
src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
@@ -11,32 +11,95 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | @@ -11,32 +11,95 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | ||
11 | { | 11 | { |
12 | private $isInteractiveRequest = false; | 12 | private $isInteractiveRequest = false; |
13 | 13 | ||
14 | + private $interactiveRequestRealIndexes = array(); | ||
15 | + private $interactiveMultiPlotState = array(); | ||
16 | + private $interactiveTimeSelectionState = array(); | ||
17 | + private $interactiveCrtTTFileIndex = -1; | ||
18 | + | ||
14 | /* | 19 | /* |
15 | * @brief method to unmarshall a plot request | 20 | * @brief method to unmarshall a plot request |
16 | */ | 21 | */ |
17 | protected function unmarshallRequest($input) | 22 | protected function unmarshallRequest($input) |
18 | { | 23 | { |
24 | + $this->interactiveRequestRealIndexes = array(); | ||
25 | + | ||
19 | if (isset($input->{'action'})) | 26 | if (isset($input->{'action'})) |
20 | $input = $this->unmarshallActionRequest($input); | 27 | $input = $this->unmarshallActionRequest($input); |
21 | else | 28 | else |
22 | //save request | 29 | //save request |
23 | $this->saveIHMRequest($input); | 30 | $this->saveIHMRequest($input); |
24 | 31 | ||
32 | + //Get active tab | ||
33 | + $activeTab = NULL; | ||
34 | + foreach ($input->tabs as $tab) | ||
35 | + { | ||
36 | + if ($tab->{'id'} == $input->{'last-plotted-tab'}) | ||
37 | + { | ||
38 | + $activeTab = $tab; | ||
39 | + } | ||
40 | + } | ||
41 | + | ||
25 | //Request | 42 | //Request |
26 | - $requestIndex = 0; | 43 | + $requestIndexInParamData = 0; |
44 | + $tabRequestIndex = 0; | ||
27 | $this->isInteractiveRequest = ($input->{'file-output'} == 'INTERACTIVE'); | 45 | $this->isInteractiveRequest = ($input->{'file-output'} == 'INTERACTIVE'); |
28 | $postProcessCmd = ""; | 46 | $postProcessCmd = ""; |
29 | foreach ($input->tabs as $tab) | 47 | foreach ($input->tabs as $tab) |
30 | { | 48 | { |
49 | + if (isset($activeTab)) | ||
50 | + { | ||
51 | + if ($activeTab->{'multi-plot-linked'} && !$tab->{'multi-plot-linked'}) | ||
52 | + { | ||
53 | + ++$tabRequestIndex; | ||
54 | + //Tab is not linked to the Multi Plot Mode | ||
55 | + continue; | ||
56 | + } | ||
57 | + else if (!$activeTab->{'multi-plot-linked'} && ($tab->{'id'} != $activeTab->{'id'})) | ||
58 | + { | ||
59 | + ++$tabRequestIndex; | ||
60 | + //Plot only current active tab | ||
61 | + continue; | ||
62 | + } | ||
63 | + else if (isset($input->{'force-single-replot'}) && $input->{'force-single-replot'} && ($tab->{'id'} != $activeTab->{'id'})) | ||
64 | + { | ||
65 | + ++$tabRequestIndex; | ||
66 | + //Plot only current active tab when 'force-single-replot' is active | ||
67 | + continue; | ||
68 | + } | ||
69 | + } | ||
70 | + | ||
31 | $requestNode = $this->paramsData->addRequestNode(); | 71 | $requestNode = $this->paramsData->addRequestNode(); |
72 | + $requestNode->setRealIndex($tabRequestIndex); | ||
32 | $outputsNode = $requestNode->getOutputsNode(); | 73 | $outputsNode = $requestNode->getOutputsNode(); |
33 | $paramsNode = $requestNode->getParamsNode(); | 74 | $paramsNode = $requestNode->getParamsNode(); |
34 | 75 | ||
35 | //unmarshall time definition | 76 | //unmarshall time definition |
36 | if ($tab->{'multi-plot-linked'}) | 77 | if ($tab->{'multi-plot-linked'}) |
37 | - $this->unmarshallTimeDefinition($input, $requestIndex, $this->isInteractiveRequest && !$tab->{'page-superpose-mode'}); | 78 | + { |
79 | + $isIntervalRequest = ($input->timesrc == 'Interval'); | ||
80 | + $ttFileIndex = -1; | ||
81 | + $ttIntIndex = -1; | ||
82 | + if ($this->isInteractiveRequest && !$isIntervalRequest && !$tab->{'page-superpose-mode'}) | ||
83 | + { | ||
84 | + $ttFileIndex = !isset($activeTab->{'ttFileIndex'}) ? 0 : $activeTab->{'ttFileIndex'}; | ||
85 | + $ttIntIndex = !isset($activeTab->{'intIndex'}) ? 0 : $activeTab->{'intIndex'}; | ||
86 | + } | ||
87 | + $this->unmarshallTimeDefinition($input, $requestIndexInParamData, $ttFileIndex, $ttIntIndex); | ||
88 | + } | ||
38 | else | 89 | else |
39 | - $this->unmarshallTimeDefinition($tab, $requestIndex, $this->isInteractiveRequest && !$tab->{'page-superpose-mode'}); | 90 | + { |
91 | + $isIntervalRequest = ($tab->timesrc == 'Interval'); | ||
92 | + $ttFileIndex = -1; | ||
93 | + $ttIntIndex = -1; | ||
94 | + if ($this->isInteractiveRequest && !$isIntervalRequest && !$tab->{'page-superpose-mode'}) | ||
95 | + { | ||
96 | + $ttFileIndex = !isset($activeTab->{'ttFileIndex'}) ? 0 : $activeTab->{'ttFileIndex'}; | ||
97 | + $ttIntIndex = !isset($activeTab->{'intIndex'}) ? 0 : $activeTab->{'intIndex'}; | ||
98 | + } | ||
99 | + $this->unmarshallTimeDefinition($tab, $requestIndexInParamData, $ttFileIndex, $ttIntIndex); | ||
100 | + } | ||
101 | + | ||
102 | + $this->interactiveCrtTTFileIndex = $ttFileIndex; | ||
40 | 103 | ||
41 | $plotOutputNode = $outputsNode->addNewOutput(RequestOutputTypeEnum::PLOT); | 104 | $plotOutputNode = $outputsNode->addNewOutput(RequestOutputTypeEnum::PLOT); |
42 | 105 | ||
@@ -171,7 +234,12 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | @@ -171,7 +234,12 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | ||
171 | } | 234 | } |
172 | 235 | ||
173 | if ($this->isInteractiveRequest) | 236 | if ($this->isInteractiveRequest) |
237 | + { | ||
238 | + $this->interactiveRequestRealIndexes[PLOT_RESULT_FILE_KEY."_".$tab->{'id'}] = $tabRequestIndex; | ||
239 | + $this->interactiveMultiPlotState[PLOT_RESULT_FILE_KEY."_".$tab->{'id'}] = $tab->{'multi-plot-linked'}; | ||
240 | + $this->interactiveTimeSelectionState[PLOT_RESULT_FILE_KEY."_".$tab->{'id'}] = $isIntervalRequest; | ||
174 | $this->paramsData->addWaitingResult(PLOT_RESULT_FILE_KEY."_".$tab->{'id'}, $waitingResultFile); | 241 | $this->paramsData->addWaitingResult(PLOT_RESULT_FILE_KEY."_".$tab->{'id'}, $waitingResultFile); |
242 | + } | ||
175 | else | 243 | else |
176 | $this->paramsData->addWaitingResult(PLOT_RESULT_FILE_KEY, $waitingResultFile); | 244 | $this->paramsData->addWaitingResult(PLOT_RESULT_FILE_KEY, $waitingResultFile); |
177 | 245 | ||
@@ -188,7 +256,8 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | @@ -188,7 +256,8 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | ||
188 | if ($this->isInteractiveRequest && $isPortrait) | 256 | if ($this->isInteractiveRequest && $isPortrait) |
189 | $postProcessCmd .= " | convert ".$waitingResultFile." -rotate -90 ".$waitingResultFile; | 257 | $postProcessCmd .= " | convert ".$waitingResultFile." -rotate -90 ".$waitingResultFile; |
190 | 258 | ||
191 | - ++$requestIndex; | 259 | + ++$tabRequestIndex; |
260 | + ++$requestIndexInParamData; | ||
192 | } | 261 | } |
193 | 262 | ||
194 | $this->paramsData->setBatchEnable(!(($fileFormat == RequestOutputPlotPageFormatEnum::PNG) && $this->isInteractiveRequest)); | 263 | $this->paramsData->setBatchEnable(!(($fileFormat == RequestOutputPlotPageFormatEnum::PNG) && $this->isInteractiveRequest)); |
@@ -1146,6 +1215,7 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | @@ -1146,6 +1215,7 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | ||
1146 | return $commonRes; | 1215 | return $commonRes; |
1147 | } | 1216 | } |
1148 | 1217 | ||
1218 | + //Interactive request | ||
1149 | if (!$data->getSuccess()) | 1219 | if (!$data->getSuccess()) |
1150 | return array( | 1220 | return array( |
1151 | 'success' => false, | 1221 | 'success' => false, |
@@ -1162,6 +1232,10 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | @@ -1162,6 +1232,10 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | ||
1162 | 1232 | ||
1163 | $result[] = array( | 1233 | $result[] = array( |
1164 | "id" => $key, | 1234 | "id" => $key, |
1235 | + "index" => $this->interactiveRequestRealIndexes[$key], | ||
1236 | + "multiplot" => $this->interactiveMultiPlotState[$key], | ||
1237 | + "isInterval" => $this->interactiveTimeSelectionState[$key], | ||
1238 | + "ttFileIndex" => $this->interactiveCrtTTFileIndex, | ||
1165 | "context" => IHMPlotContextFileClass::parse($this->getWorkingPath().$contextResult), | 1239 | "context" => IHMPlotContextFileClass::parse($this->getWorkingPath().$contextResult), |
1166 | "plot" => $waitingResult | 1240 | "plot" => $waitingResult |
1167 | ); | 1241 | ); |
@@ -1230,6 +1304,8 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | @@ -1230,6 +1304,8 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | ||
1230 | case 'extend' : | 1304 | case 'extend' : |
1231 | case 'shift' : | 1305 | case 'shift' : |
1232 | return $this->unmarshallNavigation($input, $plotInput); | 1306 | return $this->unmarshallNavigation($input, $plotInput); |
1307 | + case 'goto' : | ||
1308 | + return $this->unmarshallTTGoto($input, $plotInput); | ||
1233 | default : | 1309 | default : |
1234 | throw new Exception('Interactive action not implemented.'); | 1310 | throw new Exception('Interactive action not implemented.'); |
1235 | } | 1311 | } |
@@ -1237,82 +1313,65 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | @@ -1237,82 +1313,65 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | ||
1237 | 1313 | ||
1238 | private function unmarshallZoom($input, $plotInput) | 1314 | private function unmarshallZoom($input, $plotInput) |
1239 | { | 1315 | { |
1316 | + //Find current tab | ||
1317 | + $crtTab = NULL; | ||
1318 | + foreach ($plotInput->{'tabs'} as $tab) | ||
1319 | + { | ||
1320 | + if ($input->{'tabId'} == PLOT_RESULT_FILE_KEY."_".$tab->{'id'}) | ||
1321 | + { | ||
1322 | + $crtTab = $tab; | ||
1323 | + break; | ||
1324 | + } | ||
1325 | + } | ||
1326 | + | ||
1327 | + if (!$crtTab) | ||
1328 | + throw new Exception('Cannot retrieve plot tab for navigation action.'); | ||
1329 | + | ||
1240 | if ($input->{'axeId'} == 'timeAxis') | 1330 | if ($input->{'axeId'} == 'timeAxis') |
1241 | { | 1331 | { |
1242 | - //Time Axis | ||
1243 | - foreach ($plotInput->{'tabs'} as $tab) | 1332 | + //Zoom on Time Axis |
1333 | + if ($crtTab->{'multi-plot-linked'}) | ||
1244 | { | 1334 | { |
1245 | - if ($input->{'tabId'} == PLOT_RESULT_FILE_KEY."_".$tab->{'id'}) | ||
1246 | - { | ||
1247 | - if ($tab->{'multi-plot-linked'}) | ||
1248 | - { | ||
1249 | - //Update multi plot time definition | ||
1250 | - $plotInput = $plotInput; | ||
1251 | - $plotInput->{'timesrc'} = 'Interval'; | ||
1252 | - $plotInput->{'startDate'} = $input->{'min'}; | ||
1253 | - $plotInput->{'stopDate'} = $input->{'max'}; | ||
1254 | - | ||
1255 | - $interactiveInput = clone $plotInput; | ||
1256 | - $interactiveInput->{'tabs'} = array(); | ||
1257 | - //Execute only tabs linked to the multi plot mode | ||
1258 | - foreach ($plotInput->{'tabs'} as $tab2) | ||
1259 | - { | ||
1260 | - if ($tab2->{'multi-plot-linked'}) | ||
1261 | - $interactiveInput->{'tabs'}[] = $tab2; | ||
1262 | - } | ||
1263 | - | ||
1264 | - $this->saveIHMRequest($plotInput); | ||
1265 | - return $interactiveInput; | ||
1266 | - } | ||
1267 | - else | ||
1268 | - { | ||
1269 | - //Update tab time definition | ||
1270 | - $tab->{'timesrc'} = 'Interval'; | ||
1271 | - $tab->{'startDate'} = $input->{'min'}; | ||
1272 | - $tab->{'stopDate'} = $input->{'max'}; | ||
1273 | - //Execute only concerning plot tabs | ||
1274 | - $interactiveInput = clone $plotInput; | ||
1275 | - $interactiveInput->{'tabs'} = array(); | ||
1276 | - $interactiveInput->{'tabs'}[] = $tab; | ||
1277 | - $this->saveIHMRequest($plotInput); | ||
1278 | - return $interactiveInput; | ||
1279 | - } | ||
1280 | - } | 1335 | + //Update multi plot time definition |
1336 | + $plotInput->{'timesrc'} = 'Interval'; | ||
1337 | + $plotInput->{'startDate'} = $input->{'min'}; | ||
1338 | + $plotInput->{'stopDate'} = $input->{'max'}; | ||
1281 | } | 1339 | } |
1282 | - throw new Exception('Cannot retrieve plot tab for zoom action.'); | 1340 | + else |
1341 | + { | ||
1342 | + $crtTab->{'timesrc'} = 'Interval'; | ||
1343 | + $crtTab->{'startDate'} = $input->{'min'}; | ||
1344 | + $crtTab->{'stopDate'} = $input->{'max'}; | ||
1345 | + } | ||
1346 | + | ||
1347 | + $plotInput->{'last-plotted-tab'} = $crtTab->{'id'}; | ||
1348 | + $this->saveIHMRequest($plotInput); | ||
1349 | + return $plotInput; | ||
1283 | } | 1350 | } |
1284 | 1351 | ||
1285 | - //Execute only concerning plot tabs | ||
1286 | - $interactiveInput = clone $plotInput; | ||
1287 | - $interactiveInput->{'tabs'} = array(); | ||
1288 | - foreach ($plotInput->{'tabs'} as $tab) | 1352 | + //Digital axis zoom |
1353 | + foreach ($crtTab->{'panels'} as $panel) | ||
1289 | { | 1354 | { |
1290 | - if ($input->{'tabId'} == PLOT_RESULT_FILE_KEY."_".$tab->{'id'}) | 1355 | + if ($input->{'panelId'} == $panel->{'id'}) |
1291 | { | 1356 | { |
1292 | - //Add current tab to interactive input | ||
1293 | - $interactiveInput->{'tabs'}[] = $tab; | ||
1294 | - foreach ($interactiveInput->{'tabs'}[0]->{'panels'} as $panel) | 1357 | + foreach ($panel->{'axes'} as $axis) |
1295 | { | 1358 | { |
1296 | - if ($input->{'panelId'} == $panel->{'id'}) | 1359 | + if ($input->{'axeId'} == $axis->{'id'}) |
1297 | { | 1360 | { |
1298 | - foreach ($panel->{'axes'} as $axis) | ||
1299 | - { | ||
1300 | - if ($input->{'axeId'} == $axis->{'id'}) | ||
1301 | - { | ||
1302 | - $axis->{'axis-range-extend'} = false; | ||
1303 | - $axis->{'axis-range-min'} = $input->{'min'}; | ||
1304 | - $axis->{'axis-range-max'} = $input->{'max'}; | ||
1305 | - $this->saveIHMRequest($plotInput); | ||
1306 | - return $interactiveInput; | ||
1307 | - } | ||
1308 | - } | ||
1309 | - throw new Exception('Cannot retrieve axis for zoom action.'); | 1361 | + $axis->{'axis-range-extend'} = false; |
1362 | + $axis->{'axis-range-min'} = $input->{'min'}; | ||
1363 | + $axis->{'axis-range-max'} = $input->{'max'}; | ||
1364 | + $plotInput->{'last-plotted-tab'} = $crtTab->{'id'}; | ||
1365 | + $this->saveIHMRequest($plotInput); | ||
1366 | + //Do not save 'force-single-replot' in request file! | ||
1367 | + $plotInput->{'force-single-replot'} = true; | ||
1368 | + return $plotInput; | ||
1310 | } | 1369 | } |
1311 | } | 1370 | } |
1312 | - throw new Exception('Cannot retrieve plot panel for zoom action.'); | 1371 | + throw new Exception('Cannot retrieve axis for zoom action.'); |
1313 | } | 1372 | } |
1314 | } | 1373 | } |
1315 | - throw new Exception('Cannot retrieve plot tab for zoom action.'); | 1374 | + throw new Exception('Cannot retrieve plot panel for zoom action.'); |
1316 | } | 1375 | } |
1317 | 1376 | ||
1318 | private function unmarshallNavigation($input, $plotInput) | 1377 | private function unmarshallNavigation($input, $plotInput) |
@@ -1387,30 +1446,39 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | @@ -1387,30 +1446,39 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | ||
1387 | { | 1446 | { |
1388 | $plotInput->{'startDate'} = $startTime; | 1447 | $plotInput->{'startDate'} = $startTime; |
1389 | $plotInput->{'stopDate'} = $stopTime; | 1448 | $plotInput->{'stopDate'} = $stopTime; |
1390 | - | ||
1391 | - $interactiveInput = clone $plotInput; | ||
1392 | - $interactiveInput->{'tabs'} = array(); | ||
1393 | - //Execute only tabs linked to the multi plot mode | ||
1394 | - foreach ($plotInput->{'tabs'} as $tab) | ||
1395 | - { | ||
1396 | - if ($tab->{'multi-plot-linked'}) | ||
1397 | - $interactiveInput->{'tabs'}[] = $tab; | ||
1398 | - } | ||
1399 | - $this->saveIHMRequest($plotInput); | ||
1400 | - return $interactiveInput; | ||
1401 | } | 1449 | } |
1402 | else | 1450 | else |
1403 | { | 1451 | { |
1404 | $crtTab->{'startDate'} = $startTime; | 1452 | $crtTab->{'startDate'} = $startTime; |
1405 | $crtTab->{'stopDate'} = $stopTime; | 1453 | $crtTab->{'stopDate'} = $stopTime; |
1406 | - | ||
1407 | - $interactiveInput = clone $plotInput; | ||
1408 | - $interactiveInput->{'tabs'} = array(); | ||
1409 | - //Execute only concerning plot tabs | ||
1410 | - $interactiveInput->{'tabs'}[] = $crtTab; | ||
1411 | - $this->saveIHMRequest($plotInput); | ||
1412 | - return $interactiveInput; | ||
1413 | } | 1454 | } |
1455 | + | ||
1456 | + $plotInput->{'last-plotted-tab'} = $crtTab->{'id'}; | ||
1457 | + $this->saveIHMRequest($plotInput); | ||
1458 | + return $plotInput; | ||
1459 | + } | ||
1460 | + | ||
1461 | + private function unmarshallTTGoto($input, $plotInput) | ||
1462 | + { | ||
1463 | + //Find current tab | ||
1464 | + $crtTab = NULL; | ||
1465 | + foreach ($plotInput->{'tabs'} as $tab) | ||
1466 | + { | ||
1467 | + if ($input->{'tabId'} == PLOT_RESULT_FILE_KEY."_".$tab->{'id'}) | ||
1468 | + { | ||
1469 | + $crtTab = $tab; | ||
1470 | + break; | ||
1471 | + } | ||
1472 | + } | ||
1473 | + | ||
1474 | + if (!$crtTab) | ||
1475 | + throw new Exception('Cannot retrieve plot tab for navigation action.'); | ||
1476 | + | ||
1477 | + $crtTab->{'ttFileIndex'} = $input->{'ttFileIndex'}; | ||
1478 | + $crtTab->{'intIndex'} = $input->{'intIndex'}; | ||
1479 | + | ||
1480 | + $this->saveIHMRequest($plotInput); | ||
1481 | + return $plotInput; | ||
1414 | } | 1482 | } |
1415 | } | 1483 | } |
1416 | ?> | 1484 | ?> |
1417 | \ No newline at end of file | 1485 | \ No newline at end of file |
src/InputOutput/IHMImpl/Tools/IHMPlotContextFileClass.php
@@ -25,6 +25,10 @@ class IHMPlotContextFileClass { | @@ -25,6 +25,10 @@ class IHMPlotContextFileClass { | ||
25 | $pageContext = array( | 25 | $pageContext = array( |
26 | 'startTime' => $pageNode->getAttribute('startTime'), | 26 | 'startTime' => $pageNode->getAttribute('startTime'), |
27 | 'stopTime' => $pageNode->getAttribute('stopTime'), | 27 | 'stopTime' => $pageNode->getAttribute('stopTime'), |
28 | + 'superposeMode' => ($pageNode->getAttribute('stopTime') == "true"), | ||
29 | + 'ttName' => $pageNode->getAttribute('ttName'), | ||
30 | + 'ttIndex' => ($pageNode->getAttribute('ttIndex') == '') ? 0 : intval($pageNode->getAttribute('ttIndex')), | ||
31 | + 'ttNbIntervals' => ($pageNode->getAttribute('ttNbIntervals') == '') ? 0 : intval($pageNode->getAttribute('ttNbIntervals')), | ||
28 | 'portrait' => $isPortrait, | 32 | 'portrait' => $isPortrait, |
29 | //An image rotation of 90 deg. is done after request execution if a page is in "portrait" mode | 33 | //An image rotation of 90 deg. is done after request execution if a page is in "portrait" mode |
30 | 'width' => ($isPortrait ? intval($pageNode->getAttribute('height')) : intval($pageNode->getAttribute('width'))), | 34 | 'width' => ($isPortrait ? intval($pageNode->getAttribute('height')) : intval($pageNode->getAttribute('width'))), |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestNodeClass.php
@@ -65,6 +65,8 @@ define ("REQUEST_NAME", "request"); | @@ -65,6 +65,8 @@ define ("REQUEST_NAME", "request"); | ||
65 | */ | 65 | */ |
66 | class RequestNodeClass extends NodeClass | 66 | class RequestNodeClass extends NodeClass |
67 | { | 67 | { |
68 | + private $realIndex = 0; | ||
69 | + | ||
68 | public function __construct() | 70 | public function __construct() |
69 | { | 71 | { |
70 | parent::__construct(REQUEST_NAME); | 72 | parent::__construct(REQUEST_NAME); |
@@ -88,6 +90,16 @@ class RequestNodeClass extends NodeClass | @@ -88,6 +90,16 @@ class RequestNodeClass extends NodeClass | ||
88 | { | 90 | { |
89 | return $this->getFirstChildByName(REQUESTOUTPUTS_NAME); | 91 | return $this->getFirstChildByName(REQUESTOUTPUTS_NAME); |
90 | } | 92 | } |
93 | + | ||
94 | + public function setRealIndex($index) | ||
95 | + { | ||
96 | + $this->realIndex = $index; | ||
97 | + } | ||
98 | + | ||
99 | + public function getRealIndex() | ||
100 | + { | ||
101 | + return $this->realIndex; | ||
102 | + } | ||
91 | } | 103 | } |
92 | 104 | ||
93 | ?> | 105 | ?> |
94 | \ No newline at end of file | 106 | \ No newline at end of file |
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_TTNAME", "name"); | ||
46 | define ("REQUESTTIMETABLE_INDEX", "index"); | 47 | define ("REQUESTTIMETABLE_INDEX", "index"); |
47 | 48 | ||
48 | /** | 49 | /** |
@@ -67,6 +68,16 @@ class RequestTimesTimeTableNodeClass extends NodeClass | @@ -67,6 +68,16 @@ class RequestTimesTimeTableNodeClass extends NodeClass | ||
67 | return $this->getAttribute(REQUESTTIMETABLE_ID); | 68 | return $this->getAttribute(REQUESTTIMETABLE_ID); |
68 | } | 69 | } |
69 | 70 | ||
71 | + public function setTTName($name) | ||
72 | + { | ||
73 | + $this->setAttribute(REQUESTTIMETABLE_TTNAME, $name); | ||
74 | + } | ||
75 | + | ||
76 | + public function getTTName() | ||
77 | + { | ||
78 | + return $this->getAttribute(REQUESTTIMETABLE_TTNAME); | ||
79 | + } | ||
80 | + | ||
70 | public function setIndex($index) | 81 | public function setIndex($index) |
71 | { | 82 | { |
72 | $this->setAttribute(REQUESTTIMETABLE_INDEX, $index); | 83 | $this->setAttribute(REQUESTTIMETABLE_INDEX, $index); |
@@ -80,6 +91,7 @@ class RequestTimesTimeTableNodeClass extends NodeClass | @@ -80,6 +91,7 @@ class RequestTimesTimeTableNodeClass extends NodeClass | ||
80 | 91 | ||
81 | define ("REQUESTCATALOG_NAME", "catalog"); | 92 | define ("REQUESTCATALOG_NAME", "catalog"); |
82 | define ("REQUESTCATALOG_ID", "id"); | 93 | define ("REQUESTCATALOG_ID", "id"); |
94 | +define ("REQUESTCATALOG_TTNAME", "name"); | ||
83 | define ("REQUESTCATALOG_INDEX", "index"); | 95 | define ("REQUESTCATALOG_INDEX", "index"); |
84 | 96 | ||
85 | /** | 97 | /** |
@@ -103,6 +115,16 @@ class RequestCatalogNodeClass extends NodeClass | @@ -103,6 +115,16 @@ class RequestCatalogNodeClass extends NodeClass | ||
103 | { | 115 | { |
104 | return $this->getAttribute(REQUESTCATALOG_ID); | 116 | return $this->getAttribute(REQUESTCATALOG_ID); |
105 | } | 117 | } |
118 | + | ||
119 | + public function setCatalogName($name) | ||
120 | + { | ||
121 | + $this->setAttribute(REQUESTCATALOG_TTNAME, $name); | ||
122 | + } | ||
123 | + | ||
124 | + public function getCatalogName() | ||
125 | + { | ||
126 | + return $this->getAttribute(REQUESTCATALOG_TTNAME); | ||
127 | + } | ||
106 | 128 | ||
107 | public function setIndex($index) | 129 | public function setIndex($index) |
108 | { | 130 | { |
@@ -141,19 +163,23 @@ class RequestTimesNodeClass extends NodeClass | @@ -141,19 +163,23 @@ class RequestTimesNodeClass extends NodeClass | ||
141 | return $this->getChildrenByName(REQUESTTIMEINTERVAL_NAME); | 163 | return $this->getChildrenByName(REQUESTTIMEINTERVAL_NAME); |
142 | } | 164 | } |
143 | 165 | ||
144 | - public function addTimeTable($id, $index = -1) | 166 | + public function addTimeTable($id, $name, $index = -1) |
145 | { | 167 | { |
146 | $timeTable = new RequestTimesTimeTableNodeClass(); | 168 | $timeTable = new RequestTimesTimeTableNodeClass(); |
147 | $timeTable->setId($id); | 169 | $timeTable->setId($id); |
170 | + if ($name != '') | ||
171 | + $timeTable->setTTName($name); | ||
148 | if ($index >= 0) | 172 | if ($index >= 0) |
149 | $timeTable->setIndex($index); | 173 | $timeTable->setIndex($index); |
150 | $this->addChild($timeTable); | 174 | $this->addChild($timeTable); |
151 | } | 175 | } |
152 | 176 | ||
153 | - public function addCatalog($id, $index = -1) | 177 | + public function addCatalog($id, $name, $index = -1) |
154 | { | 178 | { |
155 | $catalogNode = new RequestCatalogNodeClass(); | 179 | $catalogNode = new RequestCatalogNodeClass(); |
156 | $catalogNode->setId($id); | 180 | $catalogNode->setId($id); |
181 | + if ($name != '') | ||
182 | + $catalogNode->setCatalogName($name); | ||
157 | if ($index >= 0) | 183 | if ($index >= 0) |
158 | $catalogNode->setIndex($index); | 184 | $catalogNode->setIndex($index); |
159 | $this->addChild($catalogNode); | 185 | $this->addChild($catalogNode); |
src/Request/ParamsRequestImpl/ParamsRequestClass.php
@@ -23,13 +23,11 @@ class ParamsRequestClass extends ProcessRequestClass | @@ -23,13 +23,11 @@ class ParamsRequestClass extends ProcessRequestClass | ||
23 | { | 23 | { |
24 | case ParamsRequestTypeEnumClass::XMLREQUEST : | 24 | case ParamsRequestTypeEnumClass::XMLREQUEST : |
25 | $cmd = ""; | 25 | $cmd = ""; |
26 | - $requestIndex = 0; | ||
27 | foreach ($this->requestData->getRequestNodes() as $requestNode) | 26 | foreach ($this->requestData->getRequestNodes() as $requestNode) |
28 | { | 27 | { |
29 | if ($cmd != "") | 28 | if ($cmd != "") |
30 | $cmd .= " && "; | 29 | $cmd .= " && "; |
31 | - $cmd .= KernelConfigClass::getKernelBinPath()."amdaXMLRequestorTool ".$this->getRequestFilePath($requestIndex); | ||
32 | - ++$requestIndex; | 30 | + $cmd .= KernelConfigClass::getKernelBinPath()."amdaXMLRequestorTool ".$this->getRequestFilePath($requestNode->getRealIndex()); |
33 | } | 31 | } |
34 | $this->requestData->setCmd($cmd); | 32 | $this->requestData->setCmd($cmd); |
35 | break; | 33 | break; |
@@ -62,7 +60,6 @@ class ParamsRequestClass extends ProcessRequestClass | @@ -62,7 +60,6 @@ class ParamsRequestClass extends ProcessRequestClass | ||
62 | 60 | ||
63 | if ($this->requestData->getRequestType() == ParamsRequestTypeEnumClass::XMLREQUEST) | 61 | if ($this->requestData->getRequestType() == ParamsRequestTypeEnumClass::XMLREQUEST) |
64 | { | 62 | { |
65 | - $requestIndex = 0; | ||
66 | foreach ($this->requestData->getRequestNodes() as $requestNode) | 63 | foreach ($this->requestData->getRequestNodes() as $requestNode) |
67 | { | 64 | { |
68 | //create XML request file | 65 | //create XML request file |
@@ -72,25 +69,23 @@ class ParamsRequestClass extends ProcessRequestClass | @@ -72,25 +69,23 @@ class ParamsRequestClass extends ProcessRequestClass | ||
72 | 69 | ||
73 | if (!$xmlNode = $requestNode->toXMLNode($doc)) | 70 | if (!$xmlNode = $requestNode->toXMLNode($doc)) |
74 | { | 71 | { |
75 | - $this->requestData->setLastErrorMessage('Cannot create params request XML file for request '.$requestIndex); | 72 | + $this->requestData->setLastErrorMessage('Cannot create params request XML file for request '.$requestNode->getRealIndex()); |
76 | return false; | 73 | return false; |
77 | } | 74 | } |
78 | 75 | ||
79 | $doc->appendChild($xmlNode); | 76 | $doc->appendChild($xmlNode); |
80 | 77 | ||
81 | - if (!$doc->save($this->getRequestFilePath($requestIndex))) | 78 | + if (!$doc->save($this->getRequestFilePath($requestNode->getRealIndex()))) |
82 | { | 79 | { |
83 | - $this->requestData->setLastErrorMessage('Cannot save params request XML file for request '.$requestIndex); | 80 | + $this->requestData->setLastErrorMessage('Cannot save params request XML file for request '.$requestNode->getRealIndex()); |
84 | return false; | 81 | return false; |
85 | } | 82 | } |
86 | 83 | ||
87 | if (!$doc->schemaValidate(KernelConfigClass::getXSDRequestFilePath())) | 84 | if (!$doc->schemaValidate(KernelConfigClass::getXSDRequestFilePath())) |
88 | { | 85 | { |
89 | - $this->requestData->setLastErrorMessage('Params request XML file not valid for request '.$requestIndex); | 86 | + $this->requestData->setLastErrorMessage('Params request XML file not valid for request '.$requestNode->getRealIndex()); |
90 | return false; | 87 | return false; |
91 | } | 88 | } |
92 | - | ||
93 | - ++$requestIndex; | ||
94 | } | 89 | } |
95 | } | 90 | } |
96 | 91 |