lib/App/SeismicUnixGui/specs/transform/sufft_spec.pm untested

filter: Statementstmt 0.0% 0 / 136 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 / 185 CC 9 SCAR 14.7
CC
9
Cov
0%
get_binding_index_aref
6.0
get_binding_length
6.0
get_file_dialog_type_aref
6.0
CRAP 4.4
1 package App::SeismicUnixGui::specs::transform::sufft_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 qw($su $suffix_su);
7 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
8 use aliased 'App::SeismicUnixGui::sunix::transform::sufft';
9  
10 my $get = L_SU_global_constants->new();
11 my $Project = Project_config->new();
12 my $sufft = sufft->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_SU = $Project->DATA_SEISMIC_SU(); # output data directory
23 my $PL_SEISMIC = $Project->PL_SEISMIC();
24 my $max_index = $sufft->get_max_index();
25  
26 my $sufft_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_pipe_in => $true,
39 _has_outpar => $false,
40 _has_pipe_out => $true,
41 _has_redirect_in => $true,
42 _has_redirect_out => $true,
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 => $true,
48 _is_first_of_4or_more => $true,
49 _is_last_of_2 => $false,
50 _is_last_of_3or_more => $false,
51 _is_last_of_4or_more => $false,
52 _is_suprog => $true,
53 _is_superflow => $false,
54 _max_index => $max_index,
55 };
56  
57 my $incompatibles = { clip => [ 'mbal', 'pbal' ], };
58  
59 =head2 sub _sub_binding_index_aref
60  
61 =cut
62  
63 sub binding_index_aref {
64  
65 my ($self) = @_;
66  
67 my @index;
68  
69 $index[0] = 0;
70  
71 $sufft_spec->{_binding_index_aref} = \@index;
72 return ();
73  
74 }
75  
76 =head2 sub file_dialog_type_aref
77  
78 =cut
79  
80 sub file_dialog_type_aref {
81 my ($self) = @_;
82  
83 my @type;
84  
85 $type[0] = '';
86  
87 $sufft_spec->{_file_dialog_type_aref} = \@type;
88  
89 return ();
90  
91 }
92  
93 =head2 sub flow_type_aref
94  
95 =cut
96  
97 sub flow_type_aref {
98  
99 my ($self) = @_;
100  
101 my @type;
102  
103 $type[0] = $flow_type->{_user_built};
104  
105 $sufft_spec->{_flow_type_aref} = \@type;
106  
107 return ();
108  
109 }
110  
111 =head2 sub get_binding_index_aref
112  
113 =cut
114  
115 sub get_binding_index_aref {
116  
117 my ($self) = @_;
118 my @index;
119  
120 if ( $sufft_spec->{_binding_index_aref} ) {
121  
122 my $index_aref = $sufft_spec->{_binding_index_aref};
123 return ($index_aref);
124  
125 }
126 else {
127 print(
128 "sufft_spec, get_binding_index_aref, missing binding_index_aref\n"
129 );
130 return ();
131 }
132  
133 my $index_aref = $sufft_spec->{_binding_index_aref};
134  
135 }
136  
137 =head2 sub get_binding_length
138  
139 =cut
140  
141 sub get_binding_length {
142 my ($self) = @_;
143  
144 if ( $sufft_spec->{_binding_index_aref} ) {
145  
146 my $length;
147  
148 $length = scalar @{ $sufft_spec->{_binding_index_aref} };
149  
150 return ($length);
151  
152 }
153 else {
154 print("sufft_spec, get_binding_length, missing length \n");
155 return ();
156 }
157  
158 }
159  
160 =head2 sub get_file_dialog_type_aref
161  
162 =cut
163  
164 sub get_file_dialog_type_aref {
165  
166 my ($self) = @_;
167 if ( $sufft_spec->{_file_dialog_type_aref} ) {
168  
169 my @type = @{ $sufft_spec->{_file_dialog_type_aref} };
170  
171 return ( \@type );
172  
173 }
174 else {
175 print(
176 "sufft_spec,get_file_dialog_type_aref, missing file_dialog_type_aref\n"
177 );
178 return ();
179 }
180  
181 }
182  
183 =head2 sub _sub_get_max_index
184  
185 =cut
186  
187 sub get_max_index {
188  
189 my ($self) = @_;
190  
191 if ( $sufft_spec->{_max_index} ) {
192  
193 my $max_idx = $sufft->get_max_index();
194 return ($max_idx);
195  
196 }
197 else {
198 print("sufft_spec, get_max_index, missing max_index\n");
199 return ();
200 }
201 }
202  
203 =head2 sub get_flow_type_aref
204  
205 =cut
206  
207 sub get_flow_type_aref {
208 my ($self) = @_;
209 if ( $sufft_spec->{_flow_type_aref} ) {
210  
211 my $type_aref = $sufft_spec->{_flow_type_aref};
212  
213 return ($type_aref);
214  
215 }
216 else {
217 print("sufft_spec, get_flow_type_aref, missing flow_type_aref \n");
218 return ();
219 }
220 }
221  
222 =head2 sub get_incompatibles
223  
224 =cut
225  
226 sub get_incompatibles {
227  
228 my ($self) = @_;
229 my @needed;
230  
231 my @_need_both;
232  
233 my @_need_only_1;
234  
235 my @_none_needed;
236  
237 my @_all_needed;
238  
239 my $params = {
240  
241 _need_both => \@_need_both,
242 _need_only_1 => \@_need_only_1,
243 _none_needed => \@_none_needed,
244 _all_needed => \@_all_needed,
245  
246 };
247  
248 my @of_two = ( 'xx', 'yy' );
249 push @{ $params->{_need_only_1} }, \@of_two;
250  
251 my $len_1_needed = scalar @{ $params->{_need_only_1} };
252  
253 if ( $len_1_needed >= 1 ) {
254  
255 for ( my $i = 0 ; $i < $len_1_needed ; $i++ ) {
256  
257 print(
258 "sufft, get_incompatibles,need_only_1: @{@{$params->{_need_only_1}}[$i]}\n"
259 );
260  
261 }
262  
263 }
264 else {
265 print("get_incompatibles, no incompatibles\n");
266 }
267  
268 return ($params);
269  
270 }
271  
272 =head2 sub get_prefix_aref
273  
274 =cut
275  
276 sub get_prefix_aref {
277  
278 my ($self) = @_;
279  
280 if ( $sufft_spec->{_prefix_aref} ) {
281  
282 my $prefix_aref = $sufft_spec->{_prefix_aref};
283 return ($prefix_aref);
284  
285 }
286 else {
287 print("sufft_spec, get_prefix_aref, missing prefix_aref\n");
288 return ();
289 }
290  
291 return ();
292 }
293  
294 =head2 sub get_suffix_aref
295  
296 =cut
297  
298 sub get_suffix_aref {
299  
300 my ($self) = @_;
301  
302 if ( $sufft_spec->{_suffix_aref} ) {
303  
304 my $suffix_aref = $sufft_spec->{_suffix_aref};
305 return ($suffix_aref);
306  
307 }
308 else {
309 print("sufft_spec, get_suffix_aref, missing suffix_aref\n");
310 return ();
311 }
312  
313 return ();
314 }
315  
316 =head2 sub prefix_aref
317  
318 Include in the Set up
319 sections of an output Poop flow.
320  
321 prefixes and suffixes to parameter labels
322 are filtered by sunix_pl
323  
324 =cut
325  
326 sub prefix_aref {
327  
328 my ($self) = @_;
329  
330 my @prefix;
331  
332 for ( my $i = 0 ; $i < $max_index ; $i++ ) {
333  
334 $prefix[$i] = $empty_string;
335  
336 }
337 $sufft_spec->{_prefix_aref} = \@prefix;
338 return ();
339  
340 }
341  
342 =head2 sub suffix_aref
343  
344 Initialize suffixes as empty
345 Assign specific suffixes to parameter
346 values
347  
348 =cut
349  
350 sub suffix_aref {
351  
352 my ($self) = @_;
353  
354 my @suffix;
355  
356 for ( my $i = 0 ; $i < $max_index ; $i++ ) {
357  
358 $suffix[$i] = $empty_string;
359  
360 }
361 $sufft_spec->{_suffix_aref} = \@suffix;
362 return ();
363  
364 }
365  
366 =head2 sub variables
367 return a hash array
368 with definitions
369  
370 =cut
371  
372 sub variables {
373  
374 my ($self) = @_;
375  
376 my $hash_ref = $sufft_spec;
377  
378 return ($hash_ref);
379  
380 }
381  
382 1;