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

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