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

Improve all help comments

parent d76e6051
No related branches found
No related tags found
2 merge requests!62Introduce changes for V1.0 RC 1,!61Improve all help comments
Pipeline #654763 passed
...@@ -5,15 +5,15 @@ classdef userDLG ...@@ -5,15 +5,15 @@ classdef userDLG
% This reduces messaging overhead and code length in PlotID.Publish() % This reduces messaging overhead and code length in PlotID.Publish()
properties properties
configError = false configError = false % error state of reading the config
scriptPublished = false scriptPublished = false % error state of publishing the script
rdFilesPublished = false rdFilesPublished = false % error state of publishing the research data
figurePublished = false figurePublished = false % error state of publishing the figure
msg = '' msg = '' % message to the user
end end
properties (SetAccess = protected) properties (SetAccess = protected)
success = false success = false % product of all states
showMessages {mustBeNumericOrLogical} showMessages {mustBeNumericOrLogical}
forcePublish {mustBeNumericOrLogical} forcePublish {mustBeNumericOrLogical}
ID %plotID ID %plotID
......
function Publish(DataPaths,scriptPath, figure, options) function Publish(DataPaths,scriptPath, figure, options)
%%Publish(DataPaths,scriptPath, ID, figure, options) saves plot, data and measuring script % Publish(DataPaths,scriptPath, ID, figure, options) saves plot, data and measuring script
% %
% DataPaths contains the path(s) to the research data, for multiple files % DataPaths contains the path(s) to the research data, for multiple files
% use a cell array or ONE struct of variables (only the first struct will % use a cell array or ONE struct of variables (only the first struct will
......
function [status, msg] = centralized(storPath, dataObj, folderName) function [status, msg] = centralized(storPath, dataObj, folderName)
%centralized stores the research files in a centrelized folder. Linked % CENTRALIZED stores the research files in a centrelized folder.
%files are created for subsequent folders (HDF5 only). % Linked files are created for subsequent folders (HDF5 only).
%
% storPath for the Data
% dataObj contains tha data related information
% folderName is the Name of the storage Folder
msg = ''; msg = '';
warning(['Linked HDF5 can only be moved with their ',... warning(['Linked HDF5 can only be moved with their ',...
'respective master files in the ', dataObj.dataFolderName, ' folder.']); 'respective master files in the ', dataObj.dataFolderName, ' folder.']);
......
function pList = copyUserFCN(scriptPath, folderName, storPath, ID) function pList = copyUserFCN(scriptPath, folderName, storPath, ID)
% COPYUSERFCN copies all user functions, classes and toolboxes that are used % COPYUSERFCN copies all user functions, classes and toolboxes that are used
%by the base script (scriptpath). % by a script (scriptpath).
%
% All toolboxes and classes are copied as a whole.
% folderName, storPath and ID are required for createfilecopy % folderName, storPath and ID are required for createfilecopy
% see also createFileCopy
[fList,pList] = matlab.codetools.requiredFilesAndProducts(scriptPath); [fList,pList] = matlab.codetools.requiredFilesAndProducts(scriptPath);
fList = fList(~ismember(fList,scriptPath)); % rmv plot script itself from list fList = fList(~ismember(fList,scriptPath)); % rmv plot script itself from list
fList = fList(~contains(fList,'config.json')); % rmv config.json from list fList = fList(~contains(fList,'config.json')); % rmv config.json from list
......
function [storagePaths, status, msg] = createFileCopy(filePaths,folderName,storPath,ID,type) function [storagePaths, status, msg] = createFileCopy(filePaths,folderName,storPath,ID,type)
% Creates a copy of the files (can be used for multiple paths in a cell array) % createFileCopy Creates a copy of the files (can be used for multiple
% paths in a cell array)
%
% folderName is the name of the exporting folder % folderName is the name of the exporting folder
% returns the storage paths were files were stored % returns the storage paths were files were stored
% type switches the mode depending on the data type
if ~iscell(filePaths) if ~iscell(filePaths)
%fixes Issue if filepath is a char and not a cell array %fixes Issue if filepath is a char and not a cell array
......
function [status] = createLinkedHDF5(SourceFile,TargetPath) function [status] = createLinkedHDF5(SourceFile,TargetPath)
% createLinkedHDF5 creates a HDF file that references the Sourcefile % createLinkedHDF5 creates a HDF file that references the Sourcefile
% TargetPath is the storage location, ID the foldername % TargetPath is the storage location
% Status returns true if the function was successfull % Status returns true if the function was successfull
plist_id = 'H5P_DEFAULT'; plist_id = 'H5P_DEFAULT';
......
function [status, id] = fileCompare(filename,fileList) function [status, id] = fileCompare(filename,fileList)
%% fileCompare checks if file1 is (binary) identical to a file in filelist % fileCompare checks if file1 is (binary) identical to a file in filelist
% it returns a status and the id of the identical file % it returns a status and the id of the identical file
%
% the functions uses the java libraries from matlab for windows systems % the functions uses the java libraries from matlab for windows systems
% or the unix function diff % or the unix function diff because of performance issues with windows
% because of performance issues with windows system calls in matlab % system calls in matlab
if isempty(fileList) if isempty(fileList)
% no comparison necessary % no comparison necessary
......
function [IDf,PrjID, Str] = friendlyID(ID) function [IDf,PrjID, Str] = friendlyID(ID)
% FriendlyID Changes the Hex Number to a human friendly datetime and dateStr % FriendlyID Changes the Hex Number to a human friendly datetime and dateStr
%
% IDf ID as DateTime Object, PrjID returns the ProjectID, Str returns the % IDf ID as DateTime Object, PrjID returns the ProjectID, Str returns the
% timestamp as String % timestamp as String
......
function img = plotQR(data, size) function img = plotQR(qrTxt, size)
%QR reads a QR code from qrserver (depends on API) % plotQR creates a QR code based on qrTxt by calling a qrserver (depends on
% created by J.Stifter % API)
% size specifies the absolut size of the qr code (pixels)
% special thanks to J.Stifter for this suggestion
arguments arguments
data {mustBeTextScalar} = 'example'; qrTxt {mustBeTextScalar} = 'example';
size (1,2) {mustBeInteger} = [150, 150]; size (1,2) {mustBeInteger} = [150, 150];
end end
...@@ -10,7 +13,7 @@ function img = plotQR(data, size) ...@@ -10,7 +13,7 @@ function img = plotQR(data, size)
n = size(2); n = size(2);
base_api = 'https://api.qrserver.com/v1/create-qr-code/?size=%dx%d&data=%s'; base_api = 'https://api.qrserver.com/v1/create-qr-code/?size=%dx%d&data=%s';
request = sprintf(base_api, m, n, data); request = sprintf(base_api, m, n, qrTxt);
options = weboptions; options = weboptions;
options.Timeout = 5; options.Timeout = 5;
......
...@@ -6,8 +6,6 @@ function replaceLinkedHDF5(linkedFilepath) ...@@ -6,8 +6,6 @@ function replaceLinkedHDF5(linkedFilepath)
% Filepath is the location of the File that contains the link. The % Filepath is the location of the File that contains the link. The
% filepath to the linked data has to be present in the file itself. % filepath to the linked data has to be present in the file itself.
%% Check whether the only Objects present are links %% Check whether the only Objects present are links
h5inf = h5info(linkedFilepath); h5inf = h5info(linkedFilepath);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment