[2] | 1 | ;+ |
---|
| 2 | ; |
---|
[133] | 3 | ; @file_comments |
---|
| 4 | ; Kind of UNDO: |
---|
| 5 | ; Allows to redo all the chain of drawing since the opening of the last window without |
---|
| 6 | ; reexecute the last order Example: I do a drawing with 10 plot over it, if I make a |
---|
| 7 | ; mistake, I execute this program and i can redo the only plot missed. |
---|
[2] | 8 | ; |
---|
[150] | 9 | ; @categories |
---|
| 10 | ; utilities |
---|
[2] | 11 | ; |
---|
[150] | 12 | ; @restrictions |
---|
| 13 | ; compatible with \@ps \@vzoom text_box... |
---|
[2] | 14 | ; |
---|
[150] | 15 | ; @history |
---|
[157] | 16 | ; Sebastien Masson (smasson\@lodyc.jussieu.fr) |
---|
[2] | 17 | ; |
---|
| 18 | ; |
---|
[150] | 19 | ; @version |
---|
| 20 | ; $Id$ |
---|
[2] | 21 | ; |
---|
[150] | 22 | ; @todo |
---|
| 23 | ; seb |
---|
[2] | 24 | ; |
---|
| 25 | ;- |
---|
| 26 | ;------------------------------------------------------------ |
---|
[133] | 27 | ; Close the journal! |
---|
[2] | 28 | ;------------------------------------------------------------ |
---|
| 29 | journal |
---|
[133] | 30 | ; we recuperate the journal as a vector of string: |
---|
[11] | 31 | vectjournal = getfile(myuniquetmpdir+'idlsave.pro') |
---|
[133] | 32 | ; we cut the last line which is oups |
---|
[2] | 33 | vectjournal = vectjournal[0:n_elements(vectjournal)-2 ] |
---|
| 34 | ;------------------------------------------------------------ |
---|
[133] | 35 | ; we correct it if there is the need... |
---|
[2] | 36 | ;------------------------------------------------------------ |
---|
| 37 | for i = 0, n_elements(vectjournal)-1 do $ |
---|
| 38 | if strpos(vectjournal[i],'text_box' ) EQ -1 then $ |
---|
| 39 | vectjournal[i] = strtrim(strcompress(vectjournal[i]), 2) |
---|
[133] | 40 | ;2 line are identical ?? |
---|
[2] | 41 | for i = 0, n_elements(vectjournal)-2 do $ |
---|
| 42 | if vectjournal[i] EQ vectjournal[i+1] then vectjournal[i] = ' ' |
---|
| 43 | |
---|
| 44 | for i = 0, n_elements(vectjournal)-1 do BEGIN & $ |
---|
| 45 | if strpos(vectjournal[i],'oups' ) NE -1 $ |
---|
| 46 | OR strpos(vectjournal[i],'Syntax error' ) NE -1 $ |
---|
| 47 | OR strpos(vectjournal[i],'Illegal character' ) NE -1 $ |
---|
| 48 | then BEGIN vectjournal[i] = ' ' & vectjournal[i-1] = ' ' & endif & $ |
---|
| 49 | if strpos(strtrim(vectjournal[i], 1),'retall' ) EQ 0 $ |
---|
| 50 | OR strpos(vectjournal[i],'@oups' ) NE -1 $ |
---|
| 51 | OR strpos(vectjournal[i],'@ps' ) NE -1 $ |
---|
| 52 | OR strpos(vectjournal[i],'@vzoom' ) NE -1 $ |
---|
| 53 | OR strpos(vectjournal[i],'help' ) NE -1 $ |
---|
| 54 | OR strpos(vectjournal[i],'print' ) NE -1 $ |
---|
| 55 | then vectjournal[i] = ' ' & $ |
---|
| 56 | if strpos(vectjournal[i],'text_box' ) NE -1 then $ |
---|
| 57 | vectjournal[i] = vectjournal[i]+strmid(vectjournal[i+1], 1) & endfor |
---|
| 58 | |
---|
| 59 | |
---|
| 60 | ; |
---|
[133] | 61 | ; we erase the last line to reexecute all the programm but the last order. |
---|
[2] | 62 | ; |
---|
| 63 | IF strpos(vectjournal[n_elements(vectjournal)-1],';,pos=[' ) NE -1 then $ |
---|
| 64 | vectjournal[n_elements(vectjournal)-2] = '' $ |
---|
| 65 | ELSE vectjournal[n_elements(vectjournal)-1] = '' |
---|
[133] | 66 | ; we rewrite idlsave.pro |
---|
[229] | 67 | putfile, myuniquetmpdir+'idlsave.pro', vectjournal |
---|
| 68 | ; update the list of .pro and .sav in !PATH |
---|
| 69 | path_cache, /rebuild |
---|
| 70 | ; apply idlsave |
---|
[2] | 71 | @idlsave |
---|
[133] | 72 | ; the journal has just been reopened, and we put elements of vectjournal in it. |
---|
[2] | 73 | for i = 0, n_elements(vectjournal)-1 DO $ |
---|
[11] | 74 | journal, vectjournal[i] |
---|
[2] | 75 | |
---|
| 76 | |
---|
| 77 | |
---|