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