Commit eaf76b2ae3cd5a000cad21da90281a52e1b397dd

Authored by Menouard AZIB
1 parent 318630e4

Plot function is working properly, i also add an exception hadnling in case of p…

…aram id is not found in xml node by adding an error code in DicError.cc
src/Common/DicError.cc
1 1 #include "DicError.hh"
2 2  
3   -std::string getErrorMsg(int error_code) {
4   - switch (error_code) {
5   - case AMDA_EXIT_OK:
6   - return "";
7   - case AMDA_PARSE_COMMAND_LINE_KO:
8   - return "Command line arguments not recognized";
9   - case AMDA_TYPE_DATA_UNKNOWN:
10   - return "Type of Data not supported";
11   - case AMDA_FILEPROPERTIES_ERR:
12   - return "Error in property file";
13   - case AMDA_INFORMATION_PARAM_ERR:
14   - return "Parameter XML file not found or not well-formed or not valid";
15   - case AMDA_INFORMATION_REQUEST_ERR:
16   - return "Request XML file error";
17   - case AMDA_PARAM_OUTPUT_ERR:
18   - return "ParamOutput implementation not found";
19   - case AMDA_PROCESS_ERR:
20   - return "Compilation abort or library load abort";
21   - case AMDA_PARAM_NOT_FOUND_ERR:
22   - return "Parameter of ident ??? is not fond";
23   - case AMDA_PARAM_SOME_ERR:
24   - return "Some ParamOutput are terminated successfully but not all.";
25   - case AMDA_OPER_NOT_ALLOWED:
26   - return "Operation not allowed";
27   - case AMDA_ERROR_UNKNOWN:
28   - return "Unknown error";
  3 +std::string getErrorMsg(int error_code)
  4 +{
  5 + switch (error_code)
  6 + {
  7 + case AMDA_EXIT_OK:
  8 + return "";
  9 + case AMDA_PARSE_COMMAND_LINE_KO:
  10 + return "Command line arguments not recognized";
  11 + case AMDA_TYPE_DATA_UNKNOWN:
  12 + return "Type of Data not supported";
  13 + case AMDA_FILEPROPERTIES_ERR:
  14 + return "Error in property file";
  15 + case AMDA_INFORMATION_PARAM_ERR:
  16 + return "Parameter XML file not found or not well-formed or not valid";
  17 + case AMDA_INFORMATION_REQUEST_ERR:
  18 + return "Request XML file error";
  19 + case AMDA_PARAM_OUTPUT_ERR:
  20 + return "ParamOutput implementation not found";
  21 + case AMDA_PROCESS_ERR:
  22 + return "Compilation abort or library load abort";
  23 + case AMDA_PARAM_NOT_FOUND_ERR:
  24 + return "Parameter of ident ??? is not fond";
  25 + case AMDA_PARAM_SOME_ERR:
  26 + return "Some ParamOutput are terminated successfully but not all.";
  27 + case AMDA_OPER_NOT_ALLOWED:
  28 + return "Operation not allowed";
  29 + case AMDA_ERROR_UNKNOWN:
  30 + return "Unknown error";
29 31  
30   - case AMDA_LOCALFILE_READER:
31   - return "LocalFile: Unknown file reader";
32   - case AMDA_LOCALFILE_TIMEPARAM:
33   - return "LocalFile: Cannot find time parameter";
34   - case AMDA_OUTOFTIME_ERR:
35   - return "LocalFile: Out of data time";
36   -
37   - case AMDA_STAT_NOT_BOOL:
  32 + case AMDA_LOCALFILE_READER:
  33 + return "LocalFile: Unknown file reader";
  34 + case AMDA_LOCALFILE_TIMEPARAM:
  35 + return "LocalFile: Cannot find time parameter";
  36 + case AMDA_OUTOFTIME_ERR:
  37 + return "LocalFile: Out of data time";
  38 +
  39 + case AMDA_STAT_NOT_BOOL:
38 40 return "Only boolean parameters are handled by countTrue function";
39 41  
40   - case AMDA_PARSER_TEST_ERROR:
41   - return "Parser: At leat one error occured during test of the parser";
  42 + case AMDA_PARSER_TEST_ERROR:
  43 + return "Parser: At leat one error occured during test of the parser";
42 44  
43   - case AMDA_ERROR_NOCONNECTION:
44   - return "DD_server: No connection";
45   - case AMDA_ERROR_TOOMANYREQ:
46   - return "DD_server: Too many request";
47   - case AMDA_ERROR_REQSENDERR:
48   - return "DD_server: Error to send request";
49   - case AMDA_ERROR_REPLYRECERR:
50   - return "DD_server: Receive an error";
51   - case AMDA_ERROR_NOID:
52   - return "DD_server: Invalid request Id";
53   - case AMDA_ERROR_NOREFFILE:
54   - return "DD_server: Error to open reference file";
55   - case AMDA_ERROR_NOTIMESFILE:
56   - return "DD_server: Missing times file";
57   - case AMDA_ERROR_NOINFOFILE:
58   - return "DD_server: Missing info file";
59   - case AMDA_ERROR_NOVAR:
60   - return "DD_server: Unknown variable";
61   - case AMDA_ERROR_OUTOFTIME:
62   - return "DD_server: Out of data time";
63   - case AMDA_ERROR_CACHERR:
64   - return "DD_server: Error occured during cache manipulation";
65   - case AMDA_ERROR_CACHTOOREC:
66   - return "DD_server: No free space in cache";
67   - case AMDA_ERROR_WAITEXTCALL:
68   - return "DD_server: Waits external call finish";
69   - case AMDA_ERROR_TRYAGAIN:
70   - return "DD_server: Times file is locked. This request should be repeated again";
71   - case AMDA_ERROR_NODATAATTIME:
72   - return "DD_server: Requested time is inside NODATA time interval";
73   - case AMDA_ERROR_GAPISSMALL:
74   - return "DD_server: Gap is too small to call external archive";
75   - case AMDA_ERROR_CTIMEISSHIFTED:
76   - return "DD_server: The request was in NoData interval, try again with time at the end";
77   - case AMDA_ERROR_DATAFILEERR:
78   - return "DD_server: Error during data file manipulation";
79   - case AMDA_ERROR_ENVIRERROR:
80   - return "DD_server: Error in environment variables";
81   - case AMDA_ERROR_NOPOINTER:
82   - return "DD_server: The pointer points nowhere, SetTime were failed";
83   - case AMDA_ERROR_INTSERERR:
84   - return "DD_server: Server internal error";
85   - case AMDA_ERROR_TIMEINEMPTY:
86   - return "DD_server: No data for specified time interval";
87   - case AMDA_ERROR_NOEXEC:
88   - return "DD_server: No executable";
  45 + case AMDA_ERROR_NOCONNECTION:
  46 + return "DD_server: No connection";
  47 + case AMDA_ERROR_TOOMANYREQ:
  48 + return "DD_server: Too many request";
  49 + case AMDA_ERROR_REQSENDERR:
  50 + return "DD_server: Error to send request";
  51 + case AMDA_ERROR_REPLYRECERR:
  52 + return "DD_server: Receive an error";
  53 + case AMDA_ERROR_NOID:
  54 + return "DD_server: Invalid request Id";
  55 + case AMDA_ERROR_NOREFFILE:
  56 + return "DD_server: Error to open reference file";
  57 + case AMDA_ERROR_NOTIMESFILE:
  58 + return "DD_server: Missing times file";
  59 + case AMDA_ERROR_NOINFOFILE:
  60 + return "DD_server: Missing info file";
  61 + case AMDA_ERROR_NOVAR:
  62 + return "DD_server: Unknown variable";
  63 + case AMDA_ERROR_OUTOFTIME:
  64 + return "DD_server: Out of data time";
  65 + case AMDA_ERROR_CACHERR:
  66 + return "DD_server: Error occured during cache manipulation";
  67 + case AMDA_ERROR_CACHTOOREC:
  68 + return "DD_server: No free space in cache";
  69 + case AMDA_ERROR_WAITEXTCALL:
  70 + return "DD_server: Waits external call finish";
  71 + case AMDA_ERROR_TRYAGAIN:
  72 + return "DD_server: Times file is locked. This request should be repeated again";
  73 + case AMDA_ERROR_NODATAATTIME:
  74 + return "DD_server: Requested time is inside NODATA time interval";
  75 + case AMDA_ERROR_GAPISSMALL:
  76 + return "DD_server: Gap is too small to call external archive";
  77 + case AMDA_ERROR_CTIMEISSHIFTED:
  78 + return "DD_server: The request was in NoData interval, try again with time at the end";
  79 + case AMDA_ERROR_DATAFILEERR:
  80 + return "DD_server: Error during data file manipulation";
  81 + case AMDA_ERROR_ENVIRERROR:
  82 + return "DD_server: Error in environment variables";
  83 + case AMDA_ERROR_NOPOINTER:
  84 + return "DD_server: The pointer points nowhere, SetTime were failed";
  85 + case AMDA_ERROR_INTSERERR:
  86 + return "DD_server: Server internal error";
  87 + case AMDA_ERROR_TIMEINEMPTY:
  88 + return "DD_server: No data for specified time interval";
  89 + case AMDA_ERROR_NOEXEC:
  90 + return "DD_server: No executable";
89 91  
90   - case AMDA_ERROR_OPERMISSION:
91   - return "DD_server: Access - Permission denied";
92   - case AMDA_ERROR_NOHOST:
93   - return "DD_server: Access - No host";
94   - case AMDA_ERROR_NNOUSERSFILE:
95   - return "DD_server: Access - No user file";
  92 + case AMDA_ERROR_OPERMISSION:
  93 + return "DD_server: Access - Permission denied";
  94 + case AMDA_ERROR_NOHOST:
  95 + return "DD_server: Access - No host";
  96 + case AMDA_ERROR_NNOUSERSFILE:
  97 + return "DD_server: Access - No user file";
  98 + case AMDA_ERROR_PLOTFUNCTION_PARAM_NOT_FOUND:
  99 + return "Parameter not found in param_nb_points attribute in the xml node request";
96 100 }
97 101  
98 102 return "Unknown error";
... ...
src/Common/DicError.hh
... ... @@ -13,62 +13,64 @@
13 13 /**
14 14 * List of code error return by application
15 15 */
16   -enum {
  16 +enum
  17 +{
17 18 AMDA_EXIT_OK = 0,
18   - AMDA_PARSE_COMMAND_LINE_KO = 1, ///Command line arguments not recognized
19   - AMDA_TYPE_DATA_UNKNOWN = 2, /// Type of Data not supported
20   - AMDA_FILEPROPERTIES_ERR = 3, /// Error in property file
21   - AMDA_INFORMATION_PARAM_ERR = 4, /// Parameter XML file not found or not well-formed or not valid
  19 + AMDA_PARSE_COMMAND_LINE_KO = 1, /// Command line arguments not recognized
  20 + AMDA_TYPE_DATA_UNKNOWN = 2, /// Type of Data not supported
  21 + AMDA_FILEPROPERTIES_ERR = 3, /// Error in property file
  22 + AMDA_INFORMATION_PARAM_ERR = 4, /// Parameter XML file not found or not well-formed or not valid
22 23 AMDA_INFORMATION_REQUEST_ERR = 5, /// Request XML file error
23   - AMDA_PARAM_OUTPUT_ERR = 6, /// ParamOutput implementation not found
24   - AMDA_PROCESS_ERR = 7, /// Compilation abort or library load abort
25   - AMDA_PARAM_NOT_FOUND_ERR = 8, /// Parameter of ident ??? is not fond
26   - AMDA_PARAM_SOME_ERR = 9, /// Some ParamOutput are terminated successfully but not all.
27   - AMDA_OPER_NOT_ALLOWED = 10, /// Operation not allowed
28   - AMDA_ERROR_UNKNOWN = 100, // Unknown error
  24 + AMDA_PARAM_OUTPUT_ERR = 6, /// ParamOutput implementation not found
  25 + AMDA_PROCESS_ERR = 7, /// Compilation abort or library load abort
  26 + AMDA_PARAM_NOT_FOUND_ERR = 8, /// Parameter of ident ??? is not fond
  27 + AMDA_PARAM_SOME_ERR = 9, /// Some ParamOutput are terminated successfully but not all.
  28 + AMDA_OPER_NOT_ALLOWED = 10, /// Operation not allowed
  29 + AMDA_ERROR_UNKNOWN = 100, // Unknown error
29 30  
30 31 /*
31 32 * Errors for ParamGet LocalFiles
32 33 */
33   - AMDA_LOCALFILE_READER = 20, /// Unknown file reader
  34 + AMDA_LOCALFILE_READER = 20, /// Unknown file reader
34 35 AMDA_LOCALFILE_TIMEPARAM = 21, /// Cannot find time parameter
35   - AMDA_OUTOFTIME_ERR = 22, /// Out of data time
  36 + AMDA_OUTOFTIME_ERR = 22, /// Out of data time
36 37  
37 38 /*
38 39 * Parser error
39 40 */
40   - AMDA_PARSER_TEST_ERROR = 30, /// At leat an error occured during test of the parser
41   -
42   - AMDA_STAT_NOT_BOOL = 40, // Unknown error
  41 + AMDA_PARSER_TEST_ERROR = 30, /// At leat an error occured during test of the parser
  42 +
  43 + AMDA_STAT_NOT_BOOL = 40, // Unknown error
43 44  
44 45 /*------------ Errors of DD_serveur ---------------------*/
45   - AMDA_ERROR_NOCONNECTION =201, // No connection with DD_server
46   - AMDA_ERROR_TOOMANYREQ =202, // too many request
47   - AMDA_ERROR_REQSENDERR =203,
48   - AMDA_ERROR_REPLYRECERR =204, // receive an server error
49   - AMDA_ERROR_NOID = 205, //Id of request not valid
50   - AMDA_ERROR_NOREFFILE =206, //Data base not consistent
51   - AMDA_ERROR_NOTIMESFILE =207, //Data base not consistent
52   - AMDA_ERROR_NOINFOFILE =208, //Data base not consistent
53   - AMDA_ERROR_NOVAR = 209, // Variable unknown
54   - AMDA_ERROR_OUTOFTIME =210, //Out of data time
55   - AMDA_ERROR_CACHERR =211, /** The error occured when program manipulated the cach */
56   - AMDA_ERROR_CACHTOOREC =233 ,/** Off files in the CASH are created less then 5 sec ago */
57   - AMDA_ERROR_WAITEXTCALL =234, /** Server Waits external call finish */
58   - AMDA_ERROR_TRYAGAIN = 235, /** Times file is locked. This request should be repeated again */
59   - AMDA_ERROR_NODATAATTIME =236, /** Requested time is inside NODATA time interval */
60   - AMDA_ERROR_GAPISSMALL =237, /** Gap is too small to call external archive */
61   - AMDA_ERROR_CTIMEISSHIFTED =238 ,/** The request was in NoData interval, try again with time at the end */
62   - AMDA_ERROR_DATAFILEERR = 212, /** The error while manipulate with data file */
63   - AMDA_ERROR_ENVIRERROR =213 , /** Error in Environments */
64   - AMDA_ERROR_NOPOINTER =214 , /** The pointer points nowhere, SetTime were failed */
65   - AMDA_ERROR_INTSERERR =215 , /** Server internal error */
66   - AMDA_ERROR_TIMEINEMPTY =216, /** No data for specified time interval */
67   - AMDA_ERROR_NOEXEC = 217 , /** No executable */
  46 + AMDA_ERROR_NOCONNECTION = 201, // No connection with DD_server
  47 + AMDA_ERROR_TOOMANYREQ = 202, // too many request
  48 + AMDA_ERROR_REQSENDERR = 203,
  49 + AMDA_ERROR_REPLYRECERR = 204, // receive an server error
  50 + AMDA_ERROR_NOID = 205, // Id of request not valid
  51 + AMDA_ERROR_NOREFFILE = 206, // Data base not consistent
  52 + AMDA_ERROR_NOTIMESFILE = 207, // Data base not consistent
  53 + AMDA_ERROR_NOINFOFILE = 208, // Data base not consistent
  54 + AMDA_ERROR_NOVAR = 209, // Variable unknown
  55 + AMDA_ERROR_OUTOFTIME = 210, // Out of data time
  56 + AMDA_ERROR_CACHERR = 211, /** The error occured when program manipulated the cach */
  57 + AMDA_ERROR_CACHTOOREC = 233, /** Off files in the CASH are created less then 5 sec ago */
  58 + AMDA_ERROR_WAITEXTCALL = 234, /** Server Waits external call finish */
  59 + AMDA_ERROR_TRYAGAIN = 235, /** Times file is locked. This request should be repeated again */
  60 + AMDA_ERROR_NODATAATTIME = 236, /** Requested time is inside NODATA time interval */
  61 + AMDA_ERROR_GAPISSMALL = 237, /** Gap is too small to call external archive */
  62 + AMDA_ERROR_CTIMEISSHIFTED = 238, /** The request was in NoData interval, try again with time at the end */
  63 + AMDA_ERROR_DATAFILEERR = 212, /** The error while manipulate with data file */
  64 + AMDA_ERROR_ENVIRERROR = 213, /** Error in Environments */
  65 + AMDA_ERROR_NOPOINTER = 214, /** The pointer points nowhere, SetTime were failed */
  66 + AMDA_ERROR_INTSERERR = 215, /** Server internal error */
  67 + AMDA_ERROR_TIMEINEMPTY = 216, /** No data for specified time interval */
  68 + AMDA_ERROR_NOEXEC = 217, /** No executable */
68 69 /*------------ Errors of DD_serveur(ACCESS) ---------------------*/
69   - AMDA_ERROR_OPERMISSION = 250, /** Permission denied to connect with DD_server*/
70   - AMDA_ERROR_NOHOST = 251, /** Permission denied to connect with DD_server*/
71   - AMDA_ERROR_NNOUSERSFILE = 252
  70 + AMDA_ERROR_OPERMISSION = 250, /** Permission denied to connect with DD_server*/
  71 + AMDA_ERROR_NOHOST = 251, /** Permission denied to connect with DD_server*/
  72 + AMDA_ERROR_NNOUSERSFILE = 252,
  73 + AMDA_ERROR_PLOTFUNCTION_PARAM_NOT_FOUND = 253
72 74 };
73 75  
74 76 std::string getErrorMsg(int error_code);
... ...
src/ParamOutputImpl/Plot/InstantPlot/PlotFunction.cc
... ... @@ -188,7 +188,7 @@ namespace plot
188 188 double samplingValue = 60.0;
189 189 double nb_points = 1;
190 190  
191   - auto it = find(paramsNbPoints.begin(), paramsNbPoints.end(), param_id);
  191 + auto it = find(paramsNbPoints.begin(), paramsNbPoints.end(), id);
192 192 // If parameter was found
193 193 if (it != paramsNbPoints.end())
194 194 {
... ...