From 3a0bfa320b04d5c6542355f0142b8e3713d2fc41 Mon Sep 17 00:00:00 2001 From: kascade Date: Sat, 2 Sep 2006 04:52:15 +0000 Subject: [PATCH] bug fixes git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@277 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d --- src/enginuity/logger/EcuLogger.java | 5 +++++ src/enginuity/logger/ui/handler/DashboardUpdateHandler.java | 3 ++- src/enginuity/logger/ui/handler/FileUpdateHandler.java | 5 +++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/enginuity/logger/EcuLogger.java b/src/enginuity/logger/EcuLogger.java index 872471f9..bc95e6ee 100644 --- a/src/enginuity/logger/EcuLogger.java +++ b/src/enginuity/logger/EcuLogger.java @@ -239,6 +239,11 @@ public final class EcuLogger extends JFrame implements WindowListener, PropertyC public void windowClosing(WindowEvent windowEvent) { try { controller.stop(); + try { + Thread.sleep(250); + } catch (InterruptedException e) { + e.printStackTrace(); + } } finally { cleanUpUpdateHandlers(); } diff --git a/src/enginuity/logger/ui/handler/DashboardUpdateHandler.java b/src/enginuity/logger/ui/handler/DashboardUpdateHandler.java index 092c54a7..b1eeb688 100644 --- a/src/enginuity/logger/ui/handler/DashboardUpdateHandler.java +++ b/src/enginuity/logger/ui/handler/DashboardUpdateHandler.java @@ -6,12 +6,13 @@ import enginuity.logger.definition.EcuDataConvertor; import javax.swing.*; import javax.swing.border.BevelBorder; import java.awt.*; +import static java.util.Collections.synchronizedMap; import java.util.HashMap; import java.util.Map; public final class DashboardUpdateHandler implements DataUpdateHandler { private final JPanel dashboardPanel; - private final Map gauges = new HashMap(); + private final Map gauges = synchronizedMap(new HashMap()); public DashboardUpdateHandler(JPanel dashboardPanel) { this.dashboardPanel = dashboardPanel; diff --git a/src/enginuity/logger/ui/handler/FileUpdateHandler.java b/src/enginuity/logger/ui/handler/FileUpdateHandler.java index d81dede5..6328fec7 100644 --- a/src/enginuity/logger/ui/handler/FileUpdateHandler.java +++ b/src/enginuity/logger/ui/handler/FileUpdateHandler.java @@ -8,6 +8,7 @@ import enginuity.logger.io.file.FileLogger; import enginuity.logger.io.file.FileLoggerImpl; import static enginuity.util.ParamChecker.checkNotNull; +import static java.util.Collections.synchronizedList; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; @@ -15,7 +16,7 @@ import java.util.Map; public final class FileUpdateHandler implements DataUpdateHandler { private final FileLogger fileLogger; - private final List ecuDatas = new LinkedList(); + private final List ecuDatas = synchronizedList(new LinkedList()); private Line currentLine = new Line(ecuDatas); public FileUpdateHandler(Settings settings) { @@ -102,7 +103,7 @@ public final class FileUpdateHandler implements DataUpdateHandler { public String values() { StringBuilder buffer = new StringBuilder(); - buffer.append(lastTimestamp); + buffer.append(lastTimestamp / 1000.0); for (EcuData ecuData : ecuDataValues.keySet()) { String value = ecuDataValues.get(ecuData); buffer.append(DELIMITER).append(value);