1 | #pragma rtGlobals=3 // Use modern global access method and strict wave access. |
---|
2 | #pragma version=1.0 |
---|
3 | #pragma IgorVersion=6.1 |
---|
4 | |
---|
5 | // |
---|
6 | // this will become the equivalent of "RawWindowHook" |
---|
7 | // |
---|
8 | // Procedures to: |
---|
9 | // display the detector data |
---|
10 | // visualization tools |
---|
11 | // mouse interaction |
---|
12 | // status information necessary to understand the data |
---|
13 | // buttons to more functionality to process data |
---|
14 | |
---|
15 | |
---|
16 | // TODO |
---|
17 | // |
---|
18 | // -- have the status automatically fill in when a new file is loaded, rather than needing a click of the "status" button |
---|
19 | // -- need a place somewhere to show the currently displayed folder |
---|
20 | // -- checkboxes for "active" corrections? |
---|
21 | // -- display of Q, counts, QxQy, X and Y |
---|
22 | // -- do I need a color bar? or is this not used at all? I like it to be there, or the colors are a waste of information |
---|
23 | // (then... where do I put the color bar?) |
---|
24 | // -- define the "hook" function, and attach it to the panel (or the main detector subwindow?) |
---|
25 | // |
---|
26 | |
---|
27 | |
---|
28 | // |
---|
29 | // call this after loading data to either draw the data display panel or to update the contents |
---|
30 | // |
---|
31 | // TODO |
---|
32 | // -- make sure that the "type" input is correctly used for the updating of the data, values, etc. |
---|
33 | // -- add a procedure to define the global variables for pos, counts, QxQy, etc. |
---|
34 | // |
---|
35 | Proc UpdateDisplayInformation(type) |
---|
36 | String type |
---|
37 | |
---|
38 | DoWindow/F VSANS_Data |
---|
39 | // Print V_flag |
---|
40 | if(V_flag==0) |
---|
41 | |
---|
42 | VSANSDataPanelGlobals() |
---|
43 | |
---|
44 | VSANS_DataPanel() //draws the panel |
---|
45 | |
---|
46 | endif |
---|
47 | |
---|
48 | // TODO: update the information here - in either case |
---|
49 | // what isn't automatically picked up? What is "stale" on the display? |
---|
50 | String/G root:Packages:NIST:VSANS:Globals:gCurDispType = type |
---|
51 | |
---|
52 | // fake a click on all three tabs - to populate the data |
---|
53 | FakeTabClick(2) |
---|
54 | FakeTabClick(1) |
---|
55 | FakeTabClick(0) |
---|
56 | |
---|
57 | // either clear the status, or fake a click |
---|
58 | // root:Packages:NIST:VSANS:Globals:gStatusText = "status info box" |
---|
59 | |
---|
60 | FakeStatusButtonClick() |
---|
61 | |
---|
62 | |
---|
63 | // DoWindow/T VSANS_Data,type + " VSANS_Data" |
---|
64 | |
---|
65 | String newTitle = "WORK_"+type |
---|
66 | DoWindow/F VSANS_Data |
---|
67 | DoWindow/T VSANS_Data, newTitle |
---|
68 | KillStrings/Z newTitle |
---|
69 | |
---|
70 | end |
---|
71 | |
---|
72 | // |
---|
73 | // creates/initializes the globals for display of the data panel |
---|
74 | // |
---|
75 | Function VSANSDataPanelGlobals() |
---|
76 | |
---|
77 | SetDataFolder root:Packages:NIST:VSANS:Globals |
---|
78 | |
---|
79 | Variable/G gXPos=0 |
---|
80 | Variable/G gYPos=0 |
---|
81 | Variable/G gQX=0 |
---|
82 | Variable/G gQY=0 |
---|
83 | Variable/G gQQ=0 |
---|
84 | Variable/G gNCounts=0 |
---|
85 | String/G gCurDispFile = "default string" |
---|
86 | String/G gCurTitle = "" |
---|
87 | String/G gCurDispType = "" |
---|
88 | String/G gStatusText = "status info box" |
---|
89 | |
---|
90 | SetDataFolder root: |
---|
91 | End |
---|
92 | |
---|
93 | // TODO |
---|
94 | // |
---|
95 | // -- fill in the proper window title in the DoWindow/T command |
---|
96 | // -- add help text for all of the controls |
---|
97 | // |
---|
98 | Window VSANS_DataPanel() : Panel |
---|
99 | PauseUpdate; Silent 1 // building window... |
---|
100 | NewPanel /W=(37,45,1038,719) /N=VSANS_Data |
---|
101 | // ShowTools/A |
---|
102 | ModifyPanel cbRGB=(65535,60076,49151) |
---|
103 | |
---|
104 | String curFolder = root:Packages:NIST:VSANS:Globals:gCurDispType |
---|
105 | DoWindow/T VSANS_Data,curFolder + " VSANS_Data" |
---|
106 | SetWindow VSANS_Data,hook(dataHook)=VSANSDataHook,hookevents=2 |
---|
107 | |
---|
108 | SetDrawLayer UserBack |
---|
109 | SetDrawEnv linethick= 2,dash= 1,fillpat= 0 |
---|
110 | DrawRect 200,70,310,160 |
---|
111 | SetDrawEnv linethick= 2,dash= 1,fillpat= 0 |
---|
112 | DrawRect 320,70,430,160 |
---|
113 | SetDrawEnv linethick= 2,dash= 1,fillpat= 0 |
---|
114 | DrawRect 440,70,550,160 |
---|
115 | |
---|
116 | SetDrawEnv fsize= 18 |
---|
117 | DrawText 230,115,"Front" |
---|
118 | SetDrawEnv fsize= 18 |
---|
119 | DrawText 348,115,"Middle" |
---|
120 | SetDrawEnv fsize= 18 |
---|
121 | DrawText 476,115,"Back" |
---|
122 | |
---|
123 | ToolsGrid visible=1 |
---|
124 | |
---|
125 | |
---|
126 | TabControl tab0,pos={13,41},size={572,617},proc=VDataTabProc,tabLabel(0)="Front" |
---|
127 | TabControl tab0,tabLabel(1)="Middle",tabLabel(2)="Back",value= 2 |
---|
128 | |
---|
129 | // on the side |
---|
130 | Button button_status,pos={607,146},size={70,20},proc=StatusButtonProc,title="Status" |
---|
131 | Button button_IvsQ,pos={689,113},size={70,20},proc=IvsQPanelButtonProc,title="I vs. Q" |
---|
132 | Button button_file_m,pos={619,55},size={50,20},proc=File_minus_ButtonProc,title="File <" |
---|
133 | Button button_file_p,pos={679,55},size={50,20},proc=File_plus_ButtonProc,title="File >" |
---|
134 | Button button_log,pos={689,146},size={70,20},proc=LogLinButtonProc,title="isLin",userData="0" |
---|
135 | Button button_tab_p,pos={648,81},size={50,20},proc=Tab_p_ButtonProc,title="Tab >" |
---|
136 | Button button_isolate,pos={606,114},size={70,20},proc=IsolateButtonProc,title="Isolate" |
---|
137 | |
---|
138 | TitleBox title_file,pos={606,178},size={76,20},variable= file_name |
---|
139 | TitleBox title_dataPresent,pos={606,210},size={76,20},variable= root:Packages:NIST:VSANS:Globals:gCurDispFile |
---|
140 | TitleBox title_status,pos={606,240},size={200,200},variable= root:Packages:NIST:VSANS:Globals:gStatusText |
---|
141 | |
---|
142 | Button button_tagFile,pos={603,412},size={70,20},proc=TagFileButtonProc,title="Tag File" |
---|
143 | Button button_BeamCtr,pos={603,450},size={70,20},proc=BeamCtrButtonProc,title="Beam Ctr" |
---|
144 | Button button_SpreadPanels,pos={603,488},size={100,20},proc=SpreadPanelButtonProc,title="Spread Panels" |
---|
145 | Button button_RestorePanels,pos={603,526},size={100,20},proc=RestorePanelButtonProc,title="Restore Panels" |
---|
146 | |
---|
147 | // on the tabs, always visible |
---|
148 | TitleBox title_xy,pos={24,71},size={76,20},variable= file_name |
---|
149 | Slider slider_hi,pos={558,224},size={16,80},proc=HiMapSliderProc |
---|
150 | Slider slider_hi,limits={0,1,0},value= 1,ticks= 0 |
---|
151 | Slider slider_lo,pos={558,315},size={16,80},proc=LowMapSliderProc |
---|
152 | Slider slider_lo,limits={0,1,0},value= 0,ticks= 0 |
---|
153 | |
---|
154 | SetVariable xpos,pos={22,97},size={50,17},title="X " |
---|
155 | SetVariable xpos,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:gXPos |
---|
156 | SetVariable xpos,help={"x-position on the detector"},frame=0,noedit=1 |
---|
157 | SetVariable ypos,pos={22,121},size={50,17},title="Y " |
---|
158 | SetVariable ypos,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:gYPos |
---|
159 | SetVariable ypos,help={"y-position on the detector"},frame=0,noedit=1 |
---|
160 | SetVariable counts,pos={22,151},size={150,17},title="Counts " |
---|
161 | SetVariable counts,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:gNCounts |
---|
162 | SetVariable counts,help={"Neutron counts"},frame=0,noedit=1 |
---|
163 | SetVariable qxval,pos={83,94},size={85,17},title="qX" |
---|
164 | SetVariable qxval,help={"q value in the x-direction on the detector"},frame=0,noedit=1 |
---|
165 | SetVariable qxval,format="%+7.5f",limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:gQX |
---|
166 | SetVariable qyval,pos={83,113},size={85,17},title="qY" |
---|
167 | SetVariable qyval,help={"q value in the y-direction on the detector"},frame=0,noedit=1 |
---|
168 | SetVariable qyval,format="%+7.5f",limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:gQY |
---|
169 | SetVariable q_pos,pos={83,132},size={85,17},title="q " |
---|
170 | SetVariable q_pos,help={"q-value on the detector at (x,y)"},format="%+7.5f" |
---|
171 | SetVariable q_pos,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:gQQ,frame=0,noedit=1 |
---|
172 | |
---|
173 | Make/O/D tmp_asdf |
---|
174 | // for back panels (in pixels?) |
---|
175 | // Display/W=(50,185,545,620)/HOST=# tmp_asdf |
---|
176 | Display/W=(50,185,517,620)/HOST=# tmp_asdf |
---|
177 | RenameWindow #,det_panelsB |
---|
178 | ModifyGraph mode=2 // mode = 2 = dots |
---|
179 | ModifyGraph marker=19 |
---|
180 | ModifyGraph rgb=(0,0,0) |
---|
181 | ModifyGraph tick=2,mirror=1 |
---|
182 | Label left "pixels" |
---|
183 | Label bottom "pixels" |
---|
184 | SetActiveSubwindow ## |
---|
185 | |
---|
186 | // for middle panels (in pixels?) |
---|
187 | Display/W=(50,185,517,620)/HOST=# tmp_asdf |
---|
188 | RenameWindow #,det_panelsM |
---|
189 | ModifyGraph mode=2 // mode = 2 = dots |
---|
190 | ModifyGraph marker=19 |
---|
191 | ModifyGraph rgb=(0,0,0) |
---|
192 | ModifyGraph tick=2,mirror=1 |
---|
193 | Label left "pixels" |
---|
194 | Label bottom "pixels" |
---|
195 | SetActiveSubwindow ## |
---|
196 | |
---|
197 | // for front panels (in pixels?) |
---|
198 | Display/W=(50,185,517,620)/HOST=# tmp_asdf |
---|
199 | RenameWindow #,det_panelsF |
---|
200 | ModifyGraph mode=2 // mode = 2 = dots |
---|
201 | ModifyGraph marker=19 |
---|
202 | ModifyGraph rgb=(0,0,0) |
---|
203 | ModifyGraph tick=2,mirror=1 |
---|
204 | Label left "pixels" |
---|
205 | Label bottom "pixels" |
---|
206 | SetActiveSubwindow ## |
---|
207 | |
---|
208 | EndMacro |
---|
209 | |
---|
210 | // |
---|
211 | // event code 4 = mouse moved |
---|
212 | // |
---|
213 | // mouse moved is the only event that I really care about for the data display. |
---|
214 | // |
---|
215 | // TODO |
---|
216 | // -- figure out how to respond only to events in the main window |
---|
217 | // -- figure out which is the correct image to respond "from" |
---|
218 | // |
---|
219 | Function VSANSDataHook(s) |
---|
220 | STRUCT WMWinHookStruct &s |
---|
221 | |
---|
222 | Variable hookResult = 0 |
---|
223 | |
---|
224 | switch(s.eventCode) |
---|
225 | case 0: // Activate |
---|
226 | // Handle activate |
---|
227 | // Print "Activate" |
---|
228 | break |
---|
229 | |
---|
230 | case 1: // Deactivate |
---|
231 | // Handle deactivate |
---|
232 | break |
---|
233 | |
---|
234 | case 3: //mouse down |
---|
235 | // Print "mouse down" |
---|
236 | // |
---|
237 | // TODO (Way in the future -- I could make the small graphs into "buttons" by responding to a "mouse up" (not down) |
---|
238 | // that hits in one of the small graph areas, and treat that as a click on that tab |
---|
239 | // |
---|
240 | break |
---|
241 | |
---|
242 | case 4: // mouse moved |
---|
243 | NVAR xloc = root:Packages:NIST:VSANS:Globals:gXPos |
---|
244 | NVAR yloc = root:Packages:NIST:VSANS:Globals:gYPos |
---|
245 | NVAR gQX = root:Packages:NIST:VSANS:Globals:gQX |
---|
246 | NVAR gQY = root:Packages:NIST:VSANS:Globals:gQY |
---|
247 | NVAR gQQ = root:Packages:NIST:VSANS:Globals:gQQ |
---|
248 | NVAR gNCounts = root:Packages:NIST:VSANS:Globals:gNCounts |
---|
249 | SVAR gCurDispFile = root:Packages:NIST:VSANS:Globals:gCurDispFile |
---|
250 | SVAR gCurDispType = root:Packages:NIST:VSANS:Globals:gCurDispType //the current folder |
---|
251 | Variable xaxval,yaxval,tab |
---|
252 | |
---|
253 | // is the mouse location within the "main" display window? |
---|
254 | // if so, do something, if not, do nothing? |
---|
255 | // right now, the "main" display is at (50,185,545,620). its name depends on the active tab |
---|
256 | |
---|
257 | // xloc = s.mouseLoc.h |
---|
258 | // yloc = s.mouseLoc.v |
---|
259 | |
---|
260 | // if out of bounds, exit now |
---|
261 | // TODO - currently the values are hard-wired. eliminate this later if the size of the graph changes |
---|
262 | if(s.mouseLoc.h < 50 || s.mouseLoc.h > 545 || s.mouseLoc.v < 185 || s.mouseLoc.v > 620) |
---|
263 | break |
---|
264 | endif |
---|
265 | |
---|
266 | // if(in bounds) |
---|
267 | // get the point location |
---|
268 | // update the globals -- |
---|
269 | // but which data instance am I pointing to? |
---|
270 | // deduce the carriage and panel, and calculate Q |
---|
271 | // endif |
---|
272 | |
---|
273 | GetWindow $s.winName activeSW |
---|
274 | String activeSubwindow = S_value // returns something like: "VSANS_Data#det_panelsF" |
---|
275 | |
---|
276 | xaxval= AxisValFromPixel("","bottom",s.mouseLoc.h) |
---|
277 | yaxval= AxisValFromPixel("","left",s.mouseLoc.v) |
---|
278 | xloc = round(xaxval) |
---|
279 | yloc = round(yaxval) |
---|
280 | |
---|
281 | // which tab is selected? -this is the main graph panel (subwindow may not be the active one!) |
---|
282 | ControlInfo/W=VSANS_Data tab0 |
---|
283 | tab = V_Value |
---|
284 | if(tab == 0) |
---|
285 | activeSubwindow = "VSANS_Data#det_panelsF" |
---|
286 | elseif (tab == 1) |
---|
287 | activeSubwindow = "VSANS_Data#det_panelsM" |
---|
288 | else |
---|
289 | activeSubwindow = "VSANS_Data#det_panelsB" |
---|
290 | endif |
---|
291 | |
---|
292 | // which images are here? |
---|
293 | String detStr="",imStr,carriageStr |
---|
294 | String currentImageRef |
---|
295 | String imageList = ImageNameList(activeSubwindow,";") |
---|
296 | Variable ii,nIm,testX,testY,xctr,yctr,sdd,lam,pixSizeX,pixSizeY |
---|
297 | nIm = ItemsInList(imageList,";") |
---|
298 | gCurDispFile = imageList |
---|
299 | if(nIm==0) |
---|
300 | break //problem, get out |
---|
301 | endif |
---|
302 | |
---|
303 | // images were added in the order TBLR, so look back through in the order RLBT, checking each to see if |
---|
304 | // the xy value is found on that (scaled) array |
---|
305 | |
---|
306 | // loop backwards through the list of panels (may only be one if on the back) |
---|
307 | for(ii=nIm-1;ii>=0;ii-=1) |
---|
308 | Wave w = ImageNameToWaveRef(activeSubwindow,StringFromList(ii, imageList,";")) |
---|
309 | |
---|
310 | // which, if any image is the mouse xy location on? |
---|
311 | // use a multidemensional equivalent to x2pnt: (ScaledDimPos - DimOffset(waveName, dim))/DimDelta(waveName,dim) |
---|
312 | testX = trunc( (xloc - DimOffset(w,0))/DimDelta(w,0) ) |
---|
313 | testY = trunc( (yloc - DimOffset(w,1))/DimDelta(w,1) ) |
---|
314 | |
---|
315 | if( (testX > 0 && testX < DimSize(w,0)) && (testY > 0 && testY < DimSize(w,1)) ) |
---|
316 | // we're in-bounds on this wave |
---|
317 | |
---|
318 | // count value to the global |
---|
319 | gNCounts = w[testX][testY] |
---|
320 | |
---|
321 | // deduce the detector panel |
---|
322 | currentImageRef = StringFromList(ii, imageList,";") //the image instance ## |
---|
323 | // string is "data", or "data#2" etc. - so this returns "", "1", "2", or "3" |
---|
324 | imStr = StringFromList(1, currentImageRef,"#") |
---|
325 | carriageStr = activeSubWindow[strlen(activeSubWindow)-1] |
---|
326 | |
---|
327 | if(cmpstr(carriageStr,"B")==0) |
---|
328 | detStr = carriageStr |
---|
329 | else |
---|
330 | if(strlen(imStr)==0) |
---|
331 | imStr = "9" // a dummy value so I can replace it later |
---|
332 | endif |
---|
333 | detStr = carriageStr+imStr // "F2" or something similar |
---|
334 | detStr = ReplaceString("9", detStr, "T") // ASSUMPTION :::: instances 0123 correspond to TBLR |
---|
335 | detStr = ReplaceString("1", detStr, "B") // ASSUMPTION :::: this is the order that the panels |
---|
336 | detStr = ReplaceString("2", detStr, "L") // ASSUMPTION :::: are ALWAYS added to the graph |
---|
337 | detStr = ReplaceString("3", detStr, "R") // ASSUMPTION :::: |
---|
338 | endif |
---|
339 | gCurDispFile = detStr |
---|
340 | |
---|
341 | // now figure out q |
---|
342 | // calculate the q-values, will be different depending on which panel is up (pixel size, geometry, etc.) |
---|
343 | // TODO: !!!! get rid of the hard-wired values |
---|
344 | // TODO: be sure that the units from HDF are what I expect |
---|
345 | // TODO: beam center XY are pixels in the file, expected in the function, but are better suited for mm or cm |
---|
346 | // TODO: units of xy pixel size are likely wrong |
---|
347 | // xctr = V_getDet_beam_center_x(gCurDispType,detStr) //written in pixels |
---|
348 | // yctr = V_getDet_beam_center_y(gCurDispType,detStr) |
---|
349 | xctr = V_getDet_beam_center_x_mm(gCurDispType,detStr) //written in mm |
---|
350 | yctr = V_getDet_beam_center_y_mm(gCurDispType,detStr) |
---|
351 | |
---|
352 | sdd = V_getDet_distance(gCurDispType,detStr) / 100 //written in cm, pass in meters |
---|
353 | lam = V_getVSWavelength(gCurDispType) //A |
---|
354 | // pixSizeX = V_getDet_x_pixel_size(gCurDispType,detStr) // written mm? need mm |
---|
355 | // pixSizeY = V_getDet_y_pixel_size(gCurDispType,detStr) // written mm? need mm |
---|
356 | // |
---|
357 | // TODO: these q-values ignore the non-linear corrections!!! |
---|
358 | // -- What can I do about this? |
---|
359 | String destPath = "root:Packages:NIST:VSANS:"+gCurDispType |
---|
360 | Wave data_realDistX = $(destPath + ":entry:instrument:detector_"+detStr+":data_realDistX") |
---|
361 | Wave data_realDistY = $(destPath + ":entry:instrument:detector_"+detStr+":data_realDistY") |
---|
362 | |
---|
363 | // TODO: figure out what coordinates I need to pass -- xloc, yloc, textX, testY, (+1 on any?) |
---|
364 | //gQQ = VC_CalcQval(testX,testY,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) |
---|
365 | //gQX = VC_CalcQX(testX,testY,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) |
---|
366 | //gQY = VC_CalcQY(testX,testY,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) |
---|
367 | gQQ = V_CalcQval(testX,testY,xctr,yctr,sdd,lam,data_realDistX,data_realDistY) |
---|
368 | gQX = V_CalcQX(testX,testY,xctr,yctr,sdd,lam,data_realDistX,data_realDistY) |
---|
369 | gQY = V_CalcQY(testX,testY,xctr,yctr,sdd,lam,data_realDistX,data_realDistY) |
---|
370 | |
---|
371 | ii = -1 //look no further, set ii to bad value to exit the for loop |
---|
372 | endif //end if(mouse is over a detector panel) |
---|
373 | endfor // end loop over list of displayed images |
---|
374 | |
---|
375 | break |
---|
376 | |
---|
377 | // And so on . . . |
---|
378 | endswitch |
---|
379 | |
---|
380 | return hookResult // 0 if nothing done, else 1 |
---|
381 | End |
---|
382 | |
---|
383 | // |
---|
384 | //lots to to here: |
---|
385 | // |
---|
386 | // - 1 - display the appropriate controls for each tab, and hide the others |
---|
387 | // - 2 - display the correct detector data for each tab, and remove the others from the graph |
---|
388 | // -----?? can I draw 3 graphs, and just put the right one on top?? move the other two to the side? |
---|
389 | // |
---|
390 | // |
---|
391 | // TODO |
---|
392 | // -- add all of the controls of the VCALC panel (log scaling, adjusting the axes, etc.) |
---|
393 | // x- get the panel to be correctly populated first, rather than needing to click everywhere to fill in |
---|
394 | // x- remove the dependency on VCALC being initialized first, and using dummy waves from there... |
---|
395 | // |
---|
396 | // -- can I use "ReplaceWave" to do this? |
---|
397 | Function VDataTabProc(tca) : TabControl |
---|
398 | STRUCT WMTabControlAction &tca |
---|
399 | |
---|
400 | switch( tca.eventCode ) |
---|
401 | case 2: // mouse up |
---|
402 | Variable tab = tca.tab |
---|
403 | |
---|
404 | // SetDataFolder root:Packages:NIST:VSANS:VCALC |
---|
405 | SetDataFolder root: |
---|
406 | RemoveFromGraph/Z /W=VSANS_Data#det_panelsB tmp_asdf |
---|
407 | RemoveFromGraph/Z /W=VSANS_Data#det_panelsM tmp_asdf |
---|
408 | RemoveFromGraph/Z /W=VSANS_Data#det_panelsF tmp_asdf |
---|
409 | SetDataFolder root: |
---|
410 | |
---|
411 | SVAR dataType = root:Packages:NIST:VSANS:Globals:gCurDispType |
---|
412 | // make sure log scaling is correct |
---|
413 | NVAR state = root:Packages:NIST:VSANS:Globals:gIsLogScale |
---|
414 | if(State == 0) |
---|
415 | // lookup wave |
---|
416 | Wave LookupWave = root:Packages:NIST:VSANS:Globals:linearLookupWave |
---|
417 | else |
---|
418 | // lookup wave - the linear version |
---|
419 | Wave LookupWave = root:Packages:NIST:VSANS:Globals:logLookupWave |
---|
420 | endif |
---|
421 | |
---|
422 | |
---|
423 | //************ |
---|
424 | // -- can I use "ReplaceWave/W=VSANS_Data#det_panelsB allinCDF" to do this? |
---|
425 | // -- only works for "B", since for M and F panels, all 4 data sets are named "data" |
---|
426 | // in their respective folders... |
---|
427 | |
---|
428 | String tmpStr |
---|
429 | Variable ii |
---|
430 | if(tab==2) |
---|
431 | tmpStr = ImageNameList("VSANS_Data#det_panelsB",";") |
---|
432 | // for some odd reason, it appears that I need to work from the back of the list |
---|
433 | // since the traces get "renumbered" as I take them off !! A do loop may be a better choice |
---|
434 | if(ItemsInList(tmpStr) > 0) |
---|
435 | do |
---|
436 | RemoveImage /W=VSANS_Data#det_panelsB $(StringFromList(0,tmpStr,";")) //get 1st item |
---|
437 | tmpStr = ImageNameList("VSANS_Data#det_panelsB",";") //refresh list |
---|
438 | while(ItemsInList(tmpStr) > 0) |
---|
439 | endif |
---|
440 | |
---|
441 | SetDataFolder $("root:Packages:NIST:VSANS:"+dataType+":entry:instrument:detector_B") |
---|
442 | Wave det_B=data |
---|
443 | |
---|
444 | CheckDisplayed /W=VSANS_Data#det_panelsB det_B |
---|
445 | if(V_flag == 0) // 0 == data is not displayed, so append it |
---|
446 | AppendImage/W=VSANS_Data#det_panelsB det_B |
---|
447 | ModifyImage/W=VSANS_Data#det_panelsB ''#0 ctab= {*,*,ColdWarm,0} |
---|
448 | endif |
---|
449 | MoveSubWindow/W=VSANS_Data#det_panelsB fnum=(50,185,517,620) |
---|
450 | MoveSubWindow/W=VSANS_Data#det_panelsM fnum=(320,70,430,160) |
---|
451 | MoveSubWindow/W=VSANS_Data#det_panelsF fnum=(200,70,310,160) |
---|
452 | |
---|
453 | ModifyImage/W=VSANS_Data#det_panelsB ''#0 ctabAutoscale=0,lookup= LookupWave |
---|
454 | |
---|
455 | // make the plot square |
---|
456 | ModifyGraph/W=VSANS_Data#det_panelsB width={Aspect,1} |
---|
457 | |
---|
458 | SetActiveSubWindow VSANS_Data#det_panelsB |
---|
459 | SetDataFolder root: |
---|
460 | endif |
---|
461 | |
---|
462 | if(tab==1) |
---|
463 | tmpStr = ImageNameList("VSANS_Data#det_panelsM",";") |
---|
464 | // for some odd reason, it appears that I need to work from the back of the list |
---|
465 | // since the traces get "renumbered" as I take them off !! A do loop may be a better choice |
---|
466 | if(ItemsInList(tmpStr) > 0) |
---|
467 | do |
---|
468 | RemoveImage /W=VSANS_Data#det_panelsM $(StringFromList(0,tmpStr,";")) //get 1st item |
---|
469 | tmpStr = ImageNameList("VSANS_Data#det_panelsM",";") //refresh list |
---|
470 | while(ItemsInList(tmpStr) > 0) |
---|
471 | endif |
---|
472 | |
---|
473 | SetDataFolder $("root:Packages:NIST:VSANS:"+dataType+":entry:instrument:detector_ML") |
---|
474 | Wave det_ML=data |
---|
475 | SetDataFolder $("root:Packages:NIST:VSANS:"+dataType+":entry:instrument:detector_MR") |
---|
476 | Wave det_MR=data |
---|
477 | SetDataFolder $("root:Packages:NIST:VSANS:"+dataType+":entry:instrument:detector_MT") |
---|
478 | Wave det_MT=data |
---|
479 | SetDataFolder $("root:Packages:NIST:VSANS:"+dataType+":entry:instrument:detector_MB") |
---|
480 | Wave det_MB=data |
---|
481 | |
---|
482 | CheckDisplayed /W=VSANS_Data#det_panelsM det_MR |
---|
483 | if(V_flag == 0) |
---|
484 | AppendImage/W=VSANS_Data#det_panelsM det_MT //order is important here to get LR on "top" of display |
---|
485 | AppendImage/W=VSANS_Data#det_panelsM det_MB |
---|
486 | AppendImage/W=VSANS_Data#det_panelsM det_ML |
---|
487 | AppendImage/W=VSANS_Data#det_panelsM det_MR |
---|
488 | ModifyImage/W=VSANS_Data#det_panelsM ''#0 ctab= {*,*,ColdWarm,0} // ''#n means act on the nth image (there are 4) |
---|
489 | ModifyImage/W=VSANS_Data#det_panelsM ''#1 ctab= {*,*,ColdWarm,0} |
---|
490 | ModifyImage/W=VSANS_Data#det_panelsM ''#2 ctab= {*,*,ColdWarm,0} |
---|
491 | ModifyImage/W=VSANS_Data#det_panelsM ''#3 ctab= {*,*,ColdWarm,0} |
---|
492 | endif |
---|
493 | MoveSubWindow/W=VSANS_Data#det_panelsM fnum=(50,185,517,620) |
---|
494 | MoveSubWindow/W=VSANS_Data#det_panelsB fnum=(440,70,550,160) |
---|
495 | MoveSubWindow/W=VSANS_Data#det_panelsF fnum=(200,70,310,160) |
---|
496 | |
---|
497 | ModifyImage/W=VSANS_Data#det_panelsM ''#0 ctabAutoscale=0,lookup= LookupWave |
---|
498 | ModifyImage/W=VSANS_Data#det_panelsM ''#1 ctabAutoscale=0,lookup= LookupWave |
---|
499 | ModifyImage/W=VSANS_Data#det_panelsM ''#2 ctabAutoscale=0,lookup= LookupWave |
---|
500 | ModifyImage/W=VSANS_Data#det_panelsM ''#3 ctabAutoscale=0,lookup= LookupWave |
---|
501 | |
---|
502 | // make the plot square |
---|
503 | ModifyGraph/W=VSANS_Data#det_panelsM width={Aspect,1} |
---|
504 | |
---|
505 | SetActiveSubWindow VSANS_Data#det_panelsM |
---|
506 | SetDataFolder root: |
---|
507 | endif |
---|
508 | |
---|
509 | if(tab==0) |
---|
510 | tmpStr = ImageNameList("VSANS_Data#det_panelsF",";") |
---|
511 | // for some odd reason, it appears that I need to work from the back of the list |
---|
512 | // since the traces get "renumbered" as I take them off !! A do loop may be a better choice |
---|
513 | if(ItemsInList(tmpStr) > 0) |
---|
514 | do |
---|
515 | RemoveImage /W=VSANS_Data#det_panelsF $(StringFromList(0,tmpStr,";")) //get 1st item |
---|
516 | tmpStr = ImageNameList("VSANS_Data#det_panelsF",";") //refresh list |
---|
517 | while(ItemsInList(tmpStr) > 0) |
---|
518 | endif |
---|
519 | |
---|
520 | SetDataFolder $("root:Packages:NIST:VSANS:"+dataType+":entry:instrument:detector_FL") |
---|
521 | Wave det_FL=data |
---|
522 | SetDataFolder $("root:Packages:NIST:VSANS:"+dataType+":entry:instrument:detector_FR") |
---|
523 | Wave det_FR=data |
---|
524 | SetDataFolder $("root:Packages:NIST:VSANS:"+dataType+":entry:instrument:detector_FT") |
---|
525 | Wave det_FT=data |
---|
526 | SetDataFolder $("root:Packages:NIST:VSANS:"+dataType+":entry:instrument:detector_FB") |
---|
527 | Wave det_FB=data |
---|
528 | |
---|
529 | CheckDisplayed /W=VSANS_Data#det_panelsF det_FL |
---|
530 | if(V_flag == 0) |
---|
531 | AppendImage/W=VSANS_Data#det_panelsF det_FT |
---|
532 | AppendImage/W=VSANS_Data#det_panelsF det_FB |
---|
533 | AppendImage/W=VSANS_Data#det_panelsF det_FL |
---|
534 | AppendImage/W=VSANS_Data#det_panelsF det_FR |
---|
535 | ModifyImage/W=VSANS_Data#det_panelsF ''#0 ctab= {*,*,ColdWarm,0} |
---|
536 | ModifyImage/W=VSANS_Data#det_panelsF ''#1 ctab= {*,*,ColdWarm,0} |
---|
537 | ModifyImage/W=VSANS_Data#det_panelsF ''#2 ctab= {*,*,ColdWarm,0} |
---|
538 | ModifyImage/W=VSANS_Data#det_panelsF ''#3 ctab= {*,*,ColdWarm,0} |
---|
539 | endif |
---|
540 | MoveSubWindow/W=VSANS_Data#det_panelsF fnum=(50,185,517,620) |
---|
541 | MoveSubWindow/W=VSANS_Data#det_panelsB fnum=(440,70,550,160) |
---|
542 | MoveSubWindow/W=VSANS_Data#det_panelsM fnum=(320,70,430,160) |
---|
543 | |
---|
544 | ModifyImage/W=VSANS_Data#det_panelsF ''#0 ctabAutoscale=0,lookup= LookupWave |
---|
545 | ModifyImage/W=VSANS_Data#det_panelsF ''#1 ctabAutoscale=0,lookup= LookupWave |
---|
546 | ModifyImage/W=VSANS_Data#det_panelsF ''#2 ctabAutoscale=0,lookup= LookupWave |
---|
547 | ModifyImage/W=VSANS_Data#det_panelsF ''#3 ctabAutoscale=0,lookup= LookupWave |
---|
548 | |
---|
549 | // make the plot square |
---|
550 | ModifyGraph/W=VSANS_Data#det_panelsF width={Aspect,1} |
---|
551 | |
---|
552 | SetActiveSubWindow VSANS_Data#det_panelsF |
---|
553 | SetDataFolder root: |
---|
554 | endif |
---|
555 | |
---|
556 | |
---|
557 | break |
---|
558 | case -1: // control being killed |
---|
559 | break |
---|
560 | endswitch |
---|
561 | |
---|
562 | return 0 |
---|
563 | End |
---|
564 | |
---|
565 | // fake restore panels button click |
---|
566 | Function FakeRestorePanelsButtonClick() |
---|
567 | |
---|
568 | STRUCT WMButtonAction ba |
---|
569 | ba.eventCode = 2 |
---|
570 | RestorePanelButtonProc(ba) |
---|
571 | |
---|
572 | return(0) |
---|
573 | End |
---|
574 | |
---|
575 | |
---|
576 | // fake status button click |
---|
577 | Function FakeStatusButtonClick() |
---|
578 | |
---|
579 | STRUCT WMButtonAction ba |
---|
580 | ba.eventCode = 2 |
---|
581 | StatusButtonProc(ba) |
---|
582 | |
---|
583 | return(0) |
---|
584 | End |
---|
585 | |
---|
586 | // fake click on each tab to populate the data |
---|
587 | Function FakeTabClick(tab) |
---|
588 | Variable tab |
---|
589 | |
---|
590 | STRUCT WMTabControlAction tca |
---|
591 | |
---|
592 | tca.eventCode = 2 //fake mouse up |
---|
593 | tca.tab = tab |
---|
594 | VDataTabProc(tca) |
---|
595 | |
---|
596 | TabControl tab0,win=VSANS_Data,value= tab //select the proper tab |
---|
597 | return(0) |
---|
598 | End |
---|
599 | |
---|
600 | // TODO |
---|
601 | // |
---|
602 | // move one file number back |
---|
603 | // |
---|
604 | Function File_minus_ButtonProc(ba) : ButtonControl |
---|
605 | STRUCT WMButtonAction &ba |
---|
606 | |
---|
607 | switch( ba.eventCode ) |
---|
608 | case 2: // mouse up |
---|
609 | // click code here |
---|
610 | V_LoadPlotAndDisplayRAW(-1) |
---|
611 | |
---|
612 | break |
---|
613 | case -1: // control being killed |
---|
614 | break |
---|
615 | endswitch |
---|
616 | |
---|
617 | return 0 |
---|
618 | End |
---|
619 | |
---|
620 | // TODO |
---|
621 | // |
---|
622 | // move one file number forward |
---|
623 | // |
---|
624 | Function File_plus_ButtonProc(ba) : ButtonControl |
---|
625 | STRUCT WMButtonAction &ba |
---|
626 | |
---|
627 | switch( ba.eventCode ) |
---|
628 | case 2: // mouse up |
---|
629 | // click code here |
---|
630 | V_LoadPlotAndDisplayRAW(1) |
---|
631 | |
---|
632 | break |
---|
633 | case -1: // control being killed |
---|
634 | break |
---|
635 | endswitch |
---|
636 | |
---|
637 | return 0 |
---|
638 | End |
---|
639 | |
---|
640 | // |
---|
641 | // button that mimics a click on the tab, cycling through the tabs 0->1->2->0 etc. |
---|
642 | // only goes one direction |
---|
643 | // |
---|
644 | Function Tab_p_ButtonProc(ba) : ButtonControl |
---|
645 | STRUCT WMButtonAction &ba |
---|
646 | |
---|
647 | switch( ba.eventCode ) |
---|
648 | case 2: // mouse up |
---|
649 | // click code here |
---|
650 | ControlInfo/W=VSANS_Data tab0 |
---|
651 | |
---|
652 | V_Value += 1 |
---|
653 | if(V_Value == 3) |
---|
654 | V_Value = 0 //reset to 0 |
---|
655 | endif |
---|
656 | FakeTabClick(V_Value) |
---|
657 | |
---|
658 | // update the status when the tab is clicked |
---|
659 | STRUCT WMButtonAction sa |
---|
660 | sa.eventCode = 2 |
---|
661 | StatusButtonProc(sa) |
---|
662 | |
---|
663 | break |
---|
664 | case -1: // control being killed |
---|
665 | break |
---|
666 | endswitch |
---|
667 | |
---|
668 | return 0 |
---|
669 | End |
---|
670 | |
---|
671 | // TODO |
---|
672 | // |
---|
673 | // isolates a single panel to allow a better view of the details |
---|
674 | // useful for T/B panels which are partially blocked from view |
---|
675 | // |
---|
676 | // will open a separate graph or panel to display the selected detector |
---|
677 | // (lots to do here, depending what is necessary for instrument troubleshooting) |
---|
678 | // - like being able to turn corrections on/off and view with different axes (pix, mm, Q) |
---|
679 | // |
---|
680 | Function IsolateButtonProc(ba) : ButtonControl |
---|
681 | STRUCT WMButtonAction &ba |
---|
682 | |
---|
683 | switch( ba.eventCode ) |
---|
684 | case 2: // mouse up |
---|
685 | // click code here |
---|
686 | break |
---|
687 | case -1: // control being killed |
---|
688 | break |
---|
689 | endswitch |
---|
690 | |
---|
691 | return 0 |
---|
692 | End |
---|
693 | |
---|
694 | // TODO |
---|
695 | // |
---|
696 | // opens a separate panel with the I(q) representation of the data |
---|
697 | // ? controls here to select how the data is processed/grouped/saved, etc. |
---|
698 | // |
---|
699 | Function IvsQPanelButtonProc(ba) : ButtonControl |
---|
700 | STRUCT WMButtonAction &ba |
---|
701 | |
---|
702 | switch( ba.eventCode ) |
---|
703 | case 2: // mouse up |
---|
704 | // click code here |
---|
705 | |
---|
706 | V_PlotData_Panel() |
---|
707 | |
---|
708 | break |
---|
709 | case -1: // control being killed |
---|
710 | break |
---|
711 | endswitch |
---|
712 | |
---|
713 | return 0 |
---|
714 | End |
---|
715 | |
---|
716 | // TODO |
---|
717 | // |
---|
718 | // gets the status of the currently displayed file and dumps it to the panel (not the cmd window) |
---|
719 | // - lots to decide here about what is the important stuff to display. There's a lot more information for VSANS |
---|
720 | // |
---|
721 | Function StatusButtonProc(ba) : ButtonControl |
---|
722 | STRUCT WMButtonAction &ba |
---|
723 | |
---|
724 | switch( ba.eventCode ) |
---|
725 | case 2: // mouse up |
---|
726 | // click code here |
---|
727 | |
---|
728 | // figure out wether to display per carraige, or the whole file |
---|
729 | SVAR str = root:Packages:NIST:VSANS:Globals:gStatusText |
---|
730 | SVAR type = root:Packages:NIST:VSANS:Globals:gCurDispType //what folder |
---|
731 | // which tab active |
---|
732 | ControlInfo/W=VSANS_Data tab0 |
---|
733 | Variable curTab = V_value |
---|
734 | |
---|
735 | str = "Current data is from "+ type + "\r" |
---|
736 | str += "Description = "+V_getSampleDescription(type) + "\r" |
---|
737 | str += "Wavelength is "+num2str(V_getWavelength(type)) + " A \r" |
---|
738 | if(curTab == 2) |
---|
739 | str += "SDD B = "+num2str(V_getDet_distance(type,"B")) + " cm \r" //V_getDet_distance(fname,detStr) |
---|
740 | endif |
---|
741 | if(curTab == 1) |
---|
742 | str += "SDD ML = "+num2str(V_getDet_distance(type,"ML")) + " cm \r" |
---|
743 | str += "SDD MR = "+num2str(V_getDet_distance(type,"MR")) + " cm \r" |
---|
744 | str += "SDD MT = "+num2str(V_getDet_distance(type,"MT")) + " cm \r" |
---|
745 | str += "SDD MB = "+num2str(V_getDet_distance(type,"MB")) + " cm \r" |
---|
746 | endif |
---|
747 | if(curTab == 0) |
---|
748 | str += "SDD FL = "+num2str(V_getDet_distance(type,"FL")) + " cm \r" |
---|
749 | str += "SDD FR = "+num2str(V_getDet_distance(type,"FR")) + " cm \r" |
---|
750 | str += "SDD FT = "+num2str(V_getDet_distance(type,"FT")) + " cm \r" |
---|
751 | str += "SDD FB = "+num2str(V_getDet_distance(type,"FB")) + " cm \r" |
---|
752 | endif |
---|
753 | |
---|
754 | |
---|
755 | |
---|
756 | |
---|
757 | |
---|
758 | break |
---|
759 | case -1: // control being killed |
---|
760 | break |
---|
761 | endswitch |
---|
762 | |
---|
763 | return 0 |
---|
764 | End |
---|
765 | |
---|
766 | |
---|
767 | // TODO: |
---|
768 | // -- come up with a better definition of the log lookup wave (> 1000 pts, what is the first point) |
---|
769 | // -- make an equivalent linear wave |
---|
770 | // -- hard wire it in so it is created at initialization and stored someplace safe |
---|
771 | // -- catch the error if it doesn't exist (re-make the wave as needed) |
---|
772 | // |
---|
773 | // Using the ModifyImage log=1 keyword fails for values of zero in the data, which is a common |
---|
774 | // occurrence with count data. the display just goes all gray, so that's not an option. Use the lookup wave instead |
---|
775 | // |
---|
776 | // toggle the (z) value of the display log/lin |
---|
777 | // |
---|
778 | Function LogLinButtonProc(ba) : ButtonControl |
---|
779 | STRUCT WMButtonAction &ba |
---|
780 | |
---|
781 | switch( ba.eventCode ) |
---|
782 | case 2: // mouse up |
---|
783 | // click code here |
---|
784 | |
---|
785 | // which tab is active? does it matter - or do I log-scale everything? |
---|
786 | // log/lin current state is in the S_UserData string (0=linear, 1=log) |
---|
787 | ControlInfo/W=VSANS_Data button_log |
---|
788 | Variable curState,newState |
---|
789 | String newStateStr,newTitleStr |
---|
790 | |
---|
791 | |
---|
792 | curState = str2num(S_UserData) |
---|
793 | |
---|
794 | if(curState == 0) |
---|
795 | newState = 1 |
---|
796 | newStateStr="1" |
---|
797 | newTitleStr = "isLog" |
---|
798 | // lookup wave |
---|
799 | Wave LookupWave = root:Packages:NIST:VSANS:Globals:logLookupWave |
---|
800 | else |
---|
801 | newState = 0 |
---|
802 | newStateStr="0" |
---|
803 | newTitleStr = "isLin" |
---|
804 | // lookup wave - the linear version |
---|
805 | Wave LookupWave = root:Packages:NIST:VSANS:Globals:linearLookupWave |
---|
806 | endif |
---|
807 | |
---|
808 | // update the button and the global value |
---|
809 | Button button_log,userData=newStateStr,title=newTitleStr |
---|
810 | NVAR state = root:Packages:NIST:VSANS:Globals:gIsLogScale |
---|
811 | state = newState |
---|
812 | |
---|
813 | // on the front: |
---|
814 | ModifyImage/W=VSANS_Data#det_panelsF ''#0 ctabAutoscale=0,lookup= LookupWave |
---|
815 | ModifyImage/W=VSANS_Data#det_panelsF ''#1 ctabAutoscale=0,lookup= LookupWave |
---|
816 | ModifyImage/W=VSANS_Data#det_panelsF ''#2 ctabAutoscale=0,lookup= LookupWave |
---|
817 | ModifyImage/W=VSANS_Data#det_panelsF ''#3 ctabAutoscale=0,lookup= LookupWave |
---|
818 | //on the middle: |
---|
819 | // ModifyImage/W=VSANS_Data#det_panelsM ''#0 log=newState |
---|
820 | // ModifyImage/W=VSANS_Data#det_panelsM ''#1 log=newState |
---|
821 | // ModifyImage/W=VSANS_Data#det_panelsM ''#2 log=newState |
---|
822 | // ModifyImage/W=VSANS_Data#det_panelsM ''#3 log=newState |
---|
823 | |
---|
824 | ModifyImage/W=VSANS_Data#det_panelsM ''#0 ctabAutoscale=0,lookup= LookupWave |
---|
825 | ModifyImage/W=VSANS_Data#det_panelsM ''#1 ctabAutoscale=0,lookup= LookupWave |
---|
826 | ModifyImage/W=VSANS_Data#det_panelsM ''#2 ctabAutoscale=0,lookup= LookupWave |
---|
827 | ModifyImage/W=VSANS_Data#det_panelsM ''#3 ctabAutoscale=0,lookup= LookupWave |
---|
828 | |
---|
829 | |
---|
830 | // on the back: |
---|
831 | ModifyImage/W=VSANS_Data#det_panelsB ''#0 ctabAutoscale=0,lookup= LookupWave |
---|
832 | |
---|
833 | break |
---|
834 | case -1: // control being killed |
---|
835 | break |
---|
836 | endswitch |
---|
837 | |
---|
838 | return 0 |
---|
839 | End |
---|
840 | |
---|
841 | // TODO |
---|
842 | // possibly function to "tag" files right here in the disaply with things |
---|
843 | // like their intent, or other values that reduction will need, kind of like a "quick patch" |
---|
844 | // with limited functionality (since full function would be a nightmare!) |
---|
845 | Function TagFileButtonProc(ba) : ButtonControl |
---|
846 | STRUCT WMButtonAction &ba |
---|
847 | |
---|
848 | switch( ba.eventCode ) |
---|
849 | case 2: // mouse up |
---|
850 | // click code here |
---|
851 | DoAlert 0, "TagFileButtonProc(ba) unfinished" |
---|
852 | |
---|
853 | |
---|
854 | break |
---|
855 | case -1: // control being killed |
---|
856 | break |
---|
857 | endswitch |
---|
858 | |
---|
859 | return 0 |
---|
860 | End |
---|
861 | |
---|
862 | //TODO |
---|
863 | // |
---|
864 | //link this to the beam center finding panel |
---|
865 | // |
---|
866 | Function BeamCtrButtonProc(ba) : ButtonControl |
---|
867 | STRUCT WMButtonAction &ba |
---|
868 | |
---|
869 | switch( ba.eventCode ) |
---|
870 | case 2: // mouse up |
---|
871 | // click code here |
---|
872 | V_FindBeamCenter() |
---|
873 | break |
---|
874 | case -1: // control being killed |
---|
875 | break |
---|
876 | endswitch |
---|
877 | |
---|
878 | return 0 |
---|
879 | End |
---|
880 | |
---|
881 | //TODO |
---|
882 | // |
---|
883 | // this "spreads" the display of panels to a nominal separation for easier viewing |
---|
884 | // |
---|
885 | Function SpreadPanelButtonProc(ba) : ButtonControl |
---|
886 | STRUCT WMButtonAction &ba |
---|
887 | |
---|
888 | switch( ba.eventCode ) |
---|
889 | case 2: // mouse up |
---|
890 | // click code here |
---|
891 | V_SpreadOutPanels() |
---|
892 | |
---|
893 | break |
---|
894 | case -1: // control being killed |
---|
895 | break |
---|
896 | endswitch |
---|
897 | |
---|
898 | return 0 |
---|
899 | End |
---|
900 | |
---|
901 | //TODO |
---|
902 | // |
---|
903 | // this "restores" the display of panels to their actual position based on the apparent beam center |
---|
904 | // |
---|
905 | Function RestorePanelButtonProc(ba) : ButtonControl |
---|
906 | STRUCT WMButtonAction &ba |
---|
907 | |
---|
908 | switch( ba.eventCode ) |
---|
909 | case 2: // mouse up |
---|
910 | // click code here |
---|
911 | V_RestorePanels() |
---|
912 | |
---|
913 | break |
---|
914 | case -1: // control being killed |
---|
915 | break |
---|
916 | endswitch |
---|
917 | |
---|
918 | return 0 |
---|
919 | End |
---|
920 | |
---|
921 | // TODO |
---|
922 | // |
---|
923 | // link this slider to the "high" end of the color mapping for whatever is currently displayed |
---|
924 | // |
---|
925 | // -- see Buttons.ipf for the old SANS implementation |
---|
926 | // |
---|
927 | Function HiMapSliderProc(sa) : SliderControl |
---|
928 | STRUCT WMSliderAction &sa |
---|
929 | |
---|
930 | switch( sa.eventCode ) |
---|
931 | case -1: // control being killed |
---|
932 | break |
---|
933 | default: |
---|
934 | if( sa.eventCode & 1 ) // value set |
---|
935 | Variable curval = sa.curval |
---|
936 | endif |
---|
937 | break |
---|
938 | endswitch |
---|
939 | |
---|
940 | return 0 |
---|
941 | End |
---|
942 | |
---|
943 | // TODO |
---|
944 | // |
---|
945 | // link this slider to the "low" end of the color mapping for whatever is currently displayed |
---|
946 | // |
---|
947 | // -- see Buttons.ipf for the old SANS implementation |
---|
948 | // |
---|
949 | Function LowMapSliderProc(sa) : SliderControl |
---|
950 | STRUCT WMSliderAction &sa |
---|
951 | |
---|
952 | switch( sa.eventCode ) |
---|
953 | case -1: // control being killed |
---|
954 | break |
---|
955 | default: |
---|
956 | if( sa.eventCode & 1 ) // value set |
---|
957 | Variable curval = sa.curval |
---|
958 | endif |
---|
959 | break |
---|
960 | endswitch |
---|
961 | |
---|
962 | return 0 |
---|
963 | End |
---|
964 | |
---|
965 | |
---|