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