1 | |
---|
2 | /* file globalparams.h |
---|
3 | * ============== |
---|
4 | * |
---|
5 | * $Revision: 42 $, $Date: 2008-10-13 22:51:21 +0200 (Mo, 13 Okt 2008) $ |
---|
6 | * |
---|
7 | * Management of global parameters |
---|
8 | * K. Stammler, 9-May-2006 |
---|
9 | */ |
---|
10 | |
---|
11 | |
---|
12 | /* |
---|
13 | * |
---|
14 | * SeismicHandler, seismic analysis software |
---|
15 | * Copyright (C) 1996, Klaus Stammler, Federal Institute for Geosciences |
---|
16 | * and Natural Resources (BGR), Germany |
---|
17 | * |
---|
18 | * This program is free software; you can redistribute it and/or modify |
---|
19 | * it under the terms of the GNU General Public License as published by |
---|
20 | * the Free Software Foundation; either version 2 of the License, or |
---|
21 | * (at your option) any later version. |
---|
22 | * |
---|
23 | * This program is distributed in the hope that it will be useful, |
---|
24 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
25 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
26 | * GNU General Public License for more details. |
---|
27 | * |
---|
28 | * You should have received a copy of the GNU General Public License |
---|
29 | * along with this program; if not, write to the Free Software |
---|
30 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
---|
31 | * |
---|
32 | */ |
---|
33 | |
---|
34 | |
---|
35 | #define cGp_TEXTVARLTH 131 |
---|
36 | #define cGp_VERSION 1 |
---|
37 | #define cGp_SUBVERSION 0 |
---|
38 | |
---|
39 | /* normalisation modes */ |
---|
40 | #define cGp_NORM_UNDEF 0 |
---|
41 | #define cGp_NORM_CONST 1 |
---|
42 | #define cGp_NORM_AW 2 |
---|
43 | #define cGp_NORM_SW 3 |
---|
44 | #define cGp_NORM_MAXVAL 3 |
---|
45 | |
---|
46 | |
---|
47 | /* integer variables |
---|
48 | * ----------------- |
---|
49 | */ |
---|
50 | |
---|
51 | typedef enum { |
---|
52 | cGpI_debug_level, |
---|
53 | cGpI_parfile_version, |
---|
54 | cGpI_parfile_subversion, |
---|
55 | cGpI_min_drag_box_width, |
---|
56 | cGpI_double_click_time, |
---|
57 | cGpI_x_max_drawlth, |
---|
58 | cGpI_drag_box_rubber_val, |
---|
59 | cGpI_default_quality, |
---|
60 | cGpI_default_event_type, |
---|
61 | cGpI_default_phase_flags, |
---|
62 | cGpI_default_depth_type, |
---|
63 | cGpI_default_loc_quality, |
---|
64 | cGpI_max_cursor_form, |
---|
65 | cGpI_top_margin, |
---|
66 | cGpI_parameter_box_x, |
---|
67 | cGpI_parameter_box_y, |
---|
68 | cGpI_parameter_box_w, |
---|
69 | cGpI_parameter_box_h, |
---|
70 | cGpI_phase_box_x, |
---|
71 | cGpI_phase_box_y, |
---|
72 | cGpI_phase_box_w, |
---|
73 | cGpI_phase_box_h, |
---|
74 | cGpI_window_main_x, |
---|
75 | cGpI_window_main_y, |
---|
76 | cGpI_window_main_w, |
---|
77 | cGpI_window_main_h, |
---|
78 | cGpI_single_trace_box_x, |
---|
79 | cGpI_single_trace_box_y, |
---|
80 | cGpI_single_trace_box_w, |
---|
81 | cGpI_single_trace_box_h, |
---|
82 | cGpI_window_border, |
---|
83 | cGpI_draw_area_width, |
---|
84 | cGpI_draw_area_height, |
---|
85 | cGpI_trace_normalisation, |
---|
86 | cGpI_spectrogram_width, |
---|
87 | cGpI_spectrogram_step, |
---|
88 | cGpI_keysym_arrow_up, |
---|
89 | cGpI_keysym_arrow_down, |
---|
90 | cGpI_keysym_arrow_left, |
---|
91 | cGpI_keysym_arrow_right, |
---|
92 | cGpI_last |
---|
93 | } TGpIntIndex; |
---|
94 | |
---|
95 | |
---|
96 | /* float variables |
---|
97 | * ----------------- |
---|
98 | */ |
---|
99 | |
---|
100 | typedef enum { |
---|
101 | cGpF_close_phase_resol, |
---|
102 | cGpF_phase_ampl_diff, |
---|
103 | cGpF_trace_zoom_base, |
---|
104 | cGpF_trace_zoom_exp, |
---|
105 | cGpF_area_zoom_base, |
---|
106 | cGpF_area_zoom_exp, |
---|
107 | cGpF_move_wdw_step, |
---|
108 | cGpF_default_depth, |
---|
109 | cGpF_colour_fg_red, |
---|
110 | cGpF_colour_fg_green, |
---|
111 | cGpF_colour_fg_blue, |
---|
112 | cGpF_colour_bg_red, |
---|
113 | cGpF_colour_bg_green, |
---|
114 | cGpF_colour_bg_blue, |
---|
115 | cGpF_colour_dialog_fg_red, |
---|
116 | cGpF_colour_dialog_fg_green, |
---|
117 | cGpF_colour_dialog_fg_blue, |
---|
118 | cGpF_colour_dialog_bg0_red, |
---|
119 | cGpF_colour_dialog_bg0_green, |
---|
120 | cGpF_colour_dialog_bg0_blue, |
---|
121 | cGpF_colour_dialog_bg1_red, |
---|
122 | cGpF_colour_dialog_bg1_green, |
---|
123 | cGpF_colour_dialog_bg1_blue, |
---|
124 | cGpF_colour_dialog_bg2_red, |
---|
125 | cGpF_colour_dialog_bg2_green, |
---|
126 | cGpF_colour_dialog_bg2_blue, |
---|
127 | cGpF_colour_mark_red, |
---|
128 | cGpF_colour_mark_green, |
---|
129 | cGpF_colour_mark_blue, |
---|
130 | cGpF_colour_mark0_red, |
---|
131 | cGpF_colour_mark0_green, |
---|
132 | cGpF_colour_mark0_blue, |
---|
133 | cGpF_colour_theo_red, |
---|
134 | cGpF_colour_theo_green, |
---|
135 | cGpF_colour_theo_blue, |
---|
136 | cGpF_colour_auto_red, |
---|
137 | cGpF_colour_auto_green, |
---|
138 | cGpF_colour_auto_blue, |
---|
139 | cGpF_colour_crsr_red, |
---|
140 | cGpF_colour_crsr_green, |
---|
141 | cGpF_colour_crsr_blue, |
---|
142 | cGpF_colour_alert_red, |
---|
143 | cGpF_colour_alert_green, |
---|
144 | cGpF_colour_alert_blue, |
---|
145 | cGpF_colour_addfil_red, |
---|
146 | cGpF_colour_addfil_green, |
---|
147 | cGpF_colour_addfil_blue, |
---|
148 | cGpF_calib_wdw_width, |
---|
149 | cGpF_calib_wdw_height, |
---|
150 | cGpF_calib_azimuth_grid, |
---|
151 | cGpF_calib_slowness_grid, |
---|
152 | cGpF_sn_noise_start, |
---|
153 | cGpF_sn_noise_end, |
---|
154 | cGpF_sn_signal_start, |
---|
155 | cGpF_sn_signal_end, |
---|
156 | cGpF_idphases_tol_trav, |
---|
157 | cGpF_idphases_tol_travsurf, |
---|
158 | cGpF_idphases_tol_slow, |
---|
159 | cGpF_idphases_tol_azim, |
---|
160 | cGpF_axis_label_rounding, |
---|
161 | cGpF_last |
---|
162 | } TGpFloatIndex; |
---|
163 | |
---|
164 | |
---|
165 | /* char variables |
---|
166 | * ----------------- |
---|
167 | */ |
---|
168 | |
---|
169 | typedef enum { |
---|
170 | cGpC_filter_type, |
---|
171 | cGpC_last |
---|
172 | } TGpCharIndex; |
---|
173 | |
---|
174 | |
---|
175 | /* string variables |
---|
176 | * ----------------- |
---|
177 | */ |
---|
178 | |
---|
179 | typedef enum { |
---|
180 | cGpS_defpath_events, |
---|
181 | cGpS_defpath_gse, |
---|
182 | cGpS_defpath_ah, |
---|
183 | cGpS_defpath_q, |
---|
184 | cGpS_defpath_evid, |
---|
185 | cGpS_defpath_evtout, |
---|
186 | cGpS_defpath_data, |
---|
187 | cGpS_defpath_help, |
---|
188 | cGpS_defpath_errors, |
---|
189 | cGpS_defpath_userdir, |
---|
190 | cGpS_defpath_extprog, |
---|
191 | cGpS_analyst, |
---|
192 | cGpS_list_of_analysts, |
---|
193 | cGpS_texteditor, |
---|
194 | cGpS_refstation, |
---|
195 | cGpS_list_of_refstations, |
---|
196 | cGpS_default_filter, |
---|
197 | cGpS_minmax_format, |
---|
198 | cGpS_default_source, |
---|
199 | cGpS_auto_phase, |
---|
200 | cGpS_depth_phase_list, |
---|
201 | cGpS_theo_phase_list, |
---|
202 | cGpS_diff_phase_list, |
---|
203 | cGpS_event_check_proc, |
---|
204 | cGpS_screendump_proc, |
---|
205 | cGpS_evtview_proc, |
---|
206 | cGpS_reformat_proc, |
---|
207 | cGpS_final_proc, |
---|
208 | cGpS_motif_log, |
---|
209 | cGpS_ftp_address, |
---|
210 | cGpS_ftp_path, |
---|
211 | cGpS_exclusive_agency, |
---|
212 | cGpS_sfdb_command, |
---|
213 | cGpS_sfdb_exec_qual, |
---|
214 | cGpS_sfdb_trailer, |
---|
215 | cGpS_last |
---|
216 | } TGpStringIndex; |
---|
217 | |
---|
218 | |
---|
219 | /* boolean variables |
---|
220 | * ----------------- |
---|
221 | */ |
---|
222 | |
---|
223 | typedef enum { |
---|
224 | cGpB_top_down_order, |
---|
225 | cGpB_autopick_first, |
---|
226 | cGpB_auto_scaling, |
---|
227 | cGpB_prompt_analyst, |
---|
228 | cGpB_reverse_xors, |
---|
229 | cGpB_full_phase_names, |
---|
230 | cGpB_own_accelerators, |
---|
231 | cGpB_small_menu_font, |
---|
232 | cGpB_recover_evid, |
---|
233 | cGpB_overwrite_string_lists, |
---|
234 | cGpB_ignore_data_lock, |
---|
235 | cGpB_reads_swap, |
---|
236 | cGpB_reads_invhdr, |
---|
237 | cGpB_autosort_by_distance, |
---|
238 | cGpB_last |
---|
239 | } TGpBooleanIndex; |
---|
240 | |
---|
241 | |
---|
242 | /* string list variables |
---|
243 | * --------------------- |
---|
244 | */ |
---|
245 | |
---|
246 | typedef enum { |
---|
247 | cGpL_station_info_file, |
---|
248 | cGpL_filter_lookup_table, |
---|
249 | cGpL_sensitivity_file, |
---|
250 | cGpL_defpath_filter, |
---|
251 | cGpL_defpath_command, |
---|
252 | cGpL_defpath_globals, |
---|
253 | cGpL_last |
---|
254 | } TGpStringListIndex; |
---|
255 | |
---|
256 | |
---|
257 | /* text list definition */ |
---|
258 | |
---|
259 | typedef struct { |
---|
260 | int numelem; /* number of elements */ |
---|
261 | char **elem; /* elements of list*/ |
---|
262 | char *mem; /* memory for all elements of text list */ |
---|
263 | } TGpTextList; |
---|
264 | |
---|
265 | |
---|
266 | |
---|
267 | /*----------------------------------------------------------------------------*/ |
---|
268 | |
---|
269 | |
---|
270 | void GpReadParfile( void ); |
---|
271 | |
---|
272 | /* Reads parameters from file |
---|
273 | * |
---|
274 | * no parameters passed |
---|
275 | */ |
---|
276 | |
---|
277 | |
---|
278 | /*----------------------------------------------------------------------------*/ |
---|
279 | |
---|
280 | |
---|
281 | int GpGetInt( TGpIntIndex idx ); |
---|
282 | |
---|
283 | /* Returns integer valued global |
---|
284 | * |
---|
285 | * parameters of routine |
---|
286 | * TGpIntIndex idx; input; index of variable |
---|
287 | * returns value of variable |
---|
288 | */ |
---|
289 | |
---|
290 | |
---|
291 | /*----------------------------------------------------------------------------*/ |
---|
292 | |
---|
293 | |
---|
294 | float GpGetFloat( TGpFloatIndex idx ); |
---|
295 | |
---|
296 | /* Returns float valued global |
---|
297 | * |
---|
298 | * parameters of routine |
---|
299 | * TGpFloatIndex idx; input; index of variable |
---|
300 | * returns value of variable |
---|
301 | */ |
---|
302 | |
---|
303 | |
---|
304 | /*----------------------------------------------------------------------------*/ |
---|
305 | |
---|
306 | |
---|
307 | char GpGetChar( TGpCharIndex idx ); |
---|
308 | |
---|
309 | /* Returns char valued global |
---|
310 | * |
---|
311 | * parameters of routine |
---|
312 | * TGpCharIndex idx; input; index of variable |
---|
313 | * returns value of variable |
---|
314 | */ |
---|
315 | |
---|
316 | |
---|
317 | /*----------------------------------------------------------------------------*/ |
---|
318 | |
---|
319 | |
---|
320 | char *GpGetString( TGpStringIndex idx ); |
---|
321 | |
---|
322 | /* Returns pointer to string valued global |
---|
323 | * |
---|
324 | * parameters of routine |
---|
325 | * TGpStringIndex idx; input; index of variable |
---|
326 | * returns value of variable |
---|
327 | */ |
---|
328 | |
---|
329 | |
---|
330 | /*----------------------------------------------------------------------------*/ |
---|
331 | |
---|
332 | |
---|
333 | int GpGetBoolean( TGpBooleanIndex idx ); |
---|
334 | |
---|
335 | /* Returns boolean valued global |
---|
336 | * |
---|
337 | * parameters of routine |
---|
338 | * TGpBooleanIndex idx; input; index of variable |
---|
339 | * returns value of variable |
---|
340 | */ |
---|
341 | |
---|
342 | |
---|
343 | /*----------------------------------------------------------------------------*/ |
---|
344 | |
---|
345 | |
---|
346 | char *GpGetStringElem( TGpStringListIndex idx, int elemnum ); |
---|
347 | |
---|
348 | /* returns string element number elemnum from string list idx |
---|
349 | * |
---|
350 | * parameters of routine |
---|
351 | * TGpStringListIndex idx; input; index numer of string list |
---|
352 | * int elemnum; input; number of string in list (start with 0) |
---|
353 | * returns string address or NULL |
---|
354 | */ |
---|
355 | |
---|
356 | |
---|
357 | /*----------------------------------------------------------------------------*/ |
---|
358 | |
---|
359 | |
---|
360 | void GpSetInt( TGpIntIndex idx, int value ); |
---|
361 | |
---|
362 | /* Sets integer valued global |
---|
363 | * |
---|
364 | * parameters of routine |
---|
365 | * TGpIntIndex idx; input; index of variable |
---|
366 | * int value; input; new value of variable |
---|
367 | */ |
---|
368 | |
---|
369 | |
---|
370 | /*----------------------------------------------------------------------------*/ |
---|
371 | |
---|
372 | |
---|
373 | void GpSetFloat( TGpFloatIndex idx, float value ); |
---|
374 | |
---|
375 | /* Sets float valued global |
---|
376 | * |
---|
377 | * parameters of routine |
---|
378 | * TGpFloatIndex idx; input; index of variable |
---|
379 | * float value; input; new value of variable |
---|
380 | */ |
---|
381 | |
---|
382 | |
---|
383 | /*----------------------------------------------------------------------------*/ |
---|
384 | |
---|
385 | |
---|
386 | void GpSetChar( TGpCharIndex idx, char value ); |
---|
387 | |
---|
388 | /* Sets char valued global |
---|
389 | * |
---|
390 | * parameters of routine |
---|
391 | * TGpCharIndex idx; input; index of variable |
---|
392 | * char value; input; new value of variable |
---|
393 | */ |
---|
394 | |
---|
395 | |
---|
396 | /*----------------------------------------------------------------------------*/ |
---|
397 | |
---|
398 | |
---|
399 | void GpSetString( TGpStringIndex idx, char str[], int *ok ); |
---|
400 | |
---|
401 | /* Sets value of string valued global variable |
---|
402 | * |
---|
403 | * parameters of routine |
---|
404 | * TGpStringIndex idx; input; index of variable |
---|
405 | * char str[]; input; new value of variable |
---|
406 | * int *ok; output (if not NULL); 1 = ok, 0 = failure |
---|
407 | */ |
---|
408 | |
---|
409 | |
---|
410 | /*----------------------------------------------------------------------------*/ |
---|
411 | |
---|
412 | |
---|
413 | void GpSetBoolean( TGpBooleanIndex idx, int value ); |
---|
414 | |
---|
415 | /* Sets boolean valued global |
---|
416 | * |
---|
417 | * parameters of routine |
---|
418 | * TGpBooleanIndex idx; input; index of variable |
---|
419 | * int value; input; new value of variable |
---|
420 | */ |
---|
421 | |
---|
422 | |
---|
423 | /*----------------------------------------------------------------------------*/ |
---|
424 | |
---|
425 | |
---|
426 | void GpReadParameter( char parname[], int maxlth, char value[], int *ok ); |
---|
427 | |
---|
428 | /* Reads parameter of name parname from parameter file. |
---|
429 | * |
---|
430 | * parameters of routine |
---|
431 | * char parname[]; input, name of parameter |
---|
432 | * int maxlth; input; maximum length of output string |
---|
433 | * char value[]; output; value of parameter |
---|
434 | * int *ok; output; 1=ok, 0=not found or string too short |
---|
435 | */ |
---|
436 | |
---|
437 | |
---|
438 | /*----------------------------------------------------------------------------*/ |
---|
439 | |
---|
440 | |
---|
441 | void GpParseTextList( char str[], TGpTextList *tl ); |
---|
442 | |
---|
443 | /* Parses comma separated text string and returns pointers to elements of list. |
---|
444 | * Returns data structure must be freed after use (GpFreeTextList). |
---|
445 | * |
---|
446 | * parameters of routine |
---|
447 | * char str[]; input; input string to be parsed |
---|
448 | * GpTextList *tl; output; elements of list |
---|
449 | */ |
---|
450 | |
---|
451 | |
---|
452 | /*----------------------------------------------------------------------------*/ |
---|
453 | |
---|
454 | |
---|
455 | void GpParseStringList( TGpStringListIndex idx, char line[] ); |
---|
456 | |
---|
457 | /* parses string list and puts result to list number idx |
---|
458 | * |
---|
459 | * parameters of routine |
---|
460 | * TGpStringListIndex idx; input; string list variable index |
---|
461 | * char line[]; input; line to be parsed |
---|
462 | */ |
---|
463 | |
---|
464 | |
---|
465 | /*----------------------------------------------------------------------------*/ |
---|
466 | |
---|
467 | |
---|
468 | void GpFreeTextList( TGpTextList *tl ); |
---|
469 | |
---|
470 | /* Frees memory of textlist |
---|
471 | * |
---|
472 | * parameters of routine |
---|
473 | * TGpTextList modify; text list to be freed |
---|
474 | */ |
---|
475 | |
---|
476 | |
---|
477 | /*----------------------------------------------------------------------------*/ |
---|
478 | |
---|
479 | |
---|
480 | void GpDumpParams( void ); |
---|
481 | |
---|
482 | /* write all parameters out to stdout |
---|
483 | * |
---|
484 | * no parameters passed |
---|
485 | * |
---|
486 | */ |
---|
487 | |
---|
488 | |
---|
489 | /*----------------------------------------------------------------------------*/ |
---|