;+ ; ; @file_comments ; ; @categories ; ; @param BASE {in}{required} ; The id of the widget where apply the drawing. ; ; @param NEWFIELDNAME ; ; @keyword BOXZOOM ; Vector indicating the geographic zone on which we want to cut the map. ; If BOXZOOM has : ; 1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] ; 2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] ; 4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])] ; 5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] ; 6 elements: The extraction is made on Boxzoom ; Where lon1, lon2,lat1,lat2 are global variables defined at the last ; domdef ! ; ; @returns ; ; @uses ; ; @restrictions ; ; @examples ; ; @history ; ; @version ; $Id$ ; ; @todo ; seb ; ;- PRO changefield, base, newfieldname, BOXZOOM=boxzoom ; compile_opt idl2, strictarrsubs ; widget_control, base, get_uvalue = top_uvalue ; ; Change exextra : exextra = definedefaultextra(newfieldname) specifieid = widget_info(base, find_by_uname = 'specifie') widget_control, specifieid, set_value = exextra ; Change the variable -> Do we need to change the vertical axis ; according to the type of points (T or W)? dthlv1id = widget_info(base, find_by_uname = 'dthlv1') widget_control, dthlv1id, get_uvalue = dthlv1_uval oldzgridt = dthlv1_uval.grid_t ; get the type of point currentfile = extractatt(top_uvalue, 'currentfile') listgrid = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listgrid listvar = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listvar ; for i = 0, n_elements(listvar)-1 do print, listvar[i], '/', listgrid[i] indexvar = where(listvar EQ newfieldname) indexvar = 0 > indexvar[0] zgridt = strupcase(listgrid[indexvar]) NE 'W' ; if we change the type of point if zgridt NE oldzgridt then BEGIN ; update dthlv1_uval.grid_t dthlv1_uval.grid_t = zgridt widget_control, dthlv1id, set_uvalue = dthlv1_uval ; update cw_domain if NOT keyword_set(boxzoom) THEN $ widget_control, widget_info(base, find_by_uname = 'domain'), get_value = boxzoom widget_control, widget_info(base, find_by_uname = 'domain'), set_value = boxzoom endif ; return end