public class GcodeDriver extends AbstractReferenceDriver implements Named
Modifier and Type | Class and Description |
---|---|
static interface |
GcodeDriver.AxisTransform
Deprecated.
|
static class |
GcodeDriver.CamTransform
Deprecated.
|
static class |
GcodeDriver.Command |
static class |
GcodeDriver.CommandType |
static class |
GcodeDriver.Line |
static class |
GcodeDriver.NegatingTransform
Deprecated.
|
static class |
GcodeDriver.OffsetTransform
Deprecated.
|
protected class |
GcodeDriver.ReaderThread |
static class |
GcodeDriver.ScalingTransform
Deprecated.
|
static interface |
GcodeDriver.TimeoutAction |
AbstractReferenceDriver.CommunicationsType
Driver.MotionControlType
PropertySheetHolder.PropertySheet
Modifier and Type | Field and Description |
---|---|
protected java.util.List<org.openpnp.machine.reference.driver.GcodeDriver.Axis> |
axes
Deprecated.
|
protected double |
backlashFeedRateFactor
Deprecated.
|
protected double |
backlashOffsetR
Deprecated.
|
protected double |
backlashOffsetX
Deprecated.
|
protected double |
backlashOffsetY
Deprecated.
|
protected double |
backlashOffsetZ
Deprecated.
|
protected boolean |
backslashEscapedCharactersEnabled |
java.util.ArrayList<GcodeDriver.Command> |
commands |
protected boolean |
compressGcode |
protected java.lang.String |
compressionExcludes |
protected boolean |
connected |
protected int |
connectWaitTimeMilliseconds |
protected int |
dollarWaitTimeMilliseconds |
protected GcodeDriver.Line |
errorResponse |
protected Location |
homingFiducialLocation
Deprecated.
|
protected boolean |
loggingGcode |
protected int |
maxFeedRate |
protected double |
nonSquarenessFactor
Deprecated.
|
protected java.util.concurrent.LinkedBlockingQueue<GcodeDriver.Line> |
receivedConfirmationsQueue |
protected boolean |
removeComments |
protected java.util.concurrent.LinkedBlockingQueue<AxesLocation> |
reportedLocationsQueue |
protected java.util.concurrent.LinkedBlockingQueue<GcodeDriver.Line> |
responseQueue |
protected java.util.List<GcodeDriver> |
subDrivers
Deprecated.
|
protected int |
timeoutMilliseconds |
protected LengthUnit |
units |
protected boolean |
visualHomingEnabled
Deprecated.
|
baud, communicationsType, connectionKeepAlive, dataBits, flowControl, motionControlType, parity, portName, serial, setDtr, setRts, simulated, stopBits, syncInitialLocation, tcp
deleteAction, id, name, permutateDownAction, permutateUpAction
propertyChangeSupport
Constructor and Description |
---|
GcodeDriver() |
Modifier and Type | Method and Description |
---|---|
void |
actuate(Actuator actuator,
boolean on)
Actuates a machine defined object with a boolean state.
|
void |
actuate(Actuator actuator,
double value)
Actuates a machine defined object with a double value.
|
void |
actuate(Actuator actuator,
java.lang.String value)
Actuates a machine defined object with a String value.
|
java.lang.String |
actuatorRead(Actuator actuator)
Read a String value from the given Actuator.
|
java.lang.String |
actuatorRead(Actuator actuator,
java.lang.Object parameter)
Read a given String value from the given Actuator.
|
protected void |
bailOnError() |
void |
close() |
protected void |
closeGcodeLogger() |
void |
commit() |
void |
connect() |
protected void |
connectThreads()
Connect the threads used for communications.
|
void |
createDefaultCommands() |
void |
createDefaults() |
void |
detectFirmware(boolean preserveOldValue,
boolean allowConnect)
Detect the firmware running on a controller using the M115 command.
|
protected void |
detectFirmwareSequence() |
void |
disconnect() |
protected void |
disconnectThreads()
Disconnect the threads used for communications.
|
protected void |
drainCommandQueue(long timeout) |
void |
findIssues(Solutions solutions)
Report any detected issue and proposed solution in the list.
|
java.util.List<java.lang.String> |
getAxisVariables(ReferenceMachine machine) |
java.lang.String |
getCommand(HeadMountable hm,
GcodeDriver.CommandType type) |
GcodeDriver.Command |
getCommand(HeadMountable hm,
GcodeDriver.CommandType type,
boolean checkDefaults) |
java.lang.String |
getCompressionExcludes() |
java.lang.String |
getConfiguredAxes() |
int |
getConnectWaitTimeMilliseconds() |
java.lang.String |
getDetectedFirmware() |
int |
getDollarWaitTimeMilliseconds() |
GcodeDriver.Command |
getExactCommand(java.lang.String headMountableId,
GcodeDriver.CommandType type)
This is similar to the other getCommand calls, except the head mountable id is passed in and it must match
exactly.
|
Length |
getFeedRatePerSecond() |
java.lang.String |
getFirmwareConfiguration() |
java.lang.String |
getFirmwareProperty(java.lang.String name,
java.lang.String defaultValue) |
org.openpnp.machine.reference.driver.GcodeDriver.Axis |
getLegacyAxis(HeadMountable hm,
Axis.Type type)
Deprecated.
|
int |
getMaxFeedRate() |
PropertySheetHolder.PropertySheet[] |
getPropertySheets() |
java.lang.String |
getReportedAxes() |
java.util.List<java.lang.String> |
getReportedAxesLetters() |
AxesLocation |
getReportedLocation(long timeout)
Get the momentary real-time location from the controller.
|
protected long |
getTimeoutAtMachineSpeed() |
int |
getTimeoutMilliseconds() |
LengthUnit |
getUnits() |
protected static boolean |
hasVariable(java.lang.String command,
java.lang.String name)
Find matches of variables in the format {Name:Format} and return true if present.
|
void |
home(Machine machine)
Perform the hardware homing operation.
|
boolean |
isBackslashEscapedCharactersEnabled() |
boolean |
isCompressGcode() |
boolean |
isLoggingGcode() |
boolean |
isMotionPending() |
boolean |
isRemoveComments() |
boolean |
isSpeakingGcode() |
boolean |
isSupportingPreMove() |
boolean |
isUsingLetterVariables() |
protected void |
migrateAssignAxis(org.openpnp.machine.reference.driver.GcodeDriver.Axis legacyAxis,
AbstractAxis axis,
HeadMountable hm)
Deprecated.
|
protected ReferenceControllerAxis |
migrateAxis(ReferenceMachine machine,
org.openpnp.machine.reference.driver.GcodeDriver.Axis legacyAxis)
Deprecated.
|
protected AbstractTransformedAxis |
migrateAxis(ReferenceMachine machine,
ReferenceControllerAxis inputAxis,
GcodeDriver.AxisTransform legacyAxis)
Deprecated.
|
void |
migrateDriver(Machine machine)
Deprecated.
|
void |
moveTo(HeadMountable hm,
Motion.MoveToCommand move)
Executes the given Motion.
|
protected java.lang.String |
preProcessCommand(java.lang.String command) |
protected boolean |
processPositionReport(GcodeDriver.Line line) |
protected void |
processResponse(GcodeDriver.Line line)
Process a received response immediately.
|
java.util.List<GcodeDriver.Line> |
receiveResponses() |
java.util.List<GcodeDriver.Line> |
receiveResponses(java.lang.String regex,
long timeout,
GcodeDriver.TimeoutAction timeoutAction) |
java.lang.String |
receiveSingleResponse(java.lang.String regex) |
void |
sendCommand(java.lang.String command) |
void |
sendCommand(java.lang.String command,
long timeout) |
protected void |
sendGcode(java.lang.String gCode) |
protected void |
sendGcode(java.lang.String gCode,
long timeout) |
void |
setBackslashEscapedCharactersEnabled(boolean backslashEscapedCharactersEnabled) |
void |
setCommand(HeadMountable hm,
GcodeDriver.CommandType type,
java.lang.String text) |
void |
setCompressGcode(boolean compressGcode) |
void |
setCompressionExcludes(java.lang.String compressionExcludes) |
void |
setConfiguredAxes(java.lang.String configuredAxes) |
void |
setConnectWaitTimeMilliseconds(int connectWaitTimeMilliseconds) |
void |
setDetectedFirmware(java.lang.String detectedFirmware) |
void |
setDollarWaitTimeMilliseconds(int dollarWaitTimeMilliseconds) |
void |
setEnabled(boolean enabled)
Attempts to enable the Driver, turning on all outputs.
|
void |
setFirmwareConfiguration(java.lang.String configuredAxes) |
void |
setGlobalOffsets(Machine machine,
AxesLocation axesLocation)
Set the current physical axis positions to be reinterpreted as the specified coordinates.
|
void |
setLoggingGcode(boolean loggingGcode) |
void |
setMaxFeedRate(int maxFeedRate) |
void |
setRemoveComments(boolean removeComments) |
void |
setReportedAxes(java.lang.String reportedAxes) |
void |
setSupportingPreMove(boolean supportingPreMove) |
void |
setTimeoutMilliseconds(int timeoutMilliseconds) |
void |
setUnits(LengthUnit units) |
void |
setUsingLetterVariables(boolean usingLetterVariables) |
protected static java.lang.String |
substituteVariable(java.lang.String command,
java.lang.String name,
java.lang.Object value) |
void |
waitForCompletion(HeadMountable hm,
MotionPlanner.CompletionType completionType)
Perform a coordinated wait for completion.
|
protected GcodeDriver.Line |
waitForConfirmation(java.lang.String command,
long timeout) |
getBaud, getCommunications, getCommunicationsType, getConfigurationWizard, getDataBits, getFlowControl, getIpAddress, getLineEndingType, getMotionControlType, getParity, getPort, getPortName, getSerial, getStopBits, getTcp, isConnectionKeepAlive, isInSimulationMode, isSetDtr, isSetRts, isSyncInitialLocation, setBaud, setCommunicationsType, setConnectionKeepAlive, setDataBits, setFlowControl, setIpAddress, setLineEndingType, setMotionControlType, setParity, setPort, setPortName, setSetDtr, setSetRts, setStopBits, setSyncInitialLocation, unescape
assignCameraVirtualAxes, createAxisMappingDefaults, getAxes, getChildPropertySheetHolders, getId, getMinimumRate, getName, getPropertySheetHolderActions, getPropertySheetHolderIcon, getPropertySheetHolderTitle, migrateAxis, setId, setName, toString
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, firePropertyChange, removePropertyChangeListener, removePropertyChangeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getInterpolationJerkSteps, getInterpolationMaxSteps, getInterpolationMinStep, getInterpolationTimeStep, getJunctionDeviation
getSubjectIcon, getSubjectText
protected LengthUnit units
protected int maxFeedRate
@Deprecated protected double backlashOffsetX
@Deprecated protected double backlashOffsetY
@Deprecated protected double backlashOffsetZ
@Deprecated protected double backlashOffsetR
@Deprecated protected double nonSquarenessFactor
@Deprecated protected double backlashFeedRateFactor
protected int timeoutMilliseconds
protected int connectWaitTimeMilliseconds
protected int dollarWaitTimeMilliseconds
@Deprecated protected boolean visualHomingEnabled
protected boolean backslashEscapedCharactersEnabled
protected boolean removeComments
protected boolean compressGcode
protected java.lang.String compressionExcludes
protected boolean loggingGcode
@Deprecated protected Location homingFiducialLocation
public java.util.ArrayList<GcodeDriver.Command> commands
@Deprecated protected java.util.List<GcodeDriver> subDrivers
@Deprecated protected java.util.List<org.openpnp.machine.reference.driver.GcodeDriver.Axis> axes
protected boolean connected
protected java.util.concurrent.LinkedBlockingQueue<GcodeDriver.Line> responseQueue
protected java.util.concurrent.LinkedBlockingQueue<AxesLocation> reportedLocationsQueue
protected java.util.concurrent.LinkedBlockingQueue<GcodeDriver.Line> receivedConfirmationsQueue
protected GcodeDriver.Line errorResponse
public void commit()
commit
in class AbstractReferenceDriver
public void createDefaults() throws java.lang.Exception
createDefaults
in class AbstractDriver
java.lang.Exception
public void createDefaultCommands()
public void connect() throws java.lang.Exception
java.lang.Exception
protected void connectThreads() throws java.lang.Exception
java.lang.Exception
public void setEnabled(boolean enabled) throws java.lang.Exception
Driver
setEnabled
in interface Driver
setEnabled
in class AbstractReferenceDriver
java.lang.Exception
public void home(Machine machine) throws java.lang.Exception
Driver
public java.util.List<java.lang.String> getAxisVariables(ReferenceMachine machine)
public void setGlobalOffsets(Machine machine, AxesLocation axesLocation) throws java.lang.Exception
Driver
setGlobalOffsets
in interface Driver
java.lang.Exception
http://www.linuxcnc.org/docs/html/gcode/coordinates.html#_the_g92_commands
,
http://smoothieware.org/g92-cnc
,
https://github.com/synthetos/TinyG/wiki/Coordinate-Systems#offsets-to-the-offsets-g92
public AxesLocation getReportedLocation(long timeout) throws java.lang.Exception
Driver
getReportedLocation
in interface Driver
timeout
- TODOjava.lang.Exception
public GcodeDriver.Command getExactCommand(java.lang.String headMountableId, GcodeDriver.CommandType type)
public GcodeDriver.Command getCommand(HeadMountable hm, GcodeDriver.CommandType type, boolean checkDefaults)
public java.lang.String getCommand(HeadMountable hm, GcodeDriver.CommandType type)
public void setCommand(HeadMountable hm, GcodeDriver.CommandType type, java.lang.String text)
public void moveTo(HeadMountable hm, Motion.MoveToCommand move) throws java.lang.Exception
Driver
moveTo
in interface Driver
hm
- The HeadMountable having triggered the move. This is mostly for proprietary machine driver support
and might only be a stand-in in some motion blending scenarios.move
- The moveTo Motion to execute, including target location and limits for feedrate,
acceleration etc. as shaped by the MotionPlannerjava.lang.Exception
public boolean isMotionPending()
isMotionPending
in interface Driver
protected void drainCommandQueue(long timeout) throws java.lang.InterruptedException
java.lang.InterruptedException
public void waitForCompletion(HeadMountable hm, MotionPlanner.CompletionType completionType) throws java.lang.Exception
Driver
waitForCompletion
in interface Driver
hm
- The HeadMountable to wait for. If null, wait for all the axes on the driver. Most drivers/controllers will probably
not be able to wait for just a sub-set of axes, so the'll wait for all the axes anyway.completionType
- The kind of completion wanted.java.lang.Exception
public void actuate(Actuator actuator, boolean on) throws java.lang.Exception
Driver
public void actuate(Actuator actuator, double value) throws java.lang.Exception
Driver
public void actuate(Actuator actuator, java.lang.String value) throws java.lang.Exception
Driver
public java.lang.String actuatorRead(Actuator actuator, java.lang.Object parameter) throws java.lang.Exception
Driver
actuatorRead
in interface Driver
java.lang.Exception
public java.lang.String actuatorRead(Actuator actuator) throws java.lang.Exception
Driver
actuatorRead
in interface Driver
java.lang.Exception
public void disconnect()
disconnect
in class AbstractReferenceDriver
protected void disconnectThreads()
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class AbstractReferenceDriver
java.io.IOException
protected void sendGcode(java.lang.String gCode) throws java.lang.Exception
java.lang.Exception
protected long getTimeoutAtMachineSpeed()
protected void sendGcode(java.lang.String gCode, long timeout) throws java.lang.Exception
java.lang.Exception
public void sendCommand(java.lang.String command) throws java.lang.Exception
java.lang.Exception
public void sendCommand(java.lang.String command, long timeout) throws java.lang.Exception
java.lang.Exception
protected GcodeDriver.Line waitForConfirmation(java.lang.String command, long timeout) throws java.lang.Exception
java.lang.Exception
protected void bailOnError() throws java.lang.Exception
java.lang.Exception
public java.util.List<GcodeDriver.Line> receiveResponses() throws java.lang.Exception
java.lang.Exception
public java.util.List<GcodeDriver.Line> receiveResponses(java.lang.String regex, long timeout, GcodeDriver.TimeoutAction timeoutAction) throws java.lang.Exception
java.lang.Exception
public java.lang.String receiveSingleResponse(java.lang.String regex) throws java.lang.Exception
java.lang.Exception
protected java.lang.String preProcessCommand(java.lang.String command)
protected void processResponse(GcodeDriver.Line line)
line
- protected boolean processPositionReport(GcodeDriver.Line line)
protected static java.lang.String substituteVariable(java.lang.String command, java.lang.String name, java.lang.Object value)
protected static boolean hasVariable(java.lang.String command, java.lang.String name)
public PropertySheetHolder.PropertySheet[] getPropertySheets()
getPropertySheets
in interface PropertySheetHolder
getPropertySheets
in class AbstractReferenceDriver
public LengthUnit getUnits()
public void setUnits(LengthUnit units)
public int getMaxFeedRate()
public void setMaxFeedRate(int maxFeedRate)
public Length getFeedRatePerSecond()
getFeedRatePerSecond
in interface Driver
getFeedRatePerSecond
in class AbstractDriver
public int getTimeoutMilliseconds()
public void setTimeoutMilliseconds(int timeoutMilliseconds)
public int getConnectWaitTimeMilliseconds()
public void setConnectWaitTimeMilliseconds(int connectWaitTimeMilliseconds)
public int getDollarWaitTimeMilliseconds()
public void setDollarWaitTimeMilliseconds(int dollarWaitTimeMilliseconds)
public boolean isBackslashEscapedCharactersEnabled()
public void setBackslashEscapedCharactersEnabled(boolean backslashEscapedCharactersEnabled)
public boolean isRemoveComments()
public void setRemoveComments(boolean removeComments)
public boolean isCompressGcode()
public void setCompressGcode(boolean compressGcode)
public java.lang.String getCompressionExcludes()
public void setCompressionExcludes(java.lang.String compressionExcludes)
public boolean isUsingLetterVariables()
isUsingLetterVariables
in interface Driver
public void setUsingLetterVariables(boolean usingLetterVariables)
public boolean isSupportingPreMove()
isSupportingPreMove
in interface Driver
isSupportingPreMove
in class AbstractDriver
public void setSupportingPreMove(boolean supportingPreMove)
public boolean isLoggingGcode()
public void setLoggingGcode(boolean loggingGcode)
public java.lang.String getDetectedFirmware()
public void setDetectedFirmware(java.lang.String detectedFirmware)
public java.lang.String getReportedAxes()
public void setReportedAxes(java.lang.String reportedAxes)
public java.util.List<java.lang.String> getReportedAxesLetters()
public java.lang.String getConfiguredAxes()
public void setConfiguredAxes(java.lang.String configuredAxes)
public java.lang.String getFirmwareConfiguration()
public void setFirmwareConfiguration(java.lang.String configuredAxes)
protected void closeGcodeLogger()
public void detectFirmware(boolean preserveOldValue, boolean allowConnect) throws java.lang.Exception
preserveOldValue
- preserve the old value if the detection fails.allowConnect
- allow opening an ad hoc connection, if the machine is disabled.java.lang.Exception
protected void detectFirmwareSequence() throws java.lang.Exception
java.lang.Exception
public java.lang.String getFirmwareProperty(java.lang.String name, java.lang.String defaultValue)
public boolean isSpeakingGcode()
public void findIssues(Solutions solutions)
Solutions.Subject
findIssues
in interface Solutions.Subject
@Deprecated public org.openpnp.machine.reference.driver.GcodeDriver.Axis getLegacyAxis(HeadMountable hm, Axis.Type type)
@Deprecated protected ReferenceControllerAxis migrateAxis(ReferenceMachine machine, org.openpnp.machine.reference.driver.GcodeDriver.Axis legacyAxis) throws java.lang.Exception
java.lang.Exception
@Deprecated protected AbstractTransformedAxis migrateAxis(ReferenceMachine machine, ReferenceControllerAxis inputAxis, GcodeDriver.AxisTransform legacyAxis) throws java.lang.Exception
java.lang.Exception
@Deprecated public void migrateDriver(Machine machine) throws java.lang.Exception
AbstractDriver
migrateDriver
in class AbstractDriver
java.lang.Exception
@Deprecated protected void migrateAssignAxis(org.openpnp.machine.reference.driver.GcodeDriver.Axis legacyAxis, AbstractAxis axis, HeadMountable hm)