function Synchronisationsetup_op
%LT2SETUP - GUI for doing LT2 setup

%
% Written by Laurent S. Nadolski



orbfig = findobj(allchild(0),'tag','Timingsetup'); 

if ~isempty(orbfig), delete(orbfig); end
orbfig = findobj(allchild(0),'tag','Timingsetup'); 


kmax = 6; % button number

height = 10 + kmax*30 + 30; %670;
a = figure('Color',[0.8 0.8 0.8], ...
    'Interruptible', 'on', ...   
    'HandleVisibility','off', ...
    'MenuBar','none', ...
    'Name', 'Timingsetup', ...
    'NumberTitle','off', ...
    'Units','pixels', ...
    'Position',[5 70 210*2 height], ...
    'Resize','off', ...
    'Tag','Timingsetup');

height = height - 35;

for k = 1:kmax,
    b1(k) = uicontrol('Parent',a, ...
        'Position',[3 height-(k-1)*30 204 27], ...
        'Interruptible', 'off', ...
        'Tag','button22');
end

for k = 1:kmax,
    b2(k) = uicontrol('Parent',a, ...
        'Position',[3 + 210 height-(k-1)*30 204 27], ...
        'Interruptible', 'off', ...
        'Tag','button22');
end

set(b1(1), 'Callback','disp([''   Fichiers de Consignes;'']); save_boo;', 'String','Fichiers de Consignes');
set(b1(2), 'Callback','disp([''   Survey;'']); synchro_survey;', 'String','Synchro_survey');
set(b1(3), 'Callback','disp([''   Timing;'']); synchro_injecteur8_rafale;', 'String','Synchronisation');
set(b1(4), 'Callback','disp([''   Timing_test;'']); synchro_rafale_mode_tests;', 'String','Synchro_mode_test');

set(b2(1), 'Callback','disp([''   Scale Kickers;'']); kicker_scaling;', 'String','ANS Kickers Scaling');


b = uicontrol('Parent',a, ...
    'Callback','close all', ...
    'String','Close All Figures', ...
    'Position',[3 height-kmax*30 204 27], ...
    'Userdata',[], ...
    'Interruptible', 'off', ...   
    'Tag','button2');

b = uicontrol('Parent',a, ...
    'Callback','diary off; close(get(findobj(gcbf,''Tag'',''button1''),''Userdata''));', ...
    'Position',[3 + 210 height-kmax*30 204 27], ...
    'String','CLOSE', ...
    'Userdata',a, ...
    'Interruptible', 'off', ...   
    'Tag','button1');

