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