Package gda.device.memory
Class Gdhist
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.memory.Gdhist
- All Implemented Interfaces:
Device,Memory,Configurable,Findable,gda.observable.IObservable
- Direct Known Subclasses:
EncoderCounter,Gdscaler,Scaler,Vvhist
A memory class for the VME Generic data acquisition histogramming memory card implemented using DA.Server
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DAServerprotected intprotected intprotected Stringprotected static final Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected intprotected Stringprotected intFields inherited from class gda.device.DeviceBase
DEFAULT_PROTECTION_LEVEL_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the complete memory system.voidclear(int start, int count) Clear the specified number of frames/images/spectra starting with specified frame/image/spectrum number.voidclear(int x, int y, int t, int dx, int dy, int dt) Clear the specified block of memory.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.protected voidgetAttribute(String attributeName) Get the value of the specified attributeGet the name of the daServer instance.int[]Get the size of the memory system.intintGet the physical memory sizeGet the open commandGet the command which obtains the size of memoryGet the startup script commandint[]If the detector supports multiple pixel settings, this will return an array of possible values.intgetWidth()protected voidopen()voidOutput data from memory directly to filedouble[]read(int frame) Read the specified frame/image/spectrum.double[]read(int x, int y, int t, int dx, int dy, int dt) Read the specified block of memory.float[]readFloat(int frame) float[]readFloat(int x, int y, int t, int dx, int dy, int dt) voidRe-initialisation of values and states.protected ObjectsendAndParse(String operation, String command) send a command and report error/throw exception when operation fails, i.e.voidsetAttribute(String attributeName, Object value) Set attribute values for "User", "Password", "Host", "TotalFrames", "Endian".voidsetDaServer(DAServer daServer) voidsetDaServerName(String daServerName) Set the name of the daServer instancevoidsetDimension(int[] d) Set the size of the memory system.protected voidsetFail()for use by junit testsvoidsetHeight(int height) voidsetOpenCommand(String openCommand) Set the command (if necessary) for opening the memoryvoidsetSizeCommand(String sizeCommand) Set the command to obtain the size of memoryvoidsetStartupScript(String startupScript) Set the startup script commandvoidsetSupportedDimensions(int[] d) set the number of pixel settings the detector can work at.voidsetWidth(int width) voidstart()Starts/enables the memory system.voidstop()Stops/disables the memory system.voidwrite(double[] data, int frame) Write to the specified frame of memory.voidwrite(double[] data, int x, int y, int t, int dx, int dy, int dt) Write to the specified block of memory.Methods inherited from class gda.device.DeviceBase
addIObserver, deleteIObserver, deleteIObservers, getName, getProtectionLevel, isBeingObserved, isConfigureAtStartup, notifyIObservers, 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
isConfigureAtStartup, isConfiguredMethods inherited from interface gda.device.Device
getProtectionLevel, setProtectionLevelMethods inherited from interface gda.observable.IObservable
addIObserver, deleteIObserver, deleteIObservers
-
Field Details
-
localEndian
- See Also:
-
daServer
-
startupScript
-
openCommand
-
width
protected int width -
height
protected int height -
totalFrames
protected int totalFrames -
handle
protected int handle -
user
-
password
-
host
-
remoteEndian
-
-
Constructor Details
-
Gdhist
public Gdhist()
-
-
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
-
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
-
ensureOpen
- Throws:
DeviceException
-
sendAndParse
send a command and report error/throw exception when operation fails, i.e. daserver replies -1- Parameters:
operation- descriptive name of the operation attempted for loggingcommand- command to send to daserver- Returns:
- Object
- Throws:
DeviceException
-
open
- Throws:
DeviceException
-
close
Description copied from interface:DeviceClose and unconfigure the device.- Specified by:
closein interfaceDevice- Overrides:
closein classDeviceBase- Throws:
DeviceException
-
clear
Description copied from interface:MemoryClear the complete memory system.- Specified by:
clearin interfaceMemory- Throws:
DeviceException
-
clear
Description copied from interface:MemoryClear the specified number of frames/images/spectra starting with specified frame/image/spectrum number.- Specified by:
clearin interfaceMemory- Parameters:
start- is the starting frame/image/spectrum number (1st = 0)count- is the number of frames/images/spectra to clear- Throws:
DeviceException
-
clear
Description copied from interface:MemoryClear the specified block of memory. The parameters give the ability to clear a 3D block of memory.- Specified by:
clearin interfaceMemory- Parameters:
x- is the start address for the offset in the x dimensiony- is the start address for the offset in the y dimensiont- is the start address for the offset in the z or t dimensiondx- is the address count in the x dimensiondy- is the address count in the y dimensiondt- is the address count in the z or t dimension- Throws:
DeviceException
-
start
Description copied from interface:MemoryStarts/enables the memory system.- Specified by:
startin interfaceMemory- Throws:
DeviceException
-
stop
Description copied from interface:MemoryStops/disables the memory system.- Specified by:
stopin interfaceMemory- Throws:
DeviceException
-
readFloat
- Throws:
DeviceException
-
readFloat
- Throws:
DeviceException
-
read
Description copied from interface:MemoryRead the specified block of memory. The parameters give the ability to read a 3D block of memory.- Specified by:
readin interfaceMemory- Parameters:
x- is the start address for the offset in the x dimensiony- is the start address for the offset in the y dimensiont- is the start address for the offset in the z or t dimensiondx- is the address count in the x dimensiondy- is the address count in the y dimensiondt- is the address count in the z or t dimension- Returns:
- the data
- Throws:
DeviceException
-
read
Description copied from interface:MemoryRead the specified frame/image/spectrum.- Specified by:
readin interfaceMemory- Parameters:
frame- is the frame/image/spectrum number (1st = 0)- Returns:
- the data
- Throws:
DeviceException
-
getDaServer
- Returns:
- Returns the daServer.
-
setDaServer
- Parameters:
daServer- The daServer to set.
-
setDimension
Description copied from interface:MemorySet the size of the memory system.- Specified by:
setDimensionin interfaceMemory- Parameters:
d- is the- Throws:
DeviceException
-
output
Description copied from interface:MemoryOutput data from memory directly to file- Specified by:
outputin interfaceMemory- Parameters:
file- is the fully qualified file name- Throws:
DeviceException
-
getMemorySize
Description copied from interface:MemoryGet the physical memory size- Specified by:
getMemorySizein interfaceMemory- Returns:
- the physical memory size expressed in words.
- Throws:
DeviceException
-
setAttribute
Set attribute values for "User", "Password", "Host", "TotalFrames", "Endian".- Specified by:
setAttributein interfaceDevice- Overrides:
setAttributein classDeviceBase- Parameters:
attributeName- is the name of the attributevalue- is the value of the attribute- See Also:
-
getAttribute
Description copied from interface:DeviceGet the value of the specified attribute- Specified by:
getAttributein interfaceDevice- Overrides:
getAttributein classDeviceBase- Parameters:
attributeName- is the name of the attribute- Returns:
- the value of the attribute as an Object type
-
getDimension
public int[] getDimension()Description copied from interface:MemoryGet the size of the memory system.- Specified by:
getDimensionin interfaceMemory- Returns:
- the memory dimension in x and y
-
setSupportedDimensions
public void setSupportedDimensions(int[] d) set the number of pixel settings the detector can work at. assumes a 2d detector with identical axis.- Parameters:
d-
-
getSupportedDimensions
public int[] getSupportedDimensions()Description copied from interface:MemoryIf the detector supports multiple pixel settings, this will return an array of possible values. Null otherwise. Assumes the detector is 2D with identical axes.- Specified by:
getSupportedDimensionsin interfaceMemory- Returns:
- a collection of supported Dimensions
-
write
public void write(double[] data, int x, int y, int t, int dx, int dy, int dt) Description copied from interface:MemoryWrite to the specified block of memory. The parameters give the ability to write a 3D block of memory.- Specified by:
writein interfaceMemory- Parameters:
data- is the data to write to the memoryx- is the start address for the offset in the x dimensiony- is the start address for the offset in the y dimensiont- is the start address for the offset in the z or t dimensiondx- is the address count in the x dimensiondy- is the address count in the y dimensiondt- is the address count in the z or t dimension
-
write
public void write(double[] data, int frame) Description copied from interface:MemoryWrite to the specified frame of memory. -
getWidth
public int getWidth()- Returns:
- width
-
setWidth
- Parameters:
width-- Throws:
DeviceException
-
getHeight
public int getHeight()- Returns:
- height
-
setHeight
- Parameters:
height-- Throws:
DeviceException
-
setDaServerName
Set the name of the daServer instance- Parameters:
daServerName- the server name
-
getDaServerName
Get the name of the daServer instance.- Returns:
- the server name
-
setStartupScript
Set the startup script command- Parameters:
startupScript- the startup script command
-
getStartupScript
Get the startup script command- Returns:
- the startup script command
-
setSizeCommand
Set the command to obtain the size of memory- Parameters:
sizeCommand- the command to obtain the size of memory
-
getSizeCommand
Get the command which obtains the size of memory- Returns:
- the command
-
setOpenCommand
Set the command (if necessary) for opening the memory- Parameters:
openCommand- the open command
-
getOpenCommand
Get the open command- Returns:
- the command
-
setFail
for use by junit tests- Throws:
DeviceException
-