mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-31 20: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());
|
//System.out.println(item.getLabel());
|
||||||
|
|
||||||
BaseNoGui.selectSerialPort(name);
|
BaseNoGui.selectSerialPort(name);
|
||||||
if (serialMonitor != null) {
|
try {
|
||||||
try {
|
boolean reopenMonitor = ((serialMonitor != null && serialMonitor.isVisible()) ||
|
||||||
|
serialPlotter != null && serialPlotter.isVisible());
|
||||||
|
if (serialMonitor != null) {
|
||||||
serialMonitor.close();
|
serialMonitor.close();
|
||||||
serialMonitor.setVisible(false);
|
|
||||||
} catch (Exception e) {
|
|
||||||
// ignore
|
|
||||||
}
|
}
|
||||||
}
|
if (serialPlotter != null) {
|
||||||
|
|
||||||
if (serialPlotter != null) {
|
|
||||||
try {
|
|
||||||
serialPlotter.close();
|
serialPlotter.close();
|
||||||
serialPlotter.setVisible(false);
|
|
||||||
} catch (Exception e) {
|
|
||||||
// ignore
|
|
||||||
}
|
}
|
||||||
|
if (reopenMonitor) {
|
||||||
|
handleSerial();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
onBoardOrPortChange();
|
onBoardOrPortChange();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user