PEARL Procedures  rev-distro-2.0.0-0-gfda49c3-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.02
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 
78 
79 
80 
81 
82 string PearlMenuEnableFunc(string funcname){
83  // checks whether a function name exists
84  // and conditionally returns a prefix which disables the menu item
85  // if the function does not exist
86  string funcname
87  if (exists(funcname) >= 3)
88  return ""
89  else
90  return "("
91  endif
92 };
93 
94 variable LoadPearlOptics(){
95  execute /p/q/z "INSERTINCLUDE \"pearl-optics\""
96  execute /p/q/z "COMPILEPROCEDURES "
97  execute /p/q/z "PearlOpticsPanel#po_InitPanel()"
98  execute /p/q/z "BuildMenu \"PEARL\""
99 };
100 
101 variable LoadPearlArpes(){
102  execute /p/q/z "INSERTINCLUDE \"pearl-arpes\""
103  execute /p/q/z "COMPILEPROCEDURES "
104  execute /p/q/z "BuildMenu \"PEARL\""
105 };
106 
108  execute /p/q/z "INSERTINCLUDE \"pearl-preparation\""
109  execute /p/q/z "COMPILEPROCEDURES "
110  execute /p/q/z "BuildMenu \"PEARL\""
111 };
112 
113 variable Display2dProfiles(){
114  dfref dfBefore = GetDataFolderDFR()
115  Execute /q/z "CreateBrowser prompt=\"Select 2D wave\", showWaves=1, showVars=0, showStrs=0"
116  dfref dfAfter = GetDataFolderDFR()
117  SetDataFolder dfBefore
118 
119  SVAR list = S_BrowserList
120  NVAR flag = V_Flag
121 
122  if ((flag != 0) && (ItemsInList(list) >= 1))
123  string brickname = StringFromList(0, list)
124  string cmd
125  sprintf cmd, "ad_display_profiles(%s)", brickname
126  execute /q/z cmd
127  endif
128 };
129 
130 variable Display3dSlicer(){
131  dfref dfBefore = GetDataFolderDFR()
132  Execute /q/z "CreateBrowser prompt=\"Select 3D wave\", showWaves=1, showVars=0, showStrs=0"
133  dfref dfAfter = GetDataFolderDFR()
134  SetDataFolder dfBefore
135 
136  SVAR list = S_BrowserList
137  NVAR flag = V_Flag
138 
139  if ((flag != 0) && (ItemsInList(list) >= 1))
140  string brickname = StringFromList(0, list)
141  string cmd
142  sprintf cmd, "ad_display_slice(%s)", brickname
143  execute /q/z cmd
144  sprintf cmd, "ad_brick_slicer(%s)", brickname
145  execute /q/z cmd
146  endif
147 };
148 
150  dfref dfBefore = GetDataFolderDFR()
151  Execute /q/z "CreateBrowser prompt=\"Select 3D wave\", showWaves=1, showVars=0, showStrs=0"
152  dfref dfAfter = GetDataFolderDFR()
153  SetDataFolder dfBefore
154 
155  SVAR list = S_BrowserList
156  NVAR flag = V_Flag
157 
158  if ((flag != 0) && (ItemsInList(list) >= 1))
159  string brickname = StringFromList(0, list)
160  string cmd
161  sprintf cmd, "ad_display_brick(%s)", brickname
162  execute /q/z cmd
163  sprintf cmd, "ad_brick_slicer(%s)", brickname
164  execute /q/z cmd
165  endif
166 };
167 
168 variable PearlLiveDisplay(string epicsname, string nickname, string wbRGB){
169  string epicsname// base name of the detector, e.g. X03DA-SCIENTA:
170  // image1: and cam1: are appended by the function
171  // see ad_connect
172  string nickname// nick name under which this detector is referred to in Igor
173  // must be a valid data folder name
174  // see ad_connect
175  string wbRGB// window background color, e.g. "(32768,49152,55296)"
176  string cmd
177  sprintf cmd, "ad_connect(\"%s\", \"%s\")", epicsname, nickname
178  execute /q/z cmd
179  sprintf cmd, "ad_display_profiles(root:pearl_epics:%s:image)", nickname
180  execute /q/z cmd
181  sprintf cmd, "ModifyGraph wbRGB=%s", wbRGB
182  execute /q/z cmd
183  sprintf cmd, "add_roi_controls()"
184  execute /q/z cmd
185 };
186 
187 variable PearlAnglescanTracker(string epicsname, string wbRGB){
188  string epicsname// base name of the detector, e.g. X03DA-SCIENTA:
189  // image1: and cam1: are appended by the function
190  // see ast_setup
191  string wbRGB// window background color, e.g. "(32768,49152,55296)"
192  string cmd
193  sprintf cmd, "ast_setup()"
194  execute /q/z cmd
195  sprintf cmd, "ModifyGraph wbRGB=%s", wbRGB
196  execute /q/z cmd
197 };
198 
variable PearlLiveDisplay(string epicsname, string nickname, string wbRGB)
Definition: pearl-menu.ipf:168
variable DisplayGizmoSlicer()
Definition: pearl-menu.ipf:149
variable LoadPearlPreparation()
Definition: pearl-menu.ipf:107
variable PearlAnglescanTracker(string epicsname, string wbRGB)
Definition: pearl-menu.ipf:187
variable LoadPearlArpes()
Definition: pearl-menu.ipf:101
variable LoadPearlOptics()
Definition: pearl-menu.ipf:94
variable Display3dSlicer()
Definition: pearl-menu.ipf:130
string PearlMenuEnableFunc(string funcname)
Definition: pearl-menu.ipf:82
variable Display2dProfiles()
Definition: pearl-menu.ipf:113