function busGUI()                   

%**************************************************************%
%This functions creates a graphical user interface which       %
%contains an animation of the Bus Suspension example.  This    %
%function was created for the Control Tutorials for Matlab. It %
%requires the function busFUN.m to be executed.                %       
%                                                              %
%Copyright (C) 1997 by the Regents of the University of        %
%Michigan.                                                     %
%**************************************************************%                

a = figure('Color',[1 1 1], ...
        'Position',[42 371 600 600], ...
        'Tag','Fig1');  

whitebg
whitebg
        
b = uicontrol('Parent',a, ...
        'Units','normalized', ...
        'BackgroundColor',[0 0 0], ...
        'Position',[0.161667 0.66 0.253333 0.125], ...
        'Style','frame', ...
        'Tag','stepframe');
        
b = uicontrol('Parent',a, ...
        'Units','normalized', ...
        'BackgroundColor',[1 1 1], ...
        'Position',[0.171667 0.725 0.236667 0.05], ...
        'String','Manual Advance', ...
        'Style','checkbox', ...
        'Tag','manbox');
        
b = uicontrol('Parent',a, ...
        'Units','normalized', ...
        'BackgroundColor',[1 1 1], ...
        'Position',[0.171667 0.67 0.236667 0.0483333], ...
        'String','Plot Separately', ...
        'Style','checkbox', ...
        'Tag','plotbox');
        
b = uicontrol('Parent',a, ...
        'Units','normalized', ...
        'BackgroundColor',[0 0 0], ...
        'Position',[0.108333 0.52 0.361667 0.128333], ...
        'Style','frame', ...
        'Tag','Frame1');
        
b = uicontrol('Parent',a, ...
        'Units','normalized', ...
        'BackgroundColor',[1 1 1], ...
        'Position',[0.116667 0.53 0.345 0.108333], ...
        'Style','frame', ...
        'Tag','timeframe');
        
b = uicontrol('Parent',a, ...
        'Units','normalized', ...
        'BackgroundColor',[1 1 1], ...
        'Callback','busFUN(3)', ...
        'Max',1e+07, ...
        'Min',-1e+06, ...
        'Position',[0.208333 0.55 0.160 0.03], ...
        'Style','slider', ...
        'Tag','gainslider', ...
        'Value',1e+06);
        
b = uicontrol('Parent',a, ...
        'Units','normalized', ...
        'BackgroundColor',[1 1 1], ...
        'Position',[0.188333 0.6 0.0916667 0.0216667], ...
        'String','GAIN:', ...
        'Style','text', ...
        'Tag','gain_text');
        
b = uicontrol('Parent',a, ...
        'Units','normalized', ...
        'BackgroundColor',[1 1 1], ...
        'Position',[0.281667 0.6 0.101667 0.0216667], ...
        'String','1.0e+06', ...
        'Style','text', ...
        'Tag','curtext');
        
b = uicontrol('Parent',a, ...
        'Units','normalized', ...
        'BackgroundColor',[0 0 0], ...
        'Position',[0.176667 0.795 0.226667 0.168333], ...
        'Style','frame', ...
        'Tag','ballxframe');
        
b = uicontrol('Parent',a, ...
        'Units','normalized', ...
        'BackgroundColor',[1 1 1], ...
        'Position',[0.185 0.803333 0.21 0.15], ...
        'Style','frame', ...
        'Tag','thetaframe');
        
b = uicontrol('Parent',a, ...
        'Units','normalized', ...
        'BackgroundColor',[1 0 0], ...
        'Callback','busFUN(1)', ...
        'Position',[0.2325 0.886667 0.116667 0.0433333], ...
        'String','RUN', ...
        'Tag','Runbutton', ...
        'Value',1);
        
b = uicontrol('Parent',a, ...
        'Units','normalized', ...
        'BackgroundColor',[1 1 0], ...
        'Callback','busFUN(2)', ...
        'Position',[0.244167 0.826667 0.0933333 0.0433333], ...
        'String','RESET', ...
        'Tag','Restbutton');
        
b = uicontrol('Parent',a, ...
        'Units','normalized', ...
        'BackgroundColor',[1 1 1], ...
        'Position',[0.368333 0.545 0.085 0.0316667], ...
        'String','1e+7', ...
        'Style','text', ...
        'Tag','StaticText1');
        
