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.CommunicationsTypeDriver.MotionControlTypePropertySheetHolder.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, tcpdeleteAction, id, name, permutateDownAction, permutateUpActionpropertyChangeSupport| 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, unescapeassignCameraVirtualAxes, createAxisMappingDefaults, getAxes, getChildPropertySheetHolders, getId, getMinimumRate, getName, getPropertySheetHolderActions, getPropertySheetHolderIcon, getPropertySheetHolderTitle, migrateAxis, setId, setName, toStringaddPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, firePropertyChange, removePropertyChangeListener, removePropertyChangeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetInterpolationJerkSteps, getInterpolationMaxSteps, getInterpolationMinStep, getInterpolationTimeStep, getJunctionDeviationgetSubjectIcon, getSubjectTextprotected 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 AbstractReferenceDriverpublic void createDefaults()
throws java.lang.Exception
createDefaults in class AbstractDriverjava.lang.Exceptionpublic void createDefaultCommands()
public void connect()
throws java.lang.Exception
java.lang.Exceptionprotected void connectThreads()
throws java.lang.Exception
java.lang.Exceptionpublic void setEnabled(boolean enabled)
throws java.lang.Exception
DriversetEnabled in interface DriversetEnabled in class AbstractReferenceDriverjava.lang.Exceptionpublic void home(Machine machine) throws java.lang.Exception
Driverpublic java.util.List<java.lang.String> getAxisVariables(ReferenceMachine machine)
public void setGlobalOffsets(Machine machine, AxesLocation axesLocation) throws java.lang.Exception
DriversetGlobalOffsets in interface Driverjava.lang.Exceptionhttp://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-g92public AxesLocation getReportedLocation(long timeout) throws java.lang.Exception
DrivergetReportedLocation in interface Drivertimeout - TODOjava.lang.Exceptionpublic 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
DrivermoveTo in interface Driverhm - 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.Exceptionpublic boolean isMotionPending()
isMotionPending in interface Driverprotected void drainCommandQueue(long timeout)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void waitForCompletion(HeadMountable hm, MotionPlanner.CompletionType completionType) throws java.lang.Exception
DriverwaitForCompletion in interface Driverhm - 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.Exceptionpublic void actuate(Actuator actuator, boolean on) throws java.lang.Exception
Driverpublic void actuate(Actuator actuator, double value) throws java.lang.Exception
Driverpublic void actuate(Actuator actuator, java.lang.String value) throws java.lang.Exception
Driverpublic java.lang.String actuatorRead(Actuator actuator, java.lang.Object parameter) throws java.lang.Exception
DriveractuatorRead in interface Driverjava.lang.Exceptionpublic java.lang.String actuatorRead(Actuator actuator) throws java.lang.Exception
DriveractuatorRead in interface Driverjava.lang.Exceptionpublic void disconnect()
disconnect in class AbstractReferenceDriverprotected void disconnectThreads()
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class AbstractReferenceDriverjava.io.IOExceptionprotected void sendGcode(java.lang.String gCode)
throws java.lang.Exception
java.lang.Exceptionprotected long getTimeoutAtMachineSpeed()
protected void sendGcode(java.lang.String gCode,
long timeout)
throws java.lang.Exception
java.lang.Exceptionpublic void sendCommand(java.lang.String command)
throws java.lang.Exception
java.lang.Exceptionpublic void sendCommand(java.lang.String command,
long timeout)
throws java.lang.Exception
java.lang.Exceptionprotected GcodeDriver.Line waitForConfirmation(java.lang.String command, long timeout) throws java.lang.Exception
java.lang.Exceptionprotected void bailOnError()
throws java.lang.Exception
java.lang.Exceptionpublic java.util.List<GcodeDriver.Line> receiveResponses() throws java.lang.Exception
java.lang.Exceptionpublic java.util.List<GcodeDriver.Line> receiveResponses(java.lang.String regex, long timeout, GcodeDriver.TimeoutAction timeoutAction) throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String receiveSingleResponse(java.lang.String regex)
throws java.lang.Exception
java.lang.Exceptionprotected 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 PropertySheetHoldergetPropertySheets in class AbstractReferenceDriverpublic LengthUnit getUnits()
public void setUnits(LengthUnit units)
public int getMaxFeedRate()
public void setMaxFeedRate(int maxFeedRate)
public Length getFeedRatePerSecond()
getFeedRatePerSecond in interface DrivergetFeedRatePerSecond in class AbstractDriverpublic 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 Driverpublic void setUsingLetterVariables(boolean usingLetterVariables)
public boolean isSupportingPreMove()
isSupportingPreMove in interface DriverisSupportingPreMove in class AbstractDriverpublic 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.Exceptionprotected void detectFirmwareSequence()
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String getFirmwareProperty(java.lang.String name,
java.lang.String defaultValue)
public boolean isSpeakingGcode()
public void findIssues(Solutions solutions)
Solutions.SubjectfindIssues 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
AbstractDrivermigrateDriver in class AbstractDriverjava.lang.Exception@Deprecated
protected void migrateAssignAxis(org.openpnp.machine.reference.driver.GcodeDriver.Axis legacyAxis,
AbstractAxis axis,
HeadMountable hm)