Go to the documentation of this file.
169 PGSt_SMF_status PGSstatus;
170 PGSt_SMF_status fileStatus;
175 char *routine =
"parse_eng_data_list";
179 PGSt_integer version_num=1;
180 PGSt_IO_Gen_AccessType access_mode=PGSd_IO_Gen_Read;
182 PGSt_integer file_version=1;
183 PGSt_IO_Gen_FileHandle *eng_data_list_handle;
186 unsigned short num_bits;
187 unsigned short start_bit_pos;
189 unsigned short order;
192 uint16 curr_eng_data_index=0;
193 uint16 curr_field_index;
196 int num_vdatas_created;
197 int number_of_vdata_fields;
207 if (eng_data ==
NULL) {
219 if (PGS_SMF_TestSuccessLevel(PGSstatus) != PGS_TRUE)
221 "unable to retrieve eng data list file name from pcf file");
228 &eng_data_list_handle,
231 if (PGSstatus != PGS_S_SUCCESS)
234 "error opening eng_data_list file");
243 num_vdatas_created = 0;
245 readStatus = fgets(
line,
sizeof(
line), eng_data_list_handle);
247 if (readStatus ==
line) {
249 scanStatus = sscanf(
line,
"%s %d %*[$]Revision: %s $ ", field_name,
254 if (scanStatus < 2) {
256 "Spacecraft Instrument not valid");
259 if (scanStatus < 3) {
261 "No RCS Revision number");
284 readStatus = fgets(
line,
sizeof(
line),
285 eng_data_list_handle);
286 if (readStatus ==
line)
296 strncpy (eng_data_name,
line,
sizeof(eng_data_name));
297 eng_data_name[strlen(
line)-1]=
'\0';
300 &curr_eng_data_index,
306 eng_data_list_handle);
307 if (readStatus ==
line)
313 "missing separator line in eng_data_list");
326 memset(field_name,
'\0',
sizeof(field_name));
327 number_of_vdata_fields = 0;
329 readStatus = fgets(
line,
sizeof(
line),
330 eng_data_list_handle);
332 if (readStatus !=
line)
335 scanStatus = sscanf(
line,
"%s %hu %hu %hu %hu", field_name,
336 &num_bits, &start_bit_pos, &order, &
type);
346 number_of_vdata_fields++;
350 if (!
isalpha((
int)*(
unsigned char*)field_name))
353 sprintf(
msg,
"In line %d vdata field name %s in eng_data_list does not begin with a letter",
354 total_lines, field_name);
363 sprintf(
msg,
"In line %d the number of bits is invalid for "
364 "vdata field %s in %s. Value: %d Range: %d to %d", total_lines,
372 sprintf(
msg,
"In line %d the number of attributes read for "
373 "vdata field %s in %s was %d.", total_lines, field_name,
374 eng_data_name, scanStatus);
380 sprintf(
msg,
"In line %d the order number is invalid for "
381 "vdata field %s in %s. Value: %d Range: %d to %d",
382 total_lines, field_name, eng_data_name, order,
389 sprintf(
msg,
"In line %d the type is invalid for vdata field "
390 " %s in %s. Value: %d Range: %d to %d", total_lines, field_name,
409 readStatus = fgets(
line,
sizeof(
line), eng_data_list_handle);
410 if (readStatus !=
line)
413 scanStatus = sscanf(
line,
"%s %hu %hu %hu %hu", field_name,
414 &num_bits, &start_bit_pos, &order, &
type);
419 "Unexpected end of file in eng_data_list file");
421 num_vdatas_created++;
430 fgets(
line,
sizeof(
line), eng_data_list_handle);
436 while ((!feof(eng_data_list_handle))&&(!ferror(eng_data_list_handle)))
441 fgets(
line,
sizeof(
line), eng_data_list_handle);
448 sprintf(
msg,
"There are %d additional lines after the end of the "
449 "Engineering Vdata. They were ignored", extra_lines);
455 "General Error Reading from ENG_DATA_LIST File");
460 PGSstatus = PGS_IO_Gen_Close(eng_data_list_handle);
461 if (PGSstatus != PGS_S_SUCCESS)
463 "error closing eng_data_list_file");
#define EN_MAX_VDATA_NUM_BITS
#define PC_L1A_ENG_DATA_LIST_FILE
char global_input_pointer[MAX_INPUTS][PGSd_PC_VALUE_LENGTH_MAX]
#define EN_MIN_VDATA_TYPE
#define EN_MAX_VDATA_ORDER
void create_eng_data_vdata_array_field(char *field_name, uint16 num_bits, uint16 start_bit_pos, uint16 order, uint16 type, EN_VDATA_TYPE_t *eng_data, uint16 curr_eng_data_index, uint16 *curr_field_index)
#define MODIS_E_GETCONFIG_FAILED
#define MODIS_F_INVALID_ENG_DATA_LIST
#define MODIS_E_PGS_IO_GEN_CLOSE
#define EN_MIN_VDATA_ORDER
PGSt_SMF_status parse_eng_data_list(EN_VDATA_TYPE_t *eng_data)
#define EN_NUM_SCAN_ELEMENTS
void log_fmt_msg(PGSt_SMF_status code, const char *routine, const char *msg_fmt,...)
#define EN_MAX_VDATA_NAME_LENGTH
#define EN_MAX_VDATA_TYPE
#define EN_MAX_FIELD_NAME_LENGTH
#define EN_MIN_VDATA_NUM_BITS
void create_eng_data_vdata_array(char *eng_data_name, EN_VDATA_TYPE_t *eng_data, uint16 *curr_eng_data_index, uint16 *curr_field_index)
#define MODIS_E_PGS_IO_GEN_OPEN
PARAM_TYPE_NONE Default value No parameter is buried in the product name name_prefix is case insensitive string compared to the product name PARAM_TYPE_VIS_WAVE The visible wavelength bands from the sensor are buried in the product name The product name is compared by appending and name_suffix ie aph_412_giop where prod_ix will be set to PARAM_TYPE_IR_WAVE same search method as PARAM_TYPE_VIS_WAVE except only wavelength above are looped through but prod_ix is still based ie aph_2_giop for the second and prod_ix set to PARAM_TYPE_INT name_prefix is compared with the beginning of the product name If name_suffix is not empty the it must match the end of the product name The characters right after the prefix are read as an integer and prod_ix is set to that number strncpy(l2prod->name_prefix, "myprod", UNITLEN)
#define MODIS_E_NULL_POINTER
#define MODIS_W_EXCESS_DATA_LIST
char revision[PGSd_PC_VALUE_LENGTH_MAX]