Commit 25a3853701114f5bb53337f9d61349cbba8b40e7

Authored by Erdogan Furkan
1 parent 8b185bf5

7616 - Adding color option for interval and status bar plots

src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
... ... @@ -936,15 +936,28 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
936 936  
937 937 protected function unmarshallStatusBar($paramDrawingData, $paramNode, $indexes)
938 938 {
  939 + if ($paramDrawingData->{'statusbar-color'} == "none") {
  940 + $color = NULL;
  941 + } else {
  942 + $color = $this->hexColor2KernelColor($paramDrawingData->{'statusbar-color'});
  943 + }
939 944 if (count($indexes) == 0)
940   - $paramNode->addStatusBar(-1);
941   - foreach ($indexes as $index)
942   - $paramNode->addStatusBar($index);
  945 + $paramNode->addStatusBar(-1, $color);
  946 + else {
  947 + foreach ($indexes as $index)
  948 + $paramNode->addStatusBar($index, $color);
  949 + }
  950 +
943 951 }
944 952  
945 953 protected function unmarshallIntervals($paramDrawingData, $paramNode)
946 954 {
947   - $paramNode->addIntervals();
  955 + if ($paramDrawingData->{'intervals-color'} == "none") {
  956 + $color = NULL;
  957 + } else {
  958 + $color = $this->hexColor2KernelColor($paramDrawingData->{'intervals-color'});
  959 + }
  960 + $paramNode->addIntervals($color);
948 961 }
949 962  
950 963 protected function unmarshallTickBar($paramDrawingData, $paramNode, $indexes)
... ...
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotParamsNodeClass.php
... ... @@ -49,11 +49,13 @@ define("REQUESTOUTPUTPLOTINSTANTSPECTRO_DIMONXAXIS", "dimOnXAxis");
49 49  
50 50 define("REQUESTOUTPUTPLOTSTATUSBAR_NAME", "serie");
51 51 define("REQUESTOUTPUTPLOTSTATUSBAR_INDEX", "index");
  52 +define("REQUESTOUTPUTPLOTSTATUSBAR_COLOR", "color");
52 53  
53 54 define("REQUESTOUTPUTPLOTTICKBAR_NAME", "serie");
54 55 define("REQUESTOUTPUTPLOTTICKBAR_INDEX", "index");
55 56  
56 57 define("REQUESTOUTPUTPLOTINTERVALS_NAME", "intervals");
  58 +define("REQUESTOUTPUTPLOTINTERVALS_COLOR", "color");
57 59  
58 60 /**
59 61 * @class RequestOutputPlotParamNodeClass
... ... @@ -231,11 +233,14 @@ class RequestOutputPlotParamNodeClass extends NodeClass
231 233 return $colorSerieNode;
232 234 }
233 235  
234   - public function addStatusBar($index)
  236 + public function addStatusBar($index, $color = NULL)
235 237 {
236 238 $statusBarNode = new NodeClass(REQUESTOUTPUTPLOTSTATUSBAR_NAME);
237 239 if ($index >= 0)
238 240 $statusBarNode->setAttribute(REQUESTOUTPUTPLOTSTATUSBAR_INDEX, $index);
  241 + if ($color != NULL) {
  242 + $statusBarNode->setAttribute(REQUESTOUTPUTPLOTSTATUSBAR_COLOR, $color);
  243 + }
239 244 $this->addChild($statusBarNode);
240 245 return $statusBarNode;
241 246 }
... ... @@ -249,9 +254,12 @@ class RequestOutputPlotParamNodeClass extends NodeClass
249 254 return $tickBarNode;
250 255 }
251 256  
252   - public function addIntervals()
  257 + public function addIntervals($color = NULL)
253 258 {
254 259 $intervalsNode = new NodeClass(REQUESTOUTPUTPLOTINTERVALS_NAME);
  260 + if ($color != NULL) {
  261 + $intervalsNode->setAttribute(REQUESTOUTPUTPLOTINTERVALS_COLOR, $color);
  262 + }
255 263 $this->addChild($intervalsNode);
256 264 return $intervalsNode;
257 265 }
... ...