From 69670cf1ed32b458fc11f723762b42eb88f2b929 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Wed, 2 Sep 2015 20:01:29 -0400 Subject: [PATCH] auto-sync --- firmware/controllers/algo/accel_enrichment.cpp | 4 ++-- java_console/ui/src/com/rusefi/ui/GaugesPanel.java | 13 +++++++++---- java_console/ui/src/com/rusefi/ui/MessagesPane.java | 4 +++- .../ui/src/com/rusefi/ui/MessagesPanel.java | 7 +++---- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/firmware/controllers/algo/accel_enrichment.cpp b/firmware/controllers/algo/accel_enrichment.cpp index 4ec2ba94c5..fffd3c1fba 100644 --- a/firmware/controllers/algo/accel_enrichment.cpp +++ b/firmware/controllers/algo/accel_enrichment.cpp @@ -153,7 +153,7 @@ static void setDecelMult(float value) { static void setTpsAccelLen(int len) { if (len < 1) { - scheduleMsg(logger, "Length shoold be positive"); + scheduleMsg(logger, "Length should be positive"); return; } engine->tpsAccelEnrichment.cb.setSize(len); @@ -162,7 +162,7 @@ static void setTpsAccelLen(int len) { static void setMapAccelLen(int len) { if (len < 1) { - scheduleMsg(logger, "Length shoold be positive"); + scheduleMsg(logger, "Length should be positive"); return; } engine->mapAccelEnrichment.cb.setSize(len); diff --git a/java_console/ui/src/com/rusefi/ui/GaugesPanel.java b/java_console/ui/src/com/rusefi/ui/GaugesPanel.java index 739c7e1381..c834e7f376 100644 --- a/java_console/ui/src/com/rusefi/ui/GaugesPanel.java +++ b/java_console/ui/src/com/rusefi/ui/GaugesPanel.java @@ -4,8 +4,8 @@ import com.rusefi.FileLog; import com.rusefi.core.Sensor; import com.rusefi.ui.storage.Node; import com.rusefi.ui.util.UiUtils; +import com.rusefi.ui.widgets.AnyCommand; import com.rusefi.ui.widgets.PopupMenuButton; -import com.rusefi.ui.widgets.SensorGauge; import org.jetbrains.annotations.NotNull; import javax.swing.*; @@ -63,6 +63,9 @@ public class GaugesPanel { private boolean showRpmPanel = true; private boolean showMessagesPanel = true; private final JPanel lowerRpmPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0)); + /** + * this panel is displayed on the right + */ private final JPanel messagesPanel = new JPanel(new BorderLayout()); private final JSplitPane middleSplitPanel; @@ -71,7 +74,7 @@ public class GaugesPanel { showRpmPanel = config.getBoolProperty(SHOW_RPM, true); showMessagesPanel = config.getBoolProperty(SHOW_MESSAGES, true); - prepareMessagesPanel(config); + prepareMessagesPanel(); lowerRpmPanel.add(new RpmLabel(15).getContent()); @@ -176,8 +179,8 @@ public class GaugesPanel { return menu; } - private void prepareMessagesPanel(Node config) { - MessagesPanel mp = new MessagesPanel(config, false); + private void prepareMessagesPanel() { + MessagesPanel mp = new MessagesPanel(null); messagesPanel.add(BorderLayout.NORTH, mp.getButtonPanel()); messagesPanel.add(BorderLayout.CENTER, mp.getMessagesScroll()); } @@ -187,6 +190,8 @@ public class GaugesPanel { JPanel leftUpperPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 0)); leftUpperPanel.add(createSaveImageButton()); leftUpperPanel.add(new RpmLabel(2).getContent()); + AnyCommand command = new AnyCommand(config, false, false); + leftUpperPanel.add(command.getContent()); return leftUpperPanel; } diff --git a/java_console/ui/src/com/rusefi/ui/MessagesPane.java b/java_console/ui/src/com/rusefi/ui/MessagesPane.java index 842d38086a..d92d3ec0b6 100644 --- a/java_console/ui/src/com/rusefi/ui/MessagesPane.java +++ b/java_console/ui/src/com/rusefi/ui/MessagesPane.java @@ -5,6 +5,7 @@ import com.rusefi.Launcher; import com.rusefi.ui.engine.EngineSnifferPanel; import com.rusefi.ui.storage.Node; import com.rusefi.ui.util.URLLabel; +import com.rusefi.ui.widgets.AnyCommand; import com.rusefi.ui.widgets.IdleLabel; import javax.swing.*; @@ -27,7 +28,8 @@ public class MessagesPane { public MessagesPane(final Node config) { JPanel topPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 0)); - final MessagesPanel upperPanel = new MessagesPanel(config, true); + AnyCommand command = new AnyCommand(config, true, false); + final MessagesPanel upperPanel = new MessagesPanel(command.getContent()); upperPanel.loadFont(config); JPanel middlePanel = new JPanel(new BorderLayout()); diff --git a/java_console/ui/src/com/rusefi/ui/MessagesPanel.java b/java_console/ui/src/com/rusefi/ui/MessagesPanel.java index 4120d4a613..6e62affe68 100644 --- a/java_console/ui/src/com/rusefi/ui/MessagesPanel.java +++ b/java_console/ui/src/com/rusefi/ui/MessagesPanel.java @@ -25,12 +25,11 @@ public class MessagesPanel { private static final String FONT_SIZE = "font_size"; private static final String FONT_NAME = "font_name"; - private final AnyCommand anyCommand; private final MessagesView messagesView = new MessagesView(); private final JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 5, 0)); - public MessagesPanel(Node config, boolean listenToCommands) { + public MessagesPanel(JComponent extraButton) { JPanel middlePanel = new JPanel(new BorderLayout()); middlePanel.add(messagesView.messagesScroll, BorderLayout.CENTER); // buttonPanel.setBorder(BorderFactory.createLineBorder(Color.cyan)); @@ -56,8 +55,8 @@ public class MessagesPanel { buttonPanel.add(resetButton); buttonPanel.add(pauseButton); - anyCommand = new AnyCommand(config, listenToCommands, false); - buttonPanel.add(anyCommand.getContent()); + if (extraButton != null) + buttonPanel.add(extraButton); } public JPanel getButtonPanel() {