Formatting
This commit is contained in:
@@ -50,23 +50,27 @@ function varargout = EASYconsole(varargin)
|
||||
fprintf('Using scans directory: %s from environment variable SCANS_DIR\n', scansDir);
|
||||
disp('This usually indicates that we are in module mode');
|
||||
else
|
||||
dirToScan=fullfile(parentDir,'..','ExpJobs'); % hardcoded relative to easy script dir TODO: if we change pj layout this will change
|
||||
if exist(dirToScan, 'dir')
|
||||
dirs=dir(fullfile(dirToScan, 'dir')); % filter for dirs only
|
||||
[~, sortedIndices]=sort(datenum({dirs.date}), 'descend'); % sort by newest first
|
||||
sortedDirs=dirs{sortedIndices};
|
||||
scansDir=sortedDirs{1};
|
||||
disp('Beginning in newest project scans directory');
|
||||
fprintf('Using scans directory: %s from hardcoded relative path\n', scansDir);
|
||||
disp('This usually indicates that we are in stand-alone mode without PROJECT or SCANS_DIR environment variables');
|
||||
else
|
||||
scansDir=fullfile(parentDir, '..', 'demo', '20240727_hartmanlab_demo_project');
|
||||
if exist(scansDir, 'dir')
|
||||
demo=1;
|
||||
fprintf('Using scans directory: %s from hardcoded absolute path to demo project\n', scansDir);
|
||||
else
|
||||
fprintf('Error: demo project %s not found\n', scansDir);
|
||||
disp('Attempting to continue but this may get ugly');
|
||||
% Change these when modifying EASY_DIR in workflow
|
||||
fprintf('Beginning parent scans directory search\n');
|
||||
fprintf('This usually indicates that we are in stand-alone mode without PROJECT or SCANS_DIR environment variables\n');
|
||||
dirsToScan={
|
||||
fullfile(parentDir,'..', '..', 'scans'),
|
||||
fullfile(parentDir, '..', '..', 'ExpJobs'),
|
||||
fullfile('/mnt/data/scans'),
|
||||
fullfile('/mnt/data/ExpJobs'),
|
||||
fullfile(parentDir, '..', 'demo', '20240727_hartmanlab_demo_project')
|
||||
};
|
||||
for d=dirsToScan
|
||||
if exist(d, 'dir')
|
||||
subDirs=dir(d);
|
||||
if ~isempty(subDirs)
|
||||
fprintf('Found a non-empty parent scans directory in our list: %s\n', d);
|
||||
fprintf('Scanning inside for a project scan directory\n');
|
||||
[~, sortedIndices]=sort(datenum({dirs.date}), 'descend'); % sort by newest first
|
||||
sortedDirs=dirs{sortedIndices};
|
||||
scansDir=sortedDirs{1};
|
||||
fprintf('Selected newest project scans directory: %s\n', scansDir);
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user