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);
|
fprintf('Using scans directory: %s from environment variable SCANS_DIR\n', scansDir);
|
||||||
disp('This usually indicates that we are in module mode');
|
disp('This usually indicates that we are in module mode');
|
||||||
else
|
else
|
||||||
dirToScan=fullfile(parentDir,'..','ExpJobs'); % hardcoded relative to easy script dir TODO: if we change pj layout this will change
|
% Change these when modifying EASY_DIR in workflow
|
||||||
if exist(dirToScan, 'dir')
|
fprintf('Beginning parent scans directory search\n');
|
||||||
dirs=dir(fullfile(dirToScan, 'dir')); % filter for dirs only
|
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
|
[~, sortedIndices]=sort(datenum({dirs.date}), 'descend'); % sort by newest first
|
||||||
sortedDirs=dirs{sortedIndices};
|
sortedDirs=dirs{sortedIndices};
|
||||||
scansDir=sortedDirs{1};
|
scansDir=sortedDirs{1};
|
||||||
disp('Beginning in newest project scans directory');
|
fprintf('Selected newest project scans directory: %s\n', scansDir);
|
||||||
fprintf('Using scans directory: %s from hardcoded relative path\n', scansDir);
|
end
|
||||||
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');
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user