Class NewportVMCController
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.diffractometer.newport.NewportVMCController
- All Implemented Interfaces:
Device,INewportVMCController,Stoppable,Configurable,Findable,gda.observable.IObservable
Class to communicate with the Newport collision avoidance software
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface gda.device.diffractometer.newport.INewportVMCController
INewportVMCController.Mode, INewportVMCController.Status -
Field Summary
Fields inherited from class gda.device.DeviceBase
DEFAULT_PROTECTION_LEVEL_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckAnyCommandSafe(String command) voidClear command bufferPause after current command finishesResume executing command bufferStop immediately and clear command buffervoidDefault 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.voidintintgetHost()intvoidgetMode()getName()Get the name of the deviceintintgetPosition(int axisIndex) intintvoidbooleanisBusy()booleanbooleanbooleanbooleanbooleanbooleanisReady()booleanbooleanbooleanvoidvoidvoidmoveAxisRelative(int axisIndex, Object position) reset()booleanvoidscanContinuous(int axisIndex, Double start, Double width, Double time) sendCommandSocketCommand(String command) sendSocketWaitResponse(SocketConnection socket, String command) sendStatusSocketCommand(String command) voidsetCommandPort(int port) voidsetCommandSocketConnection(SocketConnection socketConnection) voidsetDetDistanceIndex(int detDistanceIndex) voidvoidsetKappaIndex(int kappaIndex) voidsetMaxWaitControllerBusy(double waitSeconds) voidvoidvoidvoidSet the name of the devicevoidsetOmegaIndex(int omegaIndex) voidsetPhiIndex(int phiIndex) voidsetPollCommandInterval(long millis) voidsetPollCommandTrials(long numTrials) voidsetStatusPort(int statusPort) voidsetStatusSocketConnection(SocketConnection statusSocketConnection) voidsetTwoThetaIndex(int twoThetaIndex) voidstop()Stops the current operation.voidwaitUntilMoveRegistered(double timeoutInSeconds) A short waitUntilBusy to allow the controller to transition from READY to TESTING on a move requestdoublewaitWhileControllerBusy(double timeoutInSeconds) waitWhileBusy for the controller, with a timeout and will throws a DeviceException if the time limit is reached.doublewaitWhileControllerBusyDelay(double maxDelayInSeconds) waitWhileBusy for the controller, to a maximum delay - no timeout exception.Methods inherited from class gda.device.DeviceBase
addIObserver, close, deleteIObserver, deleteIObservers, getAttribute, getProtectionLevel, isBeingObserved, isConfigureAtStartup, notifyIObservers, setAttribute, setConfigureAtStartup, setProtectionLevelMethods inherited from class gda.factory.ConfigurableBase
isConfigured, reconfigure, setConfiguredMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface gda.factory.Configurable
isConfigureAtStartup, isConfigured, reconfigure
-
Constructor Details
-
NewportVMCController
public NewportVMCController()
-
-
Method Details
-
checkAnyCommandSafe
- Specified by:
checkAnyCommandSafein interfaceINewportVMCController- Throws:
DeviceException
-
closeConnection
public void closeConnection() -
cmdClearBuffer
Description copied from interface:INewportVMCControllerClear command buffer- Specified by:
cmdClearBufferin interfaceINewportVMCController- Returns:
- status
- Throws:
DeviceException
-
cmdPauseOnNext
Description copied from interface:INewportVMCControllerPause after current command finishes- Specified by:
cmdPauseOnNextin interfaceINewportVMCController- Returns:
- status
- Throws:
DeviceException
-
cmdResume
Description copied from interface:INewportVMCControllerResume executing command buffer- Specified by:
cmdResumein interfaceINewportVMCController- Returns:
- status
- Throws:
DeviceException
-
cmdStopAll
Description copied from interface:INewportVMCControllerStop immediately and clear command buffer- Specified by:
cmdStopAllin interfaceINewportVMCController- Returns:
- status
- Throws:
DeviceException
-
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- Specified by:
configurein interfaceINewportVMCController- Overrides:
configurein classConfigurableBase- Throws:
FactoryException- if there is an error in configuration e.g. required variable not set or cannot connect to device
-
executeSafeRoute
- Specified by:
executeSafeRoutein interfaceINewportVMCController- Throws:
DeviceException
-
getCommandPort
public int getCommandPort()- Specified by:
getCommandPortin interfaceINewportVMCController
-
getBufferCount
- Specified by:
getBufferCountin interfaceINewportVMCController- Returns:
- number of commands remaining be executed in buffer
-
getBufferList
- Specified by:
getBufferListin interfaceINewportVMCController- Returns:
- semi-colon separated list of unexecuted commands remaining in buffer
-
getBufferNext
- Specified by:
getBufferNextin interfaceINewportVMCController- Returns:
- next command to be executed in buffer
-
getCommandSocketConnection
- Specified by:
getCommandSocketConnectionin interfaceINewportVMCController
-
getCurrentCommand
-
getDetDistanceIndex
public int getDetDistanceIndex()- Specified by:
getDetDistanceIndexin interfaceINewportVMCController
-
getHost
- Specified by:
getHostin interfaceINewportVMCController
-
getKappaIndex
public int getKappaIndex()- Specified by:
getKappaIndexin interfaceINewportVMCController
-
getLastError
- Specified by:
getLastErrorin interfaceINewportVMCController
-
getLastExecutedCommand
- Specified by:
getLastExecutedCommandin interfaceINewportVMCController
-
getMechanicalPositions
- Specified by:
getMechanicalPositionsin interfaceINewportVMCController- Throws:
DeviceException
-
getMode
- Specified by:
getModein interfaceINewportVMCController
-
getName
Description copied from class:DeviceBaseGet the name of the device- Specified by:
getNamein interfaceFindable- Specified by:
getNamein interfaceINewportVMCController- Overrides:
getNamein classDeviceBase- Returns:
- Returns the name.
-
getOmegaIndex
public int getOmegaIndex()- Specified by:
getOmegaIndexin interfaceINewportVMCController
-
getPhiIndex
public int getPhiIndex()- Specified by:
getPhiIndexin interfaceINewportVMCController
-
getPosition
- Specified by:
getPositionin interfaceINewportVMCController
-
getPositionAll
- Specified by:
getPositionAllin interfaceINewportVMCController
-
getSafeRouteFile
- Specified by:
getSafeRouteFilein interfaceINewportVMCController- Throws:
DeviceException
-
getStatus
- Specified by:
getStatusin interfaceINewportVMCController- Throws:
DeviceException
-
getStatusPort
public int getStatusPort()- Specified by:
getStatusPortin interfaceINewportVMCController
-
getStatusSocketConnection
- Specified by:
getStatusSocketConnectionin interfaceINewportVMCController
-
getTwoThetaIndex
public int getTwoThetaIndex()- Specified by:
getTwoThetaIndexin interfaceINewportVMCController
-
initialise
- Specified by:
initialisein interfaceINewportVMCController- Throws:
DeviceException
-
isBusy
- Specified by:
isBusyin interfaceINewportVMCController- Throws:
DeviceException
-
isCommandBufferEmpty
- Specified by:
isCommandBufferEmptyin interfaceINewportVMCController- Throws:
DeviceException
-
isControllerActioned
- Throws:
DeviceException
-
isControllerBusy
- Throws:
DeviceException
-
isControllerInError
- Throws:
DeviceException
-
isControllerInState
-
isReady
- Specified by:
isReadyin interfaceINewportVMCController- Throws:
DeviceException
-
isSendStatusFlag
public boolean isSendStatusFlag() -
isStatusConnected
public boolean isStatusConnected() -
isStoppingStatusFlag
public boolean isStoppingStatusFlag() -
moveAll
- Specified by:
moveAllin interfaceINewportVMCController- Throws:
DeviceException
-
moveAxis
- Specified by:
moveAxisin interfaceINewportVMCController- Throws:
DeviceException
-
moveAxisRelative
- Specified by:
moveAxisRelativein interfaceINewportVMCController- Throws:
DeviceException
-
reset
- Throws:
DeviceException
-
resetErrorState
public boolean resetErrorState() -
scanContinuous
public void scanContinuous(int axisIndex, Double start, Double width, Double time) throws DeviceException - Specified by:
scanContinuousin interfaceINewportVMCController- Throws:
DeviceException
-
sendCommandSocketCommand
-
sendSocketWaitResponse
public NewportVMCController.Response sendSocketWaitResponse(SocketConnection socket, String command) -
sendStatusSocketCommand
-
setCommandPort
public void setCommandPort(int port) - Specified by:
setCommandPortin interfaceINewportVMCController
-
setCommandSocketConnection
- Specified by:
setCommandSocketConnectionin interfaceINewportVMCController
-
setDetDistanceIndex
public void setDetDistanceIndex(int detDistanceIndex) - Specified by:
setDetDistanceIndexin interfaceINewportVMCController
-
setHost
- Specified by:
setHostin interfaceINewportVMCController
-
setKappaIndex
public void setKappaIndex(int kappaIndex) - Specified by:
setKappaIndexin interfaceINewportVMCController
-
setMode
- Specified by:
setModein interfaceINewportVMCController- Throws:
DeviceException
-
setMaxWaitControllerBusy
public void setMaxWaitControllerBusy(double waitSeconds) -
setModeCheckMove
- Specified by:
setModeCheckMovein interfaceINewportVMCController- Throws:
DeviceException
-
setModeCheckOnly
- Specified by:
setModeCheckOnlyin interfaceINewportVMCController- Throws:
DeviceException
-
setName
Description copied from class:DeviceBaseSet the name of the device- Specified by:
setNamein interfaceFindable- Specified by:
setNamein interfaceINewportVMCController- Overrides:
setNamein classDeviceBase- Parameters:
name- The name to set.
-
setOmegaIndex
public void setOmegaIndex(int omegaIndex) - Specified by:
setOmegaIndexin interfaceINewportVMCController
-
setPhiIndex
public void setPhiIndex(int phiIndex) - Specified by:
setPhiIndexin interfaceINewportVMCController
-
setPollCommandInterval
public void setPollCommandInterval(long millis) -
setPollCommandTrials
public void setPollCommandTrials(long numTrials) -
setStatusPort
public void setStatusPort(int statusPort) - Specified by:
setStatusPortin interfaceINewportVMCController
-
setStatusSocketConnection
- Specified by:
setStatusSocketConnectionin interfaceINewportVMCController
-
setTwoThetaIndex
public void setTwoThetaIndex(int twoThetaIndex) - Specified by:
setTwoThetaIndexin interfaceINewportVMCController
-
stop
Description copied from interface:StoppableStops the current operation.- Specified by:
stopin interfaceStoppable- Throws:
DeviceException
-
waitUntilMoveRegistered
public void waitUntilMoveRegistered(double timeoutInSeconds) throws InterruptedException, DeviceException A short waitUntilBusy to allow the controller to transition from READY to TESTING on a move request- Parameters:
timeoutInSeconds-- Throws:
DeviceExceptionInterruptedException
-
waitWhileControllerBusy
public double waitWhileControllerBusy(double timeoutInSeconds) throws InterruptedException, DeviceException waitWhileBusy for the controller, with a timeout and will throws a DeviceException if the time limit is reached.- Parameters:
timeoutInSeconds-- Throws:
DeviceExceptionInterruptedException
-
waitWhileControllerBusyDelay
public double waitWhileControllerBusyDelay(double maxDelayInSeconds) throws InterruptedException, DeviceException waitWhileBusy for the controller, to a maximum delay - no timeout exception.- Parameters:
maxDelayInSeconds-- Throws:
InterruptedExceptionDeviceException
-