Package gda.device.detector
Class DummyDAServer
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.detector.DAServer
gda.device.detector.DummyDAServer
- All Implemented Interfaces:
Device,Configurable,Findable,gda.observable.IObservable
- Direct Known Subclasses:
DummyXStripDAServer
A Dummy DA.Server implementation
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected static intFields inherited from class gda.device.detector.DAServer
CLOCKRATE, startupCommandsFields inherited from class gda.device.DeviceBase
DEFAULT_PROTECTION_LEVEL_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()dummy close the server, resets open pathsvoidDefault 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()double[]getBinaryData(String command, int data_size) Get binary data from the server and transform to doublefloat[]getFloatBinaryData(String message, int ndata) Get binary data from the server as floatint[]getIntBinaryData(String command, int data_size) Get binary data from the server and transform to int[] (32bit)long[]getLongBinaryData(String command, int data_size) Get binary data from the server and transform to long (64bit) *intbooleanReturns the state of the socket connectionbooleanprotected ObjectparseFileCommand(String command) protected ObjectparseReadCommand(String command) protected ObjectparseTFGCommand(String command, Object rc) protected ObjectparseTFGGenerateCommand(String command) protected ObjectparseXspressCommand(String command) protected voidparseXspressFormatRunCommand(StringTokenizer tokenizer) voidTidy existing socket streams and try to connect them again within the thread.voidCalled for classes using DummyDAServer in fileData mode.sendCommand(String command) voidsetDataFile(String dataFile) voidsetNonRandomTestData(boolean nonRandomTestData) voidsetXspressMode(DUMMY_XSPRESS2_MODE xspressMode) Methods inherited from class gda.device.detector.DAServer
getBinaryDataBuffer, getData, getDataPort, getHost, getPort, getReplyTimeOut, getStartupCommands, reconfigure, sendCommand, sendCommand, setDataPort, setHost, setPort, setReplyTimeOut, setStartupCommands, testMethods 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, toString, wait, wait, waitMethods inherited from interface gda.factory.Configurable
isConfigured
-
Field Details
-
key
protected static int key -
handles
-
fail
protected boolean fail
-
-
Constructor Details
-
DummyDAServer
public DummyDAServer()initialise array etc.
-
-
Method Details
-
isConnected
public boolean isConnected()Description copied from class:DAServerReturns the state of the socket connection- Overrides:
isConnectedin classDAServer- Returns:
- true if connected
-
connect
public void connect() -
reconnect
public void reconnect()Description copied from class:DAServerTidy 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. -
configure
public void 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 classDAServer
-
sendCommand
- Overrides:
sendCommandin classDAServer
-
parseReadCommand
-
parseFileCommand
-
parseXspressCommand
-
parseTFGCommand
-
parseXspressFormatRunCommand
-
parseTFGGenerateCommand
-
getLongBinaryData
Description copied from class:DAServerGet binary data from the server and transform to long (64bit) *- Overrides:
getLongBinaryDatain classDAServer- Parameters:
command- an unterminated commanddata_size- number of data values to fetch.- Returns:
- returns data as an array.
-
getIntBinaryData
Description copied from class:DAServerGet binary data from the server and transform to int[] (32bit)- Overrides:
getIntBinaryDatain classDAServer- Parameters:
command- an unterminated commanddata_size- number of data values to fetch.- Returns:
- returns data as an array.
-
getBinaryData
Description copied from class:DAServerGet binary data from the server and transform to double- Overrides:
getBinaryDatain classDAServer- Parameters:
command- an unterminated commanddata_size- number of data values to fetch.- Returns:
- returns data as an array.
-
close
dummy close the server, resets open paths- Specified by:
closein interfaceDevice- Overrides:
closein classDAServer- Throws:
DeviceException- See Also:
-
isNonRandomTestData
public boolean isNonRandomTestData()- Returns:
- the nonRandomTestData
-
setNonRandomTestData
public void setNonRandomTestData(boolean nonRandomTestData) - Parameters:
nonRandomTestData- the nonRandomTestData to set
-
getDataFile
- Returns:
- Returns the mofoil2Data.
-
setDataFile
- Parameters:
dataFile- The data to set.
-
resetScanPointCount
public void resetScanPointCount()Called for classes using DummyDAServer in fileData mode. -
getXspressMode
- Returns:
- Returns the xspressMode.
-
setXspressMode
- Parameters:
xspressMode- The xspressMode to set.
-
getFloatBinaryData
Description copied from class:DAServerGet binary data from the server as float- Overrides:
getFloatBinaryDatain classDAServer- Parameters:
message- an unterminated commandndata- number of data values to fetch.- Returns:
- returns data as an array.
-
getMemorySize
public int getMemorySize()
-