refactoring: sharing command names between firmware and console
This commit is contained in:
parent
c23e99e870
commit
cedaacc709
|
@ -364,6 +364,8 @@
|
|||
#define clutchUpPinInverted_offset_hex 3d0
|
||||
#define clutchUpPinMode_offset 971
|
||||
#define clutchUpPinMode_offset_hex 3cb
|
||||
#define CMD_TRIGGERINFO "triggerinfo"
|
||||
#define CMD_WRITECONFIG "writeconfig"
|
||||
#define coastingFuelCutClt_offset 3154
|
||||
#define coastingFuelCutClt_offset_hex c52
|
||||
#define coastingFuelCutEnabled_offset 744
|
||||
|
|
|
@ -1225,6 +1225,9 @@ end_struct
|
|||
#define GAUGE_NAME_DEBUG_I5 "debug i5"
|
||||
|
||||
|
||||
#define CMD_TRIGGERINFO "triggerinfo"
|
||||
#define CMD_WRITECONFIG "writeconfig"
|
||||
|
||||
#define PROTOCOL_ANALOG_CHART "analog_chart"
|
||||
#define PROTOCOL_ENGINE_SNIFFER "wave_chart"
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.rusefi.config.generated;
|
||||
|
||||
// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Sat Jul 13 08:43:50 EDT 2019
|
||||
// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Sun Jul 14 15:12:56 EDT 2019
|
||||
|
||||
import com.rusefi.config.*;
|
||||
|
||||
|
@ -233,6 +233,8 @@ public class Fields {
|
|||
public static final int clutchUpPin_offset = 969;
|
||||
public static final int clutchUpPinInverted_offset = 976;
|
||||
public static final int clutchUpPinMode_offset = 971;
|
||||
public static final String CMD_TRIGGERINFO = "triggerinfo";
|
||||
public static final String CMD_WRITECONFIG = "writeconfig";
|
||||
public static final int coastingFuelCutClt_offset = 3154;
|
||||
public static final int coastingFuelCutEnabled_offset = 744;
|
||||
public static final int coastingFuelCutMap_offset = 3158;
|
||||
|
|
|
@ -37,6 +37,7 @@ import com.romraider.maps.Rom;
|
|||
import com.romraider.util.SettingsManager;
|
||||
import com.opensr5.ConfigurationImage;
|
||||
import com.rusefi.UploadChanges;
|
||||
import com.rusefi.config.generated.Fields;
|
||||
import com.rusefi.io.CommandQueue;
|
||||
import com.rusefi.ui.SettingsTab;
|
||||
|
||||
|
@ -98,7 +99,7 @@ public class ECUEditorToolBar extends JToolBar {
|
|||
burnImage.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
CommandQueue.getInstance().write(SettingsTab.WRITECONFIG);
|
||||
CommandQueue.getInstance().write(Fields.CMD_WRITECONFIG);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.opensr5.Logger;
|
|||
import com.rusefi.binaryprotocol.BinaryProtocol;
|
||||
import com.opensr5.io.ConfigurationImageFile;
|
||||
import com.rusefi.binaryprotocol.BinaryProtocolHolder;
|
||||
import com.rusefi.config.generated.Fields;
|
||||
import com.rusefi.io.LinkManager;
|
||||
import com.rusefi.io.serial.SerialIoStreamJSSC;
|
||||
import com.rusefi.ui.RecentCommands;
|
||||
|
@ -33,7 +34,7 @@ public class UploadChanges {
|
|||
wnd.getFrameHelper().initFrame(wnd.getContent(), false);
|
||||
|
||||
JPanel bottomPanel = new JPanel(new FlowLayout());
|
||||
bottomPanel.add(RecentCommands.createButton(new AtomicBoolean(), SettingsTab.WRITECONFIG));
|
||||
bottomPanel.add(RecentCommands.createButton(new AtomicBoolean(), Fields.CMD_WRITECONFIG));
|
||||
wnd.getContent().add(bottomPanel, BorderLayout.SOUTH);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.rusefi.ui;
|
|||
import com.rusefi.AverageAngles;
|
||||
import com.rusefi.AverageAnglesUtil;
|
||||
import com.rusefi.FileLog;
|
||||
import com.rusefi.config.generated.Fields;
|
||||
import com.rusefi.core.MessagesCentral;
|
||||
import com.rusefi.io.CommandQueue;
|
||||
import com.rusefi.io.LinkManager;
|
||||
|
@ -18,6 +19,7 @@ import java.util.*;
|
|||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import static com.rusefi.config.generated.Fields.CMD_TRIGGERINFO;
|
||||
import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
|
||||
|
||||
/**
|
||||
|
@ -32,7 +34,6 @@ public class RecentCommands {
|
|||
private static final String SHOWCONFIG = "showconfig";
|
||||
private static final String HELP = "help";
|
||||
private static final String ANALOGINFO = "analoginfo";
|
||||
private static final String TRIGGERINFO = "triggerinfo";
|
||||
private static final String IDLEINFO = "idleinfo";
|
||||
private static final String ALTINFO = "altinfo";
|
||||
private static final String TPSINFO = "tpsinfo";
|
||||
|
@ -57,7 +58,7 @@ public class RecentCommands {
|
|||
COMMAND_ICONS.put(SHOWCONFIG, infoIcon);
|
||||
COMMAND_ICONS.put(HELP, UiUtils.loadIcon("help.jpg"));
|
||||
COMMAND_ICONS.put(ANALOGINFO, infoIcon);
|
||||
COMMAND_ICONS.put(TRIGGERINFO, UiUtils.loadIcon("trigger.jpg"));
|
||||
COMMAND_ICONS.put(CMD_TRIGGERINFO, UiUtils.loadIcon("trigger.jpg"));
|
||||
COMMAND_ICONS.put(IDLEINFO, infoIcon);
|
||||
COMMAND_ICONS.put(ALTINFO, UiUtils.loadIcon("alternator.jpg"));
|
||||
COMMAND_ICONS.put(ACCELINFO, infoIcon);
|
||||
|
@ -72,7 +73,7 @@ public class RecentCommands {
|
|||
COMMAND_ICONS.put(SDINFO, UiUtils.loadIcon("sdinfo.jpg"));
|
||||
COMMAND_ICONS.put(FSIOINFO, infoIcon);
|
||||
COMMAND_ICONS.put(PINS, infoIcon);
|
||||
COMMAND_ICONS.put(SettingsTab.WRITECONFIG, UiUtils.loadIcon("writeconfig.jpg"));
|
||||
COMMAND_ICONS.put(Fields.CMD_WRITECONFIG, UiUtils.loadIcon("writeconfig.jpg"));
|
||||
COMMAND_ICONS.put(SPEEDINFO, UiUtils.loadIcon("speedinfo.jpg"));
|
||||
}
|
||||
|
||||
|
@ -118,12 +119,12 @@ public class RecentCommands {
|
|||
add(SHOWCONFIG);
|
||||
add(STOPENGINE);
|
||||
add(ANALOGINFO);
|
||||
add(TRIGGERINFO);
|
||||
add(CMD_TRIGGERINFO);
|
||||
add(TSINFO);
|
||||
add(SPEEDINFO);
|
||||
add(joystickINFO);
|
||||
add(CANINFO);
|
||||
add(SettingsTab.WRITECONFIG);
|
||||
add(Fields.CMD_WRITECONFIG);
|
||||
add("rewriteconfig");
|
||||
add("enable injection");
|
||||
add("disable injection");
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.rusefi.ui;
|
|||
import com.rusefi.config.Field;
|
||||
import com.rusefi.config.FieldType;
|
||||
import com.rusefi.config.FieldsMap;
|
||||
import com.rusefi.config.generated.Fields;
|
||||
import com.rusefi.ui.config.*;
|
||||
import com.rusefi.ui.util.UiUtils;
|
||||
|
||||
|
@ -18,7 +19,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||
* @see EnumConfigField
|
||||
*/
|
||||
public class SettingsTab {
|
||||
public static final String WRITECONFIG = "writeconfig";
|
||||
private final JPanel content = new JPanel(new BorderLayout());
|
||||
private final JPanel panel = new JPanel(new GridLayout(1, 3));
|
||||
private final JButton dialog = new JButton();
|
||||
|
@ -110,7 +110,7 @@ public class SettingsTab {
|
|||
|
||||
panel.add(dialogBody);
|
||||
|
||||
panel.add(UiUtils.wrap(RecentCommands.createButton(new AtomicBoolean(), WRITECONFIG)));
|
||||
panel.add(UiUtils.wrap(RecentCommands.createButton(new AtomicBoolean(), Fields.CMD_WRITECONFIG)));
|
||||
|
||||
JLabel unusable = new JLabel("This is painfully unusable, TunerStudio works way better for settings!");
|
||||
unusable.setForeground(Color.red);
|
||||
|
|
Loading…
Reference in New Issue