Skip to content

Commit

Permalink
Reorganised starting of software to be a function
Browse files Browse the repository at this point in the history
This will allow generation of App and Standalone installers
  • Loading branch information
AlanRace committed Jul 28, 2020
1 parent 75b1feb commit b18a1c7
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 23 deletions.
21 changes: 3 additions & 18 deletions src/SpectralAnalysis.m → SpectralAnalysis.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
%% SpectralAnalysis
% Spectral Imaging analysis software
function spectralAnalysis = SpectralAnalysis()

% Get location of current m-file
if(isdeployed())
Expand All @@ -23,27 +24,11 @@
if ~exist(spectralAnalysisHome, 'file')
mkdir(spectralAnalysisHome);

copyfile([path filesep '..' filesep 'files' filesep 'profiles'], [spectralAnalysisHome filesep 'profiles'])
copyfile([path filesep 'files' filesep 'profiles'], [spectralAnalysisHome filesep 'profiles'])
end

% TODO: Check version on github to see if update available

% Launch spectral analysis interface
try
spectralAnalysis = SpectralAnalysisInterface();
catch err
if((strcmp(err.identifier, 'MATLAB:class:undefinedMethod') || strcmp(err.identifier, 'MATLAB:class:InvalidSuperClass')) ...
&& ~isempty(strfind(err.message, 'Figure')))
disp('ERROR: Missing MOOGL. Download from https://github.com/AlanRace/MOOGL and place in src/gui/MOOGL folder');

return;
else
throw(err);
end
end

spectralAnalysis = SpectralAnalysisInterface();

% Check that a valid licence exists, otherwise show the
if(~isValidLicence())
MissingLicenceFigure();
end
4 changes: 1 addition & 3 deletions docs-src/content/installation/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ The source code version requires a valid MATLAB licence.

#### Installation with Git

1. Clone the repository and initialise the submodules
1. Clone the repository

```bash
git clone https://github.com/AlanRace/SpectralAnalysis
cd SpectralAnalysis
git submodule update --init
```

2. Open MATLAB and navigate to the folder containing the source code
Expand Down
2 changes: 0 additions & 2 deletions files/README

This file was deleted.

1 change: 1 addition & 0 deletions runSpectralAnalysis.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
path = [fileparts(mfilename('fullpath')) filesep 'src'];

% Ensure all folders are on the path
addpath(fileparts(mfilename('fullpath')));
addpath(genpath(path));

SpectralAnalysis
File renamed without changes.

0 comments on commit b18a1c7

Please sign in to comment.