areaDetector  3-13
EPICS areaDetector framework
Classes | Macros | Enumerations | Functions
pointGrey.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <epicsEvent.h>
#include <epicsTime.h>
#include <epicsThread.h>
#include <iocsh.h>
#include <epicsString.h>
#include <epicsExit.h>
#include <FlyCapture2.h>
#include "ADDriver.h"
#include <epicsExport.h>

Classes

struct  enumStruct_t
 
class  pointGrey
 Main driver class inherited from areaDetectors ADDriver class. More...
 

Macros

#define DRIVER_VERSION   2
 
#define DRIVER_REVISION   9
 
#define DRIVER_MODIFICATION   0
 
#define MAX(x, y)   ((x)>(y)?(x):(y))
 
#define PGPropertyAvailString   "PG_PROP_AVAIL"
 
#define PGPropertyOnOffAvailString   "PG_PROP_ON_OFF_AVAIL"
 
#define PGPropertyOnOffString   "PG_PROP_ON_OFF"
 
#define PGPropertyOnePushAvailString   "PG_PROP_ONE_PUSH_AVAIL"
 
#define PGPropertyOnePushString   "PG_PROP_ONE_PUSH"
 
#define PGPropertyAutoAvailString   "PG_PROP_AUTO_AVAIL"
 
#define PGPropertyManAvailString   "PG_PROP_MAN_AVAIL"
 
#define PGPropertyAutoModeString   "PG_PROP_AUTO_MODE"
 
#define PGPropertyAbsAvailString   "PG_PROP_ABS_AVAIL"
 
#define PGPropertyAbsModeString   "PG_PROP_ABS_MODE"
 
#define PGPropertyValueString   "PG_PROP_VAL"
 
#define PGPropertyValueBString   "PG_PROP_VAL_B"
 
#define PGPropertyValueMaxString   "PG_PROP_VAL_MAX"
 
#define PGPropertyValueMinString   "PG_PROP_VAL_MIN"
 
#define PGPropertyValueAbsString   "PG_PROP_VAL_ABS"
 
#define PGPropertyValueAbsMaxString   "PG_PROP_VAL_ABS_MAX"
 
#define PGPropertyValueAbsMinString   "PG_PROP_VAL_ABS_MIN"
 
#define PGGigEPropertyValueString   "PG_GIGE_PROP_VAL"
 
#define PGGigEPropertyValueMaxString   "PG_GIGE_PROP_VAL_MAX"
 
#define PGGigEPropertyValueMinString   "PG_GIGE_PROP_VAL_MIN"
 
#define PGVideoModeString   "PG_VIDEO_MODE"
 
#define PGFormat7ModeString   "PG_FORMAT7_MODE"
 
#define PGBinningModeString   "PG_BINNING_MODE"
 
#define PGFrameRateString   "PG_FRAME_RATE"
 
#define PGPixelFormatString   "PG_PIXEL_FORMAT"
 
#define PGConvertPixelFormatString   "PG_CONVERT_PIXEL_FORMAT"
 
#define PGTriggerSourceString   "PG_TRIGGER_SOURCE"
 
#define PGTriggerPolarityString   "PG_TRIGGER_POLARITY"
 
#define PGSoftwareTriggerString   "PG_SOFTWARE_TRIGGER"
 
#define PGSkipFramesString   "PG_SKIP_FRAMES"
 
#define PGStrobeSourceString   "PG_STROBE_SOURCE"
 
#define PGStrobePolarityString   "PG_STROBE_POLARITY"
 
#define PGStrobeEnableString   "PG_STROBE_ENABLE"
 
#define PGStrobeDelayString   "PG_STROBE_DELAY"
 
#define PGStrobeDurationString   "PG_STROBE_DURATION"
 
#define PGPacketSizeString   "PG_PACKET_SIZE"
 
#define PGPacketSizeActualString   "PG_PACKET_SIZE_ACTUAL"
 
