source: MML/trunk/machine/SOLEIL/common/bpmconfigurator.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: 23.2 KB
Line 
1 function varargout = bpmconfigurator(varargin)
2% BPMCONFIGURATOR M-file for bpmconfigurator.fig
3%      BPMCONFIGURATOR, by itself, creates a new BPMCONFIGURATOR or raises the existing
4%      singleton*.
5%
6%      H = BPMCONFIGURATOR returns the handle to a new BPMCONFIGURATOR or the handle to
7%      the existing singleton*.
8%
9%      BPMCONFIGURATOR('CALLBACK',hObject,eventData,handles,...) calls the local
10%      function named CALLBACK in BPMCONFIGURATOR.M with the given input arguments.
11%
12%      BPMCONFIGURATOR('Property','Value',...) creates a new BPMCONFIGURATOR or raises the
13%      existing singleton*.  Starting from the left, property value pairs are
14%      applied to the GUI before bpmconfigurator_OpeningFunction gets called.  An
15%      unrecognized property name or invalid value makes property application
16%      stop.  All inputs are passed to bpmconfigurator_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 bpmconfigurator
26
27% Last Modified by GUIDE v2.5 20-Mar-2007 12:21:43
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', @bpmconfigurator_OpeningFcn, ...
34                   'gui_OutputFcn',  @bpmconfigurator_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 bpmconfigurator is made visible.
50function bpmconfigurator_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 bpmconfigurator (see VARARGIN)
56
57% Choose default command line output for bpmconfigurator
58handles.output = hObject;
59
60% Update handles structure
61guidata(hObject, handles);
62
63% UIWAIT makes bpmconfigurator wait for user response (see UIRESUME)
64% uiwait(handles.figure1);
65AO = {};
66setappdata(handles.figure1,'AO', AO);
67
68% init oppmenu for commands and attributes
69% Mode is not read by readattribute
70
71switch getsubmachinename
72    case 'Booster_old'
73        set(handles.popupmenu_Attribute,'String',{'NumSamples','Mode', ...
74            'BufferFreezingEnabled','BufferFrozen'});
75        set(handles.popupmenu_Command,'String',{'Init','State', ...
76            'DisableBufferFreezing', 'EnableBufferFreezing', 'UnFreezeBuffer'});
77    case {'Booster', 'StorageRing', 'LT2'}
78        set(handles.popupmenu_Attribute,'String',{'AGCEnabled', 'DDBufferSize','Gain','DDTriggerCounter', ...
79            'DDBufferFreezingEnabled','DDBufferFrozen', 'DDEnabled','SAEnabled','Switches'});
80        set(handles.popupmenu_Command,'String',{'Init','State', 'Status', ...
81            'DisableDD', 'DisableSA','EnableDDBufferFreezing', 'UnFreezeDDBuffer', ...
82            'DisableDDBufferFreezing', 'EnableDD', 'EnableSA', 'SetTimeOnNextTrigger'});
83        tablist = (0:-1:-60)';
84        set(handles.popupmenu_Gain,'String', num2str(tablist));
85        handles.groupID = tango_group_create('BPM');
86        tango_group_add(handles.groupID,family2tangodev('BPMx')');
87    otherwise
88        error('Wrong SubMachine %s', getsubmachinename);
89end
90
91% Update handles structure
92guidata(hObject, handles);
93
94% --- Outputs from this function are returned to the command line.
95function varargout = bpmconfigurator_OutputFcn(hObject, eventdata, handles)
96% varargout  cell array for returning output args (see VARARGOUT);
97% hObject    handle to figure
98% eventdata  reserved - to be defined in a future version of MATLAB
99% handles    structure with handles and user data (see GUIDATA)
100
101% Get default command line output from handles structure
102varargout{1} = handles.output;
103
104
105% --- Executes on selection change in popupmenu_Command.
106function popupmenu_Command_Callback(hObject, eventdata, handles)
107% hObject    handle to popupmenu_Command (see GCBO)
108% eventdata  reserved - to be defined in a future version of MATLAB
109% handles    structure with handles and user data (see GUIDATA)
110
111% Hints: contents = get(hObject,'String') returns popupmenu_Command contents as cell array
112%        contents{get(hObject,'Value')} returns selected item from popupmenu_Command
113
114
115% --- Executes during object creation, after setting all properties.
116function popupmenu_Command_CreateFcn(hObject, eventdata, handles)
117% hObject    handle to popupmenu_Command (see GCBO)
118% eventdata  reserved - to be defined in a future version of MATLAB
119% handles    empty - handles not created until after all CreateFcns called
120
121% Hint: popupmenu controls usually have a white background on Windows.
122%       See ISPC and COMPUTER.
123if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
124    set(hObject,'BackgroundColor','white');
125end
126
127
128% --- Executes on button press in pushbutton_Apply.
129function pushbutton_Apply_Callback(hObject, eventdata, handles)
130% hObject    handle to pushbutton_Apply (see GCBO)
131% eventdata  reserved - to be defined in a future version of MATLAB
132% handles    structure with handles and user data (see GUIDATA)
133
134answer = questdlg('Do you want to apply change ?','Confirmation dialog box');
135
136% get selected bpm
137iSelected = get(handles.listbox_Bpm,'Value');
138
139AO        = getappdata(handles.figure1,'AO');
140% Status one devices
141valid  = find(AO.Status);
142valid = intersect(iSelected,valid);
143
144if isempty(valid)
145    disp('Non BPM selected or status 0');
146    return;
147end
148
149
150valS = repmat('NaN',size(AO.DeviceName));
151val = cellstr(valS);
152
153switch answer
154    case 'Yes'
155        %get selected command
156        icmd = get(handles.popupmenu_Command,'Value');
157        cmdlist = get(handles.popupmenu_Command,'String');
158        command = cmdlist{icmd};
159        switch command
160            case 'State'
161                set(handles.listbox_Attribute,'String',val);
162                for k=1:length(valid),
163                    val0 = tango_command_inout2(AO.DeviceName{valid(k)},command);
164                    val{valid(k)} = val0;
165                end
166                set(handles.listbox_Attribute,'String',val);
167            otherwise % not output command
168                for k=1:length(valid),
169                    tango_command_inout2(AO.DeviceName{valid(k)},command);
170                end
171        end
172    case {'No','Cancel'}
173        return;
174    otherwise
175        warning('Wrong answer')
176end
177
178
179function edit_Attribute_Callback(hObject, eventdata, handles)
180% hObject    handle to edit_Attribute (see GCBO)
181% eventdata  reserved - to be defined in a future version of MATLAB
182% handles    structure with handles and user data (see GUIDATA)
183
184% Hints: get(hObject,'String') returns contents of edit_Attribute as text
185%        str2double(get(hObject,'String')) returns contents of edit_Attribute as a double
186
187answer = questdlg('Do you want to apply change ?','Confirmation dialog box');
188iSelected = get(handles.listbox_Bpm,'Value');
189
190AO     = getappdata(handles.figure1,'AO');
191% Status one devices
192valid  = find(AO.Status);
193
194valid = intersect(iSelected,valid);
195
196if isempty(valid)
197    disp('Non BPM selected or status 0');
198    return;
199end
200
201switch answer
202    case 'Yes'
203
204        % Get the new value
205        value = get(hObject,'String');
206        if iscell(value)
207            value = cellstr(value);
208        end
209               
210        iAttribute = get(handles.popupmenu_Attribute,'Value');
211        attribute = get(handles.popupmenu_Attribute,'String');
212
213        if iAttribute == 1 || iAttribute == 2 || iAttribute == 3 || iAttribute == 6  || iAttribute == 7
214            value = str2double(value);
215        end
216        value = repmat(value,size(valid'));
217       
218        % Test on variable type
219        switch attribute{iAttribute}
220            case {'NumSamples','DDBufferSize'}
221                type = 'int32';
222            case 'Switches'
223                type = 'int16';
224            case 'Mode'
225                type = 'String';
226            case  {'DDEnabled','SAEnabled','AGCEnabled'}
227                type = 'uint8';
228            otherwise
229                type = 'double';
230        end         
231       
232        disp([mfilename ': Processing ...']);
233%         if (get(handles.checkbox_All,'Value') == 0)
234             %% Get selected elements
235             
236            writeattribute(strcat(AO.DeviceName(valid), ...
237                '/',attribute(iAttribute)), value,type);
238%         else % All the same
239%             writeattribute(strcat(AO.DeviceName(valid), ...
240%                 '/',attribute(iAttribute)), value,type)
241%         end
242        disp([mfilename ': Done ']);
243        % refresh display
244        pushbutton_Refresh_Callback(handles.pushbutton_Refresh,eventdata, handles);
245
246    case {'No','Cancel'}
247        return;
248    otherwise
249        warning('Wrong answer')
250end
251
252
253% --- Executes during object creation, after setting all properties.
254function edit_Attribute_CreateFcn(hObject, eventdata, handles)
255% hObject    handle to edit_Attribute (see GCBO)
256% eventdata  reserved - to be defined in a future version of MATLAB
257% handles    empty - handles not created until after all CreateFcns called
258
259% Hint: edit controls usually have a white background on Windows.
260%       See ISPC and COMPUTER.
261if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
262    set(hObject,'BackgroundColor','white');
263end
264
265
266% --- Executes on button press in pushbutton_Refresh.
267function pushbutton_Refresh_Callback(hObject, eventdata, handles)
268% hObject    handle to pushbutton_Refresh (see GCBO)
269% eventdata  reserved - to be defined in a future version of MATLAB
270% handles    structure with handles and user data (see GUIDATA)
271
272% refresh ALL
273iBpm = get(handles.listbox_Bpm,'Value');
274iAttribute = get(handles.popupmenu_Attribute,'Value');
275attribute = get(handles.popupmenu_Attribute,'String');
276
277AO = getappdata(handles.figure1,'AO');
278
279valid  = find(AO.Status);
280val = ones(size(AO.DeviceName))*NaN';
281valS = repmat('NaN',size(AO.DeviceName));
282val0 = readattribute(strcat(AO.DeviceName(valid),'/',char(attribute(iAttribute))));
283
284if iscellstr(val0)
285    val = cellstr(valS);
286    for k=1:length(valid)
287        val{valid(k)} = val0{k};
288    end
289else
290    val(valid) = val0;
291end
292
293% unpdate listbox
294set(handles.listbox_Attribute,'String',val);
295% update editbox
296set(handles.edit_Attribute,'String',val(1));
297set(handles.listbox_Attribute,'Value',1);
298set(handles.listbox_Bpm,'Value',1);
299% uncheckk buttons
300set(handles.checkbox_All,'Value', 0);
301set(handles.checkbox_None,'Value', 0);
302
303% --- Executes on selection change in popupmenu_Attribute.
304function popupmenu_Attribute_Callback(hObject, eventdata, handles)
305% hObject    handle to popupmenu_Attribute (see GCBO)
306% eventdata  reserved - to be defined in a future version of MATLAB
307% handles    structure with handles and user data (see GUIDATA)
308
309% Hints: contents = get(hObject,'String') returns popupmenu_Attribute contents as cell array
310%        contents{get(hObject,'Value')} returns selected item from popupmenu_Attribute
311
312% Force a refresh
313bpmconfigurator('pushbutton_Refresh_Callback',hObject, eventdata, handles);
314
315% --- Executes during object creation, after setting all properties.
316function popupmenu_Attribute_CreateFcn(hObject, eventdata, handles)
317% hObject    handle to popupmenu_Attribute (see GCBO)
318% eventdata  reserved - to be defined in a future version of MATLAB
319% handles    empty - handles not created until after all CreateFcns called
320
321% Hint: popupmenu controls usually have a white background on Windows.
322%       See ISPC and COMPUTER.
323if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
324    set(hObject,'BackgroundColor','white');
325end
326
327
328% --- Executes on button press in checkbox_All.
329function checkbox_All_Callback(hObject, eventdata, handles)
330% hObject    handle to checkbox_All (see GCBO)
331% eventdata  reserved - to be defined in a future version of MATLAB
332% handles    structure with handles and user data (see GUIDATA)
333
334% Hint: get(hObject,'Value') returns toggle state of checkbox_All
335
336val = get(handles.listbox_Bpm,'String');
337
338if get(hObject,'Value') == 1
339    set(handles.checkbox_None,'Value',0);
340    set(handles.listbox_Bpm,'Value',1:length(val));
341    set(handles.listbox_Attribute,'Value',1:length(val));
342    set(handles.listbox_Bpm,'listboxtop',1);
343    set(handles.listbox_Attribute,'listboxtop',1);
344end
345
346% --- Executes on button press in checkbox_None.
347function checkbox_None_Callback(hObject, eventdata, handles)
348% hObject    handle to checkbox_None (see GCBO)
349% eventdata  reserved - to be defined in a future version of MATLAB
350% handles    structure with handles and user data (see GUIDATA)
351
352% Hint: get(hObject,'Value') returns toggle state of checkbox_None
353
354if get(hObject,'Value') == 1
355    set(handles.checkbox_All,'Value',0);
356    set(handles.listbox_Bpm,'Value',1);
357    set(handles.listbox_Attribute,'Value',1);
358end
359
360
361% --- Executes on selection change in listbox_Bpm.
362function listbox_Bpm_Callback(hObject, eventdata, handles)
363% hObject    handle to listbox_Bpm (see GCBO)
364% eventdata  reserved - to be defined in a future version of MATLAB
365% handles    structure with handles and user data (see GUIDATA)
366
367% Hints: contents = get(hObject,'String') returns listbox_Bpm contents as cell array
368%        contents{get(hObject,'Value')} returns selected item from listbox_Bpm
369
370idx = get(hObject,'Value');
371set(handles.listbox_Attribute,'Value',idx,'ListBoxTop',get(hObject,'ListboxTop'));
372
373set(handles.checkbox_All,'Value',0);
374set(handles.checkbox_None,'Value',0);
375
376
377% --- Executes during object creation, after setting all properties.
378function listbox_Bpm_CreateFcn(hObject, eventdata, handles)
379% hObject    handle to listbox_Bpm (see GCBO)
380% eventdata  reserved - to be defined in a future version of MATLAB
381% handles    empty - handles not created until after all CreateFcns called
382
383% Hint: listbox controls usually have a white background on Windows.
384%       See ISPC and COMPUTER.
385if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
386    set(hObject,'BackgroundColor','white');
387end
388
389
390% --- Executes on selection change in listbox_Attribute.
391function listbox_Attribute_Callback(hObject, eventdata, handles)
392% hObject    handle to listbox_Attribute (see GCBO)
393% eventdata  reserved - to be defined in a future version of MATLAB
394% handles    structure with handles and user data (see GUIDATA)
395
396% Hints: contents = get(hObject,'String') returns listbox_Attribute contents as cell array
397%        contents{get(hObject,'Value')} returns selected item from listbox_Attribute
398contents = get(hObject,'String');
399idx = get(hObject,'Value');
400set(handles.listbox_Bpm,'Value',idx,'ListBoxTop',get(hObject,'ListboxTop'));
401set(handles.checkbox_All,'Value',0);
402set(handles.checkbox_None,'Value',0);
403
404% Selected only first element
405% If all elements are numeric, return a char array and not a cell!
406if ischar(contents)
407    contents = cellstr(contents);
408end
409set(handles.edit_Attribute,'String',contents{idx(1)});
410
411% --- Executes during object creation, after setting all properties.
412function listbox_Attribute_CreateFcn(hObject, eventdata, handles)
413% hObject    handle to listbox_Attribute (see GCBO)
414% eventdata  reserved - to be defined in a future version of MATLAB
415% handles    empty - handles not created until after all CreateFcns called
416
417% Hint: listbox controls usually have a white background on Windows.
418%       See ISPC and COMPUTER.
419if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
420    set(hObject,'BackgroundColor','white');
421end
422
423
424% --------------------------------------------------------------------
425function uimenuBooster_Callback(hObject, eventdata, handles)
426% hObject    handle to uimenuBooster (see GCBO)
427% eventdata  reserved - to be defined in a future version of MATLAB
428% handles    structure with handles and user data (see GUIDATA)
429
430AD = getad;
431
432if isempty(AD) || ~strcmpi(AD.SubMachine,'Booster')
433    setpathsoleil('Booster');
434end
435
436init_uimenu(hObject, eventdata, handles);
437
438% --------------------------------------------------------------------
439function uimenuAnneau_Callback(hObject, eventdata, handles)
440% hObject    handle to uimenuAnneau (see GCBO)
441% eventdata  reserved - to be defined in a future version of MATLAB
442% handles    structure with handles and user data (see GUIDATA)
443
444AD = getad;
445
446if isempty(AD) || ~strcmpi(AD.SubMachine,'StorageRing')
447    setpathsoleil('StorageRing');
448end
449
450init_uimenu(hObject, eventdata, handles);
451
452% --------------------------------------------------------------------
453function Untitled_1_Callback(hObject, eventdata, handles)
454% hObject    handle to Untitled_1 (see GCBO)
455% eventdata  reserved - to be defined in a future version of MATLAB
456% handles    structure with handles and user data (see GUIDATA)
457
458function handles = init_uimenu(hObject, eventdata, handles)
459
460AO = getfamilydata('BPMx');
461setappdata(handles.figure1,'AO', AO);
462
463%% Checked box
464all = findobj(get(hObject,'Parent'),'Type','UImenu');
465set(all, 'Checked', 'Off');
466set(hObject, 'Checked', 'On');
467
468%% Initialize popupmenu w/ BPM
469listbpm = AO.DeviceName;
470set(handles.listbox_Bpm,'String',listbpm);
471
472devlist = get(handles.listbox_Bpm,'String');
473val = readattribute([devlist{1},'/', 'SAEnabled']);
474ii = get(handles.uipanel_mode,'Children');
475if val == 1
476    set(handles.uipanel_mode,'SelectedObject', ii(2));
477else
478    set(handles.uipanel_mode,'SelectedObject', ii(1));
479end
480val = readattribute([devlist{1},'/', 'AGCEnabled']);
481set(handles.radiobutton_AGC,'Value', val);
482%cmdlist = get(handles.popupmenu_Command,'String');
483
484
485% --------------------------------------------------------------------
486function uimenuLT2_Callback(hObject, eventdata, handles)
487% hObject    handle to uimenuLT2 (see GCBO)
488% eventdata  reserved - to be defined in a future version of MATLAB
489% handles    structure with handles and user data (see GUIDATA)
490
491AD = getad;
492
493if isempty(AD) || ~strcmpi(AD.SubMachine,'LT2')
494    setpathsoleil('LT2');
495end
496
497init_uimenu(hObject, eventdata, handles);
498
499
500% --- Executes on selection change in popupmenu_Gain.
501function popupmenu_Gain_Callback(hObject, eventdata, handles)
502% hObject    handle to popupmenu_Gain (see GCBO)
503% eventdata  reserved - to be defined in a future version of MATLAB
504% handles    structure with handles and user data (see GUIDATA)
505
506% Hints: contents = get(hObject,'String') returns popupmenu_Gain contents as cell array
507%        contents{get(hObject,'Value')} returns selected item from popupmenu_Gain
508
509contents = get(hObject,'String');
510att = str2double(contents(get(hObject,'Value'),:));
511tango_group_write_attribute(handles.groupID,'Gain',0,att);
512pause(1);
513pushbutton_Refresh_Callback(handles.pushbutton_Refresh,eventdata, handles);
514
515% --- Executes during object creation, after setting all properties.
516function popupmenu_Gain_CreateFcn(hObject, eventdata, handles)
517% hObject    handle to popupmenu_Gain (see GCBO)
518% eventdata  reserved - to be defined in a future version of MATLAB
519% handles    empty - handles not created until after all CreateFcns called
520
521% Hint: popupmenu controls usually have a white background on Windows.
522%       See ISPC and COMPUTER.
523if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
524    set(hObject,'BackgroundColor','white');
525end
526
527
528% --- Executes on button press in checkbox_TbyTmode.
529function checkbox_TbyTmode_Callback(hObject, eventdata, handles)
530% hObject    handle to checkbox_TbyTmode (see GCBO)
531% eventdata  reserved - to be defined in a future version of MATLAB
532% handles    structure with handles and user data (see GUIDATA)
533
534% Hint: get(hObject,'Value') returns toggle state of checkbox_TbyTmode
535
536value = get(hObject,'Value');
537if value == 0 % deactivation of SA mode
538    tango_group_write_attribute(handles.groupID,'DDEnabled',0, uint8(0));
539else % activation of SA mode
540    tango_group_write_attribute(handles.groupID,'DDEnabled',0, uint8(1));
541end
542pause(1);
543pushbutton_Refresh_Callback(handles.pushbutton_Refresh,eventdata, handles);
544
545% --- Executes on button press in checkbox_SAmode.
546function checkbox_SAmode_Callback(hObject, eventdata, handles)
547% hObject    handle to checkbox_SAmode (see GCBO)
548% eventdata  reserved - to be defined in a future version of MATLAB
549% handles    structure with handles and user data (see GUIDATA)
550
551% Hint: get(hObject,'Value') returns toggle state of checkbox_SAmode
552
553value = get(hObject,'Value');
554if value == 0 % deactivation of SA mode
555    tango_group_write_attribute(handles.groupID,'SAEnabled',0, uint8(0));
556    %% deactivate switching Switches attribute 255 to 3
557    tango_group_write_attribute(handles.groupID,'Switches',0, 3);
558else % activation of SA mode
559    tango_group_write_attribute(handles.groupID,'SAEnabled',0, uint8(1));
560    %% activate switching Digital Signal Conditioning
561    tango_group_write_attribute(handles.groupID,'DSCEnabled',0, uint8(1));
562end
563pause(1);
564pushbutton_Refresh_Callback(handles.pushbutton_Refresh,eventdata, handles);
565
566
567% --------------------------------------------------------------------
568function uipanel_mode_SelectionChangeFcn(hObject, eventdata, handles)
569% hObject    handle to uipanel_mode (see GCBO)
570% eventdata  reserved - to be defined in a future version of MATLAB
571% handles    structure with handles and user data (see GUIDATA)
572
573switch get(hObject,'Tag')   % Get Tag of selected object
574    case 'radiobutton1' % SA mode
575        % Active switching mecanisme (work around for now because of Device
576        % bugs)
577        tango_group_write_attribute(handles.groupID,'Switches',0,int16(255));
578        tango_group_write_attribute(handles.groupID,'DSCEnabled',0,uint8(1));
579        pause(1);
580        pushbutton_Refresh_Callback(handles.pushbutton_Refresh,eventdata, handles);
581    case 'radiobutton2'
582        % Deactive switching mecanisme (work around for now because of Device
583        % bugs)
584        tango_group_write_attribute(handles.groupID,'Switches',0,int16(3));
585        pause(1);
586        pushbutton_Refresh_Callback(handles.pushbutton_Refresh,eventdata, handles);
587    % Continue with more cases as necessary.
588end
589
590
591% --- Executes on button press in radiobutton_AGC.
592function radiobutton_AGC_Callback(hObject, eventdata, handles)
593% hObject    handle to radiobutton_AGC (see GCBO)
594% eventdata  reserved - to be defined in a future version of MATLAB
595% handles    structure with handles and user data (see GUIDATA)
596
597% Hint: get(hObject,'Value') returns toggle state of radiobutton_AGC
598
599value = get(hObject,'Value');
600if value == 1
601    tango_group_write_attribute(handles.groupID,'AGCEnabled',0,uint8(1));
602    pause(1);
603    pushbutton_Refresh_Callback(handles.pushbutton_Refresh,eventdata, handles);
604else
605    tango_group_write_attribute(handles.groupID,'AGCEnabled',0,uint8(0));
606    pause(1);
607    pushbutton_Refresh_Callback(handles.pushbutton_Refresh,eventdata, handles);
608end
609
610
611% --- Executes on button press in pushbutton_initALL.
612function pushbutton_initALL_Callback(hObject, eventdata, handles)
613% hObject    handle to pushbutton_initALL (see GCBO)
614% eventdata  reserved - to be defined in a future version of MATLAB
615% handles    structure with handles and user data (see GUIDATA)
616
617commandName = 'Init';
618tango_group_command_inout2(handles.groupID,commandName,0,0);
619pause(1);
620
Note: See TracBrowser for help on using the repository browser.