lib/App/SeismicUnixGui/specs/big_streams/immodpg_spec.pm untested

filter: Statementstmt 0.0% 0 / 110 Branchbran 0.0% 0 / 14 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 17 Podpod 0.0% 0 / 13 totaltotal 0.0% 0 / 154 CC 8 SCAR 14.7
CC
8
Cov
0%
get_binding_index_aref
6.0
get_max_index
6.0
get_file_dialog_type_aref
6.0
CRAP 4.3
1 package App::SeismicUnixGui::specs::big_streams::immodpg_spec;
2  
3 use Moose;
4 our $VERSION = '0.0.1';
5  
6 use App::SeismicUnixGui::misc::SeismicUnix qw($su $suffix_su);
7 require App::SeismicUnixGui::misc::L_SU_global_constants;
8 require App::SeismicUnixGui::configs::big_streams::Project_config;
9  
10 my $L_SU_global_constants = App::SeismicUnixGui::misc::L_SU_global_constants->new();
11 my $var = $L_SU_global_constants->var();
12  
13 my $empty_string = $var->{_empty_string};
14 my $file_dialog_type = $L_SU_global_constants->file_dialog_type_href();
15 my $flow_type = $L_SU_global_constants->flow_type_href();
16  
17 my $true = $var->{_true};
18 my $false = $var->{_false};
19  
20 my $Project = App::SeismicUnixGui::configs::big_streams::Project_config->new();
21 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); # output data directory
22 my $IMMODPG = $Project->IMMODPG();
23  
24 my $max_index = 19;
25  
26 my $immodpg_spec = {
27 _CONFIG => $IMMODPG,
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 => $false,
38 _has_pipe_in => $false,
39 _has_pipe_out => $false,
40 _has_redirect_in => $false,
41 _has_redirect_out => $false,
42 _has_subin_in => $false,
43 _has_subin_out => $false,
44 _is_data => $false,
45 _is_first_of_2 => $false,
46 _is_first_of_3or_more => $false,
47 _is_first_of_4or_more => $false,
48 _is_last_of_2 => $false,
49 _is_last_of_3or_more => $false,
50 _is_last_of_4or_more => $false,
51 _is_suprog => $false,
52 _is_superflow => $true,
53 _max_index => $max_index,
54 _prefix_aref => '',
55 _suffix_aref => '',
56 };
57  
58 =head2 sub binding_index_aref
59  
60 out
61  
62 =cut
63  
64 sub binding_index_aref {
65 my ($self) = @_;
66 my @index;
67  
68 $index[0] = 0; # item is bound to _DATA_DIR_IN
69  
70 $immodpg_spec->{_binding_index_aref} = \@index;
71  
72 return ();
73 }
74  
75 =head2 sub get_binding_index_aref
76  
77  
78 =cut
79  
80 sub get_binding_index_aref {
81 my ($self) = @_;
82 my @index;
83  
84 if ( $immodpg_spec->{_binding_index_aref} ) {
85 my $index_aref = $immodpg_spec->{_binding_index_aref};
86 return ($index_aref);
87  
88 }
89 else {
90 print(
91 "immodpg_spec, get_binding_index_aref, missing binding_index_aref\n"
92 );
93 return ();
94 }
95  
96 my $index_aref = $immodpg_spec->{_binding_index_aref};
97  
98 }
99  
100 =head2 sub get_max_index
101  
102 =cut
103  
104 sub get_max_index {
105 my ($self) = @_;
106  
107 if ( $immodpg_spec->{_max_index} ) {
108  
109 my $max_idx = $immodpg_spec->{_max_index};
110 return ($max_idx);
111  
112 }
113 else {
114 print("immodpg_spec, get_max_index, missing max_index\n");
115 return ();
116 }
117 }
118  
119  
120 =head2 sub file_dialog_type_aref
121  
122 =cut
123  
124 sub file_dialog_type_aref {
125 my ($self) = @_;
126  
127 my @type;
128  
129 $type[0] = $file_dialog_type->{_Data};
130  
131 $immodpg_spec->{_file_dialog_type_aref} = \@type;
132  
133 return ();
134  
135 }
136  
137 =head2 sub get_file_dialog_type_aref
138  
139 =cut
140  
141 sub get_file_dialog_type_aref {
142 my ($self) = @_;
143  
144 if ( $immodpg_spec->{_file_dialog_type_aref} ) {
145 my @type = @{ $immodpg_spec->{_file_dialog_type_aref} };
146 return ( \@type );
147 }
148 else {
149 print(
150 "immodpg_spec,get_file_dialog_type_aref, missing file_dialog_type_aref\n"
151 );
152 return ();
153 }
154 }
155  
156 =head2 sub flow_type_aref
157  
158 =cut
159  
160 sub flow_type_aref {
161 my ($self) = @_;
162  
163 my @type;
164  
165 $type[0] = $flow_type->{_pre_built_superflow};
166  
167 $immodpg_spec->{_flow_type_aref} = \@type;
168  
169 return ();
170  
171 }
172  
173 =head2 sub get_flow_type_aref
174  
175 =cut
176  
177 sub get_flow_type_aref {
178 my ($self) = @_;
179  
180 if ( $immodpg_spec->{_flow_type_aref} ) {
181 my $type_aref = $immodpg_spec->{_flow_type_aref};
182 return ($type_aref);
183 }
184 else {
185  
186 print("immodpg_spec, get_flow_type_aref, missing flow_type_aref \n");
187 return ();
188 }
189 }
190  
191 =head2 sub get_prefix_aref
192  
193 =cut
194  
195 sub get_prefix_aref {
196  
197 my $self = @_;
198  
199 if ( defined $immodpg_spec->{_prefix_aref} ) {
200  
201 my $prefix_aref= $immodpg_spec->{_prefix_aref};
202 return($prefix_aref);
203  
204 } else {
205 print("immodpg_spec, get_prefix_aref, missing prefix_aref\n");
206 return();
207 }
208  
209 return();
210 }
211  
212 =head2 sub get_suffix_aref
213  
214 =cut
215  
216 sub get_suffix_aref {
217  
218 my $self = @_;
219  
220 if ($immodpg_spec->{_suffix_aref} ) {
221  
222 my $suffix_aref= $immodpg_spec->{_suffix_aref};
223 return($suffix_aref);
224  
225 } else {
226 print("immodpg_spec, get_suffix_aref, missing suffix_aref\n");
227 return();
228 }
229  
230 return();
231 }
232  
233  
234 =head2 sub prefix_aref
235  
236 =cut
237  
238 sub prefix_aref {
239  
240 my $self = @_;
241  
242 my @prefix;
243  
244 for (my $i=0; $i < $max_index; $i++) {
245  
246 $prefix[$i] = $empty_string;
247  
248 }
249 $immodpg_spec ->{_prefix_aref} = \@prefix;
250 return();
251  
252 }
253  
254  
255 =head2 sub suffix_aref
256  
257 =cut
258  
259 sub suffix_aref {
260  
261 my $self = @_;
262  
263 my @suffix;
264  
265 for (my $i=0; $i < $max_index; $i++) {
266  
267 $suffix[$i] = $empty_string;
268  
269 }
270 $immodpg_spec ->{_suffix_aref} = \@suffix;
271 return();
272  
273 }
274  
275  
276 =head2 sub get_binding_length
277  
278 =cut
279  
280 sub get_binding_length {
281 my ($self) = @_;
282  
283 if ( $immodpg_spec->{_binding_index_aref} ) {
284 my $length;
285 $length = scalar @{ $immodpg_spec->{_binding_index_aref} };
286 return ($length);
287  
288 }
289 else {
290  
291 print("immodpg_spec, get_binding_length, missing length \n");
292 return ();
293 }
294  
295 }
296  
297 =head2 sub variables
298  
299 return a hash array
300 with definitions
301  
302 =cut
303  
304 sub variables {
305 my ($self) = @_;
306  
307 # print("immodpg_spec,variables,
308 # first_of_2,$immodpg_spec->{_is_first_of_2}\n");
309 my $hash_ref = $immodpg_spec;
310 return ($hash_ref);
311 }
312  
313 1;