lib/App/SeismicUnixGui/specs/plot/suxwigb_spec.pm untested

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