1 | function varargout = booster(varargin) |
---|
2 | % BOOSTER M-file for booster.fig |
---|
3 | % BOOSTER, by itself, creates a new BOOSTER or raises the existing |
---|
4 | % singleton*. |
---|
5 | % |
---|
6 | % H = BOOSTER returns the handle to a new BOOSTER or the handle to |
---|
7 | % the existing singleton*. |
---|
8 | % |
---|
9 | % BOOSTER('CALLBACK',hObject,eventData,handles,...) calls the local |
---|
10 | % function named CALLBACK in BOOSTER.M with the given input arguments. |
---|
11 | % |
---|
12 | % BOOSTER('Property','Value',...) creates a new BOOSTER or raises the |
---|
13 | % existing singleton*. Starting from the left, property value pairs are |
---|
14 | % applied to the GUI before booster_OpeningFunction gets called. An |
---|
15 | % unrecognized property name or invalid value makes property application |
---|
16 | % stop. All inputs are passed to booster_OpeningFcn via varargin. |
---|
17 | % |
---|
18 | % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one |
---|
19 | % instance to run (singleton)". |
---|
20 | % |
---|
21 | % See also: GUIDE, GUIDATA, GUIHANDLES |
---|
22 | |
---|
23 | % Copyright 2002-2003 The MathWorks, Inc. |
---|
24 | |
---|
25 | % Edit the above text to modify the response to help booster |
---|
26 | |
---|
27 | % Last Modified by GUIDE v2.5 29-Sep-2005 17:24:34 |
---|
28 | |
---|
29 | % Begin initialization code - DO NOT EDIT |
---|
30 | gui_Singleton = 1; |
---|
31 | gui_State = struct('gui_Name', mfilename, ... |
---|
32 | 'gui_Singleton', gui_Singleton, ... |
---|
33 | 'gui_OpeningFcn', @booster_OpeningFcn, ... |
---|
34 | 'gui_OutputFcn', @booster_OutputFcn, ... |
---|
35 | 'gui_LayoutFcn', [] , ... |
---|
36 | 'gui_Callback', []); |
---|
37 | if nargin && ischar(varargin{1}) |
---|
38 | gui_State.gui_Callback = str2func(varargin{1}); |
---|
39 | end |
---|
40 | |
---|
41 | if nargout |
---|
42 | [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); |
---|
43 | else |
---|
44 | gui_mainfcn(gui_State, varargin{:}); |
---|
45 | end |
---|
46 | % End initialization code - DO NOT EDIT |
---|
47 | |
---|
48 | |
---|
49 | % --- Executes just before booster is made visible. |
---|
50 | function booster_OpeningFcn(hObject, eventdata, handles, varargin) |
---|
51 | % This function has no output args, see OutputFcn. |
---|
52 | % hObject handle to figure |
---|
53 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
54 | % handles structure with handles and user data (see GUIDATA) |
---|
55 | % varargin command line arguments to booster (see VARARGIN) |
---|
56 | |
---|
57 | % Choose default command line output for booster |
---|
58 | handles.output = hObject; |
---|
59 | |
---|
60 | % Update handles structure |
---|
61 | guidata(hObject, handles); |
---|
62 | |
---|
63 | % UIWAIT makes booster wait for user response (see UIRESUME) |
---|
64 | % uiwait(handles.figure1); |
---|
65 | |
---|
66 | |
---|
67 | % --- Outputs from this function are returned to the command line. |
---|
68 | function varargout = booster_OutputFcn(hObject, eventdata, handles) |
---|
69 | % varargout cell array for returning output args (see VARARGOUT); |
---|
70 | % hObject handle to figure |
---|
71 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
72 | % handles structure with handles and user data (see GUIDATA) |
---|
73 | |
---|
74 | % Get default command line output from handles structure |
---|
75 | varargout{1} = handles.output; |
---|
76 | |
---|
77 | |
---|
78 | % --- Executes on button press in New_Orbit. |
---|
79 | function New_Orbit_Callback(hObject, eventdata, handles) |
---|
80 | % hObject handle to New_Orbit (see GCBO) |
---|
81 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
82 | % handles structure with handles and user data (see GUIDATA) |
---|
83 | global Stop; |
---|
84 | Selected_BPMs=1:1:22; |
---|
85 | %orbit=rand(22,1); |
---|
86 | %axes(handles.Xinj) |
---|
87 | %plot(Selected_BPMs,orbit) |
---|
88 | liste={'xInj','zInj','xExt','zExt'}; |
---|
89 | Stop=0; |
---|
90 | while Stop==0, |
---|
91 | argout=tango_read_attributes('BOO/DG/BPM-Manager',liste); |
---|
92 | Xinj=argout(1).value; |
---|
93 | Zinj=argout(2).value; |
---|
94 | Xext=argout(3).value; |
---|
95 | Zext=argout(4).value; |
---|
96 | axes(handles.Xinj); |
---|
97 | plot(Xinj);title('X injection'); |
---|
98 | set(handles.Xinj,'XLim',[1 22]); |
---|
99 | axes(handles.Zinj); |
---|
100 | plot(Zinj);title('Z injection'); |
---|
101 | set(handles.Zinj,'XLim',[1 22]); |
---|
102 | axes(handles.Xext); |
---|
103 | plot(Xext);title('X extraction'); |
---|
104 | set(handles.Xext,'XLim',[1 22]); |
---|
105 | axes(handles.Zext); |
---|
106 | plot(Zext);title('Z extraction'); |
---|
107 | set(handles.Zext,'XLim',[1 22]); |
---|
108 | |
---|
109 | |
---|
110 | pause(1); |
---|
111 | end |
---|
112 | |
---|
113 | |
---|
114 | |
---|
115 | |
---|
116 | |
---|
117 | % --- Executes on selection change in Dev_Name_Xcyc. |
---|
118 | function Dev_Name_Xcyc_Callback(hObject, eventdata, handles) |
---|
119 | % hObject handle to Dev_Name_Xcyc (see GCBO) |
---|
120 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
121 | % handles structure with handles and user data (see GUIDATA) |
---|
122 | |
---|
123 | % Hints: contents = get(hObject,'String') returns Dev_Name_Xcyc contents as cell array |
---|
124 | % contents{get(hObject,'Value')} returns selected item from Dev_Name_Xcyc |
---|
125 | |
---|
126 | |
---|
127 | |
---|
128 | % --- Executes during object creation, after setting all properties. |
---|
129 | function Dev_Name_Xcyc_CreateFcn(hObject, eventdata, handles) |
---|
130 | % hObject handle to Dev_Name_Xcyc (see GCBO) |
---|
131 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
132 | % handles empty - handles not created until after all CreateFcns called |
---|
133 | |
---|
134 | % Hint: popupmenu controls usually have a white background on Windows. |
---|
135 | % See ISPC and COMPUTER. |
---|
136 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
137 | set(hObject,'BackgroundColor','white'); |
---|
138 | end |
---|
139 | |
---|
140 | |
---|
141 | % --- Executes on selection change in Dev_Name_Zcyc. |
---|
142 | function Dev_Name_Zcyc_Callback(hObject, eventdata, handles) |
---|
143 | % hObject handle to Dev_Name_Zcyc (see GCBO) |
---|
144 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
145 | % handles structure with handles and user data (see GUIDATA) |
---|
146 | |
---|
147 | % Hints: contents = get(hObject,'String') returns Dev_Name_Zcyc contents as cell array |
---|
148 | % contents{get(hObject,'Value')} returns selected item from Dev_Name_Zcyc |
---|
149 | |
---|
150 | |
---|
151 | % --- Executes during object creation, after setting all properties. |
---|
152 | function Dev_Name_Zcyc_CreateFcn(hObject, eventdata, handles) |
---|
153 | % hObject handle to Dev_Name_Zcyc (see GCBO) |
---|
154 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
155 | % handles empty - handles not created until after all CreateFcns called |
---|
156 | |
---|
157 | % Hint: popupmenu controls usually have a white background on Windows. |
---|
158 | % See ISPC and COMPUTER. |
---|
159 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
160 | set(hObject,'BackgroundColor','white'); |
---|
161 | end |
---|
162 | |
---|
163 | |
---|
164 | |
---|
165 | function N_samples_Callback(hObject, eventdata, handles) |
---|
166 | % hObject handle to N_samples (see GCBO) |
---|
167 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
168 | % handles structure with handles and user data (see GUIDATA) |
---|
169 | |
---|
170 | % Hints: get(hObject,'String') returns contents of N_samples as text |
---|
171 | % str2double(get(hObject,'String')) returns contents of N_samples as a double |
---|
172 | |
---|
173 | |
---|
174 | % --- Executes during object creation, after setting all properties. |
---|
175 | function N_samples_CreateFcn(hObject, eventdata, handles) |
---|
176 | % hObject handle to N_samples (see GCBO) |
---|
177 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
178 | % handles empty - handles not created until after all CreateFcns called |
---|
179 | |
---|
180 | % Hint: edit controls usually have a white background on Windows. |
---|
181 | % See ISPC and COMPUTER. |
---|
182 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
183 | set(hObject,'BackgroundColor','white'); |
---|
184 | end |
---|
185 | |
---|
186 | |
---|
187 | |
---|
188 | |
---|
189 | % --- Executes on button press in Stop. |
---|
190 | function Stop_Callback(hObject, eventdata, handles) |
---|
191 | % hObject handle to Stop (see GCBO) |
---|
192 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
193 | % handles structure with handles and user data (see GUIDATA) |
---|
194 | global Stop; |
---|
195 | Stop=1; |
---|
196 | |
---|