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

Merge branch 'docs/minimalexampleinreadme' into 'master'

Docs/minimalexampleinreadme

Closes #119

See merge request !73
parents f4d0e0dd a6255965
No related branches found
No related tags found
1 merge request!73Docs/minimalexampleinreadme
Pipeline #671877 passed
......@@ -46,6 +46,11 @@ if isstring(scriptPath)
scriptPath = char(scriptPath);
end
% ensure ParentFolder has no trailing fileseperator
if contains(options.ParentFolder(end),filesep)
options.ParentFolder(end)='';
end
%catch multiple figures in fig
if numel(figure) > 1
figure = figure(1);
......
......@@ -12,11 +12,17 @@ end
[~,filename,ext] = fileparts(SourceFile);
% create GroupName to avoid internal path issues on linux/unix systems
GroupName = split(SourceFile,filesep);
% Using windows fileseperator for the object name
GroupName = join(GroupName,'\');
GroupName = GroupName{:};
try
fid = H5F.create(fullfile(TargetPath,[filename,ext]));
%create External Link to Sourcefile in the Group linkToExternal
H5L.create_external(['..',filesep,SourceFile],'/',fid, SourceFile ,plist_id,plist_id);
%H5L.create_external(['..,filesep,'data',filesep,SourceFile],'/',fid, SourceFile ,plist_id,plist_id); %original
H5L.create_external(['..',SourceFile],'/',fid, GroupName ,plist_id,plist_id);
%H5L.create_external(['..,filesep,'data',SourceFile],'/',fid, GroupName ,plist_id,plist_id); %original
H5F.close(fid);
disp([fullfile(TargetPath,[filename,ext]),' created']);
status = 1;
......
......@@ -22,7 +22,7 @@ end
exampleList = {'PlotID_example','PlotID_advanced',...
'PlotID_QRcode', 'PlotID_variables' };
'PlotID_QRcode', 'PlotID_centralized','PlotID_variables'};
% initialise
......
......@@ -25,9 +25,9 @@ plot(x.^2,y,'-r');
PlotID.Publish(datapath,scriptPath, fig2, 'Method','centralized')
%% Note:
% If you rerun this script PlotId will tell you that a identical named (but
% not binary idetical) file exists in the data folder. This is intended,
% due protect the user from overwritting non (binary) identical files. The
% reason for this is that two hdf files with the same data are not idetical
% If you rerun this script PlotId will tell you that an identically named (but
% not binary identical) file exists in the data folder. This is intended
% to protect the user from overwritting non (binary) identical files. The
% reason for this is that two hdf files with the same data are not identical
% when recreated (see line 11). Usually you would use an existing file
% without changing it.
\ No newline at end of file
......@@ -29,9 +29,20 @@ The **ProjectID** is your custom project number, it well be the prefix of the ID
`PlotID.Publish(DataPaths,scriptPath, figure, options)`
`scriptPath` contains either the path to the script, this can be provided with the simple call of `scriptPath = [mfilename('fullpath'),'.m']` or the script or function name that is used for creating your plot. \
`DataPaths` contains the path(s) to the research data, for multiple files you can use a cell array (We recommend using absolute paths). It is also possible to pass an arbitrary number of variables as struct. \
`DataPaths` contains the path(s) to the research data, for multiple files you can use a cell array (We recommend using absolute paths). It is also possible to pass an arbitrary number of variables as struct. To generate all paths for a filetype try: `f=dir(/folderpath/*.mat); rdata=fullfile({f.folder},{f.name})`. \
`figure` is the figure that should be published.
** Minimal Example:**
```matlab
fig = figure;
plot(x,y);
[fig, IDs] = PlotID.TagPlot(fig);
script = [mfilename('fullpath'),'.m']; % This creates a path to the script this line is called from
rdata = {'\\fullpath\dataset01.mat', '\\fullpath\dataset02.h5'} ; % a single path does not need a cell array
PlotID.Publish(rdata, script, fig);
```
**Please take also a look on the examples provided in the Example folder**.
......@@ -122,6 +133,9 @@ The config file is a JSON-File. The config file stores user data and options of
**Note:** If you mess up your config-file simply delete it, PlotID will create a new one the next time you use it.
## Default config.json
## Define an export path
If you define an export path in the config.json this path is used as location for the exported data.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment