move sensor live data to separate pane fix #910

This commit is contained in:
rusefi 2019-08-26 20:16:56 -04:00
parent 1cc50b1dea
commit 8fd1463b52
4 changed files with 56 additions and 17 deletions

View File

@ -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"));

View File

@ -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();

View File

@ -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;
}
}

View File

@ -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;
}
}