lib/App/SeismicUnixGui/messages/SuMessages.pm untested

filter: Statementstmt 0.0% 0 / 165 Branchbran 0.0% 0 / 48 Conditioncond 0.0% 0 / 12 MC/DCmcdc 0.0% 0 / 7 Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 7 totaltotal 0.0% 0 / 248 CC 25 SCAR 55.5
CC
25
Cov
0%
instructions
420.0
cdp_num
6.0
gather_header
6.0
CRAP 256.5
1 package App::SeismicUnixGui::messages::SuMessages;
2  
3 use Moose;
4 our $VERSION = '0.0.1';
5 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
6  
7 =head1 DOCUMENTATION
8  
9 =head2 SYNOPSIS
10 PERL PROGRAM NAME: SuMessages
11 AUTHOR: Juan Lorenzo
12 July 29 2015
13  
14 DESCRIPTION:
15 Version: 1.1
16 Version: 1.11 : June 12 2007
17 Include messages for
18 --interactive bottom mute
19 --interactive velocity analysis
20 -- TODO
21 Messages to users in Seismic unix programs
22  
23 =head2 USE
24  
25 =head3 NOTES
26  
27 =head4
28 Examples
29  
30 =head3 SEISMIC UNIX NOTES
31  
32 =head4 CHANGES and their DATES
33  
34 =cut
35  
36 =head2
37  
38 =head3 STEPS
39  
40 1. define the types of variables you are using
41 these would be the values you enter into
42 each of the Seismic Unix programs each of the
43 Seismic Unix programs
44  
45 2. build a list or hash with all the possible variable
46 names you may use and you can even change them
47  
48 =cut
49  
50 my $get = L_SU_global_constants->new();
51  
52 my $var = $get->var();
53 my $empty_string = $var->{_empty_string};
54 my $NaN = $var->{_NaN};
55  
56 =head2
57  
58 set defaults
59  
60 VELAN DATA
61 m/s
62  
63
64 =cut
65  
66 my $SuMessages = {
67 _cdp_num => '',
68 _gather_num => '',
69 _gather_type => '',
70 _gather_header => '',
71 _type => '',
72 _instructions => ''
73 };
74  
75 =head2 subroutine clear
76  
77 sets all variable strings to ''
78  
79 =cut
80  
81 sub clear {
82  
83 $SuMessages->{_cdp_num} = '';
84 $SuMessages->{_gather_num} = '';
85 $SuMessages->{_gather_type} = '';
86 $SuMessages->{_gather_header} = '';
87 $SuMessages->{_type} = '';
88 $SuMessages->{_instructions} = '';
89 }
90  
91 =head2 subroutine cdp_num
92  
93 sets cdp number to consider
94  
95 =cut
96  
97 sub cdp_num {
98 my ( $self, $cdp_num ) = @_;
99  
100 if ( defined $cdp_num ) {
101
102 $SuMessages->{_cdp_num} = $cdp_num;
103 $SuMessages->{_gather_num} = $cdp_num;
104 # print("\ncdp num is $SuMessages->{_cdp_num}\n");
105
106 }
107 else {
108  
109 print("\nSuMessages, cdp num, missing cdp_num\n");
110 }
111  
112 }
113  
114 =head2 subroutine gather_header
115  
116 sets binheader type to consider
117  
118 =cut
119  
120 sub gather_header {
121 my ( $self, $gather_header ) = @_;
122 $SuMessages->{_gather_header} = $gather_header if defined($gather_header);
123  
124 #print("\ngather_header is $SuMessages->{_gather_header}\n");
125 }
126  
127 =head2 subroutine gather_type
128  
129 sets gather type to consider
130  
131 =cut
132  
133 sub gather_type {
134 my ( $self, $gather_type ) = @_;
135 $SuMessages->{_gather_type} = $gather_type if defined($gather_type);
136  
137 #print("\n_gather_type is $SuMessages->{_gather_type}\n");
138 }
139  
140 =head2 subroutine gather_num
141  
142 sets gather number to consider
143  
144 =cut
145  
146 sub gather_num {
147 my ( $self, $gather_num ) = @_;
148 $SuMessages->{_gather_num} = $gather_num if defined($gather_num);
149  
150 # print("\ngather num is $SuMessages->{_gather_num}\n");
151 }
152  
153 =head2
154  
155 sub set
156 establishes the family type of messages
157  
158 e.g., velocity analysis
159 sutaup,
160 bottom mute
161 top mute
162 interactive velocity analysis
163 general picking
164
165 =cut
166  
167 sub set {
168 my ( $self, $message_type ) = @_;
169  
170 if ( defined($message_type) && $message_type ne $empty_string ) {
171  
172 $SuMessages->{_type} = $message_type;
173  
174 # print("SuMessages, set, type is $SuMessages->{_type}\n\n");
175  
176 }
177 else {
178 print("SuMessages,set,unexpected message type");
179 }
180 }
181  
182 =head2
183  
184 sub instructions
185 print instructions for a given family type of message
186 e.g., velocity analysis
187 sutaup etc.
188  
189 =cut
190  
191 sub instructions {
192  
193 my ( $self, $instructions ) = @_;
194  
195 #print(
196 # "SuMessages,instructions:$instructions,gather_num: $SuMessages->{_gather_num}\n\n"
197 # );
198  
199 if ( defined($instructions)
200 && ( length( $SuMessages->{_gather_num} ) or
201 $SuMessages->{_gather_num} eq $NaN )
202 && $instructions ne $empty_string )
203 {
204  
205 $SuMessages->{_instructions} = $instructions;
206  
207 =item CASE:
208  
209 interactive spectral analysis
210  
211 =cut
212  
213 if ( $SuMessages->{_type} eq 'iSpectralAnalysis' ) {
214  
215 if ( $SuMessages->{_instructions} eq 'firstSpectralAnalysis' ) {
216  
217 print("\n GATHER = $SuMessages->{_gather_num}\n\n");
218 print(" 1. PICK two(2) X-T pairs\n");
219 print(" 2. Quit window*\n");
220 print(" 3. Click CALC \n\n\n");
221 print(" (*To FINISH picking in window, enter: q \n");
222 print(" while mouse lies over image)\n");
223 print("LSULSULSULSULSULSULSULSULSULSULSULSULSULSU\n");
224 return ();
225 } # end first spectral analysis instructions
226 }
227  
228 =item CASE:
229  
230 interactive velocity analysis
231  
232 =cut
233  
234 if ( $SuMessages->{_type} eq 'iva' ) {
235  
236 if ( $SuMessages->{_instructions} eq 'first_velan' ) {
237  
238 print("\n CDP = $SuMessages->{_cdp_num}\n\n");
239 print(" Click PICK (if you want to pick V-T pairs) \n");
240 print(" or Click NEXT (next CDP)\n\n");
241 print("LSULSULSULSULSULSULSULSULSULSULSULSULSULSU\n");
242 return ();
243  
244 } # end first-velan instructions
245  
246 if ( $SuMessages->{_instructions} eq 'pre_pick_velan' ) {
247  
248 print(" 1. PICK V-T pairs\n");
249 print(" 2. Quit window*\n");
250 print(" 3. Click CALC \n\n\n");
251 print(" (*To FINISH picking in window, enter: q \n");
252 print(" while mouse lies over image)\n");
253 print("LSULSULSULSULSULSULSULSULSULSULSULSULSULSU\n");
254 return ();
255  
256 } # end 'pre_pick_velan' instructions
257  
258 if ( $SuMessages->{_instructions} eq 'post_pick_velan' ) {
259  
260 print("\tCDP = $SuMessages->{_cdp_num}\n\n");
261 print(" Are you HAPPY with these picks? \n");
262 print("\n");
263 print(" If NOT: \n");
264 print(" 1. RE-PICK the V-T pairs \n");
265 print(" 2. Quit window*, and \n");
266 print(" 3. Click CALC\n\n");
267 print(" If SATISFIED:\n");
268 print(" 1. Quit window*,\n");
269 print(" 2. Click NEXT to go to next CDP \n");
270 print(" or Click EXIT \n\n\n");
271 print(" (*To FINISH picking in window, enter: q \n");
272 print(" while mouse lies over image)\n");
273 print("LSULSULSULSULSULSULSULSULSULSULSULSULSULSU\n");
274 return ();
275  
276 } # end post-pick velan
277 } # end iva-type instructions
278  
279 =item CASE
280  
281 Interactive top-mute picking
282  
283 =cut
284  
285 if ( $SuMessages->{_type} eq 'iTopMute' ) {
286  
287 if ( $SuMessages->{_instructions} eq 'first_top_mute' ) {
288  
289 print(
290 "\n $SuMessages->{_gather_type} GATHER = $SuMessages->{_gather_num}\n\n"
291 );
292 print(" Click PICK (if you want to pick X-T pairs) \n");
293 print(" or Click NEXT (next GATHER)\n\n");
294 print("LSULSULSULSULSULSULSULSULSULSULSULSULSULSU\n");
295 return ();
296 }
297  
298 if ( $SuMessages->{_instructions} eq 'pre_pick_mute' ) {
299  
300 print(" 1. PICK X-T pairs\n");
301 print(" 2. Quit window*\n");
302 print(" 3. Click CALC \n\n\n");
303 print(" (*To FINISH picking in window, enter: q \n");
304 print(" while mouse lies over image)\n");
305 print("LSULSULSULSULSULSULSULSULSULSULSULSULSULSU\n");
306 return ();
307 }
308  
309 if ( $SuMessages->{_instructions} eq 'post_pick_mute' ) {
310  
311 print(
312 "\t $SuMessages->{_gather_type} GATHER = $SuMessages->{_gather_num}\n\n"
313 );
314 print(" Are you HAPPY with these picks? \n");
315 print("\n");
316 print(" If NOT: \n");
317 print(" 1. PICK the X-T pairs \n");
318 print(" 2. Quit window*, and \n");
319 print(" 3. Click CALC\n\n");
320 print(" If SATISFIED:\n");
321 print(" 1. Quit window*,\n");
322 print(" 2. Click NEXT to go to next CDP \n");
323 print(" or Click EXIT \n\n");
324 print("LSULSULSULSULSULSULSULSULSULSULSULSULSULSU\n");
325 return ();
326  
327 } # end post-pick mute
328  
329 } # end top mute instructions
330  
331 =item CASE
332  
333 Interactive bottom-mute picking
334  
335 =cut
336  
337 if ( $SuMessages->{_type} eq 'iBottomMute' ) {
338  
339 if ( $SuMessages->{_instructions} eq 'first_bottom_mute' ) {
340  
341 print(
342 "\n $SuMessages->{_gather_type} GATHER = $SuMessages->{_gather_num}\n\n"
343 );
344 print(" Click PICK (if you want to pick X-T pairs) \n");
345 print(" or Click NEXT (next GATHER)\n\n");
346 print("LSULSULSULSULSULSULSULSULSULSULSULSULSULSU\n");
347 return ();
348 }
349  
350 if ( $SuMessages->{_instructions} eq 'pre_pick_mute' ) {
351  
352 print(" 1. PICK X-T pairs\n");
353 print(" 2. Quit window*\n");
354 print(" 3. Click CALC \n\n\n");
355 print(" (*To FINISH picking in window, enter: q \n");
356 print(" while mouse lies over image)\n");
357 print("LSULSULSULSULSULSULSULSULSULSULSULSULSULSU\n");
358 return ();
359 }
360  
361 if ( $SuMessages->{_instructions} eq 'post_pick_mute' ) {
362  
363 print(
364 "\t $SuMessages->{_gather_type} GATHER = $SuMessages->{_gather_num}\n\n"
365 );
366 print(" Are you HAPPY with these picks? \n");
367 print("\n");
368 print(" If NOT: \n");
369 print(" 1. PICK the X-T pairs \n");
370 print(" 2. Quit window*, and \n");
371 print(" 3. Click CALC\n\n");
372 print(" If SATISFIED:\n");
373 print(" 1. Quit window*,\n");
374 print(" 2. Click NEXT to go to next CDP \n");
375 print(" or Click EXIT \n\n");
376 print("LSULSULSULSULSULSULSULSULSULSULSULSULSULSU\n");
377 return ();
378  
379 } # end post-pick mute
380  
381 } # end bottom mute instructions
382  
383 =item CASE
384  
385 Interactive general x-t picking
386  
387 =cut
388  
389 if ( $SuMessages->{_type} eq 'iPick_xt' ) {
390  
391 if ( $SuMessages->{_instructions} eq 'first_pick_xt' ) {
392  
393 print(
394 "\n $SuMessages->{_gather_type} GATHER = $SuMessages->{_gather_num}\n\n"
395 );
396 print(" Click PICK (if you want to pick X-T pairs) \n");
397 print(" or Click NEXT (next GATHER)\n\n");
398 print("LSULSULSULSULSULSULSULSULSULSULSULSULSULSU\n");
399 return ();
400 }
401  
402 if ( $SuMessages->{_instructions} eq 'pre_pick_xt' ) {
403  
404 print(" 1. PICK X-T pairs\n");
405 print(" 2. Quit window*\n");
406 print(" 3. Click CALC \n\n\n");
407 print(" (*To FINISH picking in window, enter: q \n");
408 print(" while mouse lies over image)\n");
409 print("LSULSULSULSULSULSULSULSULSULSULSULSULSULSU\n");
410 return ();
411 }
412  
413 if ( $SuMessages->{_instructions} eq 'post_pick_xt' ) {
414  
415 print(
416 "\t $SuMessages->{_gather_type} GATHER = $SuMessages->{_gather_num}\n\n"
417 );
418 print(" Are you HAPPY with these picks? \n");
419 print("\n");
420 print(" If NOT: \n");
421 print(" 1. PICK the X-T pairs \n");
422 print(" 2. Quit window*, and \n");
423 print(" 3. Click CALC\n\n");
424 print(" If SATISFIED:\n");
425 print(" 1. Quit window*,\n");
426 print(" 2. Click NEXT to go to next CDP \n");
427 print(" or Click EXIT \n\n");
428 print("LSULSULSULSULSULSULSULSULSULSULSULSULSULSU\n");
429 return ();
430  
431 } # end post-pick
432  
433 } # end pick instructions
434  
435 }
436 else {
437 print(
438 "SuMessages, instructions, missing instructions or gather_num \n\n"
439 );
440 }
441  
442 } # end sub instructions
443  
444 1;