Package org.openpnp.spi.base
Class AbstractActuator
- java.lang.Object
-
- org.openpnp.model.AbstractModelObject
-
- org.openpnp.spi.base.AbstractHeadMountable
-
- org.openpnp.spi.base.AbstractActuator
-
- All Implemented Interfaces:
Identifiable,Named,Solutions.Subject,Actuator,HeadMountable,Locatable,Movable,MovableMountable,PropertySheetHolder,WizardConfigurable
- Direct Known Subclasses:
ReferenceActuator
public abstract class AbstractActuator extends AbstractHeadMountable implements Actuator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractActuator.ActuatorCoordinationEnumType-
Nested classes/interfaces inherited from interface org.openpnp.spi.Actuator
Actuator.ActuatorValueType, Actuator.InterlockMonitor
-
Nested classes/interfaces inherited from interface org.openpnp.spi.Locatable
Locatable.LocationOption
-
Nested classes/interfaces inherited from interface org.openpnp.spi.PropertySheetHolder
PropertySheetHolder.PropertySheet
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.DoubledefaultOffDoubleprotected java.lang.StringdefaultOffStringprotected java.lang.DoubledefaultOnDoubleprotected java.lang.StringdefaultOnStringprotected Headheadprotected java.lang.Stringidprotected booleaninterlockActuatorprotected java.lang.Stringnameprotected Actuator.ActuatorValueTypevalueTypeprotected booleanvalueTypeConfirmed-
Fields inherited from class org.openpnp.model.AbstractModelObject
propertyChangeSupport
-
-
Constructor Summary
Constructors Constructor Description AbstractActuator()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidactuate(java.lang.Object value)Provides the actuator with a generic value to which it can respond in an implementation dependent manner.voidactuateBoolean(boolean value)voidactuateDouble(double value)voidactuateObject(java.lang.Object value)voidactuateString(java.lang.String value)voidassertOnOffDefined()static voidassertOnOffDefined(Actuator actuator)protected voidcoordinateWithMachineAfterActuate()protected voidcoordinateWithMachineBeforeActuate()The following three methods are used to execute the requested coordination between actuator and machine.protected voidcoordinateWithMachineBeforeRead()voidfindIssues(Solutions solutions)Report any detected issue and proposed solution in the list.LocationgetCameraToolCalibratedOffset(Camera camera)Get the tool specific calibrated offset for the camera.AbstractActuator.ActuatorCoordinationEnumTypegetCoordinatedAfterActuateEnum()AbstractActuator.ActuatorCoordinationEnumTypegetCoordinatedBeforeActuateEnum()AbstractActuator.ActuatorCoordinationEnumTypegetCoordinatedBeforeReadEnum()java.lang.DoublegetDefaultOffDouble()protected abstract java.lang.StringgetDefaultOffProfile()java.lang.StringgetDefaultOffString()java.lang.ObjectgetDefaultOffValue()java.lang.DoublegetDefaultOnDouble()protected abstract java.lang.StringgetDefaultOnProfile()java.lang.StringgetDefaultOnString()java.lang.ObjectgetDefaultOnValue()DrivergetDriver()HeadgetHead()Gets the Head that this HeadMountable is attached to.java.lang.StringgetId()Actuator.InterlockMonitorgetInterlockMonitor()java.lang.StringgetName()javax.swing.IcongetPropertySheetHolderIcon()Actuator.ActuatorValueTypegetValueType()Declares the primary value type of the Actuator.java.lang.BooleanisActuated()Returns the Boolean state of the actuator i.e.booleanisInterlockActuator()booleanisValueTypeConfirmed()java.lang.Stringread()Read a value from the actuator.voidsetCoordinatedAfterActuateEnum(AbstractActuator.ActuatorCoordinationEnumType coordinateAfterActuateEnum)voidsetCoordinatedBeforeActuateEnum(AbstractActuator.ActuatorCoordinationEnumType coordinateBeforeActuateEnum)voidsetCoordinatedBeforeReadEnum(AbstractActuator.ActuatorCoordinationEnumType coordinateBeforeReadEnum)voidsetDefaultOffDouble(java.lang.Double defaultOffDouble)voidsetDefaultOffString(java.lang.String defaultOffString)voidsetDefaultOnDouble(java.lang.Double defaultOnDouble)voidsetDefaultOnString(java.lang.String defaultOnString)voidsetDriver(Driver driver)voidsetHead(Head head)Set the Head that this HeadMountable is attached to.voidsetInterlockActuator(boolean interlockActuator)voidsetInterlockMonitor(Actuator.InterlockMonitor interlockMonitor)voidsetName(java.lang.String name)voidsetValueType(Actuator.ActuatorValueType valueType)voidsetValueTypeConfirmed(boolean valueTypeConfirmed)static voidsuggestValueType(Actuator actuator, Actuator.ActuatorValueType valueType)Suggest a specific valueType for the actuator, based on its functional use.java.lang.ObjecttypedValue(java.lang.Object value)As the user might change the valueType() in the life-time of the actuator, we try to re-interpret persisted values in the most tolerant fashion.static java.lang.ObjecttypedValue(java.lang.Object value, Actuator actuator)Convenience null- and type-checked call to typedValue().-
Methods inherited from class org.openpnp.spi.base.AbstractHeadMountable
applyConfiguration, delay, getApproximativeLocation, getAxis, getAxisRotation, getAxisX, getAxisY, getAxisZ, getCalibratedHeadOffsets, getCoordinateAxisZ, getEffectiveSafeZ, getLocation, getMachine, getMappedAxes, getSafeZ, getSafeZZone, headMountableToRawZ, isInSafeZZone, isReachable, moveTo, moveTo, moveToSafeZ, moveToSafeZ, rawToHeadMountableZ, setAxis, setAxis, setAxisRotation, setAxisX, setAxisY, setAxisZ, setSafeZ, substituteUnchangedCoordinates, toAxesLocation, toHeadLocation, toHeadLocation, toHeadMountableLocation, toHeadMountableLocation, toMappedLocation, toRaw, toTransformed, waitForCompletion
-
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.Actuator
actuate, actuate, actuate, actuateProfile, actuateProfile, getLastActuationValue, getProfileValues, isDriverless, read
-
Methods inherited from interface org.openpnp.spi.HeadMountable
delay, getHeadOffsets, setHeadOffsets, toHeadLocation, toHeadMountableLocation, waitForCompletion
-
Methods inherited from interface org.openpnp.spi.Locatable
getApproximativeLocation, getLocation
-
Methods inherited from interface org.openpnp.spi.Movable
getEffectiveSafeZ, getSafeZ, getSafeZZone, home, isInSafeZZone, isReachable, moveTo, moveTo, moveToSafeZ, moveToSafeZ
-
Methods inherited from interface org.openpnp.spi.MovableMountable
getAxis, getAxisRotation, getAxisX, getAxisY, getAxisZ, getMappedAxes, toRaw, toTransformed
-
Methods inherited from interface org.openpnp.spi.PropertySheetHolder
getChildPropertySheetHolders, getPropertySheetHolderActions, getPropertySheetHolderTitle, getPropertySheets
-
Methods inherited from interface org.openpnp.model.Solutions.Subject
getSubjectIcon, getSubjectText
-
Methods inherited from interface org.openpnp.spi.WizardConfigurable
getConfigurationWizard
-
-
-
-
Field Detail
-
id
protected java.lang.String id
-
name
protected java.lang.String name
-
valueType
protected Actuator.ActuatorValueType valueType
-
valueTypeConfirmed
protected boolean valueTypeConfirmed
-
defaultOnDouble
protected java.lang.Double defaultOnDouble
-
defaultOnString
protected java.lang.String defaultOnString
-
defaultOffDouble
protected java.lang.Double defaultOffDouble
-
defaultOffString
protected java.lang.String defaultOffString
-
interlockActuator
protected boolean interlockActuator
-
head
protected Head head
-
-
Method Detail
-
getId
public java.lang.String getId()
- Specified by:
getIdin interfaceIdentifiable
-
getHead
public Head getHead()
Description copied from interface:HeadMountableGets the Head that this HeadMountable is attached to. If it is not attached to a Head this method returns null.- Specified by:
getHeadin interfaceHeadMountable- Returns:
-
setHead
public void setHead(Head head)
Description copied from interface:HeadMountableSet the Head that this HeadMountable is attached to. Called by the Head when the HeadMountable is added to it.- Specified by:
setHeadin interfaceHeadMountable
-
getDriver
public Driver getDriver()
-
getCameraToolCalibratedOffset
public Location getCameraToolCalibratedOffset(Camera camera)
Description copied from interface:HeadMountableGet the tool specific calibrated offset for the camera.- Specified by:
getCameraToolCalibratedOffsetin interfaceHeadMountable- Returns:
-
getValueType
public Actuator.ActuatorValueType getValueType()
Description copied from interface:ActuatorDeclares the primary value type of the Actuator. This will allow the GUI to present the proper control for value editing.- Specified by:
getValueTypein interfaceActuator- Returns:
-
setValueType
public void setValueType(Actuator.ActuatorValueType valueType)
-
isValueTypeConfirmed
public boolean isValueTypeConfirmed()
- Returns:
- true if the valueType was confirmed by functional usage or user interaction.
-
setValueTypeConfirmed
public void setValueTypeConfirmed(boolean valueTypeConfirmed)
-
suggestValueType
public static void suggestValueType(Actuator actuator, Actuator.ActuatorValueType valueType)
Suggest a specific valueType for the actuator, based on its functional use. This will only set the valueType once, if not yet otherwise confirmed by GUI user interaction etc. (mixed type usage must remain possible). Performs null and type checking on the actuator.- Parameters:
actuator-valueType-
-
typedValue
public java.lang.Object typedValue(java.lang.Object value)
As the user might change the valueType() in the life-time of the actuator, we try to re-interpret persisted values in the most tolerant fashion.- Parameters:
value-- Returns:
-
typedValue
public static java.lang.Object typedValue(java.lang.Object value, Actuator actuator)Convenience null- and type-checked call to typedValue().- Parameters:
value-actuator-- Returns:
-
getDefaultOnDouble
public java.lang.Double getDefaultOnDouble()
-
setDefaultOnDouble
public void setDefaultOnDouble(java.lang.Double defaultOnDouble)
-
getDefaultOnString
public java.lang.String getDefaultOnString()
-
setDefaultOnString
public void setDefaultOnString(java.lang.String defaultOnString)
-
getDefaultOffDouble
public java.lang.Double getDefaultOffDouble()
-
setDefaultOffDouble
public void setDefaultOffDouble(java.lang.Double defaultOffDouble)
-
getDefaultOffString
public java.lang.String getDefaultOffString()
-
setDefaultOffString
public void setDefaultOffString(java.lang.String defaultOffString)
-
getDefaultOnProfile
protected abstract java.lang.String getDefaultOnProfile()
-
getDefaultOffProfile
protected abstract java.lang.String getDefaultOffProfile()
-
getDefaultOnValue
public java.lang.Object getDefaultOnValue()
- Specified by:
getDefaultOnValuein interfaceActuator
-
getDefaultOffValue
public java.lang.Object getDefaultOffValue()
- Specified by:
getDefaultOffValuein interfaceActuator
-
isActuated
public java.lang.Boolean isActuated()
Description copied from interface:ActuatorReturns the Boolean state of the actuator i.e. whether the last actuation was not equal to the default off value. Returns null when the actuator state is unknown, i.e. when it was never actuated.- Specified by:
isActuatedin interfaceActuator- Returns:
-
actuate
public void actuate(java.lang.Object value) throws java.lang.ExceptionDescription copied from interface:ActuatorProvides the actuator with a generic value to which it can respond in an implementation dependent manner. This will ultimately call typed actuate() methods according to getValueType().
-
actuateBoolean
public final void actuateBoolean(boolean value) throws java.lang.Exception- Throws:
java.lang.Exception
-
actuateDouble
public final void actuateDouble(double value) throws java.lang.Exception- Throws:
java.lang.Exception
-
actuateString
public final void actuateString(java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception
-
actuateObject
public final void actuateObject(java.lang.Object value) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertOnOffDefined
public void assertOnOffDefined() throws java.lang.Exception- Throws:
java.lang.Exception
-
assertOnOffDefined
public static void assertOnOffDefined(Actuator actuator) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getPropertySheetHolderIcon
public javax.swing.Icon getPropertySheetHolderIcon()
- Specified by:
getPropertySheetHolderIconin interfacePropertySheetHolder
-
coordinateWithMachineBeforeActuate
protected void coordinateWithMachineBeforeActuate() throws java.lang.ExceptionThe following three methods are used to execute the requested coordination between actuator and machine. They are separated by type to allow checking if coordination is requested and to use the minimum completion types required.- Throws:
java.lang.Exception
-
coordinateWithMachineAfterActuate
protected void coordinateWithMachineAfterActuate() throws java.lang.Exception- Throws:
java.lang.Exception
-
coordinateWithMachineBeforeRead
protected void coordinateWithMachineBeforeRead() throws java.lang.Exception- Throws:
java.lang.Exception
-
read
public java.lang.String read() throws java.lang.ExceptionDescription copied from interface:ActuatorRead a value from the actuator. The value will be returned exactly as provided by the Actuator and can be interpreted as needed by the caller.
-
getCoordinatedBeforeActuateEnum
public AbstractActuator.ActuatorCoordinationEnumType getCoordinatedBeforeActuateEnum()
-
setCoordinatedBeforeActuateEnum
public void setCoordinatedBeforeActuateEnum(AbstractActuator.ActuatorCoordinationEnumType coordinateBeforeActuateEnum)
-
getCoordinatedAfterActuateEnum
public AbstractActuator.ActuatorCoordinationEnumType getCoordinatedAfterActuateEnum()
-
setCoordinatedAfterActuateEnum
public void setCoordinatedAfterActuateEnum(AbstractActuator.ActuatorCoordinationEnumType coordinateAfterActuateEnum)
-
getCoordinatedBeforeReadEnum
public AbstractActuator.ActuatorCoordinationEnumType getCoordinatedBeforeReadEnum()
-
setCoordinatedBeforeReadEnum
public void setCoordinatedBeforeReadEnum(AbstractActuator.ActuatorCoordinationEnumType coordinateBeforeReadEnum)
-
isInterlockActuator
public boolean isInterlockActuator()
-
setInterlockActuator
public void setInterlockActuator(boolean interlockActuator)
-
getInterlockMonitor
public Actuator.InterlockMonitor getInterlockMonitor()
- Specified by:
getInterlockMonitorin interfaceActuator
-
setInterlockMonitor
public void setInterlockMonitor(Actuator.InterlockMonitor interlockMonitor)
-
findIssues
public void findIssues(Solutions solutions)
Description copied from interface:Solutions.SubjectReport any detected issue and proposed solution in the list.- Specified by:
findIssuesin interfaceSolutions.Subject
-
-