First EZview test

This commit is contained in:
2024-07-29 17:26:51 -04:00
parent 5e0af19181
commit 78f33a0120
77 changed files with 1669 additions and 45679 deletions

View File

@@ -1,133 +1,86 @@
%EZmultiDayGui.m called by EZexpSel.m ln957 && ln963
%EZmultiday is called after this EZmultiDayGui.m also by EZexpSel.m
% EZmultiDayGui.m called by EZexpSel.m ln957 && ln963
% EZmultiday is called after this EZmultiDayGui.m also by EZexpSel.m
function EZmultiDayGui
%global Exp
global exDlst
global exFolder
global expType
global usrExpJobsDir
global exDlst
global exFolder
global expType
global usrExpJobsDir
xPos=0.05;
btnWid=0.10;
btnHt=0.05;
spacing=0.02;% Spacing between the button and the next command's label
%====================================
% The ADD Groups button
btnNumber=1;
yPos=0.85-(btnNumber-1)*(btnHt+spacing);
btnPos=[xPos yPos-spacing btnWid btnHt];
btnWid=0.10;
btnHt=0.05;
spacing=0.02; % Spacing between the button and the next command's label
btnNumber=1;
yPos=0.85-(btnNumber-1)*(btnHt+spacing);
btnPos=[xPos yPos-spacing btnWid btnHt];
datacursormode off;
%====================================
%{
w= pwd;
datacursormode off;
%Linux accommodatition
if ispc,cd(fullfile('C:\')); %end % \Easy\Experiments'));
else
cd(fullfile('~'))
end
%}
exDirs=dir(exFolder);
exFs={exDirs.name};
exFs=exFs(3:end);
%====================================
w= pwd;
%Linux accommodatition
%try to use user selected 'ExpJobs' folder otherwise use a default
%directory in the uigetfile to load the experiment .mat file.
try
load ('ExpJobsFldr')
catch
end
%try %Linux accommodatition
if ispc
try
cd(usrExpJobsDir);
catch
cd(fullfile('C:\')); %end % \Easy\Experiments'));
end
else
try
cd(usrExpJobsDir);
catch
cd(fullfile('~'))
end
end
%*****************************************
exFolder=uigetdir
exDirs=dir(exFolder);
exFs= {exDirs.name};
exFs= exFs(3:end)
%******re-Sort Experiments by 'D__' Day*******************************
if expType== 2
exFs
ii=1
for i= 1:size(exFs,2)
position= strfind(exFs(i),'_D')
if ~isempty(cell2mat(position)) && isnumeric(cell2mat(position))
da= char(exFs(i))
ff(ii)= sscanf(da((cell2mat(position)+2):end),'%d')
expDayFs(ii)= exFs(i)
indxx(ii)= ii
selFindx= nonzeros(indxx)
ii=ii+1
end
end
BB= [ff;selFindx']
BB=BB'
CC= sortrows(BB,1)
j=1;
for i= 1:size(CC,1)
j= CC(i,2)
ExpOrderByExp(i)= expDayFs(j) %exFs(j)
end
else
ExpOrderByExp= sort(exFs)
end %if expType==2
%*********************************************
f = figure('Menubar','none','Position',[1000 100 640 750],'Name','Select Exp Folders' );
hListbox = uicontrol(...
'Style', 'listbox',...
'String',ExpOrderByExp,...
'value',[],...
'max',1000,...
'min',1,...
'Units','normalized',...
'Position', [.70 .40 .6 .60],...
'callback',{@load_listbox}); %'uiresume(gcbf)'); 'Position', [5 100 60 20])
function load_listbox(source,eventdata)
userIndx = (get(source,'value'))
userStr = (get(source,'string'))
user_entry=userStr(userIndx)
exDlst= user_entry
end
% Re-Sort Experiments by 'D__' Day
if expType==2
exFs
btnNumber=10;
yPos=0.85-(btnNumber-1)*(btnHt+spacing);
btnPos=[xPos yPos-spacing btnWid btnHt];
ii=1;
for i=1:size(exFs,2)
position=strfind(exFs(i),'_D');
if ~isempty(cell2mat(position)) && isnumeric(cell2mat(position))
da=char(exFs(i));
ff(ii)=sscanf(da((cell2mat(position)+2):end),'%d');
expDayFs(ii)=exFs(i);
indxx(ii)=ii;
selFindx=nonzeros(indxx);
ii=ii+1;
end
end
BB=[ff;selFindx'];
BB=BB';
CC=sortrows(BB,1);
j=1;
for i=1:size(CC,1)
j=CC(i,2);
ExpOrderByExp(i)= expDayFs(j); %exFs(j)
end
else
ExpOrderByExp=sort(exFs);
end
hedit8 = uicontrol(...
'Style', 'pushbutton',...
'String',{'Continue'},...
'Units','normalized',...
'Position', btnPos,...
'callback','uiresume(gcbf)');
uiwait(gcf);
f=figure('Menubar','none','Position',[1000 100 640 750],'Name','Select Exp Folders' );
close(f)
cd(w)
hListbox = uicontrol(...
'Style', 'listbox',...
'String',ExpOrderByExp,...
'value',[],...
'max',1000,...
'min',1,...
'Units','normalized',...
'Position', [.70 .40 .6 .60],...
'callback',{@load_listbox}); %'uiresume(gcbf)'); 'Position', [5 100 60 20])
function load_listbox(source,eventdata)
userIndx=(get(source,'value'));
userStr=(get(source,'string'));
user_entry=userStr(userIndx);
exDlst=user_entry;
end
exFs
btnNumber=10;
yPos=0.85-(btnNumber-1)*(btnHt+spacing);
btnPos=[xPos yPos-spacing btnWid btnHt];
hedit8 = uicontrol(...
'Style', 'pushbutton',...
'String',{'Continue'},...
'Units','normalized',...
'Position', btnPos,...
'callback','uiresume(gcbf)');
uiwait(gcf);
close(f)
end
%*****************************************************************