Skip to content

Commit

Permalink
Merge pull request #20 from sliakat/master
Browse files Browse the repository at this point in the history
Updated documentation, headers, support for 18-bit detectors
  • Loading branch information
MarkRivers authored Jul 10, 2023
2 parents 4b23749 + cb172ed commit 5321c41
Show file tree
Hide file tree
Showing 10 changed files with 1,199 additions and 568 deletions.
File renamed without changes.
107 changes: 48 additions & 59 deletions PICamApp/src/ADPICam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,66 +167,52 @@ ADPICam::ADPICam(const char *portName, int maxBuffers, size_t maxMemory,

ADPICam_Instance = this;

//Open First available camera. If no camera is available,
// then open a demo camera
error = Picam_OpenFirstCamera(&currentCameraHandle);

if (error != PicamError_None) {
if (error == PicamError_NoCamerasAvailable) {
error = Picam_ConnectDemoCamera(PicamModel_Quadro4320,
"CamNotFoundOnInit", &demoId);
if (error != PicamError_None) {
Picam_GetEnumerationString(PicamEnumeratedType_Error,
error,
&errorString);
const char *demoModelName;
Picam_GetEnumerationString(PicamEnumeratedType_Model,
PicamModel_Quadro4320,
&demoModelName);
asynPrint(pasynUserSelf, ASYN_TRACE_ERROR,
"-------------------------------------------------\n"
"No detectors were available and cannot connect to "
"demo camera %s. Cannot run without a detector. \n"
"Error=%s \n"
"-------------------------------------------------\n",
demoModelName,
errorString);
Picam_DestroyString(demoModelName);
Picam_DestroyString(errorString);
return;
}
error = Picam_OpenFirstCamera(&currentCameraHandle);
if (error != PicamError_None) {
Picam_GetEnumerationString(PicamEnumeratedType_Error,
error,
&errorString);
const char *demoModelName;
Picam_GetEnumerationString(PicamEnumeratedType_Model,
PicamModel_Quadro4320,
&demoModelName);
asynPrint(pasynUserSelf, ASYN_TRACE_ERROR,
"------------------------------------------------\n"
"Trouble opening demo camera %s \n%s"
"------------------------------------------------\n",
demoModelName, errorString);
Picam_DestroyString(demoModelName);
Picam_DestroyString(errorString);
return;
}
} else {
Picam_GetEnumerationString(PicamEnumeratedType_Error, error,
&errorString);
asynPrint(pasynUserSelf, ASYN_TRACE_ERROR,
"------------------------------------------------\n"
"%s:%s Unhandled Error opening first camera: %s\n"
"------------------------------------------------\n",
driverName,
functionName,
errorString);
Picam_DestroyString(errorString);
return;
/*
Connect a SOPHIA 2048BX virtual camera to load -- if no physical camera
is plugged in when Available Cameras are generated, the virtual camera
gets used.
*/
PicamModel demoToConnect = PicamModel_Sophia2048BExcelon;
error = Picam_ConnectDemoCamera(demoToConnect,
"CamNotFoundOnInit", &demoId);
if (error != PicamError_None) {
Picam_GetEnumerationString(PicamEnumeratedType_Error,
error,
&errorString);
const char *demoModelName;
Picam_GetEnumerationString(PicamEnumeratedType_Model,
demoToConnect,
&demoModelName);
asynPrint(pasynUserSelf, ASYN_TRACE_ERROR,
"-------------------------------------------------\n"
"Cannot connect to demo camera %s."
"Cannot run without a detector.\n"
"Error=%s \n"
"-------------------------------------------------\n",
demoModelName,
errorString);
Picam_DestroyString(demoModelName);
Picam_DestroyString(errorString);
return;
}
error = Picam_OpenCamera(&demoId, &currentCameraHandle);
if (error != PicamError_None) {
Picam_GetEnumerationString(PicamEnumeratedType_Error,
error,
&errorString);
const char *demoModelName;
Picam_GetEnumerationString(PicamEnumeratedType_Model,
demoToConnect,
&demoModelName);
asynPrint(pasynUserSelf, ASYN_TRACE_ERROR,
"------------------------------------------------\n"
"Trouble opening demo camera %s \n%s"
"------------------------------------------------\n",
demoModelName, errorString);
Picam_DestroyString(demoModelName);
Picam_DestroyString(errorString);
return;
}
}
PicamAdvanced_GetCameraDevice(currentCameraHandle, &currentDeviceHandle);
selectedCameraIndex = 0;
createParam(PICAM_VersionNumberString, asynParamOctet,
Expand Down Expand Up @@ -1717,6 +1703,9 @@ asynStatus ADPICam::piAcquireStart(){
case PicamPixelFormat_Monochrome16Bit:
imageDataType = NDUInt16;
break;
case PicamPixelFormat_Monochrome32Bit:
imageDataType = NDUInt32;
break;
default:
imageDataType = NDUInt16;
const char *pixelFormatString;
Expand Down
21 changes: 12 additions & 9 deletions PICamSupport/README.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
PICAM is a C++ library provided by Princeton Instruments, a division of Roper
Scientific, Inc. This library provides a common API to drive a number of
cameras from Princeton Instruments. This library is freely available,
PICAM is a C++ library provided by Teledyne Princeton Instruments,
a business unit of Teledyne Digital Imaging, US.

This library provides a common API to drive a number of
cameras from Teledyne Princeton Instruments. This library is freely available,
downloadable, and redistributable. We have included header and library files
here for version 2.8.1.1408 as a convenience for building the EPICS areaDetector
here for version 5.13.3.2211 as a convenience for building the EPICS areaDetector
driver.

Princeton Instruments provides up to date versions of the PICAM driver library
Teledyne Princeton Instruments provides up to date versions of the PICAM driver library
on their website and would prefer users to install directly from their site.

The latest version of PICAM is available from this URL:
ftp://ftp.piacton.com/Public/Software/Official/PICam/
The latest version of PICAM is available from these URLs:
Linux: https://cdn.princetoninstruments.com/picam/picam_sdk.run
Windows: https://cdn.princetoninstruments.com/picam/picam%20install.exe

And the Archives directory contains every other version released
ftp://ftp.piacton.com/Public/Software/Official/PICam/Archives/
You can contact pi.techsupport@teledyne.com to request installers for
specific versions of PICam.

Loading

0 comments on commit 5321c41

Please sign in to comment.