mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-30 19:52:13 +01:00
Reopen serial monitor on correct port if changed from menu
This commit is contained in:
parent
465c766efb
commit
e7d85d8b6d
@ -1015,22 +1015,20 @@ public class Editor extends JFrame implements RunnerListener {
|
||||
//System.out.println(item.getLabel());
|
||||
|
||||
BaseNoGui.selectSerialPort(name);
|
||||
if (serialMonitor != null) {
|
||||
try {
|
||||
try {
|
||||
boolean reopenMonitor = ((serialMonitor != null && serialMonitor.isVisible()) ||
|
||||
serialPlotter != null && serialPlotter.isVisible());
|
||||
if (serialMonitor != null) {
|
||||
serialMonitor.close();
|
||||
serialMonitor.setVisible(false);
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
if (serialPlotter != null) {
|
||||
try {
|
||||
if (serialPlotter != null) {
|
||||
serialPlotter.close();
|
||||
serialPlotter.setVisible(false);
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
if (reopenMonitor) {
|
||||
handleSerial();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
onBoardOrPortChange();
|
||||
|
Loading…
x
Reference in New Issue
Block a user