/* ************************************************************** */ /* * SENMEAS.H * * Zachary Wolf * 2/7/03 */ #ifndef __SENMEAS_HEADER #define __SENMEAS_HEADER #if defined(__cplusplus) || defined(__cplusplus__) extern "C" { #endif /* ************************************************************** */ /* CONSTANTS */ #define SENMEAS_MAX_NUM_CHAR 80 #define SENMEAS_MAX_NUM_SENSOR 20 /* ************************************************************* */ /* ENUM DEFINITIONS */ enum senmeas_meas_type_enum {SENMEAS_V, SENMEAS_R, SENMEAS_R_4WIRE, SENMEAS_T}; enum senmeas_calib_type_enum {SENMEAS_CALIB_DATA, SENMEAS_POLY_FIT, SENMEAS_STEINHART_HART, SENMEAS_CALIB_NONE}; /* ************************************************************* */ /* STRUCTURE DEFINITIONS */ struct sensor_info_struct { char name[SENMEAS_MAX_NUM_CHAR]; /* name of the sensor */ char description[SENMEAS_MAX_NUM_CHAR]; /* description of the measurement */ int channel; /* channel number in the measurement device */ enum senmeas_meas_type_enum meas_type; /* type of measurement to make */ enum senmeas_calib_type_enum calib_type; /* type of calibration to use */ char calib_file_name[SENMEAS_MAX_NUM_CHAR]; /* name of the file containing the calibration parameters of the sensor */ }; struct senmeas_param_struct { int num_sensor; /* number of sensors */ struct sensor_info_struct sensor_info[SENMEAS_MAX_NUM_SENSOR]; /* sensor information */ }; /* ************************************************************** */ /* PUBLIC FUNCTION DECLARATIONS */ void senmeas_init(char log_file_in[], struct senmeas_param_struct senmeas_param); void senmeas_get_sensor_info(int sensor_num, struct sensor_info_struct* sensor_info); void senmeas_get_sensor_raw_output(int sensor_num, double* sensor_raw_output); void senmeas_scan_sensor_raw_output(int* num_sensor, int sensor_num[], double sensor_raw_output[]); void senmeas_apply_sensor_calib(int sensor_num, double sensor_raw_output, double* sensor_meas_val); void senmeas_get_sensor_meas_val(int sensor_num, double* sensor_meas_val); void senmeas_scan_sensor_meas_val(int* num_sensor, int sensor_num[], double sensor_meas_val[]); void senmeas_measure_all(int* num_sensor, struct sensor_info_struct sensor_info[], double sensor_meas_val[]); void senmeas_measure_scan_all(int* num_sensor, struct sensor_info_struct sensor_info[], double sensor_meas_val[]); void senmeas_dat_measure_all(char dat_file_name[], int num_sensor, struct sensor_info_struct sensor_info[], double sensor_meas_val[]); void senmeas_dat_measure_all_vs_time(char dat_file_name[], int num_sensor, struct sensor_info_struct sensor_info[], double sensor_meas_val[]); void senmeas_plt_measure_all_vs_time(char plt_file_name[], int num_sensor, struct sensor_info_struct sensor_info[], double sensor_meas_val[]); void senmeas_exit(void); /* ************************************************************** */ /* DONE */ #if defined(__cplusplus) || defined(__cplusplus__) } #endif #endif