Commit 8ade06fee80a35cef915150f538127c44736f2c0

Authored by Benjamin Renard
1 parent 8720c989

Improve config load

config/AMDAIntegrationConfig.php
1 1 <?php
2 2  
3   -$localIP = exec("hostname -i");
4   -
5   -//Add your server below
6   -switch ($localIP)
7   -{
8   - //bas-amda-01 server (AKKA dev)
9   - case '172.25.30.65' :
10   - define('PLATFORM_NAME','AKKA dev');
11   -
12   - //AKKA - Force the IP client value to prevent a bug with DDServer
13   - // The IP client must be write with the pattern : xxx.xxx.xxx.xxx
14   - define('FORCE_CLIENT_IP', '172.025.030.065');
15   -
16   - // true for AKKA
17   - // false or not defined for IRAP
18   - // It's used to select the correct SVN path for depotInfo repository
19   - define('AKKA_SVN', 'true');
20   -
21   - //Path to AMDA_Kernel base dir
22   - define('NEWKERNEL_BASE_PATH', '/home/b.renard/workspace/AMDA-KERNEL/trunk/AMDA_Kernel/');
23   -
24   - //Path to AMDA_IHM base dir
25   - define('IHM_SRC_DIR', '/home/b.renard/AMDA_INSTALL/AMDA_IHM/');
26   - break;
27   -
28   - //bas-amda-02 server (AKKA - integration)
29   - case '10.168.220.87' :
30   - define('PLATFORM_NAME','AKKA integration');
31   -
32   - //AKKA - Force the IP client value to prevent a bug with DDServer
33   - // The IP client must be write with the pattern : xxx.xxx.xxx.xxx
34   - define('FORCE_CLIENT_IP', '010.168.220.087');
35   -
36   - // true for AKKA
37   - // false or not defined for IRAP
38   - // It's used to select the correct SVN path for depotInfo repository
39   - define('AKKA_SVN', 'true');
40   -
41   - //Path to AMDA_Kernel base dir
42   - define('NEWKERNEL_BASE_PATH', '/var/lib/jenkins/jobs/AMDA_Kernel_Phase3_Integration/workspace/AMDA_Kernel/');
43   -
44   - //Path to AMDA_IHM base dir
45   - define('IHM_SRC_DIR', '/var/lib/jenkins/jobs/AMDA_Kernel_Phase3_Integration/workspace/AMDA_IHM/');
46   -
47   - break;
48   - case '195.83.102.55' :
49   - define('PLATFORM_NAME','IRAP test platform');
50   -
51   - //AKKA - Force the IP client value to prevent a bug with DDServer
52   - // The IP client must be write with the pattern : xxx.xxx.xxx.xxx
53   - define('FORCE_CLIENT_IP', '195.083.102.055');
54   -
55   - // true for AKKA
56   - // false or not defined for IRAP
57   - // It's used to select the correct SVN path for depotInfo repository
58   - //define('AKKA_SVN', 'true');
59   -
60   - //Path to AMDA_Kernel base dir
61   - define('NEWKERNEL_BASE_PATH', '/home/mbouchemit/AMDA_Kernel/');
62   -
63   - //Path to AMDA_IHM base dir
64   - define('IHM_SRC_DIR', '/home/mbouchemit/AMDA_INSTALL/AMDA_IHM/');
65   -
66   - break;
67   - case '10.121.0.3' :
68   - define('PLATFORM_NAME','APUS dev platform');
69   -
70   - //AKKA - Force the IP client value to prevent a bug with DDServer
71   - // The IP client must be write with the pattern : xxx.xxx.xxx.xxx
72   - define('FORCE_CLIENT_IP', '010.121.000.003');
73   -
74   - // true for AKKA
75   - // false or not defined for IRAP
76   - // It's used to select the correct SVN path for depotInfo repository
77   - //define('AKKA_SVN', 'true');
78   -
79   - //Path to AMDA_Kernel base dir
80   - define('NEWKERNEL_BASE_PATH', '/home/benjamin/AMDA-GIT/AMDA_Kernel/');
81   -
82   - //Path to AMDA_IHM base dir
83   - define('IHM_SRC_DIR', '/home/benjamin/AMDA-GIT/AMDA_IHM/');
84   -
85   - break;
86   - case '10.121.1.121' :
87   - define('PLATFORM_NAME','pc1121 dev plaform');
88   -
89   - //AKKA - Force the IP client value to prevent a bug with DDServer
90   - // The IP client must be write with the pattern : xxx.xxx.xxx.xxx
91   - define('FORCE_CLIENT_IP', '010.121.001.121');
92   -
93   - // true for AKKA
94   - // false or not defined for IRAP
95   - // It's used to select the correct SVN path for depotInfo repository
96   - //define('AKKA_SVN', 'true');
97   -
98   - //Path to AMDA_Kernel base dir
99   - define('NEWKERNEL_BASE_PATH', '/home/myriam/workspacenew/AMDA_Kernel/');
100   -
101   - //Path to AMDA_IHM base dir
102   - define('IHM_SRC_DIR', '/home/myriam/workspacenew/AMDA_IHM/');
103   -
104   - break;
105   -
106   - case '10.121.0.31' :
107   - define('PLATFORM_NAME','amdatest');
108   -
109   - //AKKA - Force the IP client value to prevent a bug with DDServer
110   - // The IP client must be write with the pattern : xxx.xxx.xxx.xxx
111   - define('FORCE_CLIENT_IP', '010.121.000.031');
112   -
113   - // true for AKKA
114   - // false or not defined for IRAP
115   - // It's used to select the correct SVN path for depotInfo repository
116   - //define('AKKA_SVN', 'true');
117   -
118   - //Path to AMDA_Kernel base dir
119   - define('NEWKERNEL_BASE_PATH', '/home/myriam/AMDA_20161215/AMDA_Kernel/');
120   -
121   - //Path to AMDA_IHM base dir
122   - define('IHM_SRC_DIR', '/home/myriam/AMDA_20161215/AMDA_IHM/');
123   - break;
124   - case '192.168.83.101' :
125   - define('PLATFORM_NAME','amdadev platform at AKKA');
126   -
127   - //AKKA - Force the IP client value to prevent a bug with DDServer
128   - // The IP client must be write with the pattern : xxx.xxx.xxx.xxx
129   - define('FORCE_CLIENT_IP', '192.168.83.101');
130   -
131   - // true for AKKA
132   - // false or not defined for IRAP
133   - // It's used to select the correct SVN path for depotInfo repository
134   - //define('AKKA_SVN', 'true');
135   -
136   - //Path to AMDA_Kernel base dir
137   - define('NEWKERNEL_BASE_PATH', '/home/brenard/AMDA-GIT/AMDA_Kernel/');
138   -
139   - //Path to AMDA_IHM base dir
140   - define('IHM_SRC_DIR', '/var/www/AMDA_IHM/');
141   -
142   - break;
  3 +$config_file=__DIR__."/my_config.env";
  4 +
  5 +if (!file_exists($config_file)) {
  6 + $localIP = exec("hostname -i");
  7 +
  8 + //Add your server below
  9 + switch ($localIP)
  10 + {
  11 + //bas-amda-01 server (AKKA dev)
  12 + case '172.25.30.65' :
  13 + $config_file=__DIR__."/predefined_env/akka-dev.env";
  14 + break;
  15 + //bas-amda-02 server (AKKA - integration)
  16 + case '10.168.220.87' :
  17 + $config_file=__DIR__."/predefined_env/akka-integration.env";
  18 + break;
  19 + case '195.83.102.55' :
  20 + $config_file=__DIR__."/predefined_env/irap-test.env";
  21 + break;
  22 + case '10.121.0.3' :
  23 + $config_file=__DIR__."/predefined_env/apus-dev.env";
  24 + break;
  25 + case '10.121.1.121' :
  26 + $config_file=__DIR__."/predefined_env/pc1121-dev.env";
  27 + case '10.121.0.31' :
  28 + $config_file=__DIR__."/predefined_env/irap-amdatest.env";
  29 + case '192.168.83.101' :
  30 + $config_file=__DIR__."/predefined_env/akka-amdadev.env";
  31 + break;
  32 + }
  33 +} else {
  34 + $config_file="";
143 35 }
144 36  
  37 +if (empty($config_file) || !file_exists($config_file) || ($config=parse_ini_file($config_file)) == FALSE) {
  38 + throw new Exception("Error to load environment config file");
  39 +}
145 40  
  41 +define('COTS_BASE_DIR', $config['COTS_BASE_DIR']);
  42 +define('TOOLS_BASE_DIR', $config['TOOLS_BASE_DIR']);
  43 +define('KERNEL_BUILD_TYPE', $config['KERNEL_BUILD_TYPE']);
  44 +define('AMDA_KERNEL_DIR', $config['AMDA_KERNEL_DIR']);
  45 +define('IHM_SRC_DIR', $config['IHM_SRC_DIR']);
146 46  
147   -//!! WARNING !! - Please don't change anything below this line if you do
148   -// a standard installation (describe in CDPP-MI-32500-505-SIL)
  47 +define('GCC_BASE_DIR', TOOLS_BASE_DIR.'/gcc/4.7.2/rtf');
  48 +define('BOOST_BASE_DIR', TOOLS_BASE_DIR.'/gcc/4.7.2/boost');
  49 +define('KERNEL_CONFIG_DIR',__DIR__.'/kernel');
  50 +define('DDRES_DIR',__DIR__.'/kernel');
  51 +define('AMDA_KERNEL_SRC_DIR', AMDA_KERNEL_DIR.'/src');
  52 +define('AMDA_KERNEL_BUILD_DIR', AMDA_KERNEL_DIR.'/build/'.KERNEL_BUILD_TYPE);
149 53  
150 54 //Path to AMDA_Integration source dir
151   -define('INTEGRATION_SRC_DIR', INTEGRATION_BASE_PATH.'src/');
152   -
153   -//Path to AMDA_Kernel source dir
154   -define('NEWKERNEL_SRC_DIR', NEWKERNEL_BASE_PATH.'src/');
155   -
156   -//Path to AMDA_Kernel install dir dir
157   -define ('NEWKERNEL_INSTALL_DIR', NEWKERNEL_BASE_PATH.'build/Release/');
158   -
159   -//Path to AMDA_Kernel config dir
160   -define('NEWKERNEL_CONFIG_DIR', NEWKERNEL_BASE_PATH.'app-release/');
161   -
162   -//Path to AMDA_Kernel XSD files dir
163   -define('NEWKERNEL_XSD_DIR', NEWKERNEL_BASE_PATH.'config/xsd/');
164   -
165   -//Path to local parameters database for the new kernel
166   -define('PARAMS_LOCALDB_DIR', IHM_SRC_DIR.'generic_data/newKernelDDBase/');
167   -
168   -//Path to local parameters information files
169   -define('PARAMS_LOCALINFO_DIR', IHM_SRC_DIR.'generic_data/ParamInfo/');
170   -
171   -//Root path for directories used for databases, instruments and missions information files
172   -define ('NEWKERNEL_INFO_DIR', IHM_SRC_DIR.'generic_data/');
173   -
174   -//Path to dir that include DD.res file
175   -define('DDRES_DIR', NEWKERNEL_BASE_PATH.'app-release/');
  55 +if (defined('INTEGRATION_BASE_PATH')) {
  56 + define('INTEGRATION_SRC_DIR', INTEGRATION_BASE_PATH.'/src/');
  57 +}
  58 +else {
  59 + define('INTEGRATION_SRC_DIR', __DIR__."/../src");
  60 +}
176 61  
177 62 ?>
... ...
config/kernel/DD.res 0 โ†’ 100644
... ... @@ -0,0 +1,2 @@
  1 +amdadev.fr
  2 +5000
... ...
config/kernel/amda.properties 0 โ†’ 100644
... ... @@ -0,0 +1,2 @@
  1 +createdby=Created by AMDA(c)
  2 +acknowledgement=CDPP/AMDA Team
0 3 \ No newline at end of file
... ...
config/kernel/log4cxx.config 0 โ†’ 100644
... ... @@ -0,0 +1,14 @@
  1 +log4j.rootLogger=info, stdout, F
  2 +
  3 +log4j.appender.stdout=org.apache.log4j.ConsoleAppender
  4 +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
  5 +
  6 +# Pattern to output the caller's file name and line number.
  7 +log4j.appender.stdout.layout.ConversionPattern=%X{PID} %r %5p [%t] (%r ms) (%F:%L) - %m%n
  8 +
  9 +log4j.appender.F=org.apache.log4j.FileAppender
  10 +log4j.appender.F.File=example.log
  11 +log4j.appender.F.Append=false
  12 +
  13 +log4j.appender.F.layout=org.apache.log4j.PatternLayout
  14 +log4j.appender.F.layout.ConversionPattern=%p %t (%r ms) %c - %m%n
... ...
config/kernel/plotConfig.xml 0 โ†’ 100644
... ... @@ -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="8" />
  6 + <margin x="5" y="5" /> <!-- 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" />
  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/kernel/plplot/cmap0_black_on_white.pal 0 โ†’ 100644
... ... @@ -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/kernel/plplot/cmap0_default.pal 0 โ†’ 100644
... ... @@ -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/kernel/plplot/cmap0_test.pal 0 โ†’ 100644
... ... @@ -0,0 +1,9 @@
  1 +8
  2 +#4BFF14
  3 +#21B259
  4 +#66AF3B
  5 +#74AD8A
  6 +#096321
  7 +#6DD80F
  8 +#558752
  9 +#A9D6C5
... ...
config/kernel/plplot/cmap1_blue_red.pal 0 โ†’ 100644
... ... @@ -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/kernel/plplot/cmap1_blue_yellow.pal 0 โ†’ 100644
... ... @@ -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/kernel/plplot/cmap1_default.pal 0 โ†’ 100644
... ... @@ -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 8 \ No newline at end of file
... ...
config/kernel/plplot/cmap1_gray.pal 0 โ†’ 100644
... ... @@ -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 5 \ No newline at end of file
... ...
config/spiceKernelConfig.xml renamed to config/kernel/spiceKernelConfig.xml
config/predefined_env/akka-amdadev.env 0 โ†’ 100644
... ... @@ -0,0 +1,15 @@
  1 +;Path to COTS dir
  2 +COTS_BASE_DIR='/opt2/local'
  3 +
  4 +;Path to tools dir
  5 +TOOLS_BASE_DIR='/opt2/tools'
  6 +
  7 +;Define kernel build type
  8 +KERNEL_BUILD_TYPE='Release'
  9 +
  10 +;Path to AMDA_Kernel base dir
  11 +AMDA_KERNEL_DIR='/home/brenard/AMDA-GIT/AMDA_Kernel'
  12 +
  13 +;Path to AMDA_IHM base dir
  14 +IHM_SRC_DIR='/var/www/AMDA_IHM/'
  15 +
... ...
config/predefined_env/akka-dev.env 0 โ†’ 100644
... ... @@ -0,0 +1,14 @@
  1 +;Path to COTS dir
  2 +COTS_BASE_DIR='/opt/local'
  3 +
  4 +;Path to tools dir
  5 +TOOLS_BASE_DIR='/opt2/tools'
  6 +
  7 +;Define kernel build type
  8 +KERNEL_BUILD_TYPE='Release'
  9 +
  10 +;Path to AMDA_Kernel base dir
  11 +AMDA_KERNEL_DIR='/home/b.renard/workspace/AMDA-KERNEL/trunk/AMDA_Kernel/'
  12 +
  13 +;Path to AMDA_IHM base dir
  14 +IHM_SRC_DIR='/home/b.renard/AMDA_INSTALL/AMDA_IHM/'
... ...
config/predefined_env/akka-integration.env 0 โ†’ 100644
... ... @@ -0,0 +1,15 @@
  1 +;Path to COTS dir
  2 +COTS_BASE_DIR='/opt/local'
  3 +
  4 +;Path to tools dir
  5 +TOOLS_BASE_DIR='/opt/tools'
  6 +
  7 +;Define kernel build type
  8 +KERNEL_BUILD_TYPE='Release'
  9 +
  10 +;Path to AMDA_Kernel base dir
  11 +AMDA_KERNEL_DIR='/var/lib/jenkins/jobs/AMDA_Kernel_Phase3_Integration/workspace/AMDA_Kernel/'
  12 +
  13 +;Path to AMDA_IHM base dir
  14 +IHM_SRC_DIR='/var/lib/jenkins/jobs/AMDA_Kernel_Phase3_Integration/workspace/AMDA_IHM/'
  15 +
... ...
config/predefined_env/apus-dev.env 0 โ†’ 100644
... ... @@ -0,0 +1,14 @@
  1 +;Path to COTS dir
  2 +COTS_BASE_DIR='/opt/local'
  3 +
  4 +;Path to tools dir
  5 +TOOLS_BASE_DIR='/opt/tools'
  6 +
  7 +;Define kernel build type
  8 +KERNEL_BUILD_TYPE='Release'
  9 +
  10 +;Path to AMDA_Kernel base dir
  11 +AMDA_KERNEL_DIR='/home/benjamin/AMDA-GIT/AMDA_Kernel/'
  12 +
  13 +;Path to AMDA_IHM base dir
  14 +IHM_SRC_DIR='/home/benjamin/AMDA-GIT/AMDA_IHM/'
... ...
config/predefined_env/irap-amdatest.env 0 โ†’ 100644
... ... @@ -0,0 +1,14 @@
  1 +;Path to COTS dir
  2 +COTS_BASE_DIR='/opt/local'
  3 +
  4 +;Path to tools dir
  5 +TOOLS_BASE_DIR='/opt/tools'
  6 +
  7 +;Define kernel build type
  8 +KERNEL_BUILD_TYPE='Release'
  9 +
  10 +;Path to AMDA_Kernel base dir
  11 +AMDA_KERNEL_DIR='/home/myriam/AMDA_20161215/AMDA_Kernel/'
  12 +
  13 +;Path to AMDA_IHM base dir
  14 +IHM_SRC_DIR='/home/myriam/AMDA_20161215/AMDA_IHM/'
... ...
config/predefined_env/irap-test.env 0 โ†’ 100644
... ... @@ -0,0 +1,15 @@
  1 +;Path to COTS dir
  2 +COTS_BASE_DIR='/opt/local'
  3 +
  4 +;Path to tools dir
  5 +TOOLS_BASE_DIR='/opt/tools'
  6 +
  7 +;Define kernel build type
  8 +KERNEL_BUILD_TYPE='Release'
  9 +
  10 +;Path to AMDA_Kernel base dir
  11 +AMDA_KERNEL_DIR='/home/mbouchemit/AMDA_Kernel/'
  12 +
  13 +;Path to AMDA_IHM base dir
  14 +IHM_SRC_DIR='/home/mbouchemit/AMDA_INSTALL/AMDA_IHM/'
  15 +
... ...
config/predefined_env/pc1121-dev.env 0 โ†’ 100644
... ... @@ -0,0 +1,14 @@
  1 +;Path to COTS dir
  2 +COTS_BASE_DIR='/opt/local'
  3 +
  4 +;Path to tools dir
  5 +TOOLS_BASE_DIR='/opt/tools'
  6 +
  7 +;Define kernel build type
  8 +KERNEL_BUILD_TYPE='Release'
  9 +
  10 +;Path to AMDA_Kernel base dir
  11 +AMDA_KERNEL_DIR='/home/myriam/workspacenew/AMDA_Kernel/'
  12 +
  13 +;Path to AMDA_IHM base dir
  14 +IHM_SRC_DIR='/home/myriam/workspacenew/AMDA_IHM/'
... ...
src/InputOutput/IHMImpl/Config/IHMConfigClass.php
... ... @@ -15,7 +15,7 @@ class IHMConfigClass
15 15  
16 16 private static $functionsFile = "functions.xml";
17 17  
18   - private static $paramTemplateDir = "ParamTemplate/";
  18 + private static $paramTemplateDir = "LocalData/ParamTemplate/";
19 19  
20 20 private static $paramTemplateFile = "ParamTemplateList.xml";
21 21  
... ...
src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
... ... @@ -709,7 +709,7 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
709 709  
710 710  
711 711 $colorSerieId = -1;
712   - if ($paramData->{'param-drawing-object'}->{'serie-colored-param'} != '')
  712 + if (!empty($paramData->{'param-drawing-object'}->{'serie-colored-param'}))
713 713 $colorSerieId = $drawingEltIndex;
714 714  
715 715 switch ($paramData->{'param-drawing-type'})
... ... @@ -759,7 +759,7 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
759 759 $drawingEltIndex = 0;
760 760 foreach ($paramsData as $paramData)
761 761 {
762   - if ($paramData->{'param-drawing-object'}->{'serie-colored-param'} == '')
  762 + if (empty($paramData->{'param-drawing-object'}->{'serie-colored-param'}))
763 763 {
764 764 ++$drawingEltIndex;
765 765 continue;
... ...
src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php
... ... @@ -132,12 +132,12 @@ class IHMParamManagerClass
132 132 $real_param_id = $paramId;
133 133 if ($this->templateParamsManager->isTemplatedParam($paramId)) {
134 134 $paramPath = $this->templateParamsManager->getTemplatePath($paramId);
135   - if (empty($paramPath) || !$doc->load($paramPath))
  135 + if (empty($paramPath) || !@$doc->load($paramPath))
136 136 throw new Exception('Cannot find parameter template file '.$paramPath);
137 137 }
138 138 else {
139 139 $paramPath = IHMConfigClass::getLocalParamDBPath().$paramId.".xml";
140   - if (empty($paramPath) || !$doc->load($paramPath))
  140 + if (empty($paramPath) || !@$doc->load($paramPath))
141 141 throw new Exception('Cannot find parameter local file '.$paramPath);
142 142 }
143 143  
... ...
src/InputOutput/IHMImpl/Tools/IHMParamTemplateClass.php
... ... @@ -220,6 +220,9 @@ class IHMParamTemplateClass
220 220 */
221 221 public function replaceArgs($string, $template_args) {
222 222 $result = $string;
  223 + if (empty($template_args)) {
  224 + return $result;
  225 + }
223 226 foreach ($template_args as $template_arg_key => $template_arg_value) {
224 227 $result = str_replace("##".$template_arg_key."##", $template_arg_value, $result);
225 228 }
... ... @@ -232,7 +235,7 @@ class IHMParamTemplateClass
232 235 private function addDefaultValues($param_id, &$template_args) {
233 236 $list = $this->getParamTemplates();
234 237  
235   - if (!array_key_exists($param_id, $list))
  238 + if (!array_key_exists($param_id, $list) || !isset($list[$param_id]->arguments))
236 239 return;
237 240  
238 241 $arguments = $list[$param_id]->arguments;
... ...
src/Request/Config/KernelConfigClass.php
... ... @@ -7,20 +7,11 @@
7 7 */
8 8 class KernelConfigClass
9 9 {
10   - private static $xsdRequestDir = "request/";
11   - private static $xsdParameterDir = "parameter/";
12   - private static $xsdInfoDir = "info/";
13   - private static $xsdLocalBaseDir = "localbase/";
14   - private static $xsdSpiceKernelDir = "spicekernel/";
15   -
16 10 private static $propFile = "app.properties";
17 11  
18   - private static $amdaPropFile = "amda.properties";
19   -
20 12 private static $cxxCompiler = "g++";
21 13 private static $cmakeFlags = "-g -std=c++0x -fPIC -Wall -ggdb -DLINUX -Dlinux -D_REENTRANT -malign-double -pthread";
22 14  
23   - private static $logConfigFile = "log4cxx.config";
24 15 private static $plotConfigFile = "plotConfig.xml";
25 16  
26 17 private static $spiceKernelConfigFile = "spiceKernelConfig.xml";
... ... @@ -33,16 +24,6 @@ class KernelConfigClass
33 24 private static $userSrcDir = "src/";
34 25 private static $userLibDir = "lib/";
35 26  
36   - private static $datasetInfoDir = "DataSetInfo/";
37   - private static $instrumentInfoDir= "InstrumentInfo/";
38   - private static $missionInfoDir = "MissionInfo/";
39   -
40   - private static $localInclude = "/opt/local/include/";
41   - private static $boostInclude = "/opt/tools/gcc/4.7.2/boost/include/";
42   - private static $log4cxxInclude = "/opt/local/include/log4cxx/";
43   -
44   - private static $gccDir = "/opt/tools/gcc/4.7.2/rtf/";
45   -
46 27 private static $defaultGapThreshold = "5";
47 28  
48 29  
... ... @@ -51,9 +32,6 @@ class KernelConfigClass
51 32  
52 33 private static $timeToBatchMode = 10; // secs : interval after which batch mode is launched
53 34  
54   - private static $kernelAbout = "Created by CDPP/AMDA(c)";
55   - private static $kernelAcknow = "CDPP/AMDA Team";
56   -
57 35 private static $includeArray = array(
58 36 "InternLib",
59 37 "Common",
... ... @@ -77,7 +55,7 @@ class KernelConfigClass
77 55 {
78 56 self::$userName = $user;
79 57 }
80   -
  58 +
81 59 public static function getRequestParamsPath($working_dir)
82 60 {
83 61 $paramsPath = $working_dir.self::$requestParamsDir;
... ... @@ -90,72 +68,72 @@ class KernelConfigClass
90 68  
91 69 public static function getXSDParameterFilePath()
92 70 {
93   - return NEWKERNEL_XSD_DIR.self::$xsdParameterDir.'all.xsd';
  71 + return AMDA_KERNEL_DIR.'/config/xsd/parameter/all.xsd';
94 72 }
95 73  
96 74 public static function getXSDRequestFilePath()
97 75 {
98   - return NEWKERNEL_XSD_DIR.self::$xsdRequestDir.'all.xsd';
  76 + return AMDA_KERNEL_DIR.'/config/xsd/request/all.xsd';
99 77 }
100 78  
101 79 public static function getXSDParamInfoFilePath()
102 80 {
103   - return NEWKERNEL_XSD_DIR.self::$xsdInfoDir.'paramInfo.xsd';
  81 + return AMDA_KERNEL_DIR.'/config/xsd/info/paramInfo.xsd';
104 82 }
105 83  
106 84 public static function getXSDDatasetInfoFilePath()
107 85 {
108   - return NEWKERNEL_XSD_DIR.self::$xsdInfoDir.'dataSetInfo.xsd';
  86 + return AMDA_KERNEL_DIR.'/config/xsd/info/dataSetInfo.xsd';
109 87 }
110 88  
111 89 public static function getXSDInstrumentInfoFilePath()
112 90 {
113   - return NEWKERNEL_XSD_DIR.self::$xsdInfoDir.'instrumentInfo.xsd';
  91 + return AMDA_KERNEL_DIR.'/config/xsd/info/instrumentInfo.xsd';
114 92 }
115 93  
116 94 public static function getXSDMissionInfoFilePath()
117 95 {
118   - return NEWKERNEL_XSD_DIR.self::$xsdInfoDir.'missionInfo.xsd';
  96 + return AMDA_KERNEL_DIR.'/config/xsd/info/missionInfo.xsd';
119 97 }
120 98  
121 99 public static function getXSDLocalBaseFilePath()
122 100 {
123   - return NEWKERNEL_XSD_DIR.self::$xsdLocalBaseDir.'base.xsd';
  101 + return AMDA_KERNEL_DIR.'/config/xsd/localbase/base.xsd';
124 102 }
125 103  
126 104 public static function getXSDSpiceKernelConfigFilePath()
127 105 {
128   - return NEWKERNEL_XSD_DIR.self::$xsdSpiceKernelDir.'config.xsd';
  106 + return AMDA_KERNEL_DIR.'/config/xsd/spicekernel/config.xsd';
129 107 }
130 108  
131 109  
132 110 public static function getDatasetInfoPath()
133 111 {
134   - return NEWKERNEL_INFO_DIR.self::$datasetInfoDir;
  112 + return DataSetInfo;
135 113 }
136 114  
137 115 public static function getInstrumentInfoPath()
138 116 {
139   - return NEWKERNEL_INFO_DIR.self::$instrumentInfoDir;
  117 + return InstrumentInfo;
140 118 }
141 119  
142 120 public static function getMissionInfoPath()
143 121 {
144   - return NEWKERNEL_INFO_DIR.self::$missionInfoDir;
  122 + return MissionInfo;
145 123 }
146 124  
147 125 public static function getKernelBinPath()
148 126 {
149   - return NEWKERNEL_INSTALL_DIR.self::$binDir;
  127 + return AMDA_KERNEL_BUILD_DIR.'/'.self::$binDir;
150 128 }
151 129  
152 130 public static function getExecEnvVarArray()
153 131 {
154 132 return array (
155   - "DDPATH" => DDRES_DIR,
156   - "MY_GXX_HOME" => self::$gccDir,
157   - "PATH" => self::getKernelBinPath().":".self::$gccDir."bin/:".getenv("PATH"),
158   - "LD_LIBRARY_PATH" => self::$gccDir."lib64:".self::$gccDir."lib:".getenv("LD_LIBRARY_PATH")
  133 + "DDPATH" => KERNEL_CONFIG_DIR,
  134 + "MY_GXX_HOME" => GCC_BASE_DIR,
  135 + "PATH" => self::getKernelBinPath().":".COTS_BASE_DIR."/bin:".GCC_BASE_DIR."/bin:".getenv("PATH"),
  136 + "LD_LIBRARY_PATH" => COTS_BASE_DIR."/lib:".GCC_BASE_DIR."/lib64:".GCC_BASE_DIR."/lib:".getenv("LD_LIBRARY_PATH"),
159 137 );
160 138 }
161 139  
... ... @@ -174,7 +152,7 @@ class KernelConfigClass
174 152 //create app.properties file
175 153 $appProperties = array();
176 154  
177   - $appProperties["app.log4cxx.configfile"] = NEWKERNEL_CONFIG_DIR.self::$logConfigFile;
  155 + $appProperties["app.log4cxx.configfile"] = KERNEL_CONFIG_DIR."/log4cxx.config";
178 156 $appProperties["app.param.path"] = self::getRequestParamsPath($working_dir);
179 157 $appProperties["app.parameter.xsd"] = self::getXSDParameterFilePath();
180 158 $appProperties["app.request.xsd"] = self::getXSDRequestFilePath();
... ... @@ -191,9 +169,9 @@ class KernelConfigClass
191 169 $appProperties["app.localbase.xsd"] = self::getXSDLocalBaseFilePath();
192 170  
193 171 $appProperties["app.spicekernel.configxsd"] = self::getXSDSpiceKernelConfigFilePath();
194   - $appProperties["app.spicekernel.configfile"] = INTEGRATION_SRC_DIR.'../config/'.self::$spiceKernelConfigFile;
  172 + $appProperties["app.spicekernel.configfile"] = KERNEL_CONFIG_DIR.'/spiceKernelConfig.xml';
195 173  
196   - $appProperties["app.plugin"] = NEWKERNEL_INSTALL_DIR.self::$pluginDir;
  174 + $appProperties["app.plugin"] = AMDA_KERNEL_BUILD_DIR.'/'.self::$pluginDir;
197 175 $appProperties["app.process.src"] = $compilation_path.self::$userSrcDir;
198 176 $appProperties["app.process.lib"] = $compilation_path.self::$userLibDir;
199 177 $appProperties["app.process.CXX_COMPILER"] = self::$cxxCompiler;
... ... @@ -201,14 +179,14 @@ class KernelConfigClass
201 179  
202 180 $appProperties["app.process.INCLUDE"] = "";
203 181 foreach (self::$includeArray as $inc)
204   - $appProperties["app.process.INCLUDE"] .= ("-I".NEWKERNEL_SRC_DIR.$inc." ");
205   - $appProperties["app.process.INCLUDE"] .= "-I".self::$localInclude." -I".self::$boostInclude." -I".self::$log4cxxInclude;
  182 + $appProperties["app.process.INCLUDE"] .= ("-I".AMDA_KERNEL_SRC_DIR."/".$inc." ");
  183 + $appProperties["app.process.INCLUDE"] .= "-I".COTS_BASE_DIR."/include"." -I".BOOST_BASE_DIR."/include -I".COTS_BASE_DIR."/include/log4cxx";
206 184  
207   - $appProperties["app.process.LIB"] = "-L".NEWKERNEL_INSTALL_DIR.self::$libDir." ";
  185 + $appProperties["app.process.LIB"] = "-L".AMDA_KERNEL_BUILD_DIR.'/'.self::$libDir." ";
208 186 foreach (self::$libArray as $lib)
209 187 $appProperties["app.process.LIB"] .= ("-l".$lib." ");
210 188  
211   - $appProperties["app.plot.configfile"] = INTEGRATION_SRC_DIR.'../config/'.self::$plotConfigFile;
  189 + $appProperties["app.plot.configfile"] = KERNEL_CONFIG_DIR.'/'.self::$plotConfigFile;
212 190  
213 191 $appProperties["app.param.gapthreshold"] = self::$defaultGapThreshold;
214 192  
... ... @@ -223,16 +201,8 @@ class KernelConfigClass
223 201 fwrite($fp, $key."=".$value.PHP_EOL);
224 202 fclose($fp);
225 203  
226   - //create amda.properties file
227   - $amdaPropertiesArray = array();
228   -
229   - $amdaPropertiesArray["createdby"] = self::$kernelAbout;
230   - $amdaPropertiesArray["acknowledgement"] = self::$kernelAcknow;
231   -
232   - $fp = fopen($working_dir.self::$amdaPropFile, 'w');
233   - foreach ($amdaPropertiesArray as $key => $value)
234   - fwrite($fp, $key."=".$value.PHP_EOL);
235   - fclose($fp);
  204 + //copy amda.properties file
  205 + copy(KERNEL_CONFIG_DIR.'/amda.properties', $working_dir.'/amda.properties');
236 206 }
237 207 }
238 208  
... ...
src/Request/ParamInfoRequestClass.php
... ... @@ -49,7 +49,7 @@ class ParamInfoRequestClass extends RequestAbstractClass
49 49 $dom->preserveWhiteSpace = false;
50 50 $dom->formatOutput = true;
51 51  
52   - $res = $dom->load($this->requestData->getFilePath());
  52 + $res = @$dom->load($this->requestData->getFilePath());
53 53  
54 54 $this->requestData->setSuccess(false);
55 55  
... ... @@ -168,4 +168,4 @@ class ParamInfoRequestClass extends RequestAbstractClass
168 168 return true;
169 169 }
170 170 }
171   -?>
172 171 \ No newline at end of file
  172 +?>
... ...
src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamNodeClass.php
1 1 <?php
2 2  
  3 +require_once("InfoParamTableDefBoundsNodeClass.php");
  4 +require_once("InfoParamTableDefCenterNodeClass.php");
  5 +require_once("InfoParamTableDefCenterWidthNodeClass.php");
  6 +require_once("InfoParamTableDefMinMaxNodeClass.php");
  7 +
3 8 define ("INFOPARAM_TAGNAME", "info");
4 9 define ("INFOPARAM_NAME", "name");
5 10 define ("INFOPARAM_SHORTNAME", "short_name");
... ... @@ -187,7 +192,7 @@ class InfoParamNodeClass extends NodeClass
187 192 case INFOPARAMTABLEDEFCENTERWIDTH_TAGNAME :
188 193 $this->addTable(InfoParamTableTypeEnum::CENTERWIDTH, "")->loadFromNode($tableDefXmlNode);
189 194 break;
190   - case InfoParamTableDefMinMaxNodeClass :
  195 + case INFOPARAMTABLEDEFMINMAX_TAGNAME :
191 196 $this->addTable(InfoParamTableTypeEnum::MINMAX, "")->loadFromNode($tableDefXmlNode);
192 197 break;
193 198 default :
... ...
src/Request/ParamsRequestImpl/Nodes/NodeClass.php
... ... @@ -42,7 +42,10 @@ class NodeClass
42 42  
43 43 public function getAttribute($attName)
44 44 {
45   - return $this->attributes[$attName];
  45 + if (array_key_exists($attName,$this->attributes)) {
  46 + return $this->attributes[$attName];
  47 + }
  48 + return "";
46 49 }
47 50  
48 51 protected function hasChildren()
... ...