source: MML/trunk/machine/SOLEIL/common/diag/DserverBPM/booster.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 6.9 KB
Line 
1function 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
30gui_Singleton = 1;
31gui_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',   []);
37if nargin && ischar(varargin{1})
38    gui_State.gui_Callback = str2func(varargin{1});
39end
40
41if nargout
42    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
43else
44    gui_mainfcn(gui_State, varargin{:});
45end
46% End initialization code - DO NOT EDIT
47
48
49% --- Executes just before booster is made visible.
50function 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
58handles.output = hObject;
59
60% Update handles structure
61guidata(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.
68function 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
75varargout{1} = handles.output;
76
77
78% --- Executes on button press in New_Orbit.
79function 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)
83global Stop;
84Selected_BPMs=1:1:22;
85%orbit=rand(22,1);
86%axes(handles.Xinj)
87%plot(Selected_BPMs,orbit)
88liste={'xInj','zInj','xExt','zExt'};
89Stop=0;
90while Stop==0,
91argout=tango_read_attributes('BOO/DG/BPM-Manager',liste);
92Xinj=argout(1).value;
93Zinj=argout(2).value;
94Xext=argout(3).value;
95Zext=argout(4).value;
96axes(handles.Xinj);
97plot(Xinj);title('X injection');
98set(handles.Xinj,'XLim',[1 22]);
99axes(handles.Zinj);
100plot(Zinj);title('Z injection');
101set(handles.Zinj,'XLim',[1 22]);
102axes(handles.Xext);
103plot(Xext);title('X extraction');
104set(handles.Xext,'XLim',[1 22]);
105axes(handles.Zext);
106plot(Zext);title('Z extraction');
107set(handles.Zext,'XLim',[1 22]);
108
109
110pause(1);
111end
112
113
114
115
116
117% --- Executes on selection change in Dev_Name_Xcyc.
118function 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.
129function 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.
136if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
137    set(hObject,'BackgroundColor','white');
138end
139
140
141% --- Executes on selection change in Dev_Name_Zcyc.
142function 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.
152function 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.
159if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
160    set(hObject,'BackgroundColor','white');
161end
162
163
164
165function 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.
175function 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.
182if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
183    set(hObject,'BackgroundColor','white');
184end
185
186
187
188
189% --- Executes on button press in Stop.
190function 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)
194global Stop;
195Stop=1;
196
Note: See TracBrowser for help on using the repository browser.