1 | #pragma rtGlobals=3 // Use modern global access method and strict wave access. |
---|
2 | |
---|
3 | |
---|
4 | // this will become the equivalent of "RawWindowHook" |
---|
5 | |
---|
6 | |
---|
7 | Proc UpdateDisplayInformation(type) |
---|
8 | String type |
---|
9 | |
---|
10 | DoWindow VSANS_Data |
---|
11 | if(V_flag==0) |
---|
12 | VSANS_DataPanel() //draws the panel |
---|
13 | endif |
---|
14 | |
---|
15 | // update the information here - in either case |
---|
16 | |
---|
17 | end |
---|
18 | |
---|
19 | |
---|
20 | Window VSANS_DataPanel() :Panel |
---|
21 | PauseUpdate; Silent 1 // building window... |
---|
22 | NewPanel /W=(37,45,1042,784) /N=VSANS_Data |
---|
23 | ShowTools/A |
---|
24 | |
---|
25 | SetDrawLayer UserBack |
---|
26 | SetDrawEnv linethick= 2,dash= 1,fillpat= 0 |
---|
27 | DrawRect 200,140,310,230 |
---|
28 | SetDrawEnv linethick= 2,dash= 1,fillpat= 0 |
---|
29 | DrawRect 320,140,430,230 |
---|
30 | SetDrawEnv linethick= 2,dash= 1,fillpat= 0 |
---|
31 | DrawRect 440,140,550,230 |
---|
32 | |
---|
33 | SetDrawEnv fsize= 18 |
---|
34 | DrawText 230,185,"Front" |
---|
35 | SetDrawEnv fsize= 18 |
---|
36 | DrawText 348,185,"Middle" |
---|
37 | SetDrawEnv fsize= 18 |
---|
38 | DrawText 476,185,"Back" |
---|
39 | |
---|
40 | ToolsGrid visible=1 |
---|
41 | |
---|
42 | TabControl tab0,pos={13,111},size={572,617},proc=VDataTabProc,tabLabel(0)="Front" |
---|
43 | TabControl tab0,tabLabel(1)="Middle",tabLabel(2)="Back",value= 2 |
---|
44 | Button button0,pos={619,135},size={140,20} |
---|
45 | Button button0_1,pos={769,135},size={140,20} |
---|
46 | Button button0_2,pos={623,189},size={140,20} |
---|
47 | Button button0_3,pos={773,189},size={140,20} |
---|
48 | Button button0_4,pos={622,247},size={140,20} |
---|
49 | Button button0_5,pos={772,247},size={140,20} |
---|
50 | |
---|
51 | // for back panels (in pixels?) |
---|
52 | Display/W=(50,239,546,710)/HOST=# root:Packages:NIST:VSANS:VCALC:fv_degY vs root:Packages:NIST:VSANS:VCALC:fv_degX |
---|
53 | RenameWindow #,det_panelsB |
---|
54 | ModifyGraph mode=2 // mode = 2 = dots |
---|
55 | ModifyGraph marker=19 |
---|
56 | ModifyGraph rgb=(0,0,0) |
---|
57 | ModifyGraph tick=2,mirror=1 |
---|
58 | Label left "pixels" |
---|
59 | Label bottom "pixels" |
---|
60 | SetActiveSubwindow ## |
---|
61 | |
---|
62 | // for middle panels (in pixels?) |
---|
63 | Display/W=(50,239,546,710)/HOST=# root:Packages:NIST:VSANS:VCALC:fv_degY vs root:Packages:NIST:VSANS:VCALC:fv_degX |
---|
64 | RenameWindow #,det_panelsM |
---|
65 | ModifyGraph mode=2 // mode = 2 = dots |
---|
66 | ModifyGraph marker=19 |
---|
67 | ModifyGraph rgb=(0,0,0) |
---|
68 | ModifyGraph tick=2,mirror=1 |
---|
69 | Label left "pixels" |
---|
70 | Label bottom "pixels" |
---|
71 | SetActiveSubwindow ## |
---|
72 | |
---|
73 | // for front panels (in pixels?) |
---|
74 | Display/W=(50,239,546,710)/HOST=# root:Packages:NIST:VSANS:VCALC:fv_degY vs root:Packages:NIST:VSANS:VCALC:fv_degX |
---|
75 | RenameWindow #,det_panelsF |
---|
76 | ModifyGraph mode=2 // mode = 2 = dots |
---|
77 | ModifyGraph marker=19 |
---|
78 | ModifyGraph rgb=(0,0,0) |
---|
79 | ModifyGraph tick=2,mirror=1 |
---|
80 | Label left "pixels" |
---|
81 | Label bottom "pixels" |
---|
82 | SetActiveSubwindow ## |
---|
83 | |
---|
84 | EndMacro |
---|
85 | |
---|
86 | |
---|
87 | // |
---|
88 | //lots to to here: |
---|
89 | // |
---|
90 | // - 1 - display the appropriate controls for each tab, and hide the others |
---|
91 | // - 2 - display the correct detector data for each tab, and remove the others from the graph |
---|
92 | // -----?? can I draw 3 graphs, and just put the right one on top?? move the other two to the side? |
---|
93 | // |
---|
94 | // |
---|
95 | // TODO |
---|
96 | // -- add all of the controls of the VCALC panel (log scaling, adjusting the axes, etc.) |
---|
97 | // -- get the panel to be correctly populated first, rather than needing to click everywhere to fill in |
---|
98 | Function VDataTabProc(tca) : TabControl |
---|
99 | STRUCT WMTabControlAction &tca |
---|
100 | |
---|
101 | switch( tca.eventCode ) |
---|
102 | case 2: // mouse up |
---|
103 | Variable tab = tca.tab |
---|
104 | |
---|
105 | SetDataFolder root:Packages:NIST:VSANS:VCALC |
---|
106 | RemoveFromGraph/Z /W=VSANS_Data#det_panelsB fv_degY |
---|
107 | RemoveFromGraph/Z /W=VSANS_Data#det_panelsM fv_degY |
---|
108 | RemoveFromGraph/Z /W=VSANS_Data#det_panelsF fv_degY |
---|
109 | SetDataFolder root: |
---|
110 | |
---|
111 | if(tab==2) |
---|
112 | //SetDataFolder root:Packages:NIST:VSANS:VCALC:Back |
---|
113 | //Wave det_B |
---|
114 | SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_B |
---|
115 | Wave det_B=data |
---|
116 | CheckDisplayed /W=VSANS_Data#det_panelsB det_B |
---|
117 | if(V_flag == 0) |
---|
118 | AppendImage/W=VSANS_Data#det_panelsB det_B |
---|
119 | // ModifyImage/W=VSANS_Data#det_panelsB det_B ctab= {*,*,ColdWarm,0} |
---|
120 | ModifyImage/W=VSANS_Data#det_panelsB ''#0 ctab= {*,*,ColdWarm,0} |
---|
121 | endif |
---|
122 | MoveSubWindow/W=VSANS_Data#det_panelsB fnum=(50,239,546,710) |
---|
123 | MoveSubWindow/W=VSANS_Data#det_panelsM fnum=(320,140,430,230) |
---|
124 | MoveSubWindow/W=VSANS_Data#det_panelsF fnum=(200,140,310,230) |
---|
125 | SetDataFolder root: |
---|
126 | endif |
---|
127 | |
---|
128 | if(tab==1) |
---|
129 | //SetDataFolder root:Packages:NIST:VSANS:VCALC:Middle |
---|
130 | //Wave det_MR,det_ML,det_MB,det_MT |
---|
131 | SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_ML |
---|
132 | Wave det_ML=data |
---|
133 | SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_MR |
---|
134 | Wave det_MR=data |
---|
135 | SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_MT |
---|
136 | Wave det_MT=data |
---|
137 | SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_MB |
---|
138 | Wave det_MB=data |
---|
139 | CheckDisplayed /W=VSANS_Data#det_panelsM det_MR |
---|
140 | if(V_flag == 0) |
---|
141 | AppendImage/W=VSANS_Data#det_panelsM det_MT //order is important here to get LR on "top" of display |
---|
142 | AppendImage/W=VSANS_Data#det_panelsM det_MB |
---|
143 | AppendImage/W=VSANS_Data#det_panelsM det_ML |
---|
144 | AppendImage/W=VSANS_Data#det_panelsM det_MR |
---|
145 | // ModifyImage/W=VSANS_Data#det_panelsM det_MT ctab= {*,*,ColdWarm,0} |
---|
146 | // ModifyImage/W=VSANS_Data#det_panelsM det_MB ctab= {*,*,ColdWarm,0} |
---|
147 | // ModifyImage/W=VSANS_Data#det_panelsM det_ML ctab= {*,*,ColdWarm,0} |
---|
148 | // ModifyImage/W=VSANS_Data#det_panelsM det_MR ctab= {*,*,ColdWarm,0} |
---|
149 | ModifyImage/W=VSANS_Data#det_panelsM ''#0 ctab= {*,*,ColdWarm,0} // ''#n means act on the nth image (there are 4) |
---|
150 | ModifyImage/W=VSANS_Data#det_panelsM ''#1 ctab= {*,*,ColdWarm,0} |
---|
151 | ModifyImage/W=VSANS_Data#det_panelsM ''#2 ctab= {*,*,ColdWarm,0} |
---|
152 | ModifyImage/W=VSANS_Data#det_panelsM ''#3 ctab= {*,*,ColdWarm,0} |
---|
153 | endif |
---|
154 | MoveSubWindow/W=VSANS_Data#det_panelsM fnum=(50,239,546,710) |
---|
155 | MoveSubWindow/W=VSANS_Data#det_panelsB fnum=(440,140,550,230) |
---|
156 | MoveSubWindow/W=VSANS_Data#det_panelsF fnum=(200,140,310,230) |
---|
157 | SetDataFolder root: |
---|
158 | endif |
---|
159 | |
---|
160 | if(tab==0) |
---|
161 | //SetDataFolder root:Packages:NIST:VSANS:VCALC:Front |
---|
162 | //Wave det_FL,det_FR,det_FT,det_FB |
---|
163 | SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_FL |
---|
164 | Wave det_FL=data |
---|
165 | SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_FR |
---|
166 | Wave det_FR=data |
---|
167 | SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_FT |
---|
168 | Wave det_FT=data |
---|
169 | SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_FB |
---|
170 | Wave det_FB=data |
---|
171 | CheckDisplayed /W=VSANS_Data#det_panelsF det_FL |
---|
172 | if(V_flag == 0) |
---|
173 | AppendImage/W=VSANS_Data#det_panelsF det_FB |
---|
174 | AppendImage/W=VSANS_Data#det_panelsF det_FT |
---|
175 | AppendImage/W=VSANS_Data#det_panelsF det_FL |
---|
176 | AppendImage/W=VSANS_Data#det_panelsF det_FR |
---|
177 | // ModifyImage/W=VSANS_Data#det_panelsF det_FB ctab= {*,*,ColdWarm,0} |
---|
178 | // ModifyImage/W=VSANS_Data#det_panelsF det_FT ctab= {*,*,ColdWarm,0} |
---|
179 | // ModifyImage/W=VSANS_Data#det_panelsF det_FL ctab= {*,*,ColdWarm,0} |
---|
180 | // ModifyImage/W=VSANS_Data#det_panelsF det_FR ctab= {*,*,ColdWarm,0} |
---|
181 | ModifyImage/W=VSANS_Data#det_panelsF ''#0 ctab= {*,*,ColdWarm,0} |
---|
182 | ModifyImage/W=VSANS_Data#det_panelsF ''#1 ctab= {*,*,ColdWarm,0} |
---|
183 | ModifyImage/W=VSANS_Data#det_panelsF ''#2 ctab= {*,*,ColdWarm,0} |
---|
184 | ModifyImage/W=VSANS_Data#det_panelsF ''#3 ctab= {*,*,ColdWarm,0} |
---|
185 | endif |
---|
186 | MoveSubWindow/W=VSANS_Data#det_panelsF fnum=(50,239,546,710) |
---|
187 | MoveSubWindow/W=VSANS_Data#det_panelsB fnum=(440,140,550,230) |
---|
188 | MoveSubWindow/W=VSANS_Data#det_panelsM fnum=(320,140,430,230) |
---|
189 | SetDataFolder root: |
---|
190 | endif |
---|
191 | |
---|
192 | |
---|
193 | break |
---|
194 | case -1: // control being killed |
---|
195 | break |
---|
196 | endswitch |
---|
197 | |
---|
198 | return 0 |
---|
199 | End |
---|