Subversion Repositories OpenFresco

Rev

Rev 285 | Rev 287 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

function GUI_Template(varargin)

%%%%%%%%%%%%%%%%%%%%%
%Create GUI Template%
%%%%%%%%%%%%%%%%%%%%%

% Check if window already exists
if ~isempty(findobj('Tag','OpenFresco Quick Start'))
   figure(findobj('Tag','OpenFresco Quick Start'));
   return
end

%Check for .tcl and report files and delete if found
fclose('all');
if exist('OPFAnalysis.tcl','file')
    delete(which('OPFAnalysis.tcl'));
end
if exist('OPFReport.txt','file')
    delete(which('OPFReport.txt'));
end


%Get window size
SS = get(0,'screensize');

%Pre-allocate colors and fonts
fig_color = [0 0.45 1.0];
panel_color = [0.3 0.5 0.7];
panelDefault = [0.941176 0.941176 0.941176];
font = 'Lucinda Sans';
         
%Load Buttons
%Sidebar
DIR = pwd;
sideButWidth  = 0.8*SS(3)*0.1*0.84;
sideButHeight = 0.8*SS(4)*0.5*0.16;
Analysis0     = imresize(imread(which('Analysis0.png')), [(sideButHeight) (sideButWidth)]);
Analysis1     = imresize(imread(which('Analysis1.png')), [(sideButHeight) (sideButWidth)]);
ExpControl0   = imresize(imread(which('ExpControl0.png')), [(sideButHeight) (sideButWidth)]);
ExpControl1   = imresize(imread(which('ExpControl1.png')), [(sideButHeight) (sideButWidth)]);
ExpSetup0     = imresize(imread(which('ExpSetup0.png')), [(sideButHeight) (sideButWidth)]);
ExpSetup1     = imresize(imread(which('ExpSetup1.png')), [(sideButHeight) (sideButWidth)]);
Loading0      = imresize(imread(which('Loading0.png')), [(sideButHeight) (sideButWidth)]);
Loading1      = imresize(imread(which('Loading1.png')), [(sideButHeight) (sideButWidth)]);
Structure0    = imresize(imread(which('Structure0.png')), [(sideButHeight) (sideButWidth)]);
Structure1    = imresize(imread(which('Structure1.png')), [(sideButHeight) (sideButWidth)]);

%Structure Images
% height = SS(4)*0.8*0.8*0.44;
% width = SS(3)*0.8*0.81*0.315;
% height = SS(4)*0.8*0.8*0.45;
% width = SS(3)*0.8*0.81*0.32;
% height = SS(4)*0.8*0.8*0.445;
% width = SS(3)*0.8*0.81*0.318;
structureWidth  = 0.8*SS(3)*0.81*0.318;
structureHeight = 0.8*SS(4)*0.9*0.445;
Model1A0 = imresize(imread(which('Model1A0.png')), [structureHeight structureWidth]);
Model1A1 = imresize(imread(which('Model1A1.png')), [structureHeight structureWidth]);
Model2A0 = imresize(imread(which('Model2A0.png')), [structureHeight structureWidth]);
Model2A1 = imresize(imread(which('Model2A1.png')), [structureHeight structureWidth]);
Model2B0 = imresize(imread(which('Model2B0.png')), [structureHeight structureWidth]);
Model2B1 = imresize(imread(which('Model2B1.png')), [structureHeight structureWidth]);

%Loading Page
loadingWidth  = 0.8*SS(3)*0.81*0.1;
loadingHeight = 0.8*SS(4)*0.9*0.08;
GM0 = imresize(imread(which('GroundMotions0.png')), [loadingHeight loadingWidth]);
GM1 = imresize(imread(which('GroundMotions1.png')), [loadingHeight loadingWidth]);
IC0 = imresize(imread(which('InitialConditions0.png')), [loadingHeight loadingWidth]);
IC1 = imresize(imread(which('InitialConditions1.png')), [loadingHeight loadingWidth]);

%Experimental Control Page
ECWidth  = 0.8*SS(3)*0.81*0.1;
ECHeight = 0.8*SS(4)*0.9*0.08;
CP0   = imresize(imread(which('ControlPoint0.png')), [ECHeight ECWidth]);
CP1   = imresize(imread(which('ControlPoint1.png')), [ECHeight ECWidth]);
Sim0  = imresize(imread(which('Simulation0.png')), [ECHeight ECWidth]);
Sim1  = imresize(imread(which('Simulation1.png')), [ECHeight ECWidth]);
Real0 = imresize(imread(which('RealController0.png')), [ECHeight ECWidth]);
Real1 = imresize(imread(which('RealController1.png')), [ECHeight ECWidth]);


%Analysis Page
analysisWidth1  = 0.8*SS(3)*0.81*0.5*0.3;
analysisHeight1 = 0.8*SS(4)*0.9*0.197*0.627;
Start0a = imresize(imread(which('Start0.png')), [analysisHeight1 analysisWidth1]);
Start1a = imresize(imread(which('Start1.png')), [analysisHeight1 analysisWidth1]);
Pause0a = imresize(imread(which('Pause0.png')), [analysisHeight1 analysisWidth1]);
Pause1a = imresize(imread(which('Pause1.png')), [analysisHeight1 analysisWidth1]);
Stop0a  = imresize(imread(which('Stop0.png')), [analysisHeight1 analysisWidth1]);
Stop1a  = imresize(imread(which('Stop1.png')), [analysisHeight1 analysisWidth1]);

%Analysis Controls
analysisWidth2 = 0.1*SS(3)*0.94*0.835;
analysisHeight2 = 0.265*SS(4)*0.94*0.3;
Start0b = imresize(imread(which('Start0.png')), [analysisHeight2 analysisWidth2]);
Start1b = imresize(imread(which('Start1.png')), [analysisHeight2 analysisWidth2]);
Pause0b = imresize(imread(which('Pause0.png')), [analysisHeight2 analysisWidth2]);
Pause1b = imresize(imread(which('Pause1.png')), [analysisHeight2 analysisWidth2]);
Stop0b  = imresize(imread(which('Stop0.png')), [analysisHeight2 analysisWidth2]);
Stop1b  = imresize(imread(which('Stop1.png')), [analysisHeight2 analysisWidth2]);

%Question Button
questWidth = SS(4)*0.8*0.81*0.32*0.1;
questHeight = SS(3)*0.8*0.9*0.28*0.07;
Question0 = imresize(imread(which('Question0.png')),[questHeight questWidth]);
Question1 = imresize(imread(which('Question1.png')),[questHeight questWidth]);


%Main Figure
f = figure('Visible','off',...
           'Name','OpenFresco Quick Start',...
           'NumberTitle','off',...
           'MenuBar','none',...
           'Tag','OpenFresco Quick Start',...
           'Color',fig_color,...
           'Position',[0.1*SS(3) 0.1*SS(4) 0.8*SS(3) 0.8*SS(4)],...
           'Resize','off',...
           'KeyPressFcn',@shortcutKeys,...
           'CloseRequestFcn',@Quit_Program);
       
Background = axes('Parent',f,'Position',[0 0 1 1]);
imagesc(imread(which('Metal.jpg')));
set(Background,'XTick',[],'YTick',[]);

%Menubar
Menu(1) = uimenu('Position',1,'Label','File');
Menu(2) = uimenu(Menu(1),'Position',1,'Label','Load        Ctrl+L', ...
   'Callback','MenuBar(''load'')');
Menu(3) = uimenu(Menu(1),'Position',2,'Label','Save        Ctrl+S', ...
   'Callback','MenuBar(''save'')');
Menu(4) = uimenu(Menu(1),'Position',3,'Label','Quit        Ctrl+Q',...
   'Callback',@Quit_Program);


%Sidebar Tabs
Sidebar(1) = uibuttongroup('Parent',f,...
    'BackgroundColor',panel_color,...
    'Position',[0.03 .45 .1 .5]);
         Sidebar(7) = uicontrol(Sidebar(1),'Style','togglebutton',...
             'Tag','Structure',...
             'Units','normalized',...
             'FontName',font,...
             'Position',[0.08 0.8 0.84 0.16],...
             'CData',Structure0);
         Sidebar(8) = uicontrol(Sidebar(1),'Style','togglebutton',...
             'Tag','Loading',...
             'Units','normalized',...
             'FontName',font,...
             'Position',[0.08 0.61 0.84 0.16],...
             'CData',Loading0);
         Sidebar(9) = uicontrol(Sidebar(1),'Style','togglebutton',...
             'Tag','Experimental Setup',...
             'Units','normalized',...
             'FontName',font,...
             'Position',[0.08 0.42 0.84 0.16],...
             'CData',ExpSetup0);
         Sidebar(10) = uicontrol(Sidebar(1),'Style','togglebutton',...
             'Tag','Experimental Control',...
             'Units','normalized',...
             'FontName',font,...
             'Position',[0.08 0.23 0.84 0.16],...
             'CData',ExpControl0);
         Sidebar(11) = uicontrol(Sidebar(1),'Style','togglebutton',...
             'Tag','Analysis',...
             'Units','normalized',...
             'FontName',font,...
             'Position',[0.08 0.04 0.84 0.16],...
             'CData',Analysis0);
         set(Sidebar(1),'SelectionChangeFcn',@template_toggle_Callback);
         set(Sidebar(1),'SelectedObject',[]);

Sidebar(2) = uicontrol('Parent',f,...
    'Style','pushbutton',...
    'String','User Tips',...
    'Units','normalized',...
    'BackgroundColor',panel_color,...
    'Callback','Links(''User Tips'')',...
    'Position',[0.03 0.36 0.1 0.04]);
                 
         
%Main Display Panel
ph_Main = uipanel('Parent',f,...
    'BackgroundColor',panel_color,...
    'Position',[0.16 0.05 0.81 0.9]);



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%        
%Create Structure Page%
%%%%%%%%%%%%%%%%%%%%%%%

%Title      
Struct(1) = uicontrol(ph_Main,'Style','text',...
    'String','Structural Properties',...
    'FontSize',18,...
    'Units','normalized',...
    'ForegroundColor',[1 1 1],...
    'BackgroundColor',panel_color,...
    'Position',[0.3 0.945 0.4 0.055],...
    'FontName',font,...
    'Visible','off');                      


BackgroundPanel = uipanel('Parent',ph_Main,...
    'Position',[0.04 0.06 0.92 0.88],...
    'Visible','on');
Background = axes('Parent',BackgroundPanel,'Position',[0 0 1 1]);
imagesc(imread(which('greyGradient.png')));
set(Background,'XTick',[],'YTick',[]);


Struct(2) = uibuttongroup('Parent',ph_Main,...
    'BackgroundColor',panel_color,...
    'Position',[0.34 .45 .32 .45],...
    'Visible','off');
         Struct(3) = uicontrol(Struct(2),'Style','togglebutton',...
             'Tag','1 DOF',...
             'Units','normalized',...
             'Position',[0 0 1 1],...
             'CData',Model1A1);
         Struct(4) = uicontrol(Struct(2),'Style','togglebutton',...
             'Tag','2 DOF A',...
             'Units','normalized',...
             'Position',[0 0 1 1],...
             'CData',Model2A0);
         Struct(5) = uicontrol(Struct(2),'Style','togglebutton',...
             'Tag','2 DOF B',...
             'Units','normalized',...
             'Position',[0 0 1 1],...
             'CData',Model2B0);
         set(Struct(2),'SelectionChangeFcn','Structure(''choose DOF'')');
%          set(Struct(2),'SelectedObject',[]);


Struct(30) = uicontrol('Parent',ph_Main,...
    'Style','slider',...
   'Units','normalized',...
   'Position',[0.34 0.42 0.32 0.02],...
   'BackgroundColor',panelDefault,...
   'ForegroundColor',panelDefault,...
   'Min',0,'Max',1, ...
   'SliderStep',[0.5 0.5],...
   'Value',0,...
   'ToolTipString',sprintf('Move the slider to access\ndifferent structure types'),...
   'Visible','off',...
   'Callback','Structure(''scroll'')');


%1 DOF Options                    
Struct(6) = uipanel('Parent',ph_Main,...
    'Position',[0.34 0.35 0.32 0.05],...
    'Visible','off');
Struct(8) = uipanel('Parent',ph_Main,...
    'Position',[0.34 0.1 0.32 0.3],...
    'BackgroundColor',panelDefault,...
    'Visible','off');    

%          Background = axes('Parent',Struct(8),'Position',[0 0 1 1]);
%          imagesc(imread(which('greyGradient.png')));
%          % imagesc(imread(which('Metal.jpg')));
%          set(Background,'XTick',[],'YTick',[]);

         st_Struct_m1 = uicontrol(Struct(8),'Style','text',...
             'Units','normalized',...
             'FontSize',10,...
             'String','m',...
             'BackgroundColor',panelDefault,...
             'Position',[0.025 0.8 0.05 0.1]);
         Struct(7) = uicontrol(Struct(8),'Style','edit',...
             'Units','normalized',...
             'FontSize',10,...
             'String','',...
             'BackgroundColor',[1 1 1],...
             'Position',[0.1 0.8 0.8 0.1],...
             'Tag','Mass',...
             'Callback','Structure(''mass_input'')');
         
         m1_help = uicontrol(Struct(8),'Style','pushbutton',...
             'Units','normalized',...
             'FontSize',10,...
             'Tag','help1',...
             'ToolTipString','Input a positive mass value',...
             'Position',[0.92 0.8 0.064 0.104],...
             'Visible','on',...
             'CData',Question1,...
             'Callback',@helpCallback);
         
         st_Struct_k1 = uicontrol(Struct(8),'Style','text',...
             'Units','normalized',...
             'FontSize',10,...
             'String','k',...
             'BackgroundColor',panelDefault,...
             'Position',[0.025 0.6 0.05 0.1]);
         Struct(9) = uicontrol(Struct(8),'Style','edit',...
             'Units','normalized',...
             'FontSize',10,...
             'String','',...
             'BackgroundColor',[1 1 1],...
             'Position',[0.1 0.6 0.8 0.1],...
             'Tag','Stiffness',...
             'Callback','Structure(''stiffness_input'')');
         k1_help = uicontrol(Struct(8),'Style','pushbutton',...
             'Units','normalized',...
             'FontSize',10,...
             'Tag','help1',...
             'ToolTipString','Input a positive stiffness value',...
             'Position',[0.92 0.6 0.064 0.104],...
             'CData',Question1,...
             'Callback',@helpCallback);
         Struct(10) = uicontrol(Struct(8),'Style','pushbutton',...
             'String','Calculate T',...
             'Units','normalized',...
             'FontSize',10,...
             'BackgroundColor',panelDefault,...
             'Position',[0.1 0.55 0.8 0.1],...
             'Callback','Structure(''period_calc'')');
         Struct(11) = uicontrol(Struct(8),'Style','text',...
             'Units','normalized',...
             'String','Period',...
             'FontSize',10,...
             'Position',[0.1 0.4 0.8 0.1],...
             'BackgroundColor',panelDefault,...
             'Tag','Period');
         Struct(12) = uicontrol(Struct(8),'Style','popupmenu',...
             'String',{'Damping Type: ','Stiffness Proportional','Mass Proportional'},...
             'Value',1,...
             'Units','normalized',...
             'BackgroundColor',[1 1 1],...
             'FontSize',10,...
             'Position',[0.1 0.23 0.8 0.1],...
             'Callback','Structure(''choose damping'')');
         Struct(13) = uicontrol(Struct(8),'Style','edit',...
             'Units','normalized',...
             'FontSize',10,...
             'String','zeta',...
             'BackgroundColor',[1 1 1],...
             'Position',[0.1 0.05 0.8 0.1],...
             'Callback','Structure(''damping_input'')');
         Damp1_help = uicontrol(Struct(8),'Style','pushbutton',...
             'Units','normalized',...
             'FontSize',10,...
             'Tag','help1',...
             'ToolTipString',sprintf('Input damping value as a decimal. For\nexample type 0.05 for 5%% damping.'),...
             'Position',[0.92 0.05 0.064 0.104],...
             'CData',Question1,...
             'Callback',@helpCallback);
                     
%2 DOF A Options                      
Struct(14) = uipanel('Parent',ph_Main,...
    'Position',[0.34 0.35 0.32 0.05],...
    'Visible','off');        
Struct(16) = uipanel('Parent',ph_Main,...
    'Position',[0.34 0.1 0.32 0.3],...
    'BackgroundColor',panelDefault,...
    'Visible','off');
         st_Struct_m2A1 = uicontrol(Struct(16),'Style','text',...
             'Units','normalized',...
             'FontSize',10,...
             'String','m1',...
             'BackgroundColor',panelDefault,...
             'Position',[0.015 0.8 0.07 0.1]);
         Struct(15) = uicontrol(Struct(16),'Style','text',...
             'Units','normalized',...
             'FontSize',10,...
             'String','',...
             'BackgroundColor',panelDefault,...
             'Tag','m1A',...
             'Position',[0.1 0.8 0.35 0.1],...
             'Callback','Structure(''mass_input'')');
         st_Struct_m2A2 = uicontrol(Struct(16),'Style','text',...
             'Units','normalized',...
             'FontSize',10,...
             'String','m2',...
             'BackgroundColor',panelDefault,...
             'Position',[0.465 0.8 0.07 0.1]);
         Struct(31) = uicontrol(Struct(16),'Style','text',...
             'Units','normalized',...
             'FontSize',10,...
             'String','',...
             'BackgroundColor',panelDefault,...
             'Tag','m2A',...
             'Position',[0.55 0.8 0.35 0.1],...
             'Callback','Structure(''mass_input'')');
         m2_help = uicontrol(Struct(16),'Style','pushbutton',...
             'Units','normalized',...
             'FontSize',10,...
             'Tag','help2A',...
             'ToolTipString',sprintf('Input the nodal mass values\nto form the mass matrix\nM = [m1 0; 0 m2]'),...
             'Position',[0.92 0.8 0.064 0.104],...
             'CData',Question0,...
             'Callback',@helpCallback);


         st_Struct_k2A1 = uicontrol(Struct(16),'Style','text',...
             'Units','normalized',...
             'FontSize',10,...
             'String','k1',...
             'BackgroundColor',panelDefault,...
             'Tag','k1A',...
             'Position',[0.015 0.6 0.07 0.1]);
         Struct(17) = uicontrol(Struct(16),'Style','text',...
             'Units','normalized',...
             'FontSize',10,...
             'String','',...
             'BackgroundColor',panelDefault,...
             'Tag','k1A',...
             'Position',[0.1 0.6 0.35 0.1],...
             'Callback','Structure(''stiffness_input'')');
         st_Struct_k2A2 = uicontrol(Struct(16),'Style','text',...
             'Units','normalized',...
             'FontSize',10,...
             'String','k2',...
             'BackgroundColor',panelDefault,...
             'Position',[0.465 0.6 0.07 0.1]);
         Struct(32) = uicontrol(Struct(16),'Style','text',...
             'Units','normalized',...
             'FontSize',10,...
             'String','',...
             'BackgroundColor',panelDefault,...
             'Tag','k2A',...
             'Position',[0.55 0.6 0.35 0.1],...
             'Callback','Structure(''stiffness_input'')');
         k2_help = uicontrol(Struct(16),'Style','pushbutton',...
             'Units','normalized',...
             'FontSize',10,...
             'Tag','help2A',...
             'ToolTipString',sprintf('Enter k1 and k2 to form\nthe stiffness matrix K = \n[k1+k2 -k2; -k2 k2]'),...
             'Position',[0.92 0.6 0.064 0.104],...
             'CData',Question0,...
             'Callback',@helpCallback);
         Struct(18) = uicontrol(Struct(16),'Style','pushbutton',...
             'String','Calculate T',...
             'Units','normalized',...
             'FontSize',10,...
             'Position',[0.1 0.55 0.8 0.1],...
             'Callback','Structure(''period_calc'')');
         Struct(19) = uicontrol(Struct(16),'Style','text',...
             'Units','normalized',...
             'FontSize',10,...
             'String','Period',...
             'BackgroundColor',panelDefault,...
             'Position',[0.1 0.4 0.8 0.1]);
         Struct(20) = uicontrol(Struct(16),'Style','popupmenu',...
             'String',{'Damping Type: ','Stiffness Proportional','Mass Proportional','Rayleigh'},...
             'Value',1,...
             'Units','normalized',...
             'FontSize',10,...
             'BackgroundColor',panelDefault,...
             'Position',[0.1 0.23 0.8 0.1],...
             'Callback','Structure(''choose damping'')');
         Struct(21) = uicontrol(Struct(16),'Style','text',...
             'Units','normalized',...
             'FontSize',10,...
             'String','zeta',...
             'BackgroundColor',panelDefault,...
             'Position',[0.1 0.05 0.8 0.1],...
             'Callback','Structure(''damping_input'')');
         Damp2_help = uicontrol(Struct(16),'Style','pushbutton',...
             'Units','normalized',...
             'FontSize',10,...
             'Tag','help2A',...
             'ToolTipString',sprintf('Input damping value as a decimal. For\nexample type 0.05 for 5%% damping.\nFor Rayleigh damping, two values\nare required in the form [zeta1 zeta2]'),...
             'Position',[0.92 0.05 0.064 0.104],...
             'CData',Question0,...
             'Callback',@helpCallback);
         
%2 DOF B Options                      
Struct(22) = uipanel('Parent',ph_Main,...
    'Position',[0.34 0.35 0.32 0.05],...
    'Visible','off');
       
Struct(24) = uipanel('Parent',ph_Main,...
    'Position',[0.34 0.1 0.32 0.3],...
    'BackgroundColor',panelDefault,...
    'Visible','off');
       st_Struct_m2Ba = uicontrol(Struct(24),'Style','text',...
           'Units','normalized',...
           'FontSize',10,...
           'String','m1',...
           'BackgroundColor',panelDefault,...
           'Position',[0.015 0.8 0.07 0.1]);
       Struct(23) = uicontrol(Struct(24),'Style','text',...
           'Units','normalized',...
           'FontSize',10,...
           'String','',...
           'BackgroundColor',panelDefault,...
           'Tag','m1B',...
           'Position',[0.1 0.8 0.35 0.1],...
           'Callback','Structure(''mass_input'')');
       st_Struct_m2Bb = uicontrol(Struct(24),'Style','text',...
           'Units','normalized',...
           'FontSize',10,...
           'String','m2',...
           'BackgroundColor',panelDefault,...
           'Position',[0.465 0.8 0.07 0.1]);
       Struct(33) = uicontrol(Struct(24),'Style','text',...
           'Units','normalized',...
           'FontSize',10,...
           'String','',...
           'BackgroundColor',panelDefault,...
           'Tag','m2B',...
           'Position',[0.55 0.8 0.35 0.1],...
           'Callback','Structure(''mass_input'')');
       m3_help = uicontrol(Struct(24),'Style','pushbutton',...
             'Units','normalized',...
             'FontSize',10,...
             'Tag','help2B',...
             'ToolTipString',sprintf('Input the nodal mass values\nto form the mass matrix\nM = [m1 0; 0 m2]'),...
             'Position',[0.92 0.8 0.064 0.104],...
             'CData',Question0,...
             'Callback',@helpCallback);
         
       st_Struct_k2Ba = uicontrol(Struct(24),'Style','text',...
           'Units','normalized',...
           'FontSize',10,...
           'String','k1',...
           'BackgroundColor',panelDefault,...
           'Position',[0.015 0.6 0.07 0.1]);
       Struct(25) = uicontrol(Struct(24),'Style','text',...
           'Units','normalized',...
           'FontSize',10,...
           'String','',...
           'BackgroundColor',panelDefault,...
           'Tag','k1B',...
           'Position',[0.1 0.6 0.35 0.1],...
           'Callback','Structure(''stiffness_input'')');
       st_Struct_k2Bb = uicontrol(Struct(24),'Style','text',...
           'Units','normalized',...
           'FontSize',10,...
           'String','k2',...
           'BackgroundColor',panelDefault,...
           'Position',[0.465 0.6 0.07 0.1]);
       Struct(34) = uicontrol(Struct(24),'Style','text',...
           'Units','normalized',...
           'FontSize',10,...
           'String','',...
           'BackgroundColor',panelDefault,...
           'Tag','k2B',...
           'Position',[0.55 0.6 0.35 0.1],...
           'Callback','Structure(''stiffness_input'')');
       k3_help = uicontrol(Struct(24),'Style','pushbutton',...
             'Units','normalized',...
             'FontSize',10,...
             'Tag','help2B',...
             'ToolTipString',sprintf('Enter k1 and k2 to form\nthe stiffness matrix K = \n[k1 0; 0 k2]'),...
             'Position',[0.92 0.6 0.064 0.104],...
             'CData',Question0,...
             'Callback',@helpCallback);
       Struct(26) = uicontrol(Struct(24),'Style','pushbutton',...
           'String','Calculate T',...
           'FontSize',10,...
           'Units','normalized',...
           'Position',[0.1 0.55 0.8 0.1],...
           'Callback','Structure(''period_calc'')');
       Struct(27) = uicontrol(Struct(24),'Style','text',...
           'Units','normalized',...
           'FontSize',10,...
           'String','Period',...
           'BackgroundColor',panelDefault,...
           'Position',[0.1 0.4 0.8 0.1]);
       Struct(28) = uicontrol(Struct(24),'Style','popupmenu',...
           'String',{'Damping Type: ','Stiffness Proportional','Mass Proportional','Rayleigh'},...
           'Value',1,...
           'Units','normalized',...
           'FontSize',10,...
           'BackgroundColor',panelDefault,...
           'Position',[0.1 0.23 0.8 0.1],...
           'Callback','Structure(''choose damping'')');
       Struct(29) = uicontrol(Struct(24),'Style','text',...
           'Units','normalized',...
           'FontSize',10,...
           'String','zeta',...
           'BackgroundColor',panelDefault,...
           'Position',[0.1 0.05 0.8 0.1],...
           'Callback','Structure(''damping_input'')');
       Damp3_help = uicontrol(Struct(24),'Style','pushbutton',...
             'Units','normalized',...
             'FontSize',10,...
             'Tag','help2B',...
             'ToolTipString',sprintf('Input damping value as a decimal. For\nexample type 0.05 for 5%% damping.\nFor Rayleigh damping, two values\nare required in the form [zeta1 zeta2]'),...
             'Position',[0.92 0.05 0.064 0.104],...
             'CData',Question0,...
             'Callback',@helpCallback);

       
   
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%        
%Create Ground Motions Page%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Title
GM(1) = uicontrol(ph_Main,'Style','text',...
    'String','Loading',...
    'FontSize',18,...
    'ForegroundColor',[1 1 1],...
    'BackgroundColor',panel_color,...
    'Units','normalized',...
    'Position',[0.3 0.945 0.4 0.055],...
    'FontName',font,...
    'Visible','off');

GM(18) = uipanel('Parent',ph_Main,...
    'Visible','off',...
    'BackgroundColor',panelDefault,...
    'Position',[0.15 0.1 0.7 0.72]);

%Tab Buttons      
GM(19) = uicontrol(ph_Main,'Style','togglebutton',...
    'Tag','Ground Motions',...
    'Units','normalized',...
    'Value',1,...
    'Position',[0.15 0.82 0.1 0.08],...
    'Visible','off',...
    'Callback','GroundMotions(''tab toggle'')',...
    'CData',GM1);
GM(20) = uicontrol(ph_Main,'Style','togglebutton',...
    'Tag','Initial Conditions',...
    'Units','normalized',...
    'Value',0,...
    'Position',[0.25 0.82 0.1 0.08],...
    'Visible','off',...
    'Callback','GroundMotions(''tab toggle'')',...
    'CData',IC0);

%Ground Motion Options
%DOF 1                    
GM(2) = uipanel('Parent',GM(18),...
    'Position',[0.2 0.64 0.35 0.33],...
    'Tag','Direction 1',...
    'BackgroundColor',panelDefault,...
    'Visible','off');
         st_GM_Xlabel = uicontrol(GM(2),'Style','text',...
             'Units','normalized',...
             'String','DOF 1',...
             'FontSize',10,...
             'FontWeight','bold',...
             'BackgroundColor',panelDefault,...
             'Position',[0.45 0.88 0.15 0.1]);
         st_GM_Xfile = uicontrol(GM(2),'Style','text',...
             'Units','normalized',...
             'String','File',...
             'BackgroundColor',panelDefault,...
             'Position',[0.03 0.75 0.1 0.1]);
         GM(3) = uicontrol(GM(2),'Style','edit',...
             'Units','normalized',...
             'String','...',...
             'BackgroundColor',[1 1 1],...
             'Tag','GM(3)',...
             'Position',[0.25 0.72 0.43 0.15],...
             'Callback','GroundMotions(''manual load'')');
         pbh_GM_Xbrowse = uicontrol(GM(2),'Style','pushbutton',...
             'Units','normalized',...
             'String','...',...
             'Tag','pbh_GM_Xbrowse',...
             'Position',[0.71 0.72 0.1 0.15],...
             'Callback','GroundMotions(''load'')');
         GM_help = uicontrol(GM(2),'Style','pushbutton',...
             'Units','normalized',...
             'FontSize',10,...
             'Tag','GMhelp',...
             'ToolTipString',sprintf('You can click on this button to find\nground motions from PEER or CESMD,\nor you can upload your own file.\nNote that unrecognized formats require\nthe time step to be input manually.'),...
             'Position',[0.85 0.72 0.083 0.132],...
             'CData',Question1,...
             'Callback','Links(''GM'')');
         st_dt = uicontrol(GM(2),'Style','text',...
             'Units','normalized',...
             'String','dt',...
             'BackgroundColor',panelDefault,...
             'Position',[0.03 0.56 0.1 0.1]);
         GM(28) = uicontrol(GM(2),'Style','text',...
             'Units','normalized',...
             'String','...',...
             'BackgroundColor',panelDefault,...
             'Tag','dt1',...
             'Position',[0.25 0.53 0.43 0.15],...
             'Callback','GroundMotions(''manual dt'')');
             
         %Divide Frame
         Height = 0.005;
         uicontrol(GM(2),'Style','frame', ...
             'Units','normalized', ...
             'BackgroundColor',[0 0 0],...
             'ForegroundColor',[0 0 0],...
             'Position',[0.00 0.5 1.00 Height]);
         st_GM_Xscale = uicontrol(GM(2),'Style','text',...
             'Units','normalized',...
             'String','Scale Factors',...
             'FontSize',10,...
             'FontWeight','bold',...
             'BackgroundColor',panelDefault,...
             'Position',[0.15 0.35 0.8 0.1]);
         st_GM_Xamp = uicontrol(GM(2),'Style','text',...
             'Units','normalized',...
             'String','Amplitude',...
             'BackgroundColor',panelDefault,...
             'Position',[0.01 0.2 0.2 0.1]);
         GM(4) = uicontrol(GM(2),'Style','edit',...
             'Units','normalized',...
             'String','1.0',...
             'BackgroundColor',[1 1 1],...
             'Tag','edit_amp1',...
             'Position',[0.25 0.2 0.56 0.15],...
             'Callback','GroundMotions(''scale'')');
         agScale_help = uicontrol(GM(2),'Style','pushbutton',...
             'Units','normalized',...
             'FontSize',10,...
             'Tag','Scalehelp',...
             'ToolTipString',sprintf('The ground motion record can be scaled\nin amplitude and time if required.'),...
             'Position',[0.85 0.2 0.083 0.132],...
             'CData',Question1,...
             'Callback',@helpCallback);
         st_GM_Xdt = uicontrol(GM(2),'Style','text',...
             'Units','normalized',...
             'String','Time',...
             'BackgroundColor',panelDefault,...
             'Position',[0.03 0.02 0.125 0.1]);
         GM(5) = uicontrol(GM(2),'Style','edit',...
             'Units','normalized',...
             'String','1.0',...
             'BackgroundColor',[1 1 1],...
             'Tag','edit_time1',...
             'Position',[0.25 0.02 0.56 0.15],...
             'Callback','GroundMotions(''scale'')');
%          GM(6) = uicontrol(GM(2),'Style','pushbutton',...
%              'Units','normalized',...
%              'String','Apply Scale Factors',...
%              'Tag','scale_1',...
%              'Position',[0.33 0.01 0.4 0.15],...
%              'Callback','GroundMotions(''scale'')');
         GM(7) = axes('Parent',GM(18),'Position',[0.12 0.47 0.35 0.15],'Box','on',...
             'Tag','a_GM_Xag','Visible','off','NextPlot','replacechildren',...
             'ButtonDownFcn','displayAxes(''ag1'')','FontWeight','bold');
             grid('on');
             xlabel(GM(7),'Time [sec]');
             ylabel(GM(7),'ag [L/sec^2]');
         GM(8) = axes('Parent',GM(18),'Position',[0.12 0.25 0.35 0.15],'Box','on',...
             'Tag','a_GM_XSa','Visible','off','NextPlot','replacechildren','XTickLabel',[],...
             'ButtonDownFcn','displayAxes(''Sa1'')','FontWeight','bold');
             grid('on');
             ylabel(GM(8),'Sa [L/sec^2]');        
         GM(9) = axes('Parent',GM(18),'Position',[0.12 0.08 0.35 0.15],'Box','on',...
             'Tag','a_GM_XSd','Visible','off','NextPlot','replacechildren',...
             'ButtonDownFcn','displayAxes(''Sd1'')','FontWeight','bold');
             grid('on');
             xlabel(GM(9),'Period [sec]');
             ylabel(GM(9),'Sd [L]');        

%DOF 2
GM(10) = uipanel('Parent',GM(18),...
    'Position',[0.56 0.64 0.35 0.33],...
    'Tag','Direction 2',...
    'BackgroundColor',panelDefault,...
    'Visible','off');
         sty = uicontrol(GM(10),'Style','text',...
             'Units','normalized',...
             'String','DOF 2',...
             'FontSize',10,...
             'FontWeight','bold',...
             'BackgroundColor',panelDefault,...
             'Position',[0.45 0.88 0.15 0.1]);
         st_GM_Yfile = uicontrol(GM(10),'Style','text',...
             'Units','normalized',...
             'String','File',...
             'BackgroundColor',panelDefault,...
             'Position',[0.03 0.75 0.1 0.1]);
         GM(11) = uicontrol(GM(10),'Style','edit',...
             'Units','normalized',...
             'String','...',...
             'BackgroundColor',[1 1 1],...
             'Tag','GM(10)',...
             'Position',[0.25 0.72 0.43 0.15],...
             'Callback','GroundMotions(''manual load'')');
         pbh_GM_Ybrowse = uicontrol(GM(10),'Style','pushbutton',...
             'Units','normalized',...
             'String','...',...
             'Tag','pbh_GM_Ybrowse',...
             'Position',[0.71 0.72 0.1 0.15],...
             'Callback','GroundMotions(''load'')');
         GM_help = uicontrol(GM(10),'Style','pushbutton',...
             'Units','normalized',...
             'FontSize',10,...
             'Tag','GMhelp',...
             'ToolTipString',sprintf('You can click on this button to find\nground motions from PEER or CESMD,\nor you can upload your own file.\nNote that unrecognized formats require\nthe time step to be input manually.'),...
             'Position',[0.85 0.72 0.083 0.132],...
             'CData',Question1,...
             'Callback','Links(''GM'')');
         st_dty = uicontrol(GM(10),'Style','text',...
             'Units','normalized',...
             'String','dt',...
             'BackgroundColor',panelDefault,...
             'Position',[0.03 0.56 0.1 0.1]);
         GM(29) = uicontrol(GM(10),'Style','text',...
             'Units','normalized',...
             'String','...',...
             'BackgroundColor',panelDefault,...
             'Tag','dt2',...
             'Position',[0.25 0.53 0.43 0.15],...
             'Callback','GroundMotions(''manual dt'')');
         %Divide Frame
         Height = 0.005;
         uicontrol(GM(10),'Style','frame', ...
             'Units','normalized', ...
             'BackgroundColor',[0 0 0],...
             'ForegroundColor',[0 0 0],...
             'Position',[0.00 0.5 1.00 Height]);
         st_GM_Yscale = uicontrol(GM(10),'Style','text',...
             'Units','normalized',...
             'String','Scale Factors',...
             'FontSize',10,...
             'FontWeight','bold',...
             'BackgroundColor',panelDefault,...
             'Position',[0.15 0.35 0.8 0.1]);
         st_GM_Yamp = uicontrol(GM(10),'Style','text',...
             'Units','normalized',...
             'String','Amplitude',...
             'BackgroundColor',panelDefault,...
             'Position',[0.01 0.2 0.2 0.1]);
         GM(12) = uicontrol(GM(10),'Style','edit',...
             'Units','normalized',...
             'String','1.0',...
             'BackgroundColor',[1 1 1],...
             'Tag','edit_amp2',...
             'Position',[0.25 0.2 0.56 0.15],...
             'Callback','GroundMotions(''scale'')');
         agScale_help = uicontrol(GM(10),'Style','pushbutton',...
             'Units','normalized',...
             'FontSize',10,...
             'Tag','Scalehelp',...
             'ToolTipString',sprintf('The ground motion record is automatically\nsclaed by gravity in units of in/s^2.'),...
             'Position',[0.85 0.2 0.083 0.132],...
             'CData',Question1,...
             'Callback',@helpCallback);
         st_GM_Ydt = uicontrol(GM(10),'Style','text',...
             'Units','normalized',...
             'String','Time',...
             'BackgroundColor',panelDefault,...
             'Position',[0.03 0.02 0.125 0.1]);
         GM(13) = uicontrol(GM(10),'Style','edit',...
             'Units','normalized',...
             'String','1.0',...
             'BackgroundColor',[1 1 1],...
             'Tag','edit_time2',...
             'Position',[0.25 0.02 0.56 0.15],...
             'Callback','GroundMotions(''scale'')');
%          GM(14) = uicontrol(GM(10),'Style','pushbutton',...
%              'Units','normalized',...
%              'String','Apply Scale Factors',...
%              'Tag','scale_2',...
%              'Position',[0.33 0.01 0.4 0.15],...
%              'Callback','GroundMotions(''scale'')');
         GM(15) = axes('Parent',GM(18),'Position',[0.56 0.47 0.35 0.15],'Box','on',...
             'Tag','a_GM_Yag','Visible','off','NextPlot','replacechildren',...
             'ButtonDownFcn','displayAxes(''ag2'')');
             grid('on');
             xlabel(GM(15),'Time [sec]');
             ylabel(GM(15),'ag [L/sec^2]');
         GM(16) = axes('Parent',GM(18),'Position',[0.56 0.25 0.35 0.15],'Box','on',...
             'Tag','a_GM_YSa','Visible','off','XTickLabel',[],'NextPlot','replacechildren',...
             'ButtonDownFcn','displayAxes(''Sa2'')');
             grid('on');
             ylabel(GM(16),'Sa [L/sec^2]');        
         GM(17) = axes('Parent',GM(18),'Position',[0.56 0.08 0.35 0.15],'Box','on',...
             'Tag','a_GM_YSd','Visible','off','NextPlot','replacechildren',...
             'ButtonDownFcn','displayAxes(''Sd2'')');
             grid('on');
             xlabel(GM(17),'Period [sec]');
             ylabel(GM(17),'Sd [L]');  
             
%Initial Conditions
GM(21) = uipanel('Parent',ph_Main,...
    'Visible','off',...
    'BackgroundColor',panelDefault,...
    'Position',[0.15 0.1 0.7 0.72]);
GM(22) = uipanel('Parent',GM(21),...
    'Position',[0.2 0.64 0.6 0.33],...
    'Tag','Initial Conditions',...
    'BackgroundColor',panelDefault,...
    'Visible','off');
         stID = uicontrol(GM(22),'Style','text',...
             'Units','normalized',...
             'String','Initial Displacement',...
             'BackgroundColor',panelDefault,...
             'Position',[0.03 0.67 0.23 0.13]);
         GM(27) = uicontrol(GM(22),'Style','popupmenu',...
             'Units','normalized',...
             'String',{'Choose Mode...','Mode 1','User Defined'},...
             'Value',1,...
             'FontSize',10,...
             'BackgroundColor',[1 1 1],...
             'Tag','GM(27)',...
             'Position',[0.30 0.7 0.27 0.15],...
             'Callback','GroundMotions(''initialDispType'')');
         GM(23) = uicontrol(GM(22),'Style','edit',...
             'Units','normalized',...
             'String','Enter displacement here',...
             'BackgroundColor',[1 1 1],...
             'Tag','GM(23)',...
             'Position',[0.59 0.7 0.27 0.15],...
             'Callback','GroundMotions(''initialDisp'')');
         stRT = uicontrol(GM(22),'Style','text',...
             'Units','normalized',...
             'String','Ramp Time',...
             'BackgroundColor',panelDefault,...
             'Position',[0.03 0.42 0.15 0.1]);
         GM(24) = uicontrol(GM(22),'Style','edit',...
             'Units','normalized',...
             'String','',...
             'BackgroundColor',[1 1 1],...
             'Tag','GM(24)',...
             'Position',[0.30 0.4 0.56 0.15],...
             'Callback','GroundMotions(''rampTime'')');
         stVT = uicontrol(GM(22),'Style','text',...
             'Units','normalized',...
             'String','Free Vibration Time',...
             'BackgroundColor',panelDefault,...
             'Position',[0.03 0.1 0.23 0.13]);
         GM(25) = uicontrol(GM(22),'Style','edit',...
             'Units','normalized',...
             'String','',...
             'BackgroundColor',[1 1 1],...
             'Tag','GM(25)',...
             'Position',[0.30 0.1 0.56 0.15],...
             'Callback','GroundMotions(''vibTime'')');
%          GM(26) = axes('Parent',GM(21),'Position',[0.2 0.15 0.6 0.4],'Box','on',...
%              'Tag','ICplot','Visible','off','NextPlot','replacechildren');
         GM(26) = uipanel('Parent',GM(21),'Position',[0.2 0.03 0.6 0.58],...
             'Tag','ICplot','Visible','off');
         ICimage = axes('Parent',GM(26),'Position',[0 0 1 1]);
         imagesc(imread(which('FreeVibration.png')));
         set(ICimage,'XTick',[],'YTick',[]);
         
         InitDispHelp = uicontrol(GM(22),'Style','pushbutton',...
             'Units','normalized',...
             'FontSize',10,...
             'ToolTipString',sprintf('Input initial displacement value.\nFor 2 DOF Models, two values\nare required in the form [U1 U2]'),...
             'Position',[0.90 0.71 0.049 0.132],...
             'CData',Question1,...
             'Callback',@helpCallback);
         
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%        
%Create Experimental Setup Page%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Title
ExpSetup(1) = uicontrol(ph_Main,'Style','text',...
    'String','Experimental Setup',...
    'FontSize',18,...
    'Units','normalized',...
    'ForegroundColor',[1 1 1],...
    'BackgroundColor',panel_color,...
    'Position',[0.3 0.945 0.4 0.055],...
    'FontName',font,...
    'Visible','off');

%Image Button Group      
ExpSetup(2) = uibuttongroup('Parent',ph_Main,...
    'BackgroundColor',[0.3 0.5 0.7],...
    'Position',[0.25 .2 .5 .6],...
    'Visible','off');
         ExpSetup(3) = uicontrol(ExpSetup(2),'Style','togglebutton',...
             'Tag','1 DOF',...
             'Units','normalized',...
             'Position',[0 0 1 1]);
         ExpSetup(4) = uicontrol(ExpSetup(2),'Style','togglebutton',...
             'Tag','2 DOF A',...
             'Units','normalized',...
             'Position',[0 0 1 1]);
         ExpSetup(5) = uicontrol(ExpSetup(2),'Style','togglebutton',...
             'Tag','2 DOF B',...
             'Units','normalized',...
             'Position',[0 0 1 1]);
         ExpSetup(6) = uicontrol(ExpSetup(2),'Style','pushbutton',...
             'Units','normalized',...
             'String','!',...
             'Position',[0.8 0 0.2 0.2],...
             'Callback','ExpSetup(''extra options'')');
         set(ExpSetup(2),'SelectionChangeFcn','ExpSetup(''choose DOF'')');
         
Background = axes('Parent',ExpSetup(2),'Position',[0 0 1 1]);
imagesc(imread(which('greyGradient.png')));
% imagesc(imread(which('Metal.jpg')));
set(Background,'XTick',[],'YTick',[]);          
                     
                     
                     
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%        
%Create Experimental Control Page%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Title      
ExpControl(1) = uicontrol(ph_Main,'Style','text',...
    'String','Experimental Control',...
    'FontSize',18,...
    'ForegroundColor',[1 1 1],...
    'BackgroundColor',panel_color,...
    'Units','normalized',...
    'Position',[0.3 0.945 0.4 0.055],...
    'FontName',font,...
    'Visible','off');

% ExpControl(97) = uipanel('Parent',ph_Main,...
%     'Position',[0.05 0.03 0.9 0.89],...
%     'Visible','off');
% Background = axes('Parent',ExpControl(97),'Position',[0 0 1 1]);
% imagesc(imread(which('greyGradient.png')));
% % imagesc(imread(which('Metal.jpg')));
% set(Background,'XTick',[],'YTick',[]);


%Tab Buttons      
ExpControl(2) = uicontrol(ph_Main,'Style','togglebutton',...
    'Tag','Control Point',...
    'Units','normalized',...
    'Value',0,...
    'Position',[0.35 0.82 0.1 0.08],...
    'Visible','off',...
    'Callback','ExpControl(''tab toggle'')',...
    'CData',CP0);
ExpControl(3) = uicontrol(ph_Main,'Style','togglebutton',...
    'Tag','Simulation',...
    'Units','normalized',...
    'Value',1,...
    'Position',[0.15 0.82 0.1 0.08],...
    'Visible','off',...
    'Callback','ExpControl(''tab toggle'')',...
    'CData',Sim1);
ExpControl(4) = uicontrol(ph_Main,'Style','togglebutton',...
    'Tag','Real Controller',...
    'Units','normalized',...
    'Position',[0.25 0.82 0.1 0.08],...
    'Visible','off',...
    'Callback','ExpControl(''tab toggle'')',...
    'CData',Real0);                    

%Experimental Control Option Panels
%Simulation Panel
ExpControl(5) = uipanel('Parent',ph_Main,...
    'Visible','off',...
    'BackgroundColor',panelDefault,...
    'Position',[0.15 0.1 0.7 0.72]);
         ExpControl(6) = uicontrol(ExpControl(5),'Style','popupmenu',...
             'String',{'Choose DOF...','DOF 1'},...
             'Value',1,...
             'FontSize',10,...
             'Units','normalized',...
             'BackgroundColor',[1 1 1],...
             'Position',[0.05 0.77 0.2 0.15],...
             'Callback','ExpControl(''CtrlDOF'')');
         ExpControl(7) = uipanel('Parent',ExpControl(5),...
             'Visible','off',...
             'BackgroundColor',panelDefault,...
             'Position',[0.05 0.5 0.9 0.3]);
                uicontrol(ExpControl(7),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Define Control',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0.01 0.65 0.25 0.2]);
                ExpControl(8) = uicontrol(ExpControl(7),'Style','popupmenu',...
                    'String',{'Control Types...','SimUniaxialMaterial'},...
                    'Value',1,...
                    'FontSize',10,...
                    'Units','normalized',...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.7 0.4 0.2],...
                    'Callback','ExpControl(''Sim control'')');
                uicontrol(ExpControl(7),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Number of Actuators',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0.01 0.35 0.25 0.2]);
                ExpControl(9) = uicontrol(ExpControl(7),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.40 0.4 0.2],...
                    'String','1',...
                    'Callback','ExpControl(''NumAct'')');
                uicontrol(ExpControl(7),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Choose Material',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0.01 0.05 0.25 0.2]);
                ExpControl(10) = uicontrol(ExpControl(7),'Style','popupmenu',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'String',{'Material Type...','Elastic','Elastic-Perfectly Plastic','Steel - Bilinear','Steel - Giuffré-Menegotto-Pinto'},...
                    'Position',[0.31 0.1 0.4 0.2],...
                    'Callback','ExpControl(''Sim Material'')');
                SimMatHelp = uicontrol(ExpControl(7),'Style','pushbutton',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'Tag','SimMatHelp',...
                    'ToolTipString',sprintf('Click to learn more about the material types'),...
                    'Position',[0.75 0.14 0.032 0.15],...
                    'CData',Question1,...
                    'Callback','Links(''Sim Material'')');
               
         %Simulation Material Types
         %Elastic Panel
         ExpControl(11) = uipanel('Parent',ExpControl(5),...
             'Visible','off',...
             'BackgroundColor',panelDefault,...
             'Position',[0.05 0.35 0.9 0.15]);
                uicontrol(ExpControl(11),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Elastic Modulus (E)',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.15 0.25 0.45]);
                ExpControl(12) = uicontrol(ExpControl(11),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.3 0.4 0.4],...
                    'Callback','ExpControl(''E'')');
                ElasticHelp = uicontrol(ExpControl(11),'Style','pushbutton',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'Tag','ElasticHelp',...
                    'ToolTipString',sprintf('Click to learn more about elastic material parameters'),...
                    'Position',[0.75 0.34 0.032 0.29],...
                    'CData',Question1,...
                    'Callback','Links(''Sim Material'')');
         %EPP Panel
         ExpControl(13) = uipanel('Parent',ExpControl(5),...
             'Visible','off',...
             'BackgroundColor',panelDefault,...
             'Position',[0.05 0.29 0.9 0.21]);
                uicontrol(ExpControl(13),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Elastic Modulus (E)',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.48 0.25 0.3]);
                ExpControl(14) = uicontrol(ExpControl(13),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.58 0.4 0.25],...
                    'Callback','ExpControl(''E'')');
                uicontrol(ExpControl(13),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Plastic Strain Point (epsP)',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.03 0.25 0.3]);
                ExpControl(15) = uicontrol(ExpControl(13),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.13 0.4 0.25],...
                    'Callback','ExpControl(''epsP'')');
                EPPHelp = uicontrol(ExpControl(13),'Style','pushbutton',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'Tag','EPPHelp',...
                    'ToolTipString',sprintf('Click to learn more about elastic-\nperfectly plastic material parameters'),...
                    'Position',[0.75 0.6 0.032 0.2],...
                    'CData',Question1,...
                    'Callback','Links(''Sim Material'')');
         %Steel Bilinear Panel
         ExpControl(16) = uipanel('Parent',ExpControl(5),...
             'Visible','off',...
             'BackgroundColor',panelDefault,...
             'Position',[0.05 0.2 0.9 0.3]);
                uicontrol(ExpControl(16),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Yield Strength (Fy)',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.6 0.25 0.25]);
                ExpControl(17) = uicontrol(ExpControl(16),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.7 0.4 0.2],...
                    'Callback','ExpControl(''Fy'')');
                uicontrol(ExpControl(16),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Initial Elastic Modulus (E0)',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.3 0.25 0.25]);
                ExpControl(18) = uicontrol(ExpControl(16),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.4 0.4 0.2],...
                    'Callback','ExpControl(''E0'')');
                uicontrol(ExpControl(16),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Strain Hardening Ratio (b)',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0 0.25 0.25]);
                ExpControl(19) = uicontrol(ExpControl(16),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.1 0.4 0.2],...
                    'Callback','ExpControl(''b'')');
                Steel01Help = uicontrol(ExpControl(16),'Style','pushbutton',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'Tag','Steel01Help',...
                    'ToolTipString',sprintf('Click to learn more about bilinear\nsteel material parameters'),...
                    'Position',[0.75 0.72 0.032 0.155],...
                    'CData',Question1,...
                    'Callback','Links(''Sim Material'')');
         %Steel GMP Panel
         ExpControl(20) = uipanel('Parent',ExpControl(5),...
             'Visible','off',...
             'BackgroundColor',panelDefault,...
             'Position',[0.05 0.05 0.9 0.45]);
                uicontrol(ExpControl(20),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Yield Strength (Fy)',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.77 0.25 0.15]);
                ExpControl(21) = uicontrol(ExpControl(20),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.82 0.4 0.13],...
                    'Callback','ExpControl(''Fy'')');
                uicontrol(ExpControl(20),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Initial Elastic Modulus (E)',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.54 0.25 0.15]);
                ExpControl(22) = uicontrol(ExpControl(20),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.58 0.4 0.13],...
                    'Callback','ExpControl(''E'')');
                uicontrol(ExpControl(20),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Strain Hardening Ratio (b)',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.31 0.25 0.15]);
                ExpControl(23) = uicontrol(ExpControl(20),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.35 0.4 0.13],...
                    'Callback','ExpControl(''b'')');
                uicontrol(ExpControl(20),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Elastic-Plastic Transition (R0)',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.08 0.25 0.15]);
                ExpControl(24) = uicontrol(ExpControl(20),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.11 0.4 0.13],...
                    'Callback','ExpControl(''R0'')');
%                 GMP_help = uicontrol(ExpControl(20),'Style','pushbutton',...
%                     'Units','normalized',...
%                     'FontSize',10,...
%                     'Tag','GMP_help',...
%                     'ToolTipString',sprintf('The variable R0 controls the elastic-plastic transition\nRecommended values range between 10 and 20'),...
%                     'Position',[0.75 0.11 0.032 0.097],...
%                     'CData',Question1,...
%                     'Callback',@helpCallback);
                Steel02Help = uicontrol(ExpControl(20),'Style','pushbutton',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'Tag','Steel02Help',...
                    'ToolTipString',sprintf('Click to learn more about GMP\nsteel material parameters'),...
                    'Position',[0.75 0.84 0.032 0.094],...
                    'CData',Question1,...
                    'Callback','Links(''Sim Material'')');
               
%Real Controller Panel
ExpControl(25) = uipanel('Parent',ph_Main,...
    'Visible','off',...
    'BackgroundColor',panelDefault,...
    'Position',[0.15 0.1 0.7 0.72]);
         ExpControl(26) = uipanel('Parent',ExpControl(25),...
             'Visible','off',...
             'BackgroundColor',panelDefault,...
             'Position',[0.05 0.65 0.9 0.15]);
                uicontrol(ExpControl(26),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Define Control',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.15 0.25 0.45]);
                ExpControl(27) = uicontrol(ExpControl(26),'Style','popupmenu',...
                    'String',{'Control Types...','LabVIEW','MTSCsi','SCRAMNet','dSpace','xPCtarget'},...
                    'Value',1,...
                    'FontSize',10,...
                    'Units','normalized',...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.3 0.4 0.4],...
                    'Callback','ExpControl(''Real control'')');
         %LabVIEW Panels
         ExpControl(28) = uipanel('Parent',ExpControl(25),...
             'Visible','off',...
             'Tag','LabVIEW1',...
             'BackgroundColor',panelDefault,...
             'Position',[0.05 0.45 0.9 0.2]);
                uicontrol(ExpControl(28),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','LabVIEW IP Address',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.48 0.25 0.3]);
                ExpControl(29) = uicontrol(ExpControl(28),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.58 0.4 0.25],...
                    'Callback','ExpControl(''ipAddr'')');
                uicontrol(ExpControl(28),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','LabVIEW IP Port',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.03 0.25 0.3]);
                ExpControl(30) = uicontrol(ExpControl(28),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.13 0.4 0.25],...
                    'Callback','ExpControl(''ipPort'')');
         ExpControl(31) = uipanel('Parent',ExpControl(25),...
             'Visible','off',...
             'Tag','LabVIEW2',...
             'BackgroundColor',panelDefault,...
             'Position',[0.05 0.2 0.9 0.25]);
                uicontrol(ExpControl(31),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Trial CP(s)',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.48 0.25 0.3]);
                ExpControl(32) = uicontrol(ExpControl(31),'Style','listbox',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'String',{'Control Point 1','Control Point 2'},...
                    'Max',6,...
                    'Position',[0.31 0.53 0.4 0.33],...
                    'Callback','ExpControl(''TrialCP'')');
                uicontrol(ExpControl(31),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Output CP(s)',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.03 0.25 0.3]);
                ExpControl(33) = uicontrol(ExpControl(31),'Style','listbox',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'String',{'Control Point 1','Control Point 2'},...
                    'Max',6,...
                    'Position',[0.31 0.08 0.4 0.33],...
                    'Callback','ExpControl(''OutputCP'')');
         %MTSCsi Panels
         ExpControl(34) = uipanel('Parent',ExpControl(25),...
             'Visible','off',...
             'Tag','MTSCsi1',...
             'BackgroundColor',panelDefault,...
             'Position',[0.05 0.45 0.9 0.2]);
                uicontrol(ExpControl(34),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Configuration File Name',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.48 0.25 0.3]);
                ExpControl(35) = uicontrol(ExpControl(34),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.58 0.4 0.25],...
                    'Callback','ExpControl(''ConfigName'')');
                ConfigBrowse = uicontrol(ExpControl(34),'Style','pushbutton',...
                    'Units','normalized',...
                    'String','...',...
                    'Tag','ConfigBrowse',...
                    'Position',[0.74 0.58 0.08 0.25],...
                    'Callback','ExpControl(''loadConfig'')');
                uicontrol(ExpControl(34),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Configuration File Path',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.03 0.25 0.3]);
                ExpControl(36) = uicontrol(ExpControl(34),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.13 0.4 0.25],...
                    'Callback','ExpControl(''ConfigPath'')');
         ExpControl(37) = uipanel('Parent',ExpControl(25),...
             'Visible','off',...
             'Tag','MTSCsi2',...
             'BackgroundColor',panelDefault,...
             'Position',[0.05 0.3 0.9 0.15]);
                uicontrol(ExpControl(37),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Ramp Time',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.35 0.25 0.3]);
                ExpControl(38) = uicontrol(ExpControl(37),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.3 0.4 0.4],...
                    'Callback','ExpControl(''rampTime'')');
         %SCRAMNet Panel
         ExpControl(39) = uipanel('Parent',ExpControl(25),...
             'Visible','off',...
             'Tag','SCRAMNet',...
             'BackgroundColor',panelDefault,...
             'Position',[0.05 0.4 0.9 0.25]);
                uicontrol(ExpControl(39),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Memory Offset (bytes)',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.48 0.25 0.3]);
                ExpControl(40) = uicontrol(ExpControl(39),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.58 0.4 0.25],...
                    'Callback','ExpControl(''memOffset'')');
                uicontrol(ExpControl(39),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Number of Actuator Channels',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.1 0.25 0.3]);
                ExpControl(41) = uicontrol(ExpControl(39),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.13 0.4 0.25],...
                    'Callback','ExpControl(''NumActCh'')');
         %dSpace Panel
         ExpControl(42) = uipanel('Parent',ExpControl(25),...
             'Visible','off',...
             'Tag','dSpace',...
             'BackgroundColor',panelDefault,...
             'Position',[0.05 0.45 0.9 0.2]);
                uicontrol(ExpControl(42),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Predictor-Corrector Type',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.45 0.25 0.35]);
                ExpControl(43) = uicontrol(ExpControl(42),'Style','popupmenu',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'String',{'Choose Type...','Displacement','Displacement and Velocity','Displacement, Velocity and Acceleration'},...
                    'Position',[0.31 0.58 0.4 0.25],...
                    'Callback','ExpControl(''PCtype'')');
                uicontrol(ExpControl(42),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Board Name',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.03 0.25 0.3]);
                ExpControl(44) = uicontrol(ExpControl(42),'Style','popupmenu',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'String',{'Choose Board Name...','DS1103','DS1104'},...
                    'Position',[0.31 0.13 0.4 0.25],...
                    'Callback','ExpControl(''boardName'')');
         %xPCtarget Panels
         ExpControl(45) = uipanel('Parent',ExpControl(25),...
             'Visible','off',...
             'Tag','xPCtarget1',...
             'BackgroundColor',panelDefault,...
             'Position',[0.05 0.5 0.9 0.15]);
                uicontrol(ExpControl(45),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Predictor-Corrector Type',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.15 0.25 0.45]);
                ExpControl(46) = uicontrol(ExpControl(45),'Style','popupmenu',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'String',{'Choose Type...','Displacement','Displacement and Velocity','Displacement, Velocity and Acceleration'},...
                    'Position',[0.31 0.3 0.4 0.4],...
                    'Callback','ExpControl(''PCtype'')');
         ExpControl(47) = uipanel('Parent',ExpControl(25),...
             'Visible','off',...
             'Tag','xPCtarget2',...
             'BackgroundColor',panelDefault,...
             'Position',[0.05 0.3 0.9 0.2]);
                uicontrol(ExpControl(47),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','xPC Target IP Address',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.48 0.25 0.3]);
                ExpControl(48) = uicontrol(ExpControl(47),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.58 0.4 0.25],...
                    'Callback','ExpControl(''ipAddr'')');
                uicontrol(ExpControl(47),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','xPC Target IP Port',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.03 0.25 0.3]);
                ExpControl(49) = uicontrol(ExpControl(47),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','22222',...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.13 0.4 0.25],...
                    'Callback','ExpControl(''ipPort'')');
         ExpControl(50) = uipanel('Parent',ExpControl(25),...
             'Visible','off',...
             'Tag','xPCtarget3',...
             'BackgroundColor',panelDefault,...
             'Position',[0.05 0.1 0.9 0.2]);
                uicontrol(ExpControl(50),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Application Name',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.48 0.25 0.3]);
                ExpControl(51) = uicontrol(ExpControl(50),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.58 0.4 0.25],...
                    'Callback','ExpControl(''appName'')');
                AppBrowse = uicontrol(ExpControl(50),'Style','pushbutton',...
                    'Units','normalized',...
                    'String','...',...
                    'Tag','AppBrowse',...
                    'Position',[0.74 0.58 0.08 0.25],...
                    'Callback','ExpControl(''loadApp'')');
                uicontrol(ExpControl(50),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Application Path',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.03 0.25 0.3]);
                ExpControl(52) = uicontrol(ExpControl(50),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.13 0.4 0.25],...
                    'Callback','ExpControl(''appPath'')');

%Control Points Panel
ExpControl(53) = uipanel('Parent',ph_Main,...
    'Visible','off',...
    'BackgroundColor',panelDefault,...
    'Position',[0.15 0.1 0.7 0.72]);
         ExpControl(54) = uicontrol(ExpControl(53),'Style','popupmenu',...
             'String',{'Existing Control Points...','Control Point 1','Control Point 2'},...
             'Value',1,...
             'FontSize',10,...
             'Units','normalized',...
             'BackgroundColor',[1 1 1],...
             'Position',[0.05 0.77 0.2 0.15],...
             'Callback','ExpControl(''SwitchCP'')');
         ExpControl(55) = uipanel('Parent',ExpControl(53),...
             'Visible','off',...
             'Tag','CP1',...
             'BackgroundColor',panelDefault,...
             'Position',[0.05 0.53 0.9 0.27]);
                uicontrol(ExpControl(55),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Name',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0.01 0.7 0.25 0.2]);
                ExpControl(56) = uicontrol(ExpControl(55),'Style','edit',...
                    'FontSize',10,...
                    'Units','normalized',...
                    'String','',...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.75 0.4 0.2]);
                uicontrol(ExpControl(55),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Node Number',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0.01 0.4 0.25 0.2]);
                ExpControl(57) = uicontrol(ExpControl(55),'Style','edit',...
                    'String','1',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.45 0.4 0.2],...
                    'Callback','ExpControl(''nodeNum'')');
                uicontrol(ExpControl(55),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Response Quantities',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0.01 0.1 0.25 0.2]);
                ExpControl(58) = uicontrol(ExpControl(55),'Style','edit',...
                    'Units','normalized',...
                    'String','1',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.15 0.4 0.2],...
                    'Callback','ExpControl(''RQNum'')');
               
         %Control Point Options
         ExpControl(59) = uipanel('Parent',ExpControl(53),...
             'Visible','off',...
             'Tag','CP2',...
             'BackgroundColor',panelDefault,...
             'Position',[0.05 0.1 0.9 0.43]);
                uicontrol(ExpControl(59),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Direction',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0.31 0.77 0.1 0.15]);
                uicontrol(ExpControl(59),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Response',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0.43 0.77 0.1 0.15]);
                uicontrol(ExpControl(59),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Factor',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0.55 0.77 0.1 0.15]);
                uicontrol(ExpControl(59),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String',sprintf('Assign\nLimits?'),...
                    'BackgroundColor',panelDefault,...
                    'Position',[0.67 0.78 0.1 0.2]);
                uicontrol(ExpControl(59),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String',sprintf('Lower\nLimit'),...
                    'BackgroundColor',panelDefault,...
                    'Position',[0.76 0.78 0.1 0.2]);
                uicontrol(ExpControl(59),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String',sprintf('Upper\nLimit'),...
                    'BackgroundColor',panelDefault,...
                    'Position',[0.88 0.78 0.1 0.2]);
                %Divide Frame
                Height = 0.005;
                uicontrol(ExpControl(59),'Style','frame', ...
                    'Units','normalized', ...
                    'BackgroundColor',[0 0 0],...
                    'ForegroundColor',[0 0 0],...
                    'Position',[0.31 0.79 0.68 Height]);
                uicontrol(ExpControl(59),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','Define Control Point',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0 0.56 0.25 0.15]);
                ExpControl(60) = uicontrol(ExpControl(59),'Style','popupmenu',...
                    'String',{'Direction...','UX','UY','UZ','RX','RY','RZ'},...
                    'Value',1,...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.31 0.56 0.1 0.15]);
                ExpControl(61) = uicontrol(ExpControl(59),'Style','popupmenu',...
                    'String',{'Response...','disp','vel','accel','force','time'},...
                    'Value',1,...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.43 0.56 0.1 0.15]);
                ExpControl(62) = uicontrol(ExpControl(59),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','1',...
                    'BackgroundColor',[1 1 1],...
                    'Position',[0.56 0.59 0.08 0.1]);
                ExpControl(63) = uicontrol(ExpControl(59),'Style','checkbox',...
                    'Units','normalized',...
                    'String','',...
                    'Tag','Line1',...
                    'Position',[0.71 0.59 0.2 0.1],...
                    'BackgroundColor',panelDefault,...
                    'Callback','ExpControl(''assign limits'')');
                ExpControl(64) = uicontrol(ExpControl(59),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0.77 0.59 0.08 0.1]);
                ExpControl(65) = uicontrol(ExpControl(59),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','',...
                    'BackgroundColor',panelDefault,...
                    'Position',[0.89 0.59 0.08 0.1]);
               
                ExpControl(66) = uicontrol(ExpControl(59),'Style','popupmenu',...
                    'String',{'Direction...','UX','UY','UZ','RX','RY','RZ'},...
                    'Value',1,...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Visible','off',...
                    'Position',[0.31 0.39 0.1 0.15]);
                ExpControl(67) = uicontrol(ExpControl(59),'Style','popupmenu',...
                    'String',{'Response...','disp','vel','accel','force','time'},...
                    'Value',1,...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Visible','off',...
                    'Position',[0.43 0.39 0.1 0.15]);
                ExpControl(68) = uicontrol(ExpControl(59),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','1',...
                    'BackgroundColor',[1 1 1],...
                    'Visible','off',...
                    'Position',[0.56 0.42 0.08 0.1]);
                ExpControl(69) = uicontrol(ExpControl(59),'Style','checkbox',...
                    'Units','normalized',...
                    'String','',...
                    'Tag','Line2',...
                    'Position',[0.71 0.42 0.2 0.1],...
                    'Visible','off',...
                    'BackgroundColor',panelDefault,...
                    'Callback','ExpControl(''assign limits'')');
                ExpControl(70) = uicontrol(ExpControl(59),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','',...
                    'BackgroundColor',panelDefault,...
                    'Visible','off',...
                    'Position',[0.77 0.42 0.08 0.1]);
                ExpControl(71) = uicontrol(ExpControl(59),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','',...
                    'BackgroundColor',panelDefault,...
                    'Visible','off',...
                    'Position',[0.89 0.42 0.08 0.1]);
               
                ExpControl(72) = uicontrol(ExpControl(59),'Style','popupmenu',...
                    'String',{'Direction...','UX','UY','UZ','RX','RY','RZ'},...
                    'Value',1,...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Visible','off',...
                    'Position',[0.31 0.22 0.1 0.15]);
                ExpControl(73) = uicontrol(ExpControl(59),'Style','popupmenu',...
                    'String',{'Response...','disp','vel','accel','force','time'},...
                    'Value',1,...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Visible','off',...
                    'Position',[0.43 0.22 0.1 0.15]);
                ExpControl(74) = uicontrol(ExpControl(59),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','1',...
                    'BackgroundColor',[1 1 1],...
                    'Visible','off',...
                    'Position',[0.56 0.25 0.08 0.1]);
                ExpControl(75) = uicontrol(ExpControl(59),'Style','checkbox',...
                    'Units','normalized',...
                    'String','',...
                    'Tag','Line3',...
                    'Position',[0.71 0.25 0.2 0.1],...
                    'BackgroundColor',panelDefault,...
                    'Visible','off',...
                    'Callback','ExpControl(''assign limits'')');
                ExpControl(76) = uicontrol(ExpControl(59),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','',...
                    'BackgroundColor',panelDefault,...
                    'Visible','off',...
                    'Position',[0.77 0.25 0.08 0.1]);
                ExpControl(77) = uicontrol(ExpControl(59),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','',...
                    'BackgroundColor',panelDefault,...
                    'Visible','off',...
                    'Position',[0.89 0.25 0.08 0.1]);
               
                ExpControl(78) = uicontrol(ExpControl(59),'Style','popupmenu',...
                    'String',{'Direction...','UX','UY','UZ','RX','RY','RZ'},...
                    'Value',1,...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Visible','off',...
                    'Position',[0.31 0.05 0.1 0.15]);
                ExpControl(79) = uicontrol(ExpControl(59),'Style','popupmenu',...
                    'String',{'Response...','disp','vel','accel','force','time'},...
                    'Value',1,...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Visible','off',...
                    'Position',[0.43 0.05 0.1 0.15]);
                ExpControl(80) = uicontrol(ExpControl(59),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','1',...
                    'BackgroundColor',[1 1 1],...
                    'Visible','off',...
                    'Position',[0.56 0.08 0.08 0.1]);
                ExpControl(81) = uicontrol(ExpControl(59),'Style','checkbox',...
                    'Units','normalized',...
                    'String','',...
                    'Tag','Line4',...
                    'Position',[0.71 0.08 0.2 0.1],...
                    'BackgroundColor',panelDefault,...
                    'Visible','off',...
                    'Callback','ExpControl(''assign limits'')');
                ExpControl(82) = uicontrol(ExpControl(59),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','',...
                    'BackgroundColor',panelDefault,...
                    'Visible','off',...
                    'Position',[0.77 0.08 0.08 0.1]);
                ExpControl(83) = uicontrol(ExpControl(59),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','',...
                    'BackgroundColor',panelDefault,...
                    'Visible','off',...
                    'Position',[0.89 0.08 0.08 0.1]);
               
                ExpControl(84) = uicontrol(ExpControl(59),'Style','popupmenu',...
                    'String',{'Direction...','UX','UY','UZ','RX','RY','RZ'},...
                    'Value',1,...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Visible','off',...
                    'Position',[0.31 0.05 0.1 0.15]);
                ExpControl(85) = uicontrol(ExpControl(59),'Style','popupmenu',...
                    'String',{'Response...','disp','vel','accel','force','time'},...
                    'Value',1,...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Visible','off',...
                    'Position',[0.43 0.05 0.1 0.15]);
                ExpControl(86) = uicontrol(ExpControl(59),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','1',...
                    'BackgroundColor',[1 1 1],...
                    'Visible','off',...
                    'Position',[0.56 0.08 0.08 0.1]);
                ExpControl(87) = uicontrol(ExpControl(59),'Style','checkbox',...
                    'Units','normalized',...
                    'String','',...
                    'Tag','Line5',...
                    'Position',[0.71 0.08 0.2 0.1],...
                    'BackgroundColor',panelDefault,...
                    'Visible','off',...
                    'Callback','ExpControl(''assign limits'')');
                ExpControl(88) = uicontrol(ExpControl(59),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','',...
                    'BackgroundColor',panelDefault,...
                    'Visible','off',...
                    'Position',[0.77 0.08 0.08 0.1]);
                ExpControl(89) = uicontrol(ExpControl(59),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','',...
                    'BackgroundColor',panelDefault,...
                    'Visible','off',...
                    'Position',[0.89 0.08 0.08 0.1]);
               
                ExpControl(90) = uicontrol(ExpControl(59),'Style','popupmenu',...
                    'String',{'Direction...','UX','UY','UZ','RX','RY','RZ'},...
                    'Value',1,...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Visible','off',...
                    'Position',[0.31 0.05 0.1 0.15]);
                ExpControl(91) = uicontrol(ExpControl(59),'Style','popupmenu',...
                    'String',{'Response...','disp','vel','accel','force','time'},...
                    'Value',1,...
                    'Units','normalized',...
                    'FontSize',10,...
                    'BackgroundColor',[1 1 1],...
                    'Visible','off',...
                    'Position',[0.43 0.05 0.1 0.15]);
                ExpControl(92) = uicontrol(ExpControl(59),'Style','edit',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','1',...
                    'BackgroundColor',[1 1 1],...
                    'Visible','off',...
                    'Position',[0.56 0.08 0.08 0.1]);
                ExpControl(93) = uicontrol(ExpControl(59),'Style','checkbox',...
                    'Units','normalized',...
                    'String','',...
                    'Tag','Line6',...
                    'Position',[0.71 0.08 0.2 0.1],...
                    'BackgroundColor',panelDefault,...
                    'Visible','off',...
                    'Callback','ExpControl(''assign limits'')');
                ExpControl(94) = uicontrol(ExpControl(59),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','',...
                    'BackgroundColor',panelDefault,...
                    'Visible','off',...
                    'Position',[0.77 0.08 0.08 0.1]);
                ExpControl(95) = uicontrol(ExpControl(59),'Style','text',...
                    'Units','normalized',...
                    'FontSize',10,...
                    'String','',...
                    'BackgroundColor',panelDefault,...
                    'Visible','off',...
                    'Position',[0.89 0.08 0.08 0.1]);
               
         ExpControl(96) = uicontrol('Parent', ExpControl(53),...
             'Style','pushbutton',...
             'String','Save Control Point',...
             'Units','normalized',...
             'FontSize',10,...
             'Position',[0.8 0.01 0.15 0.06],...
             'Visible','off',...
             'Callback','ExpControl(''saveCP'')');



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%        
%Create Analysis Page%
%%%%%%%%%%%%%%%%%%%%%%

%Title      
Analysis(1) = uicontrol(ph_Main,'Style','text',...
    'String','Analysis',...
    'FontSize',18,...
    'Units','normalized',...
    'ForegroundColor',[1 1 1],...
    'BackgroundColor',panel_color,...
    'Position',[0.3 0.945 0.4 0.055],...
    'FontName',font,...
    'Visible','off');

%Create Panel
Analysis(2) = uipanel('Parent',ph_Main,...
    'Position',[0.25 0.65 0.5 0.2],...
    'Tag','AnalysisPanel',...
    'BackgroundColor',panelDefault,...
    'Visible','off');
        uicontrol(Analysis(2),'Style','text',...
            'Units','normalized',...
            'FontSize',10,...
            'String','dt: ',...
            'BackgroundColor',panelDefault,...
            'Position',[0.1 0.66 0.05 0.1]);
        Analysis(3) = uicontrol(Analysis(2),'Style','edit',...
            'Units','normalized',...
            'BackgroundColor',[1 1 1],...
            'FontSize',10,...
            'String','No dt defined!',...
            'Position',[0.18 0.65 0.32 0.15],...
            'Callback','Analysis(''dtAnalysis'')');
        Analysis(4) = uicontrol(Analysis(2),'Style','text',...
            'Units','normalized',...
            'String','<          ...',...
            'BackgroundColor',panelDefault,...
            'FontSize',10,...
            'Position',[0.52 0.62 0.25 0.18]);
        dt_help = uicontrol(Analysis(2),'Style','pushbutton',...
             'Units','normalized',...
             'FontSize',10,...
             'ToolTipString',sprintf('In order to ensure stability when using the\nexplicit Newmark method, dt must be less\nthan the indicated maximum value.'),...
             'Position',[0.8 0.65 0.04 0.157],...
             'CData',Question1,...
             'Callback',@helpCallback);
        Analysis(12) = uicontrol(Analysis(2),'Style','pushbutton',...
             'String','Write TCL File',...
             'Units','normalized',...
             'FontSize',10,...
             'Position',[0.3 0.33 0.4 0.2],...
             'Callback','WriteTCL');
        Analysis(5) = uicontrol(Analysis(2),'Style','pushbutton',...
             'String','Generate Report',...
             'Units','normalized',...
             'FontSize',10,...
             'Position',[0.3 0.05 0.4 0.2],...
             'Callback','Analysis(''generate report'')');

         

%Analysis Button Group    
Analysis(6) = uibuttongroup('Parent',ph_Main,...
    'BackgroundColor',[0.3 0.5 0.7],...
    'Position',[0.25 .3 .5 .2],...
    'Visible','off');
         Analysis(7) = uicontrol(Analysis(6),'Style','togglebutton',...
             'Units','normalized',...
             'Tag','Start',...
             'Position',[0.025 0.187 0.3 0.627],...
             'ToolTipString','Start Analysis',...
             'CData',Start0a);
         Analysis(8) = uicontrol(Analysis(6),'Style','togglebutton',...
             'Units','normalized',...
             'Tag','Pause',...
             'Position',[0.35 0.187 0.3 0.627],...
             'ToolTipString','Pause Analysis',...
             'CData',Pause0a);
         Analysis(9) = uicontrol(Analysis(6),'Style','togglebutton',...
             'Units','normalized',...
             'Tag','Stop',...
             'Position',[0.675 0.187 0.3 0.627],...
             'ToolTipString','Stop Analysis',...
             'CData',Stop0a);
         %Remember to remove string
         set(Analysis(6),'SelectionChangeFcn','Analysis(''choose option'')');
         set(Analysis(6),'SelectedObject',[]);
         
Background = axes('Parent',Analysis(6),'Position',[0 0 1 1]);
imagesc(imread(which('greyGradient.png')));
% imagesc(imread(which('Metal.jpg')));
set(Background,'XTick',[],'YTick',[]);          
         
Analysis(10) = uicontrol('Parent', ph_Main,...
    'Style','pushbutton',...
    'String','Run New Test',...
    'Units','normalized',...
    'FontSize',10,...
    'Position',[0.8 0.15 0.1 0.04],...
    'Visible','off',...
    'Callback','Analysis(''new test'')');        
Analysis(11) = uicontrol('Parent', ph_Main,...
    'Style','pushbutton',...
    'String','Quit',...
    'Units','normalized',...
    'FontSize',10,...
    'Position',[0.8 0.1 0.1 0.04],...
    'Visible','off',...
    'Callback',@Quit_Program);


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Display the GUI
set(f, 'Visible','on');

%%%%%%%%%%%%%%%
% Save handles%
%%%%%%%%%%%%%%%

%Create the structure of handles
handles = guidata(gcf);
handles.Menu = Menu;
handles.Sidebar = Sidebar;
handles.Structure = Struct;
handles.GroundMotions = GM;
handles.ES = ExpSetup;
handles.EC = ExpControl;
handles.Analysis = Analysis;

%%%%%%%%%%%%%%%%%%%
%Initialize Fields%
%%%%%%%%%%%%%%%%%%%

%Store settings and buttons
handles.Store.SS = SS;
handles.Store.font = font;
handles.Store.BackgroundPanel = BackgroundPanel;
handles.Store.sideButWidth = sideButWidth;
handles.Store.sideButHeight = sideButHeight;
handles.Store.Analysis0 = Analysis0;
handles.Store.Analysis1 = Analysis1;
handles.Store.ExpControl0 = ExpControl0;
handles.Store.ExpControl1 = ExpControl1;
handles.Store.ExpSetup0 = ExpSetup0;
handles.Store.ExpSetup1 = ExpSetup1;
handles.Store.Loading0 = Loading0;
handles.Store.Loading1 = Loading1;
handles.Store.Structure0 = Structure0;
handles.Store.Structure1 = Structure1;

handles.Store.structureWidth = structureWidth;
handles.Store.structureHeight = structureHeight;
handles.Store.Model1A0 = Model1A0;
handles.Store.Model1A1 = Model1A1;
handles.Store.Model2A0 = Model2A0;
handles.Store.Model2A1 = Model2A1;
handles.Store.Model2B0 = Model2B0;
handles.Store.Model2B1 = Model2B1;

handles.Store.loadingWidth = loadingWidth;
handles.Store.loadingHeight = loadingHeight;
handles.Store.GM0 = GM0;
handles.Store.GM1 = GM1;
handles.Store.IC0 = IC0;
handles.Store.IC1 = IC1;

handles.Store.ECWidth  = ECWidth;
handles.Store.ECHeight = ECHeight;
handles.Store.CP0   = CP0;
handles.Store.CP1   = CP1;
handles.Store.Sim0  = Sim0;
handles.Store.Sim1  = Sim1;
handles.Store.Real0 = Real0;
handles.Store.Real1 = Real1;

handles.Store.analysisWidth1 = analysisWidth1;
handles.Store.analysisHeight1 = analysisHeight1;
handles.Store.Start0a = Start0a;
handles.Store.Start1a = Start1a;
handles.Store.Pause0a = Pause0a;
handles.Store.Pause1a = Pause1a;
handles.Store.Stop0a  = Stop0a;
handles.Store.Stop1a  = Stop1a;

handles.Store.analysisWidth2 = analysisWidth2;
handles.Store.analysisHeight2 = analysisHeight2;
handles.Store.Start0b = Start0b;
handles.Store.Start1b = Start1b;
handles.Store.Pause0b = Pause0b;
handles.Store.Pause1b = Pause1b;
handles.Store.Stop0b  = Stop0b;
handles.Store.Stop1b  = Stop1b;

handles.Store.questWidth = questWidth;
handles.Store.questHeight = questHeight;
handles.Store.Question0 = Question0;
handles.Store.Question1 = Question1;

handles.Store.Structview = 0;
handles.Store.GMview = 0;

%Initialize Model Parameters
handles.Model.M = [];
handles.Model.K = [];
handles.Model.StopFlag = 0;
handles.Model.firstStart = 1;
handles.Model.Zeta = [];
handles.Model.Type = '1 DOF';
handles.Model.Mass_field = 7;
handles.Model.Stiffness_field = 9;
handles.Model.Period_field = 11;
handles.Model.Damping_field = 13;
handles.Model.ndf = 1;
handles.Model.b = 1;
%Initialize Structure Display
handles.Model.StructActive = [3 6:13];
handles.Model.StructInactive = [4 5 14:29];
%Initialize Element Data
handles.Model.Element{1}.tag = 1;
handles.Model.Element{1}.type = 'Element_ExpGeneric';
handles.Model.Element{1}.kInit = handles.Model.K;
handles.Model.Element{1}.ipAddr = '127.0.0.1';
handles.Model.Element{1}.ipPort = 8090;
handles.Model.Element{1}.id = 1;
%Initialize Ground Motion Data
handles.GM.loadType = 'Ground Motions';
handles.GM.AmpFact(1) = str2num(get(handles.GroundMotions(4),'String'));
handles.GM.TimeFact(1) = str2num(get(handles.GroundMotions(5),'String'));
handles.GM.dt = 0;
handles.GM.t = {0};
handles.GM.ag = {0};
handles.GM.scaledt = 0;
handles.GM.scalet = {0};
handles.GM.scaleag = {0};
handles.GM.Spectra = {0};
handles.GM.initialDisp = [];
handles.GM.rampTime = [];
handles.GM.vibTime = [];
           
%Initialize Experimental Controls
handles.ExpControl.Type = 'Simulation';
handles.ExpControl.DOF1.SimMaterial = [];
handles.ExpControl.DOF2.SimMaterial = [];
handles.ExpControl.DOF1.E = [];
handles.ExpControl.DOF2.E = [];
handles.ExpControl.DOF1.epsP = [];
handles.ExpControl.DOF2.epsP = [];
handles.ExpControl.DOF1.Fy = [];
handles.ExpControl.DOF2.Fy = [];
handles.ExpControl.DOF1.E0 = [];
handles.ExpControl.DOF2.E0 = [];
handles.ExpControl.DOF1.b = [];
handles.ExpControl.DOF2.b = [];
handles.ExpControl.DOF1.R0 = [];
handles.ExpControl.DOF2.R0 = [];
handles.ExpControl.SimControl.SimType = [];
handles.ExpControl.RealControl.Controller = [];
handles.ExpControl.RealControl.ipAddr = [];
handles.ExpControl.RealControl.ipPort = 22222;
handles.ExpControl.RealControl.TrialCP = 1;
handles.ExpControl.RealControl.OutputCP = 1;
handles.ExpControl.RealControl.ConfigName = [];
handles.ExpControl.RealControl.ConfigPath = [];
handles.ExpControl.RealControl.rampTime = [];
handles.ExpControl.RealControl.memOffset = [];
handles.ExpControl.RealControl.NumActCh = [];
handles.ExpControl.RealControl.PCvalue = 1;
handles.ExpControl.RealControl.boardName = [];
handles.ExpControl.RealControl.appName = [];
handles.ExpControl.RealControl.appPath = [];
handles.ExpControl.RealControl.SimMaterial = [];
handles.ExpControl.NumAct = 1;
handles.ExpControl.store.SimActive = 6;
handles.ExpControl.store.RealActive = (26:27);
handles.ExpControl.store.CPActive = (60:65);
handles.ExpControl.store.RQ = 1;
handles.ExpControl.store.DOFOptions = get(handles.EC(6),'String');
handles.ExpControl.store.MatOptions = get(handles.EC(10),'String');
handles.ExpControl.store.CPOptions = get(handles.EC(54),'String');
handles.ExpControl.store.NodeOptions = get(handles.EC(57),'String');
handles.ExpControl.store.DirOptions = get(handles.EC(60),'String');
handles.ExpControl.store.RespOptions = get(handles.EC(61),'String');

%Create Preset Control Points
handles.ExpControl.CP = {};
handles.ExpControl.CP.Name{1} = 'Control Point 1';
handles.ExpControl.CP.NumResp{1} = 1;
handles.ExpControl.CP.Node{1} = 1;
handles.ExpControl.CP.Dir{1,1} = 'UX';
handles.ExpControl.CP.Resp{1,1} = 'disp';
handles.ExpControl.CP.F{1,1} = 1;
handles.ExpControl.CP.Lim{1,1} = 1;
handles.ExpControl.CP.LimL{1,1} = -7.5;
handles.ExpControl.CP.LimU{1,1} = 7.5;
handles.ExpControl.CP.Name{2} = 'Control Point 2';
handles.ExpControl.CP.NumResp{2} = 2;
handles.ExpControl.CP.Node{2} = 1;
handles.ExpControl.CP.Dir{1,2} = 'UX';
handles.ExpControl.CP.Resp{1,2} = 'disp';
handles.ExpControl.CP.F{1,2} = 1;
handles.ExpControl.CP.Lim{1,2} = 1;
handles.ExpControl.CP.LimL{1,2} = -7.5;
handles.ExpControl.CP.LimU{1,2} = 7.5;
handles.ExpControl.CP.Dir{2,2} = 'UX';
handles.ExpControl.CP.Resp{2,2} = 'force';
handles.ExpControl.CP.F{2,2} = 1;
handles.ExpControl.CP.Lim{2,2} = 1;
handles.ExpControl.CP.LimL{2,2} = -12;
handles.ExpControl.CP.LimU{2,2} = 12;

%Store directory
handles.Model.DIR = pwd;


%Save the structure of handles
guidata(gcf,handles);


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Callback for main template tabs
    function template_toggle_Callback(source, eventdata)
        handles = guidata(gcf);
        Page_selection = get(get(source,'SelectedObject'),'Tag');
        if ~strcmp(Page_selection, 'Structure')
            if handles.Store.Structview == 0
                msgbox('Must define structural properties first!','Error','error');
                set(handles.Sidebar(7),'CData',handles.Store.Structure1);
                set(handles.Sidebar(8),'CData',handles.Store.Loading0);
                set(handles.Sidebar(9),'CData',handles.Store.ExpSetup0);
                set(handles.Sidebar(10),'CData',handles.Store.ExpControl0);
                set(handles.Sidebar(11),'CData',handles.Store.Analysis0);
                set(handles.Structure([1 2 30]),'Visible','on');
                set(handles.Structure(handles.Model.StructActive),'Visible','on');
                set(handles.Structure(handles.Model.StructInactive),'Visible','off');
                set(handles.Structure([10 18 26]),'Visible','off');
                handles.Store.Structview = 1;
                guidata(gcbf, handles);
                return
            end
        end
        switch Page_selection;
            case 'Structure'
                if handles.Model.StopFlag == 1
                    msgbox(sprintf('Experiment has ended!\nChoose run new test to make changes'),'Error','error');
                    set(handles.Sidebar(7),'Value',0);
                    set(handles.Sidebar(11),'Value',1);
                    return
                end
                if handles.Store.Structview == 0
                    handles.Store.Structview = 1;
                    guidata(gcbf, handles);
                end
                set(handles.Sidebar(7),'CData',handles.Store.Structure1);
                set(handles.Sidebar(8),'CData',handles.Store.Loading0);
                set(handles.Sidebar(9),'CData',handles.Store.ExpSetup0);
                set(handles.Sidebar(10),'CData',handles.Store.ExpControl0);
                set(handles.Sidebar(11),'CData',handles.Store.Analysis0);
                set(handles.Structure([1 2 30]),'Visible','on');
                set(handles.Structure(handles.Model.StructActive),'Visible','on');
                set(handles.Structure(handles.Model.StructInactive),'Visible','off');
                set(handles.Structure([10 18 26]),'Visible','off');
                set(handles.GroundMotions,'Visible','off');
                set(get(handles.GroundMotions(7), 'Children'), 'Visible', 'off');
                set(get(handles.GroundMotions(8), 'Children'), 'Visible', 'off');
                set(get(handles.GroundMotions(9), 'Children'), 'Visible', 'off');
                set(get(handles.GroundMotions(15), 'Children'), 'Visible', 'off');
                set(get(handles.GroundMotions(16), 'Children'), 'Visible', 'off');
                set(get(handles.GroundMotions(17), 'Children'), 'Visible', 'off');
                set(handles.ES,'Visible','off');
                set(handles.EC,'Visible','off');
                set(handles.Analysis,'Visible','off');
               
                if ~isempty(handles.Model.Type)
                    switch handles.Model.Type
                        case '1 DOF'
                            set(handles.Structure(30),'Value',0);
                        case '2 DOF A'
                            set(handles.Structure(30),'Value',0.5);
                        case '2 DOF B'
                            set(handles.Structure(30),'Value',1);
                    end
                else
                    set(handles.Structure(30),'Value',0);
                end
               
            case 'Loading'
                if handles.Model.StopFlag == 1
                    msgbox(sprintf('Experiment has ended!\nChoose run new test to make changes'),'Error','error');
                    set(handles.Sidebar(8),'Value',0);
                    set(handles.Sidebar(11),'Value',1);
                    return
                end
                if isempty(handles.Model.M) || isempty(handles.Model.K) || isempty(handles.Model.Zeta)
                    msgbox('Must define structural properties first','Error','error');
                    %Return to structure page
                    set(handles.Sidebar(7), 'Value', 1)
                    set(handles.Sidebar(7),'CData',handles.Store.Structure1);
                    set(handles.Sidebar(8),'CData',handles.Store.Loading0);
                    set(handles.Sidebar(9),'CData',handles.Store.ExpSetup0);
                    set(handles.Sidebar(10),'CData',handles.Store.ExpControl0);
                    set(handles.Sidebar(11),'CData',handles.Store.Analysis0);
                    set(handles.Structure([1 2 30]),'Visible','on');
                    set(handles.Structure(handles.Model.StructActive),'Visible','on');
                    set(handles.Structure(handles.Model.StructInactive),'Visible','off');
                    set(handles.Structure([10 18 26]),'Visible','off');
                    set(handles.Structure(30),'Value',0);
                    set(handles.GroundMotions,'Visible','off');
                    set(get(handles.GroundMotions(7), 'Children'), 'Visible', 'off');
                    set(get(handles.GroundMotions(8), 'Children'), 'Visible', 'off');
                    set(get(handles.GroundMotions(9), 'Children'), 'Visible', 'off');
                    set(get(handles.GroundMotions(15), 'Children'), 'Visible', 'off');
                    set(get(handles.GroundMotions(16), 'Children'), 'Visible', 'off');
                    set(get(handles.GroundMotions(17), 'Children'), 'Visible', 'off');
                    %Turn off all other pages
                    return
                end
               
                set(handles.Sidebar(7),'CData',handles.Store.Structure0);
                set(handles.Sidebar(8),'CData',handles.Store.Loading1);
                set(handles.Sidebar(9),'CData',handles.Store.ExpSetup0);
                set(handles.Sidebar(10),'CData',handles.Store.ExpControl0);
                set(handles.Sidebar(11),'CData',handles.Store.Analysis0);
                set(handles.Structure,'Visible','off');
                set(handles.ES,'Visible','off');
                set(handles.EC,'Visible','off');
                set(handles.Analysis,'Visible','off');
                set(get(handles.GroundMotions(7), 'Children'), 'Visible', 'on');
                set(get(handles.GroundMotions(8), 'Children'), 'Visible', 'on');
                set(get(handles.GroundMotions(9), 'Children'), 'Visible', 'on');
                set(get(handles.GroundMotions(15), 'Children'), 'Visible', 'on');
                set(get(handles.GroundMotions(16), 'Children'), 'Visible', 'on');
                set(get(handles.GroundMotions(17), 'Children'), 'Visible', 'on');
               
                if isempty(handles.Model.Type)
                    msgbox('Must select structure type first!','Error','error');
                    %Return to structure page since no structure chosen
                    set(handles.Sidebar(7), 'Value', 1)
                    set(handles.Sidebar(7),'CData',handles.Store.Structure1);
                    set(handles.Sidebar(8),'CData',handles.Store.Loading0);
                    set(handles.Sidebar(9),'CData',handles.Store.ExpSetup0);
                    set(handles.Sidebar(10),'CData',handles.Store.ExpControl0);
                    set(handles.Sidebar(11),'CData',handles.Store.Analysis0);
                    set(handles.Structure([1 2 30]),'Visible','on');
                    set(handles.Structure(handles.Model.StructActive),'Visible','on');
                    set(handles.Structure(handles.Model.StructInactive),'Visible','off');
                    set(handles.Structure([10 18 26]),'Visible','off');
                    set(handles.Structure(30),'Value',0);
                    set(handles.GroundMotions,'Visible','off');
                    set(get(handles.GroundMotions(7), 'Children'), 'Visible', 'off');
                    set(get(handles.GroundMotions(8), 'Children'), 'Visible', 'off');
                    set(get(handles.GroundMotions(9), 'Children'), 'Visible', 'off');
                    set(get(handles.GroundMotions(15), 'Children'), 'Visible', 'off');
                    set(get(handles.GroundMotions(16), 'Children'), 'Visible', 'off');
                    set(get(handles.GroundMotions(17), 'Children'), 'Visible', 'off');
                else
                    switch handles.GM.loadType
                        case 'Ground Motions'
                            if strcmp(handles.Model.Type, '2 DOF B') ~= 1
                                %Hide plots for DOF 2 if 1 DOF or 2 DOF A is chosen
                                set(handles.GroundMotions([1:9 18:20 28]),'Visible','on');
                                set(handles.GroundMotions(2),'Position',[0.2 0.64 0.6 0.33]);
                                set(handles.GroundMotions(7),'Position',[0.2 0.47 0.6 0.15]);
                                set(handles.GroundMotions(8),'Position',[0.2 0.25 0.6 0.15]);
                                set(handles.GroundMotions(9),'Position',[0.2 0.08 0.6 0.15]);
                                set(handles.GroundMotions(10:17),'Visible','off')
                                set(get(handles.GroundMotions(15), 'Children'), 'Visible', 'off');
                                set(get(handles.GroundMotions(16), 'Children'), 'Visible', 'off');
                                set(get(handles.GroundMotions(17), 'Children'), 'Visible', 'off');
                                set(findobj('Tag','GMhelp'),'Position',[0.85 0.72 0.049 0.132]);
                                set(findobj('Tag','Scalehelp'),'Position',[0.85 0.2 0.049 0.132]);
                            else
                                set(handles.GroundMotions([1:20 28 29]),'Visible','on');
                                set(handles.GroundMotions(2),'Position',[0.12 0.64 0.35 0.33]);
                                set(handles.GroundMotions(7),'Position',[0.12 0.47 0.35 0.15]);
                                set(handles.GroundMotions(8),'Position',[0.12 0.25 0.35 0.15]);
                                set(handles.GroundMotions(9),'Position',[0.12 0.08 0.35 0.15]);
                                set(findobj('Tag','GMhelp'),'Position',[0.85 0.72 0.083 0.132]);
                                set(findobj('Tag','Scalehelp'),'Position',[0.85 0.2 0.083 0.132]);
                            end
                           
                            %Give a hint on enlarging graphs
                            if handles.Store.GMview == 0
                                msgbox(sprintf('Note: Once a ground motion is loaded, the\nplots can be enlarged by clicking on them.'));
                                handles.Store.GMview = 1;
                                guidata(gcbf, handles);
                            end
                           
                            %Update spectral response quantity plots if zeta has been
                            %changed
                            if isfield(handles.GM.Spectra{1},'psdAcc')
                                [rows cols] = size(get(handles.GroundMotions(8),'Children'));
                                if (rows ~= length(handles.Model.Zeta)) && ~isempty(handles.Model.Zeta)
                                    m = 1.0;
                                    minT = 0.01;
                                    maxT = 4.99;
                                    numTvalues = 300;
                                    handles.GM.Spectra{1} = ResponseSpectraElastic(handles.GM.scaleag{1},handles.GM.scaledt(1),m,handles.Model.Zeta,minT,maxT,numTvalues);
                                    plot(handles.GroundMotions(8), handles.GM.Spectra{1}.T, handles.GM.Spectra{1}.psdAcc);
                                    plot(handles.GroundMotions(9), handles.GM.Spectra{1}.T, handles.GM.Spectra{1}.dsp);
                                    if strcmp(handles.Model.Type, '2 DOF B')
                                        if length(handles.GM.Spectra) == 2
                                            handles.GM.Spectra{2} = ResponseSpectraElastic(handles.GM.scaleag{2},handles.GM.scaledt(2),m,handles.Model.Zeta,minT,maxT,numTvalues);
                                            plot(handles.GroundMotions(16), handles.GM.Spectra{2}.T, handles.GM.Spectra{2}.psdAcc);
                                            plot(handles.GroundMotions(17), handles.GM.Spectra{2}.T, handles.GM.Spectra{2}.dsp);
                                        end
                                    end
                                end
                            end
                           
                        case 'Initial Conditions'
                            set(handles.GroundMotions(2:17),'Visible','off');
                            set(handles.GroundMotions(18:27),'Visible','on');
                            set(get(handles.GroundMotions(7), 'Children'), 'Visible', 'off');
                            set(get(handles.GroundMotions(8), 'Children'), 'Visible', 'off');
                            set(get(handles.GroundMotions(9), 'Children'), 'Visible', 'off');
                            set(get(handles.GroundMotions(15), 'Children'), 'Visible', 'off');
                            set(get(handles.GroundMotions(16), 'Children'), 'Visible', 'off');
                            set(get(handles.GroundMotions(17), 'Children'), 'Visible', 'off');
                            set(get(handles.GroundMotions(26), 'Children'), 'Visible', 'on');
                            if isempty(handles.Model.M) || isempty(handles.Model.K)
                                msgbox(sprintf('Please define structural properties before\n setting initial conditions.'),'Error','error');
                            end
                    end
                end
                       
               
            case 'Experimental Setup'
                if handles.Model.StopFlag == 1
                    msgbox(sprintf('Experiment has ended!\nChoose run new test to make changes'),'Error','error');
                    set(handles.Sidebar(9),'Value',0);
                    set(handles.Sidebar(11),'Value',1);
                    return
                end
                set(handles.Sidebar(7),'CData',handles.Store.Structure0);
                set(handles.Sidebar(8),'CData',handles.Store.Loading0);
                set(handles.Sidebar(9),'CData',handles.Store.ExpSetup1);
                set(handles.Sidebar(10),'CData',handles.Store.ExpControl0);
                set(handles.Sidebar(11),'CData',handles.Store.Analysis0);
                set(handles.Structure,'Visible','off');
                set(handles.GroundMotions,'Visible','off');
                set(get(handles.GroundMotions(7), 'Children'), 'Visible', 'off');
                set(get(handles.GroundMotions(8), 'Children'), 'Visible', 'off');
                set(get(handles.GroundMotions(9), 'Children'), 'Visible', 'off');
                set(get(handles.GroundMotions(15), 'Children'), 'Visible', 'off');
                set(get(handles.GroundMotions(16), 'Children'), 'Visible', 'off');
                set(get(handles.GroundMotions(17), 'Children'), 'Visible', 'off');
                set(handles.ES,'Visible','on');
                set(handles.EC,'Visible','off');
                set(handles.Analysis,'Visible','off');
               
                if isfield(handles.Model, 'Type')
                    if strcmp(handles.Model.Type, '1 DOF')
                        set(handles.ES(3),'Visible','on')
                        set(handles.ES(4:6),'Visible','off')
                    elseif strcmp(handles.Model.Type, '2 DOF A')
                        set(handles.ES(4),'Visible','on')
                        set(handles.ES([3 5:6]),'Visible','off')
                    else
                        set(handles.ES(5:6),'Visible','on')
                        set(handles.ES(3:4),'Visible','off')
                    end
                else
                    set(handles.ES(3),'Visible','on')
                    set(handles.ES(4:6),'Visible','off')
                end
               
            case 'Experimental Control'
                if handles.Model.StopFlag == 1
                    msgbox(sprintf('Experiment has ended!\nChoose run new test to make changes'),'Error','error');
                    set(handles.Sidebar(10),'Value',0);
                    set(handles.Sidebar(11),'Value',1);
                    return
                end
                set(handles.Sidebar(7),'CData',handles.Store.Structure0);
                set(handles.Sidebar(8),'CData',handles.Store.Loading0);
                set(handles.Sidebar(9),'CData',handles.Store.ExpSetup0);
                set(handles.Sidebar(10),'CData',handles.Store.ExpControl1);
                set(handles.Sidebar(11),'CData',handles.Store.Analysis0);
                set(handles.Structure,'Visible','off');
                set(handles.GroundMotions,'Visible','off');
                set(get(handles.GroundMotions(7), 'Children'), 'Visible', 'off');
                set(get(handles.GroundMotions(8), 'Children'), 'Visible', 'off');
                set(get(handles.GroundMotions(9), 'Children'), 'Visible', 'off');
                set(get(handles.GroundMotions(15), 'Children'), 'Visible', 'off');
                set(get(handles.GroundMotions(16), 'Children'), 'Visible', 'off');
                set(get(handles.GroundMotions(17), 'Children'), 'Visible', 'off');
                set(handles.ES,'Visible','off');
                set(handles.Analysis,'Visible','off');
                if get(handles.EC(2),'Value') == 1
                    set(handles.EC([1:4 53:59 96]),'Visible','on');
                    set(handles.EC(2),'CData',handles.Store.CP1);
                    set(handles.EC(3),'Value',0,'CData',handles.Store.Sim0);
                    set(handles.EC(4),'Value',0,'CData',handles.Store.Real0);
                    if isfield(handles.ExpControl.store,'CPActive')
                        set(handles.EC(handles.ExpControl.store.CPActive),'Visible','on');
                    else
                        set(handles.EC(60:65),'Visible','on');
                    end
                elseif get(handles.EC(3),'Value') == 1
                    set(handles.EC([1 3:6]),'Visible','on');
                    set(handles.EC(2),'Value',0,'CData',handles.Store.CP0);
                    set(handles.EC(3),'CData',handles.Store.Sim1);
                    set(handles.EC(4),'Value',0,'CData',handles.Store.Real0);
                    set(handles.EC(handles.ExpControl.store.SimActive),'Visible','on');
                elseif get(handles.EC(4),'Value') == 1
                    if strcmp(handles.ExpControl.RealControl.Controller, 'LabVIEW')
                        set(handles.EC(2),'Visible','on');
                    end
                    set(handles.EC([1 3 4 25:27]),'Visible','on');
                    set(handles.EC(2),'Value',0,'CData',handles.Store.CP0);
                    set(handles.EC(3),'Value',0,'CData',handles.Store.Sim0);
                    set(handles.EC(4),'CData',handles.Store.Real1);
                    set(handles.EC(28:52),'Visible','off');
                    set(handles.EC(handles.ExpControl.store.RealActive),'Visible','on');
                else
                    switch handles.ExpControl.Type
                        case 'Simulation'
                            set(handles.EC(3),'Value',1);
                            set(handles.EC(1:6),'Visible','on');
                            set(handles.EC(handles.ExpControl.store.SimActive),'Visible','on');
                        case 'Real'
                            set(handles.EC(4),'Value',1);
                            set(handles.EC([1:4 25:27]),'Visible','on');
                            set(handles.EC(28:52),'Visible','off');
                            set(handles.EC(handles.ExpControl.store.RealActive),'Visible','on');
                    end
                end
                   
            case 'Analysis'
                set(handles.Sidebar(7),'CData',handles.Store.Structure0);
                set(handles.Sidebar(8),'CData',handles.Store.Loading0);
                set(handles.Sidebar(9),'CData',handles.Store.ExpSetup0);
                set(handles.Sidebar(10),'CData',handles.Store.ExpControl0);
                set(handles.Sidebar(11),'CData',handles.Store.Analysis1);
                set(handles.Structure,'Visible','off');
                set(handles.GroundMotions,'Visible','off');
                set(get(handles.GroundMotions(7), 'Children'), 'Visible', 'off');
                set(get(handles.GroundMotions(8), 'Children'), 'Visible', 'off');
                set(get(handles.GroundMotions(9), 'Children'), 'Visible', 'off');
                set(get(handles.GroundMotions(15), 'Children'), 'Visible', 'off');
                set(get(handles.GroundMotions(16), 'Children'), 'Visible', 'off');
                set(get(handles.GroundMotions(17), 'Children'), 'Visible', 'off');
                set(handles.ES,'Visible','off');
                set(handles.EC,'Visible','off');
                set(handles.Analysis,'Visible','on');
                %Calculate maximum allowable time step
                %For now we introduce a check of whether the field minT exists to avoid
                %errors. This should be REMOVED/MODIFIED
                if isfield(handles.Model, 'minTDOF');
                    handles.Model.Maxdt = 2/handles.Model.Omega(handles.Model.minTDOF);
                    dt_str = {'<    ' num2str(handles.Model.Maxdt)};
                    set(handles.Analysis(4),'String',[dt_str{1} dt_str{2}]);
                    if handles.GM.dtAnalysis > handles.Model.Maxdt
                        msgbox(['Time step too large! Must be less than ' num2str(handles.Model.Maxdt)], 'Time Step Error', 'warn');
                    end
                    guidata(gcbf, handles);
                end
        end
    end

%Callback for program quit
    function Quit_Program(source, eventdata)
        close_program = questdlg('Are you sure you want to quit?','Quit?','Yes','Cancel','Yes');
        switch close_program
            case 'Yes'
                delete(gcf);
                close all;
            case 'Cancel'
                quit cancel;
        end
    end

%Callback for shortcut keys
    function shortcutKeys(source, eventdata)
        control = 0;
        for x=1:length(eventdata.Modifier)
            switch(eventdata.Modifier{x})
                case 'control'
                    control = 1;
            end
        end
        if (control == 1 && strcmp(eventdata.Key,'s'))
            MenuBar('save');
        elseif (control == 1 && strcmp(eventdata.Key,'l'))
            MenuBar('load');
        elseif (control == 1 && strcmp(eventdata.Key,'q'))
            Quit_Program;
        end


    end

%Callback for help buttons
    function helpCallback(source, eventdata)
        helpString = get(gcbo,'ToolTipString');
        msgbox(helpString);
    end

end

%#function Analysis AnimateResponse Element_ExpGeneric ExpControl
%#function ExpSetup GUI_AnalysisControls GUI_ErrorMonitors GUI_Output
%#function GUI_StructuralOutput GUI_Template GetFileList GroundMotions
%#function InputCheck Integrator_AlphaOS Integrator_NewmarkExplicit Links
%#function MenuBar ReadWriteTHFileNGA Report RunOpenFresco
%#function SetOPFPath Structure TCPSocket TerminateAnalysis
%#function UpdatePragmaList WriteTCL displayAxes getFFT