mirror of https://github.com/rusefi/rusefi-1.git
minor refactoring
This commit is contained in:
parent
f2cd7f1225
commit
ae4e0f75b7
|
@ -7,11 +7,10 @@ import com.rusefi.NamedThreadFactory;
|
||||||
import com.rusefi.binaryprotocol.BinaryProtocol;
|
import com.rusefi.binaryprotocol.BinaryProtocol;
|
||||||
import com.rusefi.binaryprotocol.BinaryProtocolState;
|
import com.rusefi.binaryprotocol.BinaryProtocolState;
|
||||||
import com.rusefi.core.EngineState;
|
import com.rusefi.core.EngineState;
|
||||||
import com.rusefi.io.serial.StreamConnector;
|
|
||||||
import com.rusefi.io.serial.BufferedSerialIoStream;
|
import com.rusefi.io.serial.BufferedSerialIoStream;
|
||||||
|
import com.rusefi.io.serial.StreamConnector;
|
||||||
import com.rusefi.io.tcp.TcpConnector;
|
import com.rusefi.io.tcp.TcpConnector;
|
||||||
import com.rusefi.io.tcp.TcpIoStream;
|
import com.rusefi.io.tcp.TcpIoStream;
|
||||||
import jdk.nashorn.internal.runtime.regexp.joni.constants.Arguments;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.io.Closeable;
|
import java.io.Closeable;
|
||||||
|
|
|
@ -39,7 +39,6 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
|
||||||
*/
|
*/
|
||||||
public class ConsoleUI {
|
public class ConsoleUI {
|
||||||
private static final int DEFAULT_TAB_INDEX = 0;
|
private static final int DEFAULT_TAB_INDEX = 0;
|
||||||
public String port;
|
|
||||||
private static SensorCentral.SensorListener wrongVersionListener;
|
private static SensorCentral.SensorListener wrongVersionListener;
|
||||||
|
|
||||||
public static final String TAB_INDEX = "main_tab";
|
public static final String TAB_INDEX = "main_tab";
|
||||||
|
@ -50,8 +49,7 @@ public class ConsoleUI {
|
||||||
static Frame staticFrame;
|
static Frame staticFrame;
|
||||||
|
|
||||||
private final TabbedPanel tabbedPane;
|
private final TabbedPanel tabbedPane;
|
||||||
|
private final String port;
|
||||||
private final MainFrame mainFrame;
|
|
||||||
|
|
||||||
public final UIContext uiContext = new UIContext();
|
public final UIContext uiContext = new UIContext();
|
||||||
|
|
||||||
|
@ -67,7 +65,7 @@ public class ConsoleUI {
|
||||||
public ConsoleUI(String port) {
|
public ConsoleUI(String port) {
|
||||||
tabbedPane = new TabbedPanel(uiContext);
|
tabbedPane = new TabbedPanel(uiContext);
|
||||||
this.port = port;
|
this.port = port;
|
||||||
mainFrame = new MainFrame(this, tabbedPane);
|
MainFrame mainFrame = new MainFrame(this, tabbedPane);
|
||||||
ConsoleUI.staticFrame = mainFrame.getFrame().getFrame();
|
ConsoleUI.staticFrame = mainFrame.getFrame().getFrame();
|
||||||
setFrameIcon(ConsoleUI.staticFrame);
|
setFrameIcon(ConsoleUI.staticFrame);
|
||||||
FileLog.MAIN.logLine("Console " + CONSOLE_VERSION);
|
FileLog.MAIN.logLine("Console " + CONSOLE_VERSION);
|
||||||
|
@ -182,6 +180,10 @@ public class ConsoleUI {
|
||||||
mainFrame.getFrame().showFrame(tabbedPane.tabbedPane);
|
mainFrame.getFrame().showFrame(tabbedPane.tabbedPane);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getPort() {
|
||||||
|
return port;
|
||||||
|
}
|
||||||
|
|
||||||
static void startUi(String[] args) throws InterruptedException, InvocationTargetException {
|
static void startUi(String[] args) throws InterruptedException, InvocationTargetException {
|
||||||
FileLog.MAIN.start();
|
FileLog.MAIN.start();
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ public class MainFrame {
|
||||||
String disconnected = ConnectionStatusLogic.INSTANCE.isConnected() ? "" : "DISCONNECTED ";
|
String disconnected = ConnectionStatusLogic.INSTANCE.isConnected() ? "" : "DISCONNECTED ";
|
||||||
BinaryProtocol bp = consoleUI.uiContext.getLinkManager().getCurrentStreamState();
|
BinaryProtocol bp = consoleUI.uiContext.getLinkManager().getCurrentStreamState();
|
||||||
String signature = bp == null ? "not loaded" : bp.signature;
|
String signature = bp == null ? "not loaded" : bp.signature;
|
||||||
frame.getFrame().setTitle(disconnected + "Console " + Launcher.CONSOLE_VERSION + "; firmware=" + Launcher.firmwareVersion.get() + "@" + consoleUI.port + " " + signature);
|
frame.getFrame().setTitle(disconnected + "Console " + Launcher.CONSOLE_VERSION + "; firmware=" + Launcher.firmwareVersion.get() + "@" + consoleUI.getPort() + " " + signature);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void windowClosedHandler() {
|
private void windowClosedHandler() {
|
||||||
|
|
Loading…
Reference in New Issue