Changeset 226 for trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX
- Timestamp:
- 03/16/07 10:22:26 (17 years ago)
- Location:
- trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/buildcmd.pro
r172 r226 5 5 ; 6 6 ; @file_comments 7 ; This function send back a string which contain the reading command 7 ; This function send back a string which contain the reading command 8 8 ; and drawing's parameters. 9 9 ; … … 11 11 ; 12 12 ; @keyword BOXZOOM 13 ; Vector indicating the geographic zone on which we want to cut the map. 14 ; If BOXZOOM has : 13 ; Vector indicating the geographic zone on which we want to cut the map. 14 ; If BOXZOOM has : 15 15 ; 1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 16 16 ; 2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 17 17 ; 4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])] 18 18 ; 5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] 19 ; 6 elements: The extraction is made on Boxzoom 19 ; 6 elements: The extraction is made on Boxzoom 20 20 ; Where lon1, lon2,lat1,lat2 are global variables defined at the last domdef! 21 21 ; … … 54 54 numdessinout = smallout[2]-1 55 55 ; 56 options = extractatt(top_uvalue, 'options') 56 options = extractatt(top_uvalue, 'options') 57 57 optionsflag = extractatt(top_uvalue, 'optionsflag') 58 58 portrait = (strtrim(optionsflag[where(options EQ 'Portrait/Landscape'), 0], 1))[0] … … 83 83 ; Search of options 84 84 ; 85 options = extractatt(top_uvalue, 'options') 85 options = extractatt(top_uvalue, 'options') 86 86 optionsflag = extractatt(top_uvalue, 'optionsflag') 87 87 flags = optionsflag[*, numdessinin] … … 133 133 widcmd = strtrim(widcmd, 2) 134 134 IF widcmd[0] EQ '' THEN widcmd = 'zzz' 135 135 136 136 cutcmd, widcmd[0], toread, numberofread, prefix, nameexp, ending 137 137 ; … … 158 158 ; we complet the reading command 159 159 oldrdcmd = extractatt(top_uvalue, 'currentreadcmd') 160 nl = n_elements(oldrdcmd) 160 nl = n_elements(oldrdcmd) 161 161 oldrdcmd[nl-1] = oldrdcmd[nl-1] + ' $' 162 162 readcmd[i] = prefix + readcmd[i] … … 164 164 ENDELSE 165 165 ; exit if we have to read other fields... 166 if alreadyread+1 NE numberofread-1 THEN BEGIN 166 if alreadyread+1 NE numberofread-1 THEN BEGIN 167 167 *top_uvalue[1, findline(top_uvalue, 'currentreadcmd')] = readcmd 168 168 *top_uvalue[1, findline(top_uvalue, 'alreadyread')] = alreadyread+1 … … 171 171 ENDIF 172 172 ; we finalize the reading command 173 IF ending NE '' THEN BEGIN 174 nl = n_elements(readcmd) 173 IF ending NE '' THEN BEGIN 174 nl = n_elements(readcmd) 175 175 readcmd[nl-1] = readcmd[nl-1] + ' $' 176 176 readcmd = [temporary(readcmd), ending] … … 186 186 tgnm = strlowcase(tag_names(exextra)) 187 187 indtmp = where(tgnm EQ 'box' OR tgnm EQ 'boxzoom', cnt) 188 IF cnt EQ 1 THEN BEGIN 188 IF cnt EQ 1 THEN BEGIN 189 189 boxextra = exextra.(indtmp[0]) 190 190 exextra = extractstru(exextra, ['box', 'boxzoom']) 191 ENDIF 191 ENDIF 192 192 extra = mixstru(exextra, extra) 193 193 sextra = struct2string(extra) … … 214 214 'vector':BEGIN 215 215 ; for the vectors, there is 2 components. we read u when alreadyvector 216 ; is a inte rger and v when alreadyvector is a interger+0.5216 ; is a integer and v when alreadyvector is a integer+0.5 217 217 if floor(alreadyvector)+1 EQ 0 then begin 218 218 if floor(alreadyvector) EQ alreadyvector then begin … … 226 226 ENDIF ELSE BEGIN 227 227 oldrdcmd = extractatt(top_uvalue, 'currentreadcmd') 228 nl = n_elements(oldrdcmd) 228 nl = n_elements(oldrdcmd) 229 229 oldrdcmd[nl-1] = oldrdcmd[nl-1] + ' $' 230 230 readcmd[i] = prefix + readcmd[i] … … 235 235 numberofread-1:BEGIN 236 236 ; we finalize the reading command 237 IF ending NE '' THEN BEGIN 238 nl = n_elements(readcmd) 237 IF ending NE '' THEN BEGIN 238 nl = n_elements(readcmd) 239 239 readcmd[nl-1] = readcmd[nl-1] + ' $' 240 240 readcmd = [temporary(readcmd), ending] … … 252 252 numberofread-0.5:BEGIN 253 253 ; we finalize the reading command 254 IF ending NE '' THEN BEGIN 255 nl = n_elements(readcmd) 254 IF ending NE '' THEN BEGIN 255 nl = n_elements(readcmd) 256 256 readcmd[nl-1] = readcmd[nl-1] + ' $' 257 257 readcmd = [temporary(readcmd), ending] … … 301 301 ENDIF ELSE BEGIN 302 302 oldrdcmd = extractatt(top_uvalue, 'currentreadcmd') 303 nl = n_elements(oldrdcmd) 303 nl = n_elements(oldrdcmd) 304 304 oldrdcmd[nl-1] = oldrdcmd[nl-1] + ' $' 305 305 readcmd[i] = prefix + readcmd[i] … … 307 307 ENDELSE 308 308 ; 309 if alreadyover+1 NE numberofread-1 THEN BEGIN 309 if alreadyover+1 NE numberofread-1 THEN BEGIN 310 310 ; we still need to read some files... 311 311 *top_uvalue[1, findline(top_uvalue, 'currentreadcmd')] = readcmd … … 315 315 ENDIF 316 316 ; we finalize the reading command 317 IF ending NE '' THEN BEGIN 318 nl = n_elements(readcmd) 317 IF ending NE '' THEN BEGIN 318 nl = n_elements(readcmd) 319 319 readcmd[nl-1] = readcmd[nl-1] + ' $' 320 320 readcmd = [temporary(readcmd), ending] … … 362 362 ; For [plots in z, box must have by default 0,profmax 363 363 if strpos(type, 'z') NE -1 then BEGIN 364 ; If more than 1 level is selected: 364 ; If more than 1 level is selected: 365 365 widget_control, widget_info(base, find_by_uname = 'dthlv1'), get_value = niv1 366 366 niv1 = niv1.combobox_index -
trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/identifyclick.pro
r150 r226 85 85 ; t/3/0 End of the double click 86 86 thisEvent EQ 'WIDGET_TIMER' AND uval.click EQ 3 AND press EQ 0:uval.click = 0 87 ; Impos ible case in theory:87 ; Impossible case in theory: 88 88 ELSE:BEGIN 89 89 print, thisEvent, uval.click, press -
trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/scanfile.pro
r221 r226 5 5 ; @categories 6 6 ; 7 ; 7 ; 8 8 ; @param NAMEFILE 9 9 ; 10 ;11 10 ; @keyword GRID {default='T'}{type=scalar string} 12 11 ; Used to specify on which grid type are located the data … … 14 13 ; @keyword _EXTRA 15 14 ; Used to pass your keywords to isafile and ncdf_getaxis 16 ; 15 ; 17 16 ; @returns 18 ; 19 ; 17 ; 20 18 ; @uses 21 ; 22 ; 19 ; 23 20 ; @restrictions 24 ; 25 ; 21 ; 26 22 ; @examples 27 ; 28 ; 23 ; 29 24 ; @history 30 ; 31 ; 32 ; @version 25 ; 26 ; @version 33 27 ; $Id$ 34 28 ; 35 29 ; @todo 36 30 ; seb : I don't know what to do with that... 37 ; 31 ; 38 32 ;- 39 33 ; … … 49 43 ; dont les noms sont 'x','lon...','xi_...' et 'y','lat...' ou 50 44 ; 'eta_...' ou bien en majuscule. 51 ; 4) il doit exi ter ds ce fichier une unique variable n''ayant45 ; 4) il doit exister ds ce fichier une unique variable n''ayant 52 46 ; qu''une dimension et etant la dimension temporelle. cette 53 47 ; variable sera prise comme axe des temps. Rq: si plusieurs … … 55 49 ; variable 56 50 ; 5) Cette variable axe des temps doit contenir l''attribut 57 ; 'units' qui doit etre ecrit suivant la syntaxe:58 ; "seconds since 0001-01-01 00:00:00" 59 ; "hours since 0001-01-01 00:00:00" 60 ; "days since 1979-01-01 00:59:59" 61 ; "months since 1979-01-01 00:59:59" 62 ; "years since 1979-01-01 00:59:59" 51 ; 'units' qui doit etre ecrit suivant la syntaxe: 52 ; "seconds since 0001-01-01 00:00:00" 53 ; "hours since 0001-01-01 00:00:00" 54 ; "days since 1979-01-01 00:59:59" 55 ; "months since 1979-01-01 00:59:59" 56 ; "years since 1979-01-01 00:59:59" 63 57 ; 64 58 ; je crois que c''est tout! … … 93 87 namedim = strarr(inside.ndims) 94 88 for dimiq = 0, inside.ndims-1 do begin 95 ncdf_diminq, cdfid, dimiq, tmpname, value 89 ncdf_diminq, cdfid, dimiq, tmpname, value 96 90 namedim[dimiq] = strlowcase(tmpname) 97 91 ENDFOR … … 110 104 (inter(invar.dim, dimidy))[0] NE -1 AND $ 111 105 ((where(invar.dim EQ inside.recdim))[0] NE -1 OR inside.recdim EQ -1) $ 112 THEN namevar[varid] = invar.name 106 THEN namevar[varid] = invar.name 113 107 ENDFOR 114 108 namevar = namevar[where(namevar NE '')] … … 135 129 tmpnm[0] EQ 'xi_u' AND tmpnm[1] EQ 'eta_rho':listgrid[i] = 'U' 136 130 tmpnm[0] EQ 'xi_u' AND tmpnm[1] EQ 'eta_v' :listgrid[i] = 'F' 137 ELSE: 138 ENDCASE 131 ELSE: 132 ENDCASE 139 133 ENDFOR 140 134 empty = where(listgrid EQ '') 141 IF empty[0] NE -1 THEN BEGIN 135 IF empty[0] NE -1 THEN BEGIN 142 136 ; could we define the grid type from the file name?? 143 137 pattern = ['GRID.', 'GRID_', 'GRID', 'UPID_', '30ID_'] … … 153 147 ENDFOR 154 148 listgrid[empty] = vargrid 155 ENDIF 149 ENDIF 156 150 ENDIF ELSE listgrid[*] = vargrid 157 151 ;------------------------------------------------------------ … … 159 153 ;------------------------------------------------------------ 160 154 date0fk = date2jul(19000101) 161 IF inside.recdim EQ -1 THEN BEGIN 155 IF inside.recdim EQ -1 THEN BEGIN 162 156 jpt = 1 163 157 time = date0fk … … 170 164 repeat BEGIN 171 165 IF varid LT inside.nvars THEN BEGIN 172 invar = ncdf_varinq(cdfid, varid) 173 varid = varid+1 166 invar = ncdf_varinq(cdfid, varid) 167 varid = varid+1 174 168 ENDIF ELSE varid = 0 175 169 endrep until (n_elements(invar.dim) EQ 1 AND invar.dim[0] EQ inside.recdim) OR (varid EQ 0) … … 177 171 ; 178 172 CASE 1 OF 179 varid EQ -1:BEGIN 173 varid EQ -1:BEGIN 180 174 dummy = report('the file '+fullname+' has no time axis.!C we create a fake calendar ...') 181 175 fakecal = 1 182 176 time = date0fk + lindgen(1>jpt) 183 177 END 184 invar.natts EQ 0:BEGIN 178 invar.natts EQ 0:BEGIN 185 179 dummy = report('the variable '+invar.name+' has no attribut.!C we create a fake calendar ...') 186 180 fakecal = 1 … … 197 191 fakecal = 1 198 192 time = date0fk + lindgen(1>jpt) 199 ENDIF ELSE BEGIN 193 ENDIF ELSE BEGIN 200 194 ; we read the time axis 201 195 ncdf_varget, cdfid, varid, time … … 223 217 err = 1 224 218 ENDIF 225 IF err GT 0 THEN BEGIN 219 IF err GT 0 THEN BEGIN 226 220 fakecal = 1 227 221 time = date0fk + lindgen(1>jpt) 228 ENDIF ELSE BEGIN 222 ENDIF ELSE BEGIN 229 223 debut = str_sep(mots[2], '-') 230 224 ; … … 241 235 'greg':IF n_elements(key_caltype) EQ 0 THEN key_caltype = 'greg' 242 236 ELSE:BEGIN 243 ; notused = report('Unknown calendar: '+value+', we use greg calendar.') 237 ; notused = report('Unknown calendar: '+value+', we use greg calendar.') 244 238 key_caltype = 'greg' 245 239 END 246 240 ENDCASE 247 241 ENDIF ELSE BEGIN 248 ; notused = report('Unknown calendar, we use '+key_caltype+' calendar.') 242 ; notused = report('Unknown calendar, we use '+key_caltype+' calendar.') 249 243 IF n_elements(key_caltype) EQ 0 THEN key_caltype = 'greg' 250 244 ENDELSE … … 259 253 'hour':time = julday(debut[1], debut[2], debut[0])+time/24.d 260 254 'day':time = julday(debut[1], debut[2], debut[0])+time 261 'month':BEGIN 255 'month':BEGIN 262 256 if total(fix(time) NE time) NE 0 then $ ; we switch to days with 30d/m 263 257 time = julday(debut[1], debut[2], debut[0])+round(time*30) $ -
trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/xcreateanim.pro
r150 r226 5 5 ; @categories 6 6 ; 7 ;8 7 ; @param EVENT 9 8 ; 10 ;11 9 ; @returns 12 ; 13 ; 10 ; 14 11 ; @uses 15 ; 16 ; 12 ; 17 13 ; @restrictions 18 ; 19 ; 14 ; 20 15 ; @examples 21 ; 22 ; 16 ; 23 17 ; @history 24 ; 25 ; 18 ; 26 19 ; @version 27 ; $Id$ 28 ; 20 ; $Id$ 21 ; 29 22 ; @todo 30 23 ; seb 31 24 ; 32 25 ;- 33 pro xcreateanim_event, event 26 pro xcreateanim_event, event 34 27 ; 35 28 compile_opt idl2, strictarrsubs … … 61 54 widget_control, widget_info(event.top, find_by_uname = 'debut') $ 62 55 , get_value = vdate1 63 index1 = where(calendar eq date2jul(vdate1)) & index1 = index1[0] 56 index1 = where(calendar eq date2jul(vdate1)) & index1 = index1[0] 64 57 if index1 EQ -1 then return 65 58 ; 66 59 widget_control, widget_info(event.handler, find_by_uname = 'fin') $ 67 60 , get_value = vdate2 68 index2 = where(calendar eq date2jul(vdate2)) & index2 = index2[0] 61 index2 = where(calendar eq date2jul(vdate2)) & index2 = index2[0] 69 62 if index2 EQ -1 OR index2 LE index1 then return 70 63 ; We delete the widget before create the file .ps … … 73 66 ; creation of the routine which will serve us to do the drawing 74 67 ; 75 ; We recuperate the list of instructions 68 ; We recuperate the list of instructions 76 69 globalcommand = extractatt(top_uvalue, 'globalcommand') 77 70 ; We complete by first and last lines of the program … … 113 106 green = green[index] 114 107 blue = blue[index] 115 endif 108 endif 116 109 ; 117 110 if depth gt 8 then $ … … 133 126 IF keyword_set(fakecal) THEN date = ind ELSE date = jul2date(calendar[ind]) 134 127 xxx2ps, /noerase, date1 = date, date2 = date 135 ; 128 ; 136 129 image = tvrd(true = depth GT 8) 137 130 ; … … 142 135 wdelete, !d.window 143 136 ENDFOR 144 ENDIF 137 ENDIF 145 138 ; We put a last white picture 146 139 window, /free, /pixmap, xsize = xsize, ysize = ysize … … 155 148 wdelete, !d.window 156 149 ; File's closing. 157 write_gif, animdir+nomfic, /close 158 widget_control, base, /destroy 150 write_gif, animdir+nomfic, /close 151 widget_control, base, /destroy 159 152 ; Rerock in "normal" mode 160 153 thisOS = strupcase(strmid(!version.os_family, 0, 3)) … … 169 162 endif 170 163 ; 171 164 172 165 return 173 166 end … … 179 172 ; @categories 180 173 ; 181 ; 174 ; 182 175 ; @param PARENT 183 176 ; 184 ; 177 ; 185 178 ; @returns 186 ; 187 ; 179 ; 180 ; 188 181 ; @uses 189 ; 190 ; 182 ; 191 183 ; @restrictions 192 ; 193 ; 184 ; 194 185 ; @examples 195 ; 196 ; 186 ; 197 187 ; @history 198 ; 199 ; 188 ; 200 189 ; @version 201 ; $Id$ 202 ; 190 ; $Id$ 191 ; 203 192 ; @todo 204 193 ; seb … … 229 218 if strtrim(filenames[0], 1) EQ '' then filenames = filenames[1:n_elements(filenames)-1] 230 219 indexfile = (where(filelist EQ filenames[0]))[0] 231 calendar = (*(extractatt(top_uvalue, 'fileparameters'))[indexfile]).time_counter 220 calendar = (*(extractatt(top_uvalue, 'fileparameters'))[indexfile]).time_counter 232 221 key_caltype = (*(extractatt(top_uvalue, 'fileparameters'))[indexfile]).caltype 233 222 fakecal = (*(extractatt(top_uvalue, 'fileparameters'))[indexfile]).fakecal … … 237 226 calendarbis = (*(extractatt(top_uvalue, 'fileparameters'))[indexfilebis]).time_counter 238 227 if n_elements(calendarbis) NE n_elements(calendar) then begin 239 nothing = report(' Les diffrents plots n''utilisent pas le meme calendrier. !C Animation impossible!', /error)228 nothing = report('plots do not use the same calendar. !C Animation impossible!', /error) 240 229 return 241 230 ENDIF 242 231 if total(calendar NE calendarbis) NE 0 then begin 243 nothing = report(' Les diffrents plots n''utilisent pas le meme calendrier. !C Animation impossible!', /error)232 nothing = report('plots do not use the same calendar. !C Animation impossible!', /error) 244 233 return 245 234 endif … … 249 238 ; It is possible to do an animation. 250 239 ; 251 base = widget_base(/column, title = 'animation creation', uvalue = {parent:parent, indexfile:indexfile}) 240 base = widget_base(/column, title = 'animation creation', uvalue = {parent:parent, indexfile:indexfile}) 252 241 rien = widget_label(base, value = 'animation name') 253 242 rien = widget_text(base,value='anim_idl.gif', uname='Filename', /editable) … … 266 255 widget_control,base,/realize 267 256 xmanager,'xcreateanim', base, /no_block 268 257 269 258 return 270 259 end -
trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/xxxmenubar_event.pro
r150 r226 5 5 ; @categories 6 6 ; 7 ; 7 ; 8 8 ; @param EVENT 9 9 ; 10 ;11 10 ; @returns 12 ; 13 ; 11 ; 14 12 ; @uses 15 ; 16 ; 13 ; 17 14 ; @restrictions 18 ; 19 ; 15 ; 20 16 ; @examples 21 ; 22 ; 17 ; 23 18 ; @history 24 ; 25 ; 26 ; @version 19 ; 20 ; @version 27 21 ; $Id$ 28 22 ; 29 ; @todo 23 ; @todo 30 24 ; seb 31 25 ;- … … 39 33 40 34 case event.value of 41 'Open' :begin 35 'Open' :begin 42 36 oldmeshparams = ccmeshparameters 43 37 newfile = selectfile() … … 62 56 ; What is the selected field ? Do we reselect it ? 63 57 fieldname = widget_info(vlstid, /combobox_gettext) 64 index = where(newfile.fileparameters.listvar EQ fieldname) 58 index = where(newfile.fileparameters.listvar EQ fieldname) 65 59 widget_control, vlstid, set_value = newfile.fileparameters.listvar 66 60 widget_control, vlstid, set_combobox_select = 0 > index[0] … … 117 111 xxx, CALLERWIDID = event.top, _extra = extra 118 112 end 119 'Quit':begin 113 'Quit':begin 120 114 widget_control, event.top, get_uvalue = top_uvalue 121 115 ptr_free, extractatt(top_uvalue, 'exextra') … … 142 136 , /POSTSCRIPT 143 137 END 144 'Animated gif' :begin 138 'Animated gif' :begin 145 139 IF float(strmid(!version.release,0,3)) GE 6.2 THEN xcreateanim, event.top 146 140 end … … 174 168 widget_control, event.top, get_uvalue = top_uvalue 175 169 ; portrait or landscape ??? 176 options = extractatt(top_uvalue, 'options') 170 options = extractatt(top_uvalue, 'options') 177 171 optionsflag = extractatt(top_uvalue, 'optionsflag') 178 172 portrait = (optionsflag[where(options EQ 'Portrait/Landscape'), 0])[0] … … 203 197 ENDIF 204 198 ; We recuperate the name of the file 205 filename = xquestion(' dans quel fichier bianire voulez vous sauver le widget ?', 'xxx_widget.dat')199 filename = xquestion('In which binary file do you want to save the widget ?', 'xxx_widget.dat') 206 200 ; We complete it by a .dat 207 201 if rstrpos(filename, '.dat') NE strlen(filename)-4 then filename = filename+'.dat' … … 219 213 for i = 0, n_elements(commande)-1 do print, commande[i] 220 214 end 221 'Portrait/Landscape' :begin 215 'Portrait/Landscape' :begin 222 216 widget_control, event.top, get_uvalue = top_uvalue 223 217 options = extractatt(top_uvalue, 'options') … … 255 249 ENDELSE 256 250 end 257 'Overlay' :begin 251 'Overlay' :begin 258 252 widget_control, event.top, get_uvalue = top_uvalue 259 253 numdessinin = (extractatt(top_uvalue, 'smallin'))[2]-1 260 options = extractatt(top_uvalue, 'options') 254 options = extractatt(top_uvalue, 'options') 261 255 flags = extractatt(top_uvalue, 'optionsflag') 262 256 index = where(options EQ 'Overlay') … … 269 263 widget_control, event.top, get_uvalue = top_uvalue 270 264 numdessinin = (extractatt(top_uvalue, 'smallin'))[2]-1 271 options = extractatt(top_uvalue, 'options') 265 options = extractatt(top_uvalue, 'options') 272 266 flags = extractatt(top_uvalue, 'optionsflag') 273 267 index = where(options EQ 'Vecteur') … … 280 274 widget_control, event.top, get_uvalue = top_uvalue 281 275 numdessinin = (extractatt(top_uvalue, 'smallin'))[2]-1 282 options = extractatt(top_uvalue, 'options') 276 options = extractatt(top_uvalue, 'options') 283 277 flags = extractatt(top_uvalue, 'optionsflag') 284 278 index = where(options EQ 'Longitude / x index') … … 314 308 (*top_uvalue[1, findline(top_uvalue, 'domaines')])[*, numdessinin] = boxzoom 315 309 end 316 'Latitude / y index':begin 310 'Latitude / y index':begin 317 311 widget_control, event.top, get_uvalue = top_uvalue 318 312 numdessinin = (extractatt(top_uvalue, 'smallin'))[2]-1 319 options = extractatt(top_uvalue, 'options') 313 options = extractatt(top_uvalue, 'options') 320 314 flags = extractatt(top_uvalue, 'optionsflag') 321 315 index = where(options EQ 'Latitude / y index')
Note: See TracChangeset
for help on using the changeset viewer.