refactoring timeouts
This commit is contained in:
parent
7ab299f8e2
commit
b3d6ded23f
|
@ -190,7 +190,7 @@ this is just too unreliable at this point :(
|
||||||
FileLog.MAIN.logLine("AUTOTEST setEngineType " + type);
|
FileLog.MAIN.logLine("AUTOTEST setEngineType " + type);
|
||||||
// sendCommand(CMD_PINS);
|
// sendCommand(CMD_PINS);
|
||||||
currentEngineType = type;
|
currentEngineType = type;
|
||||||
sendCommand("set " + Fields.CMD_ENGINE_TYPE + " " + type, COMPLEX_COMMAND_RETRY, 30);
|
sendCommand("set " + Fields.CMD_ENGINE_TYPE + " " + type, COMPLEX_COMMAND_RETRY, 2 * Timeouts.CMD_TIMEOUT);
|
||||||
// TODO: document the reason for this sleep?!
|
// TODO: document the reason for this sleep?!
|
||||||
sleep(1);
|
sleep(1);
|
||||||
sendCommand(getEnableCommand("self_stimulation"));
|
sendCommand(getEnableCommand("self_stimulation"));
|
||||||
|
|
|
@ -11,6 +11,6 @@ public interface Timeouts {
|
||||||
int READ_IMAGE_TIMEOUT = 60 * SECOND;
|
int READ_IMAGE_TIMEOUT = 60 * SECOND;
|
||||||
|
|
||||||
int CONNECTION_RESTART_DELAY = 20 * SECOND;
|
int CONNECTION_RESTART_DELAY = 20 * SECOND;
|
||||||
int CS_TIMEOUT = 3000;
|
int CONNECTION_STATUS_TIMEOUT = 3 * SECOND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class ConnectionStatusLogic {
|
||||||
public static ConnectionStatusLogic INSTANCE = new ConnectionStatusLogic();
|
public static ConnectionStatusLogic INSTANCE = new ConnectionStatusLogic();
|
||||||
private List<Listener> listeners = new CopyOnWriteArrayList<>();
|
private List<Listener> listeners = new CopyOnWriteArrayList<>();
|
||||||
|
|
||||||
private final Timer timer = new Timer(Timeouts.CS_TIMEOUT, new ActionListener() {
|
private final Timer timer = new Timer(Timeouts.CONNECTION_STATUS_TIMEOUT, new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
// setValue(Value.NOT_CONNECTED);
|
// setValue(Value.NOT_CONNECTED);
|
||||||
|
|
Loading…
Reference in New Issue