source: trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/changefield.pro @ 367

Last change on this file since 367 was 327, checked in by pinsard, 16 years ago

modification of headers : mainly blanks around = sign for keywords in declaration of function and pro

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.2 KB
Line 
1;+
2;
3; @file_comments
4;
5; @categories
6;
7; @param BASE {in}{required}
8; The id of the widget where apply the drawing.
9;
10; @param NEWFIELDNAME
11;
12; @keyword BOXZOOM
13; Vector indicating the geographic zone on which we want to cut the map.
14; If BOXZOOM has :
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]]
19;   6 elements: The extraction is made on Boxzoom
20; Where lon1, lon2,lat1,lat2 are global variables defined at the last
21; <pro>domdef</pro> !
22;
23; @returns
24;
25; @uses
26;
27; @restrictions
28;
29; @examples
30;
31; @history
32;
33; @version
34; $Id$
35;
36; @todo
37; seb
38;
39;-
40PRO changefield, base, newfieldname, BOXZOOM=boxzoom
41;
42  compile_opt idl2, strictarrsubs
43;
44  widget_control, base, get_uvalue = top_uvalue
45;
46; Change exextra :
47  exextra = definedefaultextra(newfieldname)
48  specifieid = widget_info(base, find_by_uname = 'specifie')
49  widget_control, specifieid, set_value = exextra
50; Change the variable -> Do we need to change the vertical axis
51; according to the type of points (T or W)?
52  dthlv1id = widget_info(base, find_by_uname = 'dthlv1')
53  widget_control, dthlv1id, get_uvalue = dthlv1_uval
54  oldzgridt = dthlv1_uval.grid_t
55; get the type of point
56  currentfile = extractatt(top_uvalue, 'currentfile')
57  listgrid = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listgrid
58  listvar = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listvar
59;   for i = 0,  n_elements(listvar)-1 do print,  listvar[i], '/', listgrid[i]
60  indexvar = where(listvar EQ newfieldname)
61  indexvar = 0 > indexvar[0]
62  zgridt = strupcase(listgrid[indexvar]) NE 'W'
63; if we change the type of point
64  if zgridt NE oldzgridt then BEGIN
65; update dthlv1_uval.grid_t
66    dthlv1_uval.grid_t = zgridt
67    widget_control, dthlv1id, set_uvalue = dthlv1_uval
68; update cw_domain
69    if NOT keyword_set(boxzoom) THEN $
70       widget_control, widget_info(base, find_by_uname = 'domain'), get_value = boxzoom
71    widget_control, widget_info(base, find_by_uname = 'domain'), set_value = boxzoom
72  endif
73;
74  return
75end
Note: See TracBrowser for help on using the repository browser.