/home/epics/devel/areaDetector/1-5/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 NUM_MARCCD_PARAMS   (sizeof(marCCDParamString)/sizeof(marCCDParamString[0]))

Enumerations

enum  marCCDFrameType_t { marCCDFrameNormal, marCCDFrameBackground, marCCDFrameRaw, marCCDFrameDoubleCorrelation }
 Frame type choices. More...
enum  marCCDParam_t {
  marCCDTiffTimeout = ADLastStdParam, marCCDOverlap, marCCDState, marCCDStatus,
  marCCDTaskAcquireStatus, marCCDTaskReadoutStatus, marCCDTaskCorrectStatus, marCCDTaskWritingStatus,
  marCCDTaskDezingerStatus, marCCDFrameShift, marCCDDetectorDistance, marCCDBeamX,
  marCCDBeamY, marCCDStartPhi, marCCDRotationAxis, marCCDRotationRange,
  marCCDTwoTheta, marCCDWavelength, marCCDFileComments, marCCDDatasetComments,
  ADLastDriverParam
}
 Driver-specific parameters for the marCCD driver. 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 MARCCD_POLL_DELAY   .01

#define MARCCD_SERVER_TIMEOUT   1.0

#define MAX_FILENAME_LEN   256

#define MAX_MESSAGE_SIZE   256

Messages to/from server.

#define NUM_MARCCD_PARAMS   (sizeof(marCCDParamString)/sizeof(marCCDParamString[0]))

#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 

Driver-specific parameters for the marCCD driver.

Enumerator:
marCCDTiffTimeout 
marCCDOverlap 
marCCDState 
marCCDStatus 
marCCDTaskAcquireStatus 
marCCDTaskReadoutStatus 
marCCDTaskCorrectStatus 
marCCDTaskWritingStatus 
marCCDTaskDezingerStatus 
marCCDFrameShift 
marCCDDetectorDistance 
marCCDBeamX 
marCCDBeamY 
marCCDStartPhi 
marCCDRotationAxis 
marCCDRotationRange 
marCCDTwoTheta 
marCCDWavelength 
marCCDFileComments 
marCCDDatasetComments 
ADLastDriverParam 


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 25 16:53:03 2009 for areaDetector by  doxygen 1.5.7.1