« lib/App/SeismicUnixGui/specs/big_streams/RestoreProject_spec.pm
↑ Summary
lib/App/SeismicUnixGui/specs/big_streams/Sucat_spec.pm »
| 1 | package App::SeismicUnixGui::specs::big_streams::Sseg2su_spec; | ||
| 2 | |||
| 3 | use Moose; | ||
| 4 | our $VERSION = '1.0.0'; | ||
| 5 | |||
| 6 | use App::SeismicUnixGui::misc::SeismicUnix qw($seg2 $suffix_DAT $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 | |||
| 23 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); # output data directory | ||
| 24 | my $DATA_SEISMIC_SEG2 = $Project->DATA_SEISMIC_SEG2(); # input data directory | ||
| 25 | my $PL_SEISMIC = $Project->PL_SEISMIC(); | ||
| 26 | |||
| 27 | my $max_index = 1; | ||
| 28 | |||
| 29 | =pod | ||
| 30 | |||
| 31 | |||
| 32 | max_index from local Sseg2su.config file | ||
| 33 | |||
| 34 | =cut | ||
| 35 | |||
| 36 | my $Sseg2su_spec = { | ||
| 37 | _CONFIG => $PL_SEISMIC, | ||
| 38 | _DATA_DIR_IN => $DATA_SEISMIC_SEG2, | ||
| 39 | _DATA_DIR_OUT => $DATA_SEISMIC_SU, | ||
| 40 | _binding_index_aref => '', | ||
| 41 | _suffix_type_in => $seg2, | ||
| 42 | _data_suffix_in => $suffix_DAT, | ||
| 43 | _suffix_type_out => $su, | ||
| 44 | _data_suffix_out => $suffix_su, | ||
| 45 | _file_dialog_type_aref => '', | ||
| 46 | _flow_type_aref => '', | ||
| 47 | _has_infile => $false, # internally yes but not in the superflow list | ||
| 48 | _has_pipe_in => $false, # internally yes but not in the superflow list | ||
| 49 | _has_pipe_out => $false, # internally yes but not in the superflow list | ||
| 50 | _has_redirect_in => $false, # internally yes but not in the superflow list | ||
| 51 | _has_redirect_out => $false, # internally yes but not in the superflow list | ||
| 52 | _has_subin_in => $false, # internally yes but not in the superflow list | ||
| 53 | _has_subin_out => $false, # not in the superflow list | ||
| 54 | _is_data => $false, # superflow | ||
| 55 | _is_first_of_2 => $false, # not part of a list of sunix programs | ||
| 56 | _is_first_of_3or_more => $false, # not part of a list of sunix programs | ||
| 57 | _is_first_of_4or_more => $false, # not part of a list of sunix programs | ||
| 58 | _is_last_of_2 => $false, # not part of a list of sunix programs | ||
| 59 | _is_last_of_3or_more => $false, # not part of a list of sunix programs | ||
| 60 | _is_last_of_4or_more => $false, # not part of a list of sunix programs | ||
| 61 | _is_suprog => $false, # not a direct sunix program | ||
| 62 | _is_superflow => $true, | ||
| 63 | _max_index => $max_index, # max 2 variables | ||
| 64 | _prefix_aref => '', | ||
| 65 | _suffix_aref => '', | ||
| 66 | }; | ||
| 67 | |||
| 68 | =head2 sub binding_index_aref | ||
| 69 | |||
| 70 | =cut | ||
| 71 | |||
| 72 | sub binding_index_aref { | ||
| 73 | my ($self) = @_; | ||
| 74 | my @index; | ||
| 75 | |||
| 76 | $index[0] = 0; | ||
| 77 | |||
| 78 | $Sseg2su_spec->{_binding_index_aref} = \@index; | ||
| 79 | |||
| 80 | return (); | ||
| 81 | } | ||
| 82 | |||
| 83 | =head2 sub get_binding_index_aref | ||
| 84 | |||
| 85 | =cut | ||
| 86 | |||
| 87 | sub get_binding_index_aref { | ||
| 88 | my ($self) = @_; | ||
| 89 | my @index; | ||
| 90 | |||
| 91 | if ( $Sseg2su_spec->{_binding_index_aref} ) { | ||
| 92 | my $index_aref = $Sseg2su_spec->{_binding_index_aref}; | ||
| 93 | return ($index_aref); | ||
| 94 | |||
| 95 | } | ||
| 96 | else { | ||
| 97 | print( | ||
| 98 | "Sseg2su_spec, get_binding_index_aref, missing binding_index_aref\n" | ||
| 99 | ); | ||
| 100 | return (); | ||
| 101 | } | ||
| 102 | |||
| 103 | my $index_aref = $Sseg2su_spec->{_binding_index_aref}; | ||
| 104 | |||
| 105 | } | ||
| 106 | |||
| 107 | =head2 sub get_max_index | ||
| 108 | |||
| 109 | =cut | ||
| 110 | |||
| 111 | sub get_max_index { | ||
| 112 | my ($self) = @_; | ||
| 113 | |||
| 114 | if ( $Sseg2su_spec->{_max_index} ) { | ||
| 115 | |||
| 116 | my $max_idx = $max_index; | ||
| 117 | return ($max_idx); | ||
| 118 | |||
| 119 | } | ||
| 120 | else { | ||
| 121 | print("Sseg2su_spec, get_max_index, missing max_index\n"); | ||
| 122 | return (); | ||
| 123 | } | ||
| 124 | } | ||
| 125 | |||
| 126 | =head2 sub file_dialog_type_aref | ||
| 127 | |||
| 128 | =cut | ||
| 129 | |||
| 130 | sub file_dialog_type_aref { | ||
| 131 | my ($self) = @_; | ||
| 132 | |||
| 133 | my @type; | ||
| 134 | |||
| 135 | $type[0] = ''; | ||
| 136 | |||
| 137 | $Sseg2su_spec->{_file_dialog_type_aref} = \@type; | ||
| 138 | |||
| 139 | return (); | ||
| 140 | |||
| 141 | } | ||
| 142 | |||
| 143 | =head2 sub get_file_dialog_type_aref | ||
| 144 | |||
| 145 | =cut | ||
| 146 | |||
| 147 | sub get_file_dialog_type_aref { | ||
| 148 | my ($self) = @_; | ||
| 149 | |||
| 150 | if ( $Sseg2su_spec->{_file_dialog_type_aref} ) { | ||
| 151 | my @type = @{ $Sseg2su_spec->{_file_dialog_type_aref} }; | ||
| 152 | return ( \@type ); | ||
| 153 | } | ||
| 154 | else { | ||
| 155 | print( | ||
| 156 | "Sseg2su_spec,get_file_dialog_type_aref, missing file_dialog_type_aref\n" | ||
| 157 | ); | ||
| 158 | return (); | ||
| 159 | } | ||
| 160 | } | ||
| 161 | |||
| 162 | =head2 sub flow_type_aref | ||
| 163 | |||
| 164 | =cut | ||
| 165 | |||
| 166 | sub flow_type_aref { | ||
| 167 | my ($self) = @_; | ||
| 168 | |||
| 169 | my @type; | ||
| 170 | |||
| 171 | $type[0] = $flow_type->{_pre_built_superflow}; | ||
| 172 | |||
| 173 | $Sseg2su_spec->{_flow_type_aref} = \@type; | ||
| 174 | |||
| 175 | return (); | ||
| 176 | |||
| 177 | } | ||
| 178 | |||
| 179 | =head2 sub get_flow_type_aref | ||
| 180 | |||
| 181 | =cut | ||
| 182 | |||
| 183 | sub get_flow_type_aref { | ||
| 184 | my ($self) = @_; | ||
| 185 | |||
| 186 | if ( $Sseg2su_spec->{_flow_type_aref} ) { | ||
| 187 | my $type_aref = $Sseg2su_spec->{_flow_type_aref}; | ||
| 188 | return ($type_aref); | ||
| 189 | } | ||
| 190 | else { | ||
| 191 | |||
| 192 | print("Sseg2su_spec, get_flow_type_aref, missing flow_type_aref \n"); | ||
| 193 | return (); | ||
| 194 | } | ||
| 195 | } | ||
| 196 | |||
| 197 | =head2 sub get_prefix_aref | ||
| 198 | |||
| 199 | =cut | ||
| 200 | |||
| 201 | sub get_prefix_aref { | ||
| 202 | |||
| 203 | my $self = @_; | ||
| 204 | |||
| 205 | if ( defined $Sseg2su_spec->{_prefix_aref} ) { | ||
| 206 | |||
| 207 | my $prefix_aref= $Sseg2su_spec->{_prefix_aref}; | ||
| 208 | return($prefix_aref); | ||
| 209 | |||
| 210 | } else { | ||
| 211 | print("Sseg2su_spec, get_prefix_aref, missing prefix_aref\n"); | ||
| 212 | return(); | ||
| 213 | } | ||
| 214 | |||
| 215 | return(); | ||
| 216 | } | ||
| 217 | |||
| 218 | =head2 sub get_suffix_aref | ||
| 219 | |||
| 220 | =cut | ||
| 221 | |||
| 222 | sub get_suffix_aref { | ||
| 223 | |||
| 224 | my $self = @_; | ||
| 225 | |||
| 226 | if ($Sseg2su_spec->{_suffix_aref} ) { | ||
| 227 | |||
| 228 | my $suffix_aref= $Sseg2su_spec->{_suffix_aref}; | ||
| 229 | return($suffix_aref); | ||
| 230 | |||
| 231 | } else { | ||
| 232 | print("Sseg2su_spec, get_suffix_aref, missing suffix_aref\n"); | ||
| 233 | return(); | ||
| 234 | } | ||
| 235 | |||
| 236 | return(); | ||
| 237 | } | ||
| 238 | |||
| 239 | |||
| 240 | =head2 sub prefix_aref | ||
| 241 | |||
| 242 | =cut | ||
| 243 | |||
| 244 | sub prefix_aref { | ||
| 245 | |||
| 246 | my $self = @_; | ||
| 247 | |||
| 248 | my @prefix; | ||
| 249 | |||
| 250 | for (my $i=0; $i < $max_index; $i++) { | ||
| 251 | |||
| 252 | $prefix[$i] = $empty_string; | ||
| 253 | |||
| 254 | } | ||
| 255 | $Sseg2su_spec ->{_prefix_aref} = \@prefix; | ||
| 256 | return(); | ||
| 257 | |||
| 258 | } | ||
| 259 | |||
| 260 | |||
| 261 | =head2 sub suffix_aref | ||
| 262 | |||
| 263 | =cut | ||
| 264 | |||
| 265 | sub suffix_aref { | ||
| 266 | |||
| 267 | my $self = @_; | ||
| 268 | |||
| 269 | my @suffix; | ||
| 270 | |||
| 271 | for (my $i=0; $i < $max_index; $i++) { | ||
| 272 | |||
| 273 | $suffix[$i] = $empty_string; | ||
| 274 | |||
| 275 | } | ||
| 276 | $Sseg2su_spec ->{_suffix_aref} = \@suffix; | ||
| 277 | return(); | ||
| 278 | |||
| 279 | } | ||
| 280 | |||
| 281 | |||
| 282 | =head2 sub get_binding_length | ||
| 283 | |||
| 284 | =cut | ||
| 285 | |||
| 286 | sub get_binding_length { | ||
| 287 | my ($self) = @_; | ||
| 288 | |||
| 289 | if ( $Sseg2su_spec->{_binding_index_aref} ) { | ||
| 290 | my $length; | ||
| 291 | $length = scalar @{ $Sseg2su_spec->{_binding_index_aref} }; | ||
| 292 | return ($length); | ||
| 293 | |||
| 294 | } | ||
| 295 | else { | ||
| 296 | |||
| 297 | print("Sseg2su_spec, get_binding_length, missing length \n"); | ||
| 298 | return (); | ||
| 299 | } | ||
| 300 | |||
| 301 | } | ||
| 302 | |||
| 303 | =head2 sub variables | ||
| 304 | |||
| 305 | return a hash array | ||
| 306 | with definitions | ||
| 307 | |||
| 308 | =cut | ||
| 309 | |||
| 310 | sub variables { | ||
| 311 | my ($self) = @_; | ||
| 312 | |||
| 313 | my $hash_ref = $Sseg2su_spec; | ||
| 314 | return ($hash_ref); | ||
| 315 | } | ||
| 316 | |||
| 317 | 1; |