From a53c11f9727164697884ca5304da0d3b5e269945 Mon Sep 17 00:00:00 2001
From: rivers
Date: Mon, 17 Aug 2009 02:20:53 +0000
Subject: [PATCH] Additions and fixes for R1-5
git-svn-id: https://subversion.xor.aps.anl.gov/synApps/areaDetector/trunk@9300 dc6c5ff5-0b8b-c028-a01f-ffb33f00fc8b
---
documentation/areaDetectorDoc.html | 283 ++++++++++++++++++++---------
1 file changed, 200 insertions(+), 83 deletions(-)
diff --git a/documentation/areaDetectorDoc.html b/documentation/areaDetectorDoc.html
index 9d4dc2d..048dd39 100755
--- a/documentation/areaDetectorDoc.html
+++ b/documentation/areaDetectorDoc.html
@@ -10,7 +10,7 @@
areaDetector: EPICS Area Detector Support
- July 30, 2009
+ August 15, 2009
Mark Rivers
@@ -26,22 +26,16 @@
asynPortDriver
NDArray
NDArrayPool
+ NDAttribute
+ NDAttributeList
+ PVAttribute
+ paramAttribute
asynNDArrayDriver
+
+ Detector drivers
+
-
- Plugins
-
-
- Detector drivers
-
+
+ Plugins
+
+
+ MEDM screens
Viewers
- ImageJ Viewer
@@ -68,7 +74,7 @@
Overview
The areaDetector module provides a general-purpose interface for area (2-D) detectors
- in EPICS. It is intended to be used with
+ in EPICS. It is intended to be used with
a wide variety of detectors and cameras, ranging from high frame rate CCD and CMOS
cameras, pixel-array detectors such as the Pilatus, and large format detectors like
the MAR-345 online imaging plate.
@@ -90,7 +96,7 @@
- Provide a mechanism for device-independent real-time data analysis such as regions-of-interest
and statistics.
- Provide detector drivers for commonly used detectors in synchrotron applications.
- These include Prosilica GigE video cameras, IEEE 1394 (Firewire) cameras, MAR-CCD
+ These include Prosilica GigE video cameras, IEEE 1394 (Firewire) cameras, ADSC and MAR CCD
x-ray detectors, MAR-345 online imaging plate detectors, the Pilatus pixel-array
detector, Roper Scientific CCD cameras, and the Perkin-Elmer amorphous silicon detector.
@@ -140,7 +146,7 @@
libCom.
libCom from EPICS base provides operating-system independent functions for threads,
mutexes, etc.
- asyn. asyn is a module
+ asyn. asyn is a module
that provides interthread messaging services, including queueing and callbacks.
@@ -179,7 +185,7 @@
Implementation details
- The areaDetector module depends heavily on
+ The areaDetector module depends heavily on
asyn. It is the software that is used for interthread communication, using
the standard asyn interfaces (e.g. asynInt32, asynOctet, etc.), and callbacks. In
order to minimize the amount of redundant code in drivers, areaDetector has been
@@ -195,7 +201,7 @@
They inherit from the
asynPortDriver base C++ class that is provided in the asyn module. That base
class handles all of the details of registering the port driver, registering the
- supported interfaces, and registering the required interrupt sources. The
+ supported interfaces, and registering the required interrupt sources. The
asynPortDriver class documentation describes this class in detail.
@@ -214,15 +220,6 @@
NDDimension structure. The
NDArray class documentation describes this class in detail.
-
- NDAttribute
-
- The NDAttribute is a class for linking metadata to an NDArray. An NDattribute has
- a name, description, data type, value, source type and source information. There
- are methods to set and get the information for an attribute, and NDArray provides
- methods to add and delete attributes from an NDArray object. The
- NDAttribute class documentation describes this class in detail.
-
NDArrayPool
@@ -234,6 +231,44 @@
minimizes the copying of array data in plugins. The
NDArrayPool class documentation describes this class in detail.
+
+ NDAttribute
+
+ The NDAttribute is a class for linking metadata to an NDArray. An NDattribute has
+ a name, description, data type, value, source type and source information. Attributes are
+ identified by their names, which are case-insensitive. There
+ are methods to set and get the information for an attribute.
+ The
+ NDAttribute class documentation describes this class in detail.
+
+
+ NDAttributeList
+
+ The NDAttributeList implements a linked list of NDAttribute objects.
+ NDArray objects contain an NDAttributeList which is how attributes are associated with
+ an NDArray. There are methods to add, delete and search for NDAttribute objects in an
+ NDAttributeList. Each attribute in the list must have a unique name, which is case-insensitive.
+ The
+ NDAttributeList class documentation describes this class in detail.
+
+
+ PVAttribute
+
+ The PVAttribute class is derived from NDAttribute. It obtains its value by monitor callbacks from an EPICS PV,
+ and is thus used to associate current the value of any EPICS PV with an NDArray.
+ The
+ PVAttribute class documentation describes this class in detail.
+
+
+ paramAttribute
+
+ The paramAttribute class is derived from NDAttribute. It obtains its value from the current value
+ of a driver or plugin parameter. The paramAttribute class is typically used when it is important to have
+ the current value of the parameter and the value of a corresponding PVAttribute might not be current because the
+ EPICS PV has not yet updated.
+ The
+ paramAttribute class documentation describes this class in detail.
+
asynNDArrayDriver
@@ -244,7 +279,7 @@
The file asynNDArrayDriver.h
- defines a number of enumerations, including NDStdDriverParams_t, which are the parameters
+ defines a number of enumerations, including NDStdDriverParam_t, which are the parameters
that all NDArray drivers and plugins should implement if possible. These parameters
are defined by enum values with an associated asyn interface, and access (read-only
or read-write). The EPICS database ADBase.template provides access to these standard
@@ -259,7 +294,10 @@
Access: Read-write (r/w) or read-only (r/o).
drvUser string: The string used to look up the parameter in the driver
through the drvUser interface. This string is used in the EPICS database file for
- generic asyn device support to associate a record with a particular parameter.
+ generic asyn device support to associate a record with a particular parameter. It is
+ also used to associate a paramAttribute
+ with a driver parameter in the XML file
+ that is read by asynNDArrayDriver::readNDAttributesFile
EPICS record name: The name of the record in ADBase.template. Each record
name begins with the two macro parameters $(P) and $(R). In the case of read/write
parameters there are normally two records, one for writing the value, and a second,
@@ -410,7 +448,7 @@
r/o |
- Size of the aray data in the Z direction |
+ Size of the array data in the Z direction
ARRAY_SIZE_Z |
@@ -418,6 +456,22 @@
|
longin |
+
+ |
+ NDArraySize |
+
+ asynInt32 |
+
+ r/o |
+
+ Total size of the array data in bytes |
+
+ ARRAY_SIZE |
+
+ $(P)$(R)ArraySize_RBV |
+
+ longin |
+
|
File saving parameters (records are defined in NDFile.template) |
@@ -594,7 +648,7 @@
r/w |
- Manually save the most recent image to a file when value=1 |
+ Manually save the most recent array to a file when value=1
WRITE_FILE |
@@ -652,15 +706,15 @@
|
CAPTURE |
- $(P)$(R)FileCapture
- $(P)$(R)FileCapture_RBV |
+ $(P)$(R)Capture
+ $(P)$(R)Capture_RBV
busy
bi |
|
- NDNumCapture |
+ NDFileNumCapture
asynInt32 |
@@ -670,15 +724,15 @@
|
NUM_CAPTURE |
- $(P)$(R)FileNumCapture
- $(P)$(R)FileNumCapture_RBV |
+ $(P)$(R)NumCapture
+ $(P)$(R)NumCapture_RBV
longout
longin |
|
- NDNumCaptured |
+ NDFileNumCaptured
asynInt32 |
@@ -688,29 +742,10 @@
|
NUM_CAPTURED |
- $(P)$(R)FileNumCaptured_RBV |
+ $(P)$(R)NumCaptured_RBV
longin |
-
- |
- NDArrayCounter |
-
- asynInt32 |
-
- r/w |
-
- Counter that increments by 1 each time an array is acquired. Can be reset by writing
- a value to it. |
-
- ARRAY_COUNTER |
-
- $(P)$(R)ArrayCounter
- $(P)$(R)ArrayCounter_RBV |
-
- longout
- longin |
-
|
Array data |
@@ -744,14 +779,72 @@
r/w |
- The image data as an NDArray object |
+ The array data as an NDArray object
NDARRAY_DATA |
- N/A. EPICS access to image data is through NDStdArrays plugin. |
+ N/A. EPICS access to array data is through NDStdArrays plugin.
N/A |
+
+ |
+ NDArrayCounter |
+
+ asynInt32 |
+
+ r/w |
+
+ Counter that increments by 1 each time an array is acquired. Can be reset by writing
+ a value to it. |
+
+ ARRAY_COUNTER |
+
+ $(P)$(R)ArrayCounter
+ $(P)$(R)ArrayCounter_RBV |
+
+ longout
+ longin |
+
+
+ |
+ N/A |
+
+ N/A |
+
+ r/o |
+
+ Rate at which arrays are being acquired. Computed in the ADBase.template database. |
+
+ N/A |
+
+ $(P)$(R)ArrayRate_RBV |
+
+ calc |
+
+
+ |
+ Array attributes |
+
+
+ |
+ NDAttributesFile |
+
+ asynOctet |
+
+ r/w |
+
+ The name of an XML file defining the PVAttributes and paramAttributes to be
+ added to each NDArray by this driver or plugin. The format of the XML file is described
+ in the documentation for
+ asynNDArrayDriver::readNDAttributesFile(). |
+
+ ND_ATTRIBUTES_FILE |
+
+ $(P)$(R)NDAttributesFile |
+
+ waveform |
+
|
Debugging control |
@@ -783,7 +876,7 @@
The file ADDriver.h defines
- a number of enumerations, including ADStdDriverParams_t, which are the parameters
+ a number of enumerations, including ADStdDriverParam_t, which are the parameters
that all areaDetector drivers should implement if possible.
@@ -1036,7 +1129,7 @@
|
r/w |
- Reverse image in the X direction
+ Reverse array in the X direction
(0=No, 1=Yes) |
REVERSE_X |
@@ -1055,7 +1148,7 @@
r/w |
- Reverse image in the Y direction
+ Reverse array in the Y direction
(0=No, 1=Yes) |
REVERSE_Y |
@@ -1220,16 +1313,18 @@
r/w |
- Start (1) or stop (0) image acquisition. This record is linked to an EPICS busy
+ Start (1) or stop (0) image acquisition. This is an EPICS busy
record that does not process its forward link until acquisition is complete. Clients
should write 1 to the Acquire record to start acquisition, and wait for Acquire
to go to 0 to know that acquisition is complete. |
ACQUIRE |
- $(P)$(R)Acquire |
+ $(P)$(R)Acquire
+ $(P)$(R)Acquire_RBV
- bo |
+ busy
+ bi
|
@@ -1334,22 +1429,6 @@
|
longin |
-
- |
- N/A |
-
- N/A |
-
- r/o |
-
- Rate (Hz) at which ImageCounter is incrementing. Computed in database. |
-
- N/A |
-
- $(P)$(R)ImageRate_RBV |
-
- calc |
-
|
ADTimeRemaining |
@@ -1554,6 +1633,44 @@
+
+ Guidelines and rules for drivers
+ The following are guidelines and rules for writing areaDetector drivers
+
+ -
+ Drivers will generally implement one or more of the writeInt32(), writeFloat64() or writeOctet() functions
+ if they need to act immediately on a new value of a parameter. For many parameters it is normally
+ sufficient to simply have them written to the parameter library, and not to handle them in the
+ writeXXX() functions. The parameters are then retrieved from the parameter library with the getIntParam(),
+ getDoubleParam(), or getStringParam() function calls when they are needed.
+ -
+ If the writeInt32(), writeFloat64() or writeOctet() functions are implemented they must call
+ the base class function for parameters that they do not handle and whose enum value is less than
+ the value of ADLastStdParam, i.e. parameters that belong to a base class.
+ -
+ Drivers will need to implement the drvUserCreate() function if they have additional parameters beyond
+ those in the asynPortDriver or ADDriver base classes.
+ -
+ Drivers will generally need to create a new thread in which they run the acquisition task. Some vendor
+ libraries create such a thread themselves, and then the driver must just implement a callback function
+ that runs in that thread (the Prosilica is an example of such a driver).
+ - The acquisition thread will typically monitor the acquisition process and perform periodic status update
+ callbacks. The details of how to implement this will vary depending on the specifics of the vendor API.
+ There are many existing detector drivers that can be used as examples of how to write a new driver.
+ - If the detector hardware does not support fixed-period acquisition or muliple-image acquisition sequence
+ (ADNumImages parameter) then these should be emulated in the driver. The simDetector, marCCD and other
+ drivers can be used as examples of how to do this.
+ -
+ If NDArrayCallbacks is non-zero then drivers should do the following:
+
+ - Call asynNDArrayDriver::getAttributes to attach any attributes defined for this driver to the
+ current array.
+ - Call doCallbacksGenericPointer() so that registered clients can get the values of the new arrays.
+ Drivers must release their mutex by calling this->unlock() before they call doCallbacksGenericPointer(),
+ or a deadlock can occur if the plugin makes a call to one of the driver functions.
+
+
+
MEDM screens