Changeset 16


Ignore:
Timestamp:
05/02/06 11:17:47 (18 years ago)
Author:
pinsard
Message:

upgrade of POSTSCRIPT/Postscript according to cerbere.lodyc.jussieu.fr: /usr/home/smasson/SAXO_RD/ : files

Location:
trunk
Files:
1 added
1 deleted
6 copied

Legend:

Unmodified
Added
Removed
  • trunk/Obsolete/imprime.pro

    r14 r16  
    77; 
    88; PURPOSE: 
    9 ;       visualise puis imprime eventuellement un fichier Postcript. 
    10 ; depuis rhodes, le LODYC ou L''IPSL vers les imprimantes du LODYC ou 
    11 ; de l''IPSL. si le 
    12 ; fichier n''est pas ds le repertoire courant, on va voir s''il est 
    13 ; sur gaya dans POSTSCRIPT, si oui, on se propose de le rammener. 
    14 ; 
    15 ; CATEGORY: 
    16 ;       traitement fichiers 
    17 ; 
    18 ; CALLING SEQUENCE: 
    19 ;       imprime [,nomfichier] 
    20 ;       
    21 ; INPUTS: 
    22  
    23 ;       nomfichier: nom du fichier a imprimer. si nomfichier n''est 
    24 ;       pas precise on prend le dernier postscript cree ds le 
    25 ;       repertoire courant. 
    26 ; 
    27 ; KEYWORD PARAMETERS: 
    28 ; 
    29 ;       /TRANS:imprime -si on le desire- sur un transparant 
    30 ; 
    31 ;       /NB: obsolete 
    32 ; 
    33 ; COMMON BLOCKS: 
    34 ;       common.pro 
    35 ; 
    36 ; SIDE EFFECTS: 
    37 ; 
    38 ; dans le cas ou le fichier est imprime, il y a possibilite de faire 
    39 ; un archivage sur gaya ds le repertoire POSTSCRIPT. l''archivage se 
    40 ; fait en fonction de la valeur de sauveps (variable globale) : 
    41 ;     sauveps=1 : achivage automatique 
    42 ;     sauveps=0 : on n''archive pas 
    43 ;     sauveps a une autre valeur: on demande si on veut archiver a 
    44 ;                                 chaque ps imprime. 
    45 ; 
    46 ; le nom du ps archive est le suivant: 
    47 ;     un numero lorsque le ps s''appelle idl.ps 
    48 ;     son nom ds les autres cas. 
    49 ; ce nom et la date apparaissent en bas a gauche du ps (ainsi que la 
    50 ; date de creation) 
    51 ; 
    52 ; Rq: avant d''etre envoye sur gaya le fichier est zippe. 
    53 ; 
    54 ; Dans le cas ou loginipsl est definit et la machipsl ne l''est 
    55 ; pas, on passe par la liaison ATM (bcp plus rapide) pour rappatrier le 
    56 ; fichier en local, sur le repertoire temporaire, avant de l''imprimer. 
    57 ; 
    58 ; RESTRICTIONS: verifier que rhodes est bien declare ds vos .rhosts en 
    59 ; local. 
    60 ; sur rhodes ds le .rhosts il faut : 
    61 ;     192.168.111.64      ipsllogin 
    62 ; a l''ipsl ds le .rhosts il faut : 
    63 ;     rhodes-atm          idrislogin 
    64 ; 
    65 ; EXAMPLE: 
    66 ; 
    67 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
    68 ;                       21/12/98 
    69 ;                       25/8/19999 utilisation des widgets 
    70 ;                       8/9/1999 utilisation de cw_bgroup 
     9;       obsolete, use printps instead... 
     10;        
     11; MODIFICATION HISTORY: 
     12; June 2005: Sebastien Masson, english version 
    7113;- 
    7214;------------------------------------------------------------ 
    7315;------------------------------------------------------------ 
    7416;------------------------------------------------------------ 
    75 PRO imprime_event, event 
    76 @common 
    77 ; quel est le type d''evenement? 
    78    widget_control, event.id, get_uvalue=uval 
    79 ; case sur le type d''evenement 
    80    case uval.name OF 
     17PRO imprime, filename, TRANS = trans, NB = nb 
     18; 
     19; this is working only with unix/linux/osX machines 
     20  thisOS = strupcase(strmid(!version.os_family, 0, 3)) 
     21  CASE thisOS OF  
     22    'MAC':return 
     23    'WIN':return 
     24    ELSE: 
     25  ENDCASE 
    8126;------------------------------------------------------------ 
    82 ; visualisation du Postscript 
     27; call printps 
    8328;------------------------------------------------------------ 
    84       'Visualiser':BEGIN  
    85          if key_portrait EQ 1 then sens = 'portrait' ELSE sens = 'seascape'  
    86          case event.value of 
    87             'Ghostview':spawn,'ghostview -a4 -quiet -'+sens+' '+psdir+uval.nomfich 
    88             'Ghostscript':spawn,'gs -sPAPERSIZE=a4 -q '+psdir+uval.nomfich 
    89             'Kghostview':spawn,'kghostview '+psdir+uval.nomfich 
    90          endcase 
    91       end 
    92       'Imprimer':BEGIN  
     29  CASE N_PARAMS() OF 
     30    0:printps 
     31    1:printps, filename 
     32    ELSE: BEGIN  
     33      ras = report('imprime accept only one element: psfilename') 
     34      return 
     35    END  
     36  ENDCASE        
    9337;------------------------------------------------------------ 
    94 ; sauvegarde eventuelle sur gaya, lorsque sauveps ne 0 et que le 
    95 ; fichier vient d''etre cree 
    96 ;------------------------------------------------------------ 
    97          cd, current = olddir 
    98          cd, psdir 
    99          spawn,'which "ls"' , ls 
    100          spawn,ls[n_elements(ls)-1]+' -t *ps' , nomps 
    101          nomps=nomps[n_elements(nomps)-1] 
    102          cd, olddir 
    103          if sauveps NE 0 AND nomps[0] EQ uval.nomfich then begin 
    104 ;------------------------------------------------------------ 
    105 ; ds le cas ou sauveps ne 0 et ne 1 on pause une question pour savoir 
    106 ; si on doit le sauver 
    107 ;------------------------------------------------------------ 
    108             if sauveps NE 1 then begin 
    109                onsauve = report('Voulez-vous sauver le Postscript ?', /defaul_no,  /question) 
    110                if onsauve EQ 0 THEN GOTO, passauver 
    111             endif 
    112 ;------------------------------------------------------------ 
    113 ; on change de nom qd le fichier s''appelle idl.ps 
    114 ;------------------------------------------------------------ 
    115 ; qd le fichier s''appelle idl.ps  
    116             if uval.nomfich eq 'idl.ps' then begin 
    117 ; on recupere le numero du dernier fichier sauvegarde 
    118                restore,'derniernumps.dat' 
    119 ; on lui change de nom : idl.ps en numero.ps 
    120                spawn, 'cp '+psdir+uval.nomfich+' '+psdir+strtrim(numfichps, 1)+'.ps' 
    121                nomfichgaya = strtrim(numfichps, 1)+'.ps' 
    122 ; on incremente le numero 
    123                numfichps = numfichps+1 
    124                save,numfichps,filename='derniernumps.dat' 
    125             ENDIF ELSE nomfichgaya = uval.nomfich 
    126 ;------------------------------------------------------------ 
    127 ; on gzip, on envoie sur gaya  
    128 ;------------------------------------------------------------ 
    129             spawn, 'gzip '+psdir+nomfichgaya ; on zip  
    130             spawn, 'maiaput '+psdir+nomfichgaya+'.gz POSTSCRIPT/'+nomfichgaya+'.gz' ; envoie sur gaya 
    131             if uval.nomfich eq 'idl.ps' then spawn, '\rm '+psdir+nomfichgaya+'.gz' $ ; on efface le fichier zipe 
    132             ELSE spawn, 'gunzip '+psdir+nomfichgaya+'.gz' ; on dezipe 
    133 ;------------------------------------------------------------ 
    134          endif 
    135 passauver: 
    136 ;------------------------------------------------------------ 
    137 ; selection de l''imprimante 
    138 ;------------------------------------------------------------ 
    139          case event.value of 
    140             'Phaser 740 T26':imprimante = 'ph26' 
    141             'Phaser 740 trans T26':imprimante = 'ph26T' 
    142             'Phaser 740 R/V T26':imprimante = 'ph26RV' 
    143             'HP Laser Jet Tour 26':imprimante = 'hpl26' 
    144             'HP Laser Jet Tour 26 R/V':imprimante = 'hpl26RV' 
    145             'sparc T26':imprimante = 'sparc' 
    146             'Phaser 740 T15':imprimante = 'ph15' 
    147             'Phaser 740 trans T15':imprimante = 'ph15T' 
    148             'Phaser 740 R/V T15':imprimante = 'ph15RV' 
    149             'HP Laser Jet Tour 15':imprimante = 'hpl15' 
    150             'HP Laser Jet Tour 15 R/V':imprimante = 'hpl15RV' 
    151             'sparc T15':imprimante = 'sparc2' 
    152          'CX T15':BEGIN & imprimante = 'CX' & GOTO, lodyc & end 
    153          'CX-trans T15':BEGIN & imprimante = 'CXtrans' & GOTO, lodyc & END 
    154             'SUN IPSL':imprimante = 'SUN' 
    155             'QMS-IPSL':imprimante = 'QMS' 
    156             'QMS-trans-IPSL':imprimante = 'QMS-trans' 
    157             ELSE: 
    158          endcase 
    159 ;------------------------------------------------------------ 
    160 ; ou je suis ??? 
    161 ;------------------------------------------------------------ 
    162          spawn, 'hostname', hostname & hostname = hostname[n_elements(hostname)-1] 
    163          if hostname EQ 'rhodes' then domainname = 'idris.fr' $ 
    164          ELSE spawn, 'domainname', domainname 
    165          domainname = domainname[n_elements(domainname)-1] 
    166          if domainname NE 'lodyc.jussieu.fr' AND domainname NE 'ipsl.jussieu.fr' $ 
    167           AND domainname NE 'idris.fr' then return 
    168          if domainname EQ 'lodyc.jussieu.fr' then GOTO, lodyc 
    169 ;------------------------------------------------------------ 
    170 ; choix du reseau surlequel on renvoie : IPSL ou LODYC et 
    171 ; specification du login, de la machine et du repertoire temporel ds 
    172 ; les 2 cas 
    173 ;------------------------------------------------------------ 
    174          if domainname EQ 'ipsl.jussieu.fr' then begin 
    175             machipsl = hostname 
    176             spawn, 'whoami', loginipsl & loginipsl = loginipsl[n_elements(loginipsl)-1] 
    177          endif 
    178          if n_elements(loginipsl) NE 0 THEN BEGIN  
    179             if loginipsl Eq '' THEN GOTO, lodyc 
    180             login = loginipsl   ; si on a un login a l''ipsl et que machipsl n''est pas stipule 
    181 ; alors on utilise la liaison ATM entre perouse et rhodes. 
    182             if n_elements(machipsl) EQ 0 then machine = '192.168.111.64' $ 
    183             ELSE BEGIN  
    184                if machipsl EQ '' then machine = '192.168.111.64' $ 
    185                ELSE machine = machipsl+'.ipsl.jussieu.fr' 
    186             ENDELSE 
    187             reptemp = '/temp/'+login+'/' 
    188          ENDIF ELSE BEGIN  
    189 lodyc: 
    190             if domainname EQ 'lodyc.jussieu.fr' then begin 
    191                machlodyc = hostname 
    192                spawn, 'whoami', loginlodyc & loginlodyc = loginlodyc[n_elements(loginlodyc)-1] 
    193             endif 
    194             if n_elements(loginlodyc) EQ 0 THEN BEGIN 
    195                loginlodyc = xquestion('Quel est votre login au LODYC ?') 
    196             ENDIF 
    197             login = loginlodyc 
    198             machine = machlodyc+'.lodyc.jussieu.fr' 
    199             reptemp = '/usr/temp/'+login+'/' 
    200 ; on change le nom des imprimantes qd on est sur le reseau du lodyc 
    201             case imprimante of 
    202                'SUN':imprimante = 'sun-ipsl' 
    203                'QMS':imprimante = 'qms-ipsl' 
    204                'QMS-trans': imprimante = 'qmst-ipsl' 
    205                ELSE: 
    206             endcase 
    207          ENDELSE 
    208 ;------------------------------------------------------------ 
    209 ; je suis deja sur le bon reseau ou il faut faire des rsh? 
    210 ;------------------------------------------------------------ 
    211          spawn, 'whoami', whoami & whoami = whoami[n_elements(whoami)-1] 
    212          if whoami EQ login then BEGIN 
    213             spawn,'lpr -P'+imprimante+' '+psdir+uval.nomfich 
    214             spawn,'lpq -P'+imprimante+' -l', info 
    215          ENDIF ELSE BEGIN  
    216 ;------------------------------------------------------------ 
    217 ; copie du Postscript sur le repertoire temporel a jussieu 
    218 ;------------------------------------------------------------ 
    219             spawn,'rcp '+psdir+uval.nomfich+' '+login+'@'+machine+':'+reptemp+'.'  
    220 ;------------------------------------------------------------ 
    221 ; impression puis destruction du Postscript 
    222 ;------------------------------------------------------------ 
    223 ;            print, 'rsh '+machine+' -l '+login+' lpr -P'+imprimante+' '+reptemp+uval.nomfich 
    224             spawn,'rsh '+machine+' -l '+login+' lpr -P'+imprimante+' '+reptemp+uval.nomfich 
    225 ;------------------------------------------------------------ 
    226 ; squate de l'imprimante utilisee 
    227 ;------------------------------------------------------------ 
    228 ;            print, 'rsh '+machine+' -l '+login+' lpq -P'+imprimante+' -l' 
    229             spawn,'rsh '+machine+' -l '+login+' lpq -P'+imprimante+' -l', info 
    230 ; 
    231          ENDELSE  
    232          xdisplayfile, 'bidon', text = info, title = 'Info impression '+uval.nomfich $ 
    233           , height = n_elements(info) <  24 
    234          widget_control, event.top, /destroy ; on tue le widget 
    235  
    236       END 
    237       'quit':widget_control, event.top, /destroy ; on tue le widget 
    238  
    239    endcase 
    240    return 
    241 end 
    242 pro imprime,nomfichier,TRANS=trans, NB = nb 
    243 ; 
    244    thisOS = strupcase(strmid(!version.os_family, 0, 3)) 
    245    CASE thisOS OF  
    246       'MAC':return 
    247       'WIN':return 
    248       ELSE: 
    249    ENDCASE 
    250 ; 
    251 @common 
    252 ;------------------------------------------------------------ 
    253 ; attribution du nom du fichier a imprimer 
    254 ;------------------------------------------------------------ 
    255    CASE N_PARAMS() OF 
    256       0: BEGIN  
    257          cd, current = olddir 
    258          cd, psdir 
    259          spawn,'which "ls"' , ls 
    260          spawn,ls[n_elements(ls)-1]+' -t *ps' , nomfich 
    261          nomfich=nomfich[n_elements(ls)-1] 
    262          cd, olddir 
    263       END 
    264       1: nomfich=nomfichier 
    265       else: BEGIN  
    266          ras = report('Mauvais nombre de parametre dans l''appel de IMPRIME') 
    267          return 
    268       END  
    269    endcase        
    270 ;------------------------------------------------------------ 
    271 ; on verifie que le fichier est ds le reertoire courant. 
    272 ; si il n''y est pas et on va voir s''il est sur gaya.  
    273 ;------------------------------------------------------------ 
    274    quelsfichiers = findfile(psdir+nomfich) 
    275    IF quelsfichiers[0] EQ '' THEN BEGIN ; il faut aller chercher le fichier sur gaya 
    276       spawn, 'whoami', whoami   ; login a l''idris 
    277                                 ; le fichier zippe existe sur gaya ? 
    278       spawn,'rsh '+whoami+'@gaya.idris.fr ls POSTSCRIPT/'+nomfich+'.gz', resultat 
    279       if resultat[n_elements(resultat)-1] NE '' then BEGIN ; s''il existe on le rappatrie 
    280          gaya = report('le postscript est archive sur gaya. faire le gayaget?', /question, /defualt_no) 
    281          if gaya EQ 0 then return 
    282          print, 'gayaget POSTSCRIPT/'+nomfich+'.gz '+nomfich+'.gz ...' 
    283          spawn, 'gayaget POSTSCRIPT/'+nomfich+'.gz '+nomfich+'.gz' ; on le rappatrie sur rhodes 
    284          spawn, 'gunzip '+nomfich+'.gz ' ; on le dezippe 
    285       ENDIF ELSE BEGIN  
    286          print, 'le fichier '+nomfich+' n''existe pas' 
    287          print, 'le fichier '+nomfich+'.gz n''existe pas sur gaya ds le repertoire POSTSCRIPT' 
    288          return 
    289       ENDELSE  
    290    ENDIF 
    291 ;------------------------------------------------------------ 
    292 ;------------------------------------------------------------ 
    293    base = widget_base(/row, title = 'fichier Postscript: '+nomfich) 
    294    rien = cw_bgroup(base, ['Kghostview', 'Ghostview', 'Ghostscript'], /frame, label_top = 'Visualiser' $ 
    295                     , uvalue = {name:'Visualiser', nomfich:nomfich}, /column, /return_name) 
    296    rien = cw_bgroup(base, ['Phaser 740 T26','Phaser 740 trans T26', 'Phaser 740 R/V T26' $ 
    297                            , 'HP Laser Jet Tour 26', 'HP Laser Jet Tour 26 R/V' $ 
    298                            , 'sparc T26', 'Phaser 740 T15', 'Phaser 740 trans T15' $ 
    299                            , 'Phaser 740 R/V T15', 'CX T15', 'CX-trans T15'$ 
    300                            , 'HP Laser Jet Tour 15', 'HP Laser Jet Tour 15 R/V', 'sparc T15' $ 
    301                            , 'SUN IPSL', 'QMS-IPSL', 'QMS-trans-IPSL'], /frame $ 
    302                     , label_top = 'Imprimer', uvalue = {name:'Imprimer', nomfich:nomfich} $ 
    303                     , /column, /return_name) 
    304    rien = widget_button(base,value='quit', uvalue={name:'quit'}) 
    305 ;------------------------------------------------------------ 
    306 ;execution de la fentre de base et des sous-fenetres 
    307    widget_control,base,/realize 
    308 ;------------------------------------------------------------ 
    309    xmanager,'imprime',base, /no_block 
    310 ;------------------------------------------------------------ 
    311    return 
    312 end 
     38  return 
     39END 
    31340 
    31441 
  • trunk/Postscript/closeps.pro

    r14 r16  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:closeps 
     5; NAME: closeps 
    66; 
    7 ; PURPOSE:ferme de l'environement Postscript 
     7; PURPOSE: Close the Postscript mode 
    88; 
    9 ; CALLING SEQUENCE:closeps 
     9; CALLING SEQUENCE: closeps 
    1010; 
    1111; KEYWORD PARAMETERS: 
    12 ;         INFOWIDGET: un long integer qui doit etre l''id du windget 
    13 ;         que l''on souhaite detruire (cf. openps.pro) 
    1412; 
    15 ; COMMON BLOCKS: 
    16 ;       common.pro 
     13;      INFOWIDGET: A long integer giving the id of the information 
     14;           widget (created by openps) that we have de destroy at  
     15;           the end of closeps (when the postscript is done) 
    1716; 
    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. 
     17; COMMON BLOCKS: cm_4ps 
     18; 
     19; SIDE EFFECTS: when archive_ps ne 0, we add the name and the date 
     20;    at the bottom left corner of the postcript page. If the 
     21;    postscript is called idl.ps we change its name to number.ps 
     22;    (number automatically found to be 1 larger that any of the 
     23;     existing ps file) 
    2124; 
    2225; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
    2326;                       21/12/98 
     27; June 2005: Sebastien Masson, english version with new commons  
    2428;- 
    2529;------------------------------------------------------------ 
    2630;------------------------------------------------------------ 
    2731;------------------------------------------------------------ 
    28 pro closeps, INFOWIDGET = infowidget 
    29 @common 
     32PRO closeps, INFOWIDGET = infowidget 
     33; 
     34   IF lmgr(/demo) EQ 1 THEN return 
    3035;------------------------------------------------------------ 
    31 ; si sauve ps different de 0 on sauve le ps sur maia automatiquement 
    32 ; ou apres une question. 
     36; include commons 
     37@cm_4ps 
     38  IF NOT keyword_set(key_forgetold) THEN BEGIN 
     39@updatenew 
     40  ENDIF 
     41; 
     42  IF !d.name NE 'PS' THEN GOTO, last_part 
    3343;------------------------------------------------------------ 
    34    if sauveps NE 0 then begin 
     44; if archive_ps /= 0 we will add its name and the date at the bottom 
     45; left corner of the page (in case if the postscript will be archived  
     46; in printps  
    3547;------------------------------------------------------------ 
    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 
     48   IF keyword_set(archive_ps) THEN BEGIN 
    3949;------------------------------------------------------------ 
    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; we get the name of the latest created postscript.  
    5051;------------------------------------------------------------ 
    51 ; on annote le postscript 
     52     psdir = isadirectory(psdir, title = 'Select psdir') 
     53     nameps = file_search(psdir+'*.ps' $ 
     54                          , /test_regular, /test_write, /nosort) 
     55     dates = (file_info(nameps)).mtime 
     56     lastdate = (reverse(sort(temporary(dates))))[0] 
     57     nameps = nameps[lastdate] 
     58     nameps = file_basename(nameps, '.ps') 
     59; If this name is idl.ps then we change it to the number.ps 
     60     IF nameps EQ 'idl' then BEGIN 
     61; get the name of all the *.ps or *.ps.gz files available in psdir 
     62       allps = file_search(psdir+'*[.ps|.ps.gz|.pdf]', /test_regular, /nosort) 
     63       allps = file_basename(file_basename(allps,'.gz'),'.ps') 
     64       allps = file_basename(allps,'.pdf') 
     65; find which of these names corresponds to numbers... 
     66; get ascii codes of the names 
     67       testnumb = byte(allps) 
     68; longest name 
     69       maxstrlen = (size(testnumb, /dimensions))[0] 
     70; ascii codes can be 0 or between byte('0') and byte('9') 
     71       testnumb = testnumb EQ 0 OR $ 
     72                  (testnumb GE (byte('0'))[0] AND testnumb LE (byte('9'))[0]) 
     73       testnumb = where(total(testnumb, 1) EQ maxstrlen, count) 
     74       IF count NE 0 THEN BEGIN 
     75; get the largest number 
     76         psnumber = fix(allps[testnumb]) 
     77         psnumber = (psnumber[reverse(sort(psnumber))])[0] + 1 
     78       ENDIF ELSE psnumber = 0 
     79       nameps = strtrim(psnumber, 2) 
     80     ENDIF 
    5281;------------------------------------------------------------ 
    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 
     82; we annote the postscript 
    5783;------------------------------------------------------------ 
    58    if !d.name EQ 'PS' then device,/close 
     84     date = byte(systime(0))    ; we get the date 
     85     xyouts, !d.x_px_cm, !d.y_px_cm $ 
     86             , nameps+') '+string(date[4:10])+string(date[20:23]) $ 
     87             , /device, charsize = .75 
     88   ENDIF 
     89;------------------------------------------------------------ 
     90; close the postcript mode 
     91   device, /close 
     92; 
     93last_part: 
     94; 
    5995   thisOS = strupcase(strmid(!version.os_family, 0, 3)) 
    6096   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 
     97     'MAC': SET_PLOT, thisOS 
     98     'WIN': SET_PLOT, thisOS 
     99     ELSE: SET_PLOT, 'X' 
     100   ENDCASE     
     101   def_myuniquetmpdir 
     102   colorfile = myuniquetmpdir + 'original_colors.dat' 
     103   IF file_test(colorfile, /regular) THEN BEGIN 
     104     restore, colorfile 
     105     file_delete, colorfile, /quiet 
     106; reload the original colors 
     107     tvlct, red, green, blue 
     108   ENDIF 
    66109   !p.font = -1 
     110; force background color to the last color (white) 
    67111   !p.BACKGROUND=(!d.n_colors-1) < 255 
    68112   !p.color=0 
  • trunk/Postscript/openps.pro

    r14 r16  
    55; NAME:openps 
    66; 
    7 ; PURPOSE:ouverture de l''environement Postscript. au passage on sauve 
    8 ; la palette dans les vecteurs rouge, vert et bleu puis on palit la 
    9 ; couleur a l''aide ce palit. 
     7; PURPOSE:switch to postcript mode and define it 
    108; 
    11 ; CALLING SEQUENCE:openps[,nomfich] 
     9; CALLING SEQUENCE:openps[,nameps] 
    1210; 
    13 ; INPUTS: 
    14 ;        nomfich: string donnant le nom du fichier ps a ouvrir, evite 
    15 ; que openps ose la question :'Nom du fichier Postscript?' 
     11; OPTIONAL INPUT: 
     12;        nameps: name of the postscript file. Extension '.ps' is added 
     13;                if missing. It will be stored in the psdir directory. 
    1614; 
    1715; KEYWORD PARAMETERS: 
    1816; 
    19 ;        FILENAME: meme role que nomfich mais comme c''est un mot cle, 
    20 ;        il peut passer a travers les differentes routines via 
    21 ;        INFOWIDGET: a egaler a une variable qui contiendra l''id du 
    22 ;        widget qui informe qu''un cree un widget. 
    23 ;        _EXTRA: tous les mots cles se rapportant a la procedure device 
     17;        FILENAME: to define the name of the postcript file through 
     18;                  a keyword rather than with nameps inut argument 
     19;                  (in this case the keyword can be pass through  
     20;                  different routines via _extra keyword). 
     21; 
     22;        INFOWIDGET: If INFOWIDGET is present, it specifies a named 
     23;             variable into which the id of the widget giving informations 
     24;             about the postscript creation is stored as a long integer. 
     25;             This id is needed by close ps to kill the information widget. 
     26; 
     27;        KEEP_PFONT: activate to suppress the modification of !p.font 
     28;            (by defaut we force  !p.font = 0  to make smaller postscripts) 
     29;        KEEPPFONT: same as keep_pfont 
     30; 
     31;        LIGHTNESS: a scalar used to change the Lightness of the color 
     32;            palette to be abble to adjust according to the printer we use, 
     33;            the media (paper or slide)...  
     34;               lightness < 1 to get lighter colors 
     35;                         > 1 to get darker colors 
     36; 
     37;        _EXTRA: used to pass any keyword to device procedure. 
    2438 
     39; COMMON BLOCKS: cm_4ps 
     40; 
    2541; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
    2642;                       21/12/98 
    27 ; 1/2/98: ajout de nomfich en input 
     43; 1/2/98: ajout de nameps en input 
    2844; 1/9/1999: ajout du mot cle FILENAME et du widget 
     45; June 2005: Sebastien Masson, cleaning, english version with new commons  
    2946;- 
    3047;------------------------------------------------------------ 
    3148;------------------------------------------------------------ 
    3249;------------------------------------------------------------ 
    33 pro openps, nomfichier, FILENAME = filename, INFOWIDGET = infowidget, _extra = ex 
    34 @common 
    35    if !d.name EQ 'PS' then device,/close 
     50pro openps, namepsin, FILENAME = filename, INFOWIDGET = infowidget $ 
     51            , KEEPPFONT = keeppfont, KEEP_PFONT = keep_pfont $ 
     52            , PORTRAIT = portrait, LANDSCAPE = landscape $ 
     53            , LIGHTNESS = Lightness,_extra = ex 
     54; 
     55   IF lmgr(/demo) EQ 1 THEN BEGIN 
     56      dummy = report('impossible to create a PS in demo mode') 
     57      return 
     58   ENDIF 
     59;------------------------------------------------------------ 
     60; include commons 
     61@cm_4ps 
     62IF NOT keyword_set(key_forgetold) THEN BEGIN 
     63@updatenew 
     64ENDIF 
     65;------------------------------------------------------------ 
     66; close the postcript device if we are already in postcsrit mode 
     67   IF !d.name EQ 'PS' THEN device, /close 
     68; switch to postscript mode 
    3669   set_plot,'ps' 
    3770;------------------------------------------------------------ 
    38 ; on sauve la palette ds rou, vert et bleu 
     71; if we use  keyword Lightness 
     72; save the actual color palette in a temporary file 
     73; (to be restored when calling closeps 
    3974;------------------------------------------------------------ 
    40    tvlct, rouge, vert, bleu, /get 
    41    palit,coefpalit 
     75   IF n_elements(Lightness) NE 0 THEN BEGIN 
     76     IF Lightness NE 1 THEN BEGIN 
     77       tvlct, red, green, blue, /get 
     78       def_myuniquetmpdir 
     79       save, red, green, blue, filename = myuniquetmpdir + 'original_colors.dat' 
     80       palit, Lightness, red, green, blue 
     81     ENDIF 
     82   ENDIF 
    4283;------------------------------------------------------------ 
    43 ; on choisit le nom du fichier 
     84; we define the name of the file 
    4485;------------------------------------------------------------ 
    45    if keyword_set(filename) then nomfich = filename 
    46    if n_elements(nomfichier) NE 0 then nomfich = nomfichier 
    47 ; il faut choisir  
    48    if n_elements(nomfich) EQ 0 then $ 
    49     nomfich = xquestion('Nom du fichier Postscript?', 'idl.ps', /chkwid) 
    50    nomfich = isafile(file = nomfich, iodir = psdir, /new) 
     86   CASE 1 OF 
     87     n_params() EQ 1:nameps = namepsin 
     88     keyword_set(filename): nameps = filename 
     89     ELSE:nameps = xquestion('Name of the postscript file?', 'idl.ps', /chkwid) 
     90   ENDCASE 
     91; make sure that nameps ends with '.ps' 
     92   nameps = file_dirname(nameps, /mark_directory) + $ 
     93            file_basename(nameps, '.ps') + '.ps' 
     94; add path (psdir) and check that nameps is ok 
     95   nameps = isafile(nameps, iodir = psdir, /new) 
    5196;------------------------------------------------------------ 
    52 ; on determine xsize, ysize, xoffset et  yoffset  
     97; we define xsize, ysize, xoffset et  yoffset  
    5398;------------------------------------------------------------ 
    54    if key_portrait EQ 1  then begin 
    55       xs = petitfeuille 
    56       ys = grandfeuille 
    57       xoff = 0 
    58       yoff = 0 
     99   IF keyword_set(portrait) OR keyword_set(landscape) THEN $ 
     100     key_portrait = keyword_set(portrait) * (1 - keyword_set(landscape)) 
     101   if key_portrait EQ 1 then begin 
     102      xs = min(page_size) 
     103      ys = max(page_size) 
     104      xoff = 0. 
     105      yoff = 0. 
    59106   ENDIF ELSE BEGIN  
    60       xs = grandfeuille 
    61       ys = petitfeuille 
    62       xoff = 0 
    63       yoff = grandfeuille 
     107      xs = max(page_size) 
     108      ys = min(page_size) 
     109      xoff = 0. 
     110      yoff = max(page_size) 
    64111   ENDELSE  
    65112;------------------------------------------------------------ 
    66 ; on ouvre le postcript  
     113; We define the device of the postscript mode 
    67114;------------------------------------------------------------ 
    68    device, /color,/palatino,LANDSCAPE=1-key_portrait,PORTRAIT=key_portrait $ 
    69     ,xsize=xs,ysize=ys,xoffset=xoff,yoffset=yoff $ 
    70     ,filename=strcompress(nomfich, /remove_all) $ 
    71     ,bits_per_pixel=8,_extra = ex 
    72    !p.font=0    
     115   device, /color, /palatino, filename = strcompress(nameps, /remove_all) $ 
     116           , LANDSCAPE = 1 - key_portrait, PORTRAIT = key_portrait $ 
     117           , xsize = xs, ysize = ys, xoffset = xoff, yoffset = yoff $ 
     118           , bits_per_pixel = 8, _extra = ex 
     119; to make smaller postcripts 
     120   IF NOT (keyword_set(keeppfont) OR keyword_set(keep_pfont)) $ 
     121   THEN !p.font = 0    
     122; show some informations 
     123   IF arg_present(infowidget) THEN $ 
     124    infowidget = xnotice('Postcript file is currently processed...') 
    73125; 
    74    if arg_present(infowidget) then $ 
    75     infowidget = xnotice('Creation du Postscript en cours...') 
    76 ; 
    77    return 
     126   RETURN 
    78127END 
    79128 
  • trunk/ToBeReviewed/POSTSCRIPT/calibre.pro

    r14 r16  
    88; characteres) des differentes marges, calcul posfenetre et posbar qui 
    99; servent a placer le dessin et la barre de couleur grace a 
    10 ; !p.position sur une feuille petitfeuille*grandfeuille (21*29.7) ou 
     10; !p.position sur une feuille ou 
    1111; sur une sortie ecran dont la fenetre a les memes proportions 
    1212; 
     
    1414; 
    1515; CALLING SEQUENCE: 
    16 ;     calibre, rapportyx,marge,margebar, petitdessin,posfenetre, posbar  
     16;     calibre, rapportyx,marge,margebar, smalldraw,posfenetre, posbar  
    1717; 
    1818; INPUTS: 
     
    3030; couleur. tout est mesure en lignes de characteres 
    3131; 
    32 ;       petitdessin: 2 possiblites 
     32;       smalldraw: 2 possiblites 
    3333;             un vecteur de 4 elements donnant (en portrait ou 
    3434; en landscape) la position de cadre ds lequel doit rentrer le 
     
    4040; faire de le dessin, le nombre de lignes et enfin le numero de la 
    4141; case que doit occuper le dessin (cf matlab). par ex pour faire 6 
    42 ; dessin en 2 colonnes et 3 lignes et occuper la 4 eme case, petit=[2,3,4] 
     42; dessin en 2 colonnes et 3 lignes et occuper la 4 eme case, small=[2,3,4] 
    4343; 
    4444; KEYWORD PARAMETERS: 
    4545; 
    4646;       /REMPLI:oblige le dessin a occuper l'espace maximum definit 
    47 ; par petitdessin sans resperter le rapport y sur x. 
    48 ; 
    49 ;       YSURX: force le rapport y sur x a prendre la valeur 
    50 ; rapportyx*ysurx. ce mot cle est utile ds deux cas:  
    51 ;   1) ysurx=1 : oblige rapportyx a etre bien respecte sinon 
     47; par smalldraw sans resperter le rapport y sur x. 
     48; 
     49;       YXASPECT: force le rapport y sur x a prendre la valeur 
     50; rapportyx*yxaspect. ce mot cle est utile ds deux cas:  
     51;   1) yxaspect=1 : oblige rapportyx a etre bien respecte sinon 
    5252;         calibre se reserve le droit de changer un peu celui-ci dans 
    53 ;         le cas ou le rapport d''aspect de petit dessin est trop 
    54 ;         different de celui de petitdessin. 
    55 ;   2) ysurx=n : multiplie par n le rapport d''aspect donne par 
     53;         le cas ou le rapport d''aspect de small dessin est trop 
     54;         different de celui de smalldraw. 
     55;   2) yxaspect=n : multiplie par n le rapport d''aspect donne par 
    5656;         defaut.par ex ds plt, rapportyx est calcule pour que le 
    5757;         repere soit orthonorme, pour avoir un repere ou l''axe des y 
    58 ;         est 2 fois plus dilate que celui des y YSURX=2 
     58;         est 2 fois plus dilate que celui des y YXASPECT=2 
    5959;        
    6060;       PORTRAIT et LANDSCAPE: mots cles plus utilises mais tjs fonctionnels 
     
    8484;------------------------------------------------------------ 
    8585;------------------------------------------------------------ 
    86 pro calibre, rapportyx,marge,margebar, petitdessin,posfenetre, posbar $ 
    87              ,REMPLI=rempli,YSURX=ysurx,PORTAIT=portrait,LANDSCAPE=lanscape 
    88 ;------------------------------------------------------------ 
    89 @common 
     86pro calibre, rapportyx, marge, margebar, smalldraw, posfenetre, posbar $ 
     87             , REMPLI = rempli, YXASPECT = yxaspect, PORTRAIT = portrait $ 
     88             , LANDSCAPE = lanscape, _extra = ex 
     89;--------------------------------------------------------- 
     90@cm_4ps 
     91  IF NOT keyword_set(key_forgetold) THEN BEGIN 
     92@updatenew 
     93@updatekwd 
     94  ENDIF 
     95;--------------------------------------------------------- 
     96;------------------------------------------------------------ 
    9097   tempsun = systime(1)         ; pour key_performance 
    9198;------------------------------------------------------------- 
    9299   if keyword_set(portrait) then key_portrait=1 
    93100   if keyword_set(landscape) then key_portrait=0 
    94    if keyword_set(ysurx) then begin 
    95       rapportyx=rapportyx*ysurx  
     101   if keyword_set(yxaspect) then begin 
     102      rapportyx=rapportyx*yxaspect  
    96103      test2=0 
    97104   endif else begin 
    98       ysurx=1. 
     105      yxaspect=1. 
    99106      test2=1 
    100    endelse 
     107    ENDELSE 
     108;  
     109    mipgsz = min(page_size, max = mapgsz) 
    101110;------------------------------------------------------------ 
    102111; choix de Landscape ou Portrait 
     
    107116   endif 
    108117;------------------------------------------------------------- 
    109 ; si petitdessin est compte comme ds matlab 
     118; si smalldraw est compte comme ds matlab 
    110119;------------------------------------------------------------- 
    111    if n_elements(petitdessin) EQ 3  then begin 
    112       if n_elements(margescadre) EQ 0 then margescadre = [1, 1, 1, 1] 
    113       petitdessin = long(petitdessin) 
    114       nbrecol = petitdessin[0] 
    115       nbrelig = petitdessin[1] 
    116       numero = petitdessin[2]-1 
     120   if n_elements(smalldraw) EQ 3  then begin 
     121      if n_elements(page_margins) EQ 0 then page_margins = [1, 1, 1, 1] 
     122      smalldraw = long(smalldraw) 
     123      nbrecol = smalldraw[0] 
     124      nbrelig = smalldraw[1] 
     125      numero = smalldraw[2]-1 
    117126      numlig = numero/nbrecol 
    118127      numcol = numero-numlig*nbrecol 
    119       bas = petitfeuille*key_portrait+grandfeuille*(1-key_portrait)  
    120       cote = grandfeuille*key_portrait+petitfeuille*(1-key_portrait)  
    121       poscol = margescadre[0]+findgen(nbrecol+1)*(1.*(bas-(margescadre[0]+margescadre[1]))/nbrecol) 
    122       poslig = cote-margescadre[3]-findgen(nbrelig+1)*(1.*(cote-(margescadre[2]+margescadre[3]))/nbrelig) 
    123       petitdessin = [poscol[numcol], poslig[numlig+1], poscol[numcol+1], poslig[numlig]] 
     128      bas = mipgsz*key_portrait+mapgsz*(1-key_portrait)  
     129      cote = mapgsz*key_portrait+mipgsz*(1-key_portrait)  
     130      poscol = page_margins[0]+findgen(nbrecol+1)*(1.*(bas-(page_margins[0]+page_margins[1]))/nbrecol) 
     131      poslig = cote-page_margins[3]-findgen(nbrelig+1)*(1.*(cote-(page_margins[2]+page_margins[3]))/nbrelig) 
     132      smalldraw = [poscol[numcol], poslig[numlig+1], poscol[numcol+1], poslig[numlig]] 
    124133   endif 
    125134;------------------------------------------------------------ 
     
    127136;------------------------------------------------------------ 
    128137   nombre_de_mots_ds_titre = 60. 
    129    !p.charsize=1.*(petitdessin[2]-petitdessin[0])*!d.x_px_cm / $ 
     138   !p.charsize=1.*(smalldraw[2]-smalldraw[0])*!d.x_px_cm / $ 
    130139    (nombre_de_mots_ds_titre* !d.y_ch_size) 
    131140   if !p.charsize gt 1 then !p.charsize=1 
     
    140149;------------------------------------------------------------ 
    141150   if key_portrait eq 0 then begin 
    142       grand=petitdessin[2]-petitdessin[0] 
    143       petit=petitdessin[3]-petitdessin[1] 
     151      big=smalldraw[2]-smalldraw[0] 
     152      small=smalldraw[3]-smalldraw[1] 
    144153   endif else begin 
    145       petit=petitdessin[2]-petitdessin[0] 
    146       grand=petitdessin[3]-petitdessin[1] 
     154      small=smalldraw[2]-smalldraw[0] 
     155      big=smalldraw[3]-smalldraw[1] 
    147156   endelse 
    148157   if key_portrait eq 0 then $ 
    149     rapportmax=1.*(petit-marge[3]-marge[1])/(grand-marge[2]-marge[0]) $ 
    150    else rapportmax=1.*(petit-marge[2]-marge[0])/(grand-marge[3]-marge[1]) 
    151 ;------------------------------------------------------------ 
    152 ; si ysurx n'est pas specifie on modifie la valeur de rapportyx pour que 
     158    rapportmax=1.*(small-marge[3]-marge[1])/(big-marge[2]-marge[0]) $ 
     159   else rapportmax=1.*(small-marge[2]-marge[0])/(big-marge[3]-marge[1]) 
     160;------------------------------------------------------------ 
     161; si yxaspect n'est pas specifie on modifie la valeur de rapportyx pour que 
    153162; ca colle un peu plus aux proportions de la feuille 
    154163;------------------------------------------------------------ 
     
    175184   if key_portrait eq 0 then begin        
    176185      if keyword_set(rempli) then begin 
    177          xs=grand 
    178          ys=petit 
     186         xs=big 
     187         ys=small 
    179188      endif else begin 
    180189         if rapportyx le rapportmax then begin 
    181             xs=grand 
    182             ys=1.*(grand-marge[0]-marge[1])*rapportyx+marge[2]+marge[3] 
    183             if ys gt petit then begin 
    184                xs=1.*(petit-marge[2]-marge[3])/rapportyx+marge[0]+marge[1] 
    185                ys=petit 
     190            xs=big 
     191            ys=1.*(big-marge[0]-marge[1])*rapportyx+marge[2]+marge[3] 
     192            if ys gt small then begin 
     193               xs=1.*(small-marge[2]-marge[3])/rapportyx+marge[0]+marge[1] 
     194               ys=small 
    186195            endif 
    187196         endif else begin 
    188             xs=1.*(petit-marge[2]-marge[3])/rapportyx+marge[0]+marge[1] 
    189             ys=petit 
    190             if xs gt grand then begin 
    191                xs=grand 
    192                ys=1.*(grand-marge[0]-marge[1])*rapportyx+marge[2]+marge[3] 
     197            xs=1.*(small-marge[2]-marge[3])/rapportyx+marge[0]+marge[1] 
     198            ys=small 
     199            if xs gt big then begin 
     200               xs=big 
     201               ys=1.*(big-marge[0]-marge[1])*rapportyx+marge[2]+marge[3] 
    193202            endif 
    194203         endelse 
    195204      endelse 
    196       xoff=1.*(petit-ys)/2.+petitdessin[1] 
    197       yoff=1.*(grand-xs)/2.+xs+grandfeuille-petitdessin[2] 
    198       a=1.*(grandfeuille-yoff)/grandfeuille 
    199       b=1.*xoff/petitfeuille 
    200       c=a+1.*xs/grandfeuille 
    201       d=b+1.*ys/petitfeuille 
     205      xoff=1.*(small-ys)/2.+smalldraw[1] 
     206      yoff=1.*(big-xs)/2.+xs+mapgsz-smalldraw[2] 
     207      a=1.*(mapgsz-yoff)/mapgsz 
     208      b=1.*xoff/mipgsz 
     209      c=a+1.*xs/mapgsz 
     210      d=b+1.*ys/mipgsz 
    202211   endif $ 
    203212;------------------------------------------------------------ 
     
    206215   else begin        
    207216      if keyword_set(rempli) then begin 
    208          xs=petit 
    209          ys=grand 
     217         xs=small 
     218         ys=big 
    210219      endif else begin 
    211220         if rapportyx le rapportmax then begin 
    212             xs=petit 
    213             ys=1.*(petit-marge[0]-marge[1])*rapportyx+marge[2]+marge[3] 
    214             if ys gt grand then begin 
    215                xs=1.*(grand-marge[2]-marge[3])/rapportyx+marge[0]+marge[1] 
    216                ys=grand 
     221            xs=small 
     222            ys=1.*(small-marge[0]-marge[1])*rapportyx+marge[2]+marge[3] 
     223            if ys gt big then begin 
     224               xs=1.*(big-marge[2]-marge[3])/rapportyx+marge[0]+marge[1] 
     225               ys=big 
    217226            endif 
    218227         endif else begin 
    219             xs=1.*(grand-marge[2]-marge[3])/rapportyx+marge[0]+marge[1] 
    220             ys=grand 
    221             if xs gt petit then begin 
    222                xs=petit 
    223                ys=1.*(petit-marge[0]-marge[1])*rapportyx+marge[2]+marge[3] 
     228            xs=1.*(big-marge[2]-marge[3])/rapportyx+marge[0]+marge[1] 
     229            ys=big 
     230            if xs gt small then begin 
     231               xs=small 
     232               ys=1.*(small-marge[0]-marge[1])*rapportyx+marge[2]+marge[3] 
    224233            endif 
    225234         endelse 
    226235      endelse 
    227       xoff=1.*(petit-xs)/2.+petitdessin[0] 
    228       yoff=1.*(grand-ys)/2.+petitdessin[1] 
    229       a=1.*xoff/petitfeuille 
    230       b=1.*yoff/grandfeuille 
    231       c=a+1.*xs/petitfeuille 
    232       d=b+1.*ys/grandfeuille 
     236      xoff=1.*(small-xs)/2.+smalldraw[0] 
     237      yoff=1.*(big-ys)/2.+smalldraw[1] 
     238      a=1.*xoff/mipgsz 
     239      b=1.*yoff/mapgsz 
     240      c=a+1.*xs/mipgsz 
     241      d=b+1.*ys/mapgsz 
    233242      xset = xoff 
    234243      yset = yoff 
    235244   endelse 
    236245;------------------------------------------------------------ 
    237    bas=grandfeuille*(1-key_portrait)+petitfeuille*key_portrait 
    238    cote=petitfeuille*(1-key_portrait)+grandfeuille*key_portrait 
     246   bas=mapgsz*(1-key_portrait)+mipgsz*key_portrait 
     247   cote=mipgsz*(1-key_portrait)+mapgsz*key_portrait 
    239248   posfenetre=[a,b,c,d]+[ marge[0]/bas, marge[2]/cote $ 
    240249                          ,-marge[1]/bas,-marge[3]/cote ] 
     
    243252;------------------------------------------------------------ 
    244253   if keyword_set(key_performance) THEN print, 'temps calibre', systime(1)-tempsun  
     254 
     255  IF NOT keyword_set(key_forgetold) THEN BEGIN 
     256   @updateold 
     257  ENDIF  
     258   
    245259   return 
    246260end 
  • trunk/ToBeReviewed/POSTSCRIPT/ps.pro

    r14 r16  
    4646;------------------------------------------------------------ 
    4747; on recupere le journal sous la forme d''un vecteur de string: 
    48 vectjournal = getfile(homedir+'idlsave.pro') 
     48vectjournal = getfile(myuniquetmpdir+'idlsave.pro') 
    4949;FOR i = 0,n_elements(vectjournal)-1 DO  print, vectjournal[i] 
    5050;------------------------------------------------------------ 
    5151; on coupe la derniere ligne qui est @ps 
    5252;------------------------------------------------------------ 
    53 vectjournal = vectjournal[0:n_elements(vectjournal)-2 ] 
     53IF strpos(vectjournal[n_elements(vectjournal)-1],'@ps') ne -1 then $ 
     54  vectjournal = vectjournal[0:n_elements(vectjournal)-2 ] 
    5455;------------------------------------------------------------ 
    5556; on le corrige si besoin est... 
     
    9293 
    9394; on le complete pour le transformer en une procedure equivalente a plein2dessin 
    94    vectjournal = ['reinitplt, /z,/invert' $ 
    95                   ,'openps, infowidget= infowidget' $ 
     95;   vectjournal = ['reinitplt, /z,/invert' $ 
     96   vectjournal = ['openps, infowidget= infowidget' $ 
    9697                  , vectjournal $ 
    9798                  ,'closeps, infowidget= infowidget' $ 
    98                   ,'imprime' ] 
     99                  ,'printps' ] 
    99100;FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
    100101; on reecrit idlsave.pro 
    101    putfile, homedir+'idlsave.pro', vectjournal 
     102   putfile, myuniquetmpdir+'idlsave.pro', vectjournal 
    102103; applique idlsave 
    103    cd, homedir 
     104   cd,  current = curdir 
     105   cd, myuniquetmpdir 
    104106@idlsave    
     107   cd, curdir 
    105108; on reouvre le journal et on y met les elements de 
    106109; vectjournal sauf les 2 premieres lignes et les 3 dernieres lignes 
    107 journal 
     110journal, myuniquetmpdir+'idlsave.pro' 
    108111for i = 2, n_elements(vectjournal)-3 DO $ 
    109112printf,  !journal, vectjournal[i] 
Note: See TracChangeset for help on using the changeset viewer.