Console just quits fix #3953

This commit is contained in:
rusefillc 2022-02-21 14:02:24 -05:00
parent fca5966cda
commit a69c4a298c
3 changed files with 9 additions and 5 deletions

View File

@ -193,8 +193,12 @@ public class LinkManager implements Closeable {
new NamedThreadFactory("communication executor"));
public void assertCommunicationThread() {
if (Thread.currentThread() != communicationThread)
throw new IllegalStateException("Communication on wrong thread");
if (Thread.currentThread() != communicationThread) {
IllegalStateException e = new IllegalStateException("Communication on wrong thread");
e.printStackTrace();
log.error(e.getMessage(), e);
throw e;
}
}
private final EngineState engineState;

View File

@ -43,7 +43,7 @@ public class PresetsPane {
private final String labelTest;
public SetEngineTypeCommandControl(UIContext uiContext, String labelTest, String imageFileName, engine_type_e engineType) {
super(uiContext, labelTest, imageFileName, CommandControl.SET, "set " + Fields.CMD_ENGINE_TYPE + " " + engineType.ordinal());
super(uiContext, labelTest, imageFileName, CommandControl.SET, Fields.CMD_SET + " " + Fields.CMD_ENGINE_TYPE + " " + engineType.ordinal());
this.labelTest = labelTest;
}

View File

@ -68,9 +68,9 @@ public class MainFrame {
if (ConnectionStatusLogic.INSTANCE.getValue() == ConnectionStatusValue.CONNECTED) {
long unixGmtTime = System.currentTimeMillis() / 1000L;
long withOffset = unixGmtTime + TimeZone.getDefault().getOffset(System.currentTimeMillis()) / 1000;
consoleUI.uiContext.getCommandQueue().write(IoUtil.getSetCommand(Fields.CMD_DATE) +
consoleUI.uiContext.getLinkManager().execute(() -> consoleUI.uiContext.getCommandQueue().write(IoUtil.getSetCommand(Fields.CMD_DATE) +
" " + withOffset, CommandQueue.DEFAULT_TIMEOUT,
InvocationConfirmationListener.VOID, false);
InvocationConfirmationListener.VOID, false));
}
}));