00001 #ifndef __LOAD_HK_CONFIGS_H
00002 #define __LOAD_HK_CONFIGS_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #define MAX_SIZE_PKT_DATE 100
00015 #define MAXLINE_IN_FILE 150
00016 #define MAX_NUM_KW_LINES 3000
00017 #define MAX_DATE_SIZE 15
00018 #define MAX_HK_MNM 30
00019 #define MAX_HK_KYWD 10
00020 #define MAX_HK_VALUE_TYPE 10
00021 #define MAX_APID_POINTERS 4095
00022 #define MAX_DIRECTORY_NAME 200
00023 #define MAX_FILE_NAME 300
00024 #define ERROR_LOADING_HK_DATA 1
00025 #define ERROR_SAVING_FILE_LINE 1
00026 #define ERROR_SAVING_APID_LINE 1
00027 #define SUCESSFUL 0
00028 #define HK_SUCCESSFUL 0
00029 #define MAX_SIZE_CHANGE_TIME 15
00030 #define MAX_SIZE_CHANGE_DATE 15
00031 #define MAX_CHAR_VERSION_NUMBER 10
00032 #define MAX_NUM_ACON_LINES 1000
00033 #define MAXLINE_ACON_IN_FILE 200
00034 #define MAX_NUM_DCON_LINES 4000
00035 #define MAXLINE_DCON_IN_FILE 200
00036 #define MAX_VALUE_DSC 100
00037 #define MAX_NUMBER_COFFICIENTS 6
00038 #define HMIKER_ID_TYPE "HMIKER"
00039 #define AIAKER_ID_TYPE "AIAKER"
00040 #define HMI_ID_TYPE "HMI"
00041 #define AIA_ID_TYPE "AIA"
00042 #define IRIS_ID_TYPE "IRIS"
00043 #define OTHER_ID_TYPE "SSIM"
00044 #define MAX_PACKET_ID_TYPE 100
00045 #define HK_MAX_TLM_NAME 200
00046 #define HK_LR_HMI_KER_TELEM 5
00047 #define HK_LR_HMI_ISP 29
00048 #define HK_LR_HMI_SEQ 21
00049 #define HK_LR_HMI_OBT 18
00050 #define HK_LR_AIA_KER_TELEM 37
00051 #define HK_LR_AIA_ISP 39
00052 #define HK_LR_AIA_SEQ 46
00053 #define HK_LR_AIA_OBT 50
00054 #define HK_LR_SDO_ASD 129
00055 #define HK_HSB_IRIS_ISP 56
00056 #define HK_HSB_HMI_ISP_1 445
00057 #define HK_HSB_HMI_ISP_2 475
00058 #define HK_HSB_HMI_SEQ_1 451
00059 #define HK_HSB_HMI_SEQ_2 481
00060 #define HK_HSB_HMI_OBT_1 448
00061 #define HK_HSB_HMI_OBT_2 478
00062 #define HK_HSB_AIA_ISP_1 529
00063 #define HK_HSB_AIA_ISP_2 569
00064 #define HK_HSB_AIA_SEQ_1 536
00065 #define HK_HSB_AIA_SEQ_2 576
00066 #define HK_HSB_AIA_OBT_1 540
00067 #define HK_HSB_AIA_OBT_2 580
00068 #define HK_LR_HMI_LRANGE 1
00069 #define HK_LR_HMI_HRANGE 31
00070 #define HK_HSB_HMI_LRANGE 400
00071 #define HK_HSB_HMI_HRANGE 499
00072 #define HK_LR_AIA_LRANGE 32
00073 #define HK_LR_AIA_HRANGE 64
00074 #define HK_HSB_AIA_LRANGE 500
00075 #define HK_HSB_AIA_HRANGE 599
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085 typedef struct APID_Pointer_HK_Configs_struct
00086 {
00087 char apid_name[10];
00088 int apid;
00089 struct HK_Config_Files_struct *ptr_hk_configs;
00090
00091 struct APID_Pointer_HK_Configs_struct *next;
00092 } APID_Pointer_HK_Configs;
00093
00094
00095
00096
00097
00098 typedef struct HK_Config_Files_struct
00099 {
00100 char apid_name[10];
00101 int apid_number;
00102 char packet_id_type[MAX_PACKET_ID_TYPE];
00103 char file_version_number[MAX_CHAR_VERSION_NUMBER];
00104
00105 char parameter_version_number[MAX_CHAR_VERSION_NUMBER];
00106
00107 char date[MAX_DATE_SIZE];
00108 int number_bytes_used;
00109 struct Keyword_Parameter_struct *keywords;
00110
00111 struct HK_Config_Files_struct *next;
00112 } HK_Config_Files;
00113
00114
00115
00116
00117
00118
00119 typedef struct ALG_Conversion_struct
00120 {
00121 int number_of_coeffs;
00122 double coeff [MAX_NUMBER_COFFICIENTS];
00123 } ALG_Conversion;
00124
00125 typedef struct DSC_Conversion_struct
00126 {
00127 int low_range;
00128 int high_range;
00129 char dsc_value[MAX_VALUE_DSC];
00130 struct DSC_Conversion_struct *next;
00131 } DSC_Conversion;
00132
00133
00134
00135
00136
00137 typedef struct Keyword_Parameter_struct {
00138 char telemetry_mnemonic_name[MAX_HK_MNM];
00139
00140
00141 char keyword_name[MAX_HK_KYWD];
00142
00143
00144 int start_byte;
00145 int start_bit_number;
00146 int bit_length;
00147
00148 char conv_type;
00149 char type[MAX_HK_VALUE_TYPE];
00150
00151 struct ALG_Conversion_struct *alg_ptr;
00152 struct DSC_Conversion_struct *dsc_ptr;
00153 struct Keyword_Parameter_struct *next;
00154 } Keyword_Parameter;
00155
00156
00157
00158 typedef struct APID_HKPFD_Files_struct
00159 {
00160 char version_number[MAX_CHAR_VERSION_NUMBER];
00161 int apid;
00162 char apid_name[10];
00163 char directory_name[MAX_DIRECTORY_NAME];
00164 char filename[MAX_FILE_NAME];
00165 struct APID_HKPFD_Files_struct *next;
00166 } APID_HKPFD_Files;
00167
00168
00169
00170 typedef struct GTCIDS_Version_Number_struct
00171 {
00172 char file_version_number[MAX_CHAR_VERSION_NUMBER];
00173 char hmi_id_version_number[MAX_CHAR_VERSION_NUMBER];
00174 char aia_id_version_number[MAX_CHAR_VERSION_NUMBER];
00175 char ker_id_version_number[MAX_CHAR_VERSION_NUMBER];
00176 char change_date[MAX_SIZE_CHANGE_DATE];
00177 char change_time[MAX_SIZE_CHANGE_TIME];
00178 struct GTCIDS_Version_Number_struct *next;
00179 } GTCIDS_Version_Number;
00180
00181
00182
00183 typedef struct SHCIDS_Version_Number_struct
00184 {
00185 char file_version_number[MAX_CHAR_VERSION_NUMBER];
00186 int apid;
00187 char change_date[MAX_SIZE_CHANGE_DATE];
00188 int date;
00189 char change_time[MAX_SIZE_CHANGE_TIME];
00190 struct SHCIDS_Version_Number_struct *next;
00191 } SHCIDS_Version_Number;
00192
00193
00194 APID_HKPFD_Files* read_all_hk_config_files(int apid, char file_version_number[],char packet_version_number[]);
00195
00196 void load_config_data( APID_HKPFD_Files* , APID_Pointer_HK_Configs* );
00197 int save_hdpf_new_formats(FILE* file_ptr,APID_Pointer_HK_Configs *ptr);
00198 int update_hdpf_new_formats(FILE* file_ptr, HK_Config_Files *ptr_config_node,
00199 HK_Config_Files *top_ptr_config_node);
00200 int load_hdpf_keyword_lines(char keyword_lines[MAX_NUM_KW_LINES][MAXLINE_IN_FILE], int i, HK_Config_Files *ptr_config_node);
00201 int load_hdpf_dsc_lines(char dsc_lines[MAX_NUM_DCON_LINES][MAXLINE_DCON_IN_FILE], int j, HK_Config_Files *ptr_config_node);
00202 int load_hdpf_alg_lines(char alg_lines[MAX_NUM_ACON_LINES][MAXLINE_ACON_IN_FILE], int k, HK_Config_Files *ptr_config_node);
00203 DSC_Conversion* create_hdpf_dsc_nodes(Keyword_Parameter *ptr_hk_keyword);
00204 Keyword_Parameter* create_hdpf_keyword_nodes(HK_Config_Files *ptr_hk_config_node,int number_of_lines);
00205 GTCIDS_Version_Number * read_gtcids_hk_file();
00206 SHCIDS_Version_Number * read_shcids_hk_file();
00207 int load_all_apids_hk_configs(int apid, char version_number[], char pkt_date[]);
00208 void deallocate_apid_ptr_hk_config_nodes(void);
00209 void deallocate_GTCIDS_Version_Number(void);
00210 void deallocate_SHCIDS_Version_Number(void);
00211 HK_Config_Files* check_packet_version_number( HK_Config_Files *top_ptr_to_configs,
00212 char *version_number );
00213 HK_Config_Files* check_file_version_number( HK_Config_Files *top_ptr_to_configs,
00214 char *version_number );
00215 HK_Config_Files * reread_all_files(APID_Pointer_HK_Configs *apid_ptr, char version_number[], char pkt_date[]);
00216 int check_free_configs_flag(void);
00217 int (*printkerr)(const char *fmt, ...);
00218
00219
00220 #ifndef LOAD_HK_C
00221 extern APID_Pointer_HK_Configs *gb_top_apid_ptr_hk_configs;
00222 #endif
00223
00224 #endif