source: trunk/SRC/ToBeReviewed/POSTSCRIPT/ps.pro @ 163

Last change on this file since 163 was 163, checked in by navarro, 18 years ago

header improvements : type of parameters and keywords, default values, spell checking + idldoc assistant (IDL online_help)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.4 KB
RevLine 
[2]1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
[150]5; @file_comments
6; Redirect the content of the graphic window in a postscript,
7; by redoing commands in the postscript's environment.
[2]8;
[150]9; @categories
10; utilities
11;
12; @restrictions
13; We use journal which allows to stock commands we pass.
[2]14;
[150]15; @restrictions
[163]16; Can break down if some weird commands are passed...
17; Comment: we erase Syntax error, Illegal characters, compatible
[150]18; with oups, text_box...
[2]19;
[150]20; @history
[157]21; Sebastien Masson (smasson\@lodyc.jussieu.fr)
[2]22;                       5/3/1999
23;-
24;------------------------------------------------------------
25;------------------------------------------------------------
26;------------------------------------------------------------
27;------------------------------------------------------------
[150]28; We have to close the journal!
[2]29;------------------------------------------------------------
[150]30   if !journal EQ 0 then begin
31      print, 'Il n''y a pas de journal ouvert !!'
32      GOTO, sortie
[2]33journal
34;------------------------------------------------------------
[150]35; we complete the journal ...
[2]36;------------------------------------------------------------
[150]37; We recuperate the journal as a vector of string :
[16]38vectjournal = getfile(myuniquetmpdir+'idlsave.pro')
[150]39FOR i = 0,n_elements(vectjournal)-1 DO  print, vectjournal[i]
[2]40;------------------------------------------------------------
[150]41; We cut the last line which is \@ps
[2]42;------------------------------------------------------------
[16]43IF strpos(vectjournal[n_elements(vectjournal)-1],'@ps') ne -1 then $
44  vectjournal = vectjournal[0:n_elements(vectjournal)-2 ]
[2]45;------------------------------------------------------------
[150]46; We correct it if needed...
[2]47;------------------------------------------------------------
48for i = 0, n_elements(vectjournal)-1 do $
49 if strpos(vectjournal[i],'text_box' ) EQ -1 then $
50 vectjournal[i] = strtrim(strcompress(vectjournal[i]), 2)
[150]51FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i]
52;2 lines are identical ??
[2]53for i = 0, n_elements(vectjournal)-2 do $
54 if vectjournal[i] EQ vectjournal[i+1] then vectjournal[i] = ' '
[150]55FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i]
56;
[2]57for i = 0, n_elements(vectjournal)-1 do BEGIN & $
58 if strpos(vectjournal[i],'oups' ) NE -1 $
59 OR strpos(vectjournal[i],'Syntax error' ) NE -1 $
60 OR strpos(vectjournal[i],'Illegal character' ) NE -1 $
61 then BEGIN vectjournal[i] = ' ' & vectjournal[i-1] = ' ' & endif & endfor
[150]62FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i]
[2]63for i = 0, n_elements(vectjournal)-1 do BEGIN & $
64 if strpos(strtrim(vectjournal[i], 1),'retall' ) EQ 0 $
65 OR strpos(vectjournal[i],'@ps' ) NE -1 $
66 OR strpos(vectjournal[i],'@oups' ) NE -1 $
67 OR strpos(vectjournal[i],'@vzoom' ) NE -1 $
68 OR strpos(vectjournal[i],'help' ) NE -1 $
69 OR strpos(vectjournal[i],'print' ) NE -1 $
70 then  vectjournal[i] = ' ' & endfor
[150]71FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i]
[2]72for i = 0, n_elements(vectjournal)-1 do BEGIN & $
73 if strpos(strtrim(vectjournal[i], 1),'plt' ) NE -1 THEN BEGIN & $
74 if strpos(strtrim(vectjournal[i], 1),'noerase') NE -1 then $
75 vectjournal[i] = chkeywd(vectjournal[i],'noerase',1) ELSE $
76 vectjournal[i] = vectjournal[i]+',/noerase' & $
77 ENDIF & endfor
[150]78FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i]
[2]79for i = 0, n_elements(vectjournal)-1 do BEGIN & $
80 if strpos(vectjournal[i],'text_box' ) NE -1 then $
81 IF strpos(vectjournal[i],',pos=' ) EQ -1 then $
82 vectjournal[i] = vectjournal[i]+strmid(vectjournal[i+1], 1) & endfor
83
[150]84; We complete it to transform it in a procedure equivalent to plein2dessin
85   vectjournal = ['reinitplt, /z,/invert' $
[16]86   vectjournal = ['openps, infowidget= infowidget' $
[2]87                  , vectjournal $
88                  ,'closeps, infowidget= infowidget' $
[16]89                  ,'printps' ]
[150]90FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i]
91; We rewrite idlsave.pro
[16]92   putfile, myuniquetmpdir+'idlsave.pro', vectjournal
[150]93; apply idlsave
[16]94   cd,  current = curdir
95   cd, myuniquetmpdir
[2]96@idlsave   
[16]97   cd, curdir
[150]98; We reopen the journal and we put in it all elements of vectjournal but the 2 first and the 3 last line.
[16]99journal, myuniquetmpdir+'idlsave.pro'
[2]100for i = 2, n_elements(vectjournal)-3 DO $
101printf,  !journal, vectjournal[i]
102
103;------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.