Skip to content
Snippets Groups Projects
Commit feaa7112 authored by Lemmer, Jan's avatar Lemmer, Jan
Browse files

Correct a Bug, Closes #63

parent a60b1310
No related branches found
No related tags found
3 merge requests!30Fix CI,!25Development,!24Correct a Bug, Closes #63
Pipeline #582140 passed
...@@ -51,7 +51,7 @@ classdef userDLG ...@@ -51,7 +51,7 @@ classdef userDLG
end end
end end
function [] = error(message) function [] = error(obj,message)
%error handles critical errors %error handles critical errors
% critical errors will always result in a matlab error % critical errors will always result in a matlab error
......
...@@ -24,6 +24,7 @@ arguments ...@@ -24,6 +24,7 @@ arguments
options.Location {mustBeMember(options.Location ,{'local','server','manual','CI-Test'})} = 'local' % storage path options.Location {mustBeMember(options.Location ,{'local','server','manual','CI-Test'})} = 'local' % storage path
options.Method {mustBeMember(options.Method ,{'individual','centralized'})} = 'individual' options.Method {mustBeMember(options.Method ,{'individual','centralized'})} = 'individual'
options.ParentFolder (1,:) {mustBeText} = 'export' options.ParentFolder (1,:) {mustBeText} = 'export'
options.ConfigFileName (1,:) {mustBeText} = 'config.json' %individual config names possible
options.CopyUserFCN (1,1) {mustBeNumericOrLogical} = true options.CopyUserFCN (1,1) {mustBeNumericOrLogical} = true
options.CSV (1,1) {mustBeNumericOrLogical} = false options.CSV (1,1) {mustBeNumericOrLogical} = false
options.ShowMessages(1,1) {mustBeNumericOrLogical} = true options.ShowMessages(1,1) {mustBeNumericOrLogical} = true
...@@ -42,8 +43,8 @@ if numel(figure) > 1 ...@@ -42,8 +43,8 @@ if numel(figure) > 1
end end
%get ID from Figure %get ID from Figure
ID = figure.Tag; ID = figure.Tag;
if isempty(ID) if isempty(ID)
% no ID found, User dialog for Folder name % no ID found, User dialog for Folder name
ID = inputdlg(['No ID defined- ' newline,... ID = inputdlg(['No ID defined- ' newline,...
...@@ -54,8 +55,8 @@ if isempty(ID) ...@@ -54,8 +55,8 @@ if isempty(ID)
warning(msg); warning(msg);
end end
dlgObj = PlotID.userDLG(ID,options); % Error and MSG handeling % Error and MSG handeling
dlgObj = PlotID.userDLG(ID,options);
%% read config file %% read config file
try try
...@@ -63,9 +64,6 @@ try ...@@ -63,9 +64,6 @@ try
config = jsondecode(txt); config = jsondecode(txt);
catch catch
dlgObj.configError = true; dlgObj.configError = true;
msg = ['Error while reading the config file' newline,...
' publishing on server not possible'];
dlgObj.softError(msg);
end end
%% storage location %% storage location
...@@ -79,6 +77,11 @@ switch options.Location ...@@ -79,6 +77,11 @@ switch options.Location
storPath = fullfile(scriptLocation,options.ParentFolder); storPath = fullfile(scriptLocation,options.ParentFolder);
end end
case 'server' %from config File case 'server' %from config File
if dlgObj.configError
msg = ['Error while reading the config file' newline,...
' publishing on server not possible'];
dlgObj.error(msg);
end
storPath = config.ServerPath; storPath = config.ServerPath;
case 'manual' %UI case 'manual' %UI
storPath = uigetdir(); storPath = uigetdir();
...@@ -88,7 +91,7 @@ end ...@@ -88,7 +91,7 @@ end
folderName = ['.',char(ID)]; %hidden folder folderName = ['.',char(ID)]; %hidden folder
%% Create Data-Directory %% Create data directory
if isfolder(fullfile(storPath,folderName)) if isfolder(fullfile(storPath,folderName))
dlgObj.error(['Folder ',folderName, ' exists - Plot was already published ']); dlgObj.error(['Folder ',folderName, ' exists - Plot was already published ']);
elseif mkdir(fullfile(storPath,folderName)) elseif mkdir(fullfile(storPath,folderName))
...@@ -97,7 +100,7 @@ else ...@@ -97,7 +100,7 @@ else
end end
disp(['publishing of ', ID, ' started']); disp(['publishing of ', ID, ' started']);
%% Create a Copy of the script and user functions(optional) %% Create a copy of the script and user functions(optional)
% script % script
[~, status, msg] = PlotID.createFileCopy({scriptPath},folderName,storPath,ID, 'script'); [~, status, msg] = PlotID.createFileCopy({scriptPath},folderName,storPath,ID, 'script');
dlgObj.scriptPublished =status; dlgObj.scriptPublished =status;
......
...@@ -37,6 +37,7 @@ testdata_2.h5 ...@@ -37,6 +37,7 @@ testdata_2.h5
testdata2.h5 testdata2.h5
test_data.mat test_data.mat
export/* export/*
unused*/*
# Octave session info # Octave session info
octave-workspace octave-workspace
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment