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

Merge branch '93-rework-options-storage' into 'development'

remove Server option (now part of config file)

See merge request !49
parents c568d46e 58548f4c
No related branches found
No related tags found
2 merge requests!50Draft: FIX bug that causes Error when COPYUSER FCN is off and a broken,!49remove Server option (now part of config file)
Pipeline #644622 passed
......@@ -10,13 +10,13 @@ function Publish(DataPaths,scriptPath, figure, options)
% Location sets the storage location. 'local' sets the storage location
% to the current folder (an export folder will be created), 'manual' opens
% a explorer window, where you can choose the folder. If you define a export
% path in the config file, this will used per default.
% path in the config file, this will used per defaul (exportPath).
% remote path, that is defined in the config file.
% Two Methods are implemented 'individual' stores the data for
% each plot while 'centralized' uses a data folder and uses reference links
% to the original data (hdf5 only).
% 'ParentFolder' is the folder Name where the exported data is stored if an
% path is used, PlotId will use this path a storagePath
% path is used, PlotId will use this path as storagePath
% 'ConfigFileName' is needed for handling multiple config files (see example)
% 'CSV' turns a summary table of all exports on or off
%
......@@ -29,7 +29,7 @@ arguments
DataPaths {mustBeDataPath} % location of the data-file(s)
scriptPath (1,:) {mustBeText} % location of the matlab script
figure (1,:) {mustBeFigure} % Checks if figure is a figure object
options.Location {mustBeMember(options.Location ,{'local','server','manual','CI-Test'})} = 'local' % storage path
options.Location {mustBeMember(options.Location ,{'local','exportPath','manual','CI-Test'})} = 'local' % storage path
options.Method {mustBeMember(options.Method ,{'individual','centralized'})} = 'individual'
options.ParentFolder (1,:) {mustBeText} = 'PlotID_export' % name of the ParentFolder
options.ConfigFileName (1,:) {mustBeText} = 'config.json' %individual config names possible
......@@ -69,6 +69,11 @@ end
% find scriptpath
if ~isfile(scriptPath)
scriptPath= which(['/',scriptPath]);
if ~isfile(scriptPath)
msg = ['Script path: ',scriptPath, ' not found on matlab path', newline, ...
'- check spelling or us a path'];
error(msg);
end
end
% catch missing .m extension
......@@ -123,13 +128,6 @@ switch options.Location
'does not exist, check the config file - publishing not possible!'];
dlgObj.error(msg);
end
case 'server' %legacy
if dlgObj.configError
msg = ['Error while reading the config file' newline,...
' publishing on server not possible'];
dlgObj.error(msg);
end
storPath = configObj.configData.ServerPath;
case 'manual' %UI
storPath = uigetdir();
case 'CI-Test' %only for CI tests
......
function [status] = createLinkedHDF5(SourceFile,TargetPath,ID)
function [status] = createLinkedHDF5(SourceFile,TargetPath)
%createLinkedHDF5 creates a HDF file that references the Sourcefile
% TargetPath is the storage location, ID the foldername
% Status returns true if the function was successfull
......@@ -13,15 +13,12 @@ end
[~,filename,ext] = fileparts(SourceFile);
% try
%old
%fid = H5F.create(fullfile(TargetPath,ID,[ID,'_data.h5']));
fid = H5F.create(fullfile(TargetPath,ID,[filename,ext]));
fid = H5F.create(fullfile(TargetPath,[filename,ext]));
%create External Link to Sourcefile in the Group linkToExternal
H5L.create_external(['..\',SourceFile],'/',fid, SourceFile ,plist_id,plist_id);
%H5L.create_external(['..\data\',SourceFile],'/',fid, SourceFile ,plist_id,plist_id); %original
H5F.close(fid);
disp([fullfile(TargetPath,ID,[filename,ext]),' created']);
disp([fullfile(TargetPath,[filename,ext]),' created']);
status = 1;
% catch
% warning('No linked HDF file was created');
......
......@@ -27,16 +27,18 @@ codegen/
# Simulink autosave extension
*.autosave
# Data files (all .mat and .h5 files)
*.mat
*.h5
# Personal test files
test*.m
test*.h5
cleanUP.m
#test folder
test_*/*
# files that are created in example.m
testdata_2.h5
testdata2.h5
test_data.mat
export/*
PlotID_export/*
Examples/export/*
......
# runtest.ps1
$LOGFILE='CI_log.txt'
$wd = pwd;
$LOGFILE = $("$wd" + "\" + "$LOGFILE")
$CIfolder = "$wd" + "\" + "CI_files\"
# $MFILE='"C:\git\NFDI4ing\plot_ID_matlab\CI_files\runner_test.m"'
$arguments = "-nodesktop", "-nosplash","-minimize","-wait","-sd", "$wd", "-logfile", "$LOGFILE","-batch","CI_files\test_runner_STFS.m"
$Returnvalue = & 'C:\Program Files\MATLAB\R2021b\bin\matlab.exe' $arguments
#$CODE = $?
# Returnvalue doesnt get anything useful from matlab
# Write-Output($Returnvalue)
Write-Output(Get-Content($LOGFILE))
exit $CODE
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment