lib/App/SeismicUnixGui/specs/big_streams/iBottomMute_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::iBottomMute_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 my $empty_string = $var->{_empty_string};
13 my $file_dialog_type = $get->file_dialog_type_href();
14 my $flow_type = $get->flow_type_href();
15  
16 my $true = $var->{_true};
17 my $false = $var->{_false};
18 my $Project = App::SeismicUnixGui::configs::big_streams::Project_config->new();
19  
20 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); # output data directory
21 my $PL_SEISMIC = $Project->PL_SEISMIC();
22  
23 my $max_index = 9;
24  
25 my $iBottomMute_spec = {
26 _CONFIG => $PL_SEISMIC,
27 _DATA_DIR_IN => $DATA_SEISMIC_SU,
28 _DATA_DIR_OUT => $DATA_SEISMIC_SU,
29 _binding_index_aref => '',
30 _suffix_type_in => $su,
31 _data_suffix_in => $suffix_su,
32 _suffix_type_out => $su,
33 _data_suffix_out => $suffix_su,
34 _file_dialog_type_aref => '',
35 _flow_type_aref => '',
36 _has_infile => $false,
37 _has_pipe_in => $false,
38 _has_pipe_out => $false,
39 _has_redirect_in => $false,
40 _has_redirect_out => $false,
41 _has_subin_in => $false,
42 _has_subin_out => $false,
43 _is_data => $false,
44 _is_first_of_2 => $false,
45 _is_first_of_3or_more => $false,
46 _is_first_of_4or_more => $false,
47 _is_last_of_2 => $false,
48 _is_last_of_3or_more => $false,
49 _is_last_of_4or_more => $false,
50 _is_suprog => $false,
51 _is_superflow => $true,
52 _max_index => $max_index,
53 _prefix_aref => '',
54 _suffix_aref => '',
55 };
56  
57 =head2 sub binding_index_aref
58  
59 help bind a parameter (in calling module)
60 to a callback via a mouse-click
61  
62 =cut
63  
64 sub binding_index_aref {
65 my ($self) = @_;
66 my @index;
67  
68 $index[0] = 0;
69  
70 $iBottomMute_spec->{_binding_index_aref} = \@index;
71  
72 return ();
73 }
74  
75 =head2 sub get_binding_index_aref
76  
77 =cut
78  
79 sub get_binding_index_aref {
80 my ($self) = @_;
81 my @index;
82  
83 if ( $iBottomMute_spec->{_binding_index_aref} ) {
84 my $index_aref = $iBottomMute_spec->{_binding_index_aref};
85 return ($index_aref);
86  
87 }
88 else {
89 print( "iBottomMute_spec, get_binding_index_aref, missing binding_index_aref\n" );
90 return ();
91 }
92  
93 my $index_aref = $iBottomMute_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 ( $iBottomMute_spec->{_max_index} ) {
105  
106 my $max_idx = $max_index;
107 return ($max_idx);
108  
109 }
110 else {
111 print("iBottomMute_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 $iBottomMute_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 ( $iBottomMute_spec->{_file_dialog_type_aref} ) {
141 my @type = @{ $iBottomMute_spec->{_file_dialog_type_aref} };
142 return ( \@type );
143 }
144 else {
145 print( "iBottomMute_spec,get_file_dialog_type_aref, missing file_dialog_type_aref\n" );
146 return ();
147 }
148 }
149  
150 =head2 sub flow_type_aref
151  
152 an array to define the type of flow that is
153 being used, e.g., user_built or pre-built superflow (this case)
154 important for binding buttons to opening certain directories
155  
156 =cut
157  
158 sub flow_type_aref {
159 my ($self) = @_;
160  
161 my @type;
162  
163 $type[0] = $flow_type->{_pre_built_superflow};
164  
165 $iBottomMute_spec->{_flow_type_aref} = \@type;
166  
167 return ();
168  
169 }
170  
171 =head2 sub get_flow_type_aref
172  
173 =cut
174  
175 sub get_flow_type_aref {
176 my ($self) = @_;
177  
178 if ( $iBottomMute_spec->{_flow_type_aref} ) {
179 my $type_aref = $iBottomMute_spec->{_flow_type_aref};
180  
181 return ($type_aref);
182 }
183 else {
184  
185 print("iBottomMute_spec, get_flow_type_aref, missing flow_type_aref \n");
186 return ();
187 }
188 }
189 =head2 sub get_prefix_aref
190  
191 =cut
192  
193 sub get_prefix_aref {
194  
195 my $self = @_;
196  
197 if ( defined $iBottomMute_spec->{_prefix_aref} ) {
198  
199 my $prefix_aref= $iBottomMute_spec->{_prefix_aref};
200 return($prefix_aref);
201  
202 } else {
203 print("iBottomMute_spec, get_prefix_aref, missing prefix_aref\n");
204 return();
205 }
206  
207 return();
208 }
209  
210 =head2 sub get_suffix_aref
211  
212 =cut
213  
214 sub get_suffix_aref {
215  
216 my $self = @_;
217  
218 if ($iBottomMute_spec->{_suffix_aref} ) {
219  
220 my $suffix_aref= $iBottomMute_spec->{_suffix_aref};
221 return($suffix_aref);
222  
223 } else {
224 print("iBottomMute_spec, get_suffix_aref, missing suffix_aref\n");
225 return();
226 }
227  
228 return();
229 }
230  
231  
232 =head2 sub prefix_aref
233  
234 =cut
235  
236 sub prefix_aref {
237  
238 my $self = @_;
239  
240 my @prefix;
241  
242 for (my $i=0; $i < $max_index; $i++) {
243  
244 $prefix[$i] = $empty_string;
245  
246 }
247 $iBottomMute_spec ->{_prefix_aref} = \@prefix;
248 return();
249  
250 }
251  
252  
253 =head2 sub suffix_aref
254  
255 =cut
256  
257 sub suffix_aref {
258  
259 my $self = @_;
260  
261 my @suffix;
262  
263 for (my $i=0; $i < $max_index; $i++) {
264  
265 $suffix[$i] = $empty_string;
266  
267 }
268 $iBottomMute_spec ->{_suffix_aref} = \@suffix;
269 return();
270  
271 }
272  
273  
274  
275 =head2 sub get_binding_length
276  
277 =cut
278  
279 sub get_binding_length {
280 my ($self) = @_;
281  
282 if ( $iBottomMute_spec->{_binding_index_aref} ) {
283 my $length;
284 $length = scalar @{ $iBottomMute_spec->{_binding_index_aref} };
285 return ($length);
286  
287 }
288 else {
289  
290 print("iBottomMute_spec, get_binding_length, missing length \n");
291 return ();
292 }
293  
294 }
295  
296 =head2 sub variables
297  
298 return a hash array
299 with definitions
300  
301 =cut
302  
303 sub variables {
304 my ($self) = @_;
305  
306 # print("iBottomMute_spec,variables,
307 # first_of_2,$iBottomMute_spec->{_is_first_of_2}\n");
308 my $hash_ref = $iBottomMute_spec;
309 return ($hash_ref);
310 }
311  
312 1;