From 10846acc6da75bb7f8b91d2e880b679d0409c7f9 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Fri, 25 Nov 2022 21:23:03 -0500 Subject: [PATCH] rusEFI console: Seconds of nothing between "connect" and console #4773 --- java_console/ui/src/main/java/com/rusefi/ConsoleUI.java | 2 ++ .../ui/src/main/java/com/rusefi/ui/LiveDataPane.java | 9 +++++++-- .../src/main/java/com/rusefi/ui/engine/ZoomControl.java | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/java_console/ui/src/main/java/com/rusefi/ConsoleUI.java b/java_console/ui/src/main/java/com/rusefi/ConsoleUI.java index a96397f0ed..ec1f5ee199 100644 --- a/java_console/ui/src/main/java/com/rusefi/ConsoleUI.java +++ b/java_console/ui/src/main/java/com/rusefi/ConsoleUI.java @@ -62,6 +62,7 @@ public class ConsoleUI { } public ConsoleUI(String port) { + log.info("init..."); tabbedPane = new TabbedPanel(uiContext); this.port = port; MainFrame mainFrame = new MainFrame(this, tabbedPane); @@ -167,6 +168,7 @@ public class ConsoleUI { }); AutoupdateUtil.setAppIcon(mainFrame.getFrame().getFrame()); + log.info("showFrame"); mainFrame.getFrame().showFrame(tabbedPane.tabbedPane); } diff --git a/java_console/ui/src/main/java/com/rusefi/ui/LiveDataPane.java b/java_console/ui/src/main/java/com/rusefi/ui/LiveDataPane.java index 9bbfd0feef..20f61dc2aa 100644 --- a/java_console/ui/src/main/java/com/rusefi/ui/LiveDataPane.java +++ b/java_console/ui/src/main/java/com/rusefi/ui/LiveDataPane.java @@ -1,6 +1,7 @@ package com.rusefi.ui; import com.camick.RXTextUtilities; +import com.devexperts.logging.Logging; import com.rusefi.CodeWalkthrough; import com.rusefi.config.Field; import com.rusefi.core.Sensor; @@ -21,6 +22,8 @@ import javax.swing.tree.*; import java.awt.*; import java.awt.event.*; +import static com.devexperts.logging.Logging.getLogging; + /** * Andrey Belomutskiy, (c) 2013-2020 @@ -29,6 +32,8 @@ import java.awt.event.*; * See LiveDataPaneSandbox */ public class LiveDataPane { + private static final Logging log = getLogging(LiveDataPane.class); + public static final String CPP_SUFFIX = ".cpp"; /** @@ -38,14 +43,13 @@ public class LiveDataPane { private boolean isPaused; public LiveDataPane(UIContext uiContext) { - + long start = System.currentTimeMillis(); JPanel vertical = new JPanel(new MigLayout("wrap 1", "[grow,fill]")); vertical.setBorder(BorderFactory.createLineBorder(Color.orange)); JScrollPane scroll = new JScrollPane(vertical, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); JPanel legend = populateLegend(); - DefaultMutableTreeNode root = new DefaultMutableTreeNode(); for (live_data_e view : live_data_e.values()) { String fileName = StateDictionary.INSTANCE.getFileName(view) + CPP_SUFFIX; @@ -134,6 +138,7 @@ public class LiveDataPane { bottomPanel.add(new IntGaugeLabel("error", Sensor.lastErrorCode)); content.add(bottomPanel, BorderLayout.SOUTH); + log.info("created in " + (System.currentTimeMillis() - start) + "ms"); } @NotNull diff --git a/java_console/ui/src/main/java/com/rusefi/ui/engine/ZoomControl.java b/java_console/ui/src/main/java/com/rusefi/ui/engine/ZoomControl.java index c908f15a60..20acc12451 100644 --- a/java_console/ui/src/main/java/com/rusefi/ui/engine/ZoomControl.java +++ b/java_console/ui/src/main/java/com/rusefi/ui/engine/ZoomControl.java @@ -95,7 +95,7 @@ class ZoomControl extends JPanel { } private void setValue(double value) { - System.out.println("Zoom setValue " + value); + //log.info("Zoom setValue " + value); this.value = value; resetZoom.setEnabled(Math.abs(1 - value) > 0.01);