forked from bw1129/PIDtoolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PTdispSetupInfo.m
75 lines (67 loc) · 3.49 KB
/
PTdispSetupInfo.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
%% PTdispSetupInfo - script to
% ----------------------------------------------------------------------------------
% "THE BEER-WARE LICENSE" (Revision 42):
% <[email protected]> wrote this file. As long as you retain this notice you
% can do whatever you want with this stuff. If we meet some day, and you think
% this stuff is worth it, you can buy me a beer in return. -Brian White
% ----------------------------------------------------------------------------------
if ~isempty(filenameA) || ~isempty(filenameB)
PTdisp=figure(5);
screensz = get(0,'ScreenSize');
set(PTdisp, 'units','normalized','outerposition',[.1 .1 .75 .8])
PTdisp.NumberTitle='off';
PTdisp.Name= ['PIDtoolbox (' PtbVersion ') - Setup Info'];
set(PTdisp,'color',bgcolor)
prop_max_screen=(max([PTdisp.Position(3) PTdisp.Position(4)]));
fontsz5=round(screensz_multiplier*prop_max_screen);
columnWidth=55*round(screensz_multiplier*prop_max_screen);
if ~isempty(filenameA)
if size(dataA.SetupInfo,2)>1
str=strings(size(dataA.SetupInfo,1),1);
str(:)=':'; str2=strcat(dataA.SetupInfo(:,1), char(str));
setupA=strcat(str2, string(dataA.SetupInfo(:,2)));
else
setupA=dataA.SetupInfo;
end
end
if ~isempty(filenameB)
if size(dataB.SetupInfo,2)>1
str=strings(size(dataB.SetupInfo,1),1);
str(:)=':'; str2=strcat(dataB.SetupInfo(:,1), char(str));
setupB=strcat(str2, string(dataB.SetupInfo(:,2)));
else
setupB=dataB.SetupInfo;
end
end
if ~isempty(filenameA) & ~isempty(filenameB)
if length(setupA)==length(setupB)
t = uitable('ColumnName',{filenameA; filenameB},'ColumnWidth',{columnWidth columnWidth},'ColumnFormat',{'char' 'char'},'Data',[cellstr(char(setupA)) cellstr(char(setupB))]);
set(t,'units','normalized','OuterPosition',[.05 .05 .9 .9],'FontSize',fontsz5)
end
if length(setupA)>length(setupB)
clear btmp
btmp = strings(size(setupA));
btmp(1:length(setupB),:)=setupB;
t = uitable('ColumnName',{filenameA; filenameB},'ColumnWidth',{columnWidth columnWidth},'ColumnFormat',{'char' 'char'},'Data',[cellstr(char(setupA)) cellstr(char(btmp))]);
set(t,'units','normalized','OuterPosition',[.05 .05 .9 .9],'FontSize',fontsz5)
end
if length(setupB)>length(setupA)
clear btmp
btmp = strings(size(setupB));
btmp(1:length(setupA),:)=setupA;
t = uitable('ColumnName',{filenameA; filenameB},'ColumnWidth',{columnWidth columnWidth},'ColumnFormat',{'char' 'char'},'Data',[cellstr(char(btmp)) cellstr(string(setupB))]);
set(t,'units','normalized','OuterPosition',[.05 .05 .9 .9],'FontSize',fontsz5)
end
end
if ~isempty(filenameA) & isempty(filenameB)
t = uitable('ColumnWidth',{columnWidth},'ColumnFormat',{'char'},'Data',[cellstr(char(setupA))]);
set(t,'units','normalized','OuterPosition',[.05 .05 .9 .9],'FontSize',fontsz5)
end
if isempty(filenameA) & ~isempty(filenameB)
t = uitable('ColumnWidth',{columnWidth},'ColumnFormat',{'char'},'Data',[cellstr(char(setupB))]);
set(t,'units','normalized','OuterPosition',[.05 .05 .9 .9],'FontSize',fontsz5)
end
else
errordlg('Please select file(s) then click ''load+run''', 'Error, no data');
pause(2);
end