From: Daniel Kirschten Date: Thu, 16 May 2019 11:57:38 +0000 (+0200) Subject: Fixed a bug causing new timeline events to not be processed X-Git-Url: https://mograsim.net/gitweb/?a=commitdiff_plain;h=faae2542c8eabb8de0e25a58b07798bba42a909a;p=Mograsim.git Fixed a bug causing new timeline events to not be processed --- diff --git a/LogicUI/src/era/mi/gui/LogicUI.java b/LogicUI/src/era/mi/gui/LogicUI.java index f2fc5ce0..42b07d3a 100644 --- a/LogicUI/src/era/mi/gui/LogicUI.java +++ b/LogicUI/src/era/mi/gui/LogicUI.java @@ -114,10 +114,9 @@ public class LogicUI Simulation.TIMELINE.executeUpTo(System.currentTimeMillis(), System.currentTimeMillis() + 10); long sleepTime; if(Simulation.TIMELINE.hasNext()) - { sleepTime = Simulation.TIMELINE.nextEventTime() - System.currentTimeMillis(); - } else - sleepTime = 100; + else + sleepTime = 10; try { if(sleepTime > 0) @@ -129,7 +128,7 @@ public class LogicUI simulationThread.start(); Simulation.TIMELINE.addEventAddedListener(event -> { - if(event.getTiming() >= System.currentTimeMillis() / (double) 1) + if(event.getTiming() <= System.currentTimeMillis()) simulationThread.interrupt(); });