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;ds=inline;h=fbc1493d77dfa8e8a43f8afdf77a9f945613bf54;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 faf5ae4f..1a4b76e4 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(); });