From cfb43c442909a87b4060bd3a90798e59ee4643e1 Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Wed, 4 Sep 2013 15:57:38 +0200 Subject: [PATCH] path cleanups and windows fixes Signed-off-by: Thorsten Liebig --- matlab/CalcNF2FF.m | 12 ++++++------ matlab/private/invoke_openEMS.m | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/matlab/CalcNF2FF.m b/matlab/CalcNF2FF.m index c0e233b..b51abcb 100644 --- a/matlab/CalcNF2FF.m +++ b/matlab/CalcNF2FF.m @@ -77,8 +77,8 @@ nf2ff_xml.ATTRIBUTE.freq = freq; nf2ff_xml.theta = theta; nf2ff_xml.phi = phi; -nf2ff.xml = [Sim_Path '/' filename '.xml']; -nf2ff.hdf5 = [Sim_Path '/' nf2ff_xml.ATTRIBUTE.Outfile]; +nf2ff.xml = [Sim_Path '' filesep '' filename '.xml']; +nf2ff.hdf5 = [Sim_Path '' filesep '' nf2ff_xml.ATTRIBUTE.Outfile]; % create nf2ff structure struct_2_xml(nf2ff.xml,nf2ff_xml,'nf2ff'); @@ -88,13 +88,13 @@ dir_name = fileparts( m_filename ); if isunix % try development path - nf2ff_bin = [dir_name filesep '../nf2ff' filesep 'nf2ff']; + nf2ff_bin = [dir_name filesep '..' filesep 'nf2ff' filesep 'nf2ff']; if (~exist(nf2ff_bin,'file')) % fallback to install path - nf2ff_bin = [dir_name filesep '../../../bin' filesep 'nf2ff']; + nf2ff_bin = [dir_name filesep '..' filesep '..' filesep '..' filesep 'bin' filesep 'nf2ff']; end else - nf2ff_bin = [dir_name filesep '..' filesep nf2ff.exe]; + nf2ff_bin = [dir_name filesep '..' filesep 'nf2ff.exe']; end if ((exist(nf2ff.hdf5,'file') && (mode==0)) || (mode==2)) @@ -113,7 +113,7 @@ cd(Sim_Path); try if (~exist(nf2ff_bin,'file')) - error('openEMS:CalcNF2FF',['Binary not found: ' nf2ff_bin]); + error('openEMS:CalcNF2FF','nf2ff binary not found!'); end if isunix % remove LD_LIBRARY_PATH set by matlab diff --git a/matlab/private/invoke_openEMS.m b/matlab/private/invoke_openEMS.m index 30c3a0c..abfa3f1 100644 --- a/matlab/private/invoke_openEMS.m +++ b/matlab/private/invoke_openEMS.m @@ -28,18 +28,18 @@ dir = fileparts( filename ); if isunix % try development path - openEMS_bin = [dir filesep '../..' filesep 'openEMS.sh']; + openEMS_bin = [dir filesep '..' filesep '..' filesep 'openEMS.sh']; if (~exist(openEMS_bin,'file')) % fallback to install path - openEMS_bin = [dir filesep '../../../../bin' filesep 'openEMS.sh']; + openEMS_bin = [dir filesep '..' filesep '..' filesep '..' filesep '..' filesep 'bin' filesep 'openEMS.sh']; end -else - openEMS_bin = [dir filesep '../..' filesep]; - openEMS_bin = [openEMS_bin 'openEMS']; +else % assume windows + openEMS_bin = [dir filesep '..' filesep '..' filesep]; + openEMS_bin = [openEMS_bin 'openEMS.exe']; end if (~exist(openEMS_bin,'file')) - error('openEMS:invoke_openEMS',['Binary not found: ' openEMS_bin]); + error('openEMS:invoke_openEMS', 'openEMS binary not found!'); end command = [openEMS_bin ' ' opts];