areaDetector
3-14
EPICS areaDetector framework
|
#include <stddef.h>
#include <stdlib.h>
#include <stdarg.h>
#include <math.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <ctype.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
#include <tiffio.h>
#include <epicsTime.h>
#include <epicsThread.h>
#include <epicsEvent.h>
#include <epicsTimer.h>
#include <epicsMutex.h>
#include <epicsStdlib.h>
#include <epicsString.h>
#include <epicsStdio.h>
#include <cantProceed.h>
#include <iocsh.h>
#include <epicsExport.h>
#include <asynOctetSyncIO.h>
#include "ADDriver.h"
Classes | |
class | marCCD |
Driver for marCCD (Rayonix) CCD detector; communicates with the marCCD program over a TCP/IP socket with the marccd_server_socket program that they distribute. More... | |
Macros | |
#define | DRIVER_VERSION "2.3.0" |
#define | MAX_MESSAGE_SIZE 256 |
Messages to/from server. More... | |
#define | MAX_FILENAME_LEN 256 |
#define | MARCCD_SERVER_TIMEOUT 1.0 |
#define | FILE_READ_DELAY .01 |
Time between checking to see if TIFF file is complete. More... | |
#define | MARCCD_POLL_DELAY .01 |
#define | TASK_ACQUIRE 0 |
Task numbers. More... | |
#define | TASK_READ 1 |
#define | TASK_CORRECT 2 |
#define | TASK_WRITE 3 |
#define | TASK_DEZINGER 4 |
#define | TASK_SERIES 5 |
#define | TASK_STATUS_QUEUED 0x1 |
The status bits for each task are: More... | |
#define | TASK_STATUS_EXECUTING 0x2 |
#define | TASK_STATUS_ERROR 0x4 |
#define | TASK_STATUS_RESERVED 0x8 |
#define | TASK_STATE_IDLE 0 |
These are the "old" states from version 0, but BUSY is also used in version 1. More... | |
#define | TASK_STATE_ACQUIRE 1 |
#define | TASK_STATE_READOUT 2 |
#define | TASK_STATE_CORRECT 3 |
#define | TASK_STATE_WRITING 4 |
#define | TASK_STATE_ABORTING 5 |
#define | TASK_STATE_UNAVAILABLE 6 |
#define | TASK_STATE_ERROR 7 |
#define | TASK_STATE_BUSY 8 |
#define | STATE_MASK 0xf |
These are the definitions of masks for looking at task state bits. More... | |
#define | STATUS_MASK 0xf |
#define | TASK_STATUS_MASK(task) (STATUS_MASK << (4*((task)+1))) |
#define | TASK_STATE(current_status) ((current_status) & STATE_MASK) |
These are some convenient macros for checking and setting the state of each task. More... | |
#define | TASK_STATUS(current_status, task) (((current_status) & TASK_STATUS_MASK(task)) >> (4*((task) + 1))) |
#define | TEST_TASK_STATUS(current_status, task, status) (TASK_STATUS(current_status, task) & (status)) |
#define | marCCDGateModeString "MAR_GATE_MODE" |
#define | marCCDReadoutModeString "MAR_READOUT_MODE" |
#define | marCCDServerModeString "MAR_SERVER_MODE" |
#define | marCCDTiffTimeoutString "MAR_TIFF_TIMEOUT" |
#define | marCCDSeriesFileTemplateString "MAR_SERIES_FILE_TEMPLATE" |
#define | marCCDSeriesFileDigitsString "MAR_SERIES_FILE_DIGITS" |
#define | marCCDSeriesFileFirstString "MAR_SERIES_FILE_FIRST" |
#define | marCCDOverlapString "MAR_OVERLAP" |
#define | marCCDStateString "MAR_STATE" |
#define | marCCDStatusString "MAR_STATUS" |
#define | marCCDTaskAcquireStatusString "MAR_ACQUIRE_STATUS" |
#define | marCCDTaskReadoutStatusString "MAR_READOUT_STATUS" |
#define | marCCDTaskCorrectStatusString "MAR_CORRECT_STATUS" |
#define | marCCDTaskWritingStatusString "MAR_WRITING_STATUS" |
#define | marCCDTaskDezingerStatusString "MAR_DEZINGER_STATUS" |
#define | marCCDTaskSeriesStatusString "MAR_SERIES_STATUS" |
#define | marCCDStabilityString "MAR_STABILITY" |
#define | marCCDFrameShiftString "MAR_FRAME_SHIFT" |
#define | marCCDDetectorDistanceString "MAR_DETECTOR_DISTANCE" |
#define | marCCDBeamXString "MAR_BEAM_X" |
#define | marCCDBeamYString "MAR_BEAM_Y" |
#define | marCCDStartPhiString "MAR_START_PHI" |
#define | marCCDRotationAxisString "MAR_ROTATION_AXIS" |
#define | marCCDRotationRangeString "MAR_ROTATION_RANGE" |
#define | marCCDTwoThetaString "MAR_TWO_THETA" |
#define | marCCDWavelengthString "MAR_WAVELENGTH" |
#define | marCCDFileCommentsString "MAR_FILE_COMMENTS" |
#define | marCCDDatasetCommentsString "MAR_DATASET_COMMENTS" |
#define | FIRST_MARCCD_PARAM marCCDGateMode |
#define | LAST_MARCCD_PARAM marCCDDatasetComments |
#define | NUM_MARCCD_PARAMS ((int)(&LAST_MARCCD_PARAM - &FIRST_MARCCD_PARAM + 1)) |
Enumerations | |
enum | marCCDFrameType_t { marCCDFrameNormal , marCCDFrameBackground , marCCDFrameRaw , marCCDFrameDoubleCorrelation } |
enum | marCCDImageMode_t { marCCDImageSingle = ADImageSingle , marCCDImageMultiple = ADImageMultiple , marCCDImageContinuous = ADImageContinuous , marCCDImageSeriesTriggered , marCCDImageSeriesTimed } |
enum | marCCDTriggerMode_t { marCCDTriggerInternal = ADTriggerInternal , marCCDTriggerFrame = ADTriggerExternal , marCCDTriggerBulb , marCCDTriggerTimed } |
enum | marCCDGateMode_t { marCCDGateNone , marCCDGateGated } |
enum | marCCDReadoutMode { marCCDReadoutStandard , marCCDReadoutHighGain , marCCDReadoutLowNoise , marCCDReadoutHDR } |
Functions | |
void | getImageDataTaskC (marCCD *pmarCCD) |
int | marCCDConfig (const char *portName, const char *serverPort, int maxBuffers, size_t maxMemory, int priority, int stackSize) |
epicsExportRegistrar (marCCD_ADRegister) | |
#define DRIVER_VERSION "2.3.0" |
#define FILE_READ_DELAY .01 |
Time between checking to see if TIFF file is complete.
#define FIRST_MARCCD_PARAM marCCDGateMode |
#define LAST_MARCCD_PARAM marCCDDatasetComments |
#define MARCCD_POLL_DELAY .01 |
#define MARCCD_SERVER_TIMEOUT 1.0 |
#define marCCDBeamXString "MAR_BEAM_X" |
#define marCCDBeamYString "MAR_BEAM_Y" |
#define marCCDDatasetCommentsString "MAR_DATASET_COMMENTS" |
#define marCCDDetectorDistanceString "MAR_DETECTOR_DISTANCE" |
#define marCCDFileCommentsString "MAR_FILE_COMMENTS" |
#define marCCDFrameShiftString "MAR_FRAME_SHIFT" |
#define marCCDGateModeString "MAR_GATE_MODE" |
#define marCCDOverlapString "MAR_OVERLAP" |
#define marCCDReadoutModeString "MAR_READOUT_MODE" |
#define marCCDRotationAxisString "MAR_ROTATION_AXIS" |
#define marCCDRotationRangeString "MAR_ROTATION_RANGE" |
#define marCCDSeriesFileDigitsString "MAR_SERIES_FILE_DIGITS" |
#define marCCDSeriesFileFirstString "MAR_SERIES_FILE_FIRST" |
#define marCCDSeriesFileTemplateString "MAR_SERIES_FILE_TEMPLATE" |
#define marCCDServerModeString "MAR_SERVER_MODE" |
#define marCCDStabilityString "MAR_STABILITY" |
#define marCCDStartPhiString "MAR_START_PHI" |
#define marCCDStateString "MAR_STATE" |
#define marCCDStatusString "MAR_STATUS" |
#define marCCDTaskAcquireStatusString "MAR_ACQUIRE_STATUS" |
#define marCCDTaskCorrectStatusString "MAR_CORRECT_STATUS" |
#define marCCDTaskDezingerStatusString "MAR_DEZINGER_STATUS" |
#define marCCDTaskReadoutStatusString "MAR_READOUT_STATUS" |
#define marCCDTaskSeriesStatusString "MAR_SERIES_STATUS" |
#define marCCDTaskWritingStatusString "MAR_WRITING_STATUS" |
#define marCCDTiffTimeoutString "MAR_TIFF_TIMEOUT" |
#define marCCDTwoThetaString "MAR_TWO_THETA" |
#define marCCDWavelengthString "MAR_WAVELENGTH" |
#define MAX_FILENAME_LEN 256 |
#define MAX_MESSAGE_SIZE 256 |
Messages to/from server.
#define NUM_MARCCD_PARAMS ((int)(&LAST_MARCCD_PARAM - &FIRST_MARCCD_PARAM + 1)) |
#define STATE_MASK 0xf |
These are the definitions of masks for looking at task state bits.
#define STATUS_MASK 0xf |
#define TASK_ACQUIRE 0 |
Task numbers.
#define TASK_CORRECT 2 |
#define TASK_DEZINGER 4 |
#define TASK_READ 1 |
#define TASK_SERIES 5 |
#define TASK_STATE | ( | current_status | ) | ((current_status) & STATE_MASK) |
These are some convenient macros for checking and setting the state of each task.
They are used in the marccd code and can be used in the client code
#define TASK_STATE_ABORTING 5 |
#define TASK_STATE_ACQUIRE 1 |
#define TASK_STATE_BUSY 8 |
#define TASK_STATE_CORRECT 3 |
#define TASK_STATE_ERROR 7 |
#define TASK_STATE_IDLE 0 |
These are the "old" states from version 0, but BUSY is also used in version 1.
#define TASK_STATE_READOUT 2 |
#define TASK_STATE_UNAVAILABLE 6 |
#define TASK_STATE_WRITING 4 |
#define TASK_STATUS | ( | current_status, | |
task | |||
) | (((current_status) & TASK_STATUS_MASK(task)) >> (4*((task) + 1))) |
#define TASK_STATUS_ERROR 0x4 |
#define TASK_STATUS_EXECUTING 0x2 |
#define TASK_STATUS_MASK | ( | task | ) | (STATUS_MASK << (4*((task)+1))) |
#define TASK_STATUS_QUEUED 0x1 |
The status bits for each task are:
Task Status bits
#define TASK_STATUS_RESERVED 0x8 |
#define TASK_WRITE 3 |
#define TEST_TASK_STATUS | ( | current_status, | |
task, | |||
status | |||
) | (TASK_STATUS(current_status, task) & (status)) |
enum marCCDFrameType_t |
enum marCCDGateMode_t |
enum marCCDImageMode_t |
enum marCCDReadoutMode |
enum marCCDTriggerMode_t |
epicsExportRegistrar | ( | marCCD_ADRegister | ) |
void getImageDataTaskC | ( | marCCD * | pmarCCD | ) |
int marCCDConfig | ( | const char * | portName, |
const char * | serverPort, | ||
int | maxBuffers, | ||
size_t | maxMemory, | ||
int | priority, | ||
int | stackSize | ||
) |