- Timestamp:
- 05/09/06 11:47:44 (18 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 24 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/ToBeReviewed/WIDGET/AUTOUR_de_XXX/buildcommand.pro
r47 r49 32 32 ;------------------------------------------------------------ 33 33 ;------------------------------------------------------------ 34 FUNCTION buildcommand, base, FORPLTH = forplth, FORPLTZ = forpltz, FORPLTT = forpltt, BOITE = boite 34 FUNCTION buildcommand, base, FORPLTH = forplth, FORPLTZ = forpltz, FORPLTT = forpltt, BOXZOOM = boxzoom 35 ; 35 36 ;------------------------------------------------------------ 36 37 ; on recuper les ID des differents widgets … … 46 47 ;------------------------------------------------------------ 47 48 widget_control,base, get_uvalue = top_uvalue 48 petitin = extractatt(top_uvalue, 'petitin')49 numdessinin = petitin[2]-150 petitout = extractatt(top_uvalue, 'petitout')51 numdessinout = petitout[2]-149 smallin = extractatt(top_uvalue, 'smallin') 50 numdessinin = smallin[2]-1 51 smallout = extractatt(top_uvalue, 'smallout') 52 numdessinout = smallout[2]-1 52 53 ;------------------------------------------------------------ 53 54 ;--------------- … … 139 140 cutcommand, widcommand, toread, coef, numberofread, operation, nameexp, separator, add 140 141 ; 141 readcommande = buildreadcommand(base, ''''+nameexp+'''', procedure, type, BO ITE = boite, complete = whichread EQ 'classic' AND alreadyread EQ -1)142 readcommande = buildreadcommand(base, ''''+nameexp+'''', procedure, type, BOXZOOM = boxzoom, complete = whichread EQ 'classic' AND alreadyread EQ -1) 142 143 ; on choppe la ligne ou il y a litchamp pour appliquer coef et operateur 143 144 i = 0 … … 196 197 ENDIF ELSE BEGIN 197 198 ; on fait un trace automatique en appelant un et vn ... 198 readuncommande = buildreadcommand(base, ''''+nameexp+'''', procedure, type, BO ITE = boite, complete = 0, namefield = 'un')199 readuncommande = buildreadcommand(base, ''''+nameexp+'''', procedure, type, BOXZOOM = boxzoom, complete = 0, namefield = 'un') 199 200 i = 0 200 201 while strpos(readuncommande[i], 'litchamp') EQ -1 do i = i+1 … … 203 204 readuncommande = [readuncommande,'fieldu = create_struct({tab:fieldu, grille:vargrid, unite:varunit, experience:varexp, nom:varname})'] 204 205 ; 205 readvncommande = buildreadcommand(base, ''''+nameexp+'''', procedure, type, BO ITE = boite, complete = 0, namefield = 'vn')206 readvncommande = buildreadcommand(base, ''''+nameexp+'''', procedure, type, BOXZOOM = boxzoom, complete = 0, namefield = 'vn') 206 207 i = 0 207 208 while strpos(readvncommande[i], 'litchamp') EQ -1 do i = i+1 … … 354 355 ;----------------------- 355 356 ;--------------- 356 ; determination du nom de la bo ite357 ;--------------- 358 if NOT keyword_set(bo ite) then widget_control, domainid, get_value = boite357 ; determination du nom de la boxzoom 358 ;--------------- 359 if NOT keyword_set(boxzoom) then widget_control, domainid, get_value = boxzoom 359 360 ; ecriture de celle-ci sous forme d''un string 360 box = '['+strtrim(bo ite[0], 1)361 for i = 1, (n_elements(bo ite)-1) < (3+2*(strpos(type, 'z') EQ -1)) do $362 box = box+', '+strtrim(bo ite[i], 1)361 box = '['+strtrim(boxzoom[0], 1) 362 for i = 1, (n_elements(boxzoom)-1) < (3+2*(strpos(type, 'z') EQ -1)) do $ 363 box = box+', '+strtrim(boxzoom[i], 1) 363 364 ; pour les [plots en z, box doit avoir par defaut 0,profmax 364 365 if strpos(type, 'z') NE -1 then BEGIN … … 369 370 niv2 = niv2.droplist_select 370 371 if niv1 NE niv2 then begin 371 box = box+','+strtrim(bo ite[4], 1)+','+strtrim(boite[5], 1)372 box = box+','+strtrim(boxzoom[4], 1)+','+strtrim(boxzoom[5], 1) 372 373 ENDIF ELSE BEGIN 373 374 if chkstru(exextra, 'profmax') then pmax = exextra.profmax $ … … 383 384 ;--------------- 384 385 ;--------------- 385 ; determination de petit386 ;--------------- 387 s petit = tostr(petitout)386 ; determination de small 387 ;--------------- 388 ssmall = tostr(smallout) 388 389 ;------------------------------------------------------------ 389 390 ; on va definir le string qui contiendra la commande a executer par widgetdessine.pro 390 391 ;------------------------------------------------------------ 391 Commande = [readCommande, procedure+', field $', ', bo ite=' $392 +box+', typein='+typein+', petit='+spetit+' $']392 Commande = [readCommande, procedure+', field $', ', boxzoom=' $ 393 +box+', typein='+typein+', small='+ssmall+' $'] 393 394 IF drawvecteur then Commande = [Commande, ', vecteur = {u: fieldu,v: fieldv} $'] 394 395 IF drawover then Commande = [Commande, ', contour = fieldover $'] … … 403 404 (*top_uvalue[1, findline(top_uvalue, 'nameprocedures')])[numdessinout] = procedure 404 405 (*top_uvalue[1, findline(top_uvalue, 'types')])[numdessinout] = type 405 (*top_uvalue[1, findline(top_uvalue, 'domaines')])[*, numdessinout] = bo ite406 (*top_uvalue[1, findline(top_uvalue, 'domaines')])[*, numdessinout] = boxzoom 406 407 (*top_uvalue[1, findline(top_uvalue, 'prefixes')])[numdessinout] = widcommand 407 408 (*top_uvalue[1, findline(top_uvalue, 'optionsflag')])[*, numdessinout] = flags -
trunk/ToBeReviewed/WIDGET/AUTOUR_de_XXX/buildreadcommand.pro
r47 r49 31 31 ;------------------------------------------------------------ 32 32 ;------------------------------------------------------------ 33 FUNCTION buildreadcommand, base, snameexp, procedure, type, BO ITE = boite, COMPLETE = complete, NAMEFIELD = namefield33 FUNCTION buildreadcommand, base, snameexp, procedure, type, BOXZOOM = boxzoom, COMPLETE = complete, NAMEFIELD = namefield 34 34 ;------------------------------------------------------------ 35 35 ; on recuper les ID des differents widgets … … 44 44 ;------------------------------------------------------------ 45 45 widget_control,base, get_uvalue = top_uvalue 46 numdessinin = (extractatt(top_uvalue, ' petitin'))[2]-147 numdessinout = (extractatt(top_uvalue, ' petitout'))[2]-146 numdessinin = (extractatt(top_uvalue, 'smallin'))[2]-1 47 numdessinout = (extractatt(top_uvalue, 'smallout'))[2]-1 48 48 ;--------------- 49 49 ; determination du nom du fichier … … 103 103 sdate1 = strtrim(date1, 1) & sdate2 = strtrim(date2, 1) 104 104 ;--------------- 105 ; determination du nom de la bo ite105 ; determination du nom de la boxzoom 106 106 ;--------------- 107 if NOT keyword_set(bo ite) then widget_control, domainid, get_value = boite107 if NOT keyword_set(boxzoom) then widget_control, domainid, get_value = boxzoom 108 108 ; ecriture de celle-ci sous forme d''un string 109 box = '['+strtrim(bo ite[0], 1)110 for i = 1, (n_elements(bo ite)-1) < (3+2*(strpos(type, 'z') EQ -1)) do $111 box = box+', '+strtrim(bo ite[i], 1)109 box = '['+strtrim(boxzoom[0], 1) 110 for i = 1, (n_elements(boxzoom)-1) < (3+2*(strpos(type, 'z') EQ -1)) do $ 111 box = box+', '+strtrim(boxzoom[i], 1) 112 112 if strpos(type, 'z') NE -1 then BEGIN 113 113 @common … … 140 140 , 'if keyword_set(date2in) then date2 = date2in else date2 = '+sdate2 $ 141 141 , 'litchamp('+funclec_name+'('+snomvariable+', date1, date2,'+snameexp $ 142 +',parent='+strtrim(base, 1)+',bo ite='+box+' $',', filename='+sfilename+' $' $142 +',parent='+strtrim(base, 1)+',boxzoom='+box+' $',', filename='+sfilename+' $' $ 143 143 , ', _extra=mixstru(ex, extra)))'] 144 144 (*top_uvalue[1, findline(top_uvalue, 'champs')])[*, numdessinout] = [filename, nomvariable] … … 149 149 , 'if keyword_set(date2in) then date2 = date2in else date2 = '+sdate2 $ 150 150 , 'litchamp('+funclec_name+'('+snomvariable+', date1, date2,'+snameexp $ 151 +',parent='+strtrim(base, 1)+',bo ite='+box+' $',', filename='+sfilename+' $' $151 +',parent='+strtrim(base, 1)+',boxzoom='+box+' $',', filename='+sfilename+' $' $ 152 152 , ', _extra=mixstru(ex, extra)))'] 153 153 ENDELSE -
trunk/ToBeReviewed/WIDGET/AUTOUR_de_XXX/changefield.pro
r47 r49 1 PRO changefield, base, newfieldname, BO ITE = boite1 PRO changefield, base, newfieldname, BOXZOOM = boxzoom 2 2 ; 3 3 widget_control, base, get_uvalue = top_uvalue … … 18 18 if zgrid NE oldzgrid then BEGIN 19 19 *top_uvalue[1, findline(top_uvalue, 'zgrid')] = zgrid 20 if NOT keyword_set(bo ite) THEN BEGIN21 widget_control, widget_info(base, find_by_uname = 'domain'), get_value = bo ite22 widget_control, widget_info(base, find_by_uname = 'domain'), set_value = bo ite20 if NOT keyword_set(boxzoom) THEN BEGIN 21 widget_control, widget_info(base, find_by_uname = 'domain'), get_value = boxzoom 22 widget_control, widget_info(base, find_by_uname = 'domain'), set_value = boxzoom 23 23 endif 24 24 endif -
trunk/ToBeReviewed/WIDGET/AUTOUR_de_XXX/changefile.pro
r47 r49 1 PRO changefile, base, newfilename, BO ITE = boite, DATE1 = date1, DATE2 = date2, FIELDNAME = fieldname2 1 PRO changefile, base, newfilename, BOXZOOM = boxzoom, DATE1 = date1, DATE2 = date2, FIELDNAME = fieldname 2 ; 3 3 widget_control, base, /hourglass 4 4 widget_control, base, get_uvalue = top_uvalue … … 14 14 oldfilename = filelist[oldfile] 15 15 ; a-t-on reelement change de fichier? 16 if oldfile EQ newfile AND NOT (keyword_set(BO ITE) OR keyword_set(DATE1) OR keyword_set(DATE2) OR keyword_set(FIELDNAME)) then return16 if oldfile EQ newfile AND NOT (keyword_set(BOXZOOM) OR keyword_set(DATE1) OR keyword_set(DATE2) OR keyword_set(FIELDNAME)) then return 17 17 ;-------------- 18 18 widget_control, base, update = 0 … … 40 40 ; on a modifiee le nom de la variable? 41 41 if newfieldname NE oldfieldname then BEGIN 42 changefield, base, newfieldname, BO ITE = boite42 changefield, base, newfieldname, BOXZOOM = boxzoom 43 43 widget_control, champid, set_droplist_select = indexvar 44 44 ENDIF … … 54 54 date1id = widget_info(base, find_by_uname = 'calendar1') 55 55 if NOT keyword_set(date1) then widget_control, date1id, get_value = date1 56 if (where(newcalendar EQ juldate(date1 ,/vraidate)))[0] EQ -1 then date1 = newcalendar[0]56 if (where(newcalendar EQ juldate(date1)))[0] EQ -1 then date1 = newcalendar[0] 57 57 date2id = widget_info(base, find_by_uname = 'calendar2') 58 58 if NOT keyword_set(date2) then widget_control, date2id, get_value = date2 59 if (where(newcalendar EQ juldate(date2 ,/vraidate)))[0] EQ -1 then date2 = date159 if (where(newcalendar EQ juldate(date2)))[0] EQ -1 then date2 = date1 60 60 if date2 LT date1 THEN date2 = date1 61 61 widget_control, date1id, /destroy 62 62 widget_control, date2id, /destroy 63 63 base12 = widget_info(base, find_by_uname = 'base12') 64 rien = cw_calendar(base12,newcalendar, juldate(date1 ,/vraidate), uname = 'calendar1' $64 rien = cw_calendar(base12,newcalendar, juldate(date1), uname = 'calendar1' $ 65 65 , uvalue = {name:'calendar1'}, /frame) 66 rien = cw_calendar(base12,newcalendar, juldate(date2 ,/vraidate), uname = 'calendar2' $66 rien = cw_calendar(base12,newcalendar, juldate(date2), uname = 'calendar2' $ 67 67 , uvalue = {name:'calendar2'}, /frame) 68 68 ENDIF ELSE BEGIN … … 81 81 newgrid = *(extractatt(top_uvalue, 'meshparameters'))[newfile] 82 82 change = changegrid(newgrid) 83 if change OR keyword_set(bo ite) then BEGIN84 if NOT keyword_set(bo ite) then boite= -183 if change OR keyword_set(boxzoom) then BEGIN 84 if NOT keyword_set(boxzoom) then boxzoom = -1 85 85 domainid = widget_info(base, find_by_uname = 'domain') 86 widget_control, domainid, set_value = bo ite86 widget_control, domainid, set_value = boxzoom 87 87 endif 88 88 ;-------------- -
trunk/ToBeReviewed/WIDGET/AUTOUR_de_XXX/createhistory.pro
r47 r49 1 PRO createhistory, base, petit1 PRO createhistory, base, small 2 2 ; 3 3 ;------------------------------------------------------------- … … 20 20 , ';' $ 21 21 , '; end of 1'] 22 if petit[0]*petit[1] GT 1 then begin23 for draw = 1, petit[0]*petit[1]-1 do begin22 if small[0]*small[1] GT 1 then begin 23 for draw = 1, small[0]*small[1]-1 do begin 24 24 texte = [texte $ 25 25 , '; beginning of '+strtrim(draw+1, 2) $ … … 31 31 , 'if keyword_set(postscript) then begin' $ 32 32 , ' closeps, infowidget = infowidget' $ 33 , ' imprime' $33 , ' printps' $ 34 34 , 'endif'] 35 35 ; the new globalcommand -
trunk/ToBeReviewed/WIDGET/AUTOUR_de_XXX/doubleclickaction.pro
r47 r49 7 7 wset, win 8 8 ; quel est le dessin selectionne?? 9 petitin = extractatt(top_uvalue, 'petitin')10 petitout = extractatt(top_uvalue, 'petitout')9 smallin = extractatt(top_uvalue, 'smallin') 10 smallout = extractatt(top_uvalue, 'smallout') 11 11 x = (convert_coord(uval.x[0],uval.y[0], /device, /to_normal))[0] 12 12 y = (convert_coord(uval.x[0],uval.y[0], /device, /to_normal))[1] 13 numcolonne = n_elements(where(findgen( petitin[0])/petitin[0] lt x))-114 numligne = n_elements(where(findgen( petitin[1])/petitin[1] lt 1-y))-115 numdessin = numcolonne+numligne* petitin[0]+113 numcolonne = n_elements(where(findgen(smallin[0])/smallin[0] lt x))-1 14 numligne = n_elements(where(findgen(smallin[1])/smallin[1] lt 1-y))-1 15 numdessin = numcolonne+numligne*smallin[0]+1 16 16 ; choix du type d''action 17 17 case uval.press of 18 18 1:BEGIN 19 ; if top_uvalue. petitin[2] NE numdessin then begin20 tracecadre, petitin, /erase21 if total( petitin EQ petitout) EQ 3 then $22 tracecadre, petitout, /out23 petitin = [petitin[0:1], numdessin]24 *top_uvalue[1, findline(top_uvalue, ' petitin')] = petitin25 tracecadre, petitin19 ; if top_uvalue.smallin[2] NE numdessin then begin 20 tracecadre, smallin, /erase 21 if total(smallin EQ smallout) EQ 3 then $ 22 tracecadre, smallout, /out 23 smallin = [smallin[0:1], numdessin] 24 *top_uvalue[1, findline(top_uvalue, 'smallin')] = smallin 25 tracecadre, smallin 26 26 !p = (extractatt(top_uvalue, 'penvs'))[numdessin-1] 27 27 !x = (extractatt(top_uvalue, 'xenvs'))[numdessin-1] … … 30 30 END 31 31 2:BEGIN 32 ; if top_uvalue. petitout[2] NE numdessin then begin33 tracecadre, petitout, /erase34 if total( petitin EQ petitout) EQ 3 then $35 tracecadre, petitin36 petitout = [petitin[0:1], numdessin]37 *top_uvalue[1, findline(top_uvalue, ' petitout')] = petitout38 tracecadre, petitout, /out32 ; if top_uvalue.smallout[2] NE numdessin then begin 33 tracecadre, smallout, /erase 34 if total(smallin EQ smallout) EQ 3 then $ 35 tracecadre, smallin 36 smallout = [smallin[0:1], numdessin] 37 *top_uvalue[1, findline(top_uvalue, 'smallout')] = smallout 38 tracecadre, smallout, /out 39 39 ; endif 40 40 END 41 41 4:BEGIN 42 tracecadre, [ petitin[0:1], numdessin], /fill42 tracecadre, [smallin[0:1], numdessin], /fill 43 43 inserthistory, event.top, ';', '; beginning of '+strtrim(numdessin, 2) $ 44 44 , '; end of '+strtrim(numdessin, 2) … … 53 53 (*top_uvalue[1, findline(top_uvalue, 'prefixes')])[numdessin] = '' 54 54 55 if numdessin EQ petitin[2] then $ 56 tracecadre, petitin 57 if numdessin EQ petitout[2] then $ 58 tracecadre, petitout, /out 59 END 55 if numdessin EQ smallin[2] then $ 56 tracecadre, smallin 57 if numdessin EQ smallout[2] then $ 58 tracecadre, smallout, /out 59 END 60 ELSE: 60 61 endcase 61 62 updatewidget, event.top -
trunk/ToBeReviewed/WIDGET/AUTOUR_de_XXX/letsdraw.pro
r47 r49 75 75 ; ENDIF 76 76 ; 77 petitout = long(extractatt(top_uvalue, 'petitout'))78 numdessinout = petitout[2]-177 smallout = long(extractatt(top_uvalue, 'smallout')) 78 numdessinout = smallout[2]-1 79 79 ; 80 tracecadre, petitout, /fill80 tracecadre, smallout, /fill 81 81 ; 82 82 ; … … 90 90 , 'portrait = '+portrait $ 91 91 , Commande] $ 92 , filename = isafile(file = 'xxx_oneplot', io = homedir,/new)92 , filename = myuniquetmpdir + 'xxx_oneplot.pro' 93 93 ; 94 inserthistory, base, Commande,'; beginning of '+strtrim( petitout[2], 1) $95 , '; end of '+strtrim( petitout[2], 1)94 inserthistory, base, Commande,'; beginning of '+strtrim(smallout[2], 1) $ 95 , '; end of '+strtrim(smallout[2], 1) 96 96 ; 97 97 (*top_uvalue[1, findline(top_uvalue, 'penvs')])[numdessinout] = !p -
trunk/ToBeReviewed/WIDGET/AUTOUR_de_XXX/longclickaction.pro
r47 r49 3 3 widget_control,event.top, get_uvalue = top_uvalue 4 4 ; quel est le dessin selectionne?? 5 petitout = extractatt(top_uvalue, 'petitout')6 petitin = extractatt(top_uvalue, 'petitin')7 petit = petitin5 smallout = extractatt(top_uvalue, 'smallout') 6 smallin = extractatt(top_uvalue, 'smallin') 7 small = smallin 8 8 x = (convert_coord(uval.x[0],uval.y[0], /device, /to_normal))[0] 9 9 y = (convert_coord(uval.x[0],uval.y[0], /device, /to_normal))[1] 10 numcolonne = n_elements(where(findgen( petit[0])/petit[0] lt x))-111 numligne = n_elements(where(findgen( petit[1])/petit[1] lt 1-y))-112 numdessin = numcolonne+numligne* petit[0]10 numcolonne = n_elements(where(findgen(small[0])/small[0] lt x))-1 11 numligne = n_elements(where(findgen(small[1])/small[1] lt 1-y))-1 12 numdessin = numcolonne+numligne*small[0] 13 13 ; on met ce cadrant en leader 14 tracecadre, petitin, /erase15 if total( petitin EQ petitout) EQ 3 then $16 tracecadre, petitout, /out17 petitin = [petitin[0:1], numdessin+1]18 *top_uvalue[1, findline(top_uvalue, ' petitin')] = petitin19 tracecadre, petitin14 tracecadre, smallin, /erase 15 if total(smallin EQ smallout) EQ 3 then $ 16 tracecadre, smallout, /out 17 smallin = [smallin[0:1], numdessin+1] 18 *top_uvalue[1, findline(top_uvalue, 'smallin')] = smallin 19 tracecadre, smallin 20 20 !p = (extractatt(top_uvalue, 'penvs'))[numdessin] 21 21 !x = (extractatt(top_uvalue, 'xenvs'))[numdessin] … … 29 29 y = [coor[1, 0],coor[1, 1]] 30 30 domainid = widget_info(event.top,find_by_uname = 'domain') 31 bo ite= [x, y]32 ; faut-il passer la bo iteen indexes ???33 currentplot = (extractatt(top_uvalue, ' petitin'))[2]-131 boxzoom = [x, y] 32 ; faut-il passer la boxzoom en indexes ??? 33 currentplot = (extractatt(top_uvalue, 'smallin'))[2]-1 34 34 options = extractatt(top_uvalue, 'options') 35 35 flags = extractatt(top_uvalue, 'optionsflag') … … 43 43 indexvar = widget_info(widget_info(event.top, find_by_uname = 'champ'), /droplist_select) 44 44 vargrid = strupcase(listgrid[indexvar]) 45 domdef, bo ite, grille = vargrid46 grille, mask,glam,gphi,gdep,nx,ny,nz,premierx,premiery,premierz,dernierx,derniery,dernierz47 if changex then bo ite[0:1] = [premierx, dernierx]48 if changey then bo ite[2:3] = [premiery, derniery]45 domdef, boxzoom, gridtype = vargrid 46 grille, -1, -1, -1, -1,nx,ny,nz,firstx,firsty,firstz,lastx,lasty,lastz 47 if changex then boxzoom[0:1] = [firstx, lastx] 48 if changey then boxzoom[2:3] = [firsty, lasty] 49 49 endif 50 50 ; 51 widget_control, domainid, set_value = bo ite51 widget_control, domainid, set_value = boxzoom 52 52 ; 53 53 ;------------------------------------------------------------ … … 58 58 1:BEGIN 59 59 nodates = (type EQ 'xt' OR type EQ 'yt' OR type EQ 'zt' OR type EQ 't') 60 updatewidget, event.top, /nobo ite, nodates = nodates, notype = type NE 'plt'60 updatewidget, event.top, /noboxzoom, nodates = nodates, notype = type NE 'plt' 61 61 forplth = type EQ 'plt' 62 62 letsdraw, event.top, forplth = forplth 63 63 END 64 64 2:BEGIN 65 updatewidget, event.top, /nobo ite65 updatewidget, event.top, /noboxzoom 66 66 forpltz = type EQ 'plt' 67 67 letsdraw, event.top, forpltz = forpltz 68 68 END 69 69 4:BEGIN 70 updatewidget, event.top, /nobo ite, /nodates70 updatewidget, event.top, /noboxzoom, /nodates 71 71 forpltt = type EQ 'plt' 72 72 letsdraw, event.top, forpltt = forpltt -
trunk/ToBeReviewed/WIDGET/AUTOUR_de_XXX/read_vermair.pro
r47 r49 1 FUNCTION read_vermair, name,debut,fin, nomexp, PARENT = parent, BO ITE=boite, _EXTRA = ex1 FUNCTION read_vermair, name,debut,fin, nomexp, PARENT = parent, BOXZOOM=boxzoom, _EXTRA = ex 2 2 @common 3 3 ;------------------------------------------------------------ … … 5 5 if name EQ 'vn' then name = 'vomecrty' 6 6 if debut EQ fin then begin 7 res = lec(name,debut,nomexp, BO ITE=boite, _EXTRA = ex)8 ENDIF ELSE res = lec (name,debut,fin, nomexp, BOITE=boite, _EXTRA = ex)7 res = lec(name,debut,nomexp, BOXZOOM=boxzoom, _EXTRA = ex) 8 ENDIF ELSE res = lect(name,debut,fin, nomexp, BOXZOOM=boxzoom, _EXTRA = ex) 9 9 ;------------------------------------------------------------ 10 10 return, {tab:res, grille:vargrid, unite:'', experience:varexp, nom:varname} -
trunk/ToBeReviewed/WIDGET/AUTOUR_de_XXX/scanfile.pro
r47 r49 28 28 ; 29 29 ;------------------------------------------------------------ 30 FUNCTION scanfile, nomficher, IODIRECTORY = iodirectory30 FUNCTION scanfile, nomficher, _extra = ex 31 31 @common 32 32 ;------------------------------------------------------------ … … 34 34 ; declarees ds un common) 35 35 ;------------------------------------------------------------ 36 36 res = -1 37 37 ;------------------------------------------------------------ 38 38 ; choix du nom du fichier 39 39 ;------------------------------------------------------------ 40 if NOT keyword_set(iodirectory) then iodirectory = iodir 41 nom = isafile(filename = nomficher, IODIRECTORY = iodirectory) 40 nom = isafile(filename = nomficher, IODIRECTORY = iodir, _extra = ex) 42 41 ;------------------------------------------------------------ 43 42 ; ouverture du fichier nom 44 43 ;------------------------------------------------------------ 45 cdfid=ncdf_open(nom)44 cdfid = ncdf_open(nom) 46 45 ;------------------------------------------------------------ 47 46 ; que contient le fichier?? 48 47 ;------------------------------------------------------------ 49 contient=ncdf_inquire(cdfid) 50 vargrid = strupcase(strmid(nom, strlen(nom)-9)) 51 if vargrid EQ 'GRID.T.NC' OR vargrid EQ 'GRID.U.NC' $ 52 OR vargrid EQ 'GRID.V.NC' OR vargrid EQ 'GRID.F.NC' $ 53 OR vargrid eq 'GRID.W.NC' $ 54 OR vargrid EQ 'GRID_T.NC' OR vargrid EQ 'GRID_U.NC' $ 55 OR vargrid EQ 'GRID_V.NC' OR vargrid EQ 'GRID_F.NC' $ 56 OR vargrid eq 'GRID_W.NC' then $ 57 vargrid = strupcase(strmid(nom, strlen(nom)-4, 1)) ELSE vargrid='T' 48 contient = ncdf_inquire(cdfid); 49 ; find vargrid ... 50 vargrid = 'T' ; default definition 51 pattern = ['GRID.', 'GRID_', 'GRID', 'UPID_', '30ID_'] 52 gdtype = ['T', 'U', 'V', 'W', 'F'] 53 fnametest = strupcase(nom) 54 FOR i = 0, n_elements(pattern)-1 DO BEGIN 55 FOR j = 0, n_elements(gdtype)-1 DO BEGIN 56 substr = pattern[i]+gdtype[j] 57 pos = strpos(fnametest, substr) 58 IF pos NE -1 THEN $ 59 vargrid = strmid(fnametest, pos+strlen(substr)-1, 1) 60 ENDFOR 61 ENDFOR 58 62 ;------------------------------------------------------------ 59 63 ; nom des differentes variables … … 62 66 ; contient au moins les dimensions qui doivent etre appelles x et y 63 67 ; et la dimension infinie 64 nomdim =strarr(contient.ndims)65 for dimiq=0,contient.ndims-1 do begin66 ncdf_diminq,cdfid,dimiq,name,value ; nom et valeur de la dimension67 nomdim[dimiq]=strlowcase(name)68 69 indexdimx = where(nomdim EQ 'x' OR nomdim EQ 'lon' OR nomdim EQ 'longitude')70 71 72 print, 'one of the dimensions must have the name: ''x'' or ''lon'' or ''longitude'''73 74 75 indexdimy = where(nomdim EQ 'y' OR nomdim EQ 'lat' OR nomdim EQ 'latitude')76 77 78 print, 'one of the dimensions must have the name: ''y'' or ''lat'' or ''latitude'''79 80 68 nomdim = strarr(contient.ndims) 69 for dimiq = 0, contient.ndims-1 do begin 70 ncdf_diminq, cdfid, dimiq, name, value ; nom et valeur de la dimension 71 nomdim[dimiq] = strlowcase(name) 72 ENDFOR 73 indexdimx = where(nomdim EQ 'x' OR nomdim EQ 'lon' OR nomdim EQ 'longitude' OR nomdim EQ 'xt_i7_156' OR nomdim EQ 'xi_rho' OR nomdim EQ 'xi_u' OR nomdim EQ 'xi_v' OR nomdim EQ 'xi_psi') 74 indexdimx = indexdimx[0] 75 if indexdimx EQ -1 then begin 76 print, 'one of the dimensions must have the name: ''x'' or ''lon'' or ''longitude'' or ''xt_i7_156''' 77 stop 78 endif 79 indexdimy = where(nomdim EQ 'y' OR nomdim EQ 'lat' OR nomdim EQ 'latitude' OR nomdim EQ 'yt_j6_75' OR nomdim EQ 'eta_rho' OR nomdim EQ 'eta_u' OR nomdim EQ 'eta_v' OR nomdim EQ 'eta_psi') 80 indexdimy = indexdimy[0] 81 if indexdimy EQ -1 then begin 82 print, 'one of the dimensions must have the name: ''y'' or ''lat'' or ''latitude'' or ''yt_j6_75''' 83 stop 84 endif 81 85 ; 82 83 for varid=0,contient.nvars-1 do begin84 varcontient=ncdf_varinq(cdfid,varid) ; que contient la variable85 86 87 (where(varcontient.dim EQ contient.recdim))[0] NE -1 THEN namevar[varid]=varcontient.name88 89 90 86 namevar = strarr(contient.nvars) 87 for varid = 0, contient.nvars-1 do begin 88 varcontient = ncdf_varinq(cdfid, varid) ; que contient la variable 89 if (where(varcontient.dim EQ indexdimx))[0] NE -1 AND $ 90 (where(varcontient.dim EQ indexdimy))[0] NE -1 AND $ 91 (where(varcontient.dim EQ contient.recdim))[0] NE -1 THEN namevar[varid] = varcontient.name 92 ENDFOR 93 namevar = namevar[where(namevar NE '')] 94 listgrid = replicate(vargrid, n_elements(namevar)) 91 95 ;------------------------------------------------------------ 92 96 ; on recupere l''axe des temps 93 97 ;------------------------------------------------------------ 94 98 ; on recupere le nom de la variable contenant l''axe des temps 95 96 repeat BEGIN; tant que l''on a pas trouve une variable qui n''a qu''99 varid = 0 100 repeat BEGIN ; tant que l''on a pas trouve une variable qui n''a qu'' 97 101 ; une dimension: la dimension infinie 98 varcontient=ncdf_varinq(cdfid,varid) ; que contient la variable 99 varid = varid+1 100 endrep until n_elements(varcontient.dim) EQ 1 AND varcontient.dim[0] EQ contient.recdim 102 varcontient = ncdf_varinq(cdfid, varid) ; que contient la variable 103 varid = varid+1 104 endrep until n_elements(varcontient.dim) EQ 1 AND varcontient.dim[0] EQ contient.recdim ; 105 varid = varid-1 106 ; 107 ; we want to know which attrributes are attached to the time variable... 108 ; 109 if varcontient.natts EQ 0 then BEGIN 110 ncdf_close, cdfid 111 return, report('the variable '+varcontient.name+' has no attribut.!C we need attribut ''units'' for the calendar ...') 112 endif 113 attnames = strarr(varcontient.natts) 114 for attiq = 0, varcontient.natts-1 do attnames[attiq] = ncdf_attname(cdfid, varid, attiq) 115 if (where(attnames EQ 'units'))[0] EQ -1 then BEGIN 116 ncdf_close, cdfid 117 return, report('Attribut ''units'' not found for the variable '+varid.name+'we need it for the calendar...') 118 endif 101 119 ; on lit l''axe des temps 102 varid = varid-1 103 ncdf_varget, cdfid, varid, time 104 time = long(time) 105 ncdf_attget,cdfid,varid,'units',value 120 ncdf_varget, cdfid, varid, time 121 time = double(time) 122 ncdf_attget, cdfid, varid, 'units', value 106 123 ; time_counter:units = "seconds since 0001-01-01 00:00:00" ; 107 124 ; time_counter:units = "hours since 0001-01-01 00:00:00" ; … … 109 126 ; time_counter:units = "months since 1979-01-01 00:00:00" ; 110 127 ; time_counter:units = "years since 1979-01-01 00:00:00" ; 111 112 113 114 128 value = strtrim(strcompress(string(value)), 2) 129 mots = str_sep(value, ' ') 130 unite = mots[0] 131 debut = str_sep(mots[2], '-') 115 132 ; 133 ; now we try to find the attribut called calendar... 134 ; the the attribute "calendar" exists? 135 ; If no, we suppose that the calendar is gregorian calendar 116 136 ; 117 ; ATTENTION il faut recuperer l''atribut calendar et ajuster time en 137 if (where(attnames EQ 'calendar'))[0] NE -1 then BEGIN 138 ncdf_attget, cdfid, varid, 'calendar', value 139 value = string(value) 140 CASE value OF 141 '360d':key_caltype = '360d' 142 'greg':IF n_elements(key_caltype) EQ 0 THEN key_caltype = 'greg' 143 ELSE:BEGIN 144 ; notused = report('Unknown calendar: '+value+', we use greg calendar.') 145 key_caltype = 'greg' 146 END 147 ENDCASE 148 ENDIF ELSE BEGIN 149 ; notused = report('Unknown calendar, we use '+key_caltype+' calendar.') 150 IF n_elements(key_caltype) EQ 0 THEN key_caltype = 'greg' 151 ENDELSE 152 ; 153 ; ATTENTION il faut recuperer l''attribut calendar et ajuster time en 118 154 ; consequense... 119 155 ; … … 122 158 ; on suppose qu''on utilise le vrai calendrier. 123 159 ; 124 case strlowcase(unite) of 125 'seconds':time = julday(debut[1], debut[2], debut[0])+time/(long(24)*3600) 126 'hours':time = julday(debut[1], debut[2], debut[0])+time/(long(24)) 127 'days':time = julday(debut[1], debut[2], debut[0])+time 128 'months':BEGIN 129 for t = 0, n_elements(time)-1 do begin 130 time[t] = julday(debut[1]+time[t], debut[2], debut[0]) 131 endfor 132 END 133 'years':BEGIN 134 for t = 0, n_elements(time)-1 do begin 135 time[t] = julday(debut[1], debut[2], debut[0]+time[t]) 136 endfor 137 END 138 ENDCASE 160 unite = strlowcase(unite) 161 IF strpos(unite, 's', strlen(unite)-1) NE -1 THEN unite = strmid(unite, 0, strlen(unite)-1) 162 IF strpos(unite, 'julian_') NE -1 THEN unite = strmid(unite, 7) 163 case unite of 164 'second':time = julday(debut[1], debut[2], debut[0])+time/(long(24)*3600) 165 'hour':time = julday(debut[1], debut[2], debut[0])+time/(long(24)) 166 'day':time = julday(debut[1], debut[2], debut[0])+time 167 'month':BEGIN 168 if total(fix(time) NE time) NE 0 then $ ; we switch to days with 30d/m 169 time = julday(debut[1], debut[2], debut[0])+round(time*30) $ 170 ELSE for t = 0, n_elements(time)-1 DO $ 171 time[t] = julday(debut[1]+time[t], debut[2], debut[0]) 172 END 173 'year':BEGIN 174 if total(fix(time) NE time) NE 0 then $ ; we switch to days with 365d/y 175 time = julday(debut[1], debut[2], debut[0])+round(time*365) $ 176 ELSE for t = 0, n_elements(time)-1 do $ 177 time[t] = julday(debut[1], debut[2], debut[0]+time[t]) 178 END 179 ENDCASE 180 time = long(time) 139 181 ;------------------------------------------------------------ 140 return, {filename:nom, time_counter:time, listvar:namevar, listgrid:strupcase(listgrid)}182 return, {filename:nom, time_counter:time, listvar:namevar, listgrid:strupcase(listgrid), calendartype:key_caltype} 141 183 end -
trunk/ToBeReviewed/WIDGET/AUTOUR_de_XXX/tracecadre.pro
r47 r49 1 PRO tracecadre, petit, out = out, erase = erase, fill = fill1 PRO tracecadre, small, out = out, erase = erase, fill = fill 2 2 ;------------------------------------------------------------ 3 ; determination de la colonne et de la ligne correspondant au petiten3 ; determination de la colonne et de la ligne correspondant au small en 4 4 ; entree 5 numdessin = petit[2]-16 numligne = numdessin/ petit[0]7 numcolonne = numdessin-numligne* petit[0]5 numdessin = small[2]-1 6 numligne = numdessin/small[0] 7 numcolonne = numdessin-numligne*small[0] 8 8 ; determination de poscadre 9 largeurcolonne = 1./ petit[0]10 largeurligne = 1./ petit[1]9 largeurcolonne = 1./small[0] 10 largeurligne = 1./small[1] 11 11 cadre = [numcolonne*largeurcolonne,1.-((numligne+1)*largeurligne) $ 12 12 , (numcolonne+1)*largeurcolonne, 1.-(numligne*largeurligne)] -
trunk/ToBeReviewed/WIDGET/AUTOUR_de_XXX/updatewidget.pro
r47 r49 1 PRO updatewidget, base, NOBO ITE = noboite, NODATES = nodates, NOTYPE = notype1 PRO updatewidget, base, NOBOXZOOM = noboxzoom, NODATES = nodates, NOTYPE = notype 2 2 ;---------------------------------------------------------------------- 3 3 widget_control,base, get_uvalue = top_uvalue 4 petitin = extractatt(top_uvalue, 'petitin')5 numdessinin = petitin[2]-14 smallin = extractatt(top_uvalue, 'smallin') 5 numdessinin = smallin[2]-1 6 6 ; 7 7 ;---------------------------------------------------------------------- … … 20 20 ; domaine 21 21 ;-------------- 22 bo ite= (extractatt(top_uvalue, 'domaines'))[*, numdessinin]23 if total(bo ite) EQ 0 then boite= -124 if keyword_set(nobo ite) then boite= 022 boxzoom = (extractatt(top_uvalue, 'domaines'))[*, numdessinin] 23 if total(boxzoom) EQ 0 then boxzoom = -1 24 if keyword_set(noboxzoom) then boxzoom = 0 25 25 ;-------------- 26 26 ; champ: filename & nomvar … … 30 30 ; 31 31 if filename NE '' OR nomvar NE '' THEN BEGIN 32 changefile, base, filename, fieldname = nomvar, BO ITE = boite, DATE1 = date1, DATE2 = date232 changefile, base, filename, fieldname = nomvar, BOXZOOM = boxzoom, DATE1 = date1, DATE2 = date2 33 33 ENDIF ELSE BEGIN 34 34 if date1 NE 0 then begin … … 40 40 widget_control, date2id, set_value = date2 41 41 endif 42 if keyword_set(bo ite) then BEGIN42 if keyword_set(boxzoom) then BEGIN 43 43 domainid = widget_info(base, find_by_uname = 'domain') 44 widget_control, domainid, set_value = bo ite44 widget_control, domainid, set_value = boxzoom 45 45 endif 46 46 ENDELSE -
trunk/ToBeReviewed/WIDGET/AUTOUR_de_XXX/widgetdessine.pro.old
r47 r49 48 48 ; help, top_uvalue.exextra, /struct 49 49 if NOT keyword_set(commande) then $ 50 commande = construitcommande(base, FORPLTH = forplt , FORPLTZ = forpltz, FORPLTT = forpltt, _extra = ex)50 commande = construitcommande(base, FORPLTH = forplth, FORPLTZ = forpltz, FORPLTT = forpltt, _extra = ex) 51 51 widget_control,base, get_uvalue = top_uvalue 52 52 ; print, '*****************' -
trunk/ToBeReviewed/WIDGET/AUTOUR_de_XXX/xcreateanim.pro
r47 r49 24 24 widget_control, widget_info(event.top, find_by_uname = 'debut') $ 25 25 , get_value = vdate1 26 index1 = where(calendar eq juldate(vdate1 , /vraidate)) & index1 = index1[0]26 index1 = where(calendar eq juldate(vdate1)) & index1 = index1[0] 27 27 if index1 EQ -1 then return 28 28 ; 29 29 widget_control, widget_info(event.handler, find_by_uname = 'fin') $ 30 30 , get_value = vdate2 31 index2 = where(calendar eq juldate(vdate2 , /vraidate)) & index2 = index2[0]31 index2 = where(calendar eq juldate(vdate2)) & index2 = index2[0] 32 32 if index2 EQ -1 OR index2 LE index1 then return 33 33 ; on detruit le widget avant de creer le fichier .ps … … 44 44 globalcommand = extractatt(top_uvalue, 'globalcommand') 45 45 ; on complete par le premiere et les dernieres lignes du programme 46 globalcommand = ['pro xxx2ps, NOERASE = noerase, POSTSCRIPT = postscript, DATE1IN = date1in, DATE2IN = date2in' $ 47 , globalcommand $ 48 , 'return', 'end'] 49 putfile, isadirectory(io = homedir, title = 'Bad definition of homedir')+'xxx2ps.pro', globalcommand ; on l''ecrit 50 resolve_routine, 'xxx2ps' ; on le compile 46 createpro, globalcommand, filename = myuniquetmpdir + 'xxx2ps.pro' $ 47 , KWDLIST = ', NOERASE = noerase, POSTSCRIPT = postscript, DATE1IN = date1in, DATE2IN = date2in' 51 48 ; 52 49 ;--------creation du fichier---------- -
trunk/ToBeReviewed/WIDGET/AUTOUR_de_XXX/xxxmenubar.pro
r47 r49 91 91 end 92 92 'PS' :BEGIN 93 ; we find homedir 94 homedir = isadirectory(io = homedir, title = 'Bad definition of homedir') 93 IF lmgr(/demo) EQ 1 THEN BEGIN 94 dummy = report('impossible to save as postscript in demo mode') 95 return 96 ENDIF 95 97 widget_control,event.top, get_uvalue = top_uvalue 96 98 ; portrait ou landscape ??? … … 101 103 globalcommand = extractatt(top_uvalue, 'globalcommand') 102 104 ; on complete par le premiere et les dernieres lignes du programme 103 globalcommand = ['pro xxx2ps, NOERASE = noerase, POSTSCRIPT = postscript, PORTRAIT = portrait, LANDSCAPE = landscape, DATE1IN = date1in, DATE2IN = date2in, _extra = ex' $ 104 , globalcommand $ 105 , 'return', 'end'] 106 putfile, homedir+'xxx2ps.pro', globalcommand ; on l''ecrit 107 resolve_routine, 'xxx2ps' ; on le compile 108 xxx2ps, /post, portrait = portrait ; on l''applique 109 END 105 createpro, globalcommand, filename = myuniquetmpdir + 'xxx2ps.pro' $ 106 , KWDLIST = ', NOERASE = noerase, POSTSCRIPT = postscript, PORTRAIT = portrait, LANDSCAPE = landscape, DATE1IN = date1in, DATE2IN = date2in, _extra = ex' $ 107 , KWDUSED = ', /POSTSCRIPT, PORTRAIT = portrait' 108 END 110 109 'Anim' :begin 111 xcreateanim, event.top110 ;;; no more working... xcreateanim, event.top 112 111 end 113 112 'Gif' :BEGIN 113 IF lmgr(/demo) EQ 1 THEN BEGIN 114 dummy = report('impossible to save as an image in demo mode') 115 return 116 ENDIF 114 117 widget_control,event.top, get_uvalue = top_uvalue 115 petitin = extractatt(top_uvalue, 'petitin')116 numdessinin = petitin[2]-1117 petitout = extractatt(top_uvalue, 'petitout')118 numdessinout = petitout[2]-1119 tracecadre, petitin, /erase120 tracecadre, petitout, /erase118 smallin = extractatt(top_uvalue, 'smallin') 119 numdessinin = smallin[2]-1 120 smallout = extractatt(top_uvalue, 'smallout') 121 numdessinout = smallout[2]-1 122 tracecadre, smallin, /erase 123 tracecadre, smallout, /erase 121 124 filename = xquestion('dans quelle fichier gif voulez vous sauver !C l''ecran de xxx?', 'xxx_image.gif') 122 125 if rstrpos(filename, '.gif') NE strlen(filename)-4 then filename = filename+'.gif' … … 125 128 end 126 129 'Script':BEGIN 130 IF lmgr(/demo) EQ 1 THEN BEGIN 131 dummy = report('impossible to save as a idl program file in demo mode') 132 return 133 ENDIF 127 134 ; on recupere le nom du fichier 128 135 filename = xquestion('dans quelle procedure IDL voulez vous sauver !C la realisation de ce graph?', 'xxx_figure.pro') … … 158 165 END 159 166 'Widget':BEGIN 167 IF lmgr(/demo) EQ 1 THEN BEGIN 168 dummy = report('impossible to save the widget in demo mode') 169 return 170 ENDIF 160 171 ; on recupere le nom du fichier 161 172 filename = xquestion('dans quel fichier bianire voulez vous sauver le widget ?', 'xxx_widget.dat') … … 172 183 END 173 184 'Prompt':BEGIN 174 commande = getfile( isadirectory(io = homedir)+'xxx_oneplot.pro')185 commande = getfile(myuniquetmpdir + 'xxx_oneplot.pro') 175 186 for i = 0, n_elements(commande)-1 do print, commande[i] 176 187 end … … 206 217 xmanager,'xxx',basegraph, /no_block 207 218 ; on redessine ce qu''il y avait dedans 208 ; we find homedir209 homedir = isadirectory(io = homedir, title = 'Bad definition of homedir')210 219 ; on recupere la liste des instructions 211 220 globalcommand = extractatt(top_uvalue, 'globalcommand') 212 221 ; on complete par le premiere et les dernieres lignes du programme 213 globalcommand = ['pro xxx2ps, NOERASE = noerase, POSTSCRIPT = postscript, PORTRAIT = portrait, LANDSCAPE = landscape' $ 214 , globalcommand $ 215 , 'return', 'end'] 216 putfile, homedir+'xxx2ps.pro', globalcommand ; on l''ecrit 217 resolve_routine, 'xxx2ps' ; on le compile 218 xxx2ps, /noerase, portrait = key_portrait ; on l''applique 222 createpro, globalcommand, filename = myuniquetmpdir + 'xxx2ps.pro' $ 223 , KWDLIST = ', NOERASE = noerase, POSTSCRIPT = postscript, PORTRAIT = portrait, LANDSCAPE = landscape' $ 224 , KWDUSED = ', /noerase, PORTRAIT = portrait' 219 225 ; on reattribue l''element graphid de la top_uvalue 220 226 *top_uvalue[1, findline(top_uvalue, 'graphid')] = graphid … … 227 233 'Overlay' :begin 228 234 widget_control, event.top, get_uvalue = top_uvalue 229 numdessinin = (extractatt(top_uvalue, ' petitin'))[2]-1235 numdessinin = (extractatt(top_uvalue, 'smallin'))[2]-1 230 236 options = extractatt(top_uvalue, 'options') 231 237 flags = extractatt(top_uvalue, 'optionsflag') … … 238 244 'Vecteur':BEGIN 239 245 widget_control, event.top, get_uvalue = top_uvalue 240 numdessinin = (extractatt(top_uvalue, ' petitin'))[2]-1246 numdessinin = (extractatt(top_uvalue, 'smallin'))[2]-1 241 247 options = extractatt(top_uvalue, 'options') 242 248 flags = extractatt(top_uvalue, 'optionsflag') … … 249 255 'Longitude / x index':BEGIN 250 256 widget_control, event.top, get_uvalue = top_uvalue 251 numdessinin = (extractatt(top_uvalue, ' petitin'))[2]-1257 numdessinin = (extractatt(top_uvalue, 'smallin'))[2]-1 252 258 options = extractatt(top_uvalue, 'options') 253 259 flags = extractatt(top_uvalue, 'optionsflag') … … 257 263 ; on le reeatribue 258 264 (*top_uvalue[1, findline(top_uvalue, 'optionsflag')])[index, numdessinin] = flag 259 ; maintenant on va changer les sliders definissant la bo ite265 ; maintenant on va changer les sliders definissant la boxzoom 260 266 domainid = widget_info(event.top, find_by_uname = 'domain') 261 bo ite= (extractatt(top_uvalue, 'domaines'))[*, numdessinin]267 boxzoom = (extractatt(top_uvalue, 'domaines'))[*, numdessinin] 262 268 ; on veut retrouver le type de grille qui est utilisee 263 269 currentfile = extractatt(top_uvalue, 'currentfile') … … 267 273 if flag EQ 0 then BEGIN ; longitudes 268 274 ; on fait un domdef pour retrouver le lon1 lon2 correspondant a la 269 ; bo itedefinie sur le widget...270 domdef, bo ite, grille = vargrid, /xindex $275 ; boxzoom definie sur le widget... 276 domdef, boxzoom, gridtype = vargrid, /xindex $ 271 277 , yindex = (flags[where(options EQ 'Latitude / y index'), numdessinin])[0] 272 widget_control, domainid, set_value = [lon1, lon2, bo ite[2:3]]278 widget_control, domainid, set_value = [lon1, lon2, boxzoom[2:3]] 273 279 ENDIF ELSE BEGIN ; xindex 274 ; maintenant ion veut retrouver premierx, dernierx correspondant a la275 ; bo itedefinie sur le widget...276 domdef, bo ite, grille = vargrid $280 ; maintenant ion veut retrouver firstx, lastx correspondant a la 281 ; boxzoom definie sur le widget... 282 domdef, boxzoom, gridtype = vargrid $ 277 283 , yindex = (flags[where(options EQ 'Latitude / y index'), numdessinin])[0] 278 grille, mask,glam,gphi,gdep,nx,ny,nz,premierx,premiery,premierz,dernierx,derniery,dernierz279 widget_control, domainid, set_value = [ premierx, dernierx, boite[2:3]]284 grille, -1, -1, -1, -1,nx,ny,nz,firstx,firsty,firstz,lastx,lasty,lastz 285 widget_control, domainid, set_value = [firstx, lastx, boxzoom[2:3]] 280 286 ENDELSE 281 287 ; on met a jour la top_uvalue 282 widget_control, domainid, get_value = bo ite283 (*top_uvalue[1, findline(top_uvalue, 'domaines')])[*, numdessinin] = bo ite288 widget_control, domainid, get_value = boxzoom 289 (*top_uvalue[1, findline(top_uvalue, 'domaines')])[*, numdessinin] = boxzoom 284 290 end 285 291 'Latitude / y index':begin 286 292 widget_control, event.top, get_uvalue = top_uvalue 287 numdessinin = (extractatt(top_uvalue, ' petitin'))[2]-1293 numdessinin = (extractatt(top_uvalue, 'smallin'))[2]-1 288 294 options = extractatt(top_uvalue, 'options') 289 295 flags = extractatt(top_uvalue, 'optionsflag') … … 293 299 ; on le reeatribue 294 300 (*top_uvalue[1, findline(top_uvalue, 'optionsflag')])[index, numdessinin] = flag 295 ; maintenant on va changer les sliders definissant la bo ite301 ; maintenant on va changer les sliders definissant la boxzoom 296 302 domainid = widget_info(event.top, find_by_uname = 'domain') 297 bo ite= (extractatt(top_uvalue, 'domaines'))[*, numdessinin]303 boxzoom = (extractatt(top_uvalue, 'domaines'))[*, numdessinin] 298 304 ; on veut retrouver le type de grille qui est utilisee 299 305 currentfile = extractatt(top_uvalue, 'currentfile') … … 303 309 if flag EQ 0 then BEGIN ; latitudes 304 310 ; on fait un domdef pour retrouver le lat1 lat2 correspondant a la 305 ; bo itedefinie sur le widget...306 domdef, bo ite, grille = vargrid, /yindex $311 ; boxzoom definie sur le widget... 312 domdef, boxzoom, gridtype = vargrid, /yindex $ 307 313 , xindex = (flags[where(options EQ 'Longitude / x index'), numdessinin])[0] 308 widget_control, domainid, set_value = [bo ite[0:1], lat1, lat2]314 widget_control, domainid, set_value = [boxzoom[0:1], lat1, lat2] 309 315 ENDIF ELSE BEGIN ; yindex 310 ; maintenant ion veut retrouver premiery, derniery correspondant a la311 ; bo itedefinie sur le widget...312 domdef, bo ite, grille = vargrid $316 ; maintenant ion veut retrouver firsty, lasty correspondant a la 317 ; boxzoom definie sur le widget... 318 domdef, boxzoom, gridtype = vargrid $ 313 319 , xindex = (flags[where(options EQ 'Longitude / x index'), numdessinin])[0] 314 grille, mask,glam,gphi,gdep,nx,ny,nz,premierx,premiery,premierz,dernierx,derniery,dernierz315 widget_control, domainid, set_value = [bo ite[0:1], premiery, derniery]320 grille, -1, -1, -1, -1,nx,ny,nz,firstx,firsty,firstz,lastx,lasty,lastz 321 widget_control, domainid, set_value = [boxzoom[0:1], firsty, lasty] 316 322 ENDELSE 317 323 ; on met a jour la top_uvalue 318 widget_control, domainid, get_value = bo ite319 (*top_uvalue[1, findline(top_uvalue, 'domaines')])[*, numdessinin] = bo ite324 widget_control, domainid, get_value = boxzoom 325 (*top_uvalue[1, findline(top_uvalue, 'domaines')])[*, numdessinin] = boxzoom 320 326 end 321 327 endcase
Note: See TracChangeset
for help on using the changeset viewer.