diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3a4edf6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.project diff --git a/config/AMDAIntegrationConfig.php b/config/AMDAIntegrationConfig.php index 50a5d82..9105ed0 100644 --- a/config/AMDAIntegrationConfig.php +++ b/config/AMDAIntegrationConfig.php @@ -77,10 +77,10 @@ switch ($localIP) //define('AKKA_SVN', 'true'); //Path to AMDA_Kernel base dir - define('NEWKERNEL_BASE_PATH', '/home/benjamin/AMDA-GIT/AMDA/AMDA_Kernel/'); + define('NEWKERNEL_BASE_PATH', '/home/benjamin/AMDA-GIT/AMDA_Kernel/'); //Path to AMDA_IHM base dir - define('IHM_SRC_DIR', '/home/benjamin/AMDA-GIT/AMDA/AMDA_IHM/'); + define('IHM_SRC_DIR', '/home/benjamin/AMDA-GIT/AMDA_IHM/'); break; } diff --git a/config/plotConfig.xml b/config/plotConfig.xml new file mode 100644 index 0000000..e451138 --- /dev/null +++ b/config/plotConfig.xml @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<root> + <default> + <page dimension="ISO A4" orientation="landscape" mode="color" dpi="90"> + <font name="sans-serif" size="12" /> + <margin x="15" y="20" /> <!-- in mm --> + </page> + <panel resolution="3000" backgroundColor="[255,255,255]"> <!-- charSizeUnits defines space to set all around plot area --> + <title position="top" align="center" /> + <timeAxis id="timeAxis" format="dd/mm/yy" reverse="false" color="[0,0,0]" position="bottom" thickness="1"> + <legend text="Time, UT" /> + </timeAxis> + <epochAxis id="epochAxis" format="dd/mm/yy" reverse="false" color="[0,0,0]" position="bottom" thickness="1"> + <legend text="Relative Time" /> + </epochAxis> + <colorAxis id="colorAxis" scale="linear" color="[0,0,0]" reverse="false" position="right" /> + <xAxis scale="linear" reverse="false" color="[0,0,0]" position="bottom" thickness="1" /> + <yAxis scale="linear" reverse="false" color="[0,0,0]" position="left" thickness="1" /> + <timePlot xAxis="timeAxis" zAxis="colorAxis"> + <line type="line" style="plain" width="1" /> + <symbol type="no" size="4" color="[0,0,255]" /> + </timePlot> + <epochPlot xAxis="epochAxis" zAxis="colorAxis"> + <line type="line" style="plain" width="1" /> + <symbol type="no" size="4" color="[0,0,255]" /> + </epochPlot> + <xyPlot zAxis="colorAxis"> + <line type="no" style="plain" width="1" /> + <symbol type="dot" size="4" /> + <resampling type="auto"/> + <timeTick step="0" number="0" minor="0" color="[0,0,0]"> + <font name="sans-serif" size="5" style="upright" weight="medium" /> + <firstSymbol type="triangle" size="5" color="[120,0,0]" /> + <symbol type="circle" size="5" color="[120,120,0]" /> + </timeTick> + </xyPlot> + <instantPlot zAxis="colorAxis"> + <line type="no" style="plain" color="[255,0,0]" width="1" /> + <symbol type="dot" size="4" color="[0,0,255]" /> + </instantPlot> + </panel> + </default> + <colormap path="plplot/"> + <grayscale default="0"> <!-- default is map index used for auto line color generation --> + <file index="0">cmap0_black_on_white.pal</file> + <file index="1">cmap1_gray.pal</file> + </grayscale> + <color default="0"> + <file index="0">cmap0_default.pal</file> + <file index="1">cmap1_default.pal</file> + <file index="2">cmap0_test.pal</file> + </color> + <coloraxis default="0"> + <file index="0">cmap1_default.pal</file> + <file index="1">cmap1_blue_red.pal</file> + <file index="2">cmap1_blue_yellow.pal</file> + <file index="3">cmap1_gray.pal</file> + </coloraxis> + </colormap> +</root> diff --git a/config/plplot/cmap0_black_on_white.pal b/config/plplot/cmap0_black_on_white.pal new file mode 100644 index 0000000..946f59b --- /dev/null +++ b/config/plplot/cmap0_black_on_white.pal @@ -0,0 +1,17 @@ +16 +#000000 1.0 +#ffffff 1.0 +#ffffff 1.0 +#ffffff 1.0 +#ffffff 1.0 +#ffffff 1.0 +#ffffff 1.0 +#ffffff 1.0 +#ffffff 1.0 +#ffffff 1.0 +#ffffff 1.0 +#ffffff 1.0 +#ffffff 1.0 +#ffffff 1.0 +#ffffff 1.0 +#ffffff 1.0 diff --git a/config/plplot/cmap0_default.pal b/config/plplot/cmap0_default.pal new file mode 100644 index 0000000..da7aac2 --- /dev/null +++ b/config/plplot/cmap0_default.pal @@ -0,0 +1,17 @@ +16 +#000000 +#0000ff +#ff0000 +#00ffff +#ff00ff +#008000 +#808080 +#00ff00 +#800000 +#000080 +#808000 +#800080 +#c0c0c0 +#008080 +#ffff00 +#004040 diff --git a/config/plplot/cmap0_test.pal b/config/plplot/cmap0_test.pal new file mode 100644 index 0000000..445f8e2 --- /dev/null +++ b/config/plplot/cmap0_test.pal @@ -0,0 +1,9 @@ +8 +#4BFF14 +#21B259 +#66AF3B +#74AD8A +#096321 +#6DD80F +#558752 +#A9D6C5 diff --git a/config/plplot/cmap1_blue_red.pal b/config/plplot/cmap1_blue_red.pal new file mode 100644 index 0000000..442cd12 --- /dev/null +++ b/config/plplot/cmap1_blue_red.pal @@ -0,0 +1,4 @@ +v2 hls +2 +0. 240. 0.5 1.0 1. 0 +1. 0. 0.5 1.0 1. 0 diff --git a/config/plplot/cmap1_blue_yellow.pal b/config/plplot/cmap1_blue_yellow.pal new file mode 100644 index 0000000..a25a698 --- /dev/null +++ b/config/plplot/cmap1_blue_yellow.pal @@ -0,0 +1,10 @@ +v2 rgb +7 +0.0 1.0 1.0 1.0 1.0 0 +0.001 0.001 0.998 1.0 1.0 0 +0.25 0.25 0.50 1.0 1.0 0 +0.5 0.5 0.5 0.5 1.0 0 +0.75 1.0 0.5 0.25 1.0 0 +0.999 1.0 0.998 0.001 1.0 0 +1.0 0.0 0.0 0.0 1.0 0 + diff --git a/config/plplot/cmap1_default.pal b/config/plplot/cmap1_default.pal new file mode 100644 index 0000000..62bf75e --- /dev/null +++ b/config/plplot/cmap1_default.pal @@ -0,0 +1,7 @@ +6 +#5500ff 0 0 +#110033 44 0 +#010005 50 0 +#050000 50 0 +#330000 56 0 +#ff0000 100 0 \ No newline at end of file diff --git a/config/plplot/cmap1_gray.pal b/config/plplot/cmap1_gray.pal new file mode 100644 index 0000000..0a463df --- /dev/null +++ b/config/plplot/cmap1_gray.pal @@ -0,0 +1,4 @@ +v2 rgb +2 +0.0 0.0 0.0 0.0 1.0 0 +1.0 1.0 1.0 1.0 1.0 0 \ No newline at end of file diff --git a/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php b/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php index 48fd2d2..f117e12 100644 --- a/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php +++ b/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php @@ -107,13 +107,15 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass $pageNode->setTitle($input->description); //orientation = [['landscape','LANDSCAPE'], ['portrait', 'PORTRAIT']]; - switch ($input->orientation) + $forceRotation = false; + switch (strtolower($input->orientation)) { - case 'LANDSCAPE' : + case 'landscape' : $pageNode->setOrientation(RequestOutputPlotPageOrientationEnum::LANDSCAPE); break; - case 'PORTRAIT' : + case 'portrait' : $pageNode->setOrientation(RequestOutputPlotPageOrientationEnum::PORTRAIT); + $forceRotation = true; break; default : $pageNode->setOrientation(RequestOutputPlotPageOrientationEnum::LANDSCAPE); @@ -134,6 +136,7 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass $this->isInterractive = false; break; case 'PS' : + case 'PostScript' : $pageNode->setFormat(RequestOutputPlotPageFormatEnum::PS); $this->isInterractive = false; break; @@ -285,6 +288,8 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass $postProcessCmd = "mv plot_*"; $postProcessCmd .= $extension; $postProcessCmd .= " ".$resultFile.$extension; + if ($forceRotation) + $postProcessCmd .= " | convert ".$resultFile.$extension." -rotate -90 ".$resultFile.$extension; } $this->paramsData->setPostCmd($postProcessCmd); diff --git a/src/Request/Config/KernelConfigClass.php b/src/Request/Config/KernelConfigClass.php index f939916..27496ee 100644 --- a/src/Request/Config/KernelConfigClass.php +++ b/src/Request/Config/KernelConfigClass.php @@ -176,7 +176,7 @@ class KernelConfigClass foreach (self::$libArray as $lib) $appProperties["app.process.LIB"] .= ("-l".$lib." "); - $appProperties["app.plot.configfile"] = NEWKERNEL_CONFIG_DIR.self::$plotConfigFile; + $appProperties["app.plot.configfile"] = INTEGRATION_SRC_DIR.'../config/'.self::$plotConfigFile; $appProperties["app.param.gapthreshold"] = self::$defaultGapThreshold; -- libgit2 0.21.2