Package org.openpnp.spi.base
Class AbstractHeadMountable
- java.lang.Object
-
- org.openpnp.model.AbstractModelObject
-
- org.openpnp.spi.base.AbstractHeadMountable
-
- All Implemented Interfaces:
Identifiable
,Named
,Solutions.Subject
,HeadMountable
,Locatable
,Movable
,MovableMountable
- Direct Known Subclasses:
AbstractActuator
,AbstractCamera
,AbstractNozzle
public abstract class AbstractHeadMountable extends AbstractModelObject implements HeadMountable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.openpnp.spi.Locatable
Locatable.LocationOption
-
-
Field Summary
-
Fields inherited from class org.openpnp.model.AbstractModelObject
propertyChangeSupport
-
-
Constructor Summary
Constructors Constructor Description AbstractHeadMountable()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyConfiguration(Configuration configuration)
Location
getApproximativeLocation(Location currentLocation, Location desiredLocation, Locatable.LocationOption... options)
Get an approximative Location in order to avoid extra compensation transformations or moves.AbstractAxis
getAxis(Axis.Type type)
AbstractAxis
getAxisRotation()
AbstractAxis
getAxisX()
AbstractAxis
getAxisY()
AbstractAxis
getAxisZ()
Location
getCalibratedHeadOffsets(Locatable.LocationOption... options)
protected CoordinateAxis
getCoordinateAxisZ()
Length
getEffectiveSafeZ()
Location
getLocation()
protected ReferenceMachine
getMachine()
AxesLocation
getMappedAxes(Machine machine)
Returns the set of motion-controller axes, mapped to the MovableMountable.Length
getSafeZ()
Length[]
getSafeZZone()
protected Length
headMountableToRawZ(CoordinateAxis axisZ, Length z)
boolean
isInSafeZZone(Length z)
boolean
isReachable(Location location)
void
moveTo(Location location, double speed, Motion.MotionOption... options)
Move the object to the Location at the feedRate.void
moveTo(Location location, Motion.MotionOption... options)
void
moveToSafeZ()
void
moveToSafeZ(double speed)
protected Length
rawToHeadMountableZ(ReferenceControllerAxis rawAxis, Length z)
void
setAxis(AbstractAxis axis)
void
setAxis(AbstractAxis axis, Axis.Type type)
void
setAxisRotation(AbstractAxis axisRotation)
void
setAxisX(AbstractAxis axisX)
void
setAxisY(AbstractAxis axisY)
void
setAxisZ(AbstractAxis axisZ)
void
setSafeZ(Length safeZ)
static Location
substituteUnchangedCoordinates(Location location, Location currentLocation)
protected AxesLocation
toAxesLocation(Location location)
Location
toHeadLocation(Location location, Location currentLocation, Locatable.LocationOption... options)
Location
toHeadLocation(Location location, Locatable.LocationOption... options)
Transform the specified HeadMountable location to a Head location.Location
toHeadMountableLocation(Location location, Location currentLocation, Locatable.LocationOption... options)
Location
toHeadMountableLocation(Location location, Locatable.LocationOption... options)
Transform the specified Head location to a HeadMountable location.protected Location
toMappedLocation(LengthUnit units, AxesLocation location)
AxesLocation
toRaw(Location location, Locatable.LocationOption... options)
Converts the specified transformed Head Location into a raw motion-controller AxesLocation.Location
toTransformed(AxesLocation axesLocation, Locatable.LocationOption... options)
Converts the specified raw motion-controller AxesLocation into a transformed Head Location.void
waitForCompletion(MotionPlanner.CompletionType completionType)
Wait for any motion of this HeadMountable to be completed according to the completionType.-
Methods inherited from class org.openpnp.model.AbstractModelObject
addPropertyChangeListener, addPropertyChangeListener, dispose, dumpListeners, fireIndexedPropertyChange, firePropertyChange, isListener, isListener, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openpnp.spi.HeadMountable
getCameraToolCalibratedOffset, getHead, getHeadOffsets, setHead, setHeadOffsets
-
Methods inherited from interface org.openpnp.model.Identifiable
getId
-
Methods inherited from interface org.openpnp.model.Solutions.Subject
findIssues, getSubjectIcon, getSubjectText
-
-
-
-
Method Detail
-
applyConfiguration
public void applyConfiguration(Configuration configuration)
-
getAxisX
public AbstractAxis getAxisX()
- Specified by:
getAxisX
in interfaceMovableMountable
-
setAxisX
public void setAxisX(AbstractAxis axisX)
-
getAxisY
public AbstractAxis getAxisY()
- Specified by:
getAxisY
in interfaceMovableMountable
-
setAxisY
public void setAxisY(AbstractAxis axisY)
-
getAxisZ
public AbstractAxis getAxisZ()
- Specified by:
getAxisZ
in interfaceMovableMountable
-
setAxisZ
public void setAxisZ(AbstractAxis axisZ)
-
getAxisRotation
public AbstractAxis getAxisRotation()
- Specified by:
getAxisRotation
in interfaceMovableMountable
-
setAxisRotation
public void setAxisRotation(AbstractAxis axisRotation)
-
getAxis
public AbstractAxis getAxis(Axis.Type type)
- Specified by:
getAxis
in interfaceMovableMountable
-
setAxis
public void setAxis(AbstractAxis axis, Axis.Type type)
-
setAxis
public void setAxis(AbstractAxis axis)
-
getCoordinateAxisZ
protected CoordinateAxis getCoordinateAxisZ()
-
rawToHeadMountableZ
protected Length rawToHeadMountableZ(ReferenceControllerAxis rawAxis, Length z)
-
headMountableToRawZ
protected Length headMountableToRawZ(CoordinateAxis axisZ, Length z) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getSafeZZone
public Length[] getSafeZZone()
- Specified by:
getSafeZZone
in interfaceMovable
- Returns:
- The lower and upper limits of the Safe Zone as defined on the Z axis. The array elements may be null if no axis is mapped on the Movable or no Safe Zone defined on the axis.
-
getSafeZ
public Length getSafeZ()
-
isInSafeZZone
public boolean isInSafeZZone(Length z) throws java.lang.Exception
- Specified by:
isInSafeZZone
in interfaceMovable
- Returns:
- True if the given z is in the Safe Z Zone.
- Throws:
java.lang.Exception
-
setSafeZ
public void setSafeZ(Length safeZ)
-
getEffectiveSafeZ
public Length getEffectiveSafeZ() throws java.lang.Exception
- Specified by:
getEffectiveSafeZ
in interfaceMovable
- Returns:
- The effective Safe Z, including any dynamic adjustment such as for parts on a Nozzle.
- Throws:
java.lang.Exception
-
moveTo
public void moveTo(Location location, double speed, Motion.MotionOption... options) throws java.lang.Exception
Description copied from interface:Movable
Move the object to the Location at the feedRate.- Specified by:
moveTo
in interfaceMovable
- Parameters:
location
- The Location to move to. If the movement should not include a particular axis, specify Double.NaN for that axis.speed
- Feed rate is specified as a percentage of maximum feed between 0 and 1. 1 specifies maximum feed rate as defined by the machine while 0 defines the absolute minimum feed rate while still moving.- Throws:
java.lang.Exception
-
moveToSafeZ
public void moveToSafeZ(double speed) throws java.lang.Exception
- Specified by:
moveToSafeZ
in interfaceMovable
- Throws:
java.lang.Exception
-
moveTo
public void moveTo(Location location, Motion.MotionOption... options) throws java.lang.Exception
-
moveToSafeZ
public void moveToSafeZ() throws java.lang.Exception
- Specified by:
moveToSafeZ
in interfaceMovable
- Throws:
java.lang.Exception
-
waitForCompletion
public void waitForCompletion(MotionPlanner.CompletionType completionType) throws java.lang.Exception
Description copied from interface:HeadMountable
Wait for any motion of this HeadMountable to be completed according to the completionType. If this is not mounted to any Head (e.g. the bottom camera), the wait must encompass the whole machine, as any HeadMountable could then be the camera's subject.- Specified by:
waitForCompletion
in interfaceHeadMountable
- Throws:
java.lang.Exception
-
getMappedAxes
public AxesLocation getMappedAxes(Machine machine)
Description copied from interface:MovableMountable
Returns the set of motion-controller axes, mapped to the MovableMountable.- Specified by:
getMappedAxes
in interfaceMovableMountable
- Parameters:
machine
- The machine giving the axes order.- Returns:
-
toHeadLocation
public Location toHeadLocation(Location location, Location currentLocation, Locatable.LocationOption... options)
-
substituteUnchangedCoordinates
public static Location substituteUnchangedCoordinates(Location location, Location currentLocation)
-
toHeadLocation
public Location toHeadLocation(Location location, Locatable.LocationOption... options) throws java.lang.Exception
Description copied from interface:HeadMountable
Transform the specified HeadMountable location to a Head location. This will typically apply the Head Offset and apply other transformations such as Runout Compensation on a Nozzle.- Specified by:
toHeadLocation
in interfaceHeadMountable
- Parameters:
location
- The HeadMountable location.options
- Location approximation options @see org.openpnp.spi.Movable.LocationOption- Returns:
- Throws:
java.lang.Exception
-
getCalibratedHeadOffsets
public Location getCalibratedHeadOffsets(Locatable.LocationOption... options)
-
toHeadMountableLocation
public Location toHeadMountableLocation(Location location, Location currentLocation, Locatable.LocationOption... options)
-
toHeadMountableLocation
public Location toHeadMountableLocation(Location location, Locatable.LocationOption... options)
Description copied from interface:HeadMountable
Transform the specified Head location to a HeadMountable location. This will typically unapply the Head Offset and unapply other transformations such as Runout Compensation on a Nozzle.- Specified by:
toHeadMountableLocation
in interfaceHeadMountable
- Parameters:
location
- The Head location.options
- Location approximation options @see org.openpnp.spi.Movable.LocationOption- Returns:
-
toMappedLocation
protected Location toMappedLocation(LengthUnit units, AxesLocation location)
-
toAxesLocation
protected AxesLocation toAxesLocation(Location location)
-
toTransformed
public Location toTransformed(AxesLocation axesLocation, Locatable.LocationOption... options)
Description copied from interface:MovableMountable
Converts the specified raw motion-controller AxesLocation into a transformed Head Location. Note, toTransformed() must not throw even if transformations are not well-defined. This would otherwise disrupt operation while setting the machine up. Only if toRaw() will throw, e.g. when you want to move the machine.- Specified by:
toTransformed
in interfaceMovableMountable
- Returns:
-
toRaw
public AxesLocation toRaw(Location location, Locatable.LocationOption... options) throws java.lang.Exception
Description copied from interface:MovableMountable
Converts the specified transformed Head Location into a raw motion-controller AxesLocation. Note, unlike toTransformed() toRaw() will throw if the reverse transformation is not well-defined. As this typically happens when trying to move the machine, it is an appropriately graded precaution.- Specified by:
toRaw
in interfaceMovableMountable
- Returns:
- Throws:
java.lang.Exception
-
getLocation
public Location getLocation()
- Specified by:
getLocation
in interfaceLocatable
-
getApproximativeLocation
public Location getApproximativeLocation(Location currentLocation, Location desiredLocation, Locatable.LocationOption... options) throws java.lang.Exception
Description copied from interface:Locatable
Get an approximative Location in order to avoid extra compensation transformations or moves.- Specified by:
getApproximativeLocation
in interfaceLocatable
- Parameters:
currentLocation
- The current location, usually obtained using Headmountable.getLocation()desiredLocation
- The desired location to approximate.options
- Options for the approximation.- Returns:
- Throws:
java.lang.Exception
-
isReachable
public boolean isReachable(Location location) throws java.lang.Exception
- Specified by:
isReachable
in interfaceMovable
- Returns:
- true if the location can be moved to with this Movable (soft limits etc.)
- Throws:
java.lang.Exception
-
getMachine
protected ReferenceMachine getMachine()
-
-