lib/App/SeismicUnixGui/sunix/plot/psmanager.pm untested

filter: Statementstmt 0.0% 0 / 69 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 9 totaltotal 0.0% 0 / 101 CC 6 SCAR 14.4
CC
6
Cov
0%
manual
6.0
media
6.0
orient
6.0
CRAP 4.2
1 package App::SeismicUnixGui::sunix::plot::psmanager;
2  
3 =head2 SYNOPSIS
4  
5 PERL PROGRAM NAME:
6  
7 AUTHOR: Juan Lorenzo (Perl module only)
8  
9 DATE:
10  
11 DESCRIPTION:
12  
13 Version:
14  
15 =head2 USE
16  
17 =head3 NOTES
18  
19 =head4 Examples
20  
21 =head2 SYNOPSIS
22  
23 =head3 SEISMIC UNIX NOTES
24 PSMANAGER - printer MANAGER for HP 4MV and HP 5Si Mx Laserjet
25  
26 PostScript printing
27  
28  
29  
30 psmanager < stdin [optional parameters] > stdout
31  
32  
33  
34 Required Parameters:
35  
36 none
37  
38 Optional Parameters:
39  
40 papersize=0 paper size (US Letter default)
41  
42 =1 US Legal
43  
44 =2 A4
45  
46 =3 11x17
47  
48  
49  
50 orient=0 paper orientation (Portrait default)
51  
52 =1 Landscape
53  
54  
55  
56 tray=3 printing tray (Bottom tray default)
57  
58 =1 tray 1 (multipurpose slot)
59  
60 =2 tray 2
61  
62  
63  
64 manual=0 no manual feed
65  
66 =1 (Manual Feed)
67  
68  
69  
70 media=0 regular paper
71  
72 =1 Transparency
73  
74 =2 Letterhead
75  
76 =3 Card Stock
77  
78 =4 Bond
79  
80 =5 Labels
81  
82 =6 Prepunched
83  
84 =7 Recyled
85  
86 =8 Preprinted
87  
88 =9 Color (printing on colored paper)
89  
90  
91  
92 Notes:
93  
94 The option manual=1 implies tray=1. The media options apply
95  
96 only to the HP LaserJet 5Si MX model printer.
97  
98  
99  
100 Examples:
101  
102 overheads:
103  
104 psmanager < postscript_file manual=1 media=1 | lpr
105  
106 labels:
107  
108 psmanager < postscript_file manual=1 media=5 | lpr
109  
110  
111  
112  
113  
114  
115  
116 Notes: This code was reverse engineered using output from
117  
118 the NeXTStep printer manager.
119  
120
121  
122 Author: John Stockwell, June 1995, October 1997
123  
124
125  
126 Reference:
127  
128 PostScript Printer Description File Format Specification,
129  
130 version 4.2, Adobe Systems Incorporated
131  
132  
133  
134 =head2 User's notes (Juan Lorenzo)
135 untested
136  
137 =cut
138  
139  
140 =head2 CHANGES and their DATES
141  
142 =cut
143  
144 use Moose;
145 our $VERSION = '0.0.1';
146  
147  
148 =head2 Import packages
149  
150 =cut
151  
152 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
153  
154 use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin);
155 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
156  
157  
158 =head2 instantiation of packages
159  
160 =cut
161  
162 my $get = L_SU_global_constants->new();
163 my $Project = Project_config->new();
164 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
165 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
166 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
167  
168 my $var = $get->var();
169 my $on = $var->{_on};
170 my $off = $var->{_off};
171 my $true = $var->{_true};
172 my $false = $var->{_false};
173 my $empty_string = $var->{_empty_string};
174  
175 =head2 Encapsulated
176 hash of private variables
177  
178 =cut
179  
180 my $psmanager = {
181 _manual => '',
182 _media => '',
183 _orient => '',
184 _papersize => '',
185 _tray => '',
186 _Step => '',
187 _note => '',
188  
189 };
190  
191 =head2 sub Step
192  
193 collects switches and assembles bash instructions
194 by adding the program name
195  
196 =cut
197  
198 sub Step {
199  
200 $psmanager->{_Step} = 'psmanager'.$psmanager->{_Step};
201 return ( $psmanager->{_Step} );
202  
203 }
204  
205  
206 =head2 sub note
207  
208 collects switches and assembles bash instructions
209 by adding the program name
210  
211 =cut
212  
213 sub note {
214  
215 $psmanager->{_note} = 'psmanager'.$psmanager->{_note};
216 return ( $psmanager->{_note} );
217  
218 }
219  
220  
221  
222 =head2 sub clear
223  
224 =cut
225  
226 sub clear {
227  
228 $psmanager->{_manual} = '';
229 $psmanager->{_media} = '';
230 $psmanager->{_orient} = '';
231 $psmanager->{_papersize} = '';
232 $psmanager->{_tray} = '';
233 $psmanager->{_Step} = '';
234 $psmanager->{_note} = '';
235 }
236  
237  
238 =head2 sub manual
239  
240  
241 =cut
242  
243 sub manual {
244  
245 my ( $self,$manual ) = @_;
246 if ( $manual ne $empty_string ) {
247  
248 $psmanager->{_manual} = $manual;
249 $psmanager->{_note} = $psmanager->{_note}.' manual='.$psmanager->{_manual};
250 $psmanager->{_Step} = $psmanager->{_Step}.' manual='.$psmanager->{_manual};
251  
252 } else {
253 print("psmanager, manual, missing manual,\n");
254 }
255 }
256  
257  
258 =head2 sub media
259  
260  
261 =cut
262  
263 sub media {
264  
265 my ( $self,$media ) = @_;
266 if ( $media ne $empty_string ) {
267  
268 $psmanager->{_media} = $media;
269 $psmanager->{_note} = $psmanager->{_note}.' media='.$psmanager->{_media};
270 $psmanager->{_Step} = $psmanager->{_Step}.' media='.$psmanager->{_media};
271  
272 } else {
273 print("psmanager, media, missing media,\n");
274 }
275 }
276  
277  
278 =head2 sub orient
279  
280  
281 =cut
282  
283 sub orient {
284  
285 my ( $self,$orient ) = @_;
286 if ( $orient ne $empty_string ) {
287  
288 $psmanager->{_orient} = $orient;
289 $psmanager->{_note} = $psmanager->{_note}.' orient='.$psmanager->{_orient};
290 $psmanager->{_Step} = $psmanager->{_Step}.' orient='.$psmanager->{_orient};
291  
292 } else {
293 print("psmanager, orient, missing orient,\n");
294 }
295 }
296  
297  
298 =head2 sub papersize
299  
300  
301 =cut
302  
303 sub papersize {
304  
305 my ( $self,$papersize ) = @_;
306 if ( $papersize ne $empty_string ) {
307  
308 $psmanager->{_papersize} = $papersize;
309 $psmanager->{_note} = $psmanager->{_note}.' papersize='.$psmanager->{_papersize};
310 $psmanager->{_Step} = $psmanager->{_Step}.' papersize='.$psmanager->{_papersize};
311  
312 } else {
313 print("psmanager, papersize, missing papersize,\n");
314 }
315 }
316  
317  
318 =head2 sub tray
319  
320  
321 =cut
322  
323 sub tray {
324  
325 my ( $self,$tray ) = @_;
326 if ( $tray ne $empty_string ) {
327  
328 $psmanager->{_tray} = $tray;
329 $psmanager->{_note} = $psmanager->{_note}.' tray='.$psmanager->{_tray};
330 $psmanager->{_Step} = $psmanager->{_Step}.' tray='.$psmanager->{_tray};
331  
332 } else {
333 print("psmanager, tray, missing tray,\n");
334 }
335 }
336  
337  
338 =head2 sub get_max_index
339  
340 max index = number of input variables -1
341
342 =cut
343
344 sub get_max_index {
345 my ($self) = @_;
346 my $max_index = 4;
347  
348 return($max_index);
349 }
350
351
352 1;