Go to the documentation of this file.
92 char *routine =
"write_eng_data";
96 PGSt_SMF_status returnStatus;
98 PGSt_SMF_status tempStatus;
102 unsigned char *record = (
unsigned char *) record_values;
108 int cur_pos_in_buf=0;
134 if (eng_data ==
NULL) {
250 memset(buffer, 0,
sizeof(buffer));
256 sprintf(
msg,
"Current Position: %d Max Buffer Size: %d",
262 switch (eng_data[
i].field[
j].
type) {
264 memcpy(
p, (
const void *)&eng_data[
i].field[
j].union_value[
k].i8type,
265 sizeof(eng_data[
i].field[
j].union_value[
k].i8type));
270 memcpy(
p, (
const void *)&eng_data[
i].field[
j].union_value[
k].ui8type,
271 sizeof(eng_data[
i].field[
j].union_value[
k].ui8type));
276 memcpy(
p, (
const void *)&eng_data[
i].field[
j].union_value[
k].i16type,
277 sizeof(eng_data[
i].field[
j].union_value[
k].i16type));
282 memcpy(
p, (
const void *)&eng_data[
i].field[
j].union_value[
k].ui16type,
283 sizeof(eng_data[
i].field[
j].union_value[
k].ui16type));
288 memcpy(
p, (
const void *)&eng_data[
i].field[
j].union_value[
k].i32type,
289 sizeof(eng_data[
i].field[
j].union_value[
k].i32type));
294 memcpy(
p, (
const void *)&eng_data[
i].field[
j].union_value[
k].ui32type,
295 sizeof(eng_data[
i].field[
j].union_value[
k].ui32type));
300 sprintf(
msg,
"Engineering Data Field Type: %d Valid Range: %d to %d",
319 tempStatus =
write_Vdata(eng_data[
i].vdata_name, (
unsigned char *)buffer, 1);
334 if (tempStatus ==
FAIL)
336 sprintf(
msg,
"Vdata Name = %s", eng_data[
i].vdata_name);
351 memset(record_values, 0,
sizeof(record_values));
364 record_values[
j] = eng_data[
i].field[
j].
value;
390 tempStatus =
write_Vdata(eng_data[
i].vdata_name, record, 1);
391 if (tempStatus ==
FAIL)
393 sprintf(
msg,
"Vdata Name = %s", eng_data[
i].vdata_name);
408 return (returnStatus);
EN_FIELD_TYPE_t field[EN_MAX_FIELDS_PER_VDATA]
PGSt_SMF_status write_eng_data(EN_VDATA_TYPE_t *eng_data)
HDF4 data type of the output SDS Default is DFNT_FLOAT32 Common types used DFNT_INT32
#define EN_MIN_VDATA_TYPE
union EN_FIELD_TYPE_t::@18 union_value[EN_MAX_VDATA_ORDER]
#define EN_SC_ANCILLARY_VDATA_END
#define EN_SC_ANCILLARY_VDATA_START
void log_fmt_msg(PGSt_SMF_status code, const char *routine, const char *msg_fmt,...)
#define EN_MAX_VDATA_TYPE
#define EN_ANCIL_VDATA_BUFFER_SIZE
#define MODIS_E_VDATA_BUFFER_OVERFLOW
HDF4 data type of the output SDS Default is DFNT_FLOAT32 Common types used DFNT_INT16
#define MODIS_E_WRITE_VDATA
#define MODIS_F_WRITE_ENG_DATA_FAIL
PGSt_SMF_status write_Vdata(char *Vdata_name, unsigned char *data, int32 num_records)
#define MODIS_E_INVALID_VDATA_TYPE
#define MODIS_E_NULL_POINTER
#define EN_MAX_FIELDS_PER_VDATA