Package gda.device.scannable.keyence
Class Keyence
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.scannable.ScannableBase
gda.device.scannable.keyence.Keyence
- All Implemented Interfaces:
Device,Scannable,Configurable,Findable,gda.observable.IObservable
Provides Ethernet communications a Keyence Camera Controller
Tested with a CV-3001P but should work with others as well.
Triggering is done in software. If you require hardware (external) triggering,
that would not be very hard to implement.
-
Field Summary
Fields inherited from class gda.device.scannable.ScannableBase
__doc__, DEFAULT_INPUT_NAME, DEFAULT_OUTPUT_FORMAT, extraNames, inputNames, level, outputFormatFields inherited from class gda.device.DeviceBase
DEFAULT_PROTECTION_LEVEL_PROPERTYFields inherited from interface gda.device.Scannable
ATTR_NEXUS_CATEGORY, ATTR_NX_CLASS, VALUE_UNAVAILABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidasynchronousMoveTo(Object position) Trigger a move/operation and return immediately.voidclose()Close and unconfigure the device.voidDefault implementation for classes that do not have to do any specific configuration.
Classes that do their own configuration should *not* call this superclass function, as it may cause the object to appear configured before it really is.voidconnect()Set up initial connections to socket and wrap the stream in buffered reader and writer.getHost()intgetPort()double[]Returns the current position of the Scannable.booleanisBusy()Check if the Scannable is moving/operating.booleanReturns the state of the socket connectionprocessCommand(String msg) Send command to the server.Object[]processImageRequest(String msg, int expectedReplyItems) Send command to the server.voidRe-initialisation of values and states.voidTidy existing socket streams and try to connect them again within the thread.voidsaveScreenShot(String fileName) voidSet the keyence hostvoidsetInputNames(String[] names) sets the array of names returned by getInputNames method of this scannable.voidsetPort(int port) Set the command portvoidsetStartupCommands(List<String> startupCommands) Methods inherited from class gda.device.scannable.ScannableBase
__call__, __call__, __doc__, __getitem__, __len__, __repr__, __str__, atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanLineStart, atScanStart, checkPositionValid, externalToInternal, getExtraNames, getInputNames, getLevel, getOutputFormat, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, internalToExternal, isAt, moveTo, rawAsynchronousMoveTo, rawGetPosition, setExtraNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, stop, throwExceptionIfInvalidTarget, toFormattedString, toString, validateScannable, valueUnavailableString, waitWhileBusy, waitWhileBusyMethods inherited from class gda.device.DeviceBase
addIObserver, deleteIObserver, deleteIObservers, getAttribute, getName, getProtectionLevel, isBeingObserved, isConfigureAtStartup, notifyIObservers, setAttribute, setConfigureAtStartup, setName, setProtectionLevelMethods inherited from class gda.factory.ConfigurableBase
isConfigured, setConfiguredMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface gda.factory.Configurable
isConfigureAtStartup, isConfiguredMethods inherited from interface gda.device.Device
getAttribute, getProtectionLevel, setAttribute, setProtectionLevelMethods inherited from interface gda.observable.IObservable
addIObserver, deleteIObserver, deleteIObservers
-
Constructor Details
-
Keyence
public Keyence()
-
-
Method Details
-
configure
Description copied from class:ConfigurableBaseDefault implementation for classes that do not have to do any specific configuration.
Classes that do their own configuration should *not* call this superclass function, as it may cause the object to appear configured before it really is.- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classConfigurableBase- Throws:
FactoryException- if there is an error in configuration e.g. required variable not set or cannot connect to device
-
connect
Set up initial connections to socket and wrap the stream in buffered reader and writer.- Throws:
DeviceException
-
reconfigure
Description copied from interface:ConfigurableRe-initialisation of values and states.Moved from Reconfigurable which has been deleted
- Specified by:
reconfigurein interfaceConfigurable- Overrides:
reconfigurein classConfigurableBase- Throws:
FactoryException
-
reconnect
Tidy existing socket streams and try to connect them again within the thread. This method is synchronized as both the main thread and run thread use this method.- Throws:
DeviceException
-
close
Description copied from interface:DeviceClose and unconfigure the device.- Specified by:
closein interfaceDevice- Overrides:
closein classDeviceBase- Throws:
DeviceException
-
isConnected
public boolean isConnected()Returns the state of the socket connection- Returns:
- true if connected
-
processCommand
Send command to the server.- Parameters:
msg- an unterminated command- Returns:
- the reply string.
- Throws:
DeviceException
-
saveLastMeasurementImage
- Returns:
- the filename
- Throws:
IOExceptionDeviceException
-
getLastMeasurementImage
- Returns:
- the camera shot of the last measurement
- Throws:
DeviceExceptionIOException
-
saveScreenShot
- Throws:
IOExceptionDeviceException
-
saveScreenShot
- Returns:
- the filename
- Throws:
IOExceptionDeviceException
-
getScreenShot
- Returns:
- a screenshot
- Throws:
DeviceExceptionIOException
-
processImageRequest
Send command to the server.- Parameters:
msg- an unterminated commandexpectedReplyItems-- Returns:
- the reply string.
- Throws:
DeviceException
-
setHost
Set the keyence host- Parameters:
host-
-
getHost
- Returns:
- the keyence host name
-
setPort
public void setPort(int port) Set the command port- Parameters:
port-
-
getPort
public int getPort()- Returns:
- the command port
-
setStartupCommands
- Parameters:
startupCommands-
-
getStartupCommands
- Returns:
- an array list of startup commands to be processed by da.server on startup
-
getPosition
Description copied from class:ScannableBaseReturns the current position of the Scannable. Called by ConcurentScan at the end of the point. Reads an internal (hardware) position from rawGetPosition, converts this to an external (user) position and returns it.- Specified by:
getPositionin interfaceScannable- Overrides:
getPositionin classScannableBase- Returns:
- Current position with an element for each input and extra field. null if their are no fields.
- Throws:
DeviceException
-
asynchronousMoveTo
Description copied from class:ScannableBaseTrigger a move/operation and return immediately. Implementations of this method should be non-blocking to allow concurrent motion; the isBusy method will be used to determine when the move has completed. Converts the external (user) position to an internal position and passes this to rawAsynchronousMoveTo.- Specified by:
asynchronousMoveToin interfaceScannable- Overrides:
asynchronousMoveToin classScannableBase- Parameters:
position- Position to move to should have an element for each input field.- Throws:
DeviceException
-
isBusy
Description copied from interface:ScannableCheck if the Scannable is moving/operating.- Returns:
- true - if operation carried out by moveTo has not completed yet
- Throws:
DeviceException
-
setInputNames
Description copied from interface:Scannablesets the array of names returned by getInputNames method of this scannable.- Specified by:
setInputNamesin interfaceScannable- Overrides:
setInputNamesin classScannableBase- Parameters:
names-
-