mirror of https://github.com/FOME-Tech/fome-fw.git
remove presets pane
This commit is contained in:
parent
4a8ff4dcc0
commit
775047be09
|
@ -88,8 +88,6 @@ public class ConsoleUI {
|
|||
|
||||
tabbedPane.addTab("Bench Test", new BenchTestPane(uiContext, getConfig()).getContent());
|
||||
|
||||
tabbedPane.addTab("Presets", new PresetsPane(uiContext).getContent());
|
||||
|
||||
LuaScriptPanel luaScriptPanel = new LuaScriptPanel(uiContext, getConfig().getRoot().getChild("lua"));
|
||||
tabbedPaneAdd("Lua Scripting", luaScriptPanel.getPanel(), luaScriptPanel.getTabSelectedListener());
|
||||
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
package com.rusefi;
|
||||
|
||||
import com.rusefi.config.generated.Fields;
|
||||
import com.rusefi.enums.engine_type_e;
|
||||
import com.rusefi.ui.UIContext;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
/**
|
||||
* Andrey Belomutskiy, (c) 2013-2020
|
||||
*/
|
||||
public class PresetsPane {
|
||||
private final UIContext uiContext;
|
||||
|
||||
private final JPanel content = new JPanel(new GridLayout(4, 5));
|
||||
|
||||
public PresetsPane(UIContext uiContext) {
|
||||
this.uiContext = uiContext;
|
||||
content.add(new SetEngineTypeCommandControl(uiContext,"Frankenso Miata NA6 Stage 0", "/engines/miata_na.png", engine_type_e.FRANKENSO_MIATA_NA6_VAF).getContent());
|
||||
content.add(new SetEngineTypeCommandControl(uiContext, "Frankenso Miata NA6 Stage 1", "/engines/miata_na.png", engine_type_e.FRANKENSO_MIATA_NA6_MAP).getContent());
|
||||
content.add(new SetEngineTypeCommandControl(uiContext, "Frankenso Miata NB2", "/engines/miata_nb.png", engine_type_e.FRANKENSO_MAZDA_MIATA_2003).getContent());
|
||||
content.add(new SetEngineTypeCommandControl(uiContext, "Proteus NB2 MAP", "engines/miata_nb.png", engine_type_e.PROTEUS_MIATA_NB2).getContent());
|
||||
content.add(new SetEngineTypeCommandControl(uiContext, "Hellen72 NB2 MAP", "engines/miata_nb.png", engine_type_e.HELLEN_NB2).getContent());
|
||||
content.add(new SetEngineTypeCommandControl(uiContext, "Frankenso V12", "/engines/v12", engine_type_e.PROTEUS_BMW_M73).getContent());
|
||||
content.add(new SetEngineTypeCommandControl(uiContext, "ETB bench", "", engine_type_e.ETB_BENCH_ENGINE).getContent());
|
||||
content.add(new SetEngineTypeCommandControl(uiContext, "Minimal", "", engine_type_e.MINIMAL_PINS).getContent());
|
||||
content.add(new SetEngineTypeCommandControl(uiContext, "MRE QC test board", "", engine_type_e.MRE_BOARD_NEW_TEST).getContent());
|
||||
}
|
||||
|
||||
public JPanel getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
private class SetEngineTypeCommandControl extends FixedCommandControl {
|
||||
private final String labelTest;
|
||||
|
||||
public SetEngineTypeCommandControl(UIContext uiContext, String labelTest, String imageFileName, engine_type_e engineType) {
|
||||
super(uiContext, labelTest, imageFileName, CommandControl.SET, Fields.CMD_SET + " " + Fields.CMD_ENGINE_TYPE + " " + engineType.ordinal());
|
||||
this.labelTest = labelTest;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected ActionListener createButtonListener() {
|
||||
return e -> {
|
||||
int dialogResult = JOptionPane.showConfirmDialog(panel, "Do you really want to reset all settings to " + labelTest,
|
||||
"Warning", JOptionPane.YES_NO_OPTION);
|
||||
if (dialogResult != JOptionPane.YES_OPTION)
|
||||
return;
|
||||
|
||||
uiContext.getCommandQueue().write(getCommand());
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 17 KiB |
Binary file not shown.
Before Width: | Height: | Size: 28 KiB |
Loading…
Reference in New Issue