auto-sync
This commit is contained in:
parent
b8e191917c
commit
e5ec91d32a
|
@ -24,7 +24,7 @@ import java.util.concurrent.*;
|
|||
public class PortHolder {
|
||||
// private static final int BAUD_RATE = 8 * 115200;// 921600;
|
||||
// private static final int BAUD_RATE = 2 * 115200;
|
||||
private static final int BAUD_RATE = 115200;
|
||||
public static int BAUD_RATE = 115200;
|
||||
private static PortHolder instance = new PortHolder();
|
||||
private final Object portLock = new Object();
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
|
|||
* @see com.rusefi.StartupFrame
|
||||
*/
|
||||
public class Launcher {
|
||||
public static final int CONSOLE_VERSION = 20150315;
|
||||
public static final int CONSOLE_VERSION = 20150318;
|
||||
public static final boolean SHOW_STIMULATOR = false;
|
||||
public static final String TAB_INDEX = "main_tab";
|
||||
private final String port;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.rusefi;
|
||||
|
||||
import com.rusefi.io.LinkManager;
|
||||
import com.rusefi.io.serial.PortHolder;
|
||||
import com.rusefi.io.tcp.TcpConnector;
|
||||
import com.rusefi.maintenance.EraseChip;
|
||||
import com.rusefi.maintenance.FirmwareFlasher;
|
||||
|
@ -128,17 +129,30 @@ public class StartupFrame {
|
|||
comboPorts.addItem(port);
|
||||
panel.add(comboPorts);
|
||||
|
||||
final JComboBox<String> comboSpeeds = createSpeedCombo();
|
||||
panel.add(comboSpeeds);
|
||||
|
||||
final JButton connect = new JButton("Connect");
|
||||
panel.add(connect);
|
||||
connect.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
disposeFrameAndProceed();
|
||||
PortHolder.BAUD_RATE = Integer.parseInt((String) comboSpeeds.getSelectedItem());
|
||||
new Launcher(comboPorts.getSelectedItem().toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static JComboBox<String> createSpeedCombo() {
|
||||
JComboBox<String> combo = new JComboBox<>();
|
||||
int defaultSpeed = 115200;
|
||||
for (int speed : new int[]{9600, 14400, 38400, 115200, 460800, 921600})
|
||||
combo.addItem(Integer.toString(speed));
|
||||
combo.setSelectedItem(Integer.toString(defaultSpeed));
|
||||
return combo;
|
||||
}
|
||||
|
||||
public static ImageIcon loadIcon(String strPath) {
|
||||
URL imgURL = StartupFrame.class.getResource(strPath);
|
||||
if (imgURL != null)
|
||||
|
|
Loading…
Reference in New Issue