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

Last change on this file since 192 was 150, checked in by navarro, 18 years ago

english and nicer header (3a)

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