72 #ifndef METEO_DB_DEFINITION
73 #define METEO_DB_DEFINITION
76 #define MDB_SIGN "MDB_2.0"
86 #define MDB_WRITE UPDATE
92 #define MDB_RECOVERY 7L
94 #define MDB_PAR_SYS_KEEP 1L
95 #define MDB_PAR_KEEP 2L
96 #define MDB_PAR_BUSY 3L
97 #define MDB_PAR_BACKUP 4L
100 #define MDB_ENCODE 0L
101 #define MDB_DECODE 1L
114 #define ACC_by_OFFSET 3
115 #define ACC_by_NAME 4
124 #define DBP_GRAND_Z 1
125 #define DBP_GRAND_D 2
126 #define DBP_GRAND_V 4
127 #define DBP_GRAND_S 8
138 #define MOD_INT_AUT 0
139 #define MOD_INT_MAN 1
152 #define NO_COMPRESSION 0
153 #define HUFFMAN_COMPONENTS_COMPRESSION 1
166 #define MDB_max_e_type 9
167 typedef enum {DBP_IDX,
179 #define RASTER_IDX INT_PROD_IDX
184 #define E_DBP_NUM TOT_DBP*4
193 #define E_PRO_NUM E_RTP_NUM + E_SEP_NUM
194 #define E_RAT_NUM 200
195 #define E_UTRM_NUM 200
196 #define E_ARCHIVE_NUM 50
206 #define ONE_QUANT_DBP_SIZE 8 * 1024* 1024
207 #define ONE_DBP_SPACE QUANT_NUM * ONE_QUANT_DBP_SIZE
211 #define DBP_DATA_SPACE TOT_DBP * ONE_DBP_SPACE
212 #define RTP_DATA_SPACE E_RTP_NUM *400 *1024
213 #define SEP_DATA_SPACE E_SEP_NUM *400*1024
214 #define INP_DATA_SPACE E_INP_NUM *100*1024
215 #define DEC_DATA_SPACE 1
216 #define SEN_DATA_SPACE 1
217 #define CDS_DATA_SPACE 10 * 8 *30
218 #define PRO_DATA_SPACE RTP_DATA_SPACE + SEP_DATA_SPACE
219 #define RAT_DATA_SPACE E_RAT_NUM * 100 * 1024
220 #define UTRM_DATA_SPACE E_UTRM_NUM * 10 * 1024 +\
221 E_ARCHIVE_NUM * 600 *1024
223 #define SIAP_SEN_REC_NUM 72
224 #define CAE_SEN_REC_NUM 144
227 #define DATA_REC_SIZE 64*1024
231 #define EL_MAX_NUM 20
233 #define MAX_BEAM_SIZE 1024
238 #define MULTI_COMP_MAX_NUM MAX_COMP
239 #define MULTI_FILE_MAX_NUM 4
240 #define MAX_CLASS_TYPE 30
263 #define START_OF_SET_MARK 0xff
268 #define COMP_MAX_NUM 270
273 #define A_SET_MAX_NUM 10
286 #define DBP_DATA_TIMEOUT 5 *60
287 #define RTP_DATA_TIMEOUT 5 *60
298 #define FIND_FILE "/tmp/find.tmp"
304 #define SRI_SET_FILE "/proj/tmp/sel_sri.tmp"
305 #define VOL_ACQ_SRI 1
306 #define MATCH_SECT_SRI 2
313 #define HIGH_DATA_SIZE 1
314 #define LOW_DATA_SIZE 26
328 #define CLOSE_FILE 10
333 #define PROD_INFO_MSG_SIZE 1
334 #define FILE_NAME_MSG_SIZE 1
335 #define CLOSE_FILE_MSG_SIZE 1
340 #define MAX_NUM_AZ_BEAMS 500
347 #define INP_COMP_MAX_NUM 270
353 #define INP_SRT PROD_ID_SRT
354 #define INP_ART PROD_ID_ART
359 #define RAIN_VAL_NUM 6
364 unsigned char T_MDB_rt_prod_name [8];
368 unsigned char T_MDB_e_file_name[16];
371 unsigned char T_MDB_d_file_name[16];
387 unsigned char T_MDB_file_path[50];
390 unsigned char T_MDB_date[18];
403 char T_MDB_cds_annotation[21];
405 char T_MDB_annotation[52];
413 T_MDB_d_file_name name[MULTI_FILE_MAX_NUM];
414 T_MDB_d_file_name idx_name[MULTI_FILE_MAX_NUM];
428 char T_MDB_cds_file[A_SET_NUM *
sizeof(T_MDB_a_set_rec)];
445 T_MDB_num_date cre_date;
446 unsigned int d_file_size;
448 unsigned int busy_flag:1;
449 unsigned int keep_flag:1;
450 unsigned int sys_keep_flag:1;
451 unsigned int backup_flag:1;
452 unsigned int exp_flag:1;
453 unsigned int extr_type:2;
455 unsigned int del_status:2;
460 unsigned int prod_type:7;
463 unsigned int qualif:4;
481 unsigned int type_compression:2;
489 unsigned int counter:10;
491 unsigned int radar:7;
499 T_MDB_num_date cre_date;
500 unsigned int d_file_size;
501 unsigned int rec_offset;
503 unsigned short counter;
505 unsigned char prod_type;
506 unsigned char prod_class;
514 unsigned char qualif;
515 unsigned char type_compression;
516 unsigned char extr_type;
523 unsigned int scans_type:2;
530 unsigned int rot_vel:5;
533 unsigned int grand:4;
541 unsigned int resolution:3;
550 unsigned int vel_range:1;
556 unsigned int declutter_rsp:1;
559 unsigned int type_declutter:1;
561 unsigned int filter_value:4;
563 unsigned int corr_Z:1;
565 unsigned int num_imp:10;
569 unsigned int declutter_sw:3;
573 unsigned int quota_cut_sw:5;
575 unsigned int el_ini:12;
577 unsigned int el_fin:12;
580 unsigned int imp_duration:2;
586 unsigned int coverage:3;
596 unsigned int acq_count:10;
597 unsigned int acq_duration:10;
598 unsigned int prec_z:7;
600 unsigned int num_el:8;
605 unsigned int az_ini:12;
606 unsigned int az_fin:12;
608 unsigned int acq_date;
621 unsigned short num_el;
622 unsigned short num_az;
624 unsigned short coverage;
625 unsigned short num_imp;
627 unsigned short az_ini;
628 unsigned short az_fin;
630 unsigned short el_ini;
631 unsigned short el_fin;
633 unsigned short acq_duration;
634 unsigned short acq_count;
636 unsigned short value[30];
640 unsigned char declutter_rsp;
641 unsigned char type_declutter;
642 unsigned char filter_value;
644 unsigned char corr_Z;
645 unsigned char declutter_sw;
646 unsigned char quota_cut_sw;
647 unsigned char imp_duration;
649 unsigned char resolution;
650 unsigned char rot_vel;
651 unsigned char az_step;
652 unsigned char el_step;
654 unsigned char scans_type;
655 unsigned char vel_range;
657 unsigned char spare[1];
659 unsigned char prec[4];
666 unsigned int alt_azim:12;
671 unsigned int quadr:3;
675 unsigned int type_map:1;
679 unsigned int gray_level:2;
682 unsigned int num_pix_x:14;
684 unsigned short num_pix_y;
685 unsigned short num_pix_z;
687 unsigned char latitude[3];
688 unsigned char intitude[3];
690 unsigned short map_x_resolution;
691 unsigned short map_y_resolution;
692 unsigned short map_z_resolution;
694 }T_MDB_map_info_compr;
696 #define T_MDB_base_compr T_MDB_map_info_compr
699 unsigned int map_x_resolution;
700 unsigned int map_y_resolution;
701 unsigned int map_z_resolution;
703 unsigned short quadr;
704 unsigned short alt_azim;
706 unsigned short type_map;
707 unsigned short gray_level;
709 unsigned short num_pix_x;
710 unsigned short num_pix_y;
712 unsigned short num_pix_z;
713 unsigned short az_ini;
715 unsigned short az_fin;
716 unsigned short az_ini2;
718 unsigned short az_fin2;
720 unsigned char latitude[3];
721 unsigned char longitude[3];
726 #define T_MDB_base T_MDB_map_info;
732 unsigned int end_intgr;
733 unsigned short start_az,
735 unsigned short int_intgr;
736 unsigned short minuti_integrati;
742 unsigned int end_intgr;
743 unsigned short int_intgr;
744 unsigned short spare;
751 T_MDB_map_info_compr map;
752 }T_MDB_map_acq_e_rec;
754 #define T_MDB_rtp_e_rec T_MDB_map_acq_e_rec
755 #define T_MDB_sep_e_rec T_MDB_map_acq_e_rec
762 T_MDB_s_file_name s_file;
763 }T_MDB_pro_acq_e_rec;
765 #define T_MDB_dbp_e_rec T_MDB_pro_acq_e_rec
766 #define T_MDB_clu_e_rec T_MDB_pro_acq_e_rec
773 T_MDB_file_name file;
774 }T_MDB_pro_ut_maq_e_rec;
776 #define T_MDB_rat_e_rec T_MDB_pro_ut_maq_e_rec
777 #define T_MDB_maq_e_rec T_MDB_pro_ut_maq_e_rec
782 T_MDB_map_int int_inf;
783 T_MDB_map_info_compr map;
784 }T_MDB_map_int_e_rec;
786 #define T_MDB_srt_e_rec T_MDB_map_int_e_rec
793 T_MDB_pro_int int_inf;
794 T_MDB_file_name file_dip;
795 }T_MDB_pro_int_dip_e_rec;
797 #define T_MDB_art_e_rec T_MDB_pro_int_dip_e_rec
805 T_MDB_file_name file;
811 T_MDB_link_compr link;
814 T_MDB_map_acq_e_rec map_acq;
815 T_MDB_pro_acq_e_rec pro_acq;
816 T_MDB_pro_ut_maq_e_rec pro_ut_maq;
817 T_MDB_map_int_e_rec map_int;
818 T_MDB_pro_int_dip_e_rec pro_int_dip;
819 T_MDB_pro_ut_e_rec pro;
827 } T_MDB_idx_rec_head;
832 T_MDB_idx_rec_head head;
842 unsigned int avail_start;
843 unsigned int avail_end;
844 unsigned int free_start;
845 unsigned int free_end;
847 unsigned int e_rec_num;
848 unsigned int tot_d_space;
849 unsigned int av_d_space;
850 unsigned int acq_count;
852 }T_MDB_idx_file_header;
857 T_MDB_name_des names;
858 char spare[4-
sizeof(T_MDB_name_des)%4];
860 T_MDB_general general;
861 char spare1[4-
sizeof(T_MDB_general)%4];
864 char spare2[4-
sizeof(T_MAQ)%4];
869 T_MDB_file_name file_dip;
870 char spare4[4-
sizeof(T_MDB_file_name)%4];
872 T_MDB_map_int int_inf;
873 char spare5[4-
sizeof(T_MDB_map_int)%4];
875 T_MDB_annotation annotation;
876 char spare6[4-
sizeof(T_MDB_annotation)%4];
883 T_MDB_d_file_name comp[INP_COMP_MAX_NUM];
884 char spare[INP_COMP_MAX_NUM];
891 unsigned int inf[128];
897 T_MDB_d_file_name comp[INP_COMP_MAX_NUM];
898 char spare[INP_COMP_MAX_NUM];
905 #define STATUS_BIT_OFF 0
906 #define STATUS_BIT_ON 1
910 unsigned int to_create : 1;
911 unsigned int to_destroy : 1;
912 unsigned int to_save : 1;
913 unsigned int to_load : 1;
914 unsigned int saved : 1;
915 unsigned int modified : 1;
916 unsigned int loaded : 1;
917 unsigned int cannot_encode : 1;
918 unsigned int to_encode : 1;
919 unsigned int to_not_decode : 1;
920 unsigned int to_append : 1;
921 unsigned int resize : 3;
922 unsigned int spare :18;
928 #define MSDOS_CLASS 3
934 unsigned int pointer;
939 STATUS_mask status_mask;
940 unsigned char type_compression;
943 unsigned char environ;
947 unsigned char class_code;
953 unsigned char signature[9];
956 unsigned char environ;
959 unsigned short max_comp;
960 unsigned short max_class_type;
962 unsigned short n_comp;
964 CLASS_pointer compDesc[MAX_COMP+1];
972 CLASS_header class_header;
973 T_MDB_norm_e_rec norm;
976 #define T_MDB_acq_header T_MDB_data_header
1011 char el_list[EL_MAX_NUM];
1014 }T_MDB_286_acq_header;
1027 }T_MDB_286_pro_header;
1040 }T_MDB_ap_beam_header;
1055 unsigned char prod_type;
1056 unsigned char quadr;
1058 unsigned char extr_type;
1059 unsigned char type_compression;
1060 unsigned short gray_level;
1062 unsigned short alt_azim;
1063 unsigned short num_pix_x;
1064 unsigned short num_pix_y;
1065 unsigned short num_pix_z;
1067 float map_x_resolution;
1068 float map_y_resolution;
1069 float map_z_resolution;
1071 struct coord_descr latitudine;
1072 struct coord_descr intitudine;
1078 unsigned int newest_data;
1079 unsigned short int_intgr;
1080 unsigned short minuti_integrati;
1089 unsigned int d_file_size;
1090 unsigned int intgr_start_time;
1091 unsigned int intgr_end_time;
1092 unsigned int intgr_int;
1093 unsigned int coverage;
1109 }T_MDB_dbp_idx_info;
1111 T_MDB_dbp_idx_info *T_MDB_idx_array[4];
1126 typedef T_MDB_d_file_name T_MDB_comp_selection[COMP_MAX_NUM];
1140 T_MDB_link_compr link;
1148 typedef unsigned char T_MDB_data_rec [ DATA_REC_SIZE];
1161 unsigned char prod_name[5];
1162 unsigned char num_char_to_comp;
1175 short integration_int;
1179 } T_MDB_sri_selection;
1185 } T_MDB_sri_set_file_header;
1193 short tot_sri_db_num;
1195 short ok_sri_sat_num;
1197 } T_MDB_sri_search_info;
1203 T_MDB_d_file_name sri_name;
1204 unsigned short coverage;
1205 T_MDB_num_date time;
1207 } T_MDB_sri_sel_data;
1214 T_MDB_d_file_name name[A_SET_MAX_NUM];
1216 } T_MDB_a_set_list ;
1222 T_MDB_num_date acq_time;
1224 short rain_value[RAIN_VAL_NUM];
1225 } T_MDB_siap_sen_rec;
1228 typedef unsigned char T_MDB_sen_data_selection [RAIN_VAL_NUM];
1241 unsigned int e_rec_size;
1242 unsigned int e_rec_num;
1243 unsigned int tot_d_space;
1244 unsigned int av_d_space;
1245 unsigned int acq_count;
1246 }T_MDB_ms_file_header;
1266 int data_fd[MULTI_FILE_MAX_NUM];
1267 int idx_fd[MULTI_FILE_MAX_NUM];
1271 T_MDB_data_header *head;
1272 T_MDB_e_set_name e_type;
1273 unsigned int comp_read_off[MULTI_COMP_MAX_NUM];
1274 unsigned int comp_off[MULTI_COMP_MAX_NUM];
1281 int data_fd[MULTI_FILE_MAX_NUM];
1282 int idx_fd[MULTI_FILE_MAX_NUM];
1290 #define MAX_QUERY 10L
1296 #define ACQ_OLDEST 1L
1297 #define ACQ_NEWEST 2L
1298 #define CRE_OLDEST 4L
1299 #define CRE_NEWEST 8L
1309 #define TEST_LT_GT 7L
1310 #define TEST_LT_GE 8L
1311 #define TEST_LE_GT 9L
1312 #define TEST_LE_GE 10L
1313 #define TEST_GT_LT 11L
1314 #define TEST_GT_LE 12L
1315 #define TEST_GE_LT 13L
1316 #define TEST_GE_LE 14L
1319 #define PROD_NIL '\0'
1320 #define QUADR_NIL '\0'
1321 #define FILE_NIL '\0'
1322 #define QUOTA_NIL -1
1343 float int_azimuth[2];
1355 int map_x_resolution ;
1357 int map_z_resolution ;
1393 int int_azimuth_match ;
1395 float int_azimuth[2] ;
1397 int extr_type_match ;
1409 int x_copertura_match ;
1410 int x_copertura[2] ;
1412 int z_copertura_match ;
1413 int z_copertura[2] ;
1415 int map_x_resolution_match;
1416 int map_x_resolution;
1418 int map_z_resolution_match ;
1419 int map_z_resolution ;
1421 int type_map_match ;
1424 int gray_level_match ;
1436 }T_MDB_find_match_rec;