auto-sync
This commit is contained in:
parent
69138e39b9
commit
e62a1573c9
|
@ -135,6 +135,10 @@ public class CommandQueue {
|
|||
write(command, timeout, InvocationConfirmationListener.VOID);
|
||||
}
|
||||
|
||||
public void write(String command, int timeoutMs, InvocationConfirmationListener listener) {
|
||||
write(command, timeoutMs, listener, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Non-blocking command request
|
||||
* Command is placed in the queue where it would be until it is confirmed
|
||||
|
@ -142,10 +146,12 @@ public class CommandQueue {
|
|||
* @param command dev console command
|
||||
* @param timeoutMs retry timeout
|
||||
*/
|
||||
public void write(String command, int timeoutMs, InvocationConfirmationListener listener) {
|
||||
public void write(String command, int timeoutMs, InvocationConfirmationListener listener, boolean fireEvent) {
|
||||
|
||||
for (CommandQueueListener cql : commandListeners)
|
||||
cql.onCommand(command);
|
||||
if (fireEvent) {
|
||||
for (CommandQueueListener cql : commandListeners)
|
||||
cql.onCommand(command);
|
||||
}
|
||||
|
||||
pendingCommands.add(new MethodInvocation(command, timeoutMs, listener));
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.rusefi.config.Field;
|
|||
import com.rusefi.core.MessagesCentral;
|
||||
import com.rusefi.core.Pair;
|
||||
import com.rusefi.io.CommandQueue;
|
||||
import com.rusefi.io.InvocationConfirmationListener;
|
||||
import com.rusefi.ui.ConnectionStatus;
|
||||
import com.rusefi.ui.util.JTextFieldWithWidth;
|
||||
|
||||
|
@ -29,7 +30,10 @@ public class ConfigField {
|
|||
ConnectionStatus.INSTANCE.addListener(new ConnectionStatus.Listener() {
|
||||
@Override
|
||||
public void onConnectionStatus(boolean isConnected) {
|
||||
CommandQueue.getInstance().write(field.getType().getLoadCommand() + " " + field.getOffset());
|
||||
CommandQueue.getInstance().write(field.getType().getLoadCommand() + " " + field.getOffset(),
|
||||
CommandQueue.DEFAULT_TIMEOUT,
|
||||
InvocationConfirmationListener.VOID,
|
||||
false);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue