Skip to content
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]);
[figs, ID] = TagPlot(fig, ProjectID);
%% call dummy function
a=1;
a = test_2(a);
% a=1;
% a = test_2(a);
%% publishing
......
......@@ -20,6 +20,4 @@ switch method
error('The requested method is not defined yet');
end
end
......@@ -33,7 +33,7 @@ end
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');
if options.CopyUserFCN
......@@ -52,12 +52,15 @@ switch options.Method
%check if data folder exists
if ~isfolder(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
% Check if the new plot is based on the original data-set
% copy the data(once)
for i=1:numel(DataPaths.rdata)
if fileCompare(filename1,filename2) % identical file exists
createLinkedHDF5(SourceFile,storPath,ID)
if fileCompare(DataPaths.rdata{i},{fList.name}) % identical file exists
createLinkedHDF5(DataPaths.rdata{i},storPath,ID)
else % no identical file exists
createFileCopy(DataPaths.rdata{i},'data',storPath,ID,'data');
end
......
function [status] = fileCompare(filename1,filename2)
%fileCompare checks if file1 is (binary) identical to file 2
function [status, id] = fileCompare(filename,fileList)
%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
% diff
[~,~,ext1] = fileparts(filename1);
[~,~,ext2] = fileparts(filename2);
%% Not working!!!
if ~isequal(ext1,ext2)
%warning('File extension are not identical');
status = false;
return
end
[~,~,ext1] = fileparts(filename);
id = zeros(numel(fileList),1);
if ispc
[status,result] = system(['fc ' filename1 ' ' filename2]);
for i=1:numel(fileList)
[~,~,ext2] = fileparts(fileList{i});
elseif isunix %untested!
[status,result] = system(['diff ' filename1 ' ' filename2]);
else
warning('Platform not supported')
end
if ~isequal(ext1,ext2)
%warning('File extension are not identical');
status = false;
return
end
if ispc
[status,~] = system(['fc ' filename ' ' fileList{i}]);
% 0 -> identical, 1 -> not identical
id(i) = ~status; % false (not identical), true(identical)
elseif isunix %untested!
[status,~] = system(['diff ' filename ' ' fileList{i}]);
id(i) = ~status; % ???
else
warning('Platform not supported')
end
end
end
......@@ -16,5 +16,6 @@ plist_id = 'H5P_DEFAULT';
% warning('No linked HDF file was created');
% status = 0;
% 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 register or to comment