diff --git a/src/main/java/com/marginallyclever/makelangelo/plotter/plottercontrols/JogPanel.java b/src/main/java/com/marginallyclever/makelangelo/plotter/plottercontrols/JogPanel.java index da68bdd58..c81acc68b 100644 --- a/src/main/java/com/marginallyclever/makelangelo/plotter/plottercontrols/JogPanel.java +++ b/src/main/java/com/marginallyclever/makelangelo/plotter/plottercontrols/JogPanel.java @@ -24,10 +24,9 @@ */ public class JogPanel extends JPanel { private static final Logger logger = LoggerFactory.getLogger(JogPanel.class); - - private static final long serialVersionUID = -7408469373702327861L; - private Plotter myPlotter; - private CartesianButtons bCartesian = new CartesianButtons(); + + private final Plotter myPlotter; + private final CartesianButtons bCartesian = new CartesianButtons(); private JButton toggleEngageMotor; private JButton findHome; private JButton penUp; diff --git a/src/main/java/com/marginallyclever/makelangelo/plotter/plottercontrols/MarlinPanel.java b/src/main/java/com/marginallyclever/makelangelo/plotter/plottercontrols/MarlinPanel.java index 3af25804e..d9adddf71 100644 --- a/src/main/java/com/marginallyclever/makelangelo/plotter/plottercontrols/MarlinPanel.java +++ b/src/main/java/com/marginallyclever/makelangelo/plotter/plottercontrols/MarlinPanel.java @@ -1,7 +1,6 @@ package com.marginallyclever.makelangelo.plotter.plottercontrols; import com.marginallyclever.communications.NetworkSessionEvent; -import com.marginallyclever.communications.NetworkSessionListener; import com.marginallyclever.convenience.CommandLineOptions; import com.marginallyclever.makelangelo.Translator; import com.marginallyclever.util.PreferencesHelper; @@ -84,10 +83,6 @@ public MarlinPanel(ChooseConnection chooseConnection) { }); } - public void addNetworkSessionListener(NetworkSessionListener a) { - chatInterface.addNetworkSessionListener(a); - } - private void onConnect() { logger.debug("MarlinInterface connected."); setupNetworkListener(); @@ -123,8 +118,11 @@ private void onTimeoutCheck() { private void setupNetworkListener() { chatInterface.addNetworkSessionListener(this::onDataReceived); } - - // This does not fire on the Swing EVT thread. Be careful! Concurrency problems may happen. + + /** + * This does not fire on the Swing EVT thread. Be careful! Concurrency problems may happen. + * @param evt the network session event + */ protected void onDataReceived(NetworkSessionEvent evt) { if (evt.flag == NetworkSessionEvent.DATA_RECEIVED) { lastReceivedTime = System.currentTimeMillis(); diff --git a/src/main/java/com/marginallyclever/makelangelo/plotter/plottercontrols/MarlinPlotterPanel.java b/src/main/java/com/marginallyclever/makelangelo/plotter/plottercontrols/MarlinPlotterPanel.java index 9438c21f1..37267d296 100644 --- a/src/main/java/com/marginallyclever/makelangelo/plotter/plottercontrols/MarlinPlotterPanel.java +++ b/src/main/java/com/marginallyclever/makelangelo/plotter/plottercontrols/MarlinPlotterPanel.java @@ -3,16 +3,14 @@ import com.marginallyclever.communications.NetworkSessionEvent; import com.marginallyclever.convenience.ColorRGB; import com.marginallyclever.convenience.Point2D; -import com.marginallyclever.convenience.helpers.StringHelper; import com.marginallyclever.convenience.W3CColorNames; +import com.marginallyclever.convenience.helpers.StringHelper; import com.marginallyclever.makelangelo.plotter.Plotter; import com.marginallyclever.makelangelo.plotter.PlotterEvent; import com.marginallyclever.makelangelo.plotter.plottersettings.PlotterSettings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.Serial; - /** * {@link MarlinPlotterPanel} is a {@link MarlinPanel} with extra * instructions for interaction with a plotter robot. @@ -21,15 +19,14 @@ * @since 7.28.0 */ public class MarlinPlotterPanel extends MarlinPanel { - @Serial - private static final long serialVersionUID = -7114823910724405882L; - private static final Logger logger = LoggerFactory.getLogger(MarlinPlotterPanel.class); private static final String STR_FEEDRATE = "echo: M203"; private static final String STR_ACCELERATION = "echo: M201"; private static final String MOTOR_ENGAGE = "M17"; private static final String MOTOR_DISENGAGE = "M18"; + + // M665 Set delta/polargraph configuration. private static final String M665 = "M665"; private final Plotter myPlotter; @@ -125,6 +122,10 @@ private void sendSizeUpdate() { +" H"+StringHelper.formatDouble(maxLen)); } + /** + * This does not fire on the Swing EVT thread. Be careful! Concurrency problems may happen. + * @param evt the network session event + */ @Override protected void onDataReceived(NetworkSessionEvent evt) { super.onDataReceived(evt);