mirror of https://github.com/rusefi/rusefi-1.git
rusEfi console: minor usability progress
This commit is contained in:
parent
1ec5baf57a
commit
bfdd64b36b
|
@ -9,6 +9,8 @@ import java.awt.event.ActionListener;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import static com.rusefi.ui.util.UiUtils.setToolTip;
|
||||||
|
|
||||||
public class SimulatorHelper {
|
public class SimulatorHelper {
|
||||||
public static final String BINARY = "rusefi_simulator.exe";
|
public static final String BINARY = "rusefi_simulator.exe";
|
||||||
private static Process process;
|
private static Process process;
|
||||||
|
@ -55,7 +57,6 @@ public class SimulatorHelper {
|
||||||
FileLog.MAIN.logLine("Port " + TcpConnector.DEFAULT_PORT + " is alive");
|
FileLog.MAIN.logLine("Port " + TcpConnector.DEFAULT_PORT + " is alive");
|
||||||
|
|
||||||
new Launcher("" + TcpConnector.DEFAULT_PORT);
|
new Launcher("" + TcpConnector.DEFAULT_PORT);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JComponent createSimulatorComponent(final StartupFrame portSelector) {
|
public static JComponent createSimulatorComponent(final StartupFrame portSelector) {
|
||||||
|
@ -65,7 +66,7 @@ public class SimulatorHelper {
|
||||||
if (TcpConnector.isTcpPortOpened())
|
if (TcpConnector.isTcpPortOpened())
|
||||||
return new JLabel("Port " + TcpConnector.DEFAULT_PORT + " already busy. Simulator running?");
|
return new JLabel("Port " + TcpConnector.DEFAULT_PORT + " already busy. Simulator running?");
|
||||||
|
|
||||||
JButton simulatorButton = new JButton("Start Simulator");
|
JButton simulatorButton = new JButton("Start Virtual Simulator");
|
||||||
simulatorButton.addActionListener(new ActionListener() {
|
simulatorButton.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent event) {
|
public void actionPerformed(ActionEvent event) {
|
||||||
|
@ -73,6 +74,9 @@ public class SimulatorHelper {
|
||||||
startSimulator();
|
startSimulator();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
setToolTip(simulatorButton, "Connect to totally virtual simulator",
|
||||||
|
"You do not need any hardware to try rusEfi",
|
||||||
|
"This works via localhost: " + TcpConnector.DEFAULT_PORT + " TCP/IP port");
|
||||||
|
|
||||||
return simulatorButton;
|
return simulatorButton;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
|
import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
|
||||||
|
import static com.rusefi.ui.util.UiUtils.setToolTip;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This frame is used on startup to select the port we would be using
|
* This frame is used on startup to select the port we would be using
|
||||||
|
@ -40,7 +41,7 @@ public class StartupFrame {
|
||||||
// todo: figure out a better way to work with absolute path
|
// todo: figure out a better way to work with absolute path
|
||||||
private static final String APPICON = "appicon.png";
|
private static final String APPICON = "appicon.png";
|
||||||
private static final String LOGO = "logo.gif";
|
private static final String LOGO = "logo.gif";
|
||||||
public static final String LINK_TEXT = "rusEfi (c) 2012-2018";
|
public static final String LINK_TEXT = "rusEfi (c) 2012-2019";
|
||||||
private static final String URI = "http://rusefi.com/?java_console";
|
private static final String URI = "http://rusefi.com/?java_console";
|
||||||
private static final String VCP_DRIVER_TEXT = "vcp driver";
|
private static final String VCP_DRIVER_TEXT = "vcp driver";
|
||||||
private static final String VCP_DRIVER_URI = "http://www.st.com/st-web-ui/static/active/en/st_prod_software_internet/resource/technical/software/driver/stsw-stm32102.zip";
|
private static final String VCP_DRIVER_URI = "http://www.st.com/st-web-ui/static/active/en/st_prod_software_internet/resource/technical/software/driver/stsw-stm32102.zip";
|
||||||
|
@ -112,6 +113,7 @@ public class StartupFrame {
|
||||||
connectPanel.add(comboSpeeds);
|
connectPanel.add(comboSpeeds);
|
||||||
|
|
||||||
final JButton connect = new JButton("Connect");
|
final JButton connect = new JButton("Connect");
|
||||||
|
setToolTip(connect, "Connect to real hardware");
|
||||||
connectPanel.add(connect);
|
connectPanel.add(connect);
|
||||||
connect.addActionListener(new ActionListener() {
|
connect.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue