Skip to content
Snippets Groups Projects

Fixes #48

Merged Lemmer, Jan requested to merge 48-implement-usage-of-figure-property-id into development
4 files
+ 26
12
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 16
2
function Publish(DataPaths,scriptPath, ID, figure, options)
function Publish(DataPaths,scriptPath, figure, options)
%%Publish(DataPaths,scriptPath, ID, figure, options) saves plot, data and measuring script
%
% DataPaths contains the path(s) to the research data, for multiple files
@@ -20,7 +20,6 @@ function Publish(DataPaths,scriptPath, ID, figure, options)
arguments
DataPaths {mustBeDataPath} % location of the data-file(s)
scriptPath (1,:) {mustBeFile} % location of the matlab script
ID (1,:) {mustBeNonzeroLengthText} % ID must be provided
figure (1,:) {mustBeFigure} % Checks if figure is a figure object
options.Location {mustBeMember(options.Location ,{'local','server','manual','CI-Test'})} = 'local' % storage path
options.Method {mustBeMember(options.Method ,{'individual','centralized'})} = 'individual'
@@ -29,6 +28,7 @@ arguments
options.CSV (1,1) {mustBeNumericOrLogical} = false
end
%% argument validation
%catch multiple figures in fig
if numel(figure) > 1
figure = figure(1);
@@ -38,6 +38,20 @@ if numel(figure) > 1
warning(msg);
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,...
'Please enter a folder name to continue:'],'Please enter a folder name');
ID = ID{1};
msg = ['No ID found - consider to use the TagPlot function before ',...
'you publish ', newline, 'your files will be stored in ' , ID];
warning(msg);
end
%% read config file
try
txt = fileread('config.json');
Loading