EASYconsole.m: Linting

This commit is contained in:
2024-07-26 11:19:17 -04:00
parent 3ca383e0c8
commit 8db8a078b8

View File

@@ -51,7 +51,7 @@ function varargout = EASYconsole(varargin)
% Reimplementing here for stand-alone mode % Reimplementing here for stand-alone mode
% While the easySuffix directory exists, increment by one and try again % While the easySuffix directory exists, increment by one and try again
if exist(easySuffix, 'dir') if exist(easySuffix, 'dir')
oldSuffix=easySuffix oldSuffix=easySuffix;
while exist(easySuffix, 'dir') while exist(easySuffix, 'dir')
count=1; count=1;
easySuffix=strcat(oldSuffix,'.', num2str(count)); easySuffix=strcat(oldSuffix,'.', num2str(count));
@@ -70,10 +70,10 @@ function varargout = EASYconsole(varargin)
% Helpful variables for running in workflow mode that I'll probably have to reimplement in matlab anyways for standalone mode % Helpful variables for running in workflow mode that I'll probably have to reimplement in matlab anyways for standalone mode
if exist('EASY_DIR','env') if exist('EASY_DIR','env')
EASY_DIR=fullfile(get_env('EASY_DIR')) EASY_DIR=fullfile(get_env('EASY_DIR'));
if easyDir ~= EASY_DIR % sanity check if easyDir ~= EASY_DIR % sanity check
disp("WARNING: EASY_DIR does not match this script's default EASY location"); disp("WARNING: EASY_DIR does not match this script's default EASY location");
easyDir=EASY_DIR easyDir=EASY_DIR;
end end
disp(strcat('Using EASY script directory: ', easyDir, ' from environment variable EASY_DIR')); disp(strcat('Using EASY script directory: ', easyDir, ' from environment variable EASY_DIR'));
else else
@@ -91,7 +91,7 @@ function varargout = EASYconsole(varargin)
else else
easyResultsDirName=strcat('Results_',todayStr,'_',easySuffix); easyResultsDirName=strcat('Results_',todayStr,'_',easySuffix);
easyResultsDir=fullfile(scansDir,easyResultsDirName); easyResultsDir=fullfile(scansDir,easyResultsDirName);
scansDir=fullfile(parent_dir,'ExpJobs') % relative to easy script dir scansDir=fullfile(parent_dir,'ExpJobs'); % relative to easy script dir
disp(strcat('Using project prefix: ', PROJECT_PREFIX, ' from environment variable PROJECT_PREFIX')) disp(strcat('Using project prefix: ', PROJECT_PREFIX, ' from environment variable PROJECT_PREFIX'))
end end
@@ -155,7 +155,7 @@ function EASYconsole_OpeningFcn(hObject, ~, handles, varargin)
global easyResultsDir global easyResultsDir
% Choose default command line output for EASYconsole % Choose default command line output for EASYconsole
handles.output = hObject; handles.output=hObject;
% Update handles structure % Update handles structure
guidata(hObject, handles); guidata(hObject, handles);
@@ -184,7 +184,7 @@ end
% handles--structure with handles and user data (see GUIDATA) % handles--structure with handles and user data (see GUIDATA)
function varargout = EASYconsole_OutputFcn(~, ~, handles) function varargout = EASYconsole_OutputFcn(~, ~, handles)
% Get default command line output from handles structure % Get default command line output from handles structure
varargout{1} = handles.output; varargout{1}=handles.output;
end end
%% CONSOLE BUTTON INTERFACES %% %% CONSOLE BUTTON INTERFACES %%
@@ -242,18 +242,18 @@ function NewExpDat_Callback(~, ~, ~)
% create supporting dirs % create supporting dirs
% this is also in the workflow script but here for standalone mode % this is also in the workflow script but here for standalone mode
dirs = {'PrintResults', 'CFfigs', 'Fotos', 'Fotos/BkUp'}; dirs={'PrintResults', 'CFfigs', 'Fotos', 'Fotos/BkUp'};
for i = 1:length(dirs) for i=1:length(dirs)
d = dirs{i}; d=dirs{i};
if ~exist(fullfile(easyResultsDir, d), 'dir') if ~exist(fullfile(easyResultsDir, d), 'dir')
mkdir(fullfile(easyResultsDir, d)); mkdir(fullfile(easyResultsDir, d));
end end
end end
% templateDirs are stored in the easy template directory % templateDirs are stored in the easy template directory
templates = {'figs', 'PTmats'} templates={'figs', 'PTmats'};
for i = 1:length(templates) for i=1:length(templates)
d = dirs{i}; d=dirs{i};
if ~exist(fullfile(easyResultsDir, d), 'dir') if ~exist(fullfile(easyResultsDir, d), 'dir')
copyfile((fullfile(easyDir,d)), (fullfile(easyResultsDir,d))); copyfile((fullfile(easyDir,d)), (fullfile(easyResultsDir,d)));
end end
@@ -290,11 +290,11 @@ function LoadDatFile_Callback(~, ~, ~)
questdlg('\fontsize{20} Load file from ExpJobs/YourJob/YourResults/matResults','File Creation','OK', struct('Default','OK','Interpreter','tex')); questdlg('\fontsize{20} Load file from ExpJobs/YourJob/YourResults/matResults','File Creation','OK', struct('Default','OK','Interpreter','tex'));
[inputFile,inputPath]=uigetfile('.mat','Open Experiment folder and data storage .mat file name','MultiSelect','off'); [inputFile,inputPath]=uigetfile('.mat','Open Experiment folder and data storage .mat file name','MultiSelect','off');
SWnewExp=0; SWnewExp=0;
matDir=fullfile(inputPath) matDir=fullfile(inputPath);
matFile=fullfile(inputPath,inputFile); matFile=fullfile(inputPath,inputFile);
load(matFile); load(matFile);
easyResultsDir=fullfile(matDir,'..') easyResultsDir=fullfile(matDir,'..');
scansDir=fullfile(matDir,'..', '..') scansDir=fullfile(matDir,'..', '..');
if isfolder(fullfile(matDir, '..','..','1')) % If Inovation Vrobot Then if isfolder(fullfile(matDir, '..','..','1')) % If Inovation Vrobot Then
if exist(fullfile(easyResultsDir,'PTmats','NImParameters.mat'), 'file') if exist(fullfile(easyResultsDir,'PTmats','NImParameters.mat'), 'file')
@@ -313,9 +313,9 @@ function LoadDatFile_Callback(~, ~, ~)
mkdir(fullfile(matDir,'BkUp')); mkdir(fullfile(matDir,'BkUp'));
% Create supporting dirs % Create supporting dirs
dirs = {'PrintResults', 'figs', 'CFfigs', 'PTmats', 'Fotos'} dirs={'PrintResults', 'figs', 'CFfigs', 'PTmats', 'Fotos'}
for i = 1:length(dirs) for i=1:length(dirs)
d = dirs{i} d=dirs{i};
if ~exist(fullfile(easyResultsDir, d), 'dir') if ~exist(fullfile(easyResultsDir, d), 'dir')
mkdir(fullfile(easyResultsDir, d)); mkdir(fullfile(easyResultsDir, d));
end end
@@ -341,7 +341,7 @@ end
function runPlateMapPintool_Callback(~, ~, ~) function runPlateMapPintool_Callback(~, ~, ~)
try try
NImapPT NImapPT
catch ME catch
EASYconsole EASYconsole
end end
end end
@@ -357,7 +357,7 @@ end
function runPlateImAnal_Callback(~, ~, ~) function runPlateImAnal_Callback(~, ~, ~)
try try
NImStartupOnly NImStartupOnly
catch ME catch
EASYconsole EASYconsole
end end
end end
@@ -366,7 +366,7 @@ function PlateCFit_Callback(~, ~, ~)
% global matFile % TODO BCR not sure if needed % global matFile % TODO BCR not sure if needed
try try
NCstart NCstart
catch ME catch
end end
end end
@@ -380,7 +380,7 @@ function runDMPexcel_Callback(~, ~, ~)
try try
% DMPexcel2mat_2024winLinix %DMPexcel2mat_2023winLinix % DMPexcel2mat_2024winLinix %DMPexcel2mat_2023winLinix
DMPexcel2mat % TODO Can't find above so using what I have available DMPexcel2mat % TODO Can't find above so using what I have available
catch ME catch
EASYconsole EASYconsole
end end
end end
@@ -402,7 +402,7 @@ function runOverlayPlots_Callback(~, ~, ~)
try try
DoverlayPlots2 DoverlayPlots2
EASYconsole EASYconsole
catch ME catch
EASYconsole EASYconsole
end end
end end
@@ -411,7 +411,7 @@ function runFotoStrip_Callback(~, ~, ~)
try try
F_NImStartup_CentCir F_NImStartup_CentCir
EASYconsole EASYconsole
catch ME catch
EASYconsole EASYconsole
end end
end end
@@ -419,14 +419,14 @@ end
function runDisplayFig_Callback(~, ~, ~) function runDisplayFig_Callback(~, ~, ~)
try try
UfigDisplay UfigDisplay
catch ME catch
EASYconsole EASYconsole
end end
end end
function runViewParameters_Callback(~, ~, ~) function runViewParameters_Callback(~, ~, ~)
try try
catch ME catch
EASYconsole EASYconsole
end end
end end
@@ -434,7 +434,7 @@ end
function QkviewN_Callback(~, ~, ~) function QkviewN_Callback(~, ~, ~)
try try
QkviewImages QkviewImages
catch ME catch
EASYconsole EASYconsole
end end
end end
@@ -443,7 +443,7 @@ function CFdisplay_Callback(~, ~, ~)
try try
NCsingleDisplay NCsingleDisplay
EASYconsole EASYconsole
catch ME catch
EASYconsole EASYconsole
end end
end end