Commit 7fc87ded0a670c093f37748707a96010b72955d4

Authored by Menouar AZIB
Committed by Benjamin Renard
1 parent 63aaa18d

Corriger le multi-panels bug

src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
@@ -1978,13 +1978,8 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass @@ -1978,13 +1978,8 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
1978 private function unmarshallPlotFunction($input, $plotInput) 1978 private function unmarshallPlotFunction($input, $plotInput)
1979 { 1979 {
1980 date_default_timezone_set('UTC'); 1980 date_default_timezone_set('UTC');
1981 - $timeStamp = strtotime($input->starttime);  
1982 - $DATE_TYPE = "Y-m-d\TH:i:s";  
1983 - $start_time_plotfunction = date($DATE_TYPE, $timeStamp);  
1984 - $timestamp_stop_plotfunction = strtotime($input->stoptime);  
1985 - $stop_time_plotfunction = date($DATE_TYPE, $timestamp_stop_plotfunction);  
1986 - $plotInput->{"startDate"} = $start_time_plotfunction;  
1987 - $plotInput->{"stopDate"} = $stop_time_plotfunction; 1981 + $plotInput->{"startDate"} =$input->starttime;
  1982 + $plotInput->{"stopDate"} = $input->stoptime;
1988 $plotInput->{"file-prefix"} = RequestOutPutPlotElementPlotFunctionNodeClass::REQUESTOUTPUTPLOTELEMENT_PLOTFUNCTION_NAME; 1983 $plotInput->{"file-prefix"} = RequestOutPutPlotElementPlotFunctionNodeClass::REQUESTOUTPUTPLOTELEMENT_PLOTFUNCTION_NAME;
1989 $plotInput->{"interactive-preview"} = true; 1984 $plotInput->{"interactive-preview"} = true;
1990 $plotInput->{"file-format"} = "PNG"; 1985 $plotInput->{"file-format"} = "PNG";
@@ -1996,10 +1991,11 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass @@ -1996,10 +1991,11 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
1996 "layout-panel-spacing" => 0.05 1991 "layout-panel-spacing" => 0.05
1997 ); 1992 );
1998 1993
1999 - 1994 + $panels = [];
2000 1995
2001 - foreach ($plotInput->{'panels'} as $panel) {  
2002 - if ($input->{'panelId'} == $panel->{'id'}) { 1996 + foreach ($plotInput->{'panels'} as $input_panel) {
  1997 + if ($input->{'panelId'} == $input_panel->{'id'}) {
  1998 + $panel = $input_panel;
2003 if ($panel->{'panel-plot-type'} !== 'timePlot') 1999 if ($panel->{'panel-plot-type'} !== 'timePlot')
2004 throw new Exception('Plot Function action only available for Time plot.'); 2000 throw new Exception('Plot Function action only available for Time plot.');
2005 2001
@@ -2137,10 +2133,11 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass @@ -2137,10 +2133,11 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
2137 $panel->{RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_SCALE_ABSCISSE} = $scale_abscisse; 2133 $panel->{RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_SCALE_ABSCISSE} = $scale_abscisse;
2138 $panel->{RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_SCALE_ORDONNEE} = $scale_ordonnee; 2134 $panel->{RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_SCALE_ORDONNEE} = $scale_ordonnee;
2139 2135
  2136 + $panels[]= $panel;
2140 break; 2137 break;
2141 } 2138 }
2142 } 2139 }
2143 - 2140 + $plotInput->{'panels'} = $panels;
2144 return $plotInput; 2141 return $plotInput;
2145 } 2142 }
2146 2143
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutPutPlotElementPlotFunctionNodeClass.php
@@ -50,7 +50,7 @@ class RequestOutPutPlotElementPlotFunctionNodeClass extends RequestOutputPlotEle @@ -50,7 +50,7 @@ class RequestOutPutPlotElementPlotFunctionNodeClass extends RequestOutputPlotEle
50 */ 50 */
51 public static function getTextLegend($abscisse) 51 public static function getTextLegend($abscisse)
52 { 52 {
53 - return $abscisse === RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_FREQUNECY ? "Freq, Hz" : "Period, S"; 53 + return $abscisse === RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_FREQUNECY ? "Frequency (Hz)" : "Period (S)";
54 } 54 }
55 55
56 public function getXAxis() 56 public function getXAxis()