diff --git a/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php b/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php index e670d9f..21f3225 100644 --- a/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php +++ b/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php @@ -1978,13 +1978,8 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass private function unmarshallPlotFunction($input, $plotInput) { date_default_timezone_set('UTC'); - $timeStamp = strtotime($input->starttime); - $DATE_TYPE = "Y-m-d\TH:i:s"; - $start_time_plotfunction = date($DATE_TYPE, $timeStamp); - $timestamp_stop_plotfunction = strtotime($input->stoptime); - $stop_time_plotfunction = date($DATE_TYPE, $timestamp_stop_plotfunction); - $plotInput->{"startDate"} = $start_time_plotfunction; - $plotInput->{"stopDate"} = $stop_time_plotfunction; + $plotInput->{"startDate"} =$input->starttime; + $plotInput->{"stopDate"} = $input->stoptime; $plotInput->{"file-prefix"} = RequestOutPutPlotElementPlotFunctionNodeClass::REQUESTOUTPUTPLOTELEMENT_PLOTFUNCTION_NAME; $plotInput->{"interactive-preview"} = true; $plotInput->{"file-format"} = "PNG"; @@ -1996,10 +1991,11 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass "layout-panel-spacing" => 0.05 ); - + $panels = []; - foreach ($plotInput->{'panels'} as $panel) { - if ($input->{'panelId'} == $panel->{'id'}) { + foreach ($plotInput->{'panels'} as $input_panel) { + if ($input->{'panelId'} == $input_panel->{'id'}) { + $panel = $input_panel; if ($panel->{'panel-plot-type'} !== 'timePlot') throw new Exception('Plot Function action only available for Time plot.'); @@ -2137,10 +2133,11 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass $panel->{RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_SCALE_ABSCISSE} = $scale_abscisse; $panel->{RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_SCALE_ORDONNEE} = $scale_ordonnee; + $panels[]= $panel; break; } } - + $plotInput->{'panels'} = $panels; return $plotInput; } diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutPutPlotElementPlotFunctionNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutPutPlotElementPlotFunctionNodeClass.php index 3d40103..75b86b7 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutPutPlotElementPlotFunctionNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutPutPlotElementPlotFunctionNodeClass.php @@ -50,7 +50,7 @@ class RequestOutPutPlotElementPlotFunctionNodeClass extends RequestOutputPlotEle */ public static function getTextLegend($abscisse) { - return $abscisse === RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_FREQUNECY ? "Freq, Hz" : "Period, S"; + return $abscisse === RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_FREQUNECY ? "Frequency (Hz)" : "Period (S)"; } public function getXAxis() -- libgit2 0.21.2