lib/App/SeismicUnixGui/sunix/header/suabshw.pm untested

filter: Statementstmt 0.0% 0 / 42 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 58 CC 2 SCAR 10.3
CC
2
Cov
0%
key
6.0
Step
2.0
note
2.0
CRAP 2.8
1 package App::SeismicUnixGui::sunix::header::suabshw;
2  
3 =head2 SYNOPSIS
4  
5 PERL PROGRAM NAME:
6  
7 AUTHOR: Juan Lorenzo (Perl module only)
8  
9 DATE:
10  
11 DESCRIPTION:
12  
13 Version:
14  
15 =head2 USE
16  
17 =head3 NOTES
18  
19 =head4 Examples
20  
21 =head2 SYNOPSIS
22  
23 =head3 SEISMIC UNIX NOTES
24 SUABSHW - replace header key word by its absolute value
25  
26  
27  
28 suabshw <stdin >stdout key=offset
29  
30  
31  
32 Required parameters:
33  
34 none
35  
36  
37  
38 Optional parameter:
39  
40 key=offset header key word
41  
42  
43  
44  
45  
46 Credits:
47  
48 CWP: Jack K. Cohen
49  
50  
51  
52 =head2 User's notes (Juan Lorenzo)
53 untested
54  
55 =cut
56  
57  
58 =head2 CHANGES and their DATES
59  
60 =cut
61  
62 use Moose;
63 our $VERSION = '0.0.1';
64  
65  
66 =head2 Import packages
67  
68 =cut
69  
70 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
71  
72 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
73 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
74  
75  
76 =head2 instantiation of packages
77  
78 =cut
79  
80 my $get = L_SU_global_constants->new();
81 my $Project = Project_config->new();
82 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
83 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
84 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
85  
86 my $PS_SEISMIC = $Project->PS_SEISMIC();
87  
88 my $var = $get->var();
89 my $on = $var->{_on};
90 my $off = $var->{_off};
91 my $true = $var->{_true};
92 my $false = $var->{_false};
93 my $empty_string = $var->{_empty_string};
94  
95 =head2 Encapsulated
96 hash of private variables
97  
98 =cut
99  
100 my $suabshw = {
101 _key => '',
102 _Step => '',
103 _note => '',
104  
105 };
106  
107 =head2 sub Step
108  
109 collects switches and assembles bash instructions
110 by adding the program name
111  
112 =cut
113  
114 sub Step {
115  
116 $suabshw->{_Step} = 'suabshw'.$suabshw->{_Step};
117 return ( $suabshw->{_Step} );
118  
119 }
120  
121  
122 =head2 sub note
123  
124 collects switches and assembles bash instructions
125 by adding the program name
126  
127 =cut
128  
129 sub note {
130  
131 $suabshw->{_note} = 'suabshw'.$suabshw->{_note};
132 return ( $suabshw->{_note} );
133  
134 }
135  
136  
137  
138 =head2 sub clear
139  
140 =cut
141  
142 sub clear {
143  
144 $suabshw->{_key} = '';
145 $suabshw->{_Step} = '';
146 $suabshw->{_note} = '';
147 }
148  
149  
150 =head2 sub key
151  
152  
153 =cut
154  
155 sub key {
156  
157 my ( $self,$key ) = @_;
158 if ( $key ne $empty_string ) {
159  
160 $suabshw->{_key} = $key;
161 $suabshw->{_note} = $suabshw->{_note}.' key='.$suabshw->{_key};
162 $suabshw->{_Step} = $suabshw->{_Step}.' key='.$suabshw->{_key};
163  
164 } else {
165 print("suabshw, key, missing key,\n");
166 }
167 }
168  
169  
170 =head2 sub get_max_index
171  
172 max index = number of input variables -1
173
174 =cut
175
176 sub get_max_index {
177 my ($self) = @_;
178 my $max_index = 0;
179  
180 return($max_index);
181 }
182
183
184 1;