lib/App/SeismicUnixGui/specs/big_streams/Synseis_spec.pm untested

filter: Statementstmt 0.0% 0 / 110 Branchbran 0.0% 0 / 14 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 17 Podpod 0.0% 0 / 13 totaltotal 0.0% 0 / 154 CC 8 SCAR 14.7
CC
8
Cov
0%
get_binding_index_aref
6.0
get_max_index
6.0
get_file_dialog_type_aref
6.0
CRAP 4.3
1 package App::SeismicUnixGui::specs::big_streams::Synseis_spec;
2  
3 use Moose;
4 our $VERSION = '1.0.0';
5  
6 use App::SeismicUnixGui::misc::SeismicUnix qw($su $suffix_su);
7 use App::SeismicUnixGui::misc::L_SU_global_constants;
8 use App::SeismicUnixGui::configs::big_streams::Project_config;
9  
10 my $L_SU_global_constants = App::SeismicUnixGui::misc::L_SU_global_constants->new();
11 my $Project = App::SeismicUnixGui::configs::big_streams::Project_config->new();
12  
13 my $var = $L_SU_global_constants->var();
14  
15 my $empty_string = $var->{_empty_string};
16 my $file_dialog_type = $L_SU_global_constants->file_dialog_type_href();
17 my $flow_type = $L_SU_global_constants->flow_type_href();
18  
19 my $true = $var->{_true};
20 my $false = $var->{_false};
21  
22 my $DATA_SEISMIC_WELL_SYNSEIS =
23 $Project->DATA_SEISMIC_WELL_SYNSEIS(); # data directories
24 my $PL_SEISMIC = $Project->PL_SEISMIC();
25  
26 my $max_index = 17;
27  
28 my $Synseis_spec = {
29 _CONFIG => $PL_SEISMIC,
30 _DATA_DIR_IN => $DATA_SEISMIC_WELL_SYNSEIS,
31 _DATA_DIR_OUT => $DATA_SEISMIC_WELL_SYNSEIS,
32 _binding_index_aref => '',
33 _suffix_type_in => $su,
34 _data_suffix_in => $suffix_su,
35 _suffix_type_out => $su,
36 _data_suffix_out => $suffix_su,
37 _file_dialog_type_aref => '',
38 _flow_type_aref => '',
39 _has_infile => $false,
40 _has_pipe_in => $false,
41 _has_pipe_out => $false,
42 _has_redirect_in => $false,
43 _has_redirect_out => $false,
44 _has_subin_in => $false,
45 _has_subin_out => $false,
46 _is_data => $false,
47 _is_first_of_2 => $false,
48 _is_first_of_3or_more => $false,
49 _is_first_of_4or_more => $false,
50 _is_last_of_2 => $false,
51 _is_last_of_3or_more => $false,
52 _is_last_of_4or_more => $false,
53 _is_suprog => $false,
54 _is_superflow => $true,
55 _max_index => $max_index,
56 _prefix_aref => '',
57 _suffix_aref => '',
58 };
59  
60 =head2 sub binding_index_aref
61  
62 =cut
63  
64 sub binding_index_aref {
65 my ($self) = @_;
66 my @index;
67  
68 $index[0] = 0;
69  
70 $Synseis_spec->{_binding_index_aref} = \@index;
71  
72 return ();
73 }
74  
75 =head2 sub get_binding_index_aref
76  
77 =cut
78  
79 sub get_binding_index_aref {
80 my ($self) = @_;
81 my @index;
82  
83 if ( $Synseis_spec->{_binding_index_aref} ) {
84 my $index_aref = $Synseis_spec->{_binding_index_aref};
85 return ($index_aref);
86  
87 }
88 else {
89 print(
90 "Synseis_spec, get_binding_index_aref, missing binding_index_aref\n"
91 );
92 return ();
93 }
94  
95 my $index_aref = $Synseis_spec->{_binding_index_aref};
96  
97 }
98  
99 =head2 sub get_max_index
100  
101 =cut
102  
103 sub get_max_index {
104 my ($self) = @_;
105  
106 if ( $Synseis_spec->{_max_index} ) {
107  
108 my $max_idx = $Synseis_spec->{_max_index};
109 return ($max_idx);
110  
111 }
112 else {
113 print("Synseis_spec, get_max_index, missing max_index\n");
114 return ();
115 }
116 }
117  
118 =head2 sub file_dialog_type_aref
119  
120 data for a synthetic seismogram is found in the
121 default perl flow directory, for now
122 TODO: synthetic seismogram data could be found in future
123 in the Well data directories
124  
125 =cut
126  
127 sub file_dialog_type_aref {
128 my ($self) = @_;
129  
130 my @type;
131  
132 $type[0] = $file_dialog_type->{_Data};
133  
134 $Synseis_spec->{_file_dialog_type_aref} = \@type;
135  
136 return ();
137  
138 }
139  
140 =head2 sub get_file_dialog_type_aref
141  
142 =cut
143  
144 sub get_file_dialog_type_aref {
145 my ($self) = @_;
146  
147 if ( $Synseis_spec->{_file_dialog_type_aref} ) {
148  
149 my @type = @{ $Synseis_spec->{_file_dialog_type_aref} };
150 return ( \@type );
151  
152 }
153 else {
154 print(
155 "Synseis_spec,get_file_dialog_type_aref, missing file_dialog_type_aref\n"
156 );
157 return ();
158 }
159 }
160  
161 =head2 sub flow_type_aref
162  
163 =cut
164  
165 sub flow_type_aref {
166 my ($self) = @_;
167  
168 my @type;
169  
170 $type[0] = $flow_type->{_user_built};
171  
172 $Synseis_spec->{_flow_type_aref} = \@type;
173  
174 return ();
175  
176 }
177  
178 =head2 sub get_flow_type_aref
179  
180 =cut
181  
182 sub get_flow_type_aref {
183 my ($self) = @_;
184  
185 if ( $Synseis_spec->{_flow_type_aref} ) {
186 my $type_aref = $Synseis_spec->{_flow_type_aref};
187 return ($type_aref);
188  
189 }
190 else {
191  
192 print("Synseis_spec, get_flow_type_aref, missing flow_type_aref \n");
193 return ();
194 }
195 }
196  
197 =head2 sub get_prefix_aref
198  
199 =cut
200  
201 sub get_prefix_aref {
202  
203 my $self = @_;
204  
205 if ( defined $Synseis_spec->{_prefix_aref} ) {
206  
207 my $prefix_aref = $Synseis_spec->{_prefix_aref};
208 return ($prefix_aref);
209  
210 }
211 else {
212 print("Synseis_spec, get_prefix_aref, missing prefix_aref\n");
213 return ();
214 }
215  
216 return ();
217 }
218  
219 =head2 sub get_suffix_aref
220  
221 =cut
222  
223 sub get_suffix_aref {
224  
225 my $self = @_;
226  
227 if ( $Synseis_spec->{_suffix_aref} ) {
228  
229 my $suffix_aref = $Synseis_spec->{_suffix_aref};
230 return ($suffix_aref);
231  
232 }
233 else {
234 print("Synseis_spec, get_suffix_aref, missing suffix_aref\n");
235 return ();
236 }
237  
238 return ();
239 }
240  
241 =head2 sub prefix_aref
242  
243 =cut
244  
245 sub prefix_aref {
246  
247 my $self = @_;
248  
249 my @prefix;
250  
251 for ( my $i = 0 ; $i < $Synseis_spec->{_max_index} ; $i++ ) {
252  
253 $prefix[$i] = $empty_string;
254  
255 }
256 $Synseis_spec->{_prefix_aref} = \@prefix;
257 return ();
258  
259 }
260  
261 =head2 sub suffix_aref
262  
263 =cut
264  
265 sub suffix_aref {
266  
267 my $self = @_;
268  
269 my @suffix;
270  
271 for ( my $i = 0 ; $i < $Synseis_spec->{_max_index} ; $i++ ) {
272  
273 $suffix[$i] = $empty_string;
274  
275 }
276 $Synseis_spec->{_suffix_aref} = \@suffix;
277 return ();
278  
279 }
280  
281 =head2 sub get_binding_length
282  
283 =cut
284  
285 sub get_binding_length {
286 my ($self) = @_;
287  
288 if ( $Synseis_spec->{_binding_index_aref} ) {
289  
290 my $length;
291 $length = scalar @{ $Synseis_spec->{_binding_index_aref} };
292 return ($length);
293  
294 }
295 else {
296  
297 print("Synseis_spec, get_binding_length, missing length \n");
298 return ();
299 }
300  
301 }
302  
303 =head2 sub variables
304  
305 return a hash array
306 with definitions
307  
308 =cut
309  
310 sub variables {
311 my ($self) = @_;
312  
313 # print("Synseis_spec,variables,
314 # first_of_2,$Synseis_spec->{_is_first_of_2}\n");
315 my $hash_ref = $Synseis_spec;
316 return ($hash_ref);
317 }
318  
319 1;