« lib/App/SeismicUnixGui/specs/big_streams/iBottomMute_spec.pm
↑ Summary
lib/App/SeismicUnixGui/specs/big_streams/iPick_specB.pm »
| 1 | package App::SeismicUnixGui::specs::big_streams::iPick_spec; | ||
| 2 | |||
| 3 | |||
| 4 | =head2 notes | ||
| 5 | |||
| 6 | aliased not used for Porject_config or | ||
| 7 | L_SU_global_constants because use of aliased | ||
| 8 | in calling modules creates circularity | ||
| 9 | |||
| 10 | =cut | ||
| 11 | |||
| 12 | use Moose; | ||
| 13 | our $VERSION = '0.0.1'; | ||
| 14 | |||
| 15 | use App::SeismicUnixGui::misc::L_SU_global_constants; | ||
| 16 | use App::SeismicUnixGui::configs::big_streams::Project_config; | ||
| 17 | use App::SeismicUnixGui::misc::SeismicUnix qw($su $suffix_su $txt $suffix_txt); | ||
| 18 | |||
| 19 | my $get = App::SeismicUnixGui::misc::L_SU_global_constants->new(); | ||
| 20 | my $var = $get->var(); | ||
| 21 | my $empty_string = $var->{_empty_string}; | ||
| 22 | my $file_dialog_type = $get->file_dialog_type_href(); | ||
| 23 | my $flow_type = $get->flow_type_href(); | ||
| 24 | |||
| 25 | my $true = $var->{_true}; | ||
| 26 | my $false = $var->{_false}; | ||
| 27 | |||
| 28 | my $Project = App::SeismicUnixGui::configs::big_streams::Project_config->new(); | ||
| 29 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); # input data directory | ||
| 30 | my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT(); # output data directory | ||
| 31 | my $PL_SEISMIC = $Project->PL_SEISMIC(); | ||
| 32 | |||
| 33 | my $max_index = 12; | ||
| 34 | |||
| 35 | my $iPick_spec = { | ||
| 36 | _CONFIG => $PL_SEISMIC, | ||
| 37 | _DATA_DIR_IN => $DATA_SEISMIC_SU, | ||
| 38 | _DATA_DIR_OUT => $DATA_SEISMIC_TXT, | ||
| 39 | _binding_index_aref => '', | ||
| 40 | _suffix_type_in => $su, | ||
| 41 | _data_suffix_in => $suffix_su, | ||
| 42 | _suffix_type_out => $txt, | ||
| 43 | _data_suffix_out => $suffix_txt, | ||
| 44 | _file_dialog_type_aref => '', | ||
| 45 | _flow_type_aref => '', | ||
| 46 | _has_infile => $false, | ||
| 47 | _has_pipe_in => $false, | ||
| 48 | _has_pipe_out => $false, | ||
| 49 | _has_redirect_in => $false, | ||
| 50 | _has_redirect_out => $false, | ||
| 51 | _has_subin_in => $false, | ||
| 52 | _has_subin_out => $false, | ||
| 53 | _is_data => $false, | ||
| 54 | _is_first_of_2 => $false, | ||
| 55 | _is_first_of_3or_more => $false, | ||
| 56 | _is_first_of_4or_more => $false, | ||
| 57 | _is_last_of_2 => $false, | ||
| 58 | _is_last_of_3or_more => $false, | ||
| 59 | _is_last_of_4or_more => $false, | ||
| 60 | _is_suprog => $false, | ||
| 61 | _is_superflow => $true, | ||
| 62 | _max_index => $max_index, | ||
| 63 | _prefix_aref => '', | ||
| 64 | _suffix_aref => '', | ||
| 65 | }; | ||
| 66 | |||
| 67 | =head2 sub binding_index_aref | ||
| 68 | out | ||
| 69 | =cut | ||
| 70 | |||
| 71 | sub binding_index_aref { | ||
| 72 | my ($self) = @_; | ||
| 73 | my @index; | ||
| 74 | |||
| 75 | $index[0] = 0; | ||
| 76 | |||
| 77 | $iPick_spec->{_binding_index_aref} = \@index; | ||
| 78 | |||
| 79 | return (); | ||
| 80 | } | ||
| 81 | |||
| 82 | =head2 sub get_binding_index_aref | ||
| 83 | |||
| 84 | =cut = $Project->DATA_SEISMIC_SU(); # output data directory | ||
| 85 | |||
| 86 | sub get_binding_index_aref { | ||
| 87 | my ($self) = @_; | ||
| 88 | my @index; | ||
| 89 | |||
| 90 | if ( $iPick_spec->{_binding_index_aref} ) { | ||
| 91 | my $index_aref = $iPick_spec->{_binding_index_aref}; | ||
| 92 | return ($index_aref); | ||
| 93 | |||
| 94 | } | ||
| 95 | else { | ||
| 96 | print( | ||
| 97 | "iPick_spec, get_binding_index_aref, missing binding_index_aref\n" | ||
| 98 | ); | ||
| 99 | return (); | ||
| 100 | } | ||
| 101 | |||
| 102 | my $index_aref = $iPick_spec->{_binding_index_aref}; | ||
| 103 | |||
| 104 | } | ||
| 105 | |||
| 106 | =head2 sub get_max_index | ||
| 107 | |||
| 108 | =cut | ||
| 109 | |||
| 110 | sub get_max_index { | ||
| 111 | my ($self) = @_; | ||
| 112 | |||
| 113 | if ( $iPick_spec->{_max_index} ) { | ||
| 114 | |||
| 115 | my $max_idx = $max_index; | ||
| 116 | return ($max_idx); | ||
| 117 | |||
| 118 | } | ||
| 119 | else { | ||
| 120 | print("iPick_spec, get_max_index, missing max_index\n"); | ||
| 121 | return (); | ||
| 122 | } | ||
| 123 | } | ||
| 124 | |||
| 125 | =head2 sub file_dialog_type_aref | ||
| 126 | = $Project->DATA_SEISMIC_SU(); # output data directory | ||
| 127 | |||
| 128 | =cut | ||
| 129 | |||
| 130 | sub file_dialog_type_aref { | ||
| 131 | my ($self) = @_; | ||
| 132 | |||
| 133 | my @type; | ||
| 134 | |||
| 135 | $type[0] = $file_dialog_type->{_Data}; | ||
| 136 | |||
| 137 | $iPick_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 ( $iPick_spec->{_file_dialog_type_aref} ) { | ||
| 151 | my @type = @{ $iPick_spec->{_file_dialog_type_aref} }; | ||
| 152 | return ( \@type ); | ||
| 153 | } | ||
| 154 | else { | ||
| 155 | print( | ||
| 156 | "iPick_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 | $iPick_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 ( $iPick_spec->{_flow_type_aref} ) { | ||
| 187 | my $type_aref = $iPick_spec->{_flow_type_aref}; | ||
| 188 | return ($type_aref); | ||
| 189 | } | ||
| 190 | else { | ||
| 191 | |||
| 192 | print("iPick_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 $iPick_spec->{_prefix_aref} ) { | ||
| 206 | |||
| 207 | my $prefix_aref= $iPick_spec->{_prefix_aref}; | ||
| 208 | return($prefix_aref); | ||
| 209 | |||
| 210 | } else { | ||
| 211 | print("iPick_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 ($iPick_spec->{_suffix_aref} ) { | ||
| 227 | |||
| 228 | my $suffix_aref= $iPick_spec->{_suffix_aref}; | ||
| 229 | return($suffix_aref); | ||
| 230 | |||
| 231 | } else { | ||
| 232 | print("iPick_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 | $iPick_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 | $iPick_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 ( $iPick_spec->{_binding_index_aref} ) { | ||
| 290 | my $length; | ||
| 291 | $length = scalar @{ $iPick_spec->{_binding_index_aref} }; | ||
| 292 | return ($length); | ||
| 293 | |||
| 294 | } | ||
| 295 | else { | ||
| 296 | |||
| 297 | print("iPick_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 | # print("iPick_spec,variables, | ||
| 314 | # first_of_2,$iPick_spec->{_is_first_of_2}\n"); | ||
| 315 | my $hash_ref = $iPick_spec; | ||
| 316 | return ($hash_ref); | ||
| 317 | } | ||
| 318 | |||
| 319 | 1; |