diff --git a/java_console/ui/src/com/rusefi/Launcher.java b/java_console/ui/src/com/rusefi/Launcher.java index 6134f3d82e..7703197942 100644 --- a/java_console/ui/src/com/rusefi/Launcher.java +++ b/java_console/ui/src/com/rusefi/Launcher.java @@ -48,7 +48,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig; * @see EngineSnifferPanel */ public class Launcher { - public static final int CONSOLE_VERSION = 20190823; + public static final int CONSOLE_VERSION = 20190825; public static final String INPUT_FILES_PATH = System.getProperty("input_files_path", ".."); public static final String TOOLS_PATH = System.getProperty("tools_path", "."); private static final String TAB_INDEX = "main_tab"; @@ -197,8 +197,11 @@ public class Launcher { if (!LinkManager.isLogViewer()) tabbedPane.add("Settings", settingsTab.createPane()); - if (!LinkManager.isLogViewer()) - tabbedPane.addTab("Formulas", new FormulasPane().getContent()); + if (!LinkManager.isLogViewer()) { + tabbedPane.addTab("Formulas/Live Data", new FormulasPane().getContent()); + tabbedPane.addTab("Sensors Live Data", new SensorsLiveDataPane().getContent()); + } + if (!LinkManager.isLogViewer() && false) // todo: fix it & better name? tabbedPane.add("Logs Manager", logsManager.getContent()); fuelTunePane = new FuelTunePane(getConfig().getRoot().getChild("fueltune")); diff --git a/java_console/ui/src/com/rusefi/ui/FormulasPane.java b/java_console/ui/src/com/rusefi/ui/FormulasPane.java index bffda919d4..60b504d7ab 100644 --- a/java_console/ui/src/com/rusefi/ui/FormulasPane.java +++ b/java_console/ui/src/com/rusefi/ui/FormulasPane.java @@ -25,7 +25,7 @@ import java.awt.image.BufferedImage; /** - * (c) Andrey Belomutskiy 2013-2018 + * (c) Andrey Belomutskiy 2013-2019 */ public class FormulasPane { private static final String NL = "\r\n \\\\ "; @@ -44,14 +44,12 @@ public class FormulasPane { public FormulasPane() { JPanel vertical = new JPanel(new VerticalFlowLayout()); - vertical.add(formulaProxy); vertical.add(liveDocs); + vertical.add(formulaProxy); JScrollPane scroll = new JScrollPane(vertical, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); content.add(scroll, BorderLayout.CENTER); - - formulaProxy.add(new JLabel("Waiting for data..."), BorderLayout.CENTER); JButton saveImage = UiUtils.createSaveImageButton(); diff --git a/java_console/ui/src/com/rusefi/ui/SensorsLiveDataPane.java b/java_console/ui/src/com/rusefi/ui/SensorsLiveDataPane.java new file mode 100644 index 0000000000..fd100012a3 --- /dev/null +++ b/java_console/ui/src/com/rusefi/ui/SensorsLiveDataPane.java @@ -0,0 +1,32 @@ +package com.rusefi.ui; + +import com.rusefi.ui.livedocs.LiveDocPanel; +import org.putgemin.VerticalFlowLayout; + +import javax.swing.*; +import java.awt.*; + +/** + * (c) Andrey Belomutskiy 2013-2019 + */ +public class SensorsLiveDataPane { + private JPanel liveDocs = LiveDocPanel.createSensorsLiveDataPanel(); + /** + * this is the panel we expose to the outside world + */ + private final JPanel content = new JPanel(new BorderLayout()); + + public SensorsLiveDataPane() { + JPanel vertical = new JPanel(new VerticalFlowLayout()); + + vertical.add(liveDocs); + + JScrollPane scroll = new JScrollPane(vertical, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); + content.add(scroll, BorderLayout.CENTER); + + } + + public JPanel getContent() { + return content; + } +} diff --git a/java_console/ui/src/com/rusefi/ui/livedocs/LiveDocPanel.java b/java_console/ui/src/com/rusefi/ui/livedocs/LiveDocPanel.java index ab6d028e71..d6bce3a83c 100644 --- a/java_console/ui/src/com/rusefi/ui/livedocs/LiveDocPanel.java +++ b/java_console/ui/src/com/rusefi/ui/livedocs/LiveDocPanel.java @@ -28,6 +28,7 @@ import static com.rusefi.config.Field.niceToString; public class LiveDocPanel { private static final String CONSTRAINTS = "wrap, grow"; + private static final String LAYOUT = "gap 0, insets 0"; @NotNull static JPanel createPanel(String title, String instancePrefix, final int id, Field[] values, Request[] content) { @@ -167,7 +168,21 @@ public class LiveDocPanel { @NotNull public static JPanel createLiveDocumentationPanel() { - JPanel liveDocs = new JPanel(new MigLayout("gap 0, insets 0")); + JPanel liveDocs = new JPanel(new MigLayout(LAYOUT)); + liveDocs.add(createPanel("tCharge", "", Fields.LDS_ENGINE_STATE_INDEX, + EngineState.VALUES, SpeedDensityMeta.CONTENT), CONSTRAINTS); + + liveDocs.add(createPanel("Idle", "", Fields.LDS_ENGINE_STATE_INDEX, + EngineState.VALUES, IdleThreadMeta.CONTENT), CONSTRAINTS); + + liveDocs.add(createPanel("ETB", "", Fields.LDS_ETB, + EngineState.VALUES, ElectronicThrottleMeta.CONTENT), CONSTRAINTS); + + return liveDocs; + } + + public static JPanel createSensorsLiveDataPanel() { + JPanel liveDocs = new JPanel(new MigLayout(LAYOUT)); liveDocs.add(createPanel("Coolant Sensor", "CLT", Fields.LDS_CLT_INDEX, ThermistorState.VALUES, ThermistorsMeta.CONTENT), CONSTRAINTS); @@ -178,18 +193,9 @@ public class LiveDocPanel { liveDocs.add(createPanel("Throttle Position Sensor", "", Fields.LDS_ENGINE_STATE_INDEX, EngineState.VALUES, TpsMeta.TPS_SECTION), CONSTRAINTS); - liveDocs.add(createPanel("tCharge", "", Fields.LDS_ENGINE_STATE_INDEX, - EngineState.VALUES, SpeedDensityMeta.CONTENT), CONSTRAINTS); - liveDocs.add(createPanel("Trigger", "", Fields.LDS_TRIGGER_INDEX, TriggerState.VALUES, TriggerDecoderMeta.CONTENT), CONSTRAINTS); - liveDocs.add(createPanel("Idle", "", Fields.LDS_ENGINE_STATE_INDEX, - EngineState.VALUES, IdleThreadMeta.CONTENT), CONSTRAINTS); - - liveDocs.add(createPanel("ETB", "", Fields.LDS_ETB, - EngineState.VALUES, ElectronicThrottleMeta.CONTENT), CONSTRAINTS); - return liveDocs; } }