« lib/App/SeismicUnixGui/specs/NMO_Vel_Stk/suztot_spec.pm
↑ Summary
lib/App/SeismicUnixGui/specs/data/ctrlstrip_spec.pm »
| 1 | package App::SeismicUnixGui::specs::big_streams::Project_spec; | ||
| 2 | |||
| 3 | use Moose; | ||
| 4 | our $VERSION = '1.0.0'; | ||
| 5 | |||
| 6 | use App::SeismicUnixGui::misc::SeismicUnix qw($su $suffix_su); | ||
| 7 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 8 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 9 | |||
| 10 | my $get = L_SU_global_constants->new(); | ||
| 11 | my $var = $get->var(); | ||
| 12 | my $file_dialog_type = $get->file_dialog_type_href(); | ||
| 13 | my $flow_type = $get->flow_type_href(); | ||
| 14 | |||
| 15 | my $true = $var->{_true}; | ||
| 16 | my $false = $var->{_false}; | ||
| 17 | |||
| 18 | my $Project = Project_config->new(); | ||
| 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 = $Project->get_max_index(); | ||
| 24 | |||
| 25 | my $Project_spec = { | ||
| 26 | _CONFIG => $PL_SEISMIC, | ||
| 27 | _DATA_DIR_IN => $DATA_SEISMIC_SU, | ||
| 28 | _DATA_DIR_OUT => $DATA_SEISMIC_SU, | ||
| 29 | _binding_index_aref => '', | ||
| 30 | _suffix_type_in => $su, | ||
| 31 | _data_suffix_in => $suffix_su, | ||
| 32 | _suffix_type_out => $su, | ||
| 33 | _data_suffix_out => $suffix_su, | ||
| 34 | _file_dialog_type_aref => '', | ||
| 35 | _flow_type_aref => '', | ||
| 36 | _has_infile => $false, | ||
| 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 => $false, | ||
| 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 => $true, | ||
| 52 | _max_index => $max_index, | ||
| 53 | }; | ||
| 54 | |||
| 55 | =head2 sub binding_index_aref | ||
| 56 | |||
| 57 | Mark the index of the parameter value, | ||
| 58 | visible in the GUI, that is bound to MB3. | ||
| 59 | |||
| 60 | =cut | ||
| 61 | |||
| 62 | sub binding_index_aref { | ||
| 63 | my ($self) = @_; | ||
| 64 | my @index; | ||
| 65 | |||
| 66 | $index[0] = 0; | ||
| 67 | $index[1] = 1; | ||
| 68 | $index[2] = 2; | ||
| 69 | $index[3] = 3; | ||
| 70 | $index[4] = 4; | ||
| 71 | $index[5] = 5; | ||
| 72 | $index[6] = 6; | ||
| 73 | $index[7] = 7; | ||
| 74 | |||
| 75 | $Project_spec->{_binding_index_aref} = \@index; | ||
| 76 | |||
| 77 | return (); | ||
| 78 | } | ||
| 79 | |||
| 80 | =head2 sub get_binding_index_aref | ||
| 81 | |||
| 82 | =cut | ||
| 83 | |||
| 84 | sub get_binding_index_aref { | ||
| 85 | my ($self) = @_; | ||
| 86 | my @index; | ||
| 87 | |||
| 88 | if ( $Project_spec->{_binding_index_aref} ) { | ||
| 89 | my $index_aref = $Project_spec->{_binding_index_aref}; | ||
| 90 | return ($index_aref); | ||
| 91 | |||
| 92 | } else { | ||
| 93 | print("Project_spec, get_binding_index_aref, missing binding_index_aref\n"); | ||
| 94 | return (); | ||
| 95 | } | ||
| 96 | |||
| 97 | my $index_aref = $Project_spec->{_binding_index_aref}; | ||
| 98 | |||
| 99 | } | ||
| 100 | |||
| 101 | =head2 sub get_max_index | ||
| 102 | |||
| 103 | =cut | ||
| 104 | |||
| 105 | sub get_max_index { | ||
| 106 | my ($self) = @_; | ||
| 107 | |||
| 108 | if ( $Project_spec->{_max_index} ) { | ||
| 109 | |||
| 110 | my $max_idx = $Project->get_max_index(); | ||
| 111 | return ($max_idx); | ||
| 112 | |||
| 113 | } else { | ||
| 114 | print("Project_spec, get_max_index, missing max_index\n"); | ||
| 115 | return (); | ||
| 116 | } | ||
| 117 | } | ||
| 118 | |||
| 119 | =head2 sub file_dialog_type_aref | ||
| 120 | |||
| 121 | ALl cases look for a directory path | ||
| 122 | |||
| 123 | =cut | ||
| 124 | |||
| 125 | sub file_dialog_type_aref { | ||
| 126 | my ($self) = @_; | ||
| 127 | |||
| 128 | my @type; | ||
| 129 | |||
| 130 | $type[0] = $file_dialog_type->{_Path}; | ||
| 131 | # $type[1] = $file_dialog_type->{_Home}; | ||
| 132 | $type[1] = $file_dialog_type->{_Path}; | ||
| 133 | $type[2] = $file_dialog_type->{_last_dir_in_path}; | ||
| 134 | $type[3] = $file_dialog_type->{_last_dir_in_path}; | ||
| 135 | $type[4] = $file_dialog_type->{_last_dir_in_path}; | ||
| 136 | $type[5] = $file_dialog_type->{_last_dir_in_path}; | ||
| 137 | $type[6] = $file_dialog_type->{_last_dir_in_path}; | ||
| 138 | $type[7] = $file_dialog_type->{_last_dir_in_path}; | ||
| 139 | # print(" Project_spec, file_dialog_type_aref = $type[2] \n"); | ||
| 140 | |||
| 141 | $Project_spec->{_file_dialog_type_aref} = \@type; | ||
| 142 | |||
| 143 | return (); | ||
| 144 | |||
| 145 | } | ||
| 146 | |||
| 147 | =head2 sub get_file_dialog_type_aref | ||
| 148 | |||
| 149 | =cut | ||
| 150 | |||
| 151 | sub get_file_dialog_type_aref { | ||
| 152 | my ($self) = @_; | ||
| 153 | |||
| 154 | if ( $Project_spec->{_file_dialog_type_aref} ) { | ||
| 155 | my @type = @{ $Project_spec->{_file_dialog_type_aref} }; | ||
| 156 | return ( \@type ); | ||
| 157 | } else { | ||
| 158 | print("Project_spec,get_file_dialog_type_aref, missing file_dialog_type_aref\n"); | ||
| 159 | return (); | ||
| 160 | } | ||
| 161 | } | ||
| 162 | |||
| 163 | =head2 sub flow_type_aref | ||
| 164 | |||
| 165 | =cut | ||
| 166 | |||
| 167 | sub flow_type_aref { | ||
| 168 | my ($self) = @_; | ||
| 169 | |||
| 170 | my @type; | ||
| 171 | |||
| 172 | $type[0] = $flow_type->{_pre_built_superflow}; | ||
| 173 | |||
| 174 | $Project_spec->{_flow_type_aref} = \@type; | ||
| 175 | |||
| 176 | return (); | ||
| 177 | |||
| 178 | } | ||
| 179 | |||
| 180 | =head2 sub get_flow_type_aref | ||
| 181 | |||
| 182 | =cut | ||
| 183 | |||
| 184 | sub get_flow_type_aref { | ||
| 185 | my ($self) = @_; | ||
| 186 | |||
| 187 | if ( $Project_spec->{_flow_type_aref} ) { | ||
| 188 | my $type_aref = $Project_spec->{_flow_type_aref}; | ||
| 189 | return ($type_aref); | ||
| 190 | } else { | ||
| 191 | |||
| 192 | print("Project_spec, get_flow_type_aref, missing flow_type_aref \n"); | ||
| 193 | return (); | ||
| 194 | } | ||
| 195 | } | ||
| 196 | |||
| 197 | =head2 sub get_binding_length | ||
| 198 | |||
| 199 | =cut | ||
| 200 | |||
| 201 | sub get_binding_length { | ||
| 202 | my ($self) = @_; | ||
| 203 | |||
| 204 | if ( $Project_spec->{_binding_index_aref} ) { | ||
| 205 | my $length; | ||
| 206 | $length = scalar @{ $Project_spec->{_binding_index_aref} }; | ||
| 207 | return ($length); | ||
| 208 | |||
| 209 | } else { | ||
| 210 | print("Project_spec, get_binding_length, missing length \n"); | ||
| 211 | return (); | ||
| 212 | } | ||
| 213 | |||
| 214 | } | ||
| 215 | |||
| 216 | =head2 sub variables | ||
| 217 | |||
| 218 | return a hash array | ||
| 219 | with definitions | ||
| 220 | |||
| 221 | =cut | ||
| 222 | |||
| 223 | sub variables { | ||
| 224 | my ($self) = @_; | ||
| 225 | |||
| 226 | # print("Project_spec,variables, first_of_2,$Project_spec->{_CONFIG}\n"); | ||
| 227 | my $hash_ref = $Project_spec; | ||
| 228 | return ($hash_ref); | ||
| 229 | } | ||
| 230 | |||
| 231 | 1; |