#define PGMaxPacketSizeString   "PG_MAX_PACKET_SIZE"
 
#define PGPacketDelayString   "PG_PACKET_DELAY"
 
#define PGPacketDelayActualString   "PG_PACKET_DELAY_ACTUAL"
 
#define PGPacketResendEnableString   "PG_PACKET_RESEND_ENABLE"
 
#define PGBandwidthString   "PG_BANDWIDTH"
 
#define PGTimeStampModeString   "PG_TIME_STAMP_MODE"
 
#define PGCorruptFramesString   "PG_CORRUPT_FRAMES"
 
#define PGDriverDroppedString   "PG_DRIVER_DROPPED"
 
#define PGTransmitFailedString   "PG_TRANSMIT_FAILED"
 
#define PGDroppedFramesString   "PG_DROPPED_FRAMES"
 
#define NUM_PROPERTIES   UNSPECIFIED_PROPERTY_TYPE
 
#define NUM_GIGE_PROPERTIES   4
 
#define NUM_TRIGGER_MODES   17
 
#define MAX_ADDR   NUM_MODES
 
#define NUM_GPIO_PINS   4
 
#define NUM_BINNING_MODES   3
 
#define NUM_CONVERT_PIXEL_FORMATS   6
 
#define DEFAULT_PACKET_DELAY   400
 
#define MAX_ENUM_STRING_SIZE   26
 
#define FIRST_PG_PARAM   PGPropertyAvail
 Property is available (int32 read) More...
 
#define LAST_PG_PARAM   PGDroppedFrames
 Number of dropped frames (int32 read) More...
 
#define NUM_PG_PARAMS   ((int)(&LAST_PG_PARAM - &FIRST_PG_PARAM + 1))
 Number of asynPortDriver parameters this driver supports. More...
 

Enumerations

enum  propValue_t { propValueA , propValueB }
 
enum  binningMode_t { BINNING_1X1 , BINNING_2X2 , BINNING_4X4 }
 
enum  PGTimeStamp_t { TimeStampCamera , TimeStampEPICS , TimeStampHybrid }
 

Functions

int pointGreyConfig (const char *portName, int cameraId, int traceMask, int memoryChannel, int maxBuffers, size_t maxMemory, int priority, int stackSize)
 Configuration function to configure one camera. More...
 
 epicsExportRegistrar (pointGreyRegister)
 

Macro Definition Documentation

◆ DEFAULT_PACKET_DELAY

#define DEFAULT_PACKET_DELAY   400

◆ DRIVER_MODIFICATION

#define DRIVER_MODIFICATION   0

◆ DRIVER_REVISION

#define DRIVER_REVISION   9

◆ DRIVER_VERSION

#define DRIVER_VERSION   2

◆ FIRST_PG_PARAM

#define FIRST_PG_PARAM   PGPropertyAvail

Property is available (int32 read)

◆ LAST_PG_PARAM

#define LAST_PG_PARAM   PGDroppedFrames

Number of dropped frames (int32 read)

◆ MAX

#define MAX (   x,
 
)    ((x)>(y)?(x):(y))

◆ MAX_ADDR

#define MAX_ADDR   NUM_MODES

◆ MAX_ENUM_STRING_SIZE

#define MAX_ENUM_STRING_SIZE   26

◆ NUM_BINNING_MODES

#define NUM_BINNING_MODES   3

◆ NUM_CONVERT_PIXEL_FORMATS

#define NUM_CONVERT_PIXEL_FORMATS   6

◆ NUM_GIGE_PROPERTIES

#define NUM_GIGE_PROPERTIES   4

◆ NUM_GPIO_PINS

#define NUM_GPIO_PINS   4

◆ NUM_PG_PARAMS

#define NUM_PG_PARAMS   ((int)(&LAST_PG_PARAM - &FIRST_PG_PARAM + 1))

Number of asynPortDriver parameters this driver supports.

◆ NUM_PROPERTIES

#define NUM_PROPERTIES   UNSPECIFIED_PROPERTY_TYPE

