From 1df30e955b6f4e5b655ca161dd45e39ccedd2658 Mon Sep 17 00:00:00 2001 From: gac-S_Changer Date: Fri, 10 Feb 2017 11:46:51 +0100 Subject: [PATCH] Closedown --- plugins/PuckDetection.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/plugins/PuckDetection.java b/plugins/PuckDetection.java index 3730e5b..adc43a8 100644 --- a/plugins/PuckDetection.java +++ b/plugins/PuckDetection.java @@ -81,11 +81,14 @@ public class PuckDetection extends DeviceBase{ @Override public void run() { try{ - if (chrono.isTimeout(3000)){ - setState(State.Offline); - for (PuckState puck:pucks){ - puck.clear(); - } + while (!Thread.currentThread().isInterrupted()) { + if (chrono.isTimeout(3000)){ + setState(State.Offline); + for (PuckState puck:pucks){ + puck.clear(); + } + } + Thread.sleep(1000); } } catch (Exception ex){ getLogger().log(Level.INFO, null, ex);