Closedown

This commit is contained in:
gac-S_Changer
2017-02-10 11:43:50 +01:00
parent c8aa2524d5
commit be748e0d8c

View File

@@ -11,7 +11,7 @@ import java.util.logging.Level;
public class PuckDetection extends DeviceBase{
public static final int PUCKS_NUMBER = 30;
final String server;
Chrono chrono;
volatile Chrono chrono;
public PuckDetection(String name, String server){
super(name);
@@ -80,11 +80,15 @@ public class PuckDetection extends DeviceBase{
watchDog = new Thread(new Runnable() {
@Override
public void run() {
if (chrono.isTimeout(3000)){
setState(State.Offline);
for (PuckState puck:pucks){
puck.clear();
}
try{
if (chrono.isTimeout(3000)){
setState(State.Offline);
for (PuckState puck:pucks){
puck.clear();
}
}
} catch (Exception ex){
getLogger().log(Level.INFO, null, ex);
}
}
});