lib/App/SeismicUnixGui/specs/NMO_Vel_Stk/suvelan_spec.pm untested

filter: Statementstmt 0.0% 0 / 125 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 / 170 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::NMO_Vel_Stk::suvelan_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::NMO_Vel_Stk::suvelan';
9  
10 my $get = L_SU_global_constants->new();
11 my $Project = Project_config->new();
12 my $suvelan = suvelan->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_PL = $Project->PL_SEISMIC(); # output data directory
23 my $PL_SEISMIC = $Project->PL_SEISMIC();
24 my $max_index = $suvelan->get_max_index();
25  
26 my $suvelan_spec = {
27 _CONFIG => $PL_SEISMIC,
28 _DATA_DIR_IN => $DATA_SEISMIC_PL,
29 _DATA_DIR_OUT => $DATA_SEISMIC_PL,
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 => $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 =head2 sub binding_index_aref
58  
59 =cut
60  
61 sub binding_index_aref {
62  
63 my ($self) = @_;
64  
65 my @index;
66  
67 #$index[0] = 0;
68  
69 #$suvelan_spec ->{_binding_index_aref} = \@index;
70 return ();
71  
72 }
73  
74 =head2 sub file_dialog_type_aref
75  
76 type of dialog (Data, Flow, SaveAs) is needed by binding
77 one type of dialog for each index
78  
79 =cut
80  
81 sub file_dialog_type_aref {
82  
83 my ($self) = @_;
84  
85 my @type;
86  
87 $type[0] = '';
88  
89 $suvelan_spec->{_file_dialog_type_aref} = \@type;
90 return ();
91  
92 }
93  
94 =head2 sub flow_type_aref
95  
96 =cut
97  
98 sub flow_type_aref {
99  
100 my ($self) = @_;
101  
102 my @type;
103  
104 $type[0] = $flow_type->{_user_built};
105  
106 $suvelan_spec->{_flow_type_aref} = \@type;
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 ( $suvelan_spec->{_binding_index_aref} ne $empty_string ) {
121  
122 my $index_aref = $suvelan_spec->{_binding_index_aref};
123 return ($index_aref);
124  
125 }
126 else {
127 # print("suvelan_spec, get_binding_index_aref, missing binding_index_aref\n");
128 return ();
129 }
130  
131 my $index_aref = $suvelan_spec->{_binding_index_aref};
132 }
133  
134 =head2 sub get_binding_length
135  
136 =cut
137  
138 sub get_binding_length {
139  
140 my ($self) = @_;
141  
142 if ( $suvelan_spec->{_binding_index_aref} ) {
143  
144 my $binding_length = scalar @{ $suvelan_spec->{_binding_index_aref} };
145 return ($binding_length);
146  
147 }
148 else {
149 print("suvelan_spec, get_binding_length, missing binding_length\n");
150 return ();
151 }
152  
153 return ();
154 }
155  
156 =head2 sub get_file_dialog_type_aref
157  
158 =cut
159  
160 sub get_file_dialog_type_aref {
161  
162 my ($self) = @_;
163 if ( $suvelan_spec->{_file_dialog_type_aref} ) {
164  
165 my $index_aref = $suvelan_spec->{_file_dialog_type_aref};
166 return ($index_aref);
167  
168 }
169 else {
170 print(
171 "suvelan_spec, get_file_dialog_type_aref, missing get_file_dialog_type_aref\n"
172 );
173 return ();
174 }
175  
176 return ();
177 }
178  
179 =head2 sub get_flow_type_aref
180  
181 =cut
182  
183 sub get_flow_type_aref {
184  
185 my ($self) = @_;
186  
187 if ( $suvelan_spec->{_flow_type_aref} ) {
188  
189 my $index_aref = $suvelan_spec->{_flow_type_aref};
190 return ($index_aref);
191  
192 }
193 else {
194 print("suvelan_spec, get_flow_type_aref, missing flow_type_aref\n");
195 return ();
196 }
197  
198 }
199  
200 =head2 sub get_incompatibles
201  
202 =cut
203  
204 sub get_incompatibles {
205  
206 my ($self) = @_;
207 my @needed;
208  
209 my @_need_both;
210  
211 my @_need_only_1;
212  
213 my @_none_needed;
214  
215 my @_all_needed;
216  
217 my $params = {
218  
219 _need_both => \@_need_both,
220 _need_only_1 => \@_need_only_1,
221 _none_needed => \@_none_needed,
222 _all_needed => \@_all_needed,
223  
224 };
225  
226 my @of_two = ( 'xx', 'yy' );
227 push @{ $params->{_need_only_1} }, \@of_two;
228  
229 my $len_1_needed = scalar @{ $params->{_need_only_1} };
230  
231 if ( $len_1_needed >= 1 ) {
232  
233 for ( my $i = 0 ; $i < $len_1_needed ; $i++ ) {
234  
235 print(
236 "suvelan, get_incompatibles,need_only_1: @{@{$params->{_need_only_1}}[$i]}\n"
237 );
238  
239 }
240  
241 }
242 else {
243 print("get_incompatibles, no incompatibles\n");
244 }
245  
246 return ($params);
247  
248 }
249  
250 =head2 sub get_prefix_aref
251  
252 =cut
253  
254 sub get_prefix_aref {
255  
256 my ($self) = @_;
257  
258 if ( $suvelan_spec->{_prefix_aref} ) {
259  
260 my $prefix_aref = $suvelan_spec->{_prefix_aref};
261 return ($prefix_aref);
262  
263 }
264 else {
265 print("suvelan_spec, get_prefix_aref, missing prefix_aref\n");
266 return ();
267 }
268  
269 return ();
270 }
271  
272 =head2 sub get_suffix_aref
273  
274 =cut
275  
276 sub get_suffix_aref {
277  
278 my ($self) = @_;
279  
280 if ( $suvelan_spec->{_suffix_aref} ) {
281  
282 my $suffix_aref = $suvelan_spec->{_suffix_aref};
283 return ($suffix_aref);
284  
285 }
286 else {
287 print("$suvelan_spec, get_suffix_aref, missing suffix_aref\n");
288 return ();
289 }
290  
291 return ();
292 }
293  
294 =head2 sub prefix_aref
295  
296 Include in the Set up
297 sections of an output Poop flow.
298  
299 prefixes and suffixes to parameter labels
300 are filtered by sunix_pl
301  
302 =cut
303  
304 sub prefix_aref {
305  
306 my ($self) = @_;
307  
308 my @prefix;
309  
310 for ( my $i = 0 ; $i < $max_index ; $i++ ) {
311  
312 $prefix[$i] = $empty_string;
313  
314 }
315 $suvelan_spec->{_prefix_aref} = \@prefix;
316 return ();
317  
318 }
319  
320 =head2 sub suffix_aref
321  
322 Initialize suffixes as empty
323 Assign specific suffixes to parameter
324 values
325  
326 =cut
327  
328 sub suffix_aref {
329  
330 my ($self) = @_;
331  
332 my @suffix;
333  
334 for ( my $i = 0 ; $i < $max_index ; $i++ ) {
335  
336 $suffix[$i] = $empty_string;
337  
338 }
339 $suvelan_spec->{_suffix_aref} = \@suffix;
340 return ();
341  
342 }
343  
344 =head2 sub variables
345  
346 return a hash array
347 with definitions
348
349 =cut
350  
351 sub variables {
352 my $self = @_;
353 my $hash_ref = $suvelan_spec;
354 return ($hash_ref);
355 }
356  
357 1;