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