lib/App/SeismicUnixGui/specs/datum/sudatumk2dr_spec.pm untested

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