PEARL Procedures  rev-distro-1.6.0-0-gcf1399e-dirty
Igor procedures for the analysis of PEARL data
pearl-menu.ipf
Go to the documentation of this file.
1 #pragma rtGlobals=1// Use modern global access method.
2 #pragma ModuleName = PearlMenu
3 #pragma version = 1.01
4 
5 // main menu for PEARL data acquisition and analysis packages
6 
7 // $Id$
8 // author: matthias.muntwiler@psi.ch
9 // Copyright (c) 2013-14 Paul Scherrer Institut
10 
11 // Licensed under the Apache License, Version 2.0 (the "License");
12 // you may not use this file except in compliance with the License.
13 // You may obtain a copy of the License at
14 // http://www.apache.org/licenses/LICENSE-2.0
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 
58 
59 
60 
61 
62 
63 
64 
65 
66 
67 
68 
69 
70 
71 
72 
73 
74 
75 
76 
77 string PearlMenuEnableFunc(string funcname){
78  // checks whether a function name exists
79  // and conditionally returns a prefix which disables the menu item
80  // if the function does not exist
81  string funcname
82  if (exists(funcname) >= 3)
83  return ""
84  else
85  return "("
86  endif
87 };
88 
89 variable LoadPearlOptics(){
90  execute /p/q/z "INSERTINCLUDE \"pearl-optics\""
91  execute /p/q/z "COMPILEPROCEDURES "
92  execute /p/q/z "PearlOpticsPanel#po_InitPanel()"
93  execute /p/q/z "BuildMenu \"PEARL\""
94 };
95 
96 variable LoadPearlArpes(){
97  execute /p/q/z "INSERTINCLUDE \"pearl-arpes\""
98  execute /p/q/z "COMPILEPROCEDURES "
99  execute /p/q/z "BuildMenu \"PEARL\""
100 };
101 
103  execute /p/q/z "INSERTINCLUDE \"pearl-preparation\""
104  execute /p/q/z "COMPILEPROCEDURES "
105  execute /p/q/z "BuildMenu \"PEARL\""
106 };
107 
108 variable Display2dProfiles(){
109  dfref dfBefore = GetDataFolderDFR()
110  Execute /q/z "CreateBrowser prompt=\"Select 2D wave\", showWaves=1, showVars=0, showStrs=0"
111  dfref dfAfter = GetDataFolderDFR()
112  SetDataFolder dfBefore
113 
114  SVAR list = S_BrowserList
115  NVAR flag = V_Flag
116 
117  if ((flag != 0) && (ItemsInList(list) >= 1))
118  string brickname = StringFromList(0, list)
119  string cmd
120  sprintf cmd, "ad_display_profiles(%s)", brickname
121  execute /q/z cmd
122  endif
123 };
124 
125 variable Display3dSlicer(){
126  dfref dfBefore = GetDataFolderDFR()
127  Execute /q/z "CreateBrowser prompt=\"Select 3D wave\", showWaves=1, showVars=0, showStrs=0"
128  dfref dfAfter = GetDataFolderDFR()
129  SetDataFolder dfBefore
130 
131  SVAR list = S_BrowserList
132  NVAR flag = V_Flag
133 
134  if ((flag != 0) && (ItemsInList(list) >= 1))
135  string brickname = StringFromList(0, list)
136  string cmd
137  sprintf cmd, "ad_display_slice(%s)", brickname
138  execute /q/z cmd
139  sprintf cmd, "ad_brick_slicer(%s)", brickname
140  execute /q/z cmd
141  endif
142 };
143 
145  dfref dfBefore = GetDataFolderDFR()
146  Execute /q/z "CreateBrowser prompt=\"Select 3D wave\", showWaves=1, showVars=0, showStrs=0"
147  dfref dfAfter = GetDataFolderDFR()
148  SetDataFolder dfBefore
149 
150  SVAR list = S_BrowserList
151  NVAR flag = V_Flag
152 
153  if ((flag != 0) && (ItemsInList(list) >= 1))
154  string brickname = StringFromList(0, list)
155  string cmd
156  sprintf cmd, "ad_display_brick(%s)", brickname
157  execute /q/z cmd
158  sprintf cmd, "ad_brick_slicer(%s)", brickname
159  execute /q/z cmd
160  endif
161 };
162 
163 variable PearlLiveDisplay(string epicsname, string nickname, string wbRGB){
164  string epicsname// base name of the detector, e.g. X03DA-SCIENTA:
165  // image1: and cam1: are appended by the function
166  // see ad_connect
167  string nickname// nick name under which this detector is referred to in Igor
168  // must be a valid data folder name
169  // see ad_connect
170  string wbRGB// window background color, e.g. "(32768,49152,55296)"
171  string cmd
172  sprintf cmd, "ad_connect(\"%s\", \"%s\")", epicsname, nickname
173  execute /q/z cmd
174  sprintf cmd, "ad_display_profiles(root:pearl_epics:%s:image)", nickname
175  execute /q/z cmd
176  sprintf cmd, "ModifyGraph wbRGB=%s", wbRGB
177  execute /q/z cmd
178  sprintf cmd, "add_roi_controls()"
179  execute /q/z cmd
180 };
181 
182 variable PearlAnglescanTracker(string epicsname, string wbRGB){
183  string epicsname// base name of the detector, e.g. X03DA-SCIENTA:
184  // image1: and cam1: are appended by the function
185  // see ast_setup
186  string wbRGB// window background color, e.g. "(32768,49152,55296)"
187  string cmd
188  sprintf cmd, "ast_setup()"
189  execute /q/z cmd
190  sprintf cmd, "ModifyGraph wbRGB=%s", wbRGB
191  execute /q/z cmd
192 };
193 
variable PearlLiveDisplay(string epicsname, string nickname, string wbRGB)
Definition: pearl-menu.ipf:163
variable DisplayGizmoSlicer()
Definition: pearl-menu.ipf:144
variable LoadPearlPreparation()
Definition: pearl-menu.ipf:102
variable PearlAnglescanTracker(string epicsname, string wbRGB)
Definition: pearl-menu.ipf:182
variable LoadPearlArpes()
Definition: pearl-menu.ipf:96
variable LoadPearlOptics()
Definition: pearl-menu.ipf:89
variable Display3dSlicer()
Definition: pearl-menu.ipf:125
string PearlMenuEnableFunc(string funcname)
Definition: pearl-menu.ipf:77
variable Display2dProfiles()
Definition: pearl-menu.ipf:108