let's log DFU window messages
This commit is contained in:
parent
a57b4c58a9
commit
7bef26344e
|
@ -16,5 +16,6 @@
|
||||||
<orderEntry type="library" exported="" name="annotations" level="project" />
|
<orderEntry type="library" exported="" name="annotations" level="project" />
|
||||||
<orderEntry type="module" module-name="inifile" exported="" />
|
<orderEntry type="module" module-name="inifile" exported="" />
|
||||||
<orderEntry type="library" name="mockito-all-1.10.19" level="project" />
|
<orderEntry type="library" name="mockito-all-1.10.19" level="project" />
|
||||||
|
<orderEntry type="module" module-name="logging" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
|
@ -6,7 +6,7 @@ import java.net.URL;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
public class rusEFIVersion {
|
public class rusEFIVersion {
|
||||||
public static final int CONSOLE_VERSION = 20210925;
|
public static final int CONSOLE_VERSION = 20210926;
|
||||||
public static AtomicReference<String> firmwareVersion = new AtomicReference<>("N/A");
|
public static AtomicReference<String> firmwareVersion = new AtomicReference<>("N/A");
|
||||||
|
|
||||||
public static long classBuildTimeMillis() {
|
public static long classBuildTimeMillis() {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.rusefi.ui;
|
package com.rusefi.ui;
|
||||||
|
|
||||||
|
import com.rusefi.FileLog;
|
||||||
import com.rusefi.ui.util.FrameHelper;
|
import com.rusefi.ui.util.FrameHelper;
|
||||||
import com.rusefi.ui.util.UiUtils;
|
import com.rusefi.ui.util.UiUtils;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
@ -13,10 +14,10 @@ import java.awt.*;
|
||||||
*/
|
*/
|
||||||
public class StatusWindow implements StatusConsumer {
|
public class StatusWindow implements StatusConsumer {
|
||||||
// todo: extract driver from console bundle? find a separate driver bundle?
|
// todo: extract driver from console bundle? find a separate driver bundle?
|
||||||
private final JTextArea log = new JTextArea();
|
private final JTextArea logTextArea = new JTextArea();
|
||||||
private final JPanel content = new JPanel(new BorderLayout());
|
private final JPanel content = new JPanel(new BorderLayout());
|
||||||
private final JLabel bottomStatusLabel = new JLabel();
|
private final JLabel bottomStatusLabel = new JLabel();
|
||||||
private final JScrollPane messagesScroll = new JScrollPane(log, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED) {
|
private final JScrollPane messagesScroll = new JScrollPane(logTextArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED) {
|
||||||
@Override
|
@Override
|
||||||
public Dimension getPreferredSize() {
|
public Dimension getPreferredSize() {
|
||||||
return new Dimension(400, 400);
|
return new Dimension(400, 400);
|
||||||
|
@ -26,7 +27,7 @@ public class StatusWindow implements StatusConsumer {
|
||||||
protected final FrameHelper frameHelper = new FrameHelper();
|
protected final FrameHelper frameHelper = new FrameHelper();
|
||||||
|
|
||||||
public StatusWindow() {
|
public StatusWindow() {
|
||||||
log.setLineWrap(true);
|
logTextArea.setLineWrap(true);
|
||||||
content.add(messagesScroll, BorderLayout.CENTER);
|
content.add(messagesScroll, BorderLayout.CENTER);
|
||||||
content.add(bottomStatusLabel, BorderLayout.SOUTH);
|
content.add(bottomStatusLabel, BorderLayout.SOUTH);
|
||||||
}
|
}
|
||||||
|
@ -48,17 +49,15 @@ public class StatusWindow implements StatusConsumer {
|
||||||
frameHelper.getFrame().setTitle(title);
|
frameHelper.getFrame().setTitle(title);
|
||||||
frameHelper.showFrame(content, false);
|
frameHelper.showFrame(content, false);
|
||||||
UiUtils.centerWindow(frameHelper.getFrame());
|
UiUtils.centerWindow(frameHelper.getFrame());
|
||||||
log.setText(""); // let's remove stuff from previous invocation
|
logTextArea.setText(""); // let's remove stuff from previous invocation
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void appendMsg(final String s) {
|
public void appendMsg(final String s) {
|
||||||
SwingUtilities.invokeLater(new Runnable() {
|
SwingUtilities.invokeLater(() -> {
|
||||||
@Override
|
FileLog.MAIN.logLine(s);
|
||||||
public void run() {
|
logTextArea.append(s + "\r\n");
|
||||||
log.append(s + "\r\n");
|
UiUtils.trueLayout(logTextArea);
|
||||||
UiUtils.trueLayout(log);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue