Commit 69602cd7a6b2f6fb35b43fa93f6de19e7511d30e

Authored by Benjamin Renard
1 parent 22521f1c

Use specific plot config for AMDA_Integration. Define adapted color map. Change …

…image orientation with 'portrait' mode
.gitignore 0 → 100644
@@ -0,0 +1 @@ @@ -0,0 +1 @@
  1 +.project
config/AMDAIntegrationConfig.php
@@ -77,10 +77,10 @@ switch ($localIP) @@ -77,10 +77,10 @@ switch ($localIP)
77 //define('AKKA_SVN', 'true'); 77 //define('AKKA_SVN', 'true');
78 78
79 //Path to AMDA_Kernel base dir 79 //Path to AMDA_Kernel base dir
80 - define('NEWKERNEL_BASE_PATH', '/home/benjamin/AMDA-GIT/AMDA/AMDA_Kernel/'); 80 + define('NEWKERNEL_BASE_PATH', '/home/benjamin/AMDA-GIT/AMDA_Kernel/');
81 81
82 //Path to AMDA_IHM base dir 82 //Path to AMDA_IHM base dir
83 - define('IHM_SRC_DIR', '/home/benjamin/AMDA-GIT/AMDA/AMDA_IHM/'); 83 + define('IHM_SRC_DIR', '/home/benjamin/AMDA-GIT/AMDA_IHM/');
84 84
85 break; 85 break;
86 } 86 }
config/plotConfig.xml 0 → 100644
@@ -0,0 +1,60 @@ @@ -0,0 +1,60 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<root>
  3 + <default>
  4 + <page dimension="ISO A4" orientation="landscape" mode="color" dpi="90">
  5 + <font name="sans-serif" size="12" />
  6 + <margin x="15" y="20" /> <!-- in mm -->
  7 + </page>
  8 + <panel resolution="3000" backgroundColor="[255,255,255]"> <!-- charSizeUnits defines space to set all around plot area -->
  9 + <title position="top" align="center" />
  10 + <timeAxis id="timeAxis" format="dd/mm/yy" reverse="false" color="[0,0,0]" position="bottom" thickness="1">
  11 + <legend text="Time, UT" />
  12 + </timeAxis>
  13 + <epochAxis id="epochAxis" format="dd/mm/yy" reverse="false" color="[0,0,0]" position="bottom" thickness="1">
  14 + <legend text="Relative Time" />
  15 + </epochAxis>
  16 + <colorAxis id="colorAxis" scale="linear" color="[0,0,0]" reverse="false" position="right" />
  17 + <xAxis scale="linear" reverse="false" color="[0,0,0]" position="bottom" thickness="1" />
  18 + <yAxis scale="linear" reverse="false" color="[0,0,0]" position="left" thickness="1" />
  19 + <timePlot xAxis="timeAxis" zAxis="colorAxis">
  20 + <line type="line" style="plain" width="1" />
  21 + <symbol type="no" size="4" color="[0,0,255]" />
  22 + </timePlot>
  23 + <epochPlot xAxis="epochAxis" zAxis="colorAxis">
  24 + <line type="line" style="plain" width="1" />
  25 + <symbol type="no" size="4" color="[0,0,255]" />
  26 + </epochPlot>
  27 + <xyPlot zAxis="colorAxis">
  28 + <line type="no" style="plain" width="1" />
  29 + <symbol type="dot" size="4" />
  30 + <resampling type="auto"/>
  31 + <timeTick step="0" number="0" minor="0" color="[0,0,0]">
  32 + <font name="sans-serif" size="5" style="upright" weight="medium" />
  33 + <firstSymbol type="triangle" size="5" color="[120,0,0]" />
  34 + <symbol type="circle" size="5" color="[120,120,0]" />
  35 + </timeTick>
  36 + </xyPlot>
  37 + <instantPlot zAxis="colorAxis">
  38 + <line type="no" style="plain" color="[255,0,0]" width="1" />
  39 + <symbol type="dot" size="4" color="[0,0,255]" />
  40 + </instantPlot>
  41 + </panel>
  42 + </default>
  43 + <colormap path="plplot/">
  44 + <grayscale default="0"> <!-- default is map index used for auto line color generation -->
  45 + <file index="0">cmap0_black_on_white.pal</file>
  46 + <file index="1">cmap1_gray.pal</file>
  47 + </grayscale>
  48 + <color default="0">
  49 + <file index="0">cmap0_default.pal</file>
  50 + <file index="1">cmap1_default.pal</file>
  51 + <file index="2">cmap0_test.pal</file>
  52 + </color>
  53 + <coloraxis default="0">
  54 + <file index="0">cmap1_default.pal</file>
  55 + <file index="1">cmap1_blue_red.pal</file>
  56 + <file index="2">cmap1_blue_yellow.pal</file>
  57 + <file index="3">cmap1_gray.pal</file>
  58 + </coloraxis>
  59 + </colormap>
  60 +</root>
config/plplot/cmap0_black_on_white.pal 0 → 100644
@@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
  1 +16
  2 +#000000 1.0
  3 +#ffffff 1.0
  4 +#ffffff 1.0
  5 +#ffffff 1.0
  6 +#ffffff 1.0
  7 +#ffffff 1.0
  8 +#ffffff 1.0
  9 +#ffffff 1.0
  10 +#ffffff 1.0
  11 +#ffffff 1.0
  12 +#ffffff 1.0
  13 +#ffffff 1.0
  14 +#ffffff 1.0
  15 +#ffffff 1.0
  16 +#ffffff 1.0
  17 +#ffffff 1.0
