source: trunk/SRC/ToBeReviewed/HOPE/rh_alldomains.pro @ 142

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

english and nicer header (2a)

  • Property svn:keywords set to Id
File size: 6.0 KB
Line 
1;+
2;
3; @todo seb
4;
5;-
6PRO rh_alldomains, topid, selected
7;
8  compile_opt idl2, strictarrsubs
9;
10
11   widget_control, topid, get_uvalue=top_uvalue
12   widget_control, topid, update=0
13;
14   selectedline=(*top_uvalue[1, findline(top_uvalue, 'linetype')])[selected]
15;
16; we get the size of the dimenstion id of this section
17;
18   dimvar = *top_uvalue[1, findline(top_uvalue, 'dimvar')]
19   typedim = *top_uvalue[1, findline(top_uvalue, 'typedim')]
20   dimlist = *top_uvalue[1, findline(top_uvalue, 'dimlist')]
21   sizedim = *top_uvalue[1, findline(top_uvalue, 'sizedim')]
22;
23; buttons to select type of line : odd, even or odd-even
24;
25   linechoicebase=widget_info(topid,find_by_uname = 'linechoicebase')
26   id = widget_info(linechoicebase,find_by_uname = 'linechoice')
27   IF id NE 0 THEN widget_control, id, /destroy
28   choice = ''
29   if (where(selectedline EQ 'odd'))[0] NE -1 then choice = [choice, 'odd']
30   if (where(selectedline EQ 'even'))[0] NE -1 then choice = [choice, 'even']
31   if (where(selectedline EQ 'odd-even'))[0] NE -1 then choice = [choice, 'odd-even']
32   choice = choice[1:n_elements(choice)-1]
33   nothing = cw_bgroup(linechoicebase,choice, /row,/exclusive, /return_name, uname = 'linechoice', uvalue = {name:'linechoice'})
34   widget_control, nothing, set_value = 0
35   sensitive = bytarr(3)
36   sensitive[where(['odd', 'even', 'odd-even'] eq choice[0])] = 1
37;
38;  odd points domain
39;
40   basedomainodd=widget_info(topid,find_by_uname = 'basedomainodd')
41   id = widget_info(basedomainodd,find_by_uname = 'title')
42   IF id NE 0 THEN widget_control, id, /destroy
43   oddsecchoice = where(selectedline EQ 'odd')
44   if oddsecchoice[0] NE -1 then BEGIN
45      oddsecchoice = selected[oddsecchoice]
46      nothing=widget_label(basedomainodd, value = 'Domain of the odd points', uname = 'title')
47      IF n_elements(oddsecchoice) GT 1 THEN BEGIN
48         selecteddim = dimvar[*, oddsecchoice]
49         sorteddim = selecteddim
50         FOR i = 0, n_elements(oddsecchoice)-1 DO $
51          sorteddim[*, i] = selecteddim[sortdim(typedim[selecteddim[*, i]]), i]
52         zdim = sorteddim[2, *]
53         sizedims = sizedim[zdim]
54         sortedzdim = sort(sizedims)
55         sizedims = sizedims[sortedzdim]
56         oddsecchoice = oddsecchoice[sortedzdim]
57         nothing=widget_droplist(basedomainodd,title = 'number of levels', value = strtrim(sizedims, 2), uvalue = {name:'oddsecchoice'}, uname='oddsecchoice')
58      ENDIF
59      domainpart, top_uvalue, basedomainodd, oddsecchoice[0]
60      widget_control, basedomainodd, set_uvalue = oddsecchoice
61   ENDIF ELSE BEGIN
62      nothing=widget_label(basedomainodd, value = ' ', uname = 'title')
63      domainpart, top_uvalue, basedomainodd, /destroy
64      widget_control, basedomainodd, set_uvalue = -1
65   ENDELSE
66   widget_control, basedomainodd, sensitive = sensitive[0]
67;
68;  even points domain
69;
70   basedomaineven=widget_info(topid,find_by_uname = 'basedomaineven')
71   id = widget_info(basedomaineven,find_by_uname = 'title')
72   IF id NE 0 THEN widget_control, id, /destroy
73   evensecchoice = where(selectedline EQ 'even')
74   if evensecchoice[0] NE -1 then BEGIN
75      evensecchoice = selected[evensecchoice]
76      nothing=widget_label(basedomaineven, value = 'Domain of the even points', uname = 'title')
77      IF n_elements(evensecchoice) GT 1 THEN BEGIN
78         selecteddim = dimvar[*, evensecchoice]
79         sorteddim = selecteddim
80         FOR i = 0, n_elements(evensecchoice)-1 DO $
81          sorteddim[*, i] = selecteddim[sortdim(typedim[selecteddim[*, i]]), i]
82         zdim = sorteddim[2, *]
83         sizedims = sizedim[zdim]
84         sortedzdim = sort(sizedims)
85         sizedims = sizedims[sortedzdim]
86         evensecchoice = evensecchoice[sortedzdim]
87         nothing=widget_droplist(basedomaineven,title = 'number of levels', value = strtrim(sizedims, 2), uvalue = {name:'evensecchoice'}, uname='evensecchoice')
88      ENDIF
89      domainpart, top_uvalue, basedomaineven, evensecchoice[0]
90      widget_control, basedomaineven, set_uvalue = evensecchoice
91   ENDIF ELSE BEGIN
92      domainpart, top_uvalue, basedomaineven, /destroy
93      nothing=widget_label(basedomaineven, value = ' ', uname = 'title')
94      widget_control, basedomaineven, set_uvalue = -1
95   ENDELSE
96   widget_control, basedomaineven, sensitive = sensitive[1]
97;
98;  odd-even points domain
99;
100   basedomainoddeven=widget_info(topid,find_by_uname = 'basedomainodd-even')
101   id = widget_info(basedomainoddeven,find_by_uname = 'title')
102   IF id NE 0 THEN widget_control, id, /destroy
103   oddevensecchoice = where(selectedline EQ 'odd-even')
104   if oddevensecchoice[0] NE -1 then BEGIN
105      oddevensecchoice = selected[oddevensecchoice]
106      nothing=widget_label(basedomainoddeven, value = 'Domain of the odd-even points', uname = 'title')
107      IF n_elements(oddevensecchoice) GT 1 THEN BEGIN
108         selecteddim = dimvar[*, oddevensecchoice]
109         sorteddim = selecteddim
110         FOR i = 0, n_elements(oddevensecchoice)-1 DO $
111          sorteddim[*, i] = selecteddim[sortdim(typedim[selecteddim[*, i]]), i]
112         zdim = sorteddim[2, *]
113         sizedims = sizedim[zdim]
114         sortedzdim = sort(sizedims)
115         sizedims = sizedims[sortedzdim]
116         oddevensecchoice = oddevensecchoice[sortedzdim]
117         nothing=widget_droplist(basedomainoddeven,title = 'number of levels', value = strtrim(sizedims, 2), uvalue = {name:'odd-evensecchoice'}, uname='odd-evensecchoice')
118      ENDIF
119      domainpart, top_uvalue, basedomainoddeven, oddevensecchoice[0]
120      widget_control, basedomainoddeven, set_uvalue = oddevensecchoice
121   ENDIF ELSE BEGIN
122      domainpart, top_uvalue, basedomainoddeven, /destroy
123      nothing=widget_label(basedomainoddeven, value = ' ', uname = 'title')
124      widget_control, basedomainoddeven, set_uvalue = -1
125   ENDELSE
126   widget_control, basedomainoddeven, sensitive = sensitive[2]
127;
128   case (where(sensitive EQ 1))[0] of
129      0:*top_uvalue[1, findline(top_uvalue, 'selected')] = oddsecchoice[0]
130      1:*top_uvalue[1, findline(top_uvalue, 'selected')] = evensecchoice[0]
131      2:*top_uvalue[1, findline(top_uvalue, 'selected')] = oddevensecchoice[0]
132   endcase
133;
134   widget_control, topid, update=1
135   return
136end
Note: See TracBrowser for help on using the repository browser.