b = uicontrol('Parent',a, ...
        'Units','normalized', ...
        'BackgroundColor',[1 1 1], ...
        'Position',[0.126667 0.55 0.0816667 0.03], ...
        'String','-1e+6', ...
        'Style','text', ...
        'Tag','StaticText1');
        
b = axes('Parent',a, ...
        'Box','on', ...
        'Color',[1 1 1], ...
        'Position',[0.13 0.11 0.327023 0.343902], ...
        'Tag','Axes3', ...
        'XColor',[0 0 0], ...
        'XLim',[-76 16], ...
        'XLimMode','manual', ...
        'YColor',[0 0 0]);
        
c = text('Parent',b, ...
        'Color',[0 0 0], ...
        'HorizontalAlignment','center', ...
        'Position',[-30 -0.0946602 0], ...
        'String','Real Axis', ...
        'Tag','Text9', ...
        'VerticalAlignment','cap');
set(get(c,'Parent'),'XLabel',c);

c = text('Parent',b, ...
        'Color',[0 0 0], ...
        'HorizontalAlignment','center', ...
        'Position',[-88.5026 0.502427 0], ...
        'Rotation',90, ...
        'String','Imag Axis', ...
        'Tag','Text10', ...
        'VerticalAlignment','baseline');
set(get(c,'Parent'),'YLabel',c);
        
c = text('Parent',b, ...
        'Color',[0 0 0], ...
        'HorizontalAlignment','center', ...
        'Position',[-30 1.03641 0], ...
        'String','Open-loop Root Locus', ...
        'Tag','Text11', ...
        'VerticalAlignment','bottom');
set(get(c,'Parent'),'Title',c);

b = axes('Parent',a, ...
        'Box','on', ...
        'Color',[1 1 1], ...
        'Position',[0.577977 0.581098 0.327023 0.343902], ...
        'Tag','Axes1', ...
        'XColor',[0 0 0], ...
        'YColor',[0 0 0]);
        
c = text('Parent',b, ...
        'Color',[0 0 0], ...
        'HorizontalAlignment','center', ...
        'Position',[0.497449 1.03659 0], ...
        'String','Bus response to a step disturbance of 0.1m', ...
        'Tag','Text1', ...
        'VerticalAlignment','bottom');
set(get(c,'Parent'),'Title',c);

c = text('Parent',b, ...
        'Color',[0 0 0], ...
        'HorizontalAlignment','center', ...
        'Position',[0.497449 -0.095122 0], ...
        'String','Time (sec.)', ...
        'Tag','Text2', ...
        'VerticalAlignment','cap');
set(get(c,'Parent'),'XLabel',c);

c = text('Parent',b, ...
        'Color',[0 0 0], ...
        'HorizontalAlignment','center', ...
        'Position',[-0.135204 0.5 0], ...
        'Rotation',90, ...
        'String','Bus oscillation (m)', ...
        'Tag','Text3', ...
        'VerticalAlignment','baseline');
set(get(c,'Parent'),'YLabel',c);

b = axes('Parent',a, ...
        'Box','on', ...
        'Color',[1 1 1], ...
        'Position',[0.577977 0.11 0.327023 0.343902], ...
        'Tag','Axes2', ...
        'XColor',[0 0 0], ...
        'XLim',[-1 1], ...
        'XLimMode','manual', ...
        'YColor',[0 0 0], ...
        'YLim',[0 2], ...
        'YLimMode','manual');
        
c = text('Parent',b, ...
        'Color',[0 0 0], ...
        'HorizontalAlignment','center', ...
        'Position',[-0.00510204 2.07282 0], ...
        'String','1/4 Bus suspension model animation', ...
        'Tag','Text5', ...
        'VerticalAlignment','bottom');
set(get(c,'Parent'),'Title',c);

c = text('Parent',b, ...
        'Color',[0 0 0], ...
        'HorizontalAlignment','center', ...
        'Position',[-0.00510204 -0.18932 0], ...
        'Tag','Text6', ...
        'VerticalAlignment','cap');
set(get(c,'Parent'),'XLabel',c);

c = text('Parent',b, ...
        'Color',[0 0 0], ...
        'HorizontalAlignment','center', ...
        'Position',[-1.27041 1.00485 0], ...
        'Rotation',90, ...
        'Tag','Text7', ...
        'VerticalAlignment','baseline');
set(get(c,'Parent'),'YLabel',c);
