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