diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 7b7b36ad8e..678f6d3996 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -688,7 +688,10 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->isCylinderCleanupActivated = engine->isCylinderCleanupMode; tsOutputChannels->secondTriggerChannelEnabled = engineConfiguration->secondTriggerChannelEnabled; #if EFI_VEHICLE_SPEED || defined(__DOXYGEN__) - tsOutputChannels->vehicleSpeedKph = getVehicleSpeed(); + float vehicleSpeed = getVehicleSpeed(); + tsOutputChannels->vehicleSpeedKph = vehicleSpeed; + tsOutputChannels->speedToRpmRatio = vehicleSpeed / rpm; + #endif /* EFI_VEHICLE_SPEED */ tsOutputChannels->isCltError = !isValidCoolantTemperature(getCoolantTemperature(PASS_ENGINE_PARAMETER_F)); tsOutputChannels->isIatError = !isValidIntakeAirTemperature(getIntakeAirTemperature(PASS_ENGINE_PARAMETER_F)); diff --git a/firmware/hw_layer/vehicle_speed.cpp b/firmware/hw_layer/vehicle_speed.cpp index d87ad4c19e..b651b67f0c 100644 --- a/firmware/hw_layer/vehicle_speed.cpp +++ b/firmware/hw_layer/vehicle_speed.cpp @@ -41,8 +41,10 @@ static void vsAnaWidthCallback(void) { } static void speedInfo(void) { - scheduleMsg(logger, "VSS@%s c=%f eventCounter=%d speed=%f", - hwPortname(boardConfiguration->vehicleSpeedSensorInputPin), + scheduleMsg(logger, "VSS %s at %s", boolToString(engineConfiguration->hasVehicleSpeedSensor), + hwPortname(boardConfiguration->vehicleSpeedSensorInputPin)); + + scheduleMsg(logger, "c=%f eventCounter=%d speed=%f", engineConfiguration->vehicleSpeedCoef, vssCounter, getVehicleSpeed()); @@ -52,13 +54,13 @@ static void speedInfo(void) { void initVehicleSpeed(Logging *l) { logger = l; + addConsoleAction("speedinfo", speedInfo); if (boardConfiguration->vehicleSpeedSensorInputPin == GPIO_UNASSIGNED) return; digital_input_s* vehicleSpeedInput = initWaveAnalyzerDriver("VSS", boardConfiguration->vehicleSpeedSensorInputPin); startInputDriver(vehicleSpeedInput, true); vehicleSpeedInput->widthListeners.registerCallback((VoidInt) vsAnaWidthCallback, NULL); - addConsoleAction("speedinfo", speedInfo); } #endif /* EFI_VEHICLE_SPEED */ diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 47d58331e8..31ef71af4c 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -298,5 +298,5 @@ int getRusEfiVersion(void) { return 123; // this is here to make the compiler happy about the unused array if (UNUSED_CCM_SIZE[0] * 0 != 0) return 3211; // this is here to make the compiler happy about the unused array - return 20160618; + return 20160619; } diff --git a/java_console/ui/resources/com/rusefi/speedinfo.jpg b/java_console/ui/resources/com/rusefi/speedinfo.jpg new file mode 100644 index 0000000000..f673da8d1d Binary files /dev/null and b/java_console/ui/resources/com/rusefi/speedinfo.jpg differ diff --git a/java_console/ui/src/com/rusefi/Launcher.java b/java_console/ui/src/com/rusefi/Launcher.java index f8c1f28dd2..3beb48ecfa 100644 --- a/java_console/ui/src/com/rusefi/Launcher.java +++ b/java_console/ui/src/com/rusefi/Launcher.java @@ -36,7 +36,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig; * @see EngineSnifferPanel */ public class Launcher { - public static final int CONSOLE_VERSION = 20160604; + public static final int CONSOLE_VERSION = 20160620; public static final boolean SHOW_STIMULATOR = false; private static final String TAB_INDEX = "main_tab"; protected static final String PORT_KEY = "port"; diff --git a/java_console/ui/src/com/rusefi/SensorSnifferPane.java b/java_console/ui/src/com/rusefi/SensorSnifferPane.java index 5fdfe7d2cc..a3c9bdef5f 100644 --- a/java_console/ui/src/com/rusefi/SensorSnifferPane.java +++ b/java_console/ui/src/com/rusefi/SensorSnifferPane.java @@ -97,7 +97,7 @@ public class SensorSnifferPane { @Override public void actionPerformed(ActionEvent e) { paused = !paused; - pauseButton.setText(paused ? RESUME.getMessage() : PAUSE.getMessage()); + UiUtils.setPauseButtonText(pauseButton, paused); } } ); diff --git a/java_console/ui/src/com/rusefi/ui/GaugesPanel.java b/java_console/ui/src/com/rusefi/ui/GaugesPanel.java index 6ae329198e..312a224355 100644 --- a/java_console/ui/src/com/rusefi/ui/GaugesPanel.java +++ b/java_console/ui/src/com/rusefi/ui/GaugesPanel.java @@ -15,6 +15,8 @@ import java.awt.event.ActionListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; +import static com.rusefi.ui.util.LocalizedMessages.PAUSE; + /** * Date: 2/5/13 * (c) Andrey Belomutskiy @@ -50,6 +52,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 boolean IS_PAUSED; // dirty but works for not static { if (DEFAULT_LAYOUT.length != SizeSelectorPanel.WIDTH * SizeSelectorPanel.HEIGHT) @@ -188,6 +191,7 @@ public class GaugesPanel { @NotNull private JPanel createLeftTopPanel() { JPanel leftUpperPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 0)); + leftUpperPanel.add(createPauseButton()); leftUpperPanel.add(createSaveImageButton()); leftUpperPanel.add(new RpmLabel(2).getContent()); AnyCommand command = AnyCommand.createField(config, false, false); @@ -195,6 +199,18 @@ public class GaugesPanel { return leftUpperPanel; } + private Component createPauseButton() { + final JButton pauseButton = new JButton(PAUSE.getMessage()); + pauseButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + IS_PAUSED = !IS_PAUSED; + UiUtils.setPauseButtonText(pauseButton, IS_PAUSED); + } + }); + return pauseButton; + } + @NotNull private JButton createSaveImageButton() { JButton saveImageButton = UiUtils.createSaveImageButton(); diff --git a/java_console/ui/src/com/rusefi/ui/RecentCommands.java b/java_console/ui/src/com/rusefi/ui/RecentCommands.java index 899194f085..e774cbfc99 100644 --- a/java_console/ui/src/com/rusefi/ui/RecentCommands.java +++ b/java_console/ui/src/com/rusefi/ui/RecentCommands.java @@ -38,6 +38,7 @@ public class RecentCommands { private static final String ACCELINFO = "accelinfo"; private static final String CANINFO = "caninfo"; private static final String TSINFO = "tsinfo"; + private static final String SPEEDINFO = "speedinfo"; private static final String joystickINFO = "joystickinfo"; private static final String FUELINFO = "fuelinfo"; private static final String TEMPINFO = "tempinfo"; @@ -68,6 +69,7 @@ public class RecentCommands { COMMAND_ICONS.put(FSIOINFO, infoIcon); COMMAND_ICONS.put(PINS, infoIcon); COMMAND_ICONS.put(SettingsTab.WRITECONFIG, UiUtils.loadIcon("writeconfig.jpg")); + COMMAND_ICONS.put(SPEEDINFO, UiUtils.loadIcon("speedinfo.jpg")); } private final JPanel content = new JPanel(new GridLayout(NUMBER_OF_COMMANDS + 1, 1)); @@ -114,6 +116,7 @@ public class RecentCommands { add(ANALOGINFO); add(TRIGGERINFO); add(TSINFO); + add(SPEEDINFO); add(joystickINFO); add(CANINFO); add(SettingsTab.WRITECONFIG); diff --git a/java_console/ui/src/com/rusefi/ui/SensorLiveGraph.java b/java_console/ui/src/com/rusefi/ui/SensorLiveGraph.java index 8951aed234..5ec7d8881b 100644 --- a/java_console/ui/src/com/rusefi/ui/SensorLiveGraph.java +++ b/java_console/ui/src/com/rusefi/ui/SensorLiveGraph.java @@ -76,19 +76,24 @@ public class SensorLiveGraph extends JPanel { } catch (InterruptedException e) { throw new IllegalStateException(e); } - double value = SensorCentral.getInstance().getValue(sensor); - addValue(value); - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - UiUtils.trueRepaint(SensorLiveGraph.this); - } - }); + if (!GaugesPanel.IS_PAUSED) + grabNewValue(); } } }; } + private void grabNewValue() { + double value = SensorCentral.getInstance().getValue(sensor); + addValue(value); + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + UiUtils.trueRepaint(SensorLiveGraph.this); + } + }); + } + private void showPopupMenu(MouseEvent e) { JPopupMenu pm = new JPopupMenu(); diff --git a/java_console/ui/src/com/rusefi/ui/widgets/SensorGauge.java b/java_console/ui/src/com/rusefi/ui/widgets/SensorGauge.java index 488cba80be..2578c0f06f 100644 --- a/java_console/ui/src/com/rusefi/ui/widgets/SensorGauge.java +++ b/java_console/ui/src/com/rusefi/ui/widgets/SensorGauge.java @@ -59,6 +59,8 @@ public class SensorGauge { SensorCentral.getInstance().addListener(sensor, new SensorCentral.SensorListener() { public void onSensorUpdate(double value) { + if (GaugesPanel.IS_PAUSED) + return; gauge.setValue(sensor.translateValue(value)); } });