Commit b4ee5e62bc3ee6163f0eb927d5934b767d5287c3

Authored by Benjamin Renard
1 parent bda99a72

Add integration for instant plot serie

src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
... ... @@ -346,6 +346,13 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
346 346 throw new Exception('Center Time Id not defined for an Epoch Plot.');
347 347 $plotNode->setCenterTimeId($panelData->{'panel-epoch-centertimeid'});
348 348 break;
  349 + case 'instantPlot' :
  350 + $plotNode = $panelNode->addPlotElement(RequestOutputPlotElementTypeEnum::INSTANTPLOT);
  351 + date_default_timezone_set('UTC');
  352 + $timeStamp = strtotime($panelData->{'panel-instant-time'});
  353 + $time = CommonClass::timeStampToDDTime($timeStamp);
  354 + $plotNode->setTime($time);
  355 + break;
349 356 default:
350 357 throw new Exception('Plot type not implemented.');
351 358 }
... ... @@ -505,6 +512,10 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
505 512  
506 513 $this->unmarshallTickBar($paramData->{'param-drawing-object'}, $paramNode, $paramInfo['indexes']);
507 514 break;
  515 + case 'iserie' :
  516 + $paramNode = $plotNode->getParams()->getParamById($paramInfo['id']);
  517 + $this->unmarshallInstantSerie($paramData->{'param-drawing-object'}, $plotNode, $paramNode);
  518 + break;
508 519 default :
509 520 throw new Exception('Drawing type not implemented.');
510 521 }
... ... @@ -578,6 +589,20 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
578 589 }
579 590 }
580 591  
  592 + protected function unmarshallInstantSerie($paramDrawingData, $plotNode, $paramNode)
  593 + {
  594 + $iserieNode = $paramNode->addInstantSerie(REQUESTOUTPUTPLOTELEMENTXY_XAXISID, 'y-left');
  595 +
  596 + //Table on X Axis
  597 + $iserieNode->setTableOnXAxis($paramDrawingData->{'iserie-tableonx'} ? "true" : "false");
  598 +
  599 + //Line
  600 + $this->unmarshallLine($paramDrawingData, 'iserie', $iserieNode->getLine());
  601 +
  602 + //Symbol
  603 + $this->unmarshallSymbol($paramDrawingData, 'iserie', $iserieNode->getSymbol());
  604 + }
  605 +
581 606 protected function unmarshallSpectro($paramDrawingData, $plotNode, $paramNode, $indexes)
582 607 {
583 608 $spectroNode = $paramNode->addSpectro($paramDrawingData->{'spectro-yaxis'});
... ...
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementInstantNodeClass.php 0 → 100644
... ... @@ -0,0 +1,55 @@
  1 +<?php
  2 +
  3 +require_once("RequestOutputPlotElementNodeClass.php");
  4 +
  5 +define ("REQUESTOUTPUTPLOTELEMENTINSTANT_NAME", "instantPlot");
  6 +define ("REQUESTOUTPUTPLOTELEMENTINSTANT_TIME", "time");
  7 +
  8 +/**
  9 + * @class RequestOutputPlotElementInstantNodeClass
  10 + * @brief Definition of an instant plot element for a panel of a plot request
  11 + * @details
  12 +*/
  13 +class RequestOutputPlotElementInstantNodeClass extends RequestOutputPlotElementNodeClass
  14 +{
  15 + public function __construct()
  16 + {
  17 + parent::__construct(REQUESTOUTPUTPLOTELEMENTINSTANT_NAME,true,true,true,false,false,false);
  18 + //create x axis
  19 + $this->getAxes()->addDigitalAxis(RequestOutputPlotAxisTypeEnum::XAXIS,REQUESTOUTPUTPLOTELEMENTXY_XAXISID);
  20 + //force color axis creation
  21 + $this->getAxes()->getColorAxis();
  22 + }
  23 +
  24 + public function getXAxis()
  25 + {
  26 + return $this->getAxes()->getDigitalAxis(RequestOutputPlotAxisTypeEnum::XAXIS,REQUESTOUTPUTPLOTELEMENTXY_XAXISID);
  27 + }
  28 +
  29 + public function addYAxis($id)
  30 + {
  31 + return $this->getAxes()->addDigitalAxis(RequestOutputPlotAxisTypeEnum::YAXIS,$id);
  32 + }
  33 +
  34 + public function getYAxis($id)
  35 + {
  36 + return $this->getAxes()->getDigitalAxis(RequestOutputPlotAxisTypeEnum::YAXIS,$id);
  37 + }
  38 +
  39 + public function getZAxis()
  40 + {
  41 + return $this->getAxes()->getColorAxis();
  42 + }
  43 +
  44 + public function setTime($time)
  45 + {
  46 + $this->setAttribute(REQUESTOUTPUTPLOTELEMENTINSTANT_TIME, $time);
  47 + }
  48 +
  49 + public function getTime()
  50 + {
  51 + return $this->getAttribute(REQUESTOUTPUTPLOTELEMENTINSTANT_TIME);
  52 + }
  53 +}
  54 +
  55 +?>
0 56 \ No newline at end of file
... ...
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotInstantSerieNodeClass.php 0 → 100644
... ... @@ -0,0 +1,80 @@
  1 +<?php
  2 +
  3 +define ("REQUESTOUTPUTPLOTINSTANTSERIE_NAME", "iserie");
  4 +
  5 +define ("REQUESTOUTPUTPLOTINSTANTSERIE_YAXIS", "yAxis");
  6 +define ("REQUESTOUTPUTPLOTINSTANTSERIE_XAXIS", "xAxis");
  7 +define ("REQUESTOUTPUTPLOTINSTANTSERIE_TABLEONXAXIS", "tableOnXAxis");
  8 +define ("REQUESTOUTPUTPLOTINSTANTSERIE_LINE", "line");
  9 +define ("REQUESTOUTPUTPLOTINSTANTSERIE_SYMBOL", "symbol");
  10 +
  11 +/**
  12 + * @class RequestOutputPlotInstantSerieNodeClass
  13 + * @brief Definition of a iserie for an instant plot of a plot request
  14 + * @details
  15 +*/
  16 +class RequestOutputPlotInstantSerieNodeClass extends NodeClass
  17 +{
  18 + public function __construct()
  19 + {
  20 + parent::__construct(REQUESTOUTPUTPLOTINSTANTSERIE_NAME);
  21 + }
  22 +
  23 + public function setYAxisId($axisId)
  24 + {
  25 + $this->setAttribute(REQUESTOUTPUTPLOTINSTANTSERIE_YAXIS, $axisId);
  26 + }
  27 +
  28 + public function getYAxisId()
  29 + {
  30 + return $this->getAttribute(REQUESTOUTPUTPLOTINSTANTSERIE_YAXIS);
  31 + }
  32 +
  33 + public function setXAxisId($axisId)
  34 + {
  35 + $this->setAttribute(REQUESTOUTPUTPLOTINSTANTSERIE_XAXIS, $axisId);
  36 + }
  37 +
  38 + public function getXAxisId()
  39 + {
  40 + return $this->getAttribute(REQUESTOUTPUTPLOTINSTANTSERIE_XAXIS);
  41 + }
  42 +
  43 + public function setTableOnXAxis($tableOnX)
  44 + {
  45 + $this->setAttribute(REQUESTOUTPUTPLOTINSTANTSERIE_TABLEONXAXIS, $tableOnX);
  46 + }
  47 +
  48 + public function getTableOnXAxis()
  49 + {
  50 + return $this->getAttribute(REQUESTOUTPUTPLOTINSTANTSERIE_TABLEONXAXIS);
  51 + }
  52 +
  53 + public function getLine()
  54 + {
  55 + $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTINSTANTSERIE_LINE);
  56 +
  57 + if (!isset($node))
  58 + {
  59 + $node = new RequestOutputPlotLineNodeClass(REQUESTOUTPUTPLOTINSTANTSERIE_LINE);
  60 + $this->addChild($node);
  61 + }
  62 +
  63 + return $node;
  64 + }
  65 +
  66 + public function getSymbol()
  67 + {
  68 + $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTINSTANTSERIE_SYMBOL);
  69 +
  70 + if (!isset($node))
  71 + {
  72 + $node = new RequestOutputPlotSymbolNodeClass(REQUESTOUTPUTPLOTINSTANTSERIE_SYMBOL);
  73 + $this->addChild($node);
  74 + }
  75 +
  76 + return $node;
  77 + }
  78 +}
  79 +
  80 +?>
0 81 \ No newline at end of file
... ...
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotPanelNodeClass.php
... ... @@ -14,11 +14,12 @@ define (&quot;REQUESTOUTPUTPLOTPANEL_PREFEREDHEIGHT&quot;, &quot;preferedHeight&quot;);
14 14  
15 15 abstract class RequestOutputPlotElementTypeEnum
16 16 {
17   - const TIMEPLOT = "TimePlot";
18   - const XYPLOT = "XYPlot";
19   - const STATUSPLOT = "StatusPlot";
20   - const TICKPLOT = "TickPlot";
21   - const EPOCHPLOT = "EpochPlot";
  17 + const TIMEPLOT = "TimePlot";
  18 + const XYPLOT = "XYPlot";
  19 + const STATUSPLOT = "StatusPlot";
  20 + const TICKPLOT = "TickPlot";
  21 + const EPOCHPLOT = "EpochPlot";
  22 + const INSTANTPLOT = "InstantPlot";
22 23 }
23 24  
24 25 /**
... ... @@ -101,6 +102,9 @@ class RequestOutputPlotPanelNodeClass extends NodeClass
101 102 case RequestOutputPlotElementTypeEnum::EPOCHPLOT :
102 103 $node = new RequestOutputPlotElementEpochNodeClass();
103 104 break;
  105 + case RequestOutputPlotElementTypeEnum::INSTANTPLOT :
  106 + $node = new RequestOutputPlotElementInstantNodeClass();
  107 + break;
104 108 default :
105 109 return NULL;
106 110 }
... ...
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotParamsNodeClass.php
... ... @@ -59,7 +59,16 @@ class RequestOutputPlotParamNodeClass extends NodeClass
59 59 $this->addChild($ySerieNode);
60 60 return $ySerieNode;
61 61 }
62   -
  62 +
  63 + public function addInstantSerie($xAxis, $yAxis)
  64 + {
  65 + $iserieNode = new RequestOutputPlotInstantSerieNodeClass();
  66 + $iserieNode->setXAxisId($xAxis);
  67 + $iserieNode->setYAxisId($yAxis);
  68 + $this->addChild($iserieNode);
  69 + return $iserieNode;
  70 + }
  71 +
63 72 public function addSpectro($yAxis)
64 73 {
65 74 $spectroNode = new NodeClass(REQUESTOUTPUTPLOTSPECTRO_NAME);
... ...