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