areaDetector  3-5-0
EPICS areaDetector framework
Classes | Macros | Enumerations | Functions
pilatusDetector.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 <cbf_ad.h>
#include <tiffio.h>
#include <epicsTime.h>
#include <epicsThread.h>
#include <epicsEvent.h>
#include <epicsMutex.h>
#include <epicsString.h>
#include <epicsStdio.h>
#include <cantProceed.h>
#include <iocsh.h>
#include <epicsExport.h>
#include <asynOctetSyncIO.h>
#include "ADDriver.h"

Classes

struct  badPixel
 Bad pixel structure for Pilatus detector. More...
 
class  pilatusDetector
 Driver for Dectris Pilatus pixel array detectors using their camserver server over TCP/IP socket. More...
 

Macros

#define DRIVER_VERSION   2
 
#define DRIVER_REVISION   6
 
#define DRIVER_MODIFICATION   0
 
#define MAX_MESSAGE_SIZE   256
 Messages to/from camserver. More...
 
#define MAX_FILENAME_LEN   256
 
#define MAX_HEADER_STRING_LEN   68
 
#define MAX_BAD_PIXELS   100
 
#define ASYN_POLL_TIME   .01
 Time to poll when reading from camserver. More...
 
#define CAMSERVER_DEFAULT_TIMEOUT   1.0
 
#define CAMSERVER_ACQUIRE_TIMEOUT   10.
 Additional time to wait for a camserver response after the acquire should be complete. More...
 
#define CAMSERVER_RESET_POWER_TIMEOUT   30.
 
#define FILE_READ_DELAY   .01
 Time between checking to see if image file is complete. More...
 
#define PilatusDelayTimeString   "DELAY_TIME"
 
#define PilatusThresholdString   "THRESHOLD"
 
#define PilatusThresholdApplyString   "THRESHOLD_APPLY"
 
#define PilatusThresholdAutoApplyString   "THRESHOLD_AUTO_APPLY"
 
#define PilatusEnergyString   "ENERGY"
 
#define PilatusArmedString   "ARMED"
 
#define PilatusResetPowerString   "RESET_POWER"
 
#define PilatusResetPowerTimeString   "RESET_POWER_TIME"
 
#define PilatusImageFileTmotString   "IMAGE_FILE_TMOT"
 
#define PilatusBadPixelFileString   "BAD_PIXEL_FILE"
 
#define PilatusNumBadPixelsString   "NUM_BAD_PIXELS"
 
#define PilatusFlatFieldFileString   "FLAT_FIELD_FILE"
 
#define PilatusMinFlatFieldString   "MIN_FLAT_FIELD"
 
#define PilatusFlatFieldValidString   "FLAT_FIELD_VALID"
 
#define PilatusGapFillString   "GAP_FILL"
 
#define PilatusWavelengthString   "WAVELENGTH"
 
#define PilatusEnergyLowString   "ENERGY_LOW"
 
#define PilatusEnergyHighString   "ENERGY_HIGH"
 
#define PilatusDetDistString   "DET_DIST"
 
#define PilatusDetVOffsetString   "DET_VOFFSET"
 
#define PilatusBeamXString   "BEAM_X"
 
#define PilatusBeamYString   "BEAM_Y"
 
#define PilatusFluxString   "FLUX"
 
#define PilatusFilterTransmString   "FILTER_TRANSM"
 
#define PilatusStartAngleString   "START_ANGLE"
 
#define PilatusAngleIncrString   "ANGLE_INCR"
 
#define PilatusDet2thetaString   "DET_2THETA"
 
#define PilatusPolarizationString   "POLARIZATION"
 
#define PilatusAlphaString   "ALPHA"
 
#define PilatusKappaString   "KAPPA"
 
#define PilatusPhiString   "PHI"
 
#define PilatusPhiIncrString   "PHI_INCR"
 
#define PilatusChiString   "CHI"
 
#define PilatusChiIncrString   "CHI_INCR"
 
#define PilatusOmegaString   "OMEGA"
 
#define PilatusOmegaIncrString   "OMEGA_INCR"
 
#define PilatusOscillAxisString   "OSCILL_AXIS"
 
#define PilatusNumOscillString   "NUM_OSCILL"
 
#define PilatusPixelCutOffString   "PIXEL_CUTOFF"
 
#define PilatusThTemp0String   "TH_TEMP_0"
 
#define PilatusThTemp1String   "TH_TEMP_1"
 
#define PilatusThTemp2String   "TH_TEMP_2"
 
#define PilatusThHumid0String   "TH_HUMID_0"
 
#define PilatusThHumid1String   "TH_HUMID_1"
 
#define PilatusThHumid2String   "TH_HUMID_2"
 
#define PilatusTvxVersionString   "TVXVERSION"
 
#define PilatusCbfTemplateFileString   "CBFTEMPLATEFILE"
 
#define PilatusHeaderStringString   "HEADERSTRING"
 
#define FIRST_PILATUS_PARAM   PilatusDelayTime
 

Enumerations

enum  PilatusTriggerMode {
  TMInternal, TMExternalEnable, TMExternalTrigger, TMMultipleExternalTrigger,
  TMAlignment
}
 Trigger modes. More...
 

Functions

int pilatusDetectorConfig (const char *portName, const char *camserverPort, int maxSizeX, int maxSizeY, int maxBuffers, size_t maxMemory, int priority, int stackSize)
 
 epicsExportRegistrar (pilatusDetectorRegister)
 

Macro Definition Documentation

◆ ASYN_POLL_TIME

#define ASYN_POLL_TIME   .01

Time to poll when reading from camserver.

◆ CAMSERVER_ACQUIRE_TIMEOUT

#define CAMSERVER_ACQUIRE_TIMEOUT   10.

Additional time to wait for a camserver response after the acquire should be complete.

◆ CAMSERVER_DEFAULT_TIMEOUT

#define CAMSERVER_DEFAULT_TIMEOUT   1.0

◆ CAMSERVER_RESET_POWER_TIMEOUT

#define CAMSERVER_RESET_POWER_TIMEOUT   30.

◆ DRIVER_MODIFICATION

#define DRIVER_MODIFICATION   0

◆ DRIVER_REVISION

#define DRIVER_REVISION   6

◆ DRIVER_VERSION

#define DRIVER_VERSION   2

◆ FILE_READ_DELAY

#define FILE_READ_DELAY   .01

Time between checking to see if image file is complete.

◆ FIRST_PILATUS_PARAM

#define FIRST_PILATUS_PARAM   PilatusDelayTime

◆ MAX_BAD_PIXELS

#define MAX_BAD_PIXELS   100

◆ MAX_FILENAME_LEN

#define MAX_FILENAME_LEN   256

◆ MAX_HEADER_STRING_LEN

#define MAX_HEADER_STRING_LEN   68

◆ MAX_MESSAGE_SIZE

#define MAX_MESSAGE_SIZE   256

Messages to/from camserver.

◆ PilatusAlphaString

#define PilatusAlphaString   "ALPHA"

◆ PilatusAngleIncrString

#define PilatusAngleIncrString   "ANGLE_INCR"

◆ PilatusArmedString

#define PilatusArmedString   "ARMED"

◆ PilatusBadPixelFileString

#define PilatusBadPixelFileString   "BAD_PIXEL_FILE"

◆ PilatusBeamXString

#define PilatusBeamXString   "BEAM_X"

◆ PilatusBeamYString

#define PilatusBeamYString   "BEAM_Y"

◆ PilatusCbfTemplateFileString

#define PilatusCbfTemplateFileString   "CBFTEMPLATEFILE"

◆ PilatusChiIncrString

#define PilatusChiIncrString   "CHI_INCR"

◆ PilatusChiString

#define PilatusChiString   "CHI"

◆ PilatusDelayTimeString

#define PilatusDelayTimeString   "DELAY_TIME"

◆ PilatusDet2thetaString

#define PilatusDet2thetaString   "DET_2THETA"

◆ PilatusDetDistString

#define PilatusDetDistString   "DET_DIST"

◆ PilatusDetVOffsetString

#define PilatusDetVOffsetString   "DET_VOFFSET"

◆ PilatusEnergyHighString

#define PilatusEnergyHighString   "ENERGY_HIGH"

◆ PilatusEnergyLowString

#define PilatusEnergyLowString   "ENERGY_LOW"

◆ PilatusEnergyString

#define PilatusEnergyString   "ENERGY"

◆ PilatusFilterTransmString

#define PilatusFilterTransmString   "FILTER_TRANSM"

◆ PilatusFlatFieldFileString

#define PilatusFlatFieldFileString   "FLAT_FIELD_FILE"

◆ PilatusFlatFieldValidString

#define PilatusFlatFieldValidString   "FLAT_FIELD_VALID"

◆ PilatusFluxString

#define PilatusFluxString   "FLUX"

◆ PilatusGapFillString

#define PilatusGapFillString   "GAP_FILL"

◆ PilatusHeaderStringString

#define PilatusHeaderStringString   "HEADERSTRING"

◆ PilatusImageFileTmotString

#define PilatusImageFileTmotString   "IMAGE_FILE_TMOT"

◆ PilatusKappaString

#define PilatusKappaString   "KAPPA"

◆ PilatusMinFlatFieldString

#define PilatusMinFlatFieldString   "MIN_FLAT_FIELD"

◆ PilatusNumBadPixelsString

#define PilatusNumBadPixelsString   "NUM_BAD_PIXELS"

◆ PilatusNumOscillString

#define PilatusNumOscillString   "NUM_OSCILL"

◆ PilatusOmegaIncrString

#define PilatusOmegaIncrString   "OMEGA_INCR"

◆ PilatusOmegaString

#define PilatusOmegaString   "OMEGA"

◆ PilatusOscillAxisString

#define PilatusOscillAxisString   "OSCILL_AXIS"

◆ PilatusPhiIncrString

#define PilatusPhiIncrString   "PHI_INCR"

◆ PilatusPhiString

#define PilatusPhiString   "PHI"

◆ PilatusPixelCutOffString

#define PilatusPixelCutOffString   "PIXEL_CUTOFF"

◆ PilatusPolarizationString

#define PilatusPolarizationString   "POLARIZATION"

◆ PilatusResetPowerString

#define PilatusResetPowerString   "RESET_POWER"

◆ PilatusResetPowerTimeString

#define PilatusResetPowerTimeString   "RESET_POWER_TIME"

◆ PilatusStartAngleString

#define PilatusStartAngleString   "START_ANGLE"

◆ PilatusThHumid0String

#define PilatusThHumid0String   "TH_HUMID_0"

◆ PilatusThHumid1String

#define PilatusThHumid1String   "TH_HUMID_1"

◆ PilatusThHumid2String

#define PilatusThHumid2String   "TH_HUMID_2"

◆ PilatusThresholdApplyString

#define PilatusThresholdApplyString   "THRESHOLD_APPLY"

◆ PilatusThresholdAutoApplyString

#define PilatusThresholdAutoApplyString   "THRESHOLD_AUTO_APPLY"

◆ PilatusThresholdString

#define PilatusThresholdString   "THRESHOLD"

◆ PilatusThTemp0String

#define PilatusThTemp0String   "TH_TEMP_0"

◆ PilatusThTemp1String

#define PilatusThTemp1String   "TH_TEMP_1"

◆ PilatusThTemp2String

#define PilatusThTemp2String   "TH_TEMP_2"

◆ PilatusTvxVersionString

#define PilatusTvxVersionString   "TVXVERSION"

◆ PilatusWavelengthString

#define PilatusWavelengthString   "WAVELENGTH"

Enumeration Type Documentation

◆ PilatusTriggerMode

Trigger modes.

Enumerator
TMInternal 
TMExternalEnable 
TMExternalTrigger 
TMMultipleExternalTrigger 
TMAlignment 

Function Documentation

◆ epicsExportRegistrar()

epicsExportRegistrar ( pilatusDetectorRegister  )

◆ pilatusDetectorConfig()

int pilatusDetectorConfig ( const char *  portName,
const char *  camserverPort,
int  maxSizeX,
int  maxSizeY,
int  maxBuffers,
size_t  maxMemory,
int  priority,
int  stackSize 
)