[2] | 1 | ;------------------------------------------------------------ |
---|
| 2 | ;------------------------------------------------------------ |
---|
| 3 | ;------------------------------------------------------------ |
---|
| 4 | ;+ |
---|
| 5 | ; |
---|
[150] | 6 | ; @file_comments |
---|
[226] | 7 | ; This function send back a string which contain the reading command |
---|
[150] | 8 | ; and drawing's parameters. |
---|
[2] | 9 | ; |
---|
[150] | 10 | ; @param BASE {in}{required} |
---|
[2] | 11 | ; |
---|
[150] | 12 | ; @keyword BOXZOOM |
---|
[226] | 13 | ; Vector indicating the geographic zone on which we want to cut the map. |
---|
| 14 | ; If BOXZOOM has : |
---|
[150] | 15 | ; 1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] |
---|
| 16 | ; 2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] |
---|
| 17 | ; 4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])] |
---|
| 18 | ; 5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] |
---|
[226] | 19 | ; 6 elements: The extraction is made on Boxzoom |
---|
[150] | 20 | ; Where lon1, lon2,lat1,lat2 are global variables defined at the last domdef! |
---|
[2] | 21 | ; |
---|
[150] | 22 | ; @keyword FORCETYPE |
---|
[2] | 23 | ; |
---|
[150] | 24 | ; @history |
---|
[157] | 25 | ; Sebastien Masson (smasson\@lodyc.jussieu.fr) |
---|
[2] | 26 | ; |
---|
[150] | 27 | ; @version |
---|
| 28 | ; $Id$ |
---|
[2] | 29 | ; |
---|
[150] | 30 | ; @todo |
---|
| 31 | ; seb: documenter le param BASE et le keyword FORCETYPE |
---|
[2] | 32 | ; |
---|
| 33 | ;- |
---|
| 34 | ;------------------------------------------------------------ |
---|
| 35 | ;------------------------------------------------------------ |
---|
| 36 | ;------------------------------------------------------------ |
---|
[69] | 37 | FUNCTION buildcmd, base, BOXZOOM = boxzoom, FORCETYPE = forcetype |
---|
[49] | 38 | ; |
---|
[2] | 39 | ;------------------------------------------------------------ |
---|
[69] | 40 | ; we get back the ids of the widget parts |
---|
[2] | 41 | ;------------------------------------------------------------ |
---|
[114] | 42 | ; |
---|
| 43 | compile_opt idl2, strictarrsubs |
---|
| 44 | ; |
---|
[69] | 45 | txtcmdid = widget_info(base, find_by_uname = 'txtcmd') |
---|
| 46 | domainid = widget_info(base, find_by_uname = 'domain') |
---|
| 47 | actionid = widget_info(base, find_by_uname = 'action') |
---|
[2] | 48 | ; optionid = widget_info(base, find_by_uname = 'option') |
---|
| 49 | ;------------------------------------------------------------ |
---|
[69] | 50 | widget_control, base, get_uvalue = top_uvalue |
---|
| 51 | smallin = extractatt(top_uvalue, 'smallin') |
---|
| 52 | numdessinin = smallin[2]-1 |
---|
| 53 | smallout = extractatt(top_uvalue, 'smallout') |
---|
| 54 | numdessinout = smallout[2]-1 |
---|
| 55 | ; |
---|
[226] | 56 | options = extractatt(top_uvalue, 'options') |
---|
[69] | 57 | optionsflag = extractatt(top_uvalue, 'optionsflag') |
---|
| 58 | portrait = (strtrim(optionsflag[where(options EQ 'Portrait/Landscape'), 0], 1))[0] |
---|
[2] | 59 | ;------------------------------------------------------------ |
---|
| 60 | ;--------------- |
---|
[150] | 61 | ; We determinate which procedure we will call to do the drawing and the type |
---|
[2] | 62 | ;--------------- |
---|
[69] | 63 | IF keyword_set(forcetype) THEN type = forcetype $ |
---|
| 64 | ELSE type = widget_info(actionid, /combobox_gettext) |
---|
| 65 | case type of |
---|
[74] | 66 | 'pltz diag up':procedure = 'pltz' |
---|
| 67 | 'pltz diag dn':procedure = 'pltz' |
---|
| 68 | 'pltt diag up':procedure = 'pltt' |
---|
| 69 | 'pltt diag dn':procedure = 'pltt' |
---|
[69] | 70 | 'xy':procedure = 'plt' |
---|
| 71 | 'xz':procedure = 'pltz' |
---|
| 72 | 'yz':procedure = 'pltz' |
---|
| 73 | 'xt':procedure = 'pltt' |
---|
| 74 | 'yt':procedure = 'pltt' |
---|
| 75 | 'zt':procedure = 'pltt' |
---|
| 76 | 'x':procedure = 'plt1d' |
---|
| 77 | 'y':procedure = 'plt1d' |
---|
| 78 | 'z':procedure = 'plt1d' |
---|
| 79 | 't':procedure = 'pltt' |
---|
[152] | 80 | ELSE:procedure = type |
---|
[69] | 81 | endcase |
---|
[2] | 82 | ; |
---|
[150] | 83 | ; Search of options |
---|
[2] | 84 | ; |
---|
[226] | 85 | options = extractatt(top_uvalue, 'options') |
---|
[69] | 86 | optionsflag = extractatt(top_uvalue, 'optionsflag') |
---|
| 87 | flags = optionsflag[*, numdessinin] |
---|
| 88 | xindex = (flags[where(options EQ 'Longitude / x index')])[0] |
---|
| 89 | yindex = (flags[where(options EQ 'Latitude / y index')])[0] |
---|
| 90 | drawvecteur = (flags[where(options EQ 'Vecteur')])[0]*(procedure eq 'plt') |
---|
| 91 | drawover = (flags[where(options EQ 'Overlay')])[0] |
---|
[2] | 92 | ; |
---|
[69] | 93 | alreadyread = extractatt(top_uvalue, 'alreadyread') |
---|
| 94 | alreadyvector = extractatt(top_uvalue, 'alreadyvector') |
---|
| 95 | alreadyover = extractatt(top_uvalue, 'alreadyoer') |
---|
[150] | 96 | ; What must we read ? |
---|
[69] | 97 | case 1 of |
---|
| 98 | alreadyover NE -1:BEGIN |
---|
| 99 | toread = alreadyover+1 |
---|
| 100 | readswitch = 'over' |
---|
| 101 | END |
---|
| 102 | alreadyvector NE -1 AND alreadyvector NE !pi:BEGIN |
---|
| 103 | toread = alreadyvector+1 |
---|
| 104 | readswitch = 'vector' |
---|
| 105 | END |
---|
| 106 | alreadyread NE -1 AND alreadyread NE !pi AND alreadyread NE 2.*!pi:BEGIN |
---|
| 107 | toread = alreadyread+1 |
---|
| 108 | readswitch = 'classic' |
---|
| 109 | END |
---|
| 110 | else:BEGIN |
---|
| 111 | case 1 of |
---|
| 112 | alreadyvector eq !pi:BEGIN |
---|
| 113 | toread = alreadyover+1 |
---|
| 114 | readswitch = 'over' |
---|
| 115 | END |
---|
| 116 | alreadyread EQ !pi:BEGIN |
---|
| 117 | toread = alreadyvector+1 |
---|
| 118 | readswitch = 'vector' |
---|
| 119 | END |
---|
| 120 | alreadyread EQ 2.*!pi:BEGIN |
---|
| 121 | toread = alreadyover+1 |
---|
| 122 | readswitch = 'over' |
---|
| 123 | END |
---|
| 124 | ELSE:BEGIN |
---|
| 125 | toread = alreadyread+1 |
---|
| 126 | readswitch = 'classic' |
---|
| 127 | END |
---|
| 128 | endcase |
---|
| 129 | END |
---|
| 130 | ENDCASE |
---|
[2] | 131 | ; |
---|
[69] | 132 | widget_control, txtcmdid, get_value = widcmd |
---|
[74] | 133 | widcmd = strtrim(widcmd, 2) |
---|
[69] | 134 | IF widcmd[0] EQ '' THEN widcmd = 'zzz' |
---|
[226] | 135 | |
---|
[69] | 136 | cutcmd, widcmd[0], toread, numberofread, prefix, nameexp, ending |
---|
[2] | 137 | ; |
---|
[69] | 138 | readcmd = buildreadcmd(base, ''''+nameexp+'''', procedure, type $ |
---|
| 139 | , BOXZOOM = boxzoom, complete = readswitch EQ 'classic' AND alreadyread EQ -1) |
---|
| 140 | ; we look for the line containing funclec_name |
---|
| 141 | currentfile = extractatt(top_uvalue, 'currentfile') |
---|
| 142 | readparameters = *(extractatt(top_uvalue, 'readparameters'))[currentfile] |
---|
| 143 | i = 0 |
---|
| 144 | while strpos(readcmd[i], readparameters.funclec_name + '(') EQ -1 do i = i+1 |
---|
| 145 | |
---|
[2] | 146 | ;----------------------- |
---|
| 147 | ;----------------------- |
---|
| 148 | ;----------------------- |
---|
| 149 | ;----------------------- |
---|
| 150 | ;----------------------- |
---|
[69] | 151 | case readswitch of |
---|
| 152 | 'classic':BEGIN |
---|
| 153 | if alreadyread+1 EQ 0 then BEGIN |
---|
| 154 | ; we start the reading command |
---|
| 155 | readcmd = ['; beginning of reading the field to draw', readcmd] |
---|
| 156 | readcmd[i+1] = 'field = ' + prefix + readcmd[i+1] |
---|
| 157 | ENDIF ELSE BEGIN |
---|
| 158 | ; we complet the reading command |
---|
| 159 | oldrdcmd = extractatt(top_uvalue, 'currentreadcmd') |
---|
[226] | 160 | nl = n_elements(oldrdcmd) |
---|
[69] | 161 | oldrdcmd[nl-1] = oldrdcmd[nl-1] + ' $' |
---|
| 162 | readcmd[i] = prefix + readcmd[i] |
---|
| 163 | readcmd = [temporary(oldrdcmd), temporary(readcmd)] |
---|
| 164 | ENDELSE |
---|
| 165 | ; exit if we have to read other fields... |
---|
[226] | 166 | if alreadyread+1 NE numberofread-1 THEN BEGIN |
---|
[69] | 167 | *top_uvalue[1, findline(top_uvalue, 'currentreadcmd')] = readcmd |
---|
| 168 | *top_uvalue[1, findline(top_uvalue, 'alreadyread')] = alreadyread+1 |
---|
| 169 | *top_uvalue[1, findline(top_uvalue, 'noticebase')] = xnotice('Select the field number '+strtrim(alreadyread+3, 1)) |
---|
| 170 | return, '' |
---|
| 171 | ENDIF |
---|
| 172 | ; we finalize the reading command |
---|
[226] | 173 | IF ending NE '' THEN BEGIN |
---|
| 174 | nl = n_elements(readcmd) |
---|
[69] | 175 | readcmd[nl-1] = readcmd[nl-1] + ' $' |
---|
| 176 | readcmd = [temporary(readcmd), ending] |
---|
| 177 | ENDIF |
---|
| 178 | readcmd = [temporary(readcmd) $ |
---|
| 179 | , 'field = create_struct({arr:temporary(field), grid:vargrid, unit:varunit, experiment:varexp, name:varname})' $ |
---|
| 180 | , '; end of reading the field to draw', ';'] |
---|
| 181 | ; we get back _EXTRA: |
---|
| 182 | extra = extractatt(top_uvalue, 'extra') |
---|
| 183 | if xindex NE 0 then extra = create_struct(extra, 'xindex', xindex) |
---|
| 184 | if yindex NE 0 then extra = create_struct(extra, 'yindex', yindex) |
---|
| 185 | exextra = cw_specifie_get_value(base) |
---|
[172] | 186 | tgnm = strlowcase(tag_names(exextra)) |
---|
| 187 | indtmp = where(tgnm EQ 'box' OR tgnm EQ 'boxzoom', cnt) |
---|
[226] | 188 | IF cnt EQ 1 THEN BEGIN |
---|
[172] | 189 | boxextra = exextra.(indtmp[0]) |
---|
| 190 | exextra = extractstru(exextra, ['box', 'boxzoom']) |
---|
[226] | 191 | ENDIF |
---|
[69] | 192 | extra = mixstru(exextra, extra) |
---|
| 193 | sextra = struct2string(extra) |
---|
| 194 | readcmd = [temporary(readcmd), 'extra = '+sextra] |
---|
[2] | 195 | ; |
---|
[69] | 196 | *top_uvalue[1, findline(top_uvalue, 'currentreadcmd')] = readcmd |
---|
| 197 | case 1 of |
---|
| 198 | drawvecteur:BEGIN |
---|
| 199 | ; we have to read the vectors |
---|
| 200 | *top_uvalue[1, findline(top_uvalue, 'alreadyread')] = !pi |
---|
| 201 | *top_uvalue[1, findline(top_uvalue, 'noticebase')] = xnotice('Select the zonal component of vector') |
---|
| 202 | return, '' |
---|
| 203 | END |
---|
| 204 | drawover:BEGIN |
---|
| 205 | ; we have to read the field to overlay... |
---|
| 206 | *top_uvalue[1, findline(top_uvalue, 'alreadyread')] = 2.*!pi |
---|
| 207 | *top_uvalue[1, findline(top_uvalue, 'noticebase')] = xnotice('Select the field to overlay') |
---|
| 208 | return, '' |
---|
| 209 | END |
---|
| 210 | ; finished, we draw the plot... |
---|
| 211 | ELSE:*top_uvalue[1, findline(top_uvalue, 'alreadyread')] = -1 |
---|
| 212 | endcase |
---|
| 213 | END |
---|
| 214 | 'vector':BEGIN |
---|
| 215 | ; for the vectors, there is 2 components. we read u when alreadyvector |
---|
[226] | 216 | ; is a integer and v when alreadyvector is a integer+0.5 |
---|
[69] | 217 | if floor(alreadyvector)+1 EQ 0 then begin |
---|
| 218 | if floor(alreadyvector) EQ alreadyvector then begin |
---|
| 219 | readcmd = ['; beginning of reading the zonal component of vector', readcmd] |
---|
| 220 | readcmd[i+1] = 'fieldu = ' + prefix + readcmd[i+1] |
---|
| 221 | ENDIF ELSE BEGIN |
---|
| 222 | readcmd = ['; beginning of reading the meridional component of vector', readcmd] |
---|
| 223 | readcmd[i+1] = 'fieldv = ' + prefix + readcmd[i+1] |
---|
| 224 | ENDELSE |
---|
| 225 | readcmd = [extractatt(top_uvalue, 'currentreadcmd'), temporary(readcmd)] |
---|
| 226 | ENDIF ELSE BEGIN |
---|
| 227 | oldrdcmd = extractatt(top_uvalue, 'currentreadcmd') |
---|
[226] | 228 | nl = n_elements(oldrdcmd) |
---|
[69] | 229 | oldrdcmd[nl-1] = oldrdcmd[nl-1] + ' $' |
---|
| 230 | readcmd[i] = prefix + readcmd[i] |
---|
| 231 | readcmd = [temporary(oldrdcmd), temporary(readcmd)] |
---|
| 232 | ENDELSE |
---|
[2] | 233 | ; |
---|
[69] | 234 | case alreadyvector+1 of |
---|
| 235 | numberofread-1:BEGIN |
---|
| 236 | ; we finalize the reading command |
---|
[226] | 237 | IF ending NE '' THEN BEGIN |
---|
| 238 | nl = n_elements(readcmd) |
---|
[69] | 239 | readcmd[nl-1] = readcmd[nl-1] + ' $' |
---|
| 240 | readcmd = [temporary(readcmd), ending] |
---|
| 241 | ENDIF |
---|
| 242 | readcmd = [temporary(readcmd) $ |
---|
| 243 | , 'fieldu = create_struct({arr:temporary(fieldu), grid:vargrid, unit:varunit, experiment:varexp, name:varname})' $ |
---|
| 244 | , '; end of reading the zonal component of vector', ';'] |
---|
| 245 | *top_uvalue[1, findline(top_uvalue, 'currentreadcmd')] = readcmd |
---|
| 246 | ; we finished zonal component reading... |
---|
| 247 | ; we know switch to meridional component... |
---|
| 248 | *top_uvalue[1, findline(top_uvalue, 'alreadyvector')] = -.5 |
---|
| 249 | *top_uvalue[1, findline(top_uvalue, 'noticebase')] = xnotice('Select the meridional component of vector') |
---|
| 250 | return, '' |
---|
| 251 | END |
---|
| 252 | numberofread-0.5:BEGIN |
---|
| 253 | ; we finalize the reading command |
---|
[226] | 254 | IF ending NE '' THEN BEGIN |
---|
| 255 | nl = n_elements(readcmd) |
---|
[69] | 256 | readcmd[nl-1] = readcmd[nl-1] + ' $' |
---|
| 257 | readcmd = [temporary(readcmd), ending] |
---|
| 258 | ENDIF |
---|
| 259 | readcmd = [temporary(readcmd) $ |
---|
| 260 | , 'fieldv = create_struct({arr:temporary(fieldv), grid:vargrid, unit:varunit, experiment:varexp, name:varname})' $ |
---|
| 261 | , '; end of reading the meridional component of vector', ';'] |
---|
| 262 | ; we finished meridional component reading... |
---|
[2] | 263 | ; |
---|
[69] | 264 | ; we get back _EXTRA of the vector and we complet extra already build |
---|
| 265 | extra = extractatt(top_uvalue, 'extra') |
---|
| 266 | exextra = cw_specifie_get_value(base) |
---|
| 267 | extra = mixstru(exextra, extra) |
---|
| 268 | sextra = struct2string(extra) |
---|
| 269 | readcmd = [readcmd, 'vectorextra = '+sextra, 'extra=mixstru(extra,vectorextra)'] |
---|
[2] | 270 | ; |
---|
[69] | 271 | *top_uvalue[1, findline(top_uvalue, 'currentreadcmd')] = readcmd |
---|
[2] | 272 | ; |
---|
[69] | 273 | if drawover then BEGIN |
---|
| 274 | ; shall we do an overlay??? |
---|
| 275 | *top_uvalue[1, findline(top_uvalue, 'alreadyvector')] = !pi |
---|
| 276 | *top_uvalue[1, findline(top_uvalue, 'noticebase')] = xnotice('Select the field to overlay') |
---|
| 277 | return, '' |
---|
| 278 | ENDIF ELSE BEGIN |
---|
| 279 | ; it is done know! |
---|
| 280 | *top_uvalue[1, findline(top_uvalue, 'alreadyread')] = -1 |
---|
| 281 | *top_uvalue[1, findline(top_uvalue, 'alreadyvector')] = -1 |
---|
| 282 | ENDELSE |
---|
| 283 | END |
---|
| 284 | ELSE:BEGIN |
---|
| 285 | ; we still need to read some vector components... |
---|
| 286 | *top_uvalue[1, findline(top_uvalue, 'currentreadcmd')] = readcmd |
---|
| 287 | *top_uvalue[1, findline(top_uvalue, 'alreadyvector')] = alreadyvector+1 |
---|
| 288 | if floor(alreadyvector) EQ alreadyvector then text = ' zonal ' $ |
---|
| 289 | ELSE text = ' meridional ' |
---|
| 290 | *top_uvalue[1, findline(top_uvalue, 'noticebase')] = xnotice('Select the '+strtrim(floor(alreadyread)+3, 1)+text+'component of vector') |
---|
| 291 | return, '' |
---|
| 292 | END |
---|
| 293 | endcase |
---|
| 294 | END |
---|
| 295 | 'over':BEGIN |
---|
| 296 | if alreadyover+1 EQ 0 then begin |
---|
| 297 | ; we start the reading... |
---|
| 298 | readcmd = ['; beginning of reading the field to overdraw', readcmd] |
---|
| 299 | readcmd[i+1] = 'fieldover = '+ prefix +readcmd[i+1] |
---|
| 300 | readcmd = [extractatt(top_uvalue, 'currentreadcmd'), temporary(readcmd)] |
---|
| 301 | ENDIF ELSE BEGIN |
---|
| 302 | oldrdcmd = extractatt(top_uvalue, 'currentreadcmd') |
---|
[226] | 303 | nl = n_elements(oldrdcmd) |
---|
[69] | 304 | oldrdcmd[nl-1] = oldrdcmd[nl-1] + ' $' |
---|
| 305 | readcmd[i] = prefix + readcmd[i] |
---|
| 306 | readcmd = [temporary(oldrdcmd), temporary(readcmd)] |
---|
| 307 | ENDELSE |
---|
[2] | 308 | ; |
---|
[226] | 309 | if alreadyover+1 NE numberofread-1 THEN BEGIN |
---|
[69] | 310 | ; we still need to read some files... |
---|
| 311 | *top_uvalue[1, findline(top_uvalue, 'currentreadcmd')] = readcmd |
---|
| 312 | *top_uvalue[1, findline(top_uvalue, 'alreadyover')] = alreadyover+1 |
---|
| 313 | *top_uvalue[1, findline(top_uvalue, 'noticebase')] = xnotice('Select the field number '+strtrim(alreadyover+3, 1)+' to overlay') |
---|
| 314 | return, '' |
---|
| 315 | ENDIF |
---|
| 316 | ; we finalize the reading command |
---|
[226] | 317 | IF ending NE '' THEN BEGIN |
---|
| 318 | nl = n_elements(readcmd) |
---|
[69] | 319 | readcmd[nl-1] = readcmd[nl-1] + ' $' |
---|
| 320 | readcmd = [temporary(readcmd), ending] |
---|
| 321 | ENDIF |
---|
[2] | 322 | ; on finalise la commande de lecture |
---|
[69] | 323 | readcmd = [readcmd $ |
---|
| 324 | , 'fieldover = create_struct({arr:temporary(fieldover), grid:vargrid, unit:varunit, experiment:varexp, name:varname})' $ |
---|
| 325 | , '; end of reading the field to overdraw', ';'] |
---|
| 326 | ; we get back _EXTRA of over and we complet extra already build |
---|
| 327 | extra = extractatt(top_uvalue, 'extra') |
---|
| 328 | exextra = cw_specifie_get_value(base) |
---|
| 329 | extra = mixstru(exextra, extra) |
---|
| 330 | sextra = struct2string(extra) |
---|
| 331 | readcmd = [readcmd, 'overextra = '+sextra, 'extra=mixstru(extra,overextra)'] |
---|
[2] | 332 | ; |
---|
[69] | 333 | *top_uvalue[1, findline(top_uvalue, 'currentreadcmd')] = readcmd |
---|
| 334 | ; we reinitialize |
---|
| 335 | *top_uvalue[1, findline(top_uvalue, 'alreadyread')] = -1 |
---|
| 336 | *top_uvalue[1, findline(top_uvalue, 'alreadyvector')] = -1 |
---|
| 337 | *top_uvalue[1, findline(top_uvalue, 'alreadyover')] = -1 |
---|
| 338 | END |
---|
| 339 | endcase |
---|
[2] | 340 | ; |
---|
| 341 | ;----------------------- |
---|
| 342 | ;----------------------- |
---|
| 343 | ;----------------------- |
---|
| 344 | ;----------------------- |
---|
| 345 | ;----------------------- |
---|
| 346 | ;----------------------- |
---|
| 347 | ;--------------- |
---|
[150] | 348 | ; determination of the boxzoom's name. |
---|
[69] | 349 | if NOT keyword_set(boxzoom) then widget_control, domainid, get_value = boxzoom |
---|
[172] | 350 | CASE n_elements(boxextra) OF |
---|
| 351 | 0: |
---|
| 352 | 1:boxzoom[5] = boxextra |
---|
| 353 | 2:boxzoom[4:5] = boxextra |
---|
| 354 | 4:boxzoom[0:3] = boxextra |
---|
| 355 | 5:boxzoom = [boxextra[0:3], 0, boxextra[4]] |
---|
| 356 | 6:boxzoom = boxextra |
---|
| 357 | ENDCASE |
---|
[150] | 358 | ; Writting of this one as a string |
---|
[69] | 359 | box = '['+strtrim(boxzoom[0], 1) |
---|
| 360 | for i = 1, (n_elements(boxzoom)-1) < (3+2*(strpos(type, 'z') EQ -1)) do $ |
---|
[49] | 361 | box = box+', '+strtrim(boxzoom[i], 1) |
---|
[150] | 362 | ; For [plots in z, box must have by default 0,profmax |
---|
[69] | 363 | if strpos(type, 'z') NE -1 then BEGIN |
---|
[226] | 364 | ; If more than 1 level is selected: |
---|
[69] | 365 | widget_control, widget_info(base, find_by_uname = 'dthlv1'), get_value = niv1 |
---|
| 366 | niv1 = niv1.combobox_index |
---|
| 367 | widget_control, widget_info(base, find_by_uname = 'dthlv2'), get_value = niv2 |
---|
| 368 | niv2 = niv2.combobox_index |
---|
| 369 | if niv1 NE niv2 then begin |
---|
| 370 | box = box+','+strtrim(boxzoom[4], 1)+','+strtrim(boxzoom[5], 1) |
---|
| 371 | ENDIF ELSE BEGIN |
---|
| 372 | if chkstru(exextra, 'profmax') then pmax = exextra.profmax $ |
---|
| 373 | ELSE pmax = 200 |
---|
[172] | 374 | box = box+',0,'+strtrim(boxzoom[5] > pmax, 1) |
---|
[69] | 375 | ENDELSE |
---|
| 376 | endif |
---|
| 377 | box = box+']' |
---|
[74] | 378 | IF strpos(type, ' diag up') NE -1 THEN BEGIN |
---|
[69] | 379 | sendpoints = '[' + strtrim(boxzoom[0], 1) + ', ' + strtrim(boxzoom[2], 1) + $ |
---|
| 380 | ', ' + strtrim(boxzoom[1], 1) + ', ' + strtrim(boxzoom[3], 1) + ']' |
---|
| 381 | ENDIF |
---|
[74] | 382 | IF strpos(type, ' diag dn') NE -1 THEN BEGIN |
---|
| 383 | sendpoints = '[' + strtrim(boxzoom[0], 1) + ', ' + strtrim(boxzoom[3], 1) + $ |
---|
| 384 | ', ' + strtrim(boxzoom[1], 1) + ', ' + strtrim(boxzoom[2], 1) + ']' |
---|
| 385 | ENDIF |
---|
[2] | 386 | ;--------------- |
---|
[150] | 387 | ; We determinate typein |
---|
[2] | 388 | ;--------------- |
---|
[74] | 389 | IF strpos(type, ' diag ') NE -1 THEN typein = ''''+strmid(type, 0, 4)+'''' $ |
---|
[69] | 390 | ELSE typein = ''''+type+'''' |
---|
[2] | 391 | ;--------------- |
---|
| 392 | ;--------------- |
---|
[150] | 393 | ; determination of small |
---|
[2] | 394 | ;--------------- |
---|
[69] | 395 | ssmall = tostr(smallout) |
---|
[2] | 396 | ;------------------------------------------------------------ |
---|
[150] | 397 | ; We will define the string which will contain the command to be executed by widgetdessine.pro |
---|
[2] | 398 | ;------------------------------------------------------------ |
---|
[69] | 399 | Cmd = [readCmd, procedure+ ', field $' $ |
---|
[74] | 400 | , ' , boxzoom = '+box+', /findalways, typein='+typein+', small='+ssmall+' $'] |
---|
[69] | 401 | IF drawvecteur then Cmd = [Cmd, ' , vecteur = {u: fieldu,v: fieldv} $'] |
---|
| 402 | IF drawover then Cmd = [Cmd, ' , contour = fieldover $'] |
---|
| 403 | IF n_elements(sendpoints) NE 0 then Cmd = [Cmd, ' , endpoints = ' + sendpoints + ' $'] |
---|
| 404 | Cmd = [Cmd, ' , _extra= mixstru(ex, extra), portrait = ' + portrait + ', NOERASE=noerase'] |
---|
[2] | 405 | |
---|
| 406 | ; print, '---------------' |
---|
[69] | 407 | ; for i = 0, n_elements(Cmd)-1 do print, Cmd[i] |
---|
[2] | 408 | ; print, '---------------' |
---|
| 409 | ;--------------- |
---|
[150] | 410 | ; We complete and/or update the structure top_uvalue... |
---|
[2] | 411 | ;--------------- |
---|
[69] | 412 | (*top_uvalue[1, findline(top_uvalue, 'nameprocedures')])[numdessinout] = procedure |
---|
| 413 | (*top_uvalue[1, findline(top_uvalue, 'types')])[numdessinout] = type |
---|
| 414 | (*top_uvalue[1, findline(top_uvalue, 'domaines')])[*, numdessinout] = boxzoom |
---|
| 415 | (*top_uvalue[1, findline(top_uvalue, 'txtcmd')])[numdessinout] = widcmd |
---|
| 416 | (*top_uvalue[1, findline(top_uvalue, 'optionsflag')])[*, numdessinout] = flags |
---|
| 417 | *((*top_uvalue[1, findline(top_uvalue, 'exextra')])[numdessinout]) = extra |
---|
[2] | 418 | ;------------------------------------------------------------ |
---|
[69] | 419 | return, Cmd |
---|
[2] | 420 | end |
---|
| 421 | |
---|
| 422 | |
---|