Commit fb919d71 authored by Lemmer, Jan's avatar Lemmer, Jan
Browse files

Merge branch '74-uberarbeite-alle-funktionsbeschreibungen-und-skript-kommentare' into 'development'

Improve all help comments

See merge request !61
parents d76e6051 a0d9a157
Pipeline #654867 passed with stage
in 19 seconds
classdef config < handle
%CONFIG class handles methods and attributes related to the config
% CONFIG class handles methods and attributes related to the config
%file
%handle class used for dynamicy property updates
% handle class used for dynamicy property updates
properties (SetAccess = private)
mandatoryFields = {'Author', 'ProjectID'}
......
classdef dataPath < handle
%DATAPATH stores the datapaths to the research data
% DATAPATH stores the datapaths to the research data
% usage of a class is neccessary to support variables, argument
% validation and storing variables as tempory files
......
classdef userDLG
%userDLG the userDLG Class is responsible for the user dialog
% userDLG the userDLG Class is responsible for the user dialog
% error handeling, user messages and warnings will be provided from
% this class, depending on the user options and error type.
% This reduces messaging overhead and code length in PlotID.Publish()
properties
configError = false
scriptPublished = false
rdFilesPublished = false
figurePublished = false
msg = ''
configError = false % error state of reading the config
scriptPublished = false % error state of publishing the script
rdFilesPublished = false % error state of publishing the research data
figurePublished = false % error state of publishing the figure
msg = '' % message to the user
end
properties (SetAccess = protected)
success = false
success = false % product of all states
showMessages {mustBeNumericOrLogical}
forcePublish {mustBeNumericOrLogical}
ID %plotID
......
function [ID] = CreateID(method)
%CreateID Creates an identifier (char)
% CreateID Creates an identifier (char)
% Creates an (sometimes unique) identifier based on the selected method
% if no method is selected method 1 will be the default method
arguments
......
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
% use a cell array or ONE struct of variables (only the first struct will
......
function [figs, IDs] = TagPlot(figs, options)
%TagPlot adds IDs to figures
% TagPlot adds IDs to figures
% The ID is placed visual on the figure window and as Tag (property of figure)
% TagPlot can tag multiple figures at once.
% If a single Plot is tagged IDs is a char, otherwise it is a cell array of
......
function [status, msg] = centralized(storPath, dataObj, folderName)
%centralized stores the research files in a centrelized folder. Linked
%files are created for subsequent folders (HDF5 only).
% CENTRALIZED stores the research files in a centrelized folder.
% 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 = '';
warning(['Linked HDF5 can only be moved with their ',...
'respective master files in the ', dataObj.dataFolderName, ' folder.']);
......
function pList = copyUserFCN(scriptPath, folderName, storPath, ID)
%COPYUSERFCN copies all user functions, classes and toolboxes that are used
%by the base script (scriptpath).
% folderName, storPath and ID are required for createfilecopy
% COPYUSERFCN copies all user functions, classes and toolboxes that are used
% by a script (scriptpath).
%
% All toolboxes and classes are copied as a whole.
% folderName, storPath and ID are required for createfilecopy
% see also createFileCopy
[fList,pList] = matlab.codetools.requiredFilesAndProducts(scriptPath);
fList = fList(~ismember(fList,scriptPath)); % rmv plot script itself from list
fList = fList(~contains(fList,'config.json')); % rmv config.json from list
......
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)
% folderName is the name of the exporting folder
% returns the storage paths were files were stored
% 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
% returns the storage paths were files were stored
% type switches the mode depending on the data type
if ~iscell(filePaths)
%fixes Issue if filepath is a char and not a cell array
......
function [status] = createLinkedHDF5(SourceFile,TargetPath)
%createLinkedHDF5 creates a HDF file that references the Sourcefile
% TargetPath is the storage location, ID the foldername
% createLinkedHDF5 creates a HDF file that references the Sourcefile
% TargetPath is the storage location
% Status returns true if the function was successfull
plist_id = 'H5P_DEFAULT';
......
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
% the functions uses the java libraries from matlab for windows systems
% or the unix function diff
% because of performance issues with windows system calls in matlab
%
% the functions uses the java libraries from matlab for windows systems
% or the unix function diff because of performance issues with windows
% system calls in matlab
if isempty(fileList)
% no comparison necessary
......
function [IDf,PrjID, Str] = friendlyID(ID)
%FriendlyID Changes the Hex Number to a human friendly datetime and dateStr
% IDf ID as DateTime Object, PrjID returns the ProjectID, Str returns the
% timestamp as String
% FriendlyID Changes the Hex Number to a human friendly datetime and dateStr
%
% IDf ID as DateTime Object, PrjID returns the ProjectID, Str returns the
% timestamp as String
%Remove Prefix
if contains(ID,'-')
......
function img = plotQR(data, size)
%QR reads a QR code from qrserver (depends on API)
% created by J.Stifter
function img = plotQR(qrTxt, size)
% plotQR creates a QR code based on qrTxt by calling a qrserver (depends on
% API)
% size specifies the absolut size of the qr code (pixels)
% special thanks to J.Stifter for this suggestion
arguments
data {mustBeTextScalar} = 'example';
qrTxt {mustBeTextScalar} = 'example';
size (1,2) {mustBeInteger} = [150, 150];
end
......@@ -10,7 +13,7 @@ function img = plotQR(data, size)
n = size(2);
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.Timeout = 5;
......
......@@ -6,8 +6,6 @@ function replaceLinkedHDF5(linkedFilepath)
% 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.
%% Check whether the only Objects present are links
h5inf = h5info(linkedFilepath);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment