| 1 | package App::SeismicUnixGui::sunix::plot::psepsi; | ||
| 2 | |||
| 3 | =head2 SYNOPSIS | ||
| 4 | |||
| 5 | PERL PROGRAM NAME: | ||
| 6 | |||
| 7 | AUTHOR: Juan Lorenzo (Perl module only) | ||
| 8 | |||
| 9 | DATE: | ||
| 10 | |||
| 11 | DESCRIPTION: | ||
| 12 | Version: | ||
| 13 | |||
| 14 | =head2 USE | ||
| 15 | |||
| 16 | =head3 NOTES | ||
| 17 | |||
| 18 | =head4 Examples | ||
| 19 | |||
| 20 | =head2 SYNOPSIS | ||
| 21 | |||
| 22 | =head3 SEISMIC UNIX NOTES | ||
| 23 | PSEPSI - add an EPSI formatted preview bitmap to an EPS file | ||
| 24 | |||
| 25 | |||
| 26 | |||
| 27 | psepsi <epsfile >epsifile | ||
| 28 | |||
| 29 | |||
| 30 | |||
| 31 | opt=null | ||
| 32 | |||
| 33 | |||
| 34 | |||
| 35 | Note: | ||
| 36 | |||
| 37 | This application requires | ||
| 38 | |||
| 39 | (1) that gs (the Ghostscript interpreter) exist, and | ||
| 40 | |||
| 41 | (2) that the input EPS file contain a BoundingBox and EndComments. | ||
| 42 | |||
| 43 | Ghostscript is used to build the preview bitmap, which is then | ||
| 44 | |||
| 45 | merged with the input EPS file to make the output EPSI file. | ||
| 46 | |||
| 47 | |||
| 48 | |||
| 49 | =head2 User's notes (Juan Lorenzo) | ||
| 50 | untested | ||
| 51 | |||
| 52 | =cut | ||
| 53 | |||
| 54 | =head2 CHANGES and their DATES | ||
| 55 | |||
| 56 | =cut | ||
| 57 | |||
| 58 | use Moose; | ||
| 59 | our $VERSION = '0.0.1'; | ||
| 60 | |||
| 61 | =head2 Import packages | ||
| 62 | |||
| 63 | =cut | ||
| 64 | |||
| 65 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 66 | |||
| 67 | use App::SeismicUnixGui::misc::SeismicUnix | ||
| 68 | qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin); | ||
| 69 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 70 | |||
| 71 | =head2 instantiation of packages | ||
| 72 | |||
| 73 | =cut | ||
| 74 | |||
| 75 | my $get = L_SU_global_constants->new(); | ||
| 76 | my $Project = Project_config->new(); | ||
| 77 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); | ||
| 78 | my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN(); | ||
| 79 | my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT(); | ||
| 80 | |||
| 81 | my $var = $get->var(); | ||
| 82 | my $on = $var->{_on}; | ||
| 83 | my $off = $var->{_off}; | ||
| 84 | my $true = $var->{_true}; | ||
| 85 | my $false = $var->{_false}; | ||
| 86 | my $empty_string = $var->{_empty_string}; | ||
| 87 | |||
| 88 | =head2 Encapsulated | ||
| 89 | hash of private variables | ||
| 90 | |||
| 91 | =cut | ||
| 92 | |||
| 93 | my $psepsi = { | ||
| 94 | _opt => '', | ||
| 95 | _Step => '', | ||
| 96 | _note => '', | ||
| 97 | |||
| 98 | }; | ||
| 99 | |||
| 100 | =head2 sub Step | ||
| 101 | |||
| 102 | collects switches and assembles bash instructions | ||
| 103 | by adding the program name | ||
| 104 | |||
| 105 | =cut | ||
| 106 | |||
| 107 | sub Step { | ||
| 108 | |||
| 109 | $psepsi->{_Step} = 'psepsi' . $psepsi->{_Step}; | ||
| 110 | return ( $psepsi->{_Step} ); | ||
| 111 | |||
| 112 | } | ||
| 113 | |||
| 114 | =head2 sub note | ||
| 115 | |||
| 116 | collects switches and assembles bash instructions | ||
| 117 | by adding the program name | ||
| 118 | |||
| 119 | =cut | ||
| 120 | |||
| 121 | sub note { | ||
| 122 | |||
| 123 | $psepsi->{_note} = 'psepsi' . $psepsi->{_note}; | ||
| 124 | return ( $psepsi->{_note} ); | ||
| 125 | |||
| 126 | } | ||
| 127 | |||
| 128 | =head2 sub clear | ||
| 129 | |||
| 130 | =cut | ||
| 131 | |||
| 132 | sub clear { | ||
| 133 | |||
| 134 | $psepsi->{_opt} = ''; | ||
| 135 | $psepsi->{_Step} = ''; | ||
| 136 | $psepsi->{_note} = ''; | ||
| 137 | } | ||
| 138 | |||
| 139 | =head2 sub opt | ||
| 140 | |||
| 141 | |||
| 142 | =cut | ||
| 143 | |||
| 144 | sub opt { | ||
| 145 | |||
| 146 | my ( $self, $opt ) = @_; | ||
| 147 | # if ( $opt ne $empty_string ) { | ||
| 148 | # | ||
| 149 | # $psepsi->{_opt} = $opt; | ||
| 150 | # $psepsi->{_note} = $psepsi->{_note} . ' opt=' . $psepsi->{_opt}; | ||
| 151 | # $psepsi->{_Step} = $psepsi->{_Step} . ' opt=' . $psepsi->{_opt}; | ||
| 152 | # | ||
| 153 | # } | ||
| 154 | # else { | ||
| 155 | # print("psepsi, opt, missing opt,\n"); | ||
| 156 | # } | ||
| 157 | } | ||
| 158 | |||
| 159 | =head2 sub get_max_index | ||
| 160 | |||
| 161 | max index = number of input variables -1 | ||
| 162 | |||
| 163 | =cut | ||
| 164 | |||
| 165 | sub get_max_index { | ||
| 166 | my ($self) = @_; | ||
| 167 | my $max_index = 0; | ||
| 168 | |||
| 169 | return ($max_index); | ||
| 170 | } | ||
| 171 | |||
| 172 | 1; |