config/plplot/cmap0_default.pal 0 → 100644
@@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
  1 +16
  2 +#000000
  3 +#0000ff
  4 +#ff0000
  5 +#00ffff
  6 +#ff00ff
  7 +#008000
  8 +#808080
  9 +#00ff00
  10 +#800000
  11 +#000080
  12 +#808000
  13 +#800080
  14 +#c0c0c0
  15 +#008080
  16 +#ffff00
  17 +#004040
config/plplot/cmap0_test.pal 0 → 100644
@@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
  1 +8
  2 +#4BFF14
  3 +#21B259
  4 +#66AF3B
  5 +#74AD8A
  6 +#096321
  7 +#6DD80F
  8 +#558752
  9 +#A9D6C5
config/plplot/cmap1_blue_red.pal 0 → 100644
@@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
  1 +v2 hls
  2 +2
  3 +0. 240. 0.5 1.0 1. 0
  4 +1. 0. 0.5 1.0 1. 0
config/plplot/cmap1_blue_yellow.pal 0 → 100644
@@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
  1 +v2 rgb
  2 +7
  3 +0.0 1.0 1.0 1.0 1.0 0
  4 +0.001 0.001 0.998 1.0 1.0 0
  5 +0.25 0.25 0.50 1.0 1.0 0
  6 +0.5 0.5 0.5 0.5 1.0 0
  7 +0.75 1.0 0.5 0.25 1.0 0
  8 +0.999 1.0 0.998 0.001 1.0 0
  9 +1.0 0.0 0.0 0.0 1.0 0
  10 +
config/plplot/cmap1_default.pal 0 → 100644
@@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
  1 +6
  2 +#5500ff 0 0
  3 +#110033 44 0
  4 +#010005 50 0
  5 +#050000 50 0
  6 +#330000 56 0
  7 +#ff0000 100 0
0 \ No newline at end of file 8 \ No newline at end of file
config/plplot/cmap1_gray.pal 0 → 100644
@@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
  1 +v2 rgb
  2 +2
  3 +0.0 0.0 0.0 0.0 1.0 0
  4 +1.0 1.0 1.0 1.0 1.0 0
0 \ No newline at end of file 5 \ No newline at end of file
src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
@@ -107,13 +107,15 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass @@ -107,13 +107,15 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
107 $pageNode->setTitle($input->description); 107 $pageNode->setTitle($input->description);
108 108
109 //orientation = [['landscape','LANDSCAPE'], ['portrait', 'PORTRAIT']]; 109 //orientation = [['landscape','LANDSCAPE'], ['portrait', 'PORTRAIT']];
110 - switch ($input->orientation) 110 + $forceRotation = false;
  111 + switch (strtolower($input->orientation))
111 { 112 {
112 - case 'LANDSCAPE' : 113 + case 'landscape' :
113 $pageNode->setOrientation(RequestOutputPlotPageOrientationEnum::LANDSCAPE); 114 $pageNode->setOrientation(RequestOutputPlotPageOrientationEnum::LANDSCAPE);
114 break; 115 break;
115 - case 'PORTRAIT' : 116 + case 'portrait' :
116 $pageNode->setOrientation(RequestOutputPlotPageOrientationEnum::PORTRAIT); 117 $pageNode->setOrientation(RequestOutputPlotPageOrientationEnum::PORTRAIT);
  118 + $forceRotation = true;
117 break; 119 break;
118 default : 120 default :
119 $pageNode->setOrientation(RequestOutputPlotPageOrientationEnum::LANDSCAPE); 121 $pageNode->setOrientation(RequestOutputPlotPageOrientationEnum::LANDSCAPE);
@@ -134,6 +136,7 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass @@ -134,6 +136,7 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
134 $this->isInterractive = false; 136 $this->isInterractive = false;
135 break; 137 break;
136 case 'PS' : 138 case 'PS' :
  139 + case 'PostScript' :
137 $pageNode->setFormat(RequestOutputPlotPageFormatEnum::PS); 140 $pageNode->setFormat(RequestOutputPlotPageFormatEnum::PS);
138 $this->isInterractive = false; 141 $this->isInterractive = false;
139 break; 142 break;
@@ -285,6 +288,8 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass @@ -285,6 +288,8 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
285 $postProcessCmd = "mv plot_*"; 288 $postProcessCmd = "mv plot_*";
286 $postProcessCmd .= $extension; 289 $postProcessCmd .= $extension;
287 $postProcessCmd .= " ".$resultFile.$extension; 290 $postProcessCmd .= " ".$resultFile.$extension;
  291 + if ($forceRotation)
  292 + $postProcessCmd .= " | convert ".$resultFile.$extension." -rotate -90 ".$resultFile.$extension;
288 } 293 }
289 294
290 $this->paramsData->setPostCmd($postProcessCmd); 295 $this->paramsData->setPostCmd($postProcessCmd);
src/Request/Config/KernelConfigClass.php
@@ -176,7 +176,7 @@ class KernelConfigClass @@ -176,7 +176,7 @@ class KernelConfigClass
176 foreach (self::$libArray as $lib) 176 foreach (self::$libArray as $lib)
177 $appProperties["app.process.LIB"] .= ("-l".$lib." "); 177 $appProperties["app.process.LIB"] .= ("-l".$lib." ");
178 178
179 - $appProperties["app.plot.configfile"] = NEWKERNEL_CONFIG_DIR.self::$plotConfigFile; 179 + $appProperties["app.plot.configfile"] = INTEGRATION_SRC_DIR.'../config/'.self::$plotConfigFile;
180 180
181 $appProperties["app.param.gapthreshold"] = self::$defaultGapThreshold; 181 $appProperties["app.param.gapthreshold"] = self::$defaultGapThreshold;
182 182