auto-sync

This commit is contained in:
rusEfi 2016-12-25 21:02:31 -05:00
parent 553291dc6e
commit 201dbbbe58
7 changed files with 33 additions and 16 deletions

View File

@ -1702,13 +1702,13 @@ typedef enum {
CUSTOM_OBD_32 = 6032,
CUSTOM_OBD_33 = 6033,
CUSTOM_OBD_34 = 6034,
CUSTOM_OBD_35 = 6035,
CUSTOM_OBD_TRG_DECODING = 6035,
CUSTOM_SYNC_ERROR = 6036,
CUSTOM_SYNC_ERROR_2 = 6037,
CUSTOM_OBD_38 = 6038,
CUSTOM_OBD_39 = 6039,
CUSTOM_OBD_40 = 6040,
CUSTOM_OBD_LOW_CAN_PERIOD = 6040,
CUSTOM_OBD_41 = 6041,
CUSTOM_OBD_42 = 6042,
CUSTOM_OBD_MMC_ERROR = 6043,
@ -1720,7 +1720,7 @@ typedef enum {
CUSTOM_OBD_49 = 6049,
CUSTOM_TOO_LONG_FUEL_INJECTION = 6050,
CUSTOM_OBD_51 = 6051,
CUSTOM_OBD_ZERO_CYLINDER_COUNT = 6051,
CUSTOM_OBD_52 = 6052,
CUSTOM_OBD_53 = 6053,
CUSTOM_OBD_54 = 6054,

View File

@ -283,7 +283,7 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no
errorDetection.add(isDecodingError);
if (isTriggerDecoderError()) {
warning(CUSTOM_OBD_35, "trigger decoding issue. expected %d/%d/%d got %d/%d/%d",
warning(CUSTOM_OBD_TRG_DECODING, "trigger decoding issue. expected %d/%d/%d got %d/%d/%d",
TRIGGER_SHAPE(expectedEventCount[0]), TRIGGER_SHAPE(expectedEventCount[1]),
TRIGGER_SHAPE(expectedEventCount[2]), currentCycle.eventCount[0], currentCycle.eventCount[1],
currentCycle.eventCount[2]);

View File

@ -231,7 +231,7 @@ static msg_t canThread(void *arg) {
canRead(); // todo: since this is a blocking operation, do we need a separate thread for 'write'?
if (engineConfiguration->canSleepPeriod < 10) {
warning(CUSTOM_OBD_40, "%d too low CAN", engineConfiguration->canSleepPeriod);
warning(CUSTOM_OBD_LOW_CAN_PERIOD, "%d too low CAN", engineConfiguration->canSleepPeriod);
engineConfiguration->canSleepPeriod = 50;
}

View File

@ -35,6 +35,7 @@ public enum FileLog {
@Nullable
private OutputStream fileLog; // null if not opened yet or already closed
public static boolean suspendLogging;
FileLog() {
}
@ -73,6 +74,8 @@ public enum FileLog {
public synchronized void logLine(String fullLine) {
System.out.println(fullLine);
if (suspendLogging)
return;
if (fileLog == null)
return;
try {

View File

@ -27,7 +27,7 @@ public class BenchTestPane {
}
private Component createMILTest() {
BenchTestPanel panel = new BenchTestPanel("MIL", UiUtils.loadIcon("check_engine.jpg")) {
BenchTestPanel panel = new BenchTestPanel("MIL", "check_engine.jpg") {
@NotNull
protected String getCommand() {
return "milbench";
@ -37,7 +37,7 @@ public class BenchTestPane {
}
private Component createIdleTest() {
BenchTestPanel panel = new BenchTestPanel("Idle Valve", UiUtils.loadIcon("idle_valve.png")) {
BenchTestPanel panel = new BenchTestPanel("Idle Valve", ("idle_valve.png")) {
@NotNull
protected String getCommand() {
return "idlebench";
@ -47,7 +47,7 @@ public class BenchTestPane {
}
private Component createFanTest() {
BenchTestPanel panel = new BenchTestPanel("Radiator Fan", UiUtils.loadIcon("radiator_fan.jpg")) {
BenchTestPanel panel = new BenchTestPanel("Radiator Fan", "radiator_fan.jpg") {
@NotNull
protected String getCommand() {
return "fanbench";
@ -57,7 +57,7 @@ public class BenchTestPane {
}
private Component createFuelPumpTest() {
BenchTestPanel panel = new BenchTestPanel("Fuel Pump", UiUtils.loadIcon("fuel_pump.jpg")) {
BenchTestPanel panel = new BenchTestPanel("Fuel Pump", "fuel_pump.jpg") {
@NotNull
protected String getCommand() {
return "fuelpumpbench";
@ -68,8 +68,7 @@ public class BenchTestPane {
private Component createSparkTest() {
final JComboBox<Integer> indexes = createIndexCombo();
ImageIcon icon = UiUtils.loadIcon("spark.jpg");
BenchTestPanel panel = new BenchTestPanel("Spark #", icon, indexes) {
BenchTestPanel panel = new BenchTestPanel("Spark #", "spark.jpg", indexes) {
@Override
protected String getCommand() {
return "sparkbench2 1000 " + indexes.getSelectedItem() + " 5 333 3";
@ -80,8 +79,7 @@ public class BenchTestPane {
private Component createInjectorTest() {
final JComboBox<Integer> indexes = createIndexCombo();
ImageIcon icon = UiUtils.loadIcon("injector.png");
BenchTestPanel panel = new BenchTestPanel("Injector #", icon, indexes) {
BenchTestPanel panel = new BenchTestPanel("Injector #", "injector.png", indexes) {
@Override
protected String getCommand() {
return "fuelbench2 1000 " + indexes.getSelectedItem() + " 5 333 3";
@ -107,7 +105,8 @@ public class BenchTestPane {
final JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 5, 0));
final JButton test = new JButton("Test");
public BenchTestPanel(String text, ImageIcon icon, JComponent... components) {
public BenchTestPanel(String text, String iconFileName, JComponent... components) {
ImageIcon icon = UiUtils.loadIcon(iconFileName);
JPanel rightVerticalPanel = new JPanel(new VerticalFlowLayout());
rightVerticalPanel.add(new JLabel(text));
for (JComponent component : components)

View File

@ -38,7 +38,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
* @see EngineSnifferPanel
*/
public class Launcher {
public static final int CONSOLE_VERSION = 20161220;
public static final int CONSOLE_VERSION = 20161225;
public static final boolean SHOW_STIMULATOR = false;
private static final String TAB_INDEX = "main_tab";
protected static final String PORT_KEY = "port";
@ -254,6 +254,7 @@ public class Launcher {
public static void main(final String[] args) throws Exception {
FileLog.MAIN.start();
getConfig().load();
FileLog.suspendLogging = getConfig().getRoot().getBoolProperty(GaugesPanel.DISABLE_LOGS);
Thread.setDefaultUncaughtExceptionHandler(new DefaultExceptionHandler());
VersionChecker.start();
SwingUtilities.invokeAndWait(new Runnable() {

View File

@ -18,6 +18,8 @@ import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.List;
import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
/**
* Date: 2/5/13
* (c) Andrey Belomutskiy
@ -54,6 +56,7 @@ public class GaugesPanel {
private static final String SHOW_MESSAGES = "show_messages";
private static final String SHOW_RPM = "show_rpm";
private static final String SPLIT_LOCATION = "SPLIT_LOCATION";
public static final String DISABLE_LOGS = "DISABLE_LOGS";
public static boolean IS_PAUSED; // dirty but works for not
static {
@ -159,6 +162,16 @@ public class GaugesPanel {
@NotNull
private JPopupMenu createMenu(final Node config) {
JPopupMenu menu = new JPopupMenu();
final JCheckBoxMenuItem saveDetailedLogs = new JCheckBoxMenuItem("Save detailed logs");
saveDetailedLogs.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
FileLog.suspendLogging = !saveDetailedLogs.isSelected();
getConfig().getRoot().setBoolProperty(DISABLE_LOGS, FileLog.suspendLogging);
}
});
saveDetailedLogs.setSelected(!FileLog.suspendLogging);
final JCheckBoxMenuItem showRpmItem = new JCheckBoxMenuItem("Show RPM");
final JCheckBoxMenuItem showCommandsItem = new JCheckBoxMenuItem("Show Commands");
showRpmItem.setSelected(showRpmPanel);
@ -181,7 +194,8 @@ public class GaugesPanel {
showCommandsItem.setSelected(showMessagesPanel);
menu.add(showCommandsItem);
menu.add(new JPopupMenu.Separator());
menu.add(new JPopupMenu("Reset Config"));
menu.add(saveDetailedLogs);
menu.add(new JPopupMenu("Reset Config")); // todo looks like not working
return menu;
}