Commit 51990c45 authored by Lukas Aspöck's avatar Lukas Aspöck

error messages / refactoring for running raven simulations

parent c17e7d8d
......@@ -274,6 +274,10 @@ classdef itaRavenProject < handle
%------------------------------------------------------------------
function setRavenExe(obj, newRavenExe)
if (exist(newRavenExe,'file'))
obj.ravenExe = newRavenExe;
if (exist(obj.ravenIniFile,'file'))
......@@ -285,6 +289,11 @@ classdef itaRavenProject < handle
obj.raven_ini.AddKeys('Global', {'PathRavenExe'}, {obj.ravenExe});
end
else
error('[itaRaven]: Error: Path to new Raven binary not found!');
end
end
%------------------------------------------------------------------
......@@ -445,28 +454,29 @@ classdef itaRavenProject < handle
% give the project name a date and time string to help to identify the results
obj.setProjectName(obj.projectTag);
% set filter length to the length of the reverberation
% obj.setFilterLengthToReverbTime();
% run the simulation
disp(['Running simulation... (' obj.ravenExe ')']);
if exist(obj.ravenLogFile, 'file')
delete(obj.ravenLogFile);
end
% system([obj.ravenExe ' "' obj.ravenProjectFile '" >> ' obj.ravenLogFile]);
if (~exist(obj.ravenExe,'file'))
error('[itaRaven]: Error: Cannot find Raven binary file!');
end
prevPath = pwd;
cd(fileparts(obj.ravenExe));
dos(['"' obj.ravenExe '"' ' "' obj.ravenProjectFile '"'],'-echo');
disp('Done.');
cd(prevPath);
% restore the initial project name
obj.setProjectName(savedProjectName);
% gather results
disp('Getting results...');
disp('[R] Simulation seems to be finished. Getting results...');
obj.gatherResults();
disp('Done.');
disp('[R] Done.');
obj.simulationDone = true;
......
Markdown is supported
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