include/nmxp_chan.h

Go to the documentation of this file.
00001 
00014 #ifndef NMXP_CHAN_H
00015 #define NMXP_CHAN_H 1
00016 
00017 #include <stdint.h>
00018 
00020 typedef struct NMXP_META_CHAN_LIST {
00021     int32_t key;
00022     char name[12];
00023     int32_t start_time;
00024     int32_t end_time;
00025     char network[12];
00026     struct NMXP_META_CHAN_LIST *next;
00027 } NMXP_META_CHAN_LIST;
00028 
00029 typedef enum {
00030     NMXP_META_SORT_KEY = 1,
00031     NMXP_META_SORT_NAME,
00032     NMXP_META_SORT_START_TIME,
00033     NMXP_META_SORT_END_TIME
00034 } NMXP_META_CHAN_LIST_SORT_TYPE;
00035 
00036 
00038 #define MAX_N_CHAN 2000
00039 
00041 typedef struct {
00042     int32_t key;
00043     char name[24];
00044 } NMXP_CHAN_KEY_NET;
00045 
00047 typedef struct {
00048     int32_t number;
00049     NMXP_CHAN_KEY_NET channel[MAX_N_CHAN];
00050 } NMXP_CHAN_LIST_NET;
00051 
00053 typedef struct {
00054     int32_t key;
00055     char name[12];
00056 } NMXP_CHAN_KEY;
00057 
00059 typedef struct {
00060     int32_t number;
00061     NMXP_CHAN_KEY channel[MAX_N_CHAN];
00062 } NMXP_CHAN_LIST;
00063 
00065 typedef struct {
00066     int32_t key;
00067     char name[12];
00068     int32_t start_time;
00069     int32_t end_time;
00070 } NMXP_CHAN_PRECISITEM;
00071 
00073 typedef struct {
00074     int32_t number;
00075     NMXP_CHAN_PRECISITEM channel[MAX_N_CHAN];
00076 } NMXP_CHAN_PRECISLIST;
00077 
00079 typedef enum {
00080     NMXP_DATA_TIMESERIES        = 1,
00081     NMXP_DATA_SOH               = 2,
00082     NMXP_DATA_TRANSERIAL        = 6
00083 } NMXP_DATATYPE;
00084 
00086 typedef struct {
00087     int32_t instr_id;
00088     NMXP_DATATYPE datatype;
00089     int32_t type_of_channel;
00090 } NMXP_PRECISLISTREQUEST;
00091 
00093 typedef struct {
00094     int32_t key;
00095     char name[12];
00096     char network[12];
00097 } NMXP_CHANNELINFORESPONSE;
00098 
00100 typedef struct {
00101     int32_t key;
00102     int32_t ignored;
00103 } NMXP_CHANNELINFOREQUEST;
00104 
00105 
00107 #define sep_chan_list  ','
00108 
00109 
00111 #define getDataTypeFromKey(key) ((key >> 8) & 0xff)
00112 
00114 #define getChannelNumberFromKey(key) ((key) & 0x000f)
00115 
00116 
00117 
00131 int nmxp_chan_cpy_sta_chan(const char *net_dot_station_dot_channel, char *station_code, char *channel_code, char *network_code);
00132 
00133 
00145 int nmxp_chan_match(const char *net_dot_station_dot_channel, char *pattern);
00146 
00147 
00148 
00157 int nmxp_chan_lookupKey(char* name, NMXP_CHAN_LIST *channelList);
00158 
00159 
00168 int nmxp_chan_lookupKeyIndex(int32_t key, NMXP_CHAN_LIST_NET *channelList);
00169 
00170 
00179 char *nmxp_chan_lookupName(int32_t key, NMXP_CHAN_LIST_NET *channelList);
00180 
00181 
00192 NMXP_CHAN_LIST *nmxp_chan_getType(NMXP_CHAN_LIST *channelList, NMXP_DATATYPE dataType);
00193 
00194 
00207 NMXP_CHAN_LIST_NET *nmxp_chan_subset(NMXP_CHAN_LIST *channelList, NMXP_DATATYPE dataType, char *sta_chan_list, const char *network_code_default);
00208 
00209 
00215 void nmxp_chan_sortByKey(NMXP_CHAN_LIST *channelList);
00216 
00217 
00223 void nmxp_chan_sortByName(NMXP_CHAN_LIST *channelList);
00224 
00225 
00231 void nmxp_chan_print_channelList(NMXP_CHAN_LIST *channelList);
00232 
00233 
00240 void nmxp_chan_print_channelList_with_match(NMXP_CHAN_LIST *channelList, char *sta_chan_list);
00241 
00242 
00248 void nmxp_chan_print_netchannelList(NMXP_CHAN_LIST_NET *channelList);
00249 
00250 
00251 void nmxp_meta_chan_free(NMXP_META_CHAN_LIST **chan_list);
00252 
00253 NMXP_META_CHAN_LIST *nmxp_meta_chan_add(NMXP_META_CHAN_LIST **chan_list, int32_t key, char *name, int32_t start_time, int32_t end_time, char *network, NMXP_META_CHAN_LIST_SORT_TYPE sorttype);
00254 
00255 NMXP_META_CHAN_LIST *nmxp_meta_chan_search_key(NMXP_META_CHAN_LIST *chan_list, int32_t key);
00256 
00257 NMXP_META_CHAN_LIST *nmxp_meta_chan_set_name(NMXP_META_CHAN_LIST *chan_list, int32_t key, char *name);
00258 
00259 NMXP_META_CHAN_LIST *nmxp_meta_chan_set_times(NMXP_META_CHAN_LIST *chan_list, int32_t key, int32_t start_time, int32_t end_time);
00260 
00261 NMXP_META_CHAN_LIST *nmxp_meta_chan_set_network(NMXP_META_CHAN_LIST *chan_list, int32_t key, char *network);
00262 
00263 void nmxp_meta_chan_print(NMXP_META_CHAN_LIST *chan_list);
00264 
00265 void nmxp_meta_chan_print_with_match(NMXP_META_CHAN_LIST *chan_list, char *sta_chan_list);
00266 
00267 #endif
00268 

Generated on Wed Jul 23 02:18:04 2008 for libnmxp by  doxygen 1.5.3