Commit eebc2bb6d944a3babb86f531233edb8754555775

Authored by Benjamin Renard
1 parent ac88645b

Add Extend/Shift for plot

src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
... ... @@ -1227,6 +1227,8 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
1227 1227 case 'halfforward' :
1228 1228 case 'backward' :
1229 1229 case 'halfbackward' :
  1230 + case 'extend' :
  1231 + case 'shift' :
1230 1232 return $this->unmarshallNavigation($input, $plotInput);
1231 1233 default :
1232 1234 throw new Exception('Interactive action not implemented.');
... ... @@ -1364,8 +1366,19 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
1364 1366 $startTimeStamp -= ($duration/2);
1365 1367 $stopTimeStamp -= ($duration/2);
1366 1368 break;
  1369 + case 'extend' :
  1370 + $startTimeStamp -= $input->{'duration'};
  1371 + $stopTimeStamp += $input->{'duration'};
  1372 + break;
  1373 + case 'shift' :
  1374 + $startTimeStamp += $input->{'duration'};
  1375 + $stopTimeStamp += $input->{'duration'};
  1376 + break;
1367 1377 }
1368 1378  
  1379 + if ($stopTimeStamp - $startTimeStamp <= 0)
  1380 + throw new Exception('New duration is lower than 0.');
  1381 +
1369 1382 $startTime = date("Y-m-d\TH:i:s",$startTimeStamp);
1370 1383 $stopTime = date("Y-m-d\TH:i:s",$stopTimeStamp);
1371 1384  
... ...