/home/epics/devel/areaDetector/ADApp/marCCDSrc/marCCD.cpp File Reference

#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...

Defines

#define MAX_MESSAGE_SIZE   256
 Messages to/from server.
#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.
#define MARCCD_POLL_DELAY   .01
#define TASK_ACQUIRE   0
 Task numbers.
#define TASK_READ   1
#define TASK_CORRECT   2
#define TASK_WRITE   3
#define TASK_DEZINGER   4
#define TASK_STATUS_QUEUED   0x1
 The status bits for each task are:.
#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.
#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.
#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.
#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 marCCDTiffTimeoutString   "MAR_TIFF_TIMEOUT"
#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 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   marCCDTiffTimeout
#define LAST_MARCCD_PARAM   marCCDDatasetComments
#define NUM_MARCCD_PARAMS   (&LAST_MARCCD_PARAM - &FIRST_MARCCD_PARAM + 1)

Enumerations

enum  marCCDFrameType_t { marCCDFrameNormal, marCCDFrameBackground, marCCDFrameRaw, marCCDFrameDoubleCorrelation }
 Frame type choices. More...

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 Documentation

#define FILE_READ_DELAY   .01

Time between checking to see if TIFF file is complete.

#define FIRST_MARCCD_PARAM   marCCDTiffTimeout

#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 marCCDOverlapString   "MAR_OVERLAP"

#define marCCDRotationAxisString   "MAR_ROTATION_AXIS"

#define marCCDRotationRangeString   "MAR_ROTATION_RANGE"

#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 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   (&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_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))


Enumeration Type Documentation

Frame type choices.

Enumerator:
marCCDFrameNormal 
marCCDFrameBackground 
marCCDFrameRaw 
marCCDFrameDoubleCorrelation 


Function Documentation

epicsExportRegistrar ( marCCD_ADRegister   ) 

void getImageDataTaskC ( marCCD pmarCCD  ) 

int marCCDConfig ( const char *  portName,
const char *  serverPort,
int  maxBuffers,
size_t  maxMemory,
int  priority,
int  stackSize 
)


Generated on Tue Aug 9 14:44:36 2011 for areaDetector by  doxygen 1.5.7.1