📄 hspinit.m
字号:
%-------------------------------------------------------------------------------% INITIATE DATA FIGURE%-------------------------------------------------------------------------------global initx;
hFig = findobj( allchild(0), 'Name', 'HSP Data Center' );% If GUI already exists, bring it to front and escapeif ~isempty(hFig), set(0,'CurrentFigure',hFig); returnend% Time to make a new figure% Warn user of possible delaydisp('Building HSP Data Interface...')
HspSaveCmd = ['save hsp_data ',...
'Csa Csp Cep Csv Cev Cpa Cpp Cpv Rsa Rsv Rev Rpa Rpp Rpv ',...
'Vusa Vusp Vuep Vupa Vupp Vupv Lsa Lpa ',...
'Cla Vula Rla P0lv KElv Vulv KRlv ',...
'Cra Vura Rra P0rv KErv Vurv KRrv Vt Tsys0 ksys'];
%------------------------------------------------------------------------------% Load Hsp data -- if not available, Define default parameters%------------------------------------------------------------------------------ if exist('hsp_data.mat') == 2; load hsp_data.mat;else %display info message fprintf('\nDefault settings being saved as ''hsp_data.mat...'' \n');
% Initialize variables
%Compliance (ml/mmHg)
Csa=0.28;
Csp=2.05; Cep=1.67;
Csv=61.11;
Cev=50.0;
Cpa=0.76;
Cpp=5.80;
Cpv=25.37;
%Hydraulic Resistance (mmHg*s/ml)
Rsa=0.06; % Rsp=3.307;
% Rep=1.407;
Rsv=0.038;
Rev=0.016;
Rpa=0.023;
Rpp=0.0894;
Rpv=0.0056;
%Unstressed Volumn (ml)
Vusa=0;
Vusp=274.4;
Vuep=336.6;% Vusv=1121;
% Vuev=1375;
Vupa=0;
Vupp=123;
Vupv=120;
%Inertance (mmHg*ml*s^(-2))
Lsa=0.22e-3;
Lpa=0.18e-3;
%Left Heart
Cla=19.23;
Vula=25;
Vulv=16.77;
Rla=25e-3;
KElv=0.014; %Emaxlv=2.95;
KRlv=3.75e-4;
P0lv=1.5;
%Right Heart
Cra=31.25;
Vura=25;
Vurv=40.8;
Rra=2.5e-3;
KErv=0.011;
% Emaxrv=1.75;
KRrv=1.4e-3;
P0rv=1.5;
%Heart Beat
Tsys0=0.5;
ksys=0.075;
%Total Amount of Blood
Vt=5300;
% Save Data
save hsp_data Csa Csp Cep Csv Cev Cpa Cpp Cpv Rsa Rsv Rev Rpa Rpp Rpv ...
Vusa Vusp Vuep Vupa Vupp Vupv Lsa Lpa ...
Cla Vula Rla P0lv KElv Vulv KRlv ...
Cra Vura Rra P0rv KErv Vurv KRrv Vt Tsys0 ksys
end
load HspInit
%Main Window
h0 = figure('Units','points', ...
'Color',[0.7529411764705882 0.7529411764705882 0.7529411764705882], ...
'Colormap',mat0, ...
'Name','HSP Data Center', ...
'NumberTitle','off', ...
'PaperPosition',[18 180 576.0000000000001 432.0000000000002], ...
'PaperUnits','points', ...
'Position',[0 0 496.5517241379312 342.6206896551725], ...
'Tag','Hsp', ...
'ToolBar','none', ...
'UserData',HspSaveCmd);
%Title Label
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'FontName','Geneva', ...
'FontSize',24, ...
'FontWeight','bold', ...
'ListboxTop',0, ...
'Position',[55.24137931034484 291.7241379310345 394.7586206896552 29.79310344827587], ...
'String','HSP Data Center', ...
'Style','text', ...
'Tag','TitleBar');
%Save Button
h1 = uicontrol('Parent',h0, ... 'Style' , 'pushbutton' , ... 'String' , 'Save' , ... 'Units' , 'points' , ... 'Position',[422.0689655172415 63.31034482758622 45.31034482758621 19.86206896551725], ...
'Callback' , HspSaveCmd , ... 'Tag' , 'SaveBtn' );
%Reset Button
h1 = uicontrol('Parent',h0, ... 'Style' , 'pushbutton' , ... 'String' , 'Reset' , ... 'Units' , 'points' , ...
'Position',[423.3103448275863 33.51724137931035 45.31034482758621 19.86206896551725], ...
'Callback' , 'delete(gcf); HspInit;' , ... , ... 'Tag' , 'ResetBtn' );
%Compliance
%Csa
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...
'ListboxTop',0, ...
'Position',mat3, ...
'String','Csa', ...
'Style','text', ...
'Tag','Csa');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[47.79310344827587 258.2758620689656 37.24137931034483 12.41379310344828], ...
'String',eval('num2str(Csa)'), ...
'Callback','Csa=str2num(get(gcbo, ''String''));',...
'Style','edit', ...
'Tag','Csa');
%Csp
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...
'ListboxTop',0, ...
'Position',mat8, ...
'String','Csp', ...
'Style','text', ...
'Tag','Csp');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[47.79310344827587 235.8620689655173 37.24137931034483 12.41379310344828], ...
'String',eval('num2str(Csp)'), ...
'Callback', 'Csp=str2num(get(gcbo, ''String''));',...
'Style','edit', ...
'Tag','Csp');
%Cep
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...
'ListboxTop',0, ...
'Position',mat9, ...
'String','Cep', ...
'Style','text', ...
'Tag','Cep');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[47.79310344827587 213.448275862069 37.24137931034483 12.41379310344828], ...
'String',eval('num2str(Cep)'), ...
'Callback','Cep=str2num(get(gcbo, ''String''));',...
'Style','edit', ...
'Tag','Cep');
%Csv
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...
'ListboxTop',0, ...
'Position',mat10, ...
'String','Csv', ...
'Style','text', ...
'Tag','Csv');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',mat4, ...
'String',eval('num2str(Csv)'), ...
'Callback','Csv=str2num(get(gcbo, ''String''));',...
'Style','edit', ...
'Tag','Csv');
%Cev
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...
'ListboxTop',0, ...
'Position',mat11, ...
'String','Cev', ...
'Style','text', ...
'Tag','Cev');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[47.79310344827587 168.6206896551725 37.24137931034483 12.41379310344828], ...
'String',eval('num2str(Cev)'), ...
'Callback','Cev=str2num(get(gcbo, ''String''));',...
'Style','edit', ...
'Tag','Cev');
%Cpa
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...
'ListboxTop',0, ...
'Position',mat12, ...
'String','Cpa', ...
'Style','text', ...
'Tag','Cpa');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[47.79310344827587 146.2068965517242 37.24137931034483 12.41379310344828], ...
'String',eval('num2str(Cpa)'), ...
'Callback','Cpa=str2num(get(gcbo, ''String''));',...
'Style','edit', ...
'Tag','Cpa');
%Cpp
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...
'ListboxTop',0, ...
'Position',mat13, ...
'String','Cpp', ...
'Style','text', ...
'Tag','Cpp');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[47.79310344827587 123.7931034482759 37.24137931034483 12.41379310344828], ...
'String',eval('num2str(Cpp)'), ...
'Style','edit', ...
'Callback','Cpp=str2num(get(gcbo, ''String''));',...
'Tag','Cpp');
%Cpv
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[47.79310344827587 101.3793103448276 37.24137931034483 12.41379310344828], ...
'String',eval('num2str(Cpv)'), ...
'Style','edit', ...
'Callback','Cpv=str2num(get(gcbo, ''String''));',...
'Tag','Cpv');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...
'ListboxTop',0, ...
'Position',mat14, ...
'String','Cpv', ...
'Style','text', ...
'Tag','Cpv');
%Vusa
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...
'ListboxTop',0, ...
'Position',mat22, ...
'String','Vusa', ...
'Style','text', ...
'Tag','Vusa');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[147.1034482758621 259.448275862069 37.24137931034483 12.41379310344828], ...
'String',eval('num2str(Vusa)'), ...
'Callback','Vusa=str2num(get(gcbo, ''String''));',...
'Style','edit', ...
'Tag','Vusa');
%Vusp
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...
'ListboxTop',0, ...
'Position',mat21, ...
'String','Vusp', ...
'Style','text', ...
'Tag','Vusp');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[147.1034482758621 237.1034482758621 37.24137931034483 12.41379310344828], ...
'String',eval('num2str(Vusp)'), ...
'Callback','Vusp=str2num(get(gcbo, ''String''));',...
'Style','edit', ...
'Tag','Vusp');
%Vuep
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...
'ListboxTop',0, ...
'Position',mat20, ...
'String','Vuep', ...
'Style','text', ...
'Tag','Vuep');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[147.1034482758621 214.7586206896552 37.24137931034483 12.41379310344828], ...
'String',eval('num2str(Vuep)'), ...
'Callback','Vuep=str2num(get(gcbo, ''String''));',...
'Style','edit', ...
'Tag','Vuep');
%Vusv
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...
'ListboxTop',0, ...
'Position',mat19, ...
'String','Vusv', ...
'Style','text', ...
'Tag','Vusv');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[147.1034482758621 192.4137931034483 37.24137931034483 12.41379310344828], ...
'String',eval('num2str(initx(5))'), ...
'Callback','initx(5)=str2num(get(gcbo, ''String''));',...
'Style','edit', ...
'Tag','Vusv');
%Vuev
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...
'ListboxTop',0, ...
'Position',mat18, ...
'String','Vuev', ...
'Style','text', ...
'Tag','Vuev');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[147.1034482758621 170.0689655172414 37.24137931034483 12.41379310344828], ...
'String',eval('num2str(initx(6))'), ...
'Callback','initx(6)=str2num(get(gcbo, ''String''));',...
'Style','edit', ...
'Tag','Vuev');
%Vupa
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...
'ListboxTop',0, ...
'Position',mat17, ...
'String','Vupa', ...
'Style','text', ...
'Tag','Vupa');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[147.1034482758621 147.7241379310345 37.24137931034483 12.41379310344828], ...
'String',eval('num2str(Vupa)'), ...
'Callback','Vupa=str2num(get(gcbo, ''String''));',...
'Style','edit', ...
'Tag','Vupa');
%Vupp
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...
'ListboxTop',0, ...
'Position',mat16, ...
'String','Vupp', ...
'Style','text', ...
'Tag','Vupp');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[147.1034482758621 124.7586206896552 37.24137931034483 12.41379310344828], ...
'String',eval('num2str(Vupp)'), ...
'Callback','Vupp=str2num(get(gcbo, ''String''));',...
'Style','edit', ...
'Tag','Vupp');
%Vupv
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...
'ListboxTop',0, ...
'Position',mat15, ...
'String','Vupv', ...
'Style','text', ...
'Tag','Vupv');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[147.1034482758621 102.4137931034483 37.24137931034483 12.41379310344828], ...
'String',eval('num2str(Vupv)'), ...
'Callback','Vupv=str2num(get(gcbo, ''String''));',...
'Style','edit', ...
'Tag','Vupv');
%Rsa
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...
'ListboxTop',0, ...
'Position',[209.7931034482759 258.2068965517242 24.20689655172414 12.41379310344828], ...
'String','Rsa', ...
'Style','text', ...
'Tag','Rsa');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[243.9310344827587 258.8275862068966 37.24137931034483 12.41379310344828], ...
'String',eval('num2str(Rsa)'), ...
'Callback','Rsa=str2num(get(gcbo, ''String''));',...
'Style','edit', ...
'Tag','Rsa');
%Rsp
h1 = uicontrol('Parent',h0, ...
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -