lib/App/SeismicUnixGui/specs/statsMath/suacor_spec.pm untested

filter: Statementstmt 0.0% 0 / 116 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 / 161 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::statsMath::suacor_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::statsMath::suacor';
9  
10 my $get = L_SU_global_constants->new();
11 my $Project = Project_config->new();
12 my $suacor = suacor->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 = $suacor->get_max_index();
25  
26 my $suacor_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 => $false,
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 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 $suacor_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  
82 my ($self) = @_;
83 my @type;
84  
85 $type[0] = '';
86  
87 $suacor_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 $suacor_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 ( $suacor_spec->{_binding_index_aref} ) {
121  
122 my $index_aref = $suacor_spec->{_binding_index_aref};
123 return ($index_aref);
124  
125 }
126 else {
127 print(
128 "suacor_spec, get_binding_index_aref, missing binding_index_aref\n"
129 );
130 return ();
131 }
132  
133 my $index_aref = $suacor_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 ( $suacor_spec->{_binding_index_aref} ) {
145  
146 my $length;
147  
148 $length = scalar @{ $suacor_spec->{_binding_index_aref} };
149  
150 return ($length);
151  
152 }
153 else {
154 print("suacor_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 ( $suacor_spec->{_file_dialog_type_aref} ) {
168  
169 my @type = @{ $suacor_spec->{_file_dialog_type_aref} };
170  
171 return ( \@type );
172  
173 }
174 else {
175 print(
176 "suacor_spec,get_file_dialog_type_aref, missing file_dialog_type_aref\n"
177 );
178 return ();
179 }
180  
181 }
182  
183 =head2 sub get_flow_type_aref
184  
185 =cut
186  
187 sub get_flow_type_aref {
188 my ($self) = @_;
189 if ( $suacor_spec->{_flow_type_aref} ) {
190  
191 my $type_aref = $suacor_spec->{_flow_type_aref};
192  
193 return ($type_aref);
194  
195 }
196 else {
197 print("suacor_spec, get_flow_type_aref, missing flow_type_aref \n");
198 return ();
199 }
200 }
201  
202 =head2 sub get_max_index
203  
204 =cut
205  
206 sub get_max_index {
207  
208 my ($self) = @_;
209  
210 if ( $suacor_spec->{_max_index} ) {
211  
212 my $max_idx = $suacor->get_max_index();
213 return ($max_idx);
214  
215 }
216 else {
217 print("suacor_spec, get_max_index, missing max_index\n");
218 return ();
219 }
220 }
221  
222 =head2 sub get_prefix_aref
223  
224 =cut
225  
226 sub get_prefix_aref {
227  
228 my ($self) = @_;
229  
230 if ( $suacor_spec->{_prefix_aref} ) {
231  
232 my $prefix_aref = $suacor_spec->{_prefix_aref};
233 return ($prefix_aref);
234  
235 }
236 else {
237 print("suacor_spec, get_prefix_aref, missing prefix_aref\n");
238 return ();
239 }
240  
241 return ();
242 }
243  
244 =head2 sub get_suffix_aref
245  
246 =cut
247  
248 sub get_suffix_aref {
249  
250 my ($self) = @_;
251  
252 if ( $suacor_spec->{_suffix_aref} ) {
253  
254 my $suffix_aref = $suacor_spec->{_suffix_aref};
255 return ($suffix_aref);
256  
257 }
258 else {
259 print("$suacor_spec, get_suffix_aref, missing suffix_aref\n");
260 return ();
261 }
262  
263 return ();
264 }
265  
266 =head2 sub prefix_aref
267  
268 Include in the Set up
269 sections of an output Poop flow.
270  
271 prefixes and suffixes to parameter labels
272 are filtered by sunix_pl
273  
274 =cut
275  
276 sub prefix_aref {
277  
278 my ($self) = @_;
279  
280 my @prefix;
281  
282 for ( my $i = 0 ; $i < $max_index ; $i++ ) {
283  
284 $prefix[$i] = $empty_string;
285  
286 }
287 $suacor_spec->{_prefix_aref} = \@prefix;
288 return ();
289  
290 }
291  
292 =head2 sub suffix_aref
293  
294 Initialize suffixes as empty
295 Assign specific suffixes to parameter
296 values
297  
298 =cut
299  
300 sub suffix_aref {
301  
302 my ($self) = @_;
303  
304 my @suffix;
305  
306 for ( my $i = 0 ; $i < $max_index ; $i++ ) {
307  
308 $suffix[$i] = $empty_string;
309  
310 }
311 $suacor_spec->{_suffix_aref} = \@suffix;
312 return ();
313  
314 }
315  
316 =head2 sub variables
317 return a hash array
318 with definitions
319  
320 =cut
321  
322 sub variables {
323  
324 my ($self) = @_;
325  
326 my $hash_ref = $suacor_spec;
327  
328 return ($hash_ref);
329  
330 }
331  
332 1;