Skip to main content
Sign in
Snippets Groups Projects
Commit cd152a09 authored by Lemmer, Jan's avatar Lemmer, Jan
Browse files

Work in progress on centralized

parent c87e4bea
No related branches found
No related tags found
3 merge requests!13PreRelease_V0.1,!12PreRelease_V0.1,!1Add Link-replacement feature
...@@ -45,8 +45,8 @@ set(gca, 'TickDir', 'out', 'YLim', [0,4]); ...@@ -45,8 +45,8 @@ set(gca, 'TickDir', 'out', 'YLim', [0,4]);
[figs, ID] = TagPlot(fig, ProjectID); [figs, ID] = TagPlot(fig, ProjectID);
%% call dummy function %% call dummy function
a=1; % a=1;
a = test_2(a); % a = test_2(a);
%% publishing %% publishing
... ...
......
...@@ -20,6 +20,4 @@ switch method ...@@ -20,6 +20,4 @@ switch method
error('The requested method is not defined yet'); error('The requested method is not defined yet');
end end
end end
...@@ -33,7 +33,7 @@ end ...@@ -33,7 +33,7 @@ end
disp('Publishing started'); disp('Publishing started');
%% Create a Copy of the script and User functions %% Create a Copy of the script and User functions(optional)
createFileCopy({[DataPaths.script,'.m']},folderName,storPath,ID, 'script'); createFileCopy({[DataPaths.script,'.m']},folderName,storPath,ID, 'script');
if options.CopyUserFCN if options.CopyUserFCN
...@@ -52,12 +52,15 @@ switch options.Method ...@@ -52,12 +52,15 @@ switch options.Method
%check if data folder exists %check if data folder exists
if ~isfolder(fullfile(storPath,'data')) if ~isfolder(fullfile(storPath,'data'))
mkdir(fullfile(storPath,'data')); mkdir(fullfile(storPath,'data'));
else %list all files
fList = dir(fullfile(storPath,'data', '**\*.*')); %get list of files and folders in any subfolder
fList = fList(~[fList.isdir]); %remove folders from list
end end
% Check if the new plot is based on the original data-set % Check if the new plot is based on the original data-set
% copy the data(once) % copy the data(once)
for i=1:numel(DataPaths.rdata) for i=1:numel(DataPaths.rdata)
if fileCompare(filename1,filename2) % identical file exists if fileCompare(DataPaths.rdata{i},{fList.name}) % identical file exists
createLinkedHDF5(SourceFile,storPath,ID) createLinkedHDF5(DataPaths.rdata{i},storPath,ID)
else % no identical file exists else % no identical file exists
createFileCopy(DataPaths.rdata{i},'data',storPath,ID,'data'); createFileCopy(DataPaths.rdata{i},'data',storPath,ID,'data');
end end
... ...
......
function [status] = fileCompare(filename1,filename2) function [status, id] = fileCompare(filename,fileList)
%fileCompare checks if file1 is (binary) identical to file 2 %fileCompare checks if file1 is (binary) identical to a file in filelist
% it returns a sttus and the id of the identical file
% the functions uses the windows system function fc or the unix function % the functions uses the windows system function fc or the unix function
% diff % diff
[~,~,ext1] = fileparts(filename1); %% Not working!!!
[~,~,ext2] = fileparts(filename2);
[~,~,ext1] = fileparts(filename);
id = zeros(numel(fileList),1);
for i=1:numel(fileList)
[~,~,ext2] = fileparts(fileList{i});
if ~isequal(ext1,ext2) if ~isequal(ext1,ext2)
%warning('File extension are not identical'); %warning('File extension are not identical');
...@@ -13,14 +19,18 @@ if ~isequal(ext1,ext2) ...@@ -13,14 +19,18 @@ if ~isequal(ext1,ext2)
end end
if ispc if ispc
[status,result] = system(['fc ' filename1 ' ' filename2]); [status,~] = system(['fc ' filename ' ' fileList{i}]);
% 0 -> identical, 1 -> not identical
id(i) = ~status; % false (not identical), true(identical)
elseif isunix %untested! elseif isunix %untested!
[status,result] = system(['diff ' filename1 ' ' filename2]); [status,~] = system(['diff ' filename ' ' fileList{i}]);
id(i) = ~status; % ???
else else
warning('Platform not supported') warning('Platform not supported')
end end
end
end end
...@@ -16,5 +16,6 @@ plist_id = 'H5P_DEFAULT'; ...@@ -16,5 +16,6 @@ plist_id = 'H5P_DEFAULT';
% warning('No linked HDF file was created'); % warning('No linked HDF file was created');
% status = 0; % status = 0;
% end % end
end end
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment