lib/App/SeismicUnixGui/specs/migration/sumiggbzoan_spec.pm untested

filter: Statementstmt 0.0% 0 / 172 Branchbran 0.0% 0 / 14 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 18 Podpod 0.0% 0 / 13 totaltotal 0.0% 0 / 217 CC 8 SCAR 14.4
CC
8
Cov
0%
get_binding_index_aref
6.0
get_binding_length
6.0
get_file_dialog_type_aref
6.0
CRAP 4.2
1 package App::SeismicUnixGui::specs::migration::sumiggbzoan_spec;
2 use Moose;
3 our $VERSION = '0.0.1';
4  
5 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
6 use App::SeismicUnixGui::misc::SeismicUnix
7 qw($bin $ps $segy $su $suffix_bin $suffix_ps $suffix_segy $suffix_su $suffix_txt $txt);
8 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
9 use aliased 'App::SeismicUnixGui::sunix::migration::sumiggbzoan';
10 my $get = L_SU_global_constants->new();
11 my $Project = Project_config->new();
12 my $sumiggbzoan = sumiggbzoan->new();
13  
14 my $var = $get->var();
15  
16 my $empty_string = $var->{_empty_string};
17 my $true = $var->{_true};
18 my $false = $var->{_false};
19 my $file_dialog_type = $get->file_dialog_type_href();
20 my $flow_type = $get->flow_type_href();
21  
22 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
23 my $DATA_SEISMIC_SEGY = $Project->DATA_SEISMIC_SEGY();
24 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); # output data directory
25 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT(); # output data directory
26 my $PL_SEISMIC = $Project->PL_SEISMIC();
27 my $PS_SEISMIC = $Project->PS_SEISMIC();
28 my $max_index = 19;
29  
30 my $sumiggbzoan_spec = {
31 _CONFIG => $PL_SEISMIC,
32 _DATA_DIR_IN => $DATA_SEISMIC_BIN,
33 _DATA_DIR_OUT => $DATA_SEISMIC_SU,
34 _binding_index_aref => '',
35 _suffix_type_in => $su,
36 _data_suffix_in => $suffix_su,
37 _suffix_type_out => $su,
38 _data_suffix_out => $suffix_su,
39 _file_dialog_type_aref => '',
40 _flow_type_aref => '',
41 _has_infile => $true,
42 _has_outpar => $false,
43 _has_pipe_in => $true,
44 _has_pipe_out => $true,
45 _has_redirect_in => $true,
46 _has_redirect_out => $true,
47 _has_subin_in => $false,
48 _has_subin_out => $false,
49 _is_data => $false,
50 _is_first_of_2 => $true,
51 _is_first_of_3or_more => $true,
52 _is_first_of_4or_more => $true,
53 _is_last_of_2 => $false,
54 _is_last_of_3or_more => $false,
55 _is_last_of_4or_more => $false,
56 _is_suprog => $true,
57 _is_superflow => $false,
58 _max_index => $max_index,
59 _prefix_aref => '',
60 _suffix_aref => '',
61 };
62  
63 =head2 sub binding_index_aref
64 =cut
65  
66 sub binding_index_aref {
67  
68 my $self = @_;
69  
70 my @index;
71  
72 # first binding index (index=0)
73 # connects to second item (index=1)
74 # in the parameter list
75 $index[0] = 0; # inbound item is bound
76 $index[1] = 1; # inbound item is bound
77 $index[2] = 2; # outbound item is bound
78 $index[3] = 3; # inbound item is bound
79 $index[4] = 4; # inbound item is bound
80 $index[5] = 5; # outbound item is bound
81 $index[6] = 9; # inbound item is bound
82 $index[7] = 13; # outbound item is bound
83 $index[8] = 19; # outbound item is bound
84  
85 $sumiggbzoan_spec->{_binding_index_aref} = \@index;
86 return ();
87  
88 }
89  
90 =head2 sub file_dialog_type_aref
91  
92 type of dialog (Data, Flow, SaveAs) is needed by binding
93 one type of dialog for each index
94 =cut
95  
96 sub file_dialog_type_aref {
97  
98 my $self = @_;
99  
100 my @type;
101  
102 my $index_aref = get_binding_index_aref();
103 my @index = @$index_aref;
104  
105 # bound index will look for data
106 # $type[0] = '';
107 $type[ $index[0] ] = $file_dialog_type->{_Data};
108 $type[ $index[1] ] = $file_dialog_type->{_Data};
109 $type[ $index[2] ] = $file_dialog_type->{_Data};
110 $type[ $index[3] ] = $file_dialog_type->{_Data};
111 $type[ $index[4] ] = $file_dialog_type->{_Data};
112 $type[ $index[5] ] = $file_dialog_type->{_Data};
113 $type[ $index[6] ] = $file_dialog_type->{_Data};
114 $type[ $index[7] ] = $file_dialog_type->{_Data};
115 $type[ $index[8] ] = $file_dialog_type->{_Data};
116  
117 $sumiggbzoan_spec->{_file_dialog_type_aref} = \@type;
118 return ();
119  
120 }
121  
122 =head2 sub flow_type_aref
123  
124 =cut
125  
126 sub flow_type_aref {
127  
128 my $self = @_;
129  
130 my @type;
131  
132 $type[0] = $flow_type->{_user_built};
133  
134 $sumiggbzoan_spec->{_flow_type_aref} = \@type;
135 return ();
136  
137 }
138  
139 =head2 sub get_binding_index_aref
140  
141 =cut
142  
143 sub get_binding_index_aref {
144  
145 my $self = @_;
146 my @index;
147  
148 if ( $sumiggbzoan_spec->{_binding_index_aref} ) {
149  
150 my $index_aref = $sumiggbzoan_spec->{_binding_index_aref};
151 return ($index_aref);
152  
153 }
154 else {
155 print(
156 "sumiggbzoan_spec, get_binding_index_aref, missing binding_index_aref\n"
157 );
158 return ();
159 }
160  
161 my $index_aref = $sumiggbzoan_spec->{_binding_index_aref};
162 }
163  
164 =head2 sub get_binding_length
165  
166 =cut
167  
168 sub get_binding_length {
169  
170 my $self = @_;
171  
172 if ( $sumiggbzoan_spec->{_binding_index_aref} ) {
173  
174 my $binding_length =
175 scalar @{ $sumiggbzoan_spec->{_binding_index_aref} };
176 return ($binding_length);
177  
178 }
179 else {
180 print("sumiggbzoan_spec, get_binding_length, missing binding_length\n");
181 return ();
182 }
183  
184 return ();
185 }
186  
187 =head2 sub get_file_dialog_type_aref
188  
189 =cut
190  
191 sub get_file_dialog_type_aref {
192  
193 my $self = @_;
194 if ( $sumiggbzoan_spec->{_file_dialog_type_aref} ) {
195  
196 my $index_aref = $sumiggbzoan_spec->{_file_dialog_type_aref};
197 return ($index_aref);
198  
199 }
200 else {
201 print(
202 "sumiggbzoan_spec, get_file_dialog_type_aref, missing get_file_dialog_type_aref\n"
203 );
204 return ();
205 }
206  
207 return ();
208 }
209  
210 =head2 sub get_flow_type_aref
211  
212 =cut
213  
214 sub get_flow_type_aref {
215  
216 my $self = @_;
217  
218 if ( $sumiggbzoan_spec->{_flow_type_aref} ) {
219  
220 my $index_aref = $sumiggbzoan_spec->{_flow_type_aref};
221 return ($index_aref);
222  
223 }
224 else {
225 print("sumiggbzoan_spec, get_flow_type_aref, missing flow_type_aref\n");
226 return ();
227 }
228  
229 }
230  
231 =head2 sub get_incompatibles
232  
233 =cut
234  
235 sub get_incompatibles {
236  
237 my $self = @_;
238 my @needed;
239  
240 my @_need_both;
241  
242 my @_need_only_1;
243  
244 my @_none_needed;
245  
246 my @_all_needed;
247  
248 my $params = {
249  
250 _need_both => \@_need_both,
251 _need_only_1 => \@_need_only_1,
252 _none_needed => \@_none_needed,
253 _all_needed => \@_all_needed,
254  
255 };
256  
257 my @of_two = ( 'xx', 'yy' );
258 push @{ $params->{_need_only_1} }, \@of_two;
259  
260 my $len_1_needed = scalar @{ $params->{_need_only_1} };
261  
262 if ( $len_1_needed >= 1 ) {
263  
264 for ( my $i = 0 ; $i < $len_1_needed ; $i++ ) {
265  
266 print(
267 "sumiggbzoan, get_incompatibles,need_only_1: @{@{$params->{_need_only_1}}[$i]}\n"
268 );
269  
270 }
271  
272 }
273 else {
274 print("get_incompatibles, no incompatibles\n");
275 }
276  
277 return ($params);
278  
279 }
280  
281 =head2 sub get_prefix_aref
282  
283 =cut
284  
285 sub get_prefix_aref {
286  
287 my $self = @_;
288  
289 if ( $sumiggbzoan_spec->{_prefix_aref} ) {
290  
291 my $prefix_aref = $sumiggbzoan_spec->{_prefix_aref};
292 return ($prefix_aref);
293  
294 }
295 else {
296 print("sumiggbzoan_spec, get_prefix_aref, missing prefix_aref\n");
297 return ();
298 }
299  
300 return ();
301 }
302  
303 =head2 sub get_suffix_aref
304  
305 =cut
306  
307 sub get_suffix_aref {
308  
309 my $self = @_;
310  
311 if ( $sumiggbzoan_spec->{_suffix_aref} ) {
312  
313 my $suffix_aref = $sumiggbzoan_spec->{_suffix_aref};
314 return ($suffix_aref);
315  
316 }
317 else {
318 print("$sumiggbzoan_spec, get_suffix_aref, missing suffix_aref\n");
319 return ();
320 }
321  
322 return ();
323 }
324  
325 =head2 sub prefix_aref
326  
327 Include in the Set up
328 sections of an output Poop flow.
329  
330 prefixes and suffixes to parameter labels
331 are filtered by sunix_pl
332  
333 =cut
334  
335 sub prefix_aref {
336  
337 my $self = @_;
338  
339 my @prefix;
340  
341 for ( my $i = 0 ; $i < $max_index ; $i++ ) {
342  
343 $prefix[$i] = $empty_string;
344  
345 }
346  
347 my $index_aref = get_binding_index_aref();
348 my @index = @$index_aref;
349  
350 # label 1 in GUI is input xx_file and needs a home directory
351 $prefix[ $index[0] ] = '$DATA_SEISMIC_BIN' . ".'/'.";
352  
353 # label 2 in GUI is input yy_file and needs a home directory
354 $prefix[ $index[1] ] = '$DATA_SEISMIC_BIN' . ".'/'.";
355  
356 # label 3 in GUI is input zz_file and needs a home directory
357 $prefix[ $index[2] ] = '$DATA_SEISMIC_BIN' . ".'/'.";
358  
359 # label 4 in GUI is input xx_file and needs a home directory
360 $prefix[ $index[3] ] = '$DATA_SEISMIC_BIN' . ".'/'.";
361  
362 # label 5 in GUI is input yy_file and needs a home directory
363 $prefix[ $index[4] ] = '$DATA_SEISMIC_BIN' . ".'/'.";
364  
365 # label 6 in GUI is input zz_file and needs a home directory
366 $prefix[ $index[5] ] = '$DATA_SEISMIC_BIN' . ".'/'.";
367  
368 # label 10 in GUI is input xx_file and needs a home directory
369 $prefix[ $index[6] ] = '$DATA_SEISMIC_BIN' . ".'/'.";
370  
371 # label 14 in GUI is input yy_file and needs a home directory
372 $prefix[ $index[7] ] = '$DATA_SEISMIC_BIN' . ".'/'.";
373  
374 # label 19 in GUI is input zz_file and needs a home directory
375 $prefix[ $index[8] ] = '$DATA_SEISMIC_BIN' . ".'/'.";
376  
377 $sumiggbzoan_spec->{_prefix_aref} = \@prefix;
378 return ();
379  
380 }
381  
382 =head2 sub suffix_aref
383  
384 Initialize suffixes as empty
385 values
386  
387 =cut
388  
389 sub suffix_aref {
390  
391 my $self = @_;
392  
393 my @suffix;
394  
395 for ( my $i = 0 ; $i < $max_index ; $i++ ) {
396  
397 $suffix[$i] = $empty_string;
398  
399 }
400  
401 my $index_aref = get_binding_index_aref();
402 my @index = @$index_aref;
403  
404 # label 1 in GUI is input xx_file and needs a home directory
405 $suffix[ $index[0] ] = '' . '' . '$suffix_bin';
406  
407 # label 2 in GUI is input yy_file and needs a home directory
408 $suffix[ $index[1] ] = '' . '' . '$suffix_bin';
409  
410 # label 3 in GUI is output zz_file and needs a home directory
411 $suffix[ $index[2] ] = '' . '' . '$suffix_su';
412  
413 # label 4 in GUI is input xx_file and needs a home directory
414 $suffix[ $index[3] ] = '' . '' . '$suffix_bin';
415  
416 # label 5 in GUI is input yy_file and needs a home directory
417 $suffix[ $index[4] ] = '' . '' . '$suffix_bin';
418  
419 # label 6 in GUI is output zz_file and needs a home directory
420 $suffix[ $index[5] ] = '' . '' . '$suffix_bin';
421  
422 # label 10 in GUI is input xx_file and needs a home directory
423 $suffix[ $index[6] ] = '' . '' . '$suffix_bin';
424  
425 # label 14 in GUI is input yy_file and needs a home directory
426 $suffix[ $index[7] ] = '' . '' . '$suffix_bin';
427  
428 # label 20 in GUI is output zz_file and needs a home directory
429 $suffix[ $index[8] ] = '' . '' . '$suffix_bin';
430  
431 $sumiggbzoan_spec->{_suffix_aref} = \@suffix;
432 return ();
433  
434 }
435  
436 =head2 sub variables
437  
438  
439 return a hash array
440 with definitions
441
442 =cut
443  
444 sub variables {
445  
446 my ($self) = @_;
447 my $hash_ref = $sumiggbzoan_spec;
448 return ($hash_ref);
449 }
450  
451 1;