- Partial attempt at fixing PythonPolicies broken return values

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@525 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-03-10 14:54:24 +00:00
parent 50a5214bb9
commit 3b593e00ae
5 changed files with 54 additions and 44 deletions

View file

@ -77,8 +77,17 @@ Simulation::run() throw(UserInterruptException)
{
History& h = History::get_instance();
if (_state == state_stopped)
h.truncate_at(0);
switch(_state)
{
case state_running:
// FIXME: write out something, or just ignore user input?
return;
case state_stopped:
h.truncate_at(0);
break;
default:
break;
}
_state = state_running;
@ -86,7 +95,7 @@ Simulation::run() throw(UserInterruptException)
if (_mode)
{
loop:
do {
// chech for termination
bool all_term = true;
smart_ptr<SchedulableList> left = h.get_simulation_status_at(h.get_current_time());
@ -101,8 +110,8 @@ loop:
//by the last execution of upadate()
if (all_term)
{
_state = state_paused;
return;
_state = state_stopped;
return; // Exit from loop
}
try
@ -116,16 +125,15 @@ loop:
}
catch(UserInterruptException e)
{
stop();
throw;
stop();
throw;
}
//check the state
if (_state == state_stopped || _state == state_paused)
return;
goto loop;
} while(true);
}
//******* STEP by STEP