Skip to content
Snippets Groups Projects

Merge general Fixes

Merged Lemmer, Jan requested to merge dev/generalFixes into development
4 files
+ 35
18
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 23
12
@@ -76,15 +76,20 @@ end
%% Research data handeling
switch options.Method
case 'centralized'
DataFolderName = 'data';
% check if data folder exists
if ~isfolder(fullfile(storPath,'data'))
mkdir(fullfile(storPath,'data'));
if ~isfolder(fullfile(storPath,DataFolderName))
mkdir(fullfile(storPath,DataFolderName));
end
% to get relative Paths
currentPath = fullfile(storPath);
%list all files
fList = dir(fullfile(storPath,'data', '**\*.*')); %get list of files and folders in any subfolder
fList = dir(fullfile(storPath,DataFolderName, '**\*.*'));
%get list of files and folders in any subfolder
fList = fList(~[fList.isdir]); %remove folders from list
fList = struct2table(fList);
% Check if the new plot is based on the original data-set
% copy the data(once)
for i=1:numel(DataPaths.rdata)
@@ -92,20 +97,26 @@ switch options.Method
[~, idx] = PlotID.fileCompare(DataPaths.rdata{i},fList);
% create Linked HDF5 files for identical files
if any(idx)
sourcePath = fList{idx,'name'}; % If there are multiple copies already, this only picks the last entry
fList.path = fullfile(fList.folder,fList.name);
sourcePath = fList{idx,'path'};
relativeSourcePath = strrep(sourcePath,currentPath,'');
%WIP relative PATh!!
if contains(sourcePath,{'.h5','.hdf5'}) % Linking only for HDF5
PlotID.createLinkedHDF5(sourcePath{1,1},storPath,ID);
PlotID.createLinkedHDF5(relativeSourcePath{1,1},storPath,ID);
end
else % no identical file exists
%Copy the file in data
PlotID.createFileCopy(DataPaths.rdata{i},'data',storPath,ID,'dataCentral');
%Copy the file in data and create the links (if hdf5)
[dataPath] = PlotID.createFileCopy(DataPaths.rdata{i},'data',storPath,ID,'dataCentral');
relativeDataPath = strrep(dataPath,currentPath,'');
%WIP
% if contains(DataPaths.rdata{i},{'.h5','.hdf5'}) % Linking only for HDF5
% % and create linked files in the plot folder
% PlotID.createLinkedHDF5(DataPaths.rdata{i},storPath,ID);
% end %if
if contains(DataPaths.rdata{i},{'.h5','.hdf5'}) % Linking only for HDF5
% and create also linked files in the plot folder
PlotID.createLinkedHDF5(relativeDataPath,storPath,ID);
end %if
end %if
end %for
clear DataFolderName
case 'individual'
% Create a copy of the research data
PlotID.createFileCopy(DataPaths.rdata,folderName,storPath,ID, 'data');
Loading