1 | ;------------------------------------------------------------ |
---|
2 | ;------------------------------------------------------------ |
---|
3 | ;------------------------------------------------------------ |
---|
4 | ;+ |
---|
5 | ; NAME:closeps |
---|
6 | ; |
---|
7 | ; PURPOSE:ferme de l'environement Postscript |
---|
8 | ; |
---|
9 | ; CALLING SEQUENCE:closeps |
---|
10 | ; |
---|
11 | ; KEYWORD PARAMETERS: |
---|
12 | ; INFOWIDGET: un long integer qui doit etre l''id du windget |
---|
13 | ; que l''on souhaite detruire (cf. openps.pro) |
---|
14 | ; |
---|
15 | ; COMMON BLOCKS: |
---|
16 | ; common.pro |
---|
17 | ; |
---|
18 | ; SIDE EFFECTS: qd sauveps (variable globale) ne 0 les postscript est |
---|
19 | ; annopte par un numero qd il s''appelle idl.ps sinon par son nom. le |
---|
20 | ; nom est suivit de la date. |
---|
21 | ; |
---|
22 | ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) |
---|
23 | ; 21/12/98 |
---|
24 | ;- |
---|
25 | ;------------------------------------------------------------ |
---|
26 | ;------------------------------------------------------------ |
---|
27 | ;------------------------------------------------------------ |
---|
28 | pro closeps, INFOWIDGET = infowidget |
---|
29 | @common |
---|
30 | ;------------------------------------------------------------ |
---|
31 | ; si sauve ps different de 0 on sauve le ps sur maia automatiquement |
---|
32 | ; ou apres une question. |
---|
33 | ;------------------------------------------------------------ |
---|
34 | if sauveps NE 0 then begin |
---|
35 | ;------------------------------------------------------------ |
---|
36 | ; on recupere le nom du fichier postscript qui vient d''etre cree |
---|
37 | ; si ce nom est idl.ps on numerote le postscript avec le numero |
---|
38 | ; contenu dans derniernumps.dat |
---|
39 | ;------------------------------------------------------------ |
---|
40 | spawn,'which "ls"' , ls |
---|
41 | spawn,ls[0]+' -t '+psdir+'*ps' , nomps |
---|
42 | nomps = nomps[0] |
---|
43 | nomps = strmid(nomps,rstrpos(nomps,'/')+1) |
---|
44 | if nomps EQ 'idl.ps' then begin |
---|
45 | ; on recupere le numero du dernier fichier sauvegarde |
---|
46 | ; rq: ce numero est incremente uniquement qd on fait une impression |
---|
47 | restore,'derniernumps.dat' |
---|
48 | nomps = strtrim(numfichps, 1) |
---|
49 | endif |
---|
50 | ;------------------------------------------------------------ |
---|
51 | ; on annote le postscript |
---|
52 | ;------------------------------------------------------------ |
---|
53 | date = byte(systime(0)) ; on crecupere la date |
---|
54 | xyouts, !d.x_px_cm,!d.y_px_cm $ |
---|
55 | ,nomps+') '+string(date[4:10])+string(date[20:23]), /device, charsize = .75 |
---|
56 | endif |
---|
57 | ;------------------------------------------------------------ |
---|
58 | if !d.name EQ 'PS' then device,/close |
---|
59 | thisOS = strupcase(strmid(!version.os_family, 0, 3)) |
---|
60 | CASE thisOS of |
---|
61 | 'MAC': SET_PLOT, thisOS |
---|
62 | 'WIN': SET_PLOT, thisOS |
---|
63 | ELSE: SET_PLOT, 'X' |
---|
64 | ENDCASE |
---|
65 | tvlct, rouge, vert,bleu |
---|
66 | !p.font = -1 |
---|
67 | !p.BACKGROUND=(!d.n_colors-1) < 255 |
---|
68 | !p.color=0 |
---|
69 | if !d.n_colors gt 256 then !p.background='ffffff'x |
---|
70 | ;------------------------------------------------------------ |
---|
71 | if keyword_set(infowidget) then $ |
---|
72 | widget_control, long(infowidget), bad_id = toto, /destroy |
---|
73 | ;------------------------------------------------------------ |
---|
74 | return |
---|
75 | end |
---|