Commit eebc2bb6d944a3babb86f531233edb8754555775
1 parent
ac88645b
Exists in
master
and in
66 other branches
Add Extend/Shift for plot
Showing
1 changed file
with
13 additions
and
0 deletions
Show diff stats
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 | |
... | ... |