File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -1015,22 +1015,20 @@ private void selectSerialPort(String name) {
10151015 //System.out.println(item.getLabel());
10161016
10171017 BaseNoGui .selectSerialPort (name );
1018- if (serialMonitor != null ) {
1019- try {
1018+ try {
1019+ boolean reopenMonitor = ((serialMonitor != null && serialMonitor .isVisible ()) ||
1020+ serialPlotter != null && serialPlotter .isVisible ());
1021+ if (serialMonitor != null ) {
10201022 serialMonitor .close ();
1021- serialMonitor .setVisible (false );
1022- } catch (Exception e ) {
1023- // ignore
10241023 }
1025- }
1026-
1027- if (serialPlotter != null ) {
1028- try {
1024+ if (serialPlotter != null ) {
10291025 serialPlotter .close ();
1030- serialPlotter .setVisible (false );
1031- } catch (Exception e ) {
1032- // ignore
10331026 }
1027+ if (reopenMonitor ) {
1028+ handleSerial ();
1029+ }
1030+ } catch (Exception e ) {
1031+ // ignore
10341032 }
10351033
10361034 onBoardOrPortChange ();
You can’t perform that action at this time.
0 commit comments