lib/App/SeismicUnixGui/specs/big_streams/iTopMute_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::iTopMute_spec;
2  
3 use Moose;
4 our $VERSION = '1.0.0';
5  
6 use App::SeismicUnixGui::misc::SeismicUnix qw($su $suffix_su);
7 use App::SeismicUnixGui::misc::L_SU_global_constants;
8 use App::SeismicUnixGui::configs::big_streams::Project_config;
9  
10 my $get = App::SeismicUnixGui::misc::L_SU_global_constants->new();
11 my $var = $get->var();
12  
13 my $empty_string = $var->{_empty_string};
14 my $file_dialog_type = $get->file_dialog_type_href();
15 my $flow_type = $get->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 $PL_SEISMIC = $Project->PL_SEISMIC();
23  
24 my $max_index = 9;
25  
26 my $iTopMute_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 => $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 =cut
61  
62 sub binding_index_aref {
63 my ($self) = @_;
64 my @index;
65  
66 $index[0] = 0;
67  
68 $iTopMute_spec->{_binding_index_aref} = \@index;
69  
70 return ();
71 }
72  
73 =head2 sub get_binding_index_aref
74  
75 =cut
76  
77 sub get_binding_index_aref {
78 my ($self) = @_;
79 my @index;
80  
81 if ( $iTopMute_spec->{_binding_index_aref} ) {
82 my $index_aref = $iTopMute_spec->{_binding_index_aref};
83 return ($index_aref);
84  
85 }
86 else {
87 print(
88 "iTopMute_spec, get_binding_index_aref, missing binding_index_aref\n"
89 );
90 return ();
91 }
92  
93 my $index_aref = $iTopMute_spec->{_binding_index_aref};
94  
95 }
96  
97 =head2 sub get_max_index
98  
99 =cut
100  
101 sub get_max_index {
102 my ($self) = @_;
103  
104 if ( $iTopMute_spec->{_max_index} ) {
105  
106 my $max_idx = $iTopMute_spec->{_max_index};
107 return ($max_idx);
108  
109 }
110 else {
111 print("iTopMute_spec, get_max_index, missing max_index\n");
112 return ();
113 }
114 }
115  
116 =head2 sub file_dialog_type_aref
117  
118 =cut
119  
120 sub file_dialog_type_aref {
121 my ($self) = @_;
122  
123 my @type;
124  
125 $type[0] = $file_dialog_type->{_Data};
126  
127 $iTopMute_spec->{_file_dialog_type_aref} = \@type;
128  
129 return ();
130  
131 }
132  
133 =head2 sub get_file_dialog_type_aref
134  
135 =cut
136  
137 sub get_file_dialog_type_aref {
138 my ($self) = @_;
139  
140 if ( $iTopMute_spec->{_file_dialog_type_aref} ) {
141 my @type = @{ $iTopMute_spec->{_file_dialog_type_aref} };
142 return ( \@type );
143 }
144 else {
145 print(
146 "iTopMute_spec,get_file_dialog_type_aref, missing file_dialog_type_aref\n"
147 );
148 return ();
149 }
150 }
151  
152 =head2 sub flow_type_aref
153  
154 =cut
155  
156 sub flow_type_aref {
157 my ($self) = @_;
158  
159 my @type;
160  
161 $type[0] = $flow_type->{_pre_built_superflow};
162  
163 $iTopMute_spec->{_flow_type_aref} = \@type;
164  
165 return ();
166  
167 }
168  
169 =head2 sub get_flow_type_aref
170  
171 =cut
172  
173 sub get_flow_type_aref {
174 my ($self) = @_;
175  
176 if ( $iTopMute_spec->{_flow_type_aref} ) {
177 my $type_aref = $iTopMute_spec->{_flow_type_aref};
178 return ($type_aref);
179 }
180 else {
181  
182 print("iTopMute_spec, get_flow_type_aref, missing flow_type_aref \n");
183 return ();
184 }
185 }
186  
187 =head2 sub get_prefix_aref
188  
189 =cut
190  
191 sub get_prefix_aref {
192  
193 my $self = @_;
194  
195 if ( defined $iTopMute_spec->{_prefix_aref} ) {
196  
197 my $prefix_aref = $iTopMute_spec->{_prefix_aref};
198 return ($prefix_aref);
199  
200 }
201 else {
202 print("iTopMute_spec, get_prefix_aref, missing prefix_aref\n");
203 return ();
204 }
205  
206 return ();
207 }
208  
209 =head2 sub get_suffix_aref
210  
211 =cut
212  
213 sub get_suffix_aref {
214  
215 my $self = @_;
216  
217 if ( $iTopMute_spec->{_suffix_aref} ) {
218  
219 my $suffix_aref = $iTopMute_spec->{_suffix_aref};
220 return ($suffix_aref);
221  
222 }
223 else {
224 print("iTopMute_spec, get_suffix_aref, missing suffix_aref\n");
225 return ();
226 }
227  
228 return ();
229 }
230  
231 =head2 sub prefix_aref
232  
233 =cut
234  
235 sub prefix_aref {
236  
237 my $self = @_;
238  
239 my @prefix;
240  
241 for ( my $i = 0 ; $i < $max_index ; $i++ ) {
242  
243 $prefix[$i] = $empty_string;
244  
245 }
246 $iTopMute_spec->{_prefix_aref} = \@prefix;
247 return ();
248  
249 }
250  
251 =head2 sub suffix_aref
252  
253 =cut
254  
255 sub suffix_aref {
256  
257 my $self = @_;
258  
259 my @suffix;
260  
261 for ( my $i = 0 ; $i < $max_index ; $i++ ) {
262  
263 $suffix[$i] = $empty_string;
264  
265 }
266 $iTopMute_spec->{_suffix_aref} = \@suffix;
267 return ();
268  
269 }
270  
271 =head2 sub get_binding_length
272  
273 =cut
274  
275 sub get_binding_length {
276 my ($self) = @_;
277  
278 if ( $iTopMute_spec->{_binding_index_aref} ) {
279 my $length;
280 $length = scalar @{ $iTopMute_spec->{_binding_index_aref} };
281 return ($length);
282  
283 }
284 else {
285  
286 print("iTopMute_spec, get_binding_length, missing length \n");
287 return ();
288 }
289  
290 }
291  
292 =head2 sub variables
293  
294 return a hash array
295 with definitions
296  
297 =cut
298  
299 sub variables {
300 my ($self) = @_;
301  
302 # print("iTopMute_spec,variables,
303 # first_of_2,$iTopMute_spec->{_is_first_of_2}\n");
304 my $hash_ref = $iTopMute_spec;
305 return ($hash_ref);
306 }
307  
308 1;