1 | function handles = plotfamilystartup(handles) |
---|
2 | % plotfamilystartup - Additional plotfamily menu for SOLEIL |
---|
3 | |
---|
4 | %% Laurent Nadolski |
---|
5 | % Adapted form Gregory Portmann |
---|
6 | |
---|
7 | % Disable setpoint GUI |
---|
8 | set(handles.DisabledSetpointChanges, 'Checked', 'On'); |
---|
9 | |
---|
10 | Sectors = 16; % number of sectors |
---|
11 | Straights = 24; % numberof straight sections |
---|
12 | StraigthPosition = [0; getspos('BPMx', getidbpmlist)]; |
---|
13 | % is it the best place for these definitions ? |
---|
14 | StraigthName = {'SDL01 (INJECTION)', 'SDM02 (CRYO2)', 'SDC02 (ALPHA)', 'SDM03 (CRYO1)', 'SDC03 (PSICHE)', 'SDM04 (PLEIADES)', ... |
---|
15 | 'SDL05 (DESIRS)', 'SDM06 (Empty)', 'SDC06 (CRISTAL)', 'SDM07 (DEIMOS)', 'SDC07 (GALAXIES)', 'SDM08 (TEMPO)', ... |
---|
16 | 'SDL09 (FBT)', 'SDM10 (HERMES)', 'SDC10 (PX1)', 'SDM11 (PX2)', 'SDC11 (SWING)', 'SDM12 (ANTARES)', ... |
---|
17 | 'SDL13 (NANO)', 'SDM14 (SEXTANTS)', 'SDC14 (SIXS)', 'SDM15 (CASSIOPEE)', 'SDC15 (SIRIUS)', 'SDM16 (LUCIA)', ... |
---|
18 | }; |
---|
19 | Superperiods = 4; % number of superperiods |
---|
20 | |
---|
21 | L = getfamilydata('Circumference'); |
---|
22 | if ~isempty(L) |
---|
23 | % Add a sector menu |
---|
24 | % Using a [Arc Straight] nomenclature |
---|
25 | Menu0 = uimenu(handles.figure1, 'Label', 'Sectors'); |
---|
26 | set(Menu0, 'Position', 3); |
---|
27 | set(Menu0, 'Separator', 'On'); |
---|
28 | |
---|
29 | % Arc sections |
---|
30 | Extra = 5; % meters |
---|
31 | i = 1; |
---|
32 | Menu1 = uimenu(Menu0, 'Label',sprintf('Arc Sector %d',i)); |
---|
33 | set(Menu1,'Callback', ['plotfamily(''HorizontalAxisSector_Callback'',gcbo,[',sprintf('%f %f',[0 Extra+L/Sectors]+(i-1)*L/Sectors),'],guidata(gcbo))']); |
---|
34 | for i = 2:Sectors-1 |
---|
35 | Menu1 = uimenu(Menu0, 'Label',sprintf('Arc Sector %d',i)); |
---|
36 | set(Menu1,'Callback', ['plotfamily(''HorizontalAxisSector_Callback'',gcbo,[',sprintf('%f %f',[0-Extra Extra+L/Sectors]+(i-1)*L/Sectors),'],guidata(gcbo))']); |
---|
37 | end |
---|
38 | i = Sectors; |
---|
39 | Menu1 = uimenu(Menu0, 'Label',sprintf('Arc Sector %d',i)); |
---|
40 | set(Menu1,'Callback', ['plotfamily(''HorizontalAxisSector_Callback'',gcbo,[',sprintf('%f %f',[L-L/Sectors-Extra L]),'],guidata(gcbo))']); |
---|
41 | |
---|
42 | % Add Straight section menu |
---|
43 | Menu0 = uimenu(handles.figure1, 'Label', 'Straights'); |
---|
44 | set(Menu0, 'Position', 4); |
---|
45 | set(Menu0, 'Separator', 'On'); |
---|
46 | % Straight sections |
---|
47 | Extra = 10; % meters |
---|
48 | for i = 1:Straights-1 |
---|
49 | Menu1 = uimenu(Menu0, 'Label',sprintf('%s',StraigthName{i})); |
---|
50 | set(Menu1,'Callback', ['plotfamily(''HorizontalAxisSector_Callback'',gcbo,[',sprintf('%f %f',[-Extra+StraigthPosition(2*i-1) Extra+StraigthPosition(2*i)]),'],guidata(gcbo))']); |
---|
51 | end |
---|
52 | Menu1 = uimenu(Menu0, 'Label',sprintf('%s',StraigthName{end})); |
---|
53 | set(Menu1,'Callback', ['plotfamily(''HorizontalAxisSector_Callback'',gcbo,[',sprintf('%f %f',[-Extra+StraigthPosition(end-1) Extra+StraigthPosition(end)]),'],guidata(gcbo))']); |
---|
54 | |
---|
55 | % Add Superperiod menu |
---|
56 | Menu0 = uimenu(handles.figure1, 'Label', 'Superperiod'); |
---|
57 | set(Menu0, 'Position', 5); |
---|
58 | set(Menu0, 'Separator', 'On'); |
---|
59 | |
---|
60 | handles.all = uimenu(Menu0, 'Label',sprintf('All Ring')); |
---|
61 | set(handles.all,'Callback', ['plotfamily(''HorizontalAxisSector_Callback'',gcbo,[',sprintf('%f %f',[0 L]),'],guidata(gcbo))']); |
---|
62 | set(handles.all,'Checked', 'On'); |
---|
63 | |
---|
64 | handles.superperiod1 = uimenu(Menu0, 'Label',sprintf('Superperiod %d',1)); |
---|
65 | set(handles.superperiod1,'Callback', ['plotfamily(''HorizontalAxisSector_Callback'',gcbo,[',sprintf('%f %f',[0 L/Superperiods]),'],guidata(gcbo))']); |
---|
66 | |
---|
67 | handles.superperiod2 = uimenu(Menu0, 'Label',sprintf('Superperiod %d',2)); |
---|
68 | set(handles.superperiod2,'Callback', ['plotfamily(''HorizontalAxisSector_Callback'',gcbo,[',sprintf('%f %f',[L/Superperiods 2*L/Superperiods]),'],guidata(gcbo))']); |
---|
69 | |
---|
70 | handles.superperiod3 = uimenu(Menu0, 'Label',sprintf('Superperiod %d',3)); |
---|
71 | set(handles.superperiod3,'Callback', ['plotfamily(''HorizontalAxisSector_Callback'',gcbo,[',sprintf('%f %f',[2*L/Superperiods 3*L/Superperiods]),'],guidata(gcbo))']); |
---|
72 | |
---|
73 | handles.superperiod4 = uimenu(Menu0, 'Label',sprintf('Superperiod %d',4)); |
---|
74 | set(handles.superperiod4,'Callback', ['plotfamily(''HorizontalAxisSector_Callback'',gcbo,[',sprintf('%f %f',[3*L/Superperiods L]),'],guidata(gcbo))']); |
---|
75 | |
---|
76 | end |
---|
77 | |
---|