areaDetector
3-13
EPICS areaDetector framework
|
pco.cpp Area Detector Driver for PCO cameras that use Camera Link Inherite ADCameraLink to provide Image Grabbing functions. More...
#include <pco.h>
Public Member Functions | |
pco (const char *portName, const char *pcoPort, int maxBuffers, size_t maxMemory, int priority, int stackSize) | |
Constructor for pco driver; most parameters are simply passed to ADDriver::ADDriver. More... | |
virtual asynStatus | writeInt32 (asynUser *pasynUser, epicsInt32 value) |
Called when asyn clients call pasynInt32->write(). More... | |
virtual asynStatus | writeFloat64 (asynUser *pasynUser, epicsFloat64 value) |
Called when asyn clients call pasynFloat64->write(). More... | |
virtual void | report (FILE *fp, int details) |
Report status of the driver. More... | |
void | pcoTask () |
This should be private but is called from C, must be public. More... | |
void | pcoTask2 () |
This should be private but is called from C, must be public. More... | |
Public Attributes | |
epicsEventId | stopEventId |
This should be private but is accessed from C, must be public. More... | |
Protected Types | |
enum | { pco_paramint , pco_paramdoub } |
enum | whichPCOCam { pco_dimax , pco_edge , pco_other , pco_undef } |
Protected Member Functions | |
virtual void | setDebuggingMessage (int level) |
Set debugging message level. More... | |
void | reconfigGrabber (void) |
Reconfig grabber on the pco serial thread. More... | |
void | checkEdgeDescramble (NDArray *img_ptr) |
Check image to see if edge descrambling work correctly. More... | |
virtual void | processNewImage (void *img_ptr) |
Called when new image comes from grabber. More... | |
virtual void | keepHouse (void) |
called every serial thraed loop. More... | |
int | updateParameters (asynUser *pasynUser, epicsInt32 ivalue, epicsFloat64 dvalue, int paramtype) |
Called by asyn writeInt32 and writeDouble, which pass the pasynuser and vales etc. More... | |
virtual int | doSerialTransactions (int function, int ivalue, double dvalue, int paramtype) |
Main called by updateParams, and ultimately writeInt32, writeDouble. More... | |
virtual void | clearPipe (FILE *fp) |
Read serial port until nothing in pipe. More... | |
int | getlib (void) |
Deprecated. More... | |
int | OpenCamera (void) |
Open serial port to camera, set up serial port. More... | |
int | Disconnected (int code, char *usrmsg) |
Close serial port. More... | |
void | resetDimaxMemory (void) |
Reset Dimax memory to default settings, erasing all frames and segment sizes. More... | |
int | checkCameraMessages (void) |
See if there are any messages pending from camera. More... | |
int | setPcoBaudrate (int function) |
Set pco baud rate. More... | |
int | ReportError (int code, char *usrmsg) |
report error from camera. More... | |
int | doSerialCommand (pco_command &cmd, pco_response &rsp, unsigned char *obj, int len) |
Send pco command, and recv. More... | |
int | getPcoStatusParams (void) |
PCO settings are defined in PCO docs. More... | |
int | setPcoCameraLinkParams (int function) |
PCO settings are defined in PCO docs. More... | |
int | getPcoCameraLinkParams (void) |
PCO settings are defined in PCO docs. More... | |
int | getPcoGeneralParams (void) |
Get pco general settings, as defined in pco docs. More... | |
int | setPcoGeneralParams (int function) |
Given asyn param number from writeInt32, the param number, write pco general param according to function. More... | |
int | getPcoSensorParams (void) |
Read many sensor params from camera via serial port. More... | |
int | setPcoSensorParams (int function) |
set pco sensor param defined in functino, the asyn param from writeInt32 send setting via serial port. More... | |
int | getPcoTimingParams (void) |
Read PCO image timing params from camera. More... | |
int | setPcoTimingParams (int function) |
PCO settings are defined in PCO docs. More... | |
int | getPcoStorageParams (void) |
PCO settings are defined in PCO docs. More... | |
int | setPcoStorageParams (int function) |
PCO settings are defined in PCO docs. More... | |
int | getPcoRecordingParams (void) |
PCO settings are defined in PCO docs. More... | |
int | setPcoRecordingParams (int function) |
PCO settings are defined in PCO docs. More... | |
int | setPcoImageReadParams (int function) |
Get function from writeInt32, which param. More... | |
int | getPcoImageReadParams (void) |
PCO settings are defined in PCO docs. More... | |
int | dumpOneFrame (int k) |
Get ONE frame from dimax RAM. More... | |
void | dumpCameraMemory (void) |
Read out all images from dimax RAM over CL grabber. More... | |
int | doHighLevelParams (int function) |
High level parameters are things like ADAcquire. More... | |
void | dbgSerial (void) |
Debugging function- Deprecated. More... | |
void | checkEdgeDescramble (void *img_ptr) |
int | intFlEndian (unsigned int in) |
flip endian of images from camera. More... | |
Static Protected Attributes | |
static char | dll_name [] |
pco.cpp Area Detector Driver for PCO cameras that use Camera Link Inherite ADCameraLink to provide Image Grabbing functions.
this class addes all the commands/control that is sent over serial port on CL grabber.
|
protected |
pco::pco | ( | const char * | portName, |
const char * | serverPort, | ||
int | maxBuffers, | ||
size_t | maxMemory, | ||
int | priority, | ||
int | stackSize | ||
) |
Constructor for pco driver; most parameters are simply passed to ADDriver::ADDriver.
After calling the base class constructor this method creates a thread to collect the detector data, and sets reasonable default values the parameters defined in this class, asynNDArrayDriver, and ADDriver.
[in] | portName | The name of the asyn port driver to be created. |
[in] | serverPort | The name of the asyn port driver previously created with drvAsynIPPortConfigure connected to the pco_server program. |
[in] | maxBuffers | The maximum number of NDArray buffers that the NDArrayPool for this driver is allowed to allocate. Set this to -1 to allow an unlimited number of buffers. |
[in] | maxMemory | The maximum amount of memory that the NDArrayPool for this driver is allowed to allocate. Set this to -1 to allow an unlimited amount of memory. |
[in] | priority | The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags. |
[in] | stackSize | The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags. |
init all params or else the client will not see them...they will be undefined...
init all params or else the client will not see them...they will be undefined...
|
protected |
See if there are any messages pending from camera.
|
protected |
Check image to see if edge descrambling work correctly.
img_ptr | Pointer to NDArray to descramble. |
|
protected |
|
protectedvirtual |
Read serial port until nothing in pipe.
For clearing errors etc. Deprecated function.
fp | Pointer to serial port, assuming it is opened w/ fopen. |
|
protected |
Debugging function- Deprecated.
|
protected |
Close serial port.
code | Not used |
usrmsg | Not used |
|
protected |
High level parameters are things like ADAcquire.
The idea of a high level param is that when set, it will set many low level params in the camera. To Acquire for example, about 5 low level settins in the camera must be tweaked.
function | from writeInt32, the parm numb. |
! setDoubleParam(pco_set_frame_rate,20.0);
|
protected |
Send pco command, and recv.
serial command from serial port.
cmd- | command to pco. |
rsp- | response to pco. It is filled in by this funciton. |
obj- | any raw binary data returned |
len- | len of raw binary data. |
|
protectedvirtual |
Main called by updateParams, and ultimately writeInt32, writeDouble.
also called by pcoTask periodically.
function- | param num. |
ivalue- | param val if int. |
dvalue= | param val if double |
paramtype- | enum if doubl or int. not used I think. |
! need to actuallty reconfig here!!!
! put this into a task
|
protected |
Read out all images from dimax RAM over CL grabber.
We must run on a thread, the seriao port thread, which is separate from the asynDriver thread on which writeInt32 runs. This function sends commmand via serial port to camera to get ONE image. Then it waits for image to show uip on grabber. then it does again and again in a loop until all iamges read out. It must be on separate thread so the writeInt32 does not block for minutes.
|
protected |
Get ONE frame from dimax RAM.
Just send the serial message to pco dimax to send next frame.
k | which frame number to return. |
! need to do eqv of waitDone(1000);
|
protected |
Deprecated.
|
protected |
PCO settings are defined in PCO docs.
Because so many, we group them as categories folling the pco docs. If functino is called get, we read serial port from camera and set a param. If function called set, we read a param from asyn param list and send its value to the camera.
|
protected |
Get pco general settings, as defined in pco docs.
set asyn params accordingly.
|
protected |
PCO settings are defined in PCO docs.
Because so many, we group them as categories folling the pco docs. If functino is called get, we read serial port from camera and set a param. If function called set, we read a param from asyn param list and send its value to the camera.
|
protected |
PCO settings are defined in PCO docs.
Because so many, we group them as categories folling the pco docs. If functino is called get, we read serial port from camera and set a param. If function called set, we read a param from asyn param list and send its value to the camera.
!
|
protected |
Read many sensor params from camera via serial port.
update asyn params accordingly.
|
protected |
PCO settings are defined in PCO docs.
Because so many, we group them as categories folling the pco docs. If functino is called get, we read serial port from camera and set a param. If function called set, we read a param from asyn param list and send its value to the camera.
|
protected |
PCO settings are defined in PCO docs.
Because so many, we group them as categories folling the pco docs. If functino is called get, we read serial port from camera and set a param. If function called set, we read a param from asyn param list and send its value to the camera.
|
protected |
Read PCO image timing params from camera.
set asyn params appropriately.
|
protected |
flip endian of images from camera.
|
protectedvirtual |
called every serial thraed loop.
does nothing.
|
protected |
Open serial port to camera, set up serial port.
void pco::pcoTask | ( | ) |
This should be private but is called from C, must be public.
Run on thread, monitor camera status over serial port.
if we never owned it, then it just errors.. who cares.
void pco::pcoTask2 | ( | ) |
This should be private but is called from C, must be public.
Deprecated.
|
protectedvirtual |
Called when new image comes from grabber.
can descramble if enabled for Edge camera. Can test pixels for repeated images. It takes a line of pixels whcih shoudl be noise, and compares to previous image. if same, then noise is not noise, and we have repeated frames.
|
protected |
Reconfig grabber on the pco serial thread.
It must grab the grabber mutex from the grabber thread before messing w./ grabber. we assume we already have the serial port mutex. Yes- there are 2 mutexes. Serial port and grabber.
! need to load ccf here
! must open here
! must do here
! must do here
|
virtual |
Report status of the driver.
Prints details about the driver if details>0. It then calls the ADDriver::report() method.
[in] | fp | File pointed passed by caller where the output is written to. |
[in] | details | If >0 then driver details are printed. |
|
protected |
report error from camera.
Prob. deprecated.
code | returned code from pco camera |
usrmsg | C string for a user defined error message. |
|
protected |
Reset Dimax memory to default settings, erasing all frames and segment sizes.
|
protectedvirtual |
Set debugging message level.
deprecated as we use asyn to do this
|
protected |
Set pco baud rate.
function | asyn param number, should be pco_baudrate or pco_setallparams |
|
protected |
PCO settings are defined in PCO docs.
Because so many, we group them as categories folling the pco docs. If functino is called get, we read serial port from camera and set a param. If function called set, we read a param from asyn param list and send its value to the camera.
function | - asyn Parameter number from writeInt32. |
|
protected |
Given asyn param number from writeInt32, the param number, write pco general param according to function.
function | - asyn param. |
|
protected |
Get function from writeInt32, which param.
Read that param from camera. PCO settings are defined in PCO docs. Because so many, we group them as categories folling the pco docs. The param defined in fucntion will be set from camera settings, or sent to camera settings on hardware ,depending on if the functino is named ReadParams, or WriteParams.
function | -asyn parameter number. |
! image dump must be on a task so we can cancel it
|
protected |
PCO settings are defined in PCO docs.
Because so many, we group them as categories folling the pco docs. If functino is called get, we read serial port from camera and set a param. If function called set, we read a param from asyn param list and send its value to the camera.
function- | param number from writeInt32. |
! set date time...
|
protected |
set pco sensor param defined in functino, the asyn param from writeInt32 send setting via serial port.
function | asyn param number |
! need better way to do this.
!sizex=getIntParam(ADSizeX); !sizex = sizex - (sizex % (2*magic_number)); !int maxsizex=getIntParam(ADMaxSizeX); !x0 = 1; !x1 = sizex;
|
protected |
PCO settings are defined in PCO docs.
Because so many, we group them as categories folling the pco docs. If functino is called get, we read serial port from camera and set a param. If function called set, we read a param from asyn param list and send its value to the camera.
function- | param number from writeInt32. |
|
protected |
PCO settings are defined in PCO docs.
Because so many, we group them as categories folling the pco docs. If functino is called get, we read serial port from camera and set a param. If function called set, we read a param from asyn param list and send its value to the camera.
function- | param number from writeInt32. |
|
protected |
Called by asyn writeInt32 and writeDouble, which pass the pasynuser and vales etc.
to this function. Because so many parameters, the param setting is split into many functions.
pasynUser | The standard pasynUser pointer from asyn. |
ivalue- | param val if an int. |
dvalue- | param val if a double. |
paramtype- | enum for double or int. Deprecated and not used. |
|
virtual |
Called when asyn clients call pasynFloat64->write().
This function performs actions for some parameters. For all parameters it sets the value in the parameter library and calls any registered callbacks..
[in] | pasynUser | pasynUser structure that encodes the reason and address. |
[in] | value | Value to write. |
|
virtual |
Called when asyn clients call pasynInt32->write().
This function performs actions for some parameters, including ADAcquire, ADBinX, etc. For all parameters it sets the value in the parameter library and calls any registered callbacks..
[in] | pasynUser | pasynUser structure that encodes the reason and address. |
[in] | value | Value to write. |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
! need to put into cpp- double
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
!
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
! need to put into cpp- int
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
!
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
epicsEventId pco::stopEventId |
This should be private but is accessed from C, must be public.
|
protected |
|
protected |
|
protected |
|
protected |