- Corrected get_front() issues.

- Widget tests are now working properly.



git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@990 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
matrevis 2006-09-02 01:56:00 +00:00
parent 4b3cce6bea
commit 47d4fe65b4
10 changed files with 49 additions and 30 deletions

View file

@ -65,7 +65,6 @@ ConcreteSimulation::jump_to(History::position p) throw(UserInterruptException, N
break;
case state_stopped:
_history.reset(true);
_front = 0;
break;
default:
break;
@ -81,12 +80,15 @@ ConcreteSimulation::jump_to(History::position p) throw(UserInterruptException, N
_history.set_notify_enabled(false);
bool yet_to_finish = true;
while (yet_to_finish && p > _front)
History::position increment = 0;
while (yet_to_finish && p > _history.get_front() + increment)
{
yet_to_finish = step();
increment++;
}
get_history().step_front(p);
if (!yet_to_finish)
stop();
_front = std::min(p, _front);
// Reenables updates to registered observers.
// Calls _history.notify_change() on reactivation.
@ -125,7 +127,6 @@ ConcreteSimulation::run() throw(UserInterruptException, NullPolicyException, Mal
{
case state_stopped:
_history.reset(true);
_front = 0;
break;
default:
break;
@ -135,6 +136,7 @@ ConcreteSimulation::run() throw(UserInterruptException, NullPolicyException, Mal
//step forward
bool yet_to_finish = step();
get_history().step_front(get_history().get_front() + 1);
if (yet_to_finish)
{
if(_mode == mode_step_by_step)
@ -173,9 +175,8 @@ ConcreteSimulation::step()
{
//step forward
bool yet_to_finish = true;
if (_front == get_history().get_size() - 1)
if (get_history().get_front() == get_history().get_size() - 1)
yet_to_finish = Scheduler::get_instance().step_forward(_history, *get_policy(), *get_resource_policy());
_front++;
return yet_to_finish;
}
catch (const CPUPolicyException& e)