« lib/App/SeismicUnixGui/specs/big_streams/iTopMute_spec.pm
↑ Summary
lib/App/SeismicUnixGui/specs/big_streams/immodpg_spec.pm »
| 1 | package App::SeismicUnixGui::specs::big_streams::iVA_spec; | ||
| 2 | |||
| 3 | =head1 DOCUMENTATION | ||
| 4 | |||
| 5 | =head2 SYNOPSIS | ||
| 6 | |||
| 7 | PERL PROGRAM NAME: iVA_spec | ||
| 8 | AUTHOR: Juan Lorenzo | ||
| 9 | DATE: 2017 | ||
| 10 | |||
| 11 | DESCRIPTION | ||
| 12 | |||
| 13 | |||
| 14 | BASED ON: | ||
| 15 | |||
| 16 | |||
| 17 | =cut | ||
| 18 | |||
| 19 | =head2 USE | ||
| 20 | |||
| 21 | =head3 NOTES | ||
| 22 | |||
| 23 | =head4 Examples | ||
| 24 | |||
| 25 | =head3 SEISMIC UNIX NOTES | ||
| 26 | |||
| 27 | =head2 CHANGES and their DATES | ||
| 28 | |||
| 29 | V1.1 Nov 9, 2020 | ||
| 30 | uses CONFIG | ||
| 31 | |||
| 32 | =cut | ||
| 33 | |||
| 34 | =head2 Notes from bash | ||
| 35 | |||
| 36 | =cut | ||
| 37 | |||
| 38 | use Moose; | ||
| 39 | our $VERSION = '1.1,0'; | ||
| 40 | |||
| 41 | use App::SeismicUnixGui::misc::L_SU_global_constants; | ||
| 42 | use App::SeismicUnixGui::configs::big_streams::Project_config; | ||
| 43 | use App::SeismicUnixGui::misc::SeismicUnix qw($su $suffix_su); | ||
| 44 | |||
| 45 | my $Project = App::SeismicUnixGui::configs::big_streams::Project_config->new(); | ||
| 46 | my $get = App::SeismicUnixGui::misc::L_SU_global_constants->new(); | ||
| 47 | my $var = $get->var(); | ||
| 48 | |||
| 49 | my $empty_string = $var->{_empty_string}; | ||
| 50 | my $true = $var->{_true}; | ||
| 51 | my $false = $var->{_false}; | ||
| 52 | my $file_dialog_type = $get->file_dialog_type_href(); | ||
| 53 | my $flow_type = $get->flow_type_href(); | ||
| 54 | |||
| 55 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); # output data directory | ||
| 56 | my $PL_SEISMIC = $Project->PL_SEISMIC(); | ||
| 57 | |||
| 58 | my $max_index = 17; | ||
| 59 | |||
| 60 | my $iVA_spec = { | ||
| 61 | _CONFIG => $PL_SEISMIC, | ||
| 62 | _DATA_DIR_IN => $DATA_SEISMIC_SU, | ||
| 63 | _DATA_DIR_OUT => $DATA_SEISMIC_SU, | ||
| 64 | _binding_index_aref => '', | ||
| 65 | _suffix_type_in => $su, | ||
| 66 | _data_suffix_in => $suffix_su, | ||
| 67 | _suffix_type_out => $su, | ||
| 68 | _data_suffix_out => $suffix_su, | ||
| 69 | _file_dialog_type_aref => '', | ||
| 70 | _flow_type_aref => '', | ||
| 71 | _has_infile => $false, | ||
| 72 | _has_pipe_in => $false, | ||
| 73 | _has_pipe_out => $false, | ||
| 74 | _has_redirect_in => $false, | ||
| 75 | _has_redirect_out => $false, | ||
| 76 | _has_subin_in => $false, | ||
| 77 | _has_subin_out => $false, | ||
| 78 | _is_data => $false, | ||
| 79 | _is_first_of_2 => $false, | ||
| 80 | _is_first_of_3or_more => $false, | ||
| 81 | _is_first_of_4or_more => $false, | ||
| 82 | _is_last_of_2 => $false, | ||
| 83 | _is_last_of_3or_more => $false, | ||
| 84 | _is_last_of_4or_more => $false, | ||
| 85 | _is_suprog => $false, | ||
| 86 | _is_superflow => $true, | ||
| 87 | _max_index => $max_index, | ||
| 88 | _prefix_aref => '', | ||
| 89 | _suffix_aref => '', | ||
| 90 | }; | ||
| 91 | |||
| 92 | =head2 sub binding_index_aref | ||
| 93 | |||
| 94 | =cut | ||
| 95 | |||
| 96 | sub binding_index_aref { | ||
| 97 | my ($self) = @_; | ||
| 98 | my @index; | ||
| 99 | |||
| 100 | $index[0] = 0; | ||
| 101 | |||
| 102 | $iVA_spec->{_binding_index_aref} = \@index; | ||
| 103 | |||
| 104 | return (); | ||
| 105 | } | ||
| 106 | |||
| 107 | =head2 sub get_binding_index_aref | ||
| 108 | |||
| 109 | =cut | ||
| 110 | |||
| 111 | sub get_binding_index_aref { | ||
| 112 | my ($self) = @_; | ||
| 113 | my @index; | ||
| 114 | |||
| 115 | if ( $iVA_spec->{_binding_index_aref} ) { | ||
| 116 | my $index_aref = $iVA_spec->{_binding_index_aref}; | ||
| 117 | return ($index_aref); | ||
| 118 | |||
| 119 | } | ||
| 120 | else { | ||
| 121 | print("iVA_spec, get_binding_index_aref, missing binding_index_aref\n"); | ||
| 122 | return (); | ||
| 123 | } | ||
| 124 | |||
| 125 | my $index_aref = $iVA_spec->{_binding_index_aref}; | ||
| 126 | |||
| 127 | } | ||
| 128 | |||
| 129 | =head2 sub get_max_index | ||
| 130 | |||
| 131 | =cut | ||
| 132 | |||
| 133 | sub get_max_index { | ||
| 134 | my ($self) = @_; | ||
| 135 | |||
| 136 | if ( $iVA_spec->{_max_index} ) { | ||
| 137 | |||
| 138 | my $max_idx = $max_index; | ||
| 139 | return ($max_idx); | ||
| 140 | |||
| 141 | } | ||
| 142 | else { | ||
| 143 | print("iVA_spec, get_max_index, missing max_index\n"); | ||
| 144 | return (); | ||
| 145 | } | ||
| 146 | } | ||
| 147 | |||
| 148 | =head2 sub file_dialog_type_aref | ||
| 149 | |||
| 150 | =cut | ||
| 151 | |||
| 152 | sub file_dialog_type_aref { | ||
| 153 | my ($self) = @_; | ||
| 154 | |||
| 155 | my @type; | ||
| 156 | |||
| 157 | $type[0] = $file_dialog_type->{_Data}; | ||
| 158 | |||
| 159 | $iVA_spec->{_file_dialog_type_aref} = \@type; | ||
| 160 | |||
| 161 | return (); | ||
| 162 | |||
| 163 | } | ||
| 164 | |||
| 165 | =head2 sub get_file_dialog_type_aref | ||
| 166 | |||
| 167 | =cut | ||
| 168 | |||
| 169 | sub get_file_dialog_type_aref { | ||
| 170 | my ($self) = @_; | ||
| 171 | |||
| 172 | if ( $iVA_spec->{_file_dialog_type_aref} ) { | ||
| 173 | my @type = @{ $iVA_spec->{_file_dialog_type_aref} }; | ||
| 174 | return ( \@type ); | ||
| 175 | } | ||
| 176 | else { | ||
| 177 | print( | ||
| 178 | "iVA_spec,get_file_dialog_type_aref, missing file_dialog_type_aref\n" | ||
| 179 | ); | ||
| 180 | return (); | ||
| 181 | } | ||
| 182 | } | ||
| 183 | |||
| 184 | =head2 sub flow_type_aref | ||
| 185 | |||
| 186 | =cut | ||
| 187 | |||
| 188 | sub flow_type_aref { | ||
| 189 | my ($self) = @_; | ||
| 190 | |||
| 191 | my @type; | ||
| 192 | |||
| 193 | $type[0] = $flow_type->{_pre_built_superflow}; | ||
| 194 | |||
| 195 | $iVA_spec->{_flow_type_aref} = \@type; | ||
| 196 | |||
| 197 | return (); | ||
| 198 | |||
| 199 | } | ||
| 200 | |||
| 201 | =head2 sub get_flow_type_aref | ||
| 202 | |||
| 203 | =cut | ||
| 204 | |||
| 205 | sub get_flow_type_aref { | ||
| 206 | my ($self) = @_; | ||
| 207 | |||
| 208 | if ( $iVA_spec->{_flow_type_aref} ) { | ||
| 209 | my $type_aref = $iVA_spec->{_flow_type_aref}; | ||
| 210 | return ($type_aref); | ||
| 211 | } | ||
| 212 | else { | ||
| 213 | |||
| 214 | print("iVA_spec, get_flow_type_aref, missing flow_type_aref \n"); | ||
| 215 | return (); | ||
| 216 | } | ||
| 217 | } | ||
| 218 | |||
| 219 | =head2 sub get_prefix_aref | ||
| 220 | |||
| 221 | =cut | ||
| 222 | |||
| 223 | sub get_prefix_aref { | ||
| 224 | |||
| 225 | my $self = @_; | ||
| 226 | |||
| 227 | if ( defined $iVA_spec->{_prefix_aref} ) { | ||
| 228 | |||
| 229 | my $prefix_aref= $iVA_spec->{_prefix_aref}; | ||
| 230 | return($prefix_aref); | ||
| 231 | |||
| 232 | } else { | ||
| 233 | print("iVA_spec, get_prefix_aref, missing prefix_aref\n"); | ||
| 234 | return(); | ||
| 235 | } | ||
| 236 | |||
| 237 | return(); | ||
| 238 | } | ||
| 239 | |||
| 240 | =head2 sub get_suffix_aref | ||
| 241 | |||
| 242 | =cut | ||
| 243 | |||
| 244 | sub get_suffix_aref { | ||
| 245 | |||
| 246 | my $self = @_; | ||
| 247 | |||
| 248 | if ($iVA_spec->{_suffix_aref} ) { | ||
| 249 | |||
| 250 | my $suffix_aref= $iVA_spec->{_suffix_aref}; | ||
| 251 | return($suffix_aref); | ||
| 252 | |||
| 253 | } else { | ||
| 254 | print("iVA_spec, get_suffix_aref, missing suffix_aref\n"); | ||
| 255 | return(); | ||
| 256 | } | ||
| 257 | |||
| 258 | return(); | ||
| 259 | } | ||
| 260 | |||
| 261 | |||
| 262 | =head2 sub prefix_aref | ||
| 263 | |||
| 264 | =cut | ||
| 265 | |||
| 266 | sub prefix_aref { | ||
| 267 | |||
| 268 | my $self = @_; | ||
| 269 | |||
| 270 | my @prefix; | ||
| 271 | |||
| 272 | for (my $i=0; $i < $max_index; $i++) { | ||
| 273 | |||
| 274 | $prefix[$i] = $empty_string; | ||
| 275 | |||
| 276 | } | ||
| 277 | $iVA_spec ->{_prefix_aref} = \@prefix; | ||
| 278 | return(); | ||
| 279 | |||
| 280 | } | ||
| 281 | |||
| 282 | |||
| 283 | =head2 sub suffix_aref | ||
| 284 | |||
| 285 | =cut | ||
| 286 | |||
| 287 | sub suffix_aref { | ||
| 288 | |||
| 289 | my $self = @_; | ||
| 290 | |||
| 291 | my @suffix; | ||
| 292 | |||
| 293 | for (my $i=0; $i < $max_index; $i++) { | ||
| 294 | |||
| 295 | $suffix[$i] = $empty_string; | ||
| 296 | |||
| 297 | } | ||
| 298 | $iVA_spec ->{_suffix_aref} = \@suffix; | ||
| 299 | return(); | ||
| 300 | |||
| 301 | } | ||
| 302 | |||
| 303 | |||
| 304 | =head2 sub get_binding_length | ||
| 305 | |||
| 306 | =cut | ||
| 307 | |||
| 308 | sub get_binding_length { | ||
| 309 | my ($self) = @_; | ||
| 310 | |||
| 311 | if ( $iVA_spec->{_binding_index_aref} ) { | ||
| 312 | my $length; | ||
| 313 | $length = scalar @{ $iVA_spec->{_binding_index_aref} }; | ||
| 314 | return ($length); | ||
| 315 | |||
| 316 | } | ||
| 317 | else { | ||
| 318 | |||
| 319 | print("iVA_spec, get_binding_length, missing length \n"); | ||
| 320 | return (); | ||
| 321 | } | ||
| 322 | |||
| 323 | } | ||
| 324 | |||
| 325 | =head2 sub variables | ||
| 326 | |||
| 327 | return a hash array | ||
| 328 | with definitions | ||
| 329 | |||
| 330 | =cut | ||
| 331 | |||
| 332 | sub variables { | ||
| 333 | my ($self) = @_; | ||
| 334 | |||
| 335 | # print("iVA_spec,variables, | ||
| 336 | # first_of_2,$iVA_spec->{_is_first_of_2}\n"); | ||
| 337 | my $hash_ref = $iVA_spec; | ||
| 338 | return ($hash_ref); | ||
| 339 | } | ||
| 340 | |||
| 341 | 1; |