Skip to content
Snippets Groups Projects
Commit 01af8967 authored by M. Hock's avatar M. Hock
Browse files

(Old) bugfix for hdf5 linking

removed config.json from index (might be deleted on pull)
added workaround if no config file was created and no projectID defined
changed filepaths to absolute paths in example and Demo
parent a620cbf6
No related branches found
No related tags found
2 merge requests!13PreRelease_V0.1,!12PreRelease_V0.1
......@@ -94,7 +94,7 @@ switch options.Method
if any(idx)
sourcePath = fList{idx,'name'}; % If there are multiple copies already, this only picks the last entry
if contains(sourcePath,{'.h5','.hdf5'}) % Linking only for HDF5
PlotID.createLinkedHDF5(sourcePath,storPath,ID);
PlotID.createLinkedHDF5(sourcePath{1,1},storPath,ID);
end
else % no identical file exists
%Copy the file in data
......
......@@ -21,8 +21,16 @@ arguments
end
if isempty(options.ProjectID)
txt = fileread('config.json');
config = jsondecode(txt);
try
txt = fileread('config.json');
config = jsondecode(txt);
catch
config =struct;
config.ProjectID = '';
warning("No ProjectID was definded and no config.json could be found");
end
if ~isempty(config.ProjectID)
options.ProjectID = config.ProjectID;
else
......@@ -47,7 +55,7 @@ switch options.Location
% Check if Position is valid
if ~all(0 <= options.Position & options.Position <= 1)
options.Position = [1,0.4];
warning('options.Position is not valid, TagPlot default values instead');
warning('options.Position is not valid, TagPlot uses default values instead');
end
otherwise % set default position
warning([options.Location, ' is not a defined location, TagPlot uses location east instead']);
......
......@@ -18,15 +18,18 @@ ProjectID = 'FST01';
x = linspace(0,7);
y = rand(1,100)+2;
dataset1 = 'test_data.mat';
save('test_data.mat','x','y');
% use absolute paths for good practise
dataset1 = fullfile(pwd, dataset1);
save(dataset1,'x','y');
% some data as .h5
x1 = linspace(0,2*pi);
y1 = sin(x1)+.5*sin(2*x1)+2;
% define file path & name
fpath = "./testdata_2.h5";
dataset2 = 'testdata_2.h5';
fpath = fullefile(pwd,"./testdata_2.h5");
dataset2 = fullfile(pwd,'testdata_2.h5');
% create hdf5 file and dataset > write data to hdf5 file / dataset
h5create(fpath, "/x1", size(x1), "Datatype", class(x1))
......
{
"ProjectID": "JL01",
"ServerPath": "\\\\FST-220\\Jans-50GB-SMB\\Lemmer"
}
\ No newline at end of file
......@@ -27,7 +27,9 @@ ProjectID = '';
x = linspace(0,7);
y = rand(1,100)+2;
dataset1 = 'test_data.mat';
save('test_data.mat','x','y');
% Use absolute paths for good practise
dataset1 = fullfile(pwd,dataset1);
save(dataset1,'x','y');
% some data as .h5
......@@ -35,8 +37,9 @@ x1 = linspace(0,2*pi);
y1 = sin(x1)+2;
% define file path & name
fpath = "./testdata_2.h5";
dataset2 = 'testdata_2.h5';
dataset2 = fullfile(pwd,dataset2);
fpath = dataset2;
% create hdf5 file and dataset > write data to hdf5 file / dataset
h5create(fpath, "/x1", size(x1), "Datatype", class(x1))
......@@ -77,7 +80,7 @@ path.script = mfilename('fullpath'); % filename of the m.script
% file names of the datasets
path.rdata = {dataset1,dataset2} ; % don't forget the extension
PlotID.Publish(path, ID, fig(1), 'Location', 'server' ,'Method','centralized')
PlotID.Publish(path, ID, fig(1), 'Location', 'local' ,'Method','centralized')
%% Example 2: multiple plots plot, all based on data-set2 (hdf5)
% for individual data-sets, use an appropriate array
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment