/home/epics/devel/areaDetector/1-5/ADApp/firewireWinSrc/firewireWinDCAM.cpp File Reference

#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <epicsString.h>
#include <epicsTime.h>
#include <epicsThread.h>
#include <epicsEvent.h>
#include <epicsEndian.h>
#include <iocsh.h>
#include <epicsExport.h>
#include <ADDriver.h>
#include <stdafx.h>
#include <1394Camera.h>

Classes

class  FirewireWinDCAM
 Main driver class inherited from areaDetectors ADDriver class. More...

Defines

#define ERR(errCode)   if (errCode != 0) fprintf(stderr, "ERROR [%s:%d]: dc1394 code: %d\n", __FILE__, __LINE__, errCode)
 firewireWinDCAM.cpp This is areaDetector driver support for firewire cameras that comply with the IIDC DCAM protocol.
#define PERR(pasynUser, errCode)   this->err(pasynUser, errCode, __LINE__)
 Convenience macro to be used inside the firewireDCAM class.
#define MAX_1394_BUFFERS   6
#define MAX_1394_VIDEO_FORMATS   8
#define MAX_1394_VIDEO_MODES   8
#define MAX_1394_FRAME_RATES   8
#define MAX(x, y)   ((x)>(y)?(x):(y))
#define FDC_N_PARAMS   (sizeof( FDCParamString)/ sizeof(FDCParamString[0]))
 Number of asyn parameters (asyn commands) this driver supports.

Enumerations

enum  FDCParam_t {
  FDC_feat_val = ADLastStdParam, FDC_feat_val_max, FDC_feat_val_min, FDC_feat_val_abs,
  FDC_feat_val_abs_max, FDC_feat_val_abs_min, FDC_feat_mode, FDC_feat_available,
  FDC_feat_absolute, FDC_format, FDC_mode, FDC_framerate,
  FDC_colorcode, FDC_valid_format, FDC_valid_mode, FDC_valid_framerate,
  FDC_valid_colorcode, FDC_has_format, FDC_has_mode, FDC_has_framerate,
  FDC_has_colorcode, FDC_current_format, FDC_current_mode, FDC_current_framerate,
  FDC_current_colorcode, ADLastDriverParam
}
 Specific asyn commands for this support module. More...

Functions

int WinFDC_Config (const char *portName, const char *camid, int maxBuffers, size_t maxMemory, int priority, int stackSize)
 Configuration function to configure one camera.
 epicsExportRegistrar (firewireWinDCAMRegister)

Define Documentation

#define ERR ( errCode   )     if (errCode != 0) fprintf(stderr, "ERROR [%s:%d]: dc1394 code: %d\n", __FILE__, __LINE__, errCode)

firewireWinDCAM.cpp This is areaDetector driver support for firewire cameras that comply with the IIDC DCAM protocol.

This implements the FirewireWinDCAM class which inherits from the areaDetector ADDriver class.

The driver uses the 1394Camera library from Carnegie-Mellon University

Created: March 2009 Print an errorcode to stderr. Convenience macro to be used when an asynUser is not yet available.

#define FDC_N_PARAMS   (sizeof( FDCParamString)/ sizeof(FDCParamString[0]))

Number of asyn parameters (asyn commands) this driver supports.

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

#define MAX_1394_BUFFERS   6

#define MAX_1394_FRAME_RATES   8

#define MAX_1394_VIDEO_FORMATS   8

#define MAX_1394_VIDEO_MODES   8

#define PERR ( pasynUser,
errCode   )     this->err(pasynUser, errCode, __LINE__)

Convenience macro to be used inside the firewireDCAM class.


Enumeration Type Documentation

enum FDCParam_t

Specific asyn commands for this support module.

These will be used and managed by the parameter library (part of areaDetector).

Enumerator:
FDC_feat_val 
FDC_feat_val_max  Feature value (int32 read/write) addr: 0-17.
FDC_feat_val_min  Feature maximum boundry value (int32 read) addr: 0-17.
FDC_feat_val_abs  Feature minimum boundry value (int32 read) addr: 0-17.
FDC_feat_val_abs_max  Feature absolute value (float64 read/write) addr: 0-17.
FDC_feat_val_abs_min  Feature absolute maximum boundry value (float64 read) addr: 0-17.
FDC_feat_mode  Feature absolute minimum boundry value (float64 read) addr: 0-17.
FDC_feat_available  Feature control mode: 0:manual or 1:automatic (camera controlled) (int32 read/write).
FDC_feat_absolute  Is a given featurea available in the camera 1=available 0=not available (int32, read).
FDC_format  Feature has absolute (floating point) controls available 1=available 0=not available (int32 read).
FDC_mode  Set and read back the video format (int32 (enums) read/write).
FDC_framerate  Set and read back the video mode (int32 (enums) read/write).
FDC_colorcode  Set and read back the frame rate (int32 (enums) read/write).
FDC_valid_format  Set and read back the color code (int32 (enums) read/write).
FDC_valid_mode  Read back the valid video formats (octet, read).
FDC_valid_framerate  Read back the valid video modes (octet, read).
FDC_valid_colorcode  Read back the valid frame rates (octet, read).
FDC_has_format  Read back the valid color codes (octet, read).
FDC_has_mode  Read back whether video format is supported (int32, read).
FDC_has_framerate  Read back whether video mode is supported (int32, read).
FDC_has_colorcode  Read back whether video framerate is supported (int32, read).
FDC_current_format  Read back whether color code is supported (int32, read).
FDC_current_mode  Read back the current video format (octet, read).
FDC_current_framerate  Read back the current video mode (octet, read).
FDC_current_colorcode  Read back the current frame rate (octet, read).
ADLastDriverParam  Read back the current color mcde (octet, read).


Function Documentation

epicsExportRegistrar ( firewireWinDCAMRegister   ) 

int WinFDC_Config ( const char *  portName,
const char *  camid,
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 FirewireWinDCAM class.

Parameters:
[in] portName Asyn port name to assign to the camera.
[in] camid The camera ID or serial number in a hexadecimal string. Lower case and upper case letters can be used. This is used to identify a specific camera on the bus. For instance: "0x00b09d01007139d0". If this parameter is empty ("") then the first camera found on the Firewire bus will be used.
[in] maxBuffers Maxiumum 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. Use -1 for unlimited.
[in] maxMemory Maximum 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). Use -1 for unlimited.
[in] priority The EPICS thread priority for this driver. 0=use asyn default.
[in] stackSize The size of the stack for the EPICS port thread. 0=use asyn default.


Generated on Tue Aug 25 16:53:03 2009 for areaDetector by  doxygen 1.5.7.1