Commit 30a708189141b999a7d52732edecdfa758ea4e0c

Authored by Benjamin Renard
1 parent db9b2cfe

Multi plot mode for zoom

src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
... ... @@ -33,7 +33,10 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
33 33 $paramsNode = $requestNode->getParamsNode();
34 34  
35 35 //unmarshall time definition
36   - $this->unmarshallTimeDefinition($input, $requestIndex, $this->isInteractiveRequest && !$tab->{'page-superpose-mode'});
  36 + if ($tab->{'multi-plot-linked'})
  37 + $this->unmarshallTimeDefinition($input, $requestIndex, $this->isInteractiveRequest && !$tab->{'page-superpose-mode'});
  38 + else
  39 + $this->unmarshallTimeDefinition($tab, $requestIndex, $this->isInteractiveRequest && !$tab->{'page-superpose-mode'});
37 40  
38 41 $plotOutputNode = $outputsNode->addNewOutput(RequestOutputTypeEnum::PLOT);
39 42  
... ... @@ -541,14 +544,13 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
541 544 break;
542 545 case 'spectro' :
543 546 $paramNode = $plotNode->getParams()->getParamById($paramInfo['id']);
544   - $this->unmarshallSpectro($paramData, $plotNode, $paramNode, $paramInfo['indexes']);
  547 + $this->unmarshallSpectro($paramData->{'param-drawing-object'}, $plotNode, $paramNode, $paramInfo['indexes']);
545 548 break;
546 549 case 'status-bar' :
547 550 if (($plotNode->getName() == REQUESTOUTPUTPLOTELEMENTSTATUS_NAME) && !isset($statusPlotNode))
548 551 $paramNode = $plotNode->getParams()->getParamById($paramInfo['id']);
549 552 else
550 553 $paramNode = $statusPlotNode->getParams()->getParamById($paramInfo['id']);
551   -
552 554 $this->unmarshallStatusBar($paramData->{'param-drawing-object'}, $paramNode, $paramInfo['indexes']);
553 555 break;
554 556 case 'tick-bar' :
... ... @@ -1230,12 +1232,47 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
1230 1232 {
1231 1233 if ($input->{'axeId'} == 'timeAxis')
1232 1234 {
1233   - $plotInput = $plotInput;
1234   - $plotInput->{'timesrc'} = 'Interval';
1235   - $plotInput->{'startDate'} = $input->{'min'};
1236   - $plotInput->{'stopDate'} = $input->{'max'};
1237   - $this->saveIHMRequest($plotInput);
1238   - return $plotInput;
  1235 + //Time Axis
  1236 + foreach ($plotInput->{'tabs'} as $tab)
  1237 + {
  1238 + if ($input->{'tabId'} == PLOT_RESULT_FILE_KEY."_".$tab->{'id'})
  1239 + {
  1240 + if ($tab->{'multi-plot-linked'})
  1241 + {
  1242 + //Update multi plot time definition
  1243 + $plotInput = $plotInput;
  1244 + $plotInput->{'timesrc'} = 'Interval';
  1245 + $plotInput->{'startDate'} = $input->{'min'};
  1246 + $plotInput->{'stopDate'} = $input->{'max'};
  1247 +
  1248 + $interactiveInput = clone $plotInput;
  1249 + $interactiveInput->{'tabs'} = array();
  1250 + //Execute only tabs linked to the multi plot mode
  1251 + foreach ($plotInput->{'tabs'} as $tab2)
  1252 + {
  1253 + if ($tab2->{'multi-plot-linked'})
  1254 + $interactiveInput->{'tabs'}[] = $tab2;
  1255 + }
  1256 +
  1257 + $this->saveIHMRequest($plotInput);
  1258 + return $interactiveInput;
  1259 + }
  1260 + else
  1261 + {
  1262 + //Update tab time definition
  1263 + $tab->{'timesrc'} = 'Interval';
  1264 + $tab->{'startDate'} = $input->{'min'};
  1265 + $tab->{'stopDate'} = $input->{'max'};
  1266 + //Execute only concerning plot tabs
  1267 + $interactiveInput = clone $plotInput;
  1268 + $interactiveInput->{'tabs'} = array();
  1269 + $interactiveInput->{'tabs'}[] = $tab;
  1270 + $this->saveIHMRequest($plotInput);
  1271 + return $interactiveInput;
  1272 + }
  1273 + }
  1274 + }
  1275 + throw new Exception('Cannot retrieve plot tab for zoom action.');
1239 1276 }
1240 1277  
1241 1278 //Execute only concerning plot tabs
... ...