From 5bd2008def705aae17b10ca9f5a1797921183c99 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Mon, 2 Nov 2009 10:02:58 +0000 Subject: [PATCH] minor fix: check that event is not already scheduled --- tools/cooja/java/se/sics/cooja/plugins/SimControl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/cooja/java/se/sics/cooja/plugins/SimControl.java b/tools/cooja/java/se/sics/cooja/plugins/SimControl.java index 2e4957518..0faa22e75 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/SimControl.java +++ b/tools/cooja/java/se/sics/cooja/plugins/SimControl.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: SimControl.java,v 1.16 2009/10/27 10:12:00 fros4943 Exp $ + * $Id: SimControl.java,v 1.17 2009/11/02 10:02:58 fros4943 Exp $ */ package se.sics.cooja.plugins; @@ -133,6 +133,9 @@ public class SimControl extends VisPlugin { stopTimeTextField.setToolTipText("Simulation will stop at time (us): " + t); SimControl.this.simulation.invokeSimulationThread(new Runnable() { public void run() { + if (stopEvent.isScheduled()) { + stopEvent.remove(); + } SimControl.this.simulation.scheduleEvent(stopEvent, t); } });