only:encapsulation good!
This commit is contained in:
parent
1661643c49
commit
6a63adf267
|
@ -111,7 +111,7 @@ public class BinaryProtocol {
|
||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isClosed;
|
private boolean isClosed;
|
||||||
|
|
||||||
public final CommunicationLoggingListener communicationLoggingListener;
|
public final CommunicationLoggingListener communicationLoggingListener;
|
||||||
|
|
||||||
|
@ -125,6 +125,10 @@ public class BinaryProtocol {
|
||||||
binaryProtocolLogger = new BinaryProtocolLogger(linkManager);
|
binaryProtocolLogger = new BinaryProtocolLogger(linkManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isClosed() {
|
||||||
|
return isClosed;
|
||||||
|
}
|
||||||
|
|
||||||
public static void sleep(long millis) {
|
public static void sleep(long millis) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(millis);
|
Thread.sleep(millis);
|
||||||
|
|
|
@ -92,7 +92,7 @@ public class BinaryProtocolLogger {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getComposite(BinaryProtocol binaryProtocol) {
|
public void getComposite(BinaryProtocol binaryProtocol) {
|
||||||
if (binaryProtocol.isClosed)
|
if (binaryProtocol.isClosed())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// get command would enable composite logging in controller but we need to turn it off from our end
|
// get command would enable composite logging in controller but we need to turn it off from our end
|
||||||
|
|
|
@ -144,7 +144,7 @@ public class MainFrame {
|
||||||
consoleUI.uiContext.DetachedRepositoryINSTANCE.saveConfig();
|
consoleUI.uiContext.DetachedRepositoryINSTANCE.saveConfig();
|
||||||
getConfig().save();
|
getConfig().save();
|
||||||
BinaryProtocol bp = consoleUI.uiContext.getLinkManager().getCurrentStreamState();
|
BinaryProtocol bp = consoleUI.uiContext.getLinkManager().getCurrentStreamState();
|
||||||
if (bp != null && !bp.isClosed)
|
if (bp != null && !bp.isClosed())
|
||||||
bp.close(); // it could be that serial driver wants to be closed explicitly
|
bp.close(); // it could be that serial driver wants to be closed explicitly
|
||||||
IoUtils.exit("windowClosedHandler", 0);
|
IoUtils.exit("windowClosedHandler", 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue