Commit 70e82c1f24afd62be4bac002d32e61234a816704

Authored by Benjamin Renard
1 parent 7d84634e

Fix doPlot

src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
... ... @@ -16,6 +16,8 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
16 16 private $isInstantPlot = false;
17 17  
18 18 private $interactiveTimeSelectionState = array();
  19 + private $interactivePlotTitle = array();
  20 + private $interactivePlotIndex = array();
19 21 private $interactiveCrtTTFileIndex = -1;
20 22 private $interactivePreview = false;
21 23  
... ... @@ -41,10 +43,11 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
41 43 //Request
42 44 $this->isInteractiveRequest = ($input->{'file-output'} == 'INTERACTIVE');
43 45 $this->isFromWS = ($input->{'file-output'} == 'WS');
  46 + $this->paramsData->setRequestIndex($input->{'tab-index'});
44 47 $postProcessCmd = "";
45 48  
46 49 if ($forceTimeZoomReset)
47   - $this->resetZoomListForTab($input->{'id'}, $forceTimeZoomReset);
  50 + $this->resetZoomListForTab($input->{'tab-index'}, $forceTimeZoomReset);
48 51  
49 52 $requestNode = $this->paramsData->addRequestNode();
50 53 $outputsNode = $requestNode->getOutputsNode();
... ... @@ -95,7 +98,7 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
95 98 $filePrefix = "plot_";
96 99 if ($input->{'file-prefix'} && ($input->{'file-prefix'} != ""))
97 100 $filePrefix = $input->{'file-prefix'};
98   - $filePrefix .= $input->{'id'};
  101 + $filePrefix .= $input->{'tab-index'};
99 102  
100 103 $plotOutputNode->setFilePrefix($filePrefix);
101 104  
... ... @@ -197,9 +200,11 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
197 200  
198 201 if ($this->isInteractiveRequest)
199 202 {
200   - $this->interactiveTimeSelectionState[PLOT_RESULT_FILE_KEY."_".$input->{'id'}] = $isIntervalRequest;
  203 + $this->interactiveTimeSelectionState[PLOT_RESULT_FILE_KEY."_".$input->{'tab-index'}] = $isIntervalRequest;
  204 + $this->interactivePlotTitle[PLOT_RESULT_FILE_KEY."_".$input->{'tab-index'}] = $input->{'tab-title'};
  205 + $this->interactivePlotIndex[PLOT_RESULT_FILE_KEY."_".$input->{'tab-index'}] = $input->{'tab-index'};
201 206 $this->interactivePreview = isset($input->{'interactive-preview'}) && ($input->{'interactive-preview'});
202   - $this->paramsData->addWaitingResult(PLOT_RESULT_FILE_KEY."_".$input->{'id'}, $waitingResultFile);
  207 + $this->paramsData->addWaitingResult(PLOT_RESULT_FILE_KEY."_".$input->{'tab-index'}, $waitingResultFile);
203 208 }
204 209 else
205 210 $this->paramsData->addWaitingResult(PLOT_RESULT_FILE_KEY, $waitingResultFile);
... ... @@ -1404,8 +1409,10 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
1404 1409  
1405 1410 $result[] = array(
1406 1411 "id" => $key,
  1412 + "title" => $this->interactivePlotTitle[$key],
1407 1413 "preview" => $this->interactivePreview,
1408 1414 "isInterval" => $this->interactiveTimeSelectionState[$key],
  1415 + "index" => $this->interactivePlotIndex[$key],
1409 1416 "ttFileIndex" => $this->interactiveCrtTTFileIndex,
1410 1417 "context" => IHMPlotContextFileClass::parse($this->getWorkingPath().$contextResult),
1411 1418 "plot" => $waitingResult,
... ...
src/InputOutput/IHMImpl/Tools/IHMParamTemplateClass.php
... ... @@ -114,7 +114,6 @@ class IHMParamTemplateClass
114 114 }
115 115  
116 116 $exploded_args = sscanf($template_args_str , $args_format);
117   - error_log($exploded_args);
118 117  
119 118 if ($exploded_args === -1)
120 119 return FALSE;
... ...
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(0);
  30 + $cmd .= KernelConfigClass::getKernelBinPath()."amdaXMLRequestorTool ".$this->getRequestFilePath();
31 31 }
32 32 $this->requestData->setCmd($cmd);
33 33 break;
... ... @@ -78,7 +78,7 @@ class ParamsRequestClass extends ProcessRequestClass
78 78  
79 79 $doc->appendChild($xmlNode);
80 80  
81   - if (!$doc->save($this->getRequestFilePath(0)))
  81 + if (!$doc->save($this->getRequestFilePath()))
82 82 {
83 83 $this->requestData->setLastErrorMessage('Cannot save params request XML file for request');
84 84 return false;
... ... @@ -243,9 +243,9 @@ class ParamsRequestClass extends ProcessRequestClass
243 243 /*
244 244 * @brief Get the request file path for AMDA_Kernel
245 245 */
246   - private function getRequestFilePath($requestIndex)
  246 + private function getRequestFilePath()
247 247 {
248   - return $this->requestData->getWorkingPath()."request_".$requestIndex.".xml";
  248 + return $this->requestData->getWorkingPath()."request_".$this->requestData->getRequestIndex().".xml";
249 249 }
250 250 }
251 251 ?>
... ...
src/Request/ParamsRequestImpl/ParamsRequestDataClass.php
... ... @@ -32,6 +32,7 @@ class ParamsRequestDataClass extends ProcessRequestDataClass
32 32 private $paramId = "";
33 33 private $datasetId = array();
34 34 private $task = "";
  35 + private $requestIndex = 0;
35 36  
36 37 function __construct()
37 38 {
... ... @@ -77,6 +78,16 @@ class ParamsRequestDataClass extends ProcessRequestDataClass
77 78 {
78 79 $this->task = $task;
79 80 }
  81 +
  82 + public function getRequestIndex()
  83 + {
  84 + return $this->requestIndex;
  85 + }
  86 +
  87 + public function setRequestIndex($requestIndex)
  88 + {
  89 + $this->requestIndex = $requestIndex;
  90 + }
80 91  
81 92 public function addRequestNode()
82 93 {
... ...