◆ NUM_TRIGGER_MODES

#define NUM_TRIGGER_MODES   17

◆ PGBandwidthString

#define PGBandwidthString   "PG_BANDWIDTH"

◆ PGBinningModeString

#define PGBinningModeString   "PG_BINNING_MODE"

◆ PGConvertPixelFormatString

#define PGConvertPixelFormatString   "PG_CONVERT_PIXEL_FORMAT"

◆ PGCorruptFramesString

#define PGCorruptFramesString   "PG_CORRUPT_FRAMES"

◆ PGDriverDroppedString

#define PGDriverDroppedString   "PG_DRIVER_DROPPED"

◆ PGDroppedFramesString

#define PGDroppedFramesString   "PG_DROPPED_FRAMES"

◆ PGFormat7ModeString

#define PGFormat7ModeString   "PG_FORMAT7_MODE"

◆ PGFrameRateString

#define PGFrameRateString   "PG_FRAME_RATE"

◆ PGGigEPropertyValueMaxString

#define PGGigEPropertyValueMaxString   "PG_GIGE_PROP_VAL_MAX"

◆ PGGigEPropertyValueMinString

#define PGGigEPropertyValueMinString   "PG_GIGE_PROP_VAL_MIN"

◆ PGGigEPropertyValueString

#define PGGigEPropertyValueString   "PG_GIGE_PROP_VAL"

◆ PGMaxPacketSizeString

#define PGMaxPacketSizeString   "PG_MAX_PACKET_SIZE"

◆ PGPacketDelayActualString

#define PGPacketDelayActualString   "PG_PACKET_DELAY_ACTUAL"

◆ PGPacketDelayString

#define PGPacketDelayString   "PG_PACKET_DELAY"

◆ PGPacketResendEnableString

#define PGPacketResendEnableString   "PG_PACKET_RESEND_ENABLE"

◆ PGPacketSizeActualString

#define PGPacketSizeActualString   "PG_PACKET_SIZE_ACTUAL"

◆ PGPacketSizeString

#define PGPacketSizeString   "PG_PACKET_SIZE"

◆ PGPixelFormatString

#define PGPixelFormatString   "PG_PIXEL_FORMAT"

◆ PGPropertyAbsAvailString

#define PGPropertyAbsAvailString   "PG_PROP_ABS_AVAIL"

◆ PGPropertyAbsModeString

#define PGPropertyAbsModeString   "PG_PROP_ABS_MODE"

◆ PGPropertyAutoAvailString

#define PGPropertyAutoAvailString   "PG_PROP_AUTO_AVAIL"

◆ PGPropertyAutoModeString

#define PGPropertyAutoModeString   "PG_PROP_AUTO_MODE"

◆ PGPropertyAvailString

#define PGPropertyAvailString   "PG_PROP_AVAIL"

◆ PGPropertyManAvailString

#define PGPropertyManAvailString   "PG_PROP_MAN_AVAIL"

◆ PGPropertyOnePushAvailString

#define PGPropertyOnePushAvailString   "PG_PROP_ONE_PUSH_AVAIL"

◆ PGPropertyOnePushString

#define PGPropertyOnePushString   "PG_PROP_ONE_PUSH"

◆ PGPropertyOnOffAvailString

#define PGPropertyOnOffAvailString   "PG_PROP_ON_OFF_AVAIL"

◆ PGPropertyOnOffString

#define PGPropertyOnOffString   "PG_PROP_ON_OFF"

◆ PGPropertyValueAbsMaxString

#define PGPropertyValueAbsMaxString   "PG_PROP_VAL_ABS_MAX"

◆ PGPropertyValueAbsMinString

#define PGPropertyValueAbsMinString   "PG_PROP_VAL_ABS_MIN"

◆ PGPropertyValueAbsString

#define PGPropertyValueAbsString   "PG_PROP_VAL_ABS"

◆ PGPropertyValueBString

#define PGPropertyValueBString   "PG_PROP_VAL_B"

◆ PGPropertyValueMaxString

#define PGPropertyValueMaxString   "PG_PROP_VAL_MAX"

◆ PGPropertyValueMinString

#define PGPropertyValueMinString   "PG_PROP_VAL_MIN"

◆ PGPropertyValueString

#define PGPropertyValueString   "PG_PROP_VAL"

◆ PGSkipFramesString

#define PGSkipFramesString   "PG_SKIP_FRAMES"

◆ PGSoftwareTriggerString

#define PGSoftwareTriggerString   "PG_SOFTWARE_TRIGGER"

◆ PGStrobeDelayString

#define PGStrobeDelayString   "PG_STROBE_DELAY"

◆ PGStrobeDurationString

#define PGStrobeDurationString   "PG_STROBE_DURATION"

◆ PGStrobeEnableString

#define PGStrobeEnableString   "PG_STROBE_ENABLE"

◆ PGStrobePolarityString

#define PGStrobePolarityString   "PG_STROBE_POLARITY"

◆ PGStrobeSourceString

#define PGStrobeSourceString   "PG_STROBE_SOURCE"

◆ PGTimeStampModeString

#define PGTimeStampModeString   "PG_TIME_STAMP_MODE"

◆ PGTransmitFailedString

#define PGTransmitFailedString   "PG_TRANSMIT_FAILED"

◆ PGTriggerPolarityString

#define PGTriggerPolarityString   "PG_TRIGGER_POLARITY"

◆ PGTriggerSourceString

#define PGTriggerSourceString   "PG_TRIGGER_SOURCE"

◆ PGVideoModeString

#define PGVideoModeString   "PG_VIDEO_MODE"

Enumeration Type Documentation

◆ binningMode_t

Enumerator
BINNING_1X1 
BINNING_2X2 
BINNING_4X4 

◆ PGTimeStamp_t

Enumerator
TimeStampCamera 
TimeStampEPICS 
TimeStampHybrid 

◆ propValue_t

Enumerator
propValueA 
propValueB 

Function Documentation

◆ epicsExportRegistrar()

epicsExportRegistrar ( pointGreyRegister  )

◆ pointGreyConfig()

int pointGreyConfig ( const char *  portName,
int  cameraId,
int  traceMask,
int  memoryChannel,
int  maxBuffers,
size_t  maxMemory,
int  priority,
int  stackSize 
)

Configuration function to configure one camera.

This function need to be called once for each camera to be used by the IOC. A call to this function instanciates one object from the pointGrey class.

Parameters
[in]portNameasyn port name to assign to the camera.
[in]cameraIdThe camera index or serial number.
[in]traceMaskThe initial value of the asynTraceMask.
If set to 0 or 1 then asynTraceMask will be set to ASYN_TRACE_ERROR. If set to 0x21 (ASYN_TRACE_WARNING | ASYN_TRACE_ERROR) then each call to the FlyCap2 library will be traced including during initialization.
[in]memoryChannelThe camera memory channel (non-volatile memory containing camera parameters) to load during initialization. If 0 no memory channel is loaded. If >=1 thenRestoreFromMemoryChannel(memoryChannel-1) is called.
Set memoryChannel to 1 to work around a bug in the Linux GigE driver in R2.0.
[in]maxBuffersMaxiumum number of NDArray objects (image buffers) this driver is allowed to allocate. This driver requires 2 buffers, and each queue element in a plugin can require one buffer which will all need to be added up in this parameter. 0=unlimited.
[in]maxMemoryMaximum memory (in bytes) that this driver is allowed to allocate. So if max. size = 1024x768 (8bpp) and maxBuffers is, say 14. maxMemory = 1024x768x14 = 11010048 bytes (~11MB). 0=unlimited.
[in]priorityThe EPICS thread priority for this driver. 0=use asyn default.
[in]stackSizeThe size of the stack for the EPICS port thread. 0=use asyn default.