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 voidapplyConfiguration(Configuration configuration)voiddelay(int milliseconds, HeadMountable... hms)Wait for a given time before continuing with the next command.LocationgetApproximativeLocation(Location currentLocation, Location desiredLocation, Locatable.LocationOption... options)Get an approximative Location in order to avoid extra compensation transformations or moves.AbstractAxisgetAxis(Axis.Type type)AbstractAxisgetAxisRotation()AbstractAxisgetAxisX()AbstractAxisgetAxisY()AbstractAxisgetAxisZ()LocationgetCalibratedHeadOffsets(Locatable.LocationOption... options)protected CoordinateAxisgetCoordinateAxisZ()LengthgetEffectiveSafeZ()LocationgetLocation()protected ReferenceMachinegetMachine()AxesLocationgetMappedAxes(Machine machine)Returns the set of motion-controller axes, mapped to the MovableMountable.LengthgetSafeZ()Length[]getSafeZZone()protected LengthheadMountableToRawZ(CoordinateAxis axisZ, Length z)booleanisInSafeZZone(Length z)booleanisReachable(Location location)voidmoveTo(Location location, double speed, Motion.MotionOption... options)Move the object to the Location at the feedRate.voidmoveTo(Location location, Motion.MotionOption... options)voidmoveToSafeZ()voidmoveToSafeZ(double speed)protected LengthrawToHeadMountableZ(ReferenceControllerAxis rawAxis, Length z)voidsetAxis(AbstractAxis axis)voidsetAxis(AbstractAxis axis, Axis.Type type)voidsetAxisRotation(AbstractAxis axisRotation)voidsetAxisX(AbstractAxis axisX)voidsetAxisY(AbstractAxis axisY)voidsetAxisZ(AbstractAxis axisZ)voidsetSafeZ(Length safeZ)static LocationsubstituteUnchangedCoordinates(Location location, Location currentLocation)protected AxesLocationtoAxesLocation(Location location)LocationtoHeadLocation(Location location, Location currentLocation, Locatable.LocationOption... options)LocationtoHeadLocation(Location location, Locatable.LocationOption... options)Transform the specified HeadMountable location to a Head location.LocationtoHeadMountableLocation(Location location, Location currentLocation, Locatable.LocationOption... options)LocationtoHeadMountableLocation(Location location, Locatable.LocationOption... options)Transform the specified Head location to a HeadMountable location.protected LocationtoMappedLocation(LengthUnit units, AxesLocation location)AxesLocationtoRaw(Location location, Locatable.LocationOption... options)Converts the specified transformed Head Location into a raw motion-controller AxesLocation.LocationtoTransformed(AxesLocation axesLocation, Locatable.LocationOption... options)Converts the specified raw motion-controller AxesLocation into a transformed Head Location.voidwaitForCompletion(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:
getAxisXin interfaceMovableMountable
-
setAxisX
public void setAxisX(AbstractAxis axisX)
-
getAxisY
public AbstractAxis getAxisY()
- Specified by:
getAxisYin interfaceMovableMountable
-
setAxisY
public void setAxisY(AbstractAxis axisY)
-
getAxisZ
public AbstractAxis getAxisZ()
- Specified by:
getAxisZin interfaceMovableMountable
-
setAxisZ
public void setAxisZ(AbstractAxis axisZ)
-
getAxisRotation
public AbstractAxis getAxisRotation()
- Specified by:
getAxisRotationin interfaceMovableMountable
-
setAxisRotation
public void setAxisRotation(AbstractAxis axisRotation)
-
getAxis
public AbstractAxis getAxis(Axis.Type type)
- Specified by:
getAxisin 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:
getSafeZZonein 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:
isInSafeZZonein 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:
getEffectiveSafeZin 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:MovableMove the object to the Location at the feedRate.- Specified by:
moveToin 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:
moveToSafeZin 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:
moveToSafeZin interfaceMovable- Throws:
java.lang.Exception
-
waitForCompletion
public void waitForCompletion(MotionPlanner.CompletionType completionType) throws java.lang.Exception
Description copied from interface:HeadMountableWait 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:
waitForCompletionin interfaceHeadMountable- Throws:
java.lang.Exception
-
delay
public void delay(int milliseconds, HeadMountable... hms) throws java.lang.ExceptionDescription copied from interface:HeadMountableWait for a given time before continuing with the next command. The delay my be executed using the OS (via Thread.sleep()) or - if supported - by the driver. If addition head mountables are given, they are taken into account. This shall be use to indicate, that eg a nozzle is in relation to it's vacuum valve when timing a dwell delay.- Specified by:
delayin interfaceHeadMountable- Throws:
java.lang.Exception
-
getMappedAxes
public AxesLocation getMappedAxes(Machine machine)
Description copied from interface:MovableMountableReturns the set of motion-controller axes, mapped to the MovableMountable.- Specified by:
getMappedAxesin 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:HeadMountableTransform 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:
toHeadLocationin 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:HeadMountableTransform 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:
toHeadMountableLocationin 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:MovableMountableConverts 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:
toTransformedin interfaceMovableMountable- Returns:
-
toRaw
public AxesLocation toRaw(Location location, Locatable.LocationOption... options) throws java.lang.Exception
Description copied from interface:MovableMountableConverts 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:
toRawin interfaceMovableMountable- Returns:
- Throws:
java.lang.Exception
-
getLocation
public Location getLocation()
- Specified by:
getLocationin interfaceLocatable
-
getApproximativeLocation
public Location getApproximativeLocation(Location currentLocation, Location desiredLocation, Locatable.LocationOption... options) throws java.lang.Exception
Description copied from interface:LocatableGet an approximative Location in order to avoid extra compensation transformations or moves.- Specified by:
getApproximativeLocationin 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:
isReachablein interfaceMovable- Returns:
- true if the location can be moved to with this Movable (soft limits etc.)
- Throws:
java.lang.Exception
-
getMachine
protected ReferenceMachine getMachine()
-
-