dead code?
This commit is contained in:
parent
8cdbad3349
commit
b1e98dbaad
|
@ -13,9 +13,6 @@ import com.rusefi.ui.StatusWindow;
|
|||
import com.rusefi.ui.util.URLLabel;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.File;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
@ -31,22 +28,6 @@ public class DfuFlasher {
|
|||
public static final String DFU_BINARY = Launcher.TOOLS_PATH + File.separator + "DfuSe/DfuSeCommand.exe";
|
||||
private static final String DFU_SETUP_EXE = "https://github.com/rusefi/rusefi_external_utils/raw/master/DFU_mode/DfuSe_Demo_V3.0.6_Setup.exe";
|
||||
|
||||
private final JButton button = new JButton("Auto Program via DFU");
|
||||
private final JButton manualButton = new JButton("Manual Program via DFU");
|
||||
|
||||
public DfuFlasher(JComboBox<String> comboPorts) {
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
// todo: better usability would be to disable "Program" port in case of no ports found
|
||||
Object selectedItem = comboPorts.getSelectedItem();
|
||||
doAutoDfu(selectedItem, comboPorts);
|
||||
}
|
||||
});
|
||||
|
||||
manualButton.addActionListener(e -> runDfuProgramming());
|
||||
}
|
||||
|
||||
public static void doAutoDfu(Object selectedItem, JComponent parent) {
|
||||
if (selectedItem == null) {
|
||||
JOptionPane.showMessageDialog(parent, "Failed to located serial ports");
|
||||
|
@ -154,16 +135,4 @@ public class DfuFlasher {
|
|||
|
||||
return DFU_BINARY + " -c -d --v --fn " + fileName;
|
||||
}
|
||||
|
||||
/**
|
||||
* connect via serial + initiate software DFU jump + program
|
||||
*/
|
||||
public Component getAutoButton() {
|
||||
return button;
|
||||
}
|
||||
|
||||
// todo: maybe not couple these two different buttons in same class?
|
||||
public Component getManualButton() {
|
||||
return manualButton;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue