lib/App/SeismicUnixGui/specs/par/a2b_spec.pm untested

filter: Statementstmt 0.0% 0 / 118 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 / 163 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::par::a2b_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($bin $txt $su $suffix_txt $suffix_bin);
7 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
8 use aliased 'App::SeismicUnixGui::sunix::par::a2b';
9  
10 my $get = L_SU_global_constants->new();
11 my $Project = Project_config->new();
12 my $a2b = a2b->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_BIN = $Project->DATA_SEISMIC_BIN();
23 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
24 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
25 my $PL_SEISMIC = $Project->PL_SEISMIC();
26 my $max_index = $a2b->get_max_index();
27  
28 my $a2b_spec = {
29 _CONFIG => $PL_SEISMIC,
30 _DATA_DIR_IN => $PL_SEISMIC,
31 _DATA_DIR_OUT => $PL_SEISMIC,
32 _binding_index_aref => '',
33 _suffix_type_in => $suffix_txt,
34 _data_suffix_in => $suffix_txt,
35 _suffix_type_out => $bin,
36 _data_suffix_out => $suffix_bin,
37 _file_dialog_type_aref => '',
38 _flow_type_aref => '',
39 _has_infile => $true,
40 _has_outpar => $true,
41 _has_pipe_in => $true,
42 _has_pipe_out => $true,
43 _has_redirect_in => $true,
44 _has_redirect_out => $true,
45 _has_subin_in => $false,
46 _has_subin_out => $true,
47 _is_data => $false,
48 _is_first_of_2 => $true,
49 _is_first_of_3or_more => $true,
50 _is_first_of_4or_more => $true,
51 _is_last_of_2 => $false,
52 _is_last_of_3or_more => $false,
53 _is_last_of_4or_more => $false,
54 _is_suprog => $true,
55 _is_superflow => $false,
56 _max_index => $max_index,
57 };
58  
59 my $incompatibles = { clip => [ 'mbal', 'pbal' ], };
60  
61 =head2 sub _sub_binding_index_aref
62  
63 =cut
64  
65 sub binding_index_aref {
66  
67 my ($self) = @_;
68  
69 my @index;
70  
71 # first binding index (0)
72 # connects to second item (1)
73 # in the parameter list
74 $index[0] = 1;
75  
76 $a2b_spec->{_binding_index_aref} = \@index;
77 return ();
78  
79 }
80  
81 =head2 sub file_dialog_type_aref
82  
83 =cut
84  
85 sub file_dialog_type_aref {
86 my ($self) = @_;
87  
88 my @type;
89  
90 # bound index will look for data
91 $type[0] = $file_dialog_type->{_Data};
92  
93 $a2b_spec->{_file_dialog_type_aref} = \@type;
94  
95 return ();
96  
97 }
98  
99 =head2 sub flow_type_aref
100  
101 =cut
102  
103 sub flow_type_aref {
104  
105 my ($self) = @_;
106  
107 my @type;
108  
109 $type[0] = $flow_type->{_user_built};
110  
111 $a2b_spec->{_flow_type_aref} = \@type;
112  
113 return ();
114  
115 }
116  
117 =head2 sub get_binding_index_aref
118  
119 =cut
120  
121 sub get_binding_index_aref {
122  
123 my ($self) = @_;
124 my @index;
125  
126 if ( $a2b_spec->{_binding_index_aref} ) {
127  
128 my $index_aref = $a2b_spec->{_binding_index_aref};
129 return ($index_aref);
130  
131 }
132 else {
133 print("a2b_spec, get_binding_index_aref, missing binding_index_aref\n");
134 return ();
135 }
136  
137 my $index_aref = $a2b_spec->{_binding_index_aref};
138  
139 }
140  
141 =head2 sub get_binding_length
142  
143 =cut
144  
145 sub get_binding_length {
146 my ($self) = @_;
147  
148 if ( $a2b_spec->{_binding_index_aref} ) {
149  
150 my $length;
151  
152 $length = scalar @{ $a2b_spec->{_binding_index_aref} };
153  
154 return ($length);
155  
156 }
157 else {
158 print("a2b_spec, get_binding_length, missing length \n");
159 return ();
160 }
161  
162 }
163  
164 =head2 sub get_file_dialog_type_aref
165  
166 =cut
167  
168 sub get_file_dialog_type_aref {
169  
170 my ($self) = @_;
171 if ( $a2b_spec->{_file_dialog_type_aref} ) {
172  
173 my @type = @{ $a2b_spec->{_file_dialog_type_aref} };
174  
175 return ( \@type );
176  
177 }
178 else {
179 print(
180 "a2b_spec,get_file_dialog_type_aref, missing file_dialog_type_aref\n"
181 );
182 return ();
183 }
184  
185 }
186  
187 =head2 sub get_flow_type_aref
188  
189 =cut
190  
191 sub get_flow_type_aref {
192 my ($self) = @_;
193 if ( $a2b_spec->{_flow_type_aref} ) {
194  
195 my $type_aref = $a2b_spec->{_flow_type_aref};
196  
197 return ($type_aref);
198  
199 }
200 else {
201 print("a2b_spec, get_flow_type_aref, missing flow_type_aref \n");
202 return ();
203 }
204 }
205  
206 =head2 sub get_max_index
207  
208 =cut
209  
210 sub get_max_index {
211  
212 my ($self) = @_;
213  
214 if ( $a2b_spec->{_max_index} ) {
215  
216 my $max_idx = $a2b->get_max_index();
217 return ($max_idx);
218  
219 }
220 else {
221 print("a2b_spec, get_max_index, missing max_index\n");
222 return ();
223 }
224 }
225  
226 =head2 sub get_prefix_aref
227  
228 =cut
229  
230 sub get_prefix_aref {
231  
232 my ($self) = @_;
233  
234 if ( $a2b_spec->{_prefix_aref} ) {
235  
236 my $prefix_aref = $a2b_spec->{_prefix_aref};
237 return ($prefix_aref);
238  
239 }
240 else {
241 print("a2b_spec, get_prefix_aref, missing prefix_aref\n");
242 return ();
243 }
244  
245 return ();
246 }
247  
248 =head2 sub get_suffix_aref
249  
250 =cut
251  
252 sub get_suffix_aref {
253  
254 my ($self) = @_;
255  
256 if ( $a2b_spec->{_suffix_aref} ) {
257  
258 my $suffix_aref = $a2b_spec->{_suffix_aref};
259 return ($suffix_aref);
260  
261 }
262 else {
263 print("a2b_spec, get_suffix_aref, missing suffix_aref\n");
264 return ();
265 }
266  
267 return ();
268 }
269  
270 =head2 sub prefix_aref
271  
272 Include in the Set up
273 sections of an output Poop flow.
274  
275 prefixes and suffixes to parameter labels
276 are filtered by sunix_pl
277  
278 =cut
279  
280 sub prefix_aref {
281  
282 my ($self) = @_;
283  
284 my @prefix;
285  
286 for ( my $i = 0 ; $i < $max_index ; $i++ ) {
287  
288 $prefix[$i] = $empty_string;
289  
290 }
291 $a2b_spec->{_prefix_aref} = \@prefix;
292 return ();
293  
294 }
295  
296 =head2 sub suffix_aref
297  
298 Initialize suffixes as empty
299 Assign specific suffixes to parameter
300 values
301  
302 =cut
303  
304 sub suffix_aref {
305  
306 my ($self) = @_;
307  
308 my @suffix;
309  
310 for ( my $i = 0 ; $i < $max_index ; $i++ ) {
311  
312 $suffix[$i] = $empty_string;
313  
314 }
315 $a2b_spec->{_suffix_aref} = \@suffix;
316 return ();
317  
318 }
319  
320 =head2 sub variables
321 return a hash array
322 with definitions
323  
324 =cut
325  
326 sub variables {
327  
328 my ($self) = @_;
329  
330 my $hash_ref = $a2b_spec;
331  
332 return ($hash_ref);
333  
334 }
335  
336 1;