diff --git a/.ci-local/adcore_hook.sh b/.ci-local/adcore_hook.sh new file mode 100644 index 0000000..7b0eb76 --- /dev/null +++ b/.ci-local/adcore_hook.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +# This script installs ADCore R3-11 +# +# check if user has right permissions +if [ "$(id -u)" != "0" ]; then + echo "Sorry, you are not root. Please try again using sudo." + exit 1 +fi + +# terminate script after first line that fails +set -e + +if [ -z "$EPICS_HOST_ARCH" ] +then + EPICS_HOST_ARCH=linux-x86_64 +fi + +# The directory above +SUPPORT="$(dirname "${PWD}")" + +# This won't have been set yet on the ADCore pass. +ADCORE=$PWD + +# This file will have been written by ci-scripts cue.py +source $SUPPORT/RELEASE.local + +# Hack RELEASE_LIBS.local file +sed -i -e "/^ADCORE\s*=/ s,=.*,=$ADCORE," $AREA_DETECTOR/configure/RELEASE_LIBS.local + +# Hack RELEASE_PRODS.local file +sed -i -e "/^ADCORE\s*=/ s,=.*,=$ADCORE," $AREA_DETECTOR/configure/RELEASE_PRODS.local + +# These are example plugin files, but we will just use them +if [ ! -f $ADCORE/iocBoot/commonPlugins.cmd ]; then + cp $ADCORE/iocBoot/EXAMPLE_commonPlugins.cmd $ADCORE/iocBoot/commonPlugins.cmd +fi + +# Hack commonPlugins.cmd - we need sseq_settings.req, which is in the calc module +sed -i "s/#set_requestfile_path(\"\$(CALC)\/calcApp\/Db\")/set_requestfile_path(\"\$(CALC)\/calcApp\/Db\")/" $ADCORE/iocBoot/commonPlugins.cmd +if [ ! -f $ADCORE/iocBoot/commonPlugin_settings.req ]; then + cp $ADCORE/iocBoot/EXAMPLE_commonPlugin_settings.req $ADCORE/iocBoot/commonPlugin_settings.req +fi + +if [ "$WINE" == "64" ]; then + if [ ! -f /usr/bin/x86_64-w64-mingw32-g++-posix ]; then + apt-get install -y g++-mingw-w64-x86-64 + fi + # see https://github.com/randombit/botan/issues/2039 + update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix +elif [ "$WINE" == "32" ]; then + if [ ! -f /usr/bin/i686-w64-mingw32-g++-posix ]; then + apt-get install -y g++-mingw-w64-i686 + fi + update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix +fi + diff --git a/.ci-local/adpicam_install.sh b/.ci-local/adpicam_install.sh new file mode 100644 index 0000000..230553b --- /dev/null +++ b/.ci-local/adpicam_install.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# This script installs NDS and NDS-epics +# +# check if user has right permissions +if [ "$(id -u)" != "0" ]; then + echo "Sorry, you are not root. Please try again using sudo." + exit 1 +fi + +# terminate script after first line that fails +set -e + +apt-get install -y libreadline6-dev libncurses5-dev perl clang g++-mingw-w64-i686 g++-mingw-w64-x86-64 qemu-system-x86 re2c tar +apt-get install -y build-essential git python curl p7zip-full wget libxml2-dev + +export GITLAB_CI=1 +export SETUP_PATH=".ci-local:.ci" +export BASE_RECURSIVE="YES" +export CMP="gcc" +export BCFG="static" +export SET="stable" +export WINE=64 +export VV=1 +export CLEAN_DEPS="NO" +echo "PREPARE" > /tmp/adpicam_install.log +python .ci/cue.py prepare > /tmp/adpicam_install.log 2>&1 +echo "BUILD" > /tmp/adpicam_install.log +python .ci/cue.py build > /tmp/adpicam_install.log 2>&1 + diff --git a/.ci-local/adsupport_hook.sh b/.ci-local/adsupport_hook.sh new file mode 100644 index 0000000..f50bf9f --- /dev/null +++ b/.ci-local/adsupport_hook.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# This script configures ADSupport R1-9 +# +# check if user has right permissions +if [ "$(id -u)" != "0" ]; then + echo "Sorry, you are not root. Please try again using sudo." + exit 1 +fi + +# terminate script after first line that fails +set -e + +if [ -z "$EPICS_HOST_ARCH" ] +then + EPICS_HOST_ARCH=linux-x86_64 +fi +apt-get install -y libx11-dev libxext-dev + +# The directory above +SUPPORT="$(dirname "${PWD}")" + +# This won't have been set yet on the ADSupport pass. +ADSUPPORT=$PWD + +# This file will have been written by ci-scripts cue.py +source $SUPPORT/RELEASE.local + +# Hack RELEASE_LIBS.local file +sed -i -e "/^ADSUPPORT\s*=/ s,=.*,=$ADSUPPORT," $AREA_DETECTOR/configure/RELEASE_LIBS.local + +# Hack RELEASE_PRODS.local file +sed -i -e "/^ADSUPPORT\s*=/ s,=.*,=$ADSUPPORT," $AREA_DETECTOR/configure/RELEASE_PRODS.local + diff --git a/.ci-local/area_detector_hook.sh b/.ci-local/area_detector_hook.sh new file mode 100644 index 0000000..280b7bd --- /dev/null +++ b/.ci-local/area_detector_hook.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +# This script configures areadetector R3-11 +# +# check if user has right permissions +if [ "$(id -u)" != "0" ]; then + echo "Sorry, you are not root. Please try again using sudo." + exit 1 +fi + +# terminate script after first line that fails +set -e + +if [ -z "$EPICS_HOST_ARCH" ] +then + EPICS_HOST_ARCH=linux-x86_64 +fi +apt-get install -y libx11-dev libxext-dev + +# The directory above +SUPPORT="$(dirname "${PWD}")" + +# This won't have been set yet on the areaDetector pass. +AREA_DETECTOR=$PWD + +# This file will have been written by ci-scripts cue.py +source $SUPPORT/RELEASE.local + +pushd $AREA_DETECTOR/configure +echo "Copying from example." +./copyFromExample +popd + +#hack config_site.local +sed -i -e "/^WITH_PVA\s*=/ s,=.*,=YES," $AREA_DETECTOR/configure/CONFIG_SITE.local +sed -i -e "/^WITH_OPENCV\s*=/ s,=.*,=NO," $AREA_DETECTOR/configure/CONFIG_SITE.local +sed -i -e "/^WITH_QSRV\s*=/ s,=.*,=NO," $AREA_DETECTOR/configure/CONFIG_SITE.local +sed -i -e "/^WITH_BITSHUFFLE\s*=/ s,=.*,=NO," $AREA_DETECTOR/configure/CONFIG_SITE.local + +# EXAMPLE_CONFIG_SITE.local.linux-x86_64 sets WITH_BOOST. I don't wannit. +if [ -f $AREA_DETECTOR/configure/CONFIG_SITE.local.$EPICS_HOST_ARCH ]; then + rm $AREA_DETECTOR/configure/CONFIG_SITE.local.$EPICS_HOST_ARCH +fi + +# Hack RELEASE.local.linux-x86_64 file +# NB, this file currently points to ADPointGrey, ADEiger and ADAravis. +# I'm not installing these modules. +if [ -f $AREA_DETECTOR/configure/RELEASE.local.$EPICS_HOST_ARCH ]; then + rm $AREA_DETECTOR/configure/RELEASE.local.$EPICS_HOST_ARCH +fi +echo EPICS_BASE=$EPICS_BASE > $AREA_DETECTOR/configure/RELEASE.local + +# Hack RELEASE_LIBS.local file +sed -i -e "/^SUPPORT\s*=/ s,=.*,=$SUPPORT," $AREA_DETECTOR/configure/RELEASE_LIBS.local +sed -i -e "/^ASYN\s*=/ s,=.*,=$ASYN," $AREA_DETECTOR/configure/RELEASE_LIBS.local +sed -i -e "/^EPICS_BASE\s*=/ s,=.*,=$EPICS_BASE," $AREA_DETECTOR/configure/RELEASE_LIBS.local +sed -i -e "/^AREA_DETECTOR\s*=/ s,=.*,=$AREA_DETECTOR," $AREA_DETECTOR/configure/RELEASE_LIBS.local + +# Hack RELEASE_PRODS.local file +sed -i -e "/^SUPPORT\s*=/ s,=.*,=$SUPPORT," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^CALC\s*=/ s,=.*,=$CALC," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^BUSY\s*=/ s,=.*,=$BUSY," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^SSCAN\s*=/ s,=.*,=$SSCAN," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^AUTOSAVE\s*=/ s,=.*,=$AUTOSAVE," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^SNCSEQ\s*=/ s,=.*,=$SNCSEQ," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^EPICS_BASE\s*=/ s,=.*,=$EPICS_BASE," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^ASYN\s*=/ s,=.*,=$ASYN," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^AREA_DETECTOR\s*=/ s,=.*,=$AREA_DETECTOR," $AREA_DETECTOR/configure/RELEASE_PRODS.local + +# Don't think we need this. +sed -i "s/DEVIOCSTATS/#DEVIOCSTATS/g" $AREA_DETECTOR/configure/RELEASE_PRODS.local diff --git a/.ci-local/areadetector_install.sh b/.ci-local/areadetector_install.sh new file mode 100644 index 0000000..3cc0526 --- /dev/null +++ b/.ci-local/areadetector_install.sh @@ -0,0 +1,92 @@ +#!/bin/bash + +# This script installs areadetector R3-10 +# +# check if user has right permissions +if [ "$(id -u)" != "0" ]; then + echo "Sorry, you are not root. Please try again using sudo." + exit 1 +fi + +# terminate script after first line that fails +set -e + +if [ -z "$EPICS_HOST_ARCH" ] +then + EPICS_HOST_ARCH=linux-x86_64 +fi + +apt-get install -y libx11-dev libxext-dev + +EPICS_ROOT=/builds/DATAnet/adpicam +SUPPORT=$EPICS_ROOT/.cache + +# This won't have been set yet on the ADCore pass. +ADCORE=$PWD + +# This file will have been written by ci-scripts cue.py +source $SUPPORT/RELEASE.local +# The file needs to be copied into the areaDetector folder for sub-module build. +cp $SUPPORT/RELEASE.local $AREA_DETECTOR/ + +pushd $AREA_DETECTOR/configure +echo "Copying from example." +./copyFromExample +popd + +#hack config_site.local +sed -i -e "/^WITH_PVA\s*=/ s,=.*,=YES," $AREA_DETECTOR/configure/CONFIG_SITE.local +sed -i -e "/^WITH_OPENCV\s*=/ s,=.*,=NO," $AREA_DETECTOR/configure/CONFIG_SITE.local +sed -i -e "/^WITH_QSRV\s*=/ s,=.*,=NO," $AREA_DETECTOR/configure/CONFIG_SITE.local +sed -i -e "/^WITH_BITSHUFFLE\s*=/ s,=.*,=NO," $AREA_DETECTOR/configure/CONFIG_SITE.local + +# EXAMPLE_CONFIG_SITE.local.linux-x86_64 sets WITH_BOOST. I don't wannit. +if [ -f $AREA_DETECTOR/configure/CONFIG_SITE.local.$EPICS_HOST_ARCH ]; then + rm $AREA_DETECTOR/configure/CONFIG_SITE.local.$EPICS_HOST_ARCH +fi + +# Hack RELEASE.local file +sed -i -e "/^ADSUPPORT\s*=/ s,=.*,=$ADSUPPORT," $AREA_DETECTOR/configure/RELEASE.local + +# Hack RELEASE.local.linux-x86_64 file +# NB, this file currently points to ADPointGrey, ADEiger and ADAravis. +# I'm not installing these modules. +if [ -f $AREA_DETECTOR/configure/RELEASE.local.$EPICS_HOST_ARCH ]; then + rm $AREA_DETECTOR/configure/RELEASE.local.$EPICS_HOST_ARCH +fi +echo EPICS_BASE=$EPICS_BASE > $AREA_DETECTOR/configure/RELEASE.local + +# Hack RELEASE_LIBS file +sed -i -e "/^SUPPORT\s*=/ s,=.*,=$SUPPORT," $AREA_DETECTOR/configure/RELEASE_LIBS.local +sed -i -e "/^ASYN\s*=/ s,=.*,=$ASYN," $AREA_DETECTOR/configure/RELEASE_LIBS.local +sed -i -e "/^EPICS_BASE\s*=/ s,=.*,=$EPICS_BASE," $AREA_DETECTOR/configure/RELEASE_LIBS.local +sed -i -e "/^AREA_DETECTOR\s*=/ s,=.*,=$AREA_DETECTOR," $AREA_DETECTOR/configure/RELEASE_LIBS.local +sed -i -e "/^ADSUPPORT\s*=/ s,=.*,=$ADSUPPORT," $AREA_DETECTOR/configure/RELEASE_LIBS.local +sed -i -e "/^ADCORE\s*=/ s,=.*,=$ADCORE," $AREA_DETECTOR/configure/RELEASE_LIBS.local + +# Hack RELEASE_PRODS file +sed -i -e "/^SUPPORT\s*=/ s,=.*,=$SUPPORT," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^CALC\s*=/ s,=.*,=$CALC," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^BUSY\s*=/ s,=.*,=$BUSY," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^SSCAN\s*=/ s,=.*,=$SSCAN," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^AUTOSAVE\s*=/ s,=.*,=$AUTOSAVE," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^SNCSEQ\s*=/ s,=.*,=$SNCSEQ," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^EPICS_BASE\s*=/ s,=.*,=$EPICS_BASE," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^ASYN\s*=/ s,=.*,=$ASYN," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^AREA_DETECTOR\s*=/ s,=.*,=$AREA_DETECTOR," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^ADSUPPORT\s*=/ s,=.*,=$ADSUPPORT," $AREA_DETECTOR/configure/RELEASE_PRODS.local +sed -i -e "/^ADCORE\s*=/ s,=.*,=$ADCORE," $AREA_DETECTOR/configure/RELEASE_PRODS.local + +# Don't think we need this. +sed -i "s/DEVIOCSTATS/#DEVIOCSTATS/g" $AREA_DETECTOR/configure/RELEASE_PRODS.local + +# These are example plugin files, but we will just use them +if [ ! -f $ADCORE/iocBoot/commonPlugins.cmd ]; then + cp $ADCORE/iocBoot/EXAMPLE_commonPlugins.cmd $ADCORE/iocBoot/commonPlugins.cmd +fi + +# Hack commonPlugins.cmd - we need sseq_settings.req, which is in the calc module +sed -i "s/#set_requestfile_path(\"\$(CALC)\/calcApp\/Db\")/set_requestfile_path(\"\$(CALC)\/calcApp\/Db\")/" $ADCORE/iocBoot/commonPlugins.cmd +if [ ! -f $ADCORE/iocBoot/commonPlugin_settings.req ]; then + cp $ADCORE/iocBoot/EXAMPLE_commonPlugin_settings.req $ADCORE/iocBoot/commonPlugin_settings.req +fi diff --git a/.ci-local/stable.set b/.ci-local/stable.set new file mode 100644 index 0000000..3d36d45 --- /dev/null +++ b/.ci-local/stable.set @@ -0,0 +1,24 @@ +MODULES=calc asyn autosave busy stream area_Detector ADSupport ADCore princetonspectro + +BASE=R7.0.6.1 +CALC=R3-7-4 +ASYN=R4-41 +AUTOSAVE=R5-7-1 +BUSY=R1-7-1 +STREAM=2.8.22 + +AREA_DETECTOR=R3-11 +AREA_DETECTOR_REPOURL=https://github.com/areaDetector/areaDetector +AREA_DETECTOR_RECURSIVE=NO +AREA_DETECTOR_HOOK=.ci-local/area_detector_hook.sh +ADSUPPORT=master +ADSUPPORT_REPOURL=https://github.com/pheest/ADSupport +ADSUPPORT_RECURSIVE=NO +ADSUPPORT_HOOK=.ci-local/adsupport_hook.sh +ADCORE=master +ADCORE_REPOURL=https://github.com/pheest/ADCore +ADCORE_RECURSIVE=NO +ADCORE_HOOK=.ci-local/adcore_hook.sh +PRINCETONSPECTRO=master +PRINCETONSPECTRO_REPOURL=https://github.com/ukaea/PrincetonSpectro +PRINCETONSPECTRO_RECURSIVE=NO diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..6655913 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,107 @@ +# .gitlab-ci.yml for testing EPICS Base ci-scripts +# (see: https://github.com/epics-base/ci-scripts) + +# This is YAML - indentation levels are crucial + +# GitLab runner can use any Docker container, we're using this one +# to be comparable with the other CI services +image: ubuntu:focal + +cache: + key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" + paths: + - .cache/ + +variables: + DEBIAN_FRONTEND: noninteractive + GIT_SUBMODULE_STRATEGY: "recursive" + SETUP_PATH: ".ci-local:.ci" + BASE_RECURSIVE: "YES" + # Additional packages needed for + # | EPICS |clang| Windows cross builds |RTEMS testing |sequencer + APT: "libreadline6-dev libncurses5-dev perl clang g++-mingw-w64-i686 g++-mingw-w64-x86-64 qemu-system-x86 re2c" + CMP: "gcc" + BGFC: "default" + SET: stable + CLEAN_DEPS: "NO" + +# Template for build jobs (hidden) +.build: + stage: build + before_script: + - apt-get update -qq && apt-get install -y -qq build-essential git python curl p7zip-full libgtest-dev libxml2-dev libx11-dev libxext-dev + - python .ci/cue.py prepare + script: + - python .ci/cue.py build + - python .ci/cue.py test + - python .ci/cue.py test-results + +# If you need to do more during install and build, +# add a local directory to your module and do e.g. +# - ./.ci-local/travis/install-extras.sh + +# Define build jobs + +# Well-known variables to use +# SET source setup file +# ADD_MODULES extra modules (for a specific job) +# BCFG build configuration (static/debug/static-debug; +# default: shared-optimized) +# TEST set to NO to skip running the tests (default: YES) +# VV set to make build scripts verbose (default: unset) +# EXTRA content will be added to make command line +# EXTRA1..5 more additional arguments for the make command +# (one argument per variable) + +# Usually from setup files, but may be specified or overridden +# on a job line +# MODULES list of dependency modules +# BASE branch or release tag name of the EPICS Base to use +# branch or release tag for a specific module +# ... see README for setup file syntax description + +# Different configurations of gcc and clang +gcc_default: + extends: .build + variables: + +gcc_static: + extends: .build + variables: + BCFG: "static" + +clang_default: + extends: .build + variables: + CMP: "clang" + +clang_static_c++11: + extends: .build + variables: + CMP: "clang" + BCFG: "static" + EXTRA: "CMD_CXXFLAGS=-std=c++11" + +# Cross-compilations to Windows using gcc/MinGW and WINE +wine32_default: + extends: .build + variables: + WINE: "32" + +wine64_default: + extends: .build + variables: + WINE: "64" + +wine64_debug: + extends: .build + variables: + WINE: "64" + BCFG: "debug" + +wine64_static: + extends: .build + variables: + WINE: "64" + BCFG: "static" + diff --git a/PICamApp/Db/PICam.template b/PICamApp/Db/PICam.template index ec6ea61..63f8180 100644 --- a/PICamApp/Db/PICam.template +++ b/PICamApp/Db/PICam.template @@ -3,6 +3,9 @@ # See LICENSE file. # # Database file for PICam Driver + +include "CCDMultiTrack.template" + record(stringin, "$(P)$(R)VersionNumber") { field(DTYP, "asynOctetRead") @@ -53,7 +56,7 @@ record(mbbi, "$(P)$(R)AvailableCameras_RBV") { field(INP, "@asyn($(PORT),$(ADDR),$(TIMEOUT))PICAM_AVAILABLE_CAMERAS") field(DTYP, "asynInt32") - field(SCAN, "I/O Intr") + field(SCAN, "I/O Intr") } record(stringin, "$(P)$(R)CameraInterfaceUnavailable") @@ -98,7 +101,7 @@ record(mbbi, "$(P)$(R)UnavailableCameras_RBV") { field(INP, "@asyn($(PORT),$(ADDR),$(TIMEOUT))PICAM_UNAVAILABLE_CAMERAS") field(DTYP, "asynInt32") - field(SCAN, "I/O Intr") + field(SCAN, "I/O Intr") } #Parameter Exists indicators @@ -2381,6 +2384,20 @@ record(mbbi, "$(P)$(R)AdcBitDepth_RBV") field(SCAN, "I/O Intr") } +record(longout, "$(P)$(R)AdcEMGain") +{ + field(PINI, "YES") + field(DTYP, "asynInt32") + field(OUT, "@asyn($(PORT),$(ADDR),$(TIMEOUT))PICAM_ADC_EM_GAIN") +} + +record(longin, "$(P)$(R)AdcEMGain_RBV") +{ + field(INP, "@asyn($(PORT),$(ADDR),$(TIMEOUT))PICAM_ADC_EM_GAIN") + field(DTYP, "asynInt32") + field(SCAN, "I/O Intr") +} + record(mbbo, "$(P)$(R)AdcQuality") { field(PINI, "YES") diff --git a/PICamApp/src/ADPICam.cpp b/PICamApp/src/ADPICam.cpp index 3c5b925..bcf3acb 100644 --- a/PICamApp/src/ADPICam.cpp +++ b/PICamApp/src/ADPICam.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -42,29 +43,29 @@ extern "C" { * \param[in] stackSize The stack size for the asyn port driver thread if * ASYN_CANBLOCK is set in asynFlags. */ - int PICamConfig(const char *portName, int maxBuffers, - size_t maxMemory, int priority, int stackSize) { - new ADPICam(portName, maxBuffers, maxMemory, priority, stackSize); - return (asynSuccess); - } - - /** Configuration command for PICAM driver; creates a new PICam object. - * \param[in] demoCameraName String identifying demoCameraName - */ - int PICamAddDemoCamera(const char *demoCameraName) { - int status = asynSuccess; - - status = ADPICam::piAddDemoCamera(demoCameraName); - return (status); - } - - /** - * Callback function for exit hook - */ - static void exitCallbackC(void *pPvt){ - ADPICam *pADPICam = (ADPICam*)pPvt; - delete pADPICam; - } + int PICamConfig(const char *portName, int maxBuffers, + size_t maxMemory, int priority, int stackSize, int selectedCamera) { + new ADPICam(portName, maxBuffers, maxMemory, priority, stackSize, selectedCamera); + return (asynSuccess); + } + + /** Configuration command for PICAM driver; creates a new PICam object. + * \param[in] demoCameraName String identifying demoCameraName + */ + int PICamAddDemoCamera(const char *demoCameraName) { + int status = asynSuccess; + + status = ADPICam::piAddDemoCamera(demoCameraName); + return (status); + } + + /** + * Callback function for exit hook + */ + static void exitCallbackC(void *pPvt){ + ADPICam *pADPICam = (ADPICam*)pPvt; + delete pADPICam; + } } ADPICam * ADPICam::ADPICam_Instance = NULL; const char *ADPICam::notAvailable = "N/A"; @@ -88,11 +89,12 @@ const char *ADPICam::driverName = "PICam"; * */ ADPICam::ADPICam(const char *portName, int maxBuffers, size_t maxMemory, - int priority, int stackSize) : + int priority, int stackSize, int selectedCamera) : ADDriver(portName, 1, int(NUM_PICAM_PARAMS), maxBuffers, maxMemory, - asynEnumMask, asynEnumMask, ASYN_CANBLOCK, 1, priority, stackSize) { + asynEnumMask, asynEnumMask, ASYN_CANBLOCK, 1, priority, stackSize), + PICAM_CCDMultiTrack(this) { int status = asynSuccess; - static const char *functionName = "PICam"; + static const char *functionName = "ADPICam"; const char *emptyStr = ""; pibln libInitialized; PicamCameraID demoId; @@ -134,9 +136,9 @@ ADPICam::ADPICam(const char *portName, int maxBuffers, size_t maxMemory, "------------------------------------------------\n" "%s%s Trouble Initializing Picam Library: %s\n" "------------------------------------------------\n", - driverName, + driverName, functionName, - errorString); + errorString); Picam_DestroyString(errorString); return; } @@ -157,9 +159,9 @@ ADPICam::ADPICam(const char *portName, int maxBuffers, size_t maxMemory, if (!libInitialized) { asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, "------------------------------------------------\n" - "%s%s Trouble Initializing Picam Library\n" + "%s%s Trouble Initializing Picam Library\n" "------------------------------------------------\n", - driverName, + driverName, functionName); return; // This was that last chance. Can't do anything. } @@ -168,48 +170,49 @@ ADPICam::ADPICam(const char *portName, int maxBuffers, size_t maxMemory, //Open First available camera. If no camera is available, // then open a demo camera - error = Picam_OpenFirstCamera(¤tCameraHandle); + if (selectedCamera == 0) + error = Picam_OpenFirstCamera(¤tCameraHandle); 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" - "-------------------------------------------------\n", - demoModelName, - errorString); - Picam_DestroyString(demoModelName); - Picam_DestroyString(errorString); - return; + 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 %s.\n" + "-------------------------------------------------\n", + demoModelName, + errorString); + Picam_DestroyString(demoModelName); + Picam_DestroyString(errorString); + return; } error = Picam_OpenFirstCamera(¤tCameraHandle); 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, + 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; + "Trouble opening demo camera %s \n%s" + "------------------------------------------------\n", + demoModelName, errorString); + Picam_DestroyString(demoModelName); + Picam_DestroyString(errorString); + return; } } else { Picam_GetEnumerationString(PicamEnumeratedType_Error, error, @@ -217,650 +220,656 @@ ADPICam::ADPICam(const char *portName, int maxBuffers, size_t maxMemory, asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, "------------------------------------------------\n" "%s:%s Unhandled Error opening first camera: %s\n" - "------------------------------------------------\n", - driverName, + "------------------------------------------------\n", + driverName, functionName, - errorString); + errorString); Picam_DestroyString(errorString); return; } } PicamAdvanced_GetCameraDevice(currentCameraHandle, ¤tDeviceHandle); selectedCameraIndex = 0; - createParam(PICAM_VersionNumberString, asynParamOctet, + status |= createParam(PICAM_VersionNumberString, asynParamOctet, &PICAM_VersionNumber); // Available Camera List - createParam(PICAM_AvailableCamerasString, asynParamInt32, + status |= createParam(PICAM_AvailableCamerasString, asynParamInt32, &PICAM_AvailableCameras); - createParam(PICAM_CameraInterfaceString, asynParamOctet, + status |= createParam(PICAM_CameraInterfaceString, asynParamOctet, &PICAM_CameraInterface); - createParam(PICAM_SensorNameString, asynParamOctet, &PICAM_SensorName); - createParam(PICAM_SerialNumberString, asynParamOctet, &PICAM_SerialNumber); - createParam(PICAM_FirmwareRevisionString, asynParamOctet, + status |= createParam(PICAM_SensorNameString, asynParamOctet, &PICAM_SensorName); + status |= createParam(PICAM_SerialNumberString, asynParamOctet, &PICAM_SerialNumber); + status |= createParam(PICAM_FirmwareRevisionString, asynParamOctet, &PICAM_FirmwareRevision); //Unavailable Camera List - createParam(PICAM_UnavailableCamerasString, asynParamInt32, + status |= createParam(PICAM_UnavailableCamerasString, asynParamInt32, &PICAM_UnavailableCameras); - createParam(PICAM_CameraInterfaceUnavailableString, asynParamOctet, + status |= createParam(PICAM_CameraInterfaceUnavailableString, asynParamOctet, &PICAM_CameraInterfaceUnavailable); - createParam(PICAM_SensorNameUnavailableString, asynParamOctet, + status |= createParam(PICAM_SensorNameUnavailableString, asynParamOctet, &PICAM_SensorNameUnavailable); - createParam(PICAM_SerialNumberUnavailableString, asynParamOctet, + status |= createParam(PICAM_SerialNumberUnavailableString, asynParamOctet, &PICAM_SerialNumberUnavailable); - createParam(PICAM_FirmwareRevisionUnavailableString, asynParamOctet, + status |= createParam(PICAM_FirmwareRevisionUnavailableString, asynParamOctet, &PICAM_FirmwareRevisionUnavailable); //Shutter - piCreateAndIndexADParam(PICAM_ExposureTimeString, + status |= piCreateAndIndexADParam(PICAM_ExposureTimeString, ADAcquireTime, PICAM_ExposureTimeExists, PICAM_ExposureTimeRelevant, PicamParameter_ExposureTime); - piCreateAndIndexADParam(PICAM_ShutterClosingDelayString, + status |= piCreateAndIndexADParam(PICAM_ShutterClosingDelayString, ADShutterCloseDelay, PICAM_ShutterClosingDelayExists, PICAM_ShutterClosingDelayRelevant, PicamParameter_ShutterClosingDelay); - piCreateAndIndexPIParam(PICAM_ShutterDelayResolutionString, + status |= piCreateAndIndexPIParam(PICAM_ShutterDelayResolutionString, asynParamInt32, PICAM_ShutterDelayResolution, PICAM_ShutterDelayResolutionExists, PICAM_ShutterDelayResolutionRelevant, PicamParameter_ShutterDelayResolution); - piCreateAndIndexADParam(PICAM_ShutterOpeningDelayString, + status |= piCreateAndIndexADParam(PICAM_ShutterOpeningDelayString, ADShutterOpenDelay, PICAM_ShutterOpeningDelayExists, PICAM_ShutterOpeningDelayRelevant, PicamParameter_ShutterOpeningDelay); - piCreateAndIndexPIParam(PICAM_ShutterTimingModeString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_ShutterTimingModeString, asynParamInt32, PICAM_ShutterTimingMode, PICAM_ShutterTimingModeExists, PICAM_ShutterTimingModeRelevant, PicamParameter_ShutterTimingMode); //Intensifier - piCreateAndIndexPIParam(PICAM_BracketGatingString, + status |= piCreateAndIndexPIParam(PICAM_BracketGatingString, asynParamInt32, PICAM_BracketGating, PICAM_BracketGatingExists, PICAM_BracketGatingRelevant, PicamParameter_BracketGating); //TODO CustomModulationSequence needs Modulation Type - piCreateAndIndexPIModulationsParam(PICAM_CustomModulationSequenceString, + status |= piCreateAndIndexPIModulationsParam(PICAM_CustomModulationSequenceString, PICAM_CustomModulationSequenceExists, PICAM_CustomModulationSequenceRelevant, PicamParameter_CustomModulationSequence); //TODO DifEndingGate needs pulse type - piCreateAndIndexPIPulseParam(PICAM_DifEndingGateString, + status |= piCreateAndIndexPIPulseParam(PICAM_DifEndingGateString, PICAM_DifEndingGateExists, PICAM_DifEndingGateRelevant, PicamParameter_DifEndingGate); //TODO DifStartingGate needs pulse type - piCreateAndIndexPIPulseParam(PICAM_DifStartingGateString, + status |= piCreateAndIndexPIPulseParam(PICAM_DifStartingGateString, PICAM_DifStartingGateExists, PICAM_DifStartingGateRelevant, PicamParameter_DifStartingGate); - piCreateAndIndexPIParam(PICAM_EMIccdGainString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_EMIccdGainString, asynParamInt32, PICAM_EMIccdGain, PICAM_EMIccdGainExists, PICAM_EMIccdGainRelevant, PicamParameter_EMIccdGain); - piCreateAndIndexPIParam(PICAM_EMIccdGainControlModeString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_EMIccdGainControlModeString, asynParamInt32, PICAM_EMIccdGainControlMode, PICAM_EMIccdGainControlModeExists, PICAM_EMIccdGainControlModeRelevant, PicamParameter_EMIccdGainControlMode); - piCreateAndIndexPIParam(PICAM_EnableIntensifierString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_EnableIntensifierString, asynParamInt32, PICAM_EnableIntensifier, PICAM_EnableIntensifierExists, PICAM_EnableIntensifierRelevant, PicamParameter_EnableIntensifier); - piCreateAndIndexPIParam(PICAM_EnableModulationString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_EnableModulationString, asynParamInt32, PICAM_EnableModulation, PICAM_EnableModulationExists, PICAM_EnableModulationRelevant, PicamParameter_EnableModulation); - piCreateAndIndexPIParam(PICAM_GatingModeString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_GatingModeString, asynParamInt32, PICAM_GatingMode, PICAM_GatingModeExists, PICAM_GatingModeRelevant, PicamParameter_GatingMode); - piCreateAndIndexPIParam(PICAM_GatingSpeedString, asynParamOctet, + status |= piCreateAndIndexPIParam(PICAM_GatingSpeedString, asynParamOctet, PICAM_GatingSpeed, PICAM_GatingSpeedExists, PICAM_GatingSpeedRelevant, PicamParameter_GatingSpeed); - piCreateAndIndexPIParam(PICAM_IntensifierDiameterString, asynParamFloat64, + status |= piCreateAndIndexPIParam(PICAM_IntensifierDiameterString, asynParamFloat64, PICAM_IntensifierDiameter, PICAM_IntensifierDiameterExists, PICAM_IntensifierDiameterRelevant, PicamParameter_IntensifierDiameter); - piCreateAndIndexPIParam(PICAM_IntensifierGainString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_IntensifierGainString, asynParamInt32, PICAM_IntensifierGain, PICAM_IntensifierGainExists, PICAM_IntensifierGainRelevant, PicamParameter_IntensifierGain); - piCreateAndIndexPIParam(PICAM_IntensifierOptionsString, asynParamOctet, + status |= piCreateAndIndexPIParam(PICAM_IntensifierOptionsString, asynParamOctet, PICAM_IntensifierOptions, PICAM_IntensifierOptionsExists, PICAM_IntensifierOptionsRelevant, PicamParameter_IntensifierOptions); - piCreateAndIndexPIParam(PICAM_IntensifierStatusString, asynParamOctet, + status |= piCreateAndIndexPIParam(PICAM_IntensifierStatusString, asynParamOctet, PICAM_IntensifierStatus, PICAM_IntensifierStatusExists, PICAM_IntensifierStatusRelevant, PicamParameter_IntensifierStatus); - piCreateAndIndexPIParam(PICAM_ModulationDurationString, asynParamFloat64, + status |= piCreateAndIndexPIParam(PICAM_ModulationDurationString, asynParamFloat64, PICAM_ModulationDuration, PICAM_ModulationDurationExists, PICAM_ModulationDurationRelevant, PicamParameter_ModulationDuration); - piCreateAndIndexPIParam(PICAM_ModulationFrequencyString, asynParamFloat64, + status |= piCreateAndIndexPIParam(PICAM_ModulationFrequencyString, asynParamFloat64, PICAM_ModulationFrequency, PICAM_ModulationFrequencyExists, PICAM_ModulationFrequencyRelevant, PicamParameter_ModulationFrequency); - piCreateAndIndexPIParam(PICAM_PhosphorDecayDelayString, asynParamFloat64, + status |= piCreateAndIndexPIParam(PICAM_PhosphorDecayDelayString, asynParamFloat64, PICAM_PhosphorDecayDelay, PICAM_PhosphorDecayDelayExists, PICAM_PhosphorDecayDelayRelevant, PicamParameter_PhosphorDecayDelay); - piCreateAndIndexPIParam(PICAM_PhosphorDecayDelayResolutionString, + status |= piCreateAndIndexPIParam(PICAM_PhosphorDecayDelayResolutionString, asynParamInt32, PICAM_PhosphorDecayDelayResolution, PICAM_PhosphorDecayDelayResolutionExists, PICAM_PhosphorDecayDelayResolutionRelevant, PicamParameter_PhosphorDecayDelayResolution); - piCreateAndIndexPIParam(PICAM_PhosphorTypeString, asynParamOctet, + status |= piCreateAndIndexPIParam(PICAM_PhosphorTypeString, asynParamOctet, PICAM_PhosphorType, PICAM_PhosphorTypeExists, PICAM_PhosphorTypeRelevant, PicamParameter_PhosphorType); - piCreateAndIndexPIParam(PICAM_PhotocathodeSensitivityString, asynParamOctet, + status |= piCreateAndIndexPIParam(PICAM_PhotocathodeSensitivityString, asynParamOctet, PICAM_PhotocathodeSensitivity, PICAM_PhotocathodeSensitivityExists, PICAM_PhotocathodeSensitivityRelevant, PicamParameter_PhotocathodeSensitivity); //TODO Repetitive Gate needs Pulse Type - piCreateAndIndexPIPulseParam(PICAM_RepetitiveGateString, + status |= piCreateAndIndexPIPulseParam(PICAM_RepetitiveGateString, PICAM_RepetitiveGateExists, PICAM_RepetitiveGateRelevant, PicamParameter_RepetitiveGate); - piCreateAndIndexPIParam(PICAM_RepetitiveModulationString, asynParamFloat64, + status |= piCreateAndIndexPIParam(PICAM_RepetitiveModulationString, asynParamFloat64, PICAM_RepetitiveModulation, PICAM_RepetitiveModulationPhaseExists, PICAM_RepetitiveModulationPhaseRelevant, PicamParameter_RepetitiveModulationPhase); - piCreateAndIndexPIParam(PICAM_SequentialStartingModulationPhaseString, + status |= piCreateAndIndexPIParam(PICAM_SequentialStartingModulationPhaseString, asynParamFloat64, PICAM_SequentialStartingModulationPhase, PICAM_SequentialStartingModulationPhaseExists, PICAM_SequentialStartingModulationPhaseRelevant, PicamParameter_SequentialStartingModulationPhase); - piCreateAndIndexPIParam(PICAM_SequentialEndingModulationPhaseString, + status |= piCreateAndIndexPIParam(PICAM_SequentialEndingModulationPhaseString, asynParamFloat64, PICAM_SequentialEndingModulationPhase, PICAM_SequentialEndingModulationPhaseExists, PICAM_SequentialEndingModulationPhaseRelevant, PicamParameter_SequentialEndingModulationPhase); //TODO SequentialEndingGate needs Pulse Type - piCreateAndIndexPIPulseParam(PICAM_SequentialEndingGateString, + status |= piCreateAndIndexPIPulseParam(PICAM_SequentialEndingGateString, PICAM_SequentialEndingGateExists, PICAM_SequentialEndingGateRelevant, PicamParameter_SequentialEndingGate); - piCreateAndIndexPIParam(PICAM_SequentialGateStepCountString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_SequentialGateStepCountString, asynParamInt32, PICAM_SequentialGateStepCount, PICAM_SequentialGateStepCountExists, PICAM_SequentialGateStepCountRelevant, PicamParameter_SequentialGateStepCount); - piCreateAndIndexPIParam(PICAM_SequentialGateStepIterationsString, + status |= piCreateAndIndexPIParam(PICAM_SequentialGateStepIterationsString, asynParamInt32, PICAM_SequentialGateStepIterations, PICAM_SequentialGateStepIterationsExists, PICAM_SequentialGateStepIterationsRelevant, PicamParameter_SequentialGateStepIterations); //TODO SequentialStartingGate needs Pulse Type - piCreateAndIndexPIPulseParam(PICAM_SequentialStartingGateString, + status |= piCreateAndIndexPIPulseParam(PICAM_SequentialStartingGateString, PICAM_SequentialStartingGateExists, PICAM_SequentialStartingGateRelevant, PicamParameter_SequentialStartingGate); //Analog to Digital Conversion - piCreateAndIndexPIParam(PICAM_AdcAnalogGainString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_AdcAnalogGainString, asynParamInt32, PICAM_AdcAnalogGain, PICAM_AdcAnalogGainExists, PICAM_AdcAnalogGainRelevant, PicamParameter_AdcAnalogGain); - piCreateAndIndexPIParam(PICAM_AdcBitDepthString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_AdcBitDepthString, asynParamInt32, PICAM_AdcBitDepth, PICAM_AdcBitDepthExists, PICAM_AdcBitDepthRelevant, PicamParameter_AdcBitDepth); - piCreateAndIndexPIParam(PICAM_AdcEMGainString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_AdcEMGainString, asynParamInt32, PICAM_AdcEMGain, PICAM_AdcEMGainExists, PICAM_AdcEMGainRelevant, PicamParameter_AdcEMGain); - piCreateAndIndexPIParam(PICAM_AdcQualityString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_AdcQualityString, asynParamInt32, PICAM_AdcQuality, PICAM_AdcQualityExists, PICAM_AdcQualityRelevant, PicamParameter_AdcQuality); - piCreateAndIndexPIParam(PICAM_AdcSpeedString, asynParamInt32, PICAM_AdcSpeed, + status |= piCreateAndIndexPIParam(PICAM_AdcSpeedString, asynParamInt32, PICAM_AdcSpeed, PICAM_AdcSpeedExists, PICAM_AdcSpeedRelevant, PicamParameter_AdcSpeed); - piCreateAndIndexPIParam(PICAM_CorrectPixelBiasString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_CorrectPixelBiasString, asynParamInt32, PICAM_CorrectPixelBias, PICAM_CorrectPixelBiasExists, PICAM_CorrectPixelBiasRelevant, PicamParameter_CorrectPixelBias); // Hardware I/O - piCreateAndIndexPIPulseParam(PICAM_AuxOutputString, + status |= piCreateAndIndexPIPulseParam(PICAM_AuxOutputString, PICAM_AuxOutputExists, PICAM_AuxOutputRelevant, PicamParameter_AuxOutput); - piCreateAndIndexPIParam(PICAM_EnableModulationOutputSignalString, + status |= piCreateAndIndexPIParam(PICAM_EnableModulationOutputSignalString, asynParamInt32, PICAM_EnableModulationOutputSignal, PICAM_EnableModulationOutputSignalExists, PICAM_EnableModulationOutputSignalRelevant, PicamParameter_EnableModulationOutputSignal); - piCreateAndIndexPIParam(PICAM_ModulationOutputSignalFrequencyString, + status |= piCreateAndIndexPIParam(PICAM_ModulationOutputSignalFrequencyString, asynParamFloat64, PICAM_ModulationOutputSignalFrequency, PICAM_EnableModulationOutputSignalFrequencyExists, PICAM_EnableModulationOutputSignalAmplitudeRelevant, PicamParameter_ModulationOutputSignalFrequency); - piCreateAndIndexPIParam(PICAM_ModulationOutputSignalAmplitudeString, + status |= piCreateAndIndexPIParam(PICAM_ModulationOutputSignalAmplitudeString, asynParamFloat64, PICAM_ModulationOutputSignalAmplitude, PICAM_EnableModulationOutputSignalAmplitudeExists, PICAM_EnableModulationOutputSignalAmplitudeRelevant, PicamParameter_ModulationOutputSignalAmplitude); - piCreateAndIndexPIParam(PICAM_EnableSyncMasterString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_EnableSyncMasterString, asynParamInt32, PICAM_EnableSyncMaster, PICAM_EnableSyncMasterExists, PICAM_EnableSyncMasterRelevant, PicamParameter_EnableSyncMaster); - piCreateAndIndexPIParam(PICAM_InvertOutputSignalString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_InvertOutputSignalString, asynParamInt32, PICAM_InvertOutputSignal, PICAM_InvertOutputSignalExists, PICAM_InvertOutputSignalRelevant, PicamParameter_InvertOutputSignal); - piCreateAndIndexPIParam(PICAM_OutputSignalString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_OutputSignalString, asynParamInt32, PICAM_OutputSignal, PICAM_OutputSignalExists, PICAM_OutputSignalRelevant, PicamParameter_OutputSignal); - piCreateAndIndexPIParam(PICAM_SyncMaster2DelayString, asynParamFloat64, + status |= piCreateAndIndexPIParam(PICAM_SyncMaster2DelayString, asynParamFloat64, PICAM_SyncMaster2Delay, PICAM_SyncMaster2DelayExists, PICAM_SyncMaster2DelayRelevant, PicamParameter_SyncMaster2Delay); - piCreateAndIndexPIParam(PICAM_TriggerCouplingString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_TriggerCouplingString, asynParamInt32, PICAM_TriggerCoupling, PICAM_TriggerCouplingExists, PICAM_TriggerCouplingRelevant, PicamParameter_TriggerCoupling); - piCreateAndIndexPIParam(PICAM_TriggerDeterminationString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_TriggerDeterminationString, asynParamInt32, PICAM_TriggerDetermination, PICAM_TriggerDeterminationExists, PICAM_TriggerDeterminationRelevant, PicamParameter_TriggerDetermination); - piCreateAndIndexPIParam(PICAM_TriggerFrequencyString, asynParamFloat64, + status |= piCreateAndIndexPIParam(PICAM_TriggerFrequencyString, asynParamFloat64, PICAM_TriggerFrequency, PICAM_TriggerFrequencyExists, PICAM_TriggerFrequencyRelevant, PicamParameter_TriggerFrequency); - piCreateAndIndexADParam(PICAM_TriggerResponseString, + status |= piCreateAndIndexADParam(PICAM_TriggerResponseString, ADTriggerMode, PICAM_TriggerResponseExists, PICAM_TriggerResponseRelevant, PicamParameter_TriggerResponse); - piCreateAndIndexPIParam(PICAM_TriggerSourceString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_TriggerSourceString, asynParamInt32, PICAM_TriggerSource, PICAM_TriggerSourceExists, PICAM_TriggerSourceRelevant, PicamParameter_TriggerSource); - piCreateAndIndexPIParam(PICAM_TriggerTerminationString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_TriggerTerminationString, asynParamInt32, PICAM_TriggerTermination, PICAM_TriggerTerminationExists, PICAM_TriggerTerminationRelevant, PicamParameter_TriggerTermination); - piCreateAndIndexPIParam(PICAM_TriggerThresholdString, asynParamFloat64, + status |= piCreateAndIndexPIParam(PICAM_TriggerThresholdString, asynParamFloat64, PICAM_TriggerThreshold, PICAM_TriggerThresholdExists, PICAM_TriggerThresholdRelevant, PicamParameter_TriggerThreshold); // Readout Control - piCreateAndIndexPIParam(PICAM_AccumulationsString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_AccumulationsString, asynParamInt32, PICAM_Accumulations, PICAM_AccumulationsExists, PICAM_AccumulationsRelevant, PicamParameter_Accumulations); - piCreateAndIndexPIParam(PICAM_EnableNondestructiveReadoutString, + status |= piCreateAndIndexPIParam(PICAM_EnableNondestructiveReadoutString, asynParamInt32, PICAM_EnableNondestructiveReadout, PICAM_EnableNondestructiveReadoutExists, PICAM_EnableNondestructiveReadoutRelevant, PicamParameter_EnableNondestructiveReadout); - piCreateAndIndexPIParam(PICAM_KineticsWindowHeightString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_KineticsWindowHeightString, asynParamInt32, PICAM_KineticsWindowHeight, PICAM_KineticsWindowHeightExists, PICAM_KineticsWindowHeightRelevant, PicamParameter_KineticsWindowHeight); - piCreateAndIndexPIParam(PICAM_NondestructiveReadoutPeriodString, + status |= piCreateAndIndexPIParam(PICAM_NondestructiveReadoutPeriodString, asynParamFloat64, PICAM_NondestructiveReadoutPeriod, PICAM_NondestructiveReadoutPeriodExists, PICAM_NondestructiveReadoutPeriodRelevant, PicamParameter_NondestructiveReadoutPeriod); - piCreateAndIndexPIParam(PICAM_ReadoutControlModeString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_ReadoutControlModeString, asynParamInt32, PICAM_ReadoutControlMode, PICAM_ReadoutControlModeExists, PICAM_ReadoutControlModeRelevant, PicamParameter_ReadoutControlMode); - piCreateAndIndexPIParam(PICAM_ReadoutOrientationString, asynParamOctet, + status |= piCreateAndIndexPIParam(PICAM_ReadoutOrientationString, asynParamOctet, PICAM_ReadoutOrientation, PICAM_ReadoutOrientationExists, PICAM_ReadoutOrientationRelevant, PicamParameter_ReadoutOrientation); - piCreateAndIndexPIParam(PICAM_ReadoutPortCountString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_ReadoutPortCountString, asynParamInt32, PICAM_ReadoutPortCount, PICAM_ReadoutPortCountExists, PICAM_ReadoutPortCountRelevant, PicamParameter_ReadoutPortCount); - piCreateAndIndexPIParam(PICAM_ReadoutTimeCalcString, asynParamFloat64, + status |= piCreateAndIndexPIParam(PICAM_ReadoutTimeCalcString, asynParamFloat64, PICAM_ReadoutTimeCalc, PICAM_ReadoutTimeCalculationExists, PICAM_ReadoutTimeCalculationRelevant, PicamParameter_ReadoutTimeCalculation); - piCreateAndIndexPIParam(PICAM_VerticalShiftRateString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_VerticalShiftRateString, asynParamInt32, PICAM_VerticalShiftRate, PICAM_VerticalShiftRateExists, PICAM_VerticalShiftRateRelevant, PicamParameter_VerticalShiftRate); // Data Acquisition - piCreateAndIndexPIParam(PICAM_DisableDataFormattingString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_DisableDataFormattingString, asynParamInt32, PICAM_DisableDataFormatting, PICAM_DisableDataFormattingExists, PICAM_DisableDataFormattingRelevant, PicamParameter_DisableDataFormatting); - piCreateAndIndexPIParam(PICAM_ExactReadoutCountMaxString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_ExactReadoutCountMaxString, asynParamInt32, PICAM_ExactReadoutCountMax, PICAM_ExactReadoutCountMaximumExists, PICAM_ExactReadoutCountMaximumRelevant, PicamParameter_ExactReadoutCountMaximum); - piCreateAndIndexPIParam(PICAM_FrameRateCalcString, asynParamFloat64, + status |= piCreateAndIndexPIParam(PICAM_FrameRateCalcString, asynParamFloat64, PICAM_FrameRateCalc, PICAM_FrameRateCalculationExists, PICAM_FrameRateCalculationRelevant, PicamParameter_FrameRateCalculation); - piCreateAndIndexPIParam(PICAM_FramesPerReadoutString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_FramesPerReadoutString, asynParamInt32, PICAM_FramesPerReadout, PICAM_FramesPerReadoutExists, PICAM_FramesPerReadoutRelevant, PicamParameter_FramesPerReadout); - piCreateAndIndexADParam(PICAM_FrameSizeString, NDArraySize, + status |= piCreateAndIndexADParam(PICAM_FrameSizeString, NDArraySize, PICAM_FrameSizeExists, PICAM_FrameSizeRelevant, PicamParameter_FrameSize); - piCreateAndIndexPIParam(PICAM_FrameStrideString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_FrameStrideString, asynParamInt32, PICAM_FrameStride, PICAM_FrameStrideExists, PICAM_FrameStrideRelevant, PicamParameter_FrameStride); - piCreateAndIndexPIParam(PICAM_FrameTrackingBitDepthString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_FrameTrackingBitDepthString, asynParamInt32, PICAM_FrameTrackingBitDepth, PICAM_FrameTrackingBitDepthExists, PICAM_FrameTrackingBitDepthRelevant, PicamParameter_FrameTrackingBitDepth); - piCreateAndIndexPIParam(PICAM_GateTrackingString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_GateTrackingString, asynParamInt32, PICAM_GateTracking, PICAM_GateTrackingExists, PICAM_GateTrackingRelevant, PicamParameter_GateTracking); - piCreateAndIndexPIParam(PICAM_GateTrackingBitDepthString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_GateTrackingBitDepthString, asynParamInt32, PICAM_GateTrackingBitDepth, PICAM_GateTrackingBitDepthExists, PICAM_GateTrackingBitDepthRelevant, PicamParameter_GateTrackingBitDepth); - piCreateAndIndexPIParam(PICAM_ModulationTrackingString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_ModulationTrackingString, asynParamInt32, PICAM_ModulationTracking, PICAM_ModulationTrackingExists, PICAM_ModulationTrackingRelevant, PicamParameter_ModulationTracking); - piCreateAndIndexPIParam(PICAM_ModulationTrackingBitDepthString, + status |= piCreateAndIndexPIParam(PICAM_ModulationTrackingBitDepthString, asynParamInt32, PICAM_ModulationTrackingBitDepth, PICAM_ModulationTrackingBitDepthExists, PICAM_ModulationTrackingBitDepthRelevant, PicamParameter_ModulationTrackingBitDepth); - piCreateAndIndexPIParam(PICAM_NormalizeOrientationString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_NormalizeOrientationString, asynParamInt32, PICAM_NormalizeOrientation, PICAM_NormalizeOrientationExists, PICAM_NormalizeOrientationRelevant, PicamParameter_NormalizeOrientation); - piCreateAndIndexPIParam(PICAM_OnlineReadoutRateCalcString, asynParamFloat64, + status |= piCreateAndIndexPIParam(PICAM_OnlineReadoutRateCalcString, asynParamFloat64, PICAM_OnlineReadoutRateCalc, PICAM_OnlineReadoutRateCalculationExists, PICAM_OnlineReadoutRateCalculationRelevant, PicamParameter_OnlineReadoutRateCalculation); - piCreateAndIndexPIParam(PICAM_OrientationString, asynParamOctet, + status |= piCreateAndIndexPIParam(PICAM_OrientationString, asynParamOctet, PICAM_Orientation, PICAM_OrientationExists, PICAM_OrientationRelevant, PicamParameter_Orientation); - piCreateAndIndexPIParam(PICAM_PhotonDetectionModeString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_PhotonDetectionModeString, asynParamInt32, PICAM_PhotonDetectionMode, PICAM_PhotonDetectionModeExists, PICAM_PhotonDetectionModeRelevant, PicamParameter_PhotonDetectionMode); - piCreateAndIndexPIParam(PICAM_PhotonDetectionThresholdString, + status |= piCreateAndIndexPIParam(PICAM_PhotonDetectionThresholdString, asynParamFloat64, PICAM_PhotonDetectionThreshold, PICAM_PhotonDetectionThresholdExists, PICAM_PhotonDetectionThresholdRelevant, PicamParameter_PhotonDetectionThreshold); - piCreateAndIndexPIParam(PICAM_PixelBitDepthString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_PixelBitDepthString, asynParamInt32, PICAM_PixelBitDepth, PICAM_PixelBitDepthExists, PICAM_PixelBitDepthRelevant, PicamParameter_PixelBitDepth); - piCreateAndIndexPIParam(PICAM_PixelFormatString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_PixelFormatString, asynParamInt32, PICAM_PixelFormat, PICAM_PixelFormatExists, PICAM_PixelFormatRelevant, PicamParameter_PixelFormat); - piCreateAndIndexPIParam(PICAM_ReadoutCountString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_ReadoutCountString, asynParamInt32, PICAM_ReadoutCount, PICAM_ReadoutCountExists, PICAM_ReadoutCountRelevant, PicamParameter_ReadoutCount); - piCreateAndIndexPIParam(PICAM_ReadoutRateCalcString, asynParamFloat64, + status |= piCreateAndIndexPIParam(PICAM_ReadoutRateCalcString, asynParamFloat64, PICAM_ReadoutRateCalc, PICAM_ReadoutRateCalculationExists, PICAM_ReadoutRateCalculationRelevant, PicamParameter_ReadoutRateCalculation); - piCreateAndIndexPIParam(PICAM_ReadoutStrideString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_ReadoutStrideString, asynParamInt32, PICAM_ReadoutStride, PICAM_ReadoutStrideExists, PICAM_ReadoutStrideRelevant, PicamParameter_ReadoutStride); - piCreateAndIndexPIRoisParam(PICAM_RoisString, + status |= piCreateAndIndexPIRoisParam(PICAM_RoisString, PICAM_RoisExists, PICAM_RoisRelevant, PicamParameter_Rois); - piCreateAndIndexPIParam(PICAM_TimeStampBitDepthString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_TimeStampBitDepthString, asynParamInt32, PICAM_TimeStampBitDepth, PICAM_TimeStampBitDepthExists, PICAM_TimeStampBitDepthRelevant, PicamParameter_TimeStampBitDepth); - piCreateAndIndexPIParam(PICAM_TimeStampResolutionString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_TimeStampResolutionString, asynParamInt32, PICAM_TimeStampResolution, PICAM_TimeStampResolutionExists, PICAM_TimeStampResolutionRelevant, PicamParameter_TimeStampResolution); - piCreateAndIndexPIParam(PICAM_TimeStampsString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_TimeStampsString, asynParamInt32, PICAM_TimeStamps, PICAM_TimeStampsExists, PICAM_TimeStampsRelevant, PicamParameter_TimeStamps); - piCreateAndIndexPIParam(PICAM_TrackFramesString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_TrackFramesString, asynParamInt32, PICAM_TrackFrames, PICAM_TrackFramesExists, PICAM_TrackFramesRelevant, PicamParameter_TrackFrames); - piCreateAndIndexPIParam(PICAM_CcdCharacteristicsString, asynParamOctet, + status |= piCreateAndIndexPIParam(PICAM_CcdCharacteristicsString, asynParamOctet, PICAM_CcdCharacteristics, PICAM_CcdCharacteristicsExists, PICAM_CcdCharacteristicsRelevant, PicamParameter_CcdCharacteristics); - piCreateAndIndexPIParam(PICAM_PixelGapHeightString, asynParamFloat64, + status |= piCreateAndIndexPIParam(PICAM_PixelGapHeightString, asynParamFloat64, PICAM_PixelGapHeight, PICAM_PixelGapHeightExists, PICAM_PixelGapHeightRelevant, PicamParameter_PixelGapHeight); - piCreateAndIndexPIParam(PICAM_PixelGapWidthString, asynParamFloat64, + status |= piCreateAndIndexPIParam(PICAM_PixelGapWidthString, asynParamFloat64, PICAM_PixelGapWidth, PICAM_PixelGapWidthExists, PICAM_PixelGapHeightRelevant, PicamParameter_PixelGapWidth); - piCreateAndIndexPIParam(PICAM_PixelHeightString, asynParamFloat64, + status |= piCreateAndIndexPIParam(PICAM_PixelHeightString, asynParamFloat64, PICAM_PixelHeight, PICAM_PixelHeightExists, PICAM_PixelGapHeightRelevant, PicamParameter_PixelHeight); - piCreateAndIndexPIParam(PICAM_PixelWidthString, asynParamFloat64, + status |= piCreateAndIndexPIParam(PICAM_PixelWidthString, asynParamFloat64, PICAM_PixelWidth, PICAM_PixelWidthExists, PICAM_PixelWidthRelevant, PicamParameter_PixelWidth); - piCreateAndIndexPIParam(PICAM_SensorActiveBottomMarginString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_SensorActiveBottomMarginString, asynParamInt32, PICAM_SensorActiveBottomMargin, PICAM_SensorActiveBottomMarginExists, PICAM_SensorActiveBottomMarginRelevant, PicamParameter_SensorActiveBottomMargin); - piCreateAndIndexADParam(PICAM_SensorActiveHeightString, + status |= piCreateAndIndexADParam(PICAM_SensorActiveHeightString, ADMaxSizeY, PICAM_SensorActiveHeightExists, PICAM_SensorActiveHeightRelevant, PicamParameter_SensorActiveHeight); - piCreateAndIndexPIParam(PICAM_SensorActiveLeftMarginString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_SensorActiveLeftMarginString, asynParamInt32, PICAM_SensorActiveLeftMargin, PICAM_SensorActiveLeftMarginExists, PICAM_SensorActiveLeftMarginRelevant, PicamParameter_SensorActiveLeftMargin); - piCreateAndIndexPIParam(PICAM_SensorActiveRightMarginString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_SensorActiveRightMarginString, asynParamInt32, PICAM_SensorActiveRightMargin, PICAM_SensorActiveRightMarginExists, PICAM_SensorActiveRightMarginRelevant, PicamParameter_SensorActiveRightMargin); - piCreateAndIndexPIParam(PICAM_SensorActiveTopMarginString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_SensorActiveTopMarginString, asynParamInt32, PICAM_SensorActiveTopMargin, PICAM_SensorActiveTopMarginExists, PICAM_SensorActiveTopMarginRelevant, PicamParameter_SensorActiveTopMargin); - piCreateAndIndexADParam(PICAM_SensorActiveWidthString, + status |= piCreateAndIndexADParam(PICAM_SensorActiveWidthString, ADMaxSizeX, PICAM_SensorActiveWidthExists, PICAM_SensorActiveWidthRelevant, PicamParameter_SensorActiveWidth); - piCreateAndIndexPIParam(PICAM_SensorMaskedBottomMarginString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_SensorMaskedBottomMarginString, asynParamInt32, PICAM_SensorMaskedBottomMargin, PICAM_SensorMaskedBottomMarginExists, PICAM_SensorMaskedBottomMarginRelevant, PicamParameter_SensorMaskedBottomMargin); - piCreateAndIndexPIParam(PICAM_SensorMaskedHeightString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_SensorMaskedHeightString, asynParamInt32, PICAM_SensorMaskedHeight, PICAM_SensorMaskedHeightExists, PICAM_SensorMaskedHeightRelevant, PicamParameter_SensorMaskedHeight); - piCreateAndIndexPIParam(PICAM_SensorMaskedTopMarginString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_SensorMaskedTopMarginString, asynParamInt32, PICAM_SensorMaskedTopMargin, PICAM_SensorMaskedTopMarginExists, PICAM_SensorMaskedTopMarginRelevant, PicamParameter_SensorMaskedTopMargin); - piCreateAndIndexPIParam(PICAM_SensorSecondaryActiveHeightString, + status |= piCreateAndIndexPIParam(PICAM_SensorSecondaryActiveHeightString, asynParamInt32, PICAM_SensorSecondaryActiveHeight, PICAM_SensorSecondaryActiveHeightExists, PICAM_SensorSecondaryActiveHeightRelevant, PicamParameter_SensorSecondaryActiveHeight); - piCreateAndIndexPIParam(PICAM_SensorSecondaryMaskedHeightString, + status |= piCreateAndIndexPIParam(PICAM_SensorActiveExtendedHeightString, + asynParamInt32, + PICAM_SensorActiveExtendedHeight, + PICAM_SensorActiveExtendedHeightExists, + PICAM_SensorActiveExtendedHeightRelevant, + PicamParameter_SensorActiveExtendedHeight); + status |= piCreateAndIndexPIParam(PICAM_SensorSecondaryMaskedHeightString, asynParamInt32, PICAM_SensorSecondaryMaskedHeight, PICAM_SensorSecondaryMaskedHeightExists, PICAM_SensorSecondaryMaskedHeightRelevant, PicamParameter_SensorSecondaryMaskedHeight); - piCreateAndIndexPIParam(PICAM_SensorTypeString, asynParamOctet, + status |= piCreateAndIndexPIParam(PICAM_SensorTypeString, asynParamOctet, PICAM_SensorType, PICAM_SensorTypeExists, PICAM_SensorTypeRelevant, PicamParameter_SensorType); //Sensor Layout - piCreateAndIndexPIParam(PICAM_ActiveBottomMarginString, asynParamInt32, - PICAM_ActiveBottomMargin, + status |= piCreateAndIndexPIParam(PICAM_ActiveBottomMarginString, asynParamInt32, + PICAM_ActiveBottomMargin, PICAM_ActiveBottomMarginExists, PICAM_ActiveBottomMarginRelevant, PicamParameter_ActiveBottomMargin); - piCreateAndIndexPIParam(PICAM_ActiveHeightString, asynParamInt32, - PICAM_ActiveHeight, + status |= piCreateAndIndexPIParam(PICAM_ActiveHeightString, asynParamInt32, + PICAM_ActiveHeight, PICAM_ActiveHeightExists, PICAM_ActiveHeightRelevant, PicamParameter_ActiveHeight); - piCreateAndIndexPIParam(PICAM_ActiveLeftMarginString, asynParamInt32, - PICAM_ActiveLeftMargin, + status |= piCreateAndIndexPIParam(PICAM_ActiveLeftMarginString, asynParamInt32, + PICAM_ActiveLeftMargin, PICAM_ActiveLeftMarginExists, PICAM_ActiveLeftMarginRelevant, PicamParameter_ActiveLeftMargin); - piCreateAndIndexPIParam(PICAM_ActiveRightMarginString, asynParamInt32, - PICAM_ActiveRightMargin, + status |= piCreateAndIndexPIParam(PICAM_ActiveRightMarginString, asynParamInt32, + PICAM_ActiveRightMargin, PICAM_ActiveRightMarginExists, PICAM_ActiveRightMarginRelevant, PicamParameter_ActiveRightMargin); - piCreateAndIndexPIParam(PICAM_ActiveTopMarginString, asynParamInt32, - PICAM_ActiveTopMargin, + status |= piCreateAndIndexPIParam(PICAM_ActiveTopMarginString, asynParamInt32, + PICAM_ActiveTopMargin, PICAM_ActiveTopMarginExists, PICAM_ActiveTopMarginRelevant, PicamParameter_ActiveTopMargin); - piCreateAndIndexPIParam(PICAM_ActiveWidthString, asynParamInt32, - PICAM_ActiveWidth, + status |= piCreateAndIndexPIParam(PICAM_ActiveWidthString, asynParamInt32, + PICAM_ActiveWidth, PICAM_ActiveWidthExists, PICAM_ActiveWidthRelevant, PicamParameter_ActiveWidth); - piCreateAndIndexPIParam(PICAM_MaskedBottomMarginString, asynParamInt32, - PICAM_MaskedBottomMargin, + status |= piCreateAndIndexPIParam(PICAM_MaskedBottomMarginString, asynParamInt32, + PICAM_MaskedBottomMargin, PICAM_MaskedBottomMarginExists, PICAM_MaskedBottomMarginRelevant, PicamParameter_MaskedBottomMargin); - piCreateAndIndexPIParam(PICAM_MaskedHeightString, asynParamInt32, - PICAM_MaskedHeight, + status |= piCreateAndIndexPIParam(PICAM_MaskedHeightString, asynParamInt32, + PICAM_MaskedHeight, PICAM_MaskedHeightExists, PICAM_MaskedHeightRelevant, PicamParameter_MaskedHeight); - piCreateAndIndexPIParam(PICAM_MaskedTopMarginString, asynParamInt32, - PICAM_MaskedTopMargin, + status |= piCreateAndIndexPIParam(PICAM_MaskedTopMarginString, asynParamInt32, + PICAM_MaskedTopMargin, PICAM_MaskedTopMarginExists, PICAM_MaskedTopMarginRelevant, PicamParameter_MaskedTopMargin); - piCreateAndIndexPIParam(PICAM_SecondaryActiveHeightString, asynParamInt32, - PICAM_SecondaryActiveHeight, + status |= piCreateAndIndexPIParam(PICAM_SecondaryActiveHeightString, asynParamInt32, + PICAM_SecondaryActiveHeight, PICAM_SecondaryActiveHeightExists, PICAM_SecondaryActiveHeightRelevant, PicamParameter_SecondaryActiveHeight); - piCreateAndIndexPIParam(PICAM_SecondaryMaskedHeightString, asynParamInt32, - PICAM_SecondaryMaskedHeight, + status |= piCreateAndIndexPIParam(PICAM_SecondaryMaskedHeightString, asynParamInt32, + PICAM_SecondaryMaskedHeight, PICAM_SecondaryMaskedHeightExists, PICAM_SecondaryMaskedHeightRelevant, PicamParameter_SecondaryMaskedHeight); //Sensor Cleaning - piCreateAndIndexPIParam(PICAM_CleanBeforeExposureString, asynParamInt32, - PICAM_CleanBeforeExposure, + status |= piCreateAndIndexPIParam(PICAM_CleanBeforeExposureString, asynParamInt32, + PICAM_CleanBeforeExposure, PICAM_CleanBeforeExposureExists, PICAM_CleanBeforeExposureRelevant, PicamParameter_CleanBeforeExposure); - piCreateAndIndexPIParam(PICAM_CleanCycleCountString, asynParamInt32, - PICAM_CleanCycleCount, + status |= piCreateAndIndexPIParam(PICAM_CleanCycleCountString, asynParamInt32, + PICAM_CleanCycleCount, PICAM_CleanCycleCountExists, PICAM_CleanCycleCountRelevant, PicamParameter_CleanCycleCount); - piCreateAndIndexPIParam(PICAM_CleanCycleHeightString, asynParamInt32, - PICAM_CleanCycleHeight, + status |= piCreateAndIndexPIParam(PICAM_CleanCycleHeightString, asynParamInt32, + PICAM_CleanCycleHeight, PICAM_CleanCycleHeightExists, PICAM_CleanCycleHeightRelevant, PicamParameter_CleanCycleHeight); - piCreateAndIndexPIParam(PICAM_CleanSectionFinalHeightString, asynParamInt32, - PICAM_CleanSectionFinalHeight, + status |= piCreateAndIndexPIParam(PICAM_CleanSectionFinalHeightString, asynParamInt32, + PICAM_CleanSectionFinalHeight, PICAM_CleanSectionFinalHeightExists, PICAM_CleanSectionFinalHeightRelevant, PicamParameter_CleanSectionFinalHeight); - piCreateAndIndexPIParam(PICAM_CleanSectionFinalHeightCountString, asynParamInt32, - PICAM_CleanSectionFinalHeightCount, + status |= piCreateAndIndexPIParam(PICAM_CleanSectionFinalHeightCountString, asynParamInt32, + PICAM_CleanSectionFinalHeightCount, PICAM_CleanSectionFinalHeightCountExists, PICAM_CleanSectionFinalHeightCountRelevant, PicamParameter_CleanSectionFinalHeightCount); - piCreateAndIndexPIParam(PICAM_CleanSerialRegisterString, asynParamInt32, - PICAM_CleanSerialRegister, + status |= piCreateAndIndexPIParam(PICAM_CleanSerialRegisterString, asynParamInt32, + PICAM_CleanSerialRegister, PICAM_CleanSerialRegisterExists, PICAM_CleanSerialRegisterRelevant, PicamParameter_CleanSerialRegister); - piCreateAndIndexPIParam(PICAM_CleanUntilTriggerString, asynParamInt32, - PICAM_CleanUntilTrigger, + status |= piCreateAndIndexPIParam(PICAM_CleanUntilTriggerString, asynParamInt32, + PICAM_CleanUntilTrigger, PICAM_CleanUntilTriggerExists, PICAM_CleanUntilTriggerRelevant, PicamParameter_CleanUntilTrigger); //Sensor Temperature - piCreateAndIndexPIParam(PICAM_DisableCoolingFanString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_DisableCoolingFanString, asynParamInt32, PICAM_DisableCoolingFan, PICAM_DisableCoolingFanExists, PICAM_DisableCoolingFanRelevant, PicamParameter_DisableCoolingFan); - piCreateAndIndexPIParam(PICAM_EnableSensorWindowHeaterString, asynParamInt32, + status |= piCreateAndIndexPIParam(PICAM_EnableSensorWindowHeaterString, asynParamInt32, PICAM_EnableSensorWindowHeater, PICAM_EnableSensorWindowHeaterExists, PICAM_EnableSensorWindowHeaterRelevant, PicamParameter_EnableSensorWindowHeater); - piCreateAndIndexADParam(PICAM_SensorTemperatureReadingString, + status |= piCreateAndIndexADParam(PICAM_SensorTemperatureReadingString, ADTemperatureActual, PICAM_SensorTemperatureReadingExists, PICAM_SensorTemperatureReadingRelevant, PicamParameter_SensorTemperatureReading); - piCreateAndIndexADParam(PICAM_SensorTemperatureSetPointString, + status |= piCreateAndIndexADParam(PICAM_SensorTemperatureSetPointString, ADTemperature, PICAM_SensorTemperatureSetPointExists, PICAM_SensorTemperatureSetPointRelevant, PicamParameter_SensorTemperatureSetPoint); - piCreateAndIndexPIParam(PICAM_SensorTemperatureStatusString, asynParamOctet, + status |= piCreateAndIndexPIParam(PICAM_SensorTemperatureStatusString, asynParamOctet, PICAM_SensorTemperatureStatus, PICAM_SensorTemperatureStatusExists, PICAM_SensorTemperatureStatusRelevant, PicamParameter_SensorTemperatureStatus); // Display aids - createParam(PICAM_EnableROIMinXInputString, asynParamInt32, - &PICAM_EnableROIMinXInput); - createParam(PICAM_EnableROISizeXInputString, asynParamInt32, - &PICAM_EnableROISizeXInput); - createParam(PICAM_EnableROIMinYInputString, asynParamInt32, - &PICAM_EnableROIMinYInput); - createParam(PICAM_EnableROISizeYInputString, asynParamInt32, - &PICAM_EnableROISizeYInput); - - status = setStringParam(ADManufacturer, "Princeton Instruments"); + status |= createParam(PICAM_EnableROIMinXInputString, asynParamInt32, + &PICAM_EnableROIMinXInput); + status |= createParam(PICAM_EnableROISizeXInputString, asynParamInt32, + &PICAM_EnableROISizeXInput); + status |= createParam(PICAM_EnableROIMinYInputString, asynParamInt32, + &PICAM_EnableROIMinYInput); + status |= createParam(PICAM_EnableROISizeYInputString, asynParamInt32, + &PICAM_EnableROISizeYInput); + + status |= setStringParam(ADManufacturer, "Princeton Instruments"); status |= setStringParam(ADModel, "Not Connected"); status |= setIntegerParam(NDArraySize, 0); status |= setIntegerParam(NDDataType, NDUInt16); @@ -877,18 +886,23 @@ ADPICam::ADPICam(const char *portName, int maxBuffers, size_t maxMemory, status |= setStringParam(PICAM_SensorNameUnavailable, emptyStr); status |= setStringParam(PICAM_SerialNumberUnavailable, emptyStr); status |= setStringParam(PICAM_FirmwareRevisionUnavailable, emptyStr); - status |= setIntegerParam(ADNumImagesCounter, 1); status |= setIntegerParam(PICAM_EnableROIMinXInput, enableDisplay); status |= setIntegerParam(PICAM_EnableROISizeXInput, enableDisplay); status |= setIntegerParam(PICAM_EnableROIMinYInput, enableDisplay); status |= setIntegerParam(PICAM_EnableROISizeYInput, enableDisplay); - callParamCallbacks(); - piLoadAvailableCameraIDs(); - setIntegerParam(PICAM_AvailableCameras, 0); - callParamCallbacks(); + status |= piLoadAvailableCameraIDs(); + + if (selectedCamera != 0) + status |= piSetSelectedCamera(pasynUserSelf, selectedCamera); + + if (currentCameraHandle != NULL) + status |= piSetParameterValuesFromSelectedCamera(); + + status |= setIntegerParam(PICAM_AvailableCameras, 0); + status |= callParamCallbacks(); - piLoadUnavailableCameraIDs(); + status |= piLoadUnavailableCameraIDs(); if (status) { asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, "%s:%s: unable to set camera parameters\n", driverName, @@ -902,7 +916,7 @@ ADPICam::ADPICam(const char *portName, int maxBuffers, size_t maxMemory, epicsThreadGetStackSize(epicsThreadStackMedium), (EPICSTHREADFUNC)piHandleNewImageTaskC, this) == NULL); - initializeDetector(); + status |= initializeDetector(); epicsAtExit(exitCallbackC, this); } @@ -940,8 +954,7 @@ asynStatus ADPICam::initializeDetector() { piint versionMajor, versionMinor, versionDistribution, versionReleased; static const char* functionName = "initializeDetector"; - const char *errorString; - bool retVal = true; + const char *errorString=NULL; char picamVersion[16]; int status = asynSuccess; PicamError error; @@ -996,17 +1009,16 @@ asynStatus ADPICam::readEnum(asynUser *pasynUser, char *strings[], int values[], int status = asynSuccess; char enumString[64]; const char *modelString; - const char *NAString = "N.A. 0"; PicamParameter picamParameter; int function = pasynUser->reason; - asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, "*******%s:%s: entry\n", + asynPrint(pasynUser, ASYN_TRACE_FLOW, "*******%s:%s: entry\n", driverName, functionName); *nIn = 0; if (function == PICAM_AvailableCameras) { - asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, "Getting Available IDs\n"); - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + asynPrint(pasynUser, ASYN_TRACE_FLOW, "Getting Available IDs\n"); + asynPrint(pasynUser, ASYN_TRACEIO_DEVICE, "%s:%s availableCamerasCount %d\n", driverName, functionName, availableCamerasCount); for (int ii = 0; ii < availableCamerasCount; ii++) { @@ -1014,8 +1026,8 @@ asynStatus ADPICam::readEnum(asynUser *pasynUser, char *strings[], int values[], (piint) availableCameraIDs[ii].model, &modelString); pibln camConnected = false; Picam_IsCameraIDConnected(availableCameraIDs, &camConnected); - sprintf(enumString, "%s", modelString); - asynPrint(pasynUser, ASYN_TRACE_FLOW, + epicsSnprintf(enumString, sizeof(enumString)-1, "#%s %s", availableCameraIDs[ii].serial_number, modelString); + asynPrint(pasynUser, ASYN_TRACEIO_DEVICE, "\n%s:%s: \nCamera[%d]\n---%s\n---%d\n---%s\n---%s\n", driverName, functionName, ii, modelString, availableCameraIDs[ii].computer_interface, @@ -1033,12 +1045,12 @@ asynStatus ADPICam::readEnum(asynUser *pasynUser, char *strings[], int values[], } } else if (function == PICAM_UnavailableCameras) { - asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, "Getting Unavailable IDs\n"); + asynPrint(pasynUser, ASYN_TRACE_FLOW, "Getting Unavailable IDs\n"); for (int ii = 0; ii < unavailableCamerasCount; ii++) { Picam_GetEnumerationString(PicamEnumeratedType_Model, (piint) unavailableCameraIDs[ii].model, &modelString); sprintf(enumString, "%s", modelString); - asynPrint(pasynUser, ASYN_TRACE_FLOW, + asynPrint(pasynUser, ASYN_TRACEIO_DEVICE, "\n%s:%s: \nCamera[%d]\n---%s\n---%d\n---%s\n---%s\n", driverName, functionName, ii, modelString, unavailableCameraIDs[ii].computer_interface, @@ -1064,11 +1076,11 @@ asynStatus ADPICam::readEnum(asynUser *pasynUser, char *strings[], int values[], nElements, nIn); } if (status) { - asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, + asynPrint(pasynUser, ASYN_TRACE_FLOW, "%s:%s: error calling enum functions, status=%d\n", driverName, functionName, status); } - asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, "%s:%s: exit\n", driverName, + asynPrint(pasynUser, ASYN_TRACE_FLOW, "%s:%s: exit\n", driverName, functionName); return asynSuccess; } @@ -1079,79 +1091,83 @@ asynStatus ADPICam::readEnum(asynUser *pasynUser, char *strings[], int values[], */ asynStatus ADPICam::readOctet(asynUser *pasynUser, char *value, size_t nChars, size_t *nActual, - int *eomReason) + int *eomReason) { - static const char *functionName = "readOctet"; - int status = asynSuccess; - pibln parameterDoesExist; - pibln parameterRelevant; - piint intValue; - int function = pasynUser->reason; - PicamParameter picamParameter; - PicamValueType valueType; - PicamEnumeratedType enumType; - PicamError error; - const char *errString; - const char *enumString; - - if ( piLookupPICamParameter(function, picamParameter) == PicamError_None) { - Picam_DoesParameterExist(currentCameraHandle, - picamParameter, - ¶meterDoesExist); - if (parameterDoesExist){ - error = Picam_IsParameterRelevant(currentCameraHandle, - picamParameter, - ¶meterRelevant); - } - else{ + static const char *functionName = "readOctet"; + int status = asynSuccess; + pibln parameterDoesExist = 0; + pibln parameterRelevant = 0; + piint intValue; + int function = pasynUser->reason; + PicamParameter picamParameter; + PicamValueType valueType; + PicamError error = PicamError_None; + const char *errString = NULL; + const char *enumString = NULL; + + if ( piLookupPICamParameter(function, picamParameter) == PicamError_None) { + error = Picam_DoesParameterExist(currentCameraHandle, + picamParameter, + ¶meterDoesExist); + if ((parameterDoesExist) && (error == PicamError_None)) { + error = Picam_IsParameterRelevant(currentCameraHandle, + picamParameter, + ¶meterRelevant); + } + else{ strncpy (value, "", 1); value[nChars-1] = '\0'; *nActual = strlen(value); return asynSuccess; - } - if (error != PicamError_None){ - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, &errString); - asynPrint(pasynUser, ASYN_TRACE_ERROR, - "%s:%s Trouble determining if parameter is relevant: %s\n"); - return asynError; - } - if (parameterRelevant){ - Picam_GetParameterValueType(currentCameraHandle, - picamParameter, - &valueType); - switch (valueType) { - case PicamValueType_Enumeration: - Picam_GetParameterEnumeratedType(currentCameraHandle, - picamParameter, - &enumType); - Picam_GetParameterIntegerValue(currentCameraHandle, - picamParameter, - &intValue); - Picam_GetEnumerationString(enumType, intValue, &enumString); - asynPrint (pasynUserSelf, ASYN_TRACE_FLOW, - "%s:%s ----readOctet value=%s\n", - driverName, - functionName, - enumString); - strncpy (value, enumString, nChars); - value[nChars-1] = '\0'; - *nActual = strlen(value); - Picam_DestroyString(enumString); - break; - } - } - } - else { + } + if (error != PicamError_None){ + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, &errString); + asynPrint(pasynUser, ASYN_TRACE_ERROR, + "%s:%s Trouble determining if parameter is relevant: %s\n", driverName, __func__, errString); + Picam_DestroyString(errString); + return asynError; + } + if (parameterRelevant){ + error = Picam_GetParameterValueType(currentCameraHandle, + picamParameter, + &valueType); + switch (valueType) { + case PicamValueType_Enumeration: + PicamEnumeratedType enumType; + if (error == PicamError_None) + error = Picam_GetParameterEnumeratedType(currentCameraHandle, + picamParameter, + &enumType); + if (error == PicamError_None) + error = Picam_GetParameterIntegerValue(currentCameraHandle, + picamParameter, + &intValue); + if (error == PicamError_None) + error = Picam_GetEnumerationString(enumType, intValue, &enumString); + asynPrint(pasynUser, ASYN_TRACE_FLOW, + "%s:%s ----readOctet value=%s\n", + driverName, + functionName, + enumString); + strncpy (value, enumString, nChars); + value[nChars-1] = '\0'; + *nActual = strlen(value); + Picam_DestroyString(enumString); + break; + } + } + } + else { /* If this parameter belongs to a base class call its method */ if (function < PICAM_FIRST_PARAM) { status = ADDriver::readOctet(pasynUser, value, nChars, nActual, - eomReason); + eomReason); } - } + } - return (asynStatus)status; + return (asynStatus)status; } /** @@ -1161,10 +1177,10 @@ void ADPICam::report(FILE *fp, int details) { static const char *functionName = "report"; PicamError error = PicamError_None; pibln picamInitialized; - const char *modelString; + const char *modelString=NULL; char enumString[64]; - const PicamRoisConstraint *roisConstraints; - const char *errorString; + const PicamRoisConstraint *roisConstraints=NULL; + const char *errorString=NULL; fprintf(fp, "############ %s:%s ###############\n", driverName, functionName); @@ -1211,9 +1227,9 @@ void ADPICam::report(FILE *fp, int details) { if (details > 7) { fprintf(fp, "--------------------\n"); fprintf(fp, " Parameters\n"); - const PicamParameter *parameterList; - PicamConstraintType constraintType; - piint parameterCount; + const PicamParameter *parameterList = NULL; + PicamConstraintType constraintType = PicamConstraintType_None; + piint parameterCount = 0; Picam_GetParameters(currentCameraHandle, ¶meterList, ¶meterCount); for (int ii = 0; ii < parameterCount; ii++) { @@ -1268,25 +1284,25 @@ void ADPICam::report(FILE *fp, int details) { "----- Rules 0x%x\n", // "--X bin min %d, X bin max %d\n" // "--Y bin min %d, Y bin max %d\n", - roisConstraints->x_constraint.minimum, - roisConstraints->x_constraint.maximum, - roisConstraints->y_constraint.minimum, - roisConstraints->y_constraint.maximum, - roisConstraints->width_constraint.minimum, - roisConstraints->width_constraint.maximum, - roisConstraints->height_constraint.minimum, - roisConstraints->height_constraint.maximum, + int(roisConstraints->x_constraint.minimum + 0.5), + int(roisConstraints->x_constraint.maximum + 0.5), + int(roisConstraints->y_constraint.minimum + 0.5), + int(roisConstraints->y_constraint.maximum + 0.5), + int(roisConstraints->width_constraint.minimum + 0.5), + int(roisConstraints->width_constraint.maximum + 0.5), + int(roisConstraints->height_constraint.minimum + 0.5), + int(roisConstraints->height_constraint.maximum + 0.5), roisConstraints->rules); - fprintf(fp, "-----x_binning_limits:\n"); - for (int jj = 0; jj < roisConstraints->x_binning_limits_count; jj++) { - fprintf(fp, "------ %d\n", - roisConstraints->x_binning_limits_array[jj]); - } - fprintf(fp, "-----y_binning_limits:\n"); - for (int kk = 0; kk < roisConstraints->y_binning_limits_count; kk++) { - fprintf(fp, "------ %d\n", - roisConstraints->y_binning_limits_array[kk]); - } + fprintf(fp, "-----x_binning_limits:\n"); + for (int jj = 0; jj < roisConstraints->x_binning_limits_count; jj++) { + fprintf(fp, "------ %d\n", + roisConstraints->x_binning_limits_array[jj]); + } + fprintf(fp, "-----y_binning_limits:\n"); + for (int kk = 0; kk < roisConstraints->y_binning_limits_count; kk++) { + fprintf(fp, "------ %d\n", + roisConstraints->y_binning_limits_array[kk]); + } // roisConstraints->x_.minimum, // roisConstraints->x_constraint.minimum); @@ -1333,7 +1349,7 @@ void ADPICam::report(FILE *fp, int details) { case PicamValueType_LargeInteger: for (int cc = 0; cc < collectionConstraint->values_count; cc++) { - fprintf(fp, "------ %d\n", + fprintf(fp, "------ %lld\n", (pi64s) collectionConstraint->values_array[cc]); } break; @@ -1387,26 +1403,26 @@ asynStatus ADPICam::writeFloat64(asynUser *pasynUser, epicsFloat64 value) { int function = pasynUser->reason; PicamParameter picamParameter; - asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, "%s:%s: entry\n", driverName, + asynPrint(pasynUser, ASYN_TRACE_FLOW, "%s:%s: entry\n", driverName, functionName); // Make sure that we write the value to the param. This may get changed // at a later stage - setDoubleParam(function, value); + status |= setDoubleParam(function, value); if (piLookupPICamParameter(function, picamParameter) == - PicamError_None){ - pibln isRelevant; - error = Picam_IsParameterRelevant(currentCameraHandle, - picamParameter, - &isRelevant); - if (error == PicamError_ParameterDoesNotExist){ - isRelevant = false; - } - else if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); + PicamError_None){ + pibln isRelevant; + error = Picam_IsParameterRelevant(currentCameraHandle, + picamParameter, + &isRelevant); + if (error == PicamError_ParameterDoesNotExist){ + isRelevant = false; + } + else if (error != PicamError_None) { + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, "%s:%s Trouble getting parameter associated with driver" " param %d, picam param:%d: %s\n", @@ -1417,12 +1433,12 @@ asynStatus ADPICam::writeFloat64(asynUser *pasynUser, epicsFloat64 value) { errorString); Picam_DestroyString(errorString); return asynError; - } - if (isRelevant && currentCameraHandle != NULL) { - PicamConstraintType constraintType; - error = Picam_GetParameterConstraintType(currentCameraHandle, - picamParameter, - &constraintType); + } + if (isRelevant && currentCameraHandle != NULL) { + PicamConstraintType constraintType; + error = Picam_GetParameterConstraintType(currentCameraHandle, + picamParameter, + &constraintType); if (error != PicamError_None){ Picam_GetEnumerationString(PicamEnumeratedType_Error, error, @@ -1444,31 +1460,31 @@ asynStatus ADPICam::writeFloat64(asynUser *pasynUser, epicsFloat64 value) { picamParameter); } else if (constraintType == PicamConstraintType_Collection) { - error = Picam_SetParameterFloatingPointValue(currentCameraHandle, - picamParameter, (piflt) value); - if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, error, - &errorString); - - asynPrint(pasynUser, ASYN_TRACE_ERROR, - "%s:%s error writing Float64 value to %f\n" - "Reason %s\n", - driverName, - functionName, - value, - errorString); - Picam_DestroyString(errorString); - return asynError; - } + error = Picam_SetParameterFloatingPointValue(currentCameraHandle, + picamParameter, (piflt) value); + if (error != PicamError_None) { + Picam_GetEnumerationString(PicamEnumeratedType_Error, error, + &errorString); + + asynPrint(pasynUser, ASYN_TRACE_ERROR, + "%s:%s error writing Float64 value to %f\n" + "Reason %s\n", + driverName, + functionName, + value, + errorString); + Picam_DestroyString(errorString); + return asynError; + } } else if (constraintType==PicamConstraintType_None) { - status |= Picam_SetParameterFloatingPointValue( - currentCameraHandle, - picamParameter, - value); + error = Picam_SetParameterFloatingPointValue( + currentCameraHandle, + picamParameter, + value); } - } + } } else { /* If this parameter belongs to a base class call its method */ if (function < PICAM_FIRST_PARAM) { @@ -1477,7 +1493,7 @@ asynStatus ADPICam::writeFloat64(asynUser *pasynUser, epicsFloat64 value) { } /* Do callbacks so higher layers see any changes */ - callParamCallbacks(); + status |= callParamCallbacks(); if (status) { asynPrint(pasynUser, ASYN_TRACE_ERROR, @@ -1485,11 +1501,9 @@ asynStatus ADPICam::writeFloat64(asynUser *pasynUser, epicsFloat64 value) { functionName, status, function, value); } else { - asynPrint(pasynUser, ASYN_TRACEIO_DRIVER, + asynPrint(pasynUser, ASYN_TRACE_FLOW, "%s:%s: function=%d, value=%f\n", driverName, functionName, function, value); - asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, "%s:%s: exit\n", driverName, - functionName); } return (asynStatus) status; @@ -1503,26 +1517,19 @@ asynStatus ADPICam::writeInt32(asynUser *pasynUser, epicsInt32 value) { int status = asynSuccess; PicamError error = PicamError_None; const char* errorString; - int sizeX, sizeY, binX, binY, minX, minY; int function = pasynUser->reason; PicamParameter picamParameter; int adStatus; int acquiring; // Record status and acquire for use later - getIntegerParam(ADStatus, &adStatus); - getIntegerParam(ADAcquire, &acquiring); - - // Make sure that we write the value to the param. This may get changed - // at a later stage - setIntegerParam(function, value); - + status |= getIntegerParam(ADStatus, &adStatus); + status |= getIntegerParam(ADAcquire, &acquiring); if (function == PICAM_AvailableCameras) { - status |= piSetSelectedCamera(pasynUser, (int) value); - status |= piSetParameterValuesFromSelectedCamera(); + status |= piSetSelectedCamera(pasynUser, (int)value); } else if (function == PICAM_UnavailableCameras) { - piSetSelectedUnavailableCamera(pasynUser, (int) value); + status |= piSetSelectedUnavailableCamera(pasynUser, (int)value); } else if (piLookupPICamParameter(function, picamParameter) == PicamError_None) { pibln isRelevant; @@ -1533,7 +1540,7 @@ asynStatus ADPICam::writeInt32(asynUser *pasynUser, epicsInt32 value) { isRelevant = false; } else if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, + Picam_GetEnumerationString(PicamEnumeratedType_Error, error, &errorString); asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, @@ -1585,76 +1592,71 @@ asynStatus ADPICam::writeInt32(asynUser *pasynUser, epicsInt32 value) { } // AD parameters for ROI size & Bin size need to be mapped into // PICAM's PicamRois object. - else if (function == ADSizeX) { - int xstatus = asynSuccess; - sizeX = value; - xstatus |= getIntegerParam(ADSizeY, &sizeY); - xstatus |= getIntegerParam(ADBinX, &binX); - xstatus |= getIntegerParam(ADBinY, &binY); - xstatus |= getIntegerParam(ADMinX, &minX); - xstatus |= getIntegerParam(ADMinY, &minY); - xstatus |= piSetRois(minX, minY, sizeX, sizeY, binX, binY); - } else if (function == ADSizeY) { - int xstatus = asynSuccess; - xstatus |= getIntegerParam(ADSizeX, &sizeX); - sizeY = value; - xstatus |= getIntegerParam(ADBinX, &binX); - xstatus |= getIntegerParam(ADBinY, &binY); - xstatus |= getIntegerParam(ADMinX, &minX); - xstatus |= getIntegerParam(ADMinY, &minY); - xstatus |= piSetRois(minX, minY, sizeX, sizeY, binX, binY); - } else if (function == ADBinX) { - int xstatus = asynSuccess; - xstatus |= getIntegerParam(ADSizeX, &sizeX); - xstatus |= getIntegerParam(ADSizeY, &sizeY); - binX = value; - xstatus |= getIntegerParam(ADBinY, &binY); - xstatus |= getIntegerParam(ADMinX, &minX); - xstatus |= getIntegerParam(ADMinY, &minY); - xstatus |= piSetRois(minX, minY, sizeX, sizeY, binX, binY); - } else if (function == ADBinY) { - int xstatus = asynSuccess; - xstatus |= getIntegerParam(ADSizeX, &sizeX); - xstatus |= getIntegerParam(ADSizeY, &sizeY); - xstatus |= getIntegerParam(ADBinX, &binX); - binY = value; - xstatus |= getIntegerParam(ADMinX, &minX); - xstatus |= getIntegerParam(ADMinY, &minY); - xstatus |= piSetRois(minX, minY, sizeX, sizeY, binX, binY); - } else if (function == ADMinX) { - int xstatus = asynSuccess; - xstatus |= getIntegerParam(ADSizeX, &sizeX); - xstatus |= getIntegerParam(ADSizeY, &sizeY); - xstatus |= getIntegerParam(ADBinX, &binX); - xstatus |= getIntegerParam(ADBinY, &binY); - minX = value; - xstatus |= getIntegerParam(ADMinY, &minY); - xstatus |= piSetRois(minX, minY, sizeX, sizeY, binX, binY); - } else if (function == ADMinY) { - int xstatus = asynSuccess; - xstatus |= getIntegerParam(ADSizeX, &sizeX); - xstatus |= getIntegerParam(ADSizeY, &sizeY); - xstatus |= getIntegerParam(ADBinX, &binX); - xstatus |= getIntegerParam(ADBinY, &binY); - xstatus |= getIntegerParam(ADMinX, &minX); - minY = value; - xstatus |= piSetRois(minX, minY, sizeX, sizeY, binX, binY); - } else if (function == ADAcquire) { - if (value && !acquiring){ - piAcquireStart(); + else if ((function == ADSizeX) || (function == ADSizeY) || + (function == ADBinX) || (function == ADBinY) || + (function == ADMinX) || (function == ADMinY)) { + int maxSizeX, sizeX, maxSizeY, sizeY, binX, binY, minX, minY; + status |= getIntegerParam(ADSizeX, &sizeX); + status |= getIntegerParam(ADMaxSizeX, &maxSizeX); + status |= getIntegerParam(ADSizeY, &sizeY); + status |= getIntegerParam(ADMaxSizeY, &maxSizeY); + status |= getIntegerParam(ADBinX, &binX); + status |= getIntegerParam(ADBinY, &binY); + status |= getIntegerParam(ADMinX, &minX); + status |= getIntegerParam(ADMinY, &minY); + if (function == ADSizeX) + sizeX = value; + else if (function == ADSizeY) + sizeY = value; + else if (function == ADBinX) + binX = value; + else if (function == ADBinY) + binY = value; + else if (function == ADMinX) + minX = value; + else if (function == ADMinY) + minY = value; + if ((minX + sizeX) > maxSizeX) { + if (function == ADMinX) { + sizeX = maxSizeX - minX; + setIntegerParam(ADSizeX, sizeX); + } + else if (function == ADSizeX) { + minX = maxSizeX - sizeX; + setIntegerParam(ADMinX, minX); + } + } + if ((minY + sizeY) > maxSizeY) { + if (function == ADMinY) { + sizeY = maxSizeY - minY; + setIntegerParam(ADSizeY, sizeY); + } + else if (function == ADSizeY) { + minY = maxSizeY - sizeY; + setIntegerParam(ADMinY, minY); + } + } + status |= ADDriver::writeInt32(pasynUser, value); + status |= piSetSingleRoi(minX, minY, sizeX, sizeY, binX, binY); + } + else if (function == ADAcquire) { + if (value && !acquiring) { + status |= piAcquireStart(pasynUser); } - else if (!value && acquiring){ - piAcquireStop(); + else if (!value && acquiring) { + status |= piAcquireStop(pasynUser); } - } else { + status |= ADDriver::writeInt32(pasynUser, value); + } + else { /* If this parameter belongs to a base class call its method */ if (function < PICAM_FIRST_PARAM) { - status = ADDriver::writeInt32(pasynUser, value); + status |= ADDriver::writeInt32(pasynUser, value); } } /* Do callbacks so higher layers see any changes */ - callParamCallbacks(); + status |= callParamCallbacks(); if (status) { asynPrint(pasynUser, ASYN_TRACE_ERROR, @@ -1671,40 +1673,68 @@ asynStatus ADPICam::writeInt32(asynUser *pasynUser, epicsInt32 value) { } +/* Called to set tracks definition parameters. + Sets up the track defintion. */ +asynStatus ADPICam::writeInt32Array(asynUser *pasynUser, epicsInt32 *value, size_t nElements) +{ + asynStatus status = asynSuccess; + int sizeX, binX, minX; + try { + status = PICAM_CCDMultiTrack.writeInt32Array(pasynUser, value, nElements); + if (status == asynSuccess) + status = getIntegerParam(ADBinX, &binX); + if (status == asynSuccess) + status = getIntegerParam(ADMinX, &minX); + if (status == asynSuccess) + status = getIntegerParam(ADSizeX, &sizeX); + if (status == asynSuccess) + status = piSetMultiRoi(pasynUser, minX, sizeX, binX); + else + status = ADDriver::writeInt32Array(pasynUser, value, nElements); + } + catch (const std::string &e) { + asynPrint(pasynUser, ASYN_TRACE_ERROR, + "%s:%s: %s\n", + driverName, __func__, e.c_str()); + status = asynError; + } + return status; +} + + /** * Internal method called when the Acquire button is pressed. */ -asynStatus ADPICam::piAcquireStart(){ - const char *functionName = "piAcquireStart"; +asynStatus ADPICam::piAcquireStart(asynUser *pasynUser) { int status = asynSuccess; PicamError error = PicamError_None; - int imageMode; - int presetImages; + int imageMode=0; + int presetImages=0; int numX; int numY; // Reset the number of Images Collected - asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, + asynPrint(pasynUser, ASYN_TRACE_FLOW, "%s:%s Enter\n", driverName, __func__); - lock(); - setIntegerParam(ADStatus, ADStatusInitializing); + status |= lock(); + status |= setIntegerParam(ADStatus, ADStatusInitializing); // reset Image counter - setIntegerParam(ADNumImagesCounter, 0); - callParamCallbacks(); - unlock(); - getIntegerParam(ADImageMode, &imageMode); + status |= setIntegerParam(ADNumImagesCounter, 0); + status |= callParamCallbacks(); + status |= unlock(); + status |= getIntegerParam(ADImageMode, &imageMode); /* Get Image size for use by acquisition handling*/ - getIntegerParam(ADSizeX, &numX); - getIntegerParam(ADSizeY, &numY); + status |= getIntegerParam(ADSizeX, &numX); + status |= getIntegerParam(ADSizeY, &numY); imageDims[0] = numX; imageDims[1] = numY; /* get data type for acquistion processing */ piint pixelFormat; - Picam_GetParameterIntegerDefaultValue(currentCameraHandle, + error = Picam_GetParameterIntegerDefaultValue(currentCameraHandle, PicamParameter_PixelFormat, &pixelFormat); switch(pixelFormat){ @@ -1714,12 +1744,12 @@ asynStatus ADPICam::piAcquireStart(){ default: imageDataType = NDUInt16; const char *pixelFormatString; - Picam_GetEnumerationString(PicamEnumeratedType_PixelFormat, + error = Picam_GetEnumerationString(PicamEnumeratedType_PixelFormat, pixelFormat, &pixelFormatString); - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + asynPrint(pasynUser, ASYN_TRACE_ERROR, "%s:%s Unknown data type setting to NDUInt16: %s\n", - driverName, functionName, pixelFormatString); - Picam_DestroyString(pixelFormatString); + driverName, __func__, pixelFormatString); + error = Picam_DestroyString(pixelFormatString); } @@ -1738,72 +1768,76 @@ asynStatus ADPICam::piAcquireStart(){ pi64s largePreset; largePreset = presetImages; - Picam_SetParameterLargeIntegerValue(currentCameraHandle, + error = Picam_SetParameterLargeIntegerValue(currentCameraHandle, PicamParameter_ReadoutCount, largePreset); - int readoutStride; - double onlineReadoutRate; - int timeStampsUsed; - - Picam_GetParameterIntegerValue(currentCameraHandle, - PicamParameter_ReadoutStride, - &readoutStride); - Picam_GetParameterFloatingPointValue(currentCameraHandle, - PicamParameter_OnlineReadoutRateCalculation, - &onlineReadoutRate); - Picam_GetParameterIntegerValue(currentCameraHandle, - PicamParameter_TimeStamps, - &timeStampsUsed); + int readoutStride=0; + double onlineReadoutRate=0; + int timeStampsUsed=0; + + if (error == PicamError_None) + error = Picam_GetParameterIntegerValue(currentCameraHandle, + PicamParameter_ReadoutStride, + &readoutStride); + if (error == PicamError_None) + error = Picam_GetParameterFloatingPointValue(currentCameraHandle, + PicamParameter_OnlineReadoutRateCalculation, + &onlineReadoutRate); + if (error == PicamError_None) + error = Picam_GetParameterIntegerValue(currentCameraHandle, + PicamParameter_TimeStamps, + &timeStampsUsed); pi64s readouts = - static_cast(std::ceil(std::max(6.*onlineReadoutRate, 6.))); - buffer_.resize(readouts * (readoutStride+3*8)); + static_cast(std::ceil(std::max(3.*onlineReadoutRate, 3.))); + buffer_.resize(size_t(readouts * (readoutStride))); PicamAcquisitionBuffer piBuffer; piBuffer.memory = &buffer_[0]; - piBuffer.memory_size = buffer_.size(); + piBuffer.memory_size = buffer_.size() * sizeof(pi16s); - error = PicamAdvanced_SetAcquisitionBuffer(currentDeviceHandle, &piBuffer); + if (error == PicamError_None) + error = PicamAdvanced_SetAcquisitionBuffer(currentDeviceHandle, &piBuffer); if (error != PicamError_None) { const char *errorString; Picam_GetEnumerationString(PicamEnumeratedType_Error, error, &errorString); - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Error Setting accquisition buffer with size %d: %s\n", + asynPrint(pasynUser, ASYN_TRACE_ERROR, + "%s:%s Error Setting accquisition buffer with size %zu: %s\n", driverName, - functionName, - errorString, - buffer_.size()); + __func__, + buffer_.size(), + errorString); Picam_DestroyString(errorString); - setIntegerParam(ADAcquire, 0); - setIntegerParam(ADStatus, ADStatusError); + status |= setIntegerParam(ADAcquire, 0); + status |= setIntegerParam(ADStatus, ADStatusError); return asynError; } lock(); - setIntegerParam(ADStatus, ADStatusAcquire); - callParamCallbacks(); + status |= setIntegerParam(ADStatus, ADStatusAcquire); + status |= callParamCallbacks(); unlock(); - const PicamParameter *failedParameterArray; - piint failedParameterCount; + const PicamParameter *failedParameterArray=NULL; + piint failedParameterCount = 0; error = Picam_CommitParameters(currentCameraHandle, &failedParameterArray, &failedParameterCount); if (error != PicamError_None) { - const char *errorString; - Picam_GetEnumerationString(PicamEnumeratedType_Error, + const char *errorString=NULL; + error = Picam_GetEnumerationString(PicamEnumeratedType_Error, error, &errorString); - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + asynPrint(pasynUser, ASYN_TRACE_ERROR, "%s:%s Error with Picam_CommitParameters: %s\n", driverName, - functionName, + __func__, errorString); const char *paramName; for (int ii=0; iipiSetAcquisitionData(device, available, acqStatus ); - status = ADPICam_Instance->piHandleAcquisitionUpdated(device, + int status = ADPICam_Instance->piHandleAcquisitionUpdated(device, available, acqStatus); - return error; + return PicamError_None; } /** @@ -1915,7 +1952,6 @@ asynStatus ADPICam::piAddDemoCamera(const char *demoCameraName) { PicamError error = PicamError_None; const PicamModel *demoModels; piint demoModelCount; - bool modelFoundInList = false; PicamCameraID demoID; const char *errorString; @@ -1926,24 +1962,23 @@ asynStatus ADPICam::piAddDemoCamera(const char *demoCameraName) { error = Picam_GetAvailableDemoCameraModels(&demoModels, &demoModelCount); if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); - asynPrint(ADPICam_Instance->pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Trouble getting list of available Demo Cameras. " - "%s\n", - driverName, - functionName, - errorString); - Picam_DestroyString(errorString); - return asynError; + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + asynPrint(ADPICam_Instance->pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s Trouble getting list of available Demo Cameras. " + "%s\n", + driverName, + functionName, + errorString); + Picam_DestroyString(errorString); + return asynError; } for (int ii = 0; ii < demoModelCount; ii++) { const char* modelString; error = Picam_GetEnumerationString(PicamEnumeratedType_Model, demoModels[ii], &modelString); if (strcmp(demoCameraName, modelString) == 0) { - modelFoundInList = true; error = Picam_ConnectDemoCamera(demoModels[ii], "ADDemo", &demoID); if (error == PicamError_None) { @@ -1966,16 +2001,16 @@ asynStatus ADPICam::piAddDemoCamera(const char *demoCameraName) { } Picam_DestroyModels(demoModels); } else { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); - asynPrint(ADPICam_Instance->pasynUserSelf, ASYN_TRACE_ERROR, - "%s%s PICAM is not initialized. Cannot add a camera. %s\n", - driverName, - functionName, - errorString); - Picam_DestroyString(errorString); - status = asynError; + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + asynPrint(ADPICam_Instance->pasynUserSelf, ASYN_TRACE_ERROR, + "%s%s PICAM is not initialized. Cannot add a camera. %s\n", + driverName, + functionName, + errorString); + Picam_DestroyString(errorString); + status = asynError; } return (asynStatus) status; @@ -1987,8 +2022,7 @@ asynStatus ADPICam::piAddDemoCamera(const char *demoCameraName) { */ PicamError PIL_CALL ADPICam::piCameraDiscovered(const PicamCameraID *id, PicamHandle device, PicamDiscoveryAction action) { - int status; - status = ADPICam_Instance->piHandleCameraDiscovery(id, device, action); + int status = ADPICam_Instance->piHandleCameraDiscovery(id, device, action); return PicamError_None; } @@ -2171,8 +2205,8 @@ asynStatus ADPICam::piLoadAvailableCameraIDs() { } asynStatus ADPICam::piLoadUnavailableCameraIDs() { - PicamError error; - const char *errorString; + PicamError error = PicamError_None; + const char *errorString = NULL; const char *functionName = "piLoadUnavailableCameraIDs"; int status = asynSuccess; @@ -2208,14 +2242,13 @@ asynStatus ADPICam::piLoadUnavailableCameraIDs() { * Parameter. */ int ADPICam::piLookupDriverParameter(PicamParameter parameter) { - const char *functionName = "piLookupDriverParameter"; int driverParameter = -1; - const char *paramString; + const char *paramString=NULL; try { driverParameter = parameterValueMap.at(parameter); } - catch (std::out_of_range e) { + catch (std::out_of_range const&) { Picam_GetEnumerationString(PicamEnumeratedType_Parameter, parameter, ¶mString); asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, @@ -2238,7 +2271,7 @@ PicamError ADPICam::piLookupPICamParameter(int driverParameter, try { parameter = picamParameterMap.at(driverParameter); } - catch (std::out_of_range e) { + catch (std::out_of_range const& /*e*/) { return PicamError_ParameterDoesNotExist; } asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, @@ -2257,18 +2290,18 @@ asynStatus ADPICam::piGenerateListValuesFromCollection( int status = asynSuccess; const PicamCollectionConstraint *constraints; const char *errorString; - const char *paramConstraintString; + const char *paramConstraintString=NULL; const char *parameterName; const char *NAString = "N.A. 0"; pibln paramExists; pibln isRelevant; - PicamError error; + PicamError error = PicamError_None; if (currentCameraHandle != NULL) { - Picam_DoesParameterExist(currentCameraHandle, + error = Picam_DoesParameterExist(currentCameraHandle, picamParam, ¶mExists); - if (paramExists){ + if ((paramExists) && (error == PicamError_None)){ error = Picam_IsParameterRelevant(currentCameraHandle, picamParam, &isRelevant); @@ -2347,22 +2380,38 @@ asynStatus ADPICam::piGenerateListValuesFromCollection( return asynSuccess; } for (int ii = 0; ii < constraints->values_count; ii++) { - PicamEnumeratedType picamParameterET; - Picam_GetParameterEnumeratedType(currentCameraHandle, - picamParam, - &picamParameterET); PicamValueType valType; - Picam_GetParameterValueType(currentCameraHandle, + error = Picam_GetParameterValueType(currentCameraHandle, picamParam, &valType); + if (error != PicamError_None) + { + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + asynPrint(pasynUser, ASYN_TRACE_ERROR, + "%s:%s Trouble getting value type assocoated " + "with driver param %d, picam param:%d: %s\n", + driverName, + __func__, + driverParam, + picamParam, + errorString); + return asynError; + } if (strings[*nIn]) free(strings[*nIn]); switch (valType) { case PicamValueType_Enumeration: - Picam_GetEnumerationString( - picamParameterET, - (int)constraints->values_array[ii], - ¶mConstraintString); + PicamEnumeratedType picamParameterET; + error = Picam_GetParameterEnumeratedType(currentCameraHandle, + picamParam, + &picamParameterET); + if (error == PicamError_None) + error = Picam_GetEnumerationString( + picamParameterET, + (int)constraints->values_array[ii], + ¶mConstraintString); asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, "%s:%s ---%s\n", driverName, @@ -2401,7 +2450,7 @@ asynStatus ADPICam::piGenerateListValuesFromCollection( break; case PicamValueType_LargeInteger: char largeIntString[12]; - sprintf(largeIntString, "%d", + sprintf(largeIntString, "%lld", (pi64s)constraints->values_array[ii]); strings[*nIn] = epicsStrDup(largeIntString); values[*nIn] = (int)constraints->values_array[ii]; @@ -2473,21 +2522,20 @@ asynStatus ADPICam::piHandleAcquisitionUpdated( const PicamAvailableData *available, const PicamAcquisitionStatus *acqStatus) { - const char * functionName = "piHandleAcquisitionUpdated"; int status = asynSuccess; dataLock.lock(); acqStatusRunning = acqStatus->running; acqStatusErrors = acqStatus->errors; acqStatusReadoutRate = acqStatus->readout_rate; - asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, - "%s:%s available %d\n", - driverName, - __func__, - available); // if ( (acqStatusErrors == PicamAcquisitionErrorsMask_None) && // acqStatusRunning){ if (available && available->readout_count){ + asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, + "%s:%s available %d\n", + driverName, + __func__, + available->readout_count); acqAvailableInitialReadout = available->initial_readout; acqAvailableReadoutCount = available->readout_count; epicsEventSignal(piHandleNewImageEvent); @@ -2517,8 +2565,8 @@ asynStatus ADPICam::piHandleCameraDiscovery(const PicamCameraID *id, driverName, functionName); - piLoadAvailableCameraIDs(); - piUpdateAvailableCamerasList(); + status |= piLoadAvailableCameraIDs(); + status |= piUpdateAvailableCamerasList(); switch (action) { case PicamDiscoveryAction_Found: Picam_GetEnumerationString(PicamEnumeratedType_Model, id->model, @@ -2528,8 +2576,8 @@ asynStatus ADPICam::piHandleCameraDiscovery(const PicamCameraID *id, Picam_DestroyString(modelString); if (device != NULL) { PicamHandle discoveredModel; - PicamAdvanced_GetCameraModel(device, &discoveredModel); - printf(" discovered %s, current, %s\n", discoveredModel, + error = PicamAdvanced_GetCameraModel(device, &discoveredModel); + printf(" discovered %p, current, %p\n", discoveredModel, currentCameraHandle); if (discoveredModel == currentCameraHandle) { piSetSelectedCamera(pasynUserSelf, selectedCameraIndex); @@ -2547,7 +2595,7 @@ asynStatus ADPICam::piHandleCameraDiscovery(const PicamCameraID *id, if (device != NULL) { PicamHandle discoveredModel; PicamAdvanced_GetCameraModel(device, &discoveredModel); - printf(" discovered %s, current, %s", discoveredModel, + printf(" discovered %p, current, %p", discoveredModel, currentCameraHandle); if (discoveredModel == currentCameraHandle) { setStringParam(PICAM_CameraInterface, notAvailable); @@ -2607,7 +2655,7 @@ asynStatus ADPICam::piHandleParameterFloatingPointValueChanged( ¶meterString); asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, "%s:%s Setting PICAM parameter %s to driverParameter %d, " - "value %f\n", + "value %f\n", driverName, functionName, parameterString, driverParameter, value); PicamConstraintType paramCT; @@ -2660,16 +2708,16 @@ asynStatus ADPICam::piHandleParameterFloatingPointValueChanged( status |= setDoubleParam(driverParameter, value); break; } - } else { - // Notify that handling a parameter is about to fall on the floor - // unhandled - Picam_GetEnumerationString(PicamEnumeratedType_Parameter, parameter, - ¶meterString); - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Parameter %s floating point value Changed to %f. " - "This change is not handled.\n", driverName, - functionName, parameterString, value); - Picam_DestroyString(parameterString); + } else { + // Notify that handling a parameter is about to fall on the floor + // unhandled + Picam_GetEnumerationString(PicamEnumeratedType_Parameter, parameter, + ¶meterString); + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s Parameter %s floating point value Changed to %f. " + "This change is not handled.\n", driverName, + functionName, parameterString, value); + Picam_DestroyString(parameterString); } callParamCallbacks(); asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, "%s:%s Exit\n", driverName, @@ -2705,7 +2753,7 @@ asynStatus ADPICam::piHandleParameterIntegerValueChanged(PicamHandle camera, ¶meterString); asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, "%s:%s Setting PICAM parameter %s to driverParameter %d, " - "value %f\n", + "value %d\n", driverName, functionName, parameterString, driverParameter, value); Picam_DestroyString(parameterString); @@ -2754,7 +2802,22 @@ asynStatus ADPICam::piHandleParameterIntegerValueChanged(PicamHandle camera, } break; default: - status = setIntegerParam(driverParameter, value); + asynParamType type; + status = getParamType(driverParameter, &type); + if (type == asynParamOctet) + { + PicamEnumeratedType enumType; + const char* enumString = NULL; + error = Picam_GetParameterEnumeratedType(currentCameraHandle, + parameter, + &enumType); + if (error == PicamError_None) + error = Picam_GetEnumerationString(enumType, value, &enumString); + setStringParam(driverParameter, enumString); + Picam_DestroyString(enumString); + } + else + status = setIntegerParam(driverParameter, value); } } else { // Pass along to method that lets you know that a parameter change is @@ -2805,21 +2868,21 @@ asynStatus ADPICam::piHandleParameterLargeIntegerValueChanged( ¶meterString); asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, "%s:%s Setting PICAM parameter %s to driverParameter %d, " - "value %d long value %d\n", + "value %d long value %ld\n", driverName, functionName, parameterString, driverParameter, value, lValue); Picam_DestroyString(parameterString); - // Notify that handling a parameter is about to fall on the floor unhandled } else { + // Notify that handling a parameter is about to fall on the floor unhandled Picam_GetEnumerationString(PicamEnumeratedType_Parameter, parameter, ¶meterString); asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Parameter %s large integer value Changed %d.\n" - "This change was unhandled\n", + "%s:%s Parameter %s large integer value Changed %d.\n" + "This change was unhandled\n", driverName, - functionName, - parameterString, - value); + functionName, + parameterString, + value); Picam_DestroyString(parameterString); } @@ -2867,7 +2930,7 @@ asynStatus ADPICam::piHandleParameterPulseValueChanged(PicamHandle camera, functionName); Picam_GetEnumerationString(PicamEnumeratedType_Parameter, parameter, ¶meterString); - printf("parameter %s Pulse value Changed to %f\n", parameterString, value); + printf("parameter %s Pulse value Changed to %f %f\n", parameterString, value->delay, value->width); Picam_DestroyString(parameterString); asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, "%s:%s Exit\n", driverName, @@ -2896,16 +2959,16 @@ asynStatus ADPICam::piHandleParameterRelevanceChanged(PicamHandle camera, status = piSetParameterRelevance(pasynUserSelf, parameter, (int) relevant); if (relevant != 0) { - Picam_GetParameterConstraintType(currentCameraHandle, - parameter, - &constraintType); - Picam_GetParameterValueType(currentCameraHandle, parameter, &valueType); - driverParameter = piLookupDriverParameter(parameter); - if ((driverParameter > 0) && - ((constraintType == PicamConstraintType_Collection) || - (valueType == PicamValueType_Enumeration))) { - piUpdateParameterListValues(parameter, driverParameter); - } + Picam_GetParameterConstraintType(currentCameraHandle, + parameter, + &constraintType); + Picam_GetParameterValueType(currentCameraHandle, parameter, &valueType); + driverParameter = piLookupDriverParameter(parameter); + if ((driverParameter > 0) && + ((constraintType == PicamConstraintType_Collection) || + (valueType == PicamValueType_Enumeration))) { + piUpdateParameterListValues(parameter, driverParameter); + } } return (asynStatus) status; } @@ -2922,17 +2985,23 @@ asynStatus ADPICam::piHandleParameterRoisValueChanged(PicamHandle camera, Picam_GetEnumerationString(PicamEnumeratedType_Parameter, parameter, ¶meterString); printf("parameter %s Rois value Changed\n", parameterString); - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + for (int Roi = 0; Roi < value->roi_count; Roi++) + { + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, "\n----- minX = %d\n----- minY = %d\n" - "----- sizeX = %d\n----- sizeY = %d\n" - "----- binX = %d\n----- binY = %d\n", value->roi_array[0].x, - value->roi_array[0].y, value->roi_array[0].width, - value->roi_array[0].height, value->roi_array[0].x_binning, + "----- sizeX = %d\n----- sizeY = %d\n" + "----- binX = %d\n----- binY = %d\n", value->roi_array[Roi].x, + value->roi_array[Roi].y, value->roi_array[Roi].width, + value->roi_array[Roi].height, value->roi_array[Roi].x_binning, + value->roi_array[Roi].y_binning); + } + if (value->roi_count == 1) + { + setIntegerParam(NDArraySizeX, value->roi_array[0].width / + value->roi_array[0].x_binning); + setIntegerParam(NDArraySizeY, value->roi_array[0].height / value->roi_array[0].y_binning); - setIntegerParam(NDArraySizeX, value->roi_array[0].width/ - value->roi_array[0].x_binning); - setIntegerParam(NDArraySizeY, value->roi_array[0].height/ - value->roi_array[0].y_binning); + } Picam_DestroyString(parameterString); callParamCallbacks(); @@ -2958,7 +3027,7 @@ PicamError PIL_CALL ADPICam::piParameterFloatingPointValueChanged( camera, parameter, value); if (status != asynSuccess) { - error = PicamError_UnexpectedError; + error = PicamError_UnexpectedError; } return error; @@ -2978,7 +3047,7 @@ PicamError PIL_CALL ADPICam::piParameterIntegerValueChanged(PicamHandle camera, parameter, value); if (status != asynSuccess) { - error = PicamError_UnexpectedError; + error = PicamError_UnexpectedError; } return error; @@ -2998,7 +3067,7 @@ PicamError PIL_CALL ADPICam::piParameterLargeIntegerValueChanged( parameter, value); if (status != asynSuccess) { - error = PicamError_UnexpectedError; + error = PicamError_UnexpectedError; } return error; @@ -3019,7 +3088,7 @@ PicamError PIL_CALL ADPICam::piParameterModulationsValueChanged( parameter, value); if (status != asynSuccess) { - error = PicamError_UnexpectedError; + error = PicamError_UnexpectedError; } return error; @@ -3039,7 +3108,7 @@ PicamError PIL_CALL ADPICam::piParameterPulseValueChanged(PicamHandle camera, parameter, value); if (status != asynSuccess) { - error = PicamError_UnexpectedError; + error = PicamError_UnexpectedError; } return error; @@ -3058,7 +3127,7 @@ PicamError PIL_CALL ADPICam::piParameterRelevanceChanged(PicamHandle camera, parameter, relevent); if (status != asynSuccess) { - error = PicamError_UnexpectedError; + error = PicamError_UnexpectedError; } return error; @@ -3078,7 +3147,7 @@ PicamError PIL_CALL ADPICam::piParameterRoisValueChanged(PicamHandle camera, parameter, value); if (status != asynSuccess) { - error = PicamError_UnexpectedError; + error = PicamError_UnexpectedError; } return error; @@ -3090,8 +3159,8 @@ PicamError PIL_CALL ADPICam::piParameterRoisValueChanged(PicamHandle camera, asynStatus ADPICam::piPrintRoisConstraints() { const char *functionName = "piPrintRoisConstraints"; PicamError error = PicamError_None; - const PicamRoisConstraint *roisConstraints; - const char *errorString; + const PicamRoisConstraint *roisConstraints=NULL; + const char *errorString=NULL; int status = asynSuccess; error = Picam_GetParameterRoisConstraint(currentCameraHandle, @@ -3115,51 +3184,51 @@ asynStatus ADPICam::piPrintRoisConstraints() { */ asynStatus ADPICam::piRegisterConstraintChangeWatch(PicamHandle cameraHandle) { int status = asynSuccess; - piint parameterCount; - const PicamParameter *parameterList; - PicamError error; - const char *errorString; - const char *paramString; + piint parameterCount = 0; + const PicamParameter *parameterList = NULL; + PicamError error = PicamError_None; + const char *errorString = NULL; + const char *paramString = NULL; error = Picam_GetParameters(currentCameraHandle, ¶meterList, ¶meterCount); if (error != PicamError_None) { Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); + error, + &errorString); asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Error: Trouble getting list of parameters for current " - "camera. %s\n", - driverName, - __func__, - errorString); + "%s:%s Error: Trouble getting list of parameters for current " + "camera. %s\n", + driverName, + __func__, + errorString); Picam_DestroyString(errorString); return asynError; } for (int ii = 0; ii < parameterCount; ii++) { //TODO need to change to constraint change watches. These depend on - // parameter types. - error = PicamAdvanced_RegisterForIsRelevantChanged(cameraHandle, + // parameter types. + error = PicamAdvanced_RegisterForIsRelevantChanged(cameraHandle, parameterList[ii], piParameterRelevanceChanged); if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); - Picam_GetEnumerationString(PicamEnumeratedType_Parameter, - parameterList[ii], - ¶mString); - - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Trouble registering ConstraintChange for " - "parameter %s. %s\n", - driverName, - __func__, - paramString, - errorString); - Picam_DestroyString(paramString); - Picam_DestroyString(errorString); - } - } + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + Picam_GetEnumerationString(PicamEnumeratedType_Parameter, + parameterList[ii], + ¶mString); + + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s Trouble registering ConstraintChange for " + "parameter %s. %s\n", + driverName, + __func__, + paramString, + errorString); + Picam_DestroyString(paramString); + Picam_DestroyString(errorString); + } + } return (asynStatus) status; } @@ -3168,24 +3237,24 @@ asynStatus ADPICam::piRegisterConstraintChangeWatch(PicamHandle cameraHandle) { */ asynStatus ADPICam::piRegisterRelevantWatch(PicamHandle cameraHandle) { int status = asynSuccess; - piint parameterCount; - const PicamParameter *parameterList; - PicamError error; - const char *errorString; - const char *paramString; + piint parameterCount = 0; + const PicamParameter *parameterList = NULL; + PicamError error = PicamError_None; + const char *errorString = NULL; + const char *paramString = NULL; error = Picam_GetParameters(currentCameraHandle, ¶meterList, ¶meterCount); if (error != PicamError_None) { Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); + error, + &errorString); asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Error: Trouble getting list of parameters for current " - "camera. %s\n", - driverName, - __func__, - errorString); + "%s:%s Error: Trouble getting list of parameters for current " + "camera. %s\n", + driverName, + __func__, + errorString); Picam_DestroyString(errorString); return asynError; } @@ -3193,22 +3262,22 @@ asynStatus ADPICam::piRegisterRelevantWatch(PicamHandle cameraHandle) { error = PicamAdvanced_RegisterForIsRelevantChanged(cameraHandle, parameterList[ii], piParameterRelevanceChanged); if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); - Picam_GetEnumerationString(PicamEnumeratedType_Parameter, - parameterList[ii], - ¶mString); - - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Trouble registering RelevantWatch for " - "parameter %s. %s\n", - driverName, - __func__, - paramString, - errorString); - Picam_DestroyString(paramString); - Picam_DestroyString(errorString); + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + Picam_GetEnumerationString(PicamEnumeratedType_Parameter, + parameterList[ii], + ¶mString); + + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s Trouble registering RelevantWatch for " + "parameter %s. %s\n", + driverName, + __func__, + paramString, + errorString); + Picam_DestroyString(paramString); + Picam_DestroyString(errorString); } } return (asynStatus) status; @@ -3219,95 +3288,95 @@ asynStatus ADPICam::piRegisterRelevantWatch(PicamHandle cameraHandle) { */ asynStatus ADPICam::piRegisterValueChangeWatch(PicamHandle cameraHandle) { int status = asynSuccess; - piint parameterCount; - const PicamParameter *parameterList; - PicamValueType valueType; - PicamError error; + piint parameterCount = 0; + const PicamParameter *parameterList = NULL; + PicamValueType valueType = PicamValueType_Integer; + PicamError error = PicamError_None; const char *functionName = "piRegisterValueChangeWatch"; - pibln doesParamExist; - const char *errorString; - const char *paramString; + pibln doesParamExist = 0; + const char *errorString = NULL; + const char *paramString = NULL; error = Picam_GetParameters(currentCameraHandle, ¶meterList, ¶meterCount); if (error != PicamError_None) { Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); + error, + &errorString); asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Error: Trouble getting list of parameters for current " - "camera. %s\n", - driverName, - __func__, - errorString); + "%s:%s Error: Trouble getting list of parameters for current " + "camera. %s\n", + driverName, + __func__, + errorString); Picam_DestroyString(errorString); return asynError; } for (int ii = 0; ii < parameterCount; ii++) { - Picam_DoesParameterExist(currentCameraHandle, - parameterList[ii], - &doesParamExist); - if (doesParamExist) { - error = Picam_GetParameterValueType(cameraHandle, parameterList[ii], - &valueType); - if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); - Picam_GetEnumerationString(PicamEnumeratedType_Parameter, - parameterList[ii], - ¶mString); - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Trouble getting parameter value type for " - "parameter %s. %s\n", - driverName, - functionName, - paramString, - errorString); - Picam_DestroyString(paramString); - Picam_DestroyString(errorString); - return asynError; - } - switch (valueType) { - case PicamValueType_Integer: - case PicamValueType_Boolean: - case PicamValueType_Enumeration: - error = PicamAdvanced_RegisterForIntegerValueChanged(cameraHandle, - parameterList[ii], piParameterIntegerValueChanged); - break; - case PicamValueType_LargeInteger: - error = PicamAdvanced_RegisterForLargeIntegerValueChanged( - cameraHandle, parameterList[ii], - piParameterLargeIntegerValueChanged); - break; - case PicamValueType_FloatingPoint: - error = PicamAdvanced_RegisterForFloatingPointValueChanged( - cameraHandle, parameterList[ii], - piParameterFloatingPointValueChanged); - break; - case PicamValueType_Rois: - printf("Registering ROIS value changed\n"); - error = PicamAdvanced_RegisterForRoisValueChanged(cameraHandle, - parameterList[ii], piParameterRoisValueChanged); - break; - case PicamValueType_Pulse: - error = PicamAdvanced_RegisterForPulseValueChanged(cameraHandle, - parameterList[ii], piParameterPulseValueChanged); - break; - case PicamValueType_Modulations: - error = PicamAdvanced_RegisterForModulationsValueChanged( - cameraHandle, parameterList[ii], - piParameterModulationsValueChanged); - break; - default: { - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Unexpected valueType %s", driverName, functionName, - valueType); - return asynError; - } - break; - } - } + Picam_DoesParameterExist(currentCameraHandle, + parameterList[ii], + &doesParamExist); + if (doesParamExist) { + error = Picam_GetParameterValueType(cameraHandle, parameterList[ii], + &valueType); + if (error != PicamError_None) { + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + Picam_GetEnumerationString(PicamEnumeratedType_Parameter, + parameterList[ii], + ¶mString); + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s Trouble getting parameter value type for " + "parameter %s. %s\n", + driverName, + functionName, + paramString, + errorString); + Picam_DestroyString(paramString); + Picam_DestroyString(errorString); + return asynError; + } + switch (valueType) { + case PicamValueType_Integer: + case PicamValueType_Boolean: + case PicamValueType_Enumeration: + error = PicamAdvanced_RegisterForIntegerValueChanged(cameraHandle, + parameterList[ii], piParameterIntegerValueChanged); + break; + case PicamValueType_LargeInteger: + error = PicamAdvanced_RegisterForLargeIntegerValueChanged( + cameraHandle, parameterList[ii], + piParameterLargeIntegerValueChanged); + break; + case PicamValueType_FloatingPoint: + error = PicamAdvanced_RegisterForFloatingPointValueChanged( + cameraHandle, parameterList[ii], + piParameterFloatingPointValueChanged); + break; + case PicamValueType_Rois: + printf("Registering ROIS value changed\n"); + error = PicamAdvanced_RegisterForRoisValueChanged(cameraHandle, + parameterList[ii], piParameterRoisValueChanged); + break; + case PicamValueType_Pulse: + error = PicamAdvanced_RegisterForPulseValueChanged(cameraHandle, + parameterList[ii], piParameterPulseValueChanged); + break; + case PicamValueType_Modulations: + error = PicamAdvanced_RegisterForModulationsValueChanged( + cameraHandle, parameterList[ii], + piParameterModulationsValueChanged); + break; + default: { + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s Unexpected valueType %s", driverName, functionName, + valueType); + return asynError; + } + break; + } + } } return (asynStatus) status; } @@ -3319,7 +3388,6 @@ asynStatus ADPICam::piSetParameterExists(asynUser *pasynUser, PicamParameter parameter, int exists) { int status = asynSuccess; int driverParameter = -1; - static const char *functionName = "piSetParameterExists"; const pichar* string; try { @@ -3346,7 +3414,6 @@ asynStatus ADPICam::piSetParameterRelevance(asynUser *pasynUser, PicamParameter parameter, int relevence) { int status = asynSuccess; int driverParameter = -1; - static const char *functionName = "piSetSelectedCamera"; const pichar* string; try { @@ -3367,17 +3434,80 @@ asynStatus ADPICam::piSetParameterRelevance(asynUser *pasynUser, return (asynStatus) status; } +asynStatus ADPICam::piSetRoisValuesFromSelectedCamera(const PicamParameter& parameter) +{ + int status = asynSuccess; + const PicamRois *paramRois=NULL; + const PicamRoisConstraint *roiConstraint=NULL; + PicamError error = Picam_GetParameterRoisValue(currentCameraHandle, + parameter, ¶mRois); + const pichar *errorString=NULL; + if (error != PicamError_None) { + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s Trouble getting ROI value. %s", + driverName, + __func__, + errorString); + Picam_DestroyString(errorString); + return asynError; + } + error = Picam_GetParameterRoisConstraint(currentCameraHandle, + parameter, PicamConstraintCategory_Capable, + &roiConstraint); + if (error != PicamError_None) { + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s Trouble getting ROI constraint. %s", + driverName, + __func__, + errorString); + Picam_DestroyString(errorString); + return asynError; + } + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, "Rois %d, rules 0X%X\n", + paramRois->roi_count, roiConstraint->rules); + + if (paramRois->roi_count == 1) { + status |= setIntegerParam(ADBinX, paramRois->roi_array[0].x_binning); + status |= setIntegerParam(ADBinY, paramRois->roi_array[0].y_binning); + status |= setIntegerParam(ADMinX, paramRois->roi_array[0].x); + status |= setIntegerParam(ADMinY, paramRois->roi_array[0].y); + status |= setIntegerParam(ADSizeX, paramRois->roi_array[0].width); + status |= setIntegerParam(ADSizeY, paramRois->roi_array[0].height); + status |= setIntegerParam(NDArraySizeX, paramRois->roi_array[0].width); + status |= setIntegerParam(NDArraySizeY, paramRois->roi_array[0].height); + if (roiConstraint->rules & PicamRoisConstraintRulesMask_HorizontalSymmetry) { + setIntegerParam(PICAM_EnableROIMinXInput, 0); + } + else { + setIntegerParam(PICAM_EnableROIMinXInput, 1); + } + if (roiConstraint->rules & PicamRoisConstraintRulesMask_VerticalSymmetry) { + setIntegerParam(PICAM_EnableROIMinYInput, 0); + } + else { + setIntegerParam(PICAM_EnableROIMinYInput, 1); + } + } + return (asynStatus)status; +} + /** * Change the parameter values based on those stored in the camera as the * selected detector changes. */ asynStatus ADPICam::piSetParameterValuesFromSelectedCamera() { int status = asynSuccess; - PicamError error; - const pichar *paramString; - const pichar *errorString; - piint parameterCount; - const PicamParameter *parameterList; + PicamError error = PicamError_None; + const pichar *paramString = NULL; + const pichar *errorString = NULL; + piint parameterCount = 0; + const PicamParameter *parameterList = NULL; static const char *functionName = "piSetParameterValuesFromSelectedCamera"; int driverParam = -1; PicamValueType paramType; @@ -3390,68 +3520,74 @@ asynStatus ADPICam::piSetParameterValuesFromSelectedCamera() { driverName, functionName, parameterCount); for (int ii = 0; ii < parameterCount; ii++) { - Picam_GetEnumerationString(PicamEnumeratedType_Parameter, + if (parameterList[ii] == PicamParameter_Rois) + { + // This parameter cannot be handled here as it is multi-valued. + status |= piSetRoisValuesFromSelectedCamera(parameterList[ii]); + continue; + } + error = Picam_GetEnumerationString(PicamEnumeratedType_Parameter, parameterList[ii], ¶mString); asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, "---- Found %s\n", paramString); driverParam = piLookupDriverParameter(parameterList[ii]); pibln doesParamExist; Picam_DoesParameterExist(currentCameraHandle, - parameterList[ii], - &doesParamExist); + parameterList[ii], + &doesParamExist); if (doesParamExist) { - if (driverParam >= 0) { - error = Picam_GetParameterValueType(currentCameraHandle, - parameterList[ii], ¶mType); - if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Trouble getting parameter value type for " - "parameter %s. %s", - driverName, - __func__, - paramString, - errorString); - Picam_DestroyString(paramString); - Picam_DestroyString(errorString); - return asynError; - } - PicamConstraintType constraintType; - Picam_GetParameterConstraintType(currentCameraHandle, - parameterList[ii], - &constraintType); - if (constraintType == PicamConstraintType_Collection){ - const pichar *paramString; - Picam_GetEnumerationString(PicamEnumeratedType_Parameter, - parameterList[ii], - ¶mString); - asynPrint (pasynUserSelf, ASYN_TRACE_FLOW, - "%s:%s Updating list for %s\n", - driverName, - functionName, - paramString); - Picam_DestroyString(paramString); - piUpdateParameterListValues(parameterList[ii], driverParam); - } - switch (paramType) { - case PicamValueType_Integer: - piint intVal; - error = Picam_GetParameterIntegerValue(currentCameraHandle, - parameterList[ii], &intVal); - if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Trouble getting Integer parameter %s\n", - driverName, - functionName, - errorString); - Picam_DestroyString(errorString); - return asynError; - } + if (driverParam >= 0) { + error = Picam_GetParameterValueType(currentCameraHandle, + parameterList[ii], ¶mType); + if (error != PicamError_None) { + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s Trouble getting parameter value type for " + "parameter %s. %s", + driverName, + __func__, + paramString, + errorString); + Picam_DestroyString(paramString); + Picam_DestroyString(errorString); + return asynError; + } + PicamConstraintType constraintType; + Picam_GetParameterConstraintType(currentCameraHandle, + parameterList[ii], + &constraintType); + if (constraintType == PicamConstraintType_Collection){ + const pichar *paramString; + Picam_GetEnumerationString(PicamEnumeratedType_Parameter, + parameterList[ii], + ¶mString); + asynPrint (pasynUserSelf, ASYN_TRACE_FLOW, + "%s:%s Updating list for %s\n", + driverName, + functionName, + paramString); + Picam_DestroyString(paramString); + piUpdateParameterListValues(parameterList[ii], driverParam); + } + switch (paramType) { + case PicamValueType_Integer: + piint intVal; + error = Picam_GetParameterIntegerValue(currentCameraHandle, + parameterList[ii], &intVal); + if (error != PicamError_None) { + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s Trouble getting Integer parameter %s\n", + driverName, + functionName, + errorString); + Picam_DestroyString(errorString); + return asynError; + } PicamConstraintType paramCT; error = Picam_GetParameterConstraintType( currentCameraHandle, @@ -3499,75 +3635,74 @@ asynStatus ADPICam::piSetParameterValuesFromSelectedCamera() { break; default: - setIntegerParam(driverParam, intVal); + setIntegerParam(driverParam, intVal); + } + break; + case PicamValueType_Enumeration: + if (constraintType != PicamConstraintType_None) { + error = Picam_GetParameterIntegerValue( + currentCameraHandle, + parameterList[ii], + &intVal); + if (error != PicamError_None) { + Picam_GetEnumerationString( + PicamEnumeratedType_Error, + error, + &errorString); + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s Trouble getting Integer parameter " + "%s\n", + driverName, + functionName, + errorString); + Picam_DestroyString(errorString); + return asynError; + } + setIntegerParam(driverParam, intVal); } - break; - case PicamValueType_Enumeration: - if (constraintType != PicamConstraintType_None) { - error = Picam_GetParameterIntegerValue( - currentCameraHandle, - parameterList[ii], - &intVal); - if (error != PicamError_None) { - Picam_GetEnumerationString( - PicamEnumeratedType_Error, - error, - &errorString); - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Trouble getting Integer parameter " - "%s\n", - driverName, - functionName, - errorString); - Picam_DestroyString(errorString); - return asynError; - } - setIntegerParam(driverParam, intVal); - } - else { - PicamEnumeratedType picamET; - const char *enumString; - int intValue; - Picam_GetParameterEnumeratedType(currentCameraHandle, - parameterList[ii], - &picamET); - Picam_GetParameterIntegerValue(currentCameraHandle, - parameterList[ii], &intValue); - Picam_GetEnumerationString(picamET, - intValue, - &enumString); - setStringParam(driverParam, enumString); - Picam_DestroyString(enumString); - } - break; - case PicamValueType_LargeInteger: - pi64s largeVal; - int val; - error = Picam_GetParameterLargeIntegerValue( - currentCameraHandle, - parameterList[ii], - &largeVal); - if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Trouble getting Large " - "Integer parameter %s\n", - driverName, - functionName, - errorString); - Picam_DestroyString(errorString); - return asynError; - } - val = (int)largeVal; - setIntegerParam(driverParam, val); - break; - case PicamValueType_FloatingPoint: - piflt fltVal; - const PicamCollectionConstraint *speedConstraint; - error = Picam_GetParameterFloatingPointValue( - currentCameraHandle, parameterList[ii], &fltVal); + else { + PicamEnumeratedType picamET; + const char *enumString; + int intValue; + Picam_GetParameterEnumeratedType(currentCameraHandle, + parameterList[ii], + &picamET); + Picam_GetParameterIntegerValue(currentCameraHandle, + parameterList[ii], &intValue); + Picam_GetEnumerationString(picamET, + intValue, + &enumString); + setStringParam(driverParam, enumString); + Picam_DestroyString(enumString); + } + break; + case PicamValueType_LargeInteger: + pi64s largeVal; + int val; + error = Picam_GetParameterLargeIntegerValue( + currentCameraHandle, + parameterList[ii], + &largeVal); + if (error != PicamError_None) { + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s Trouble getting Large " + "Integer parameter %s\n", + driverName, + functionName, + errorString); + Picam_DestroyString(errorString); + return asynError; + } + val = (int)largeVal; + setIntegerParam(driverParam, val); + break; + case PicamValueType_FloatingPoint: + piflt fltVal; + error = Picam_GetParameterFloatingPointValue( + currentCameraHandle, parameterList[ii], &fltVal); if (error != PicamError_None) { Picam_GetEnumerationString(PicamEnumeratedType_Error, error, @@ -3586,114 +3721,9 @@ asynStatus ADPICam::piSetParameterValuesFromSelectedCamera() { currentCameraHandle, parameterList[ii], fltVal); -// error = Picam_GetParameterConstraintType( -// currentCameraHandle, -// parameterList[ii], -// ¶mCT); -// if (error != PicamError_None) { -// Picam_GetEnumerationString(PicamEnumeratedType_Error, error, -// &errorString); -// asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, -// "%s:%s Trouble determining constraint type " -// "for parameter %s. %s", -// driverName, -// __func__, -// paramString, -// errorString); -// Picam_DestroyString(errorString); -// } -// switch (paramCT) { -// case PicamConstraintType_Collection: -// const PicamCollectionConstraint *constraint; -// error = Picam_GetParameterCollectionConstraint( -// currentCameraHandle, -// parameterList[ii], -// PicamConstraintCategory_Capable, -// &constraint); -// if (error != PicamError_None) { -// Picam_GetEnumerationString(PicamEnumeratedType_Error, -// error, -// &errorString); -// asynPrint (pasynUserSelf, ASYN_TRACE_ERROR, -// "%s:%s ErrorGetting constraint for " -// "parameter %s. %s\n", -// driverName, -// __func__, -// paramString, -// errorString); -// Picam_DestroyString(errorString); -// } -// for (int iParam = 0; iParam < constraint->values_count; -// iParam++) { -// if (constraint->values_array[iParam] == fltVal) { -// setIntegerParam(driverParam, iParam); -// } -// } -// break; -// default: -// status |= setDoubleParam(driverParam, fltVal); -// break; -// } - } - - } else if (parameterList[ii] == PicamParameter_Rois) { - const PicamRois *paramRois; - const PicamRoisConstraint *roiConstraint; - error = Picam_GetParameterRoisValue(currentCameraHandle, - parameterList[ii], ¶mRois); - if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Trouble getting ROI value. %s", - driverName, - __func__, - errorString); - Picam_DestroyString(errorString); - return asynError; - } - error = Picam_GetParameterRoisConstraint(currentCameraHandle, - parameterList[ii], PicamConstraintCategory_Capable, - &roiConstraint); - if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Trouble getting ROI constraint. %s", - driverName, - __func__, - errorString); - Picam_DestroyString(errorString); - return asynError; - } - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, "Rois %d, rules 0X%X\n", - paramRois->roi_count, roiConstraint->rules); - - if (paramRois->roi_count == 1) { - setIntegerParam(ADBinX, paramRois->roi_array[0].x_binning); - setIntegerParam(ADBinY, paramRois->roi_array[0].y_binning); - setIntegerParam(ADMinX, paramRois->roi_array[0].x); - setIntegerParam(ADMinY, paramRois->roi_array[0].y); - setIntegerParam(ADSizeX, paramRois->roi_array[0].width); - setIntegerParam(ADSizeY, paramRois->roi_array[0].height); - setIntegerParam(NDArraySizeX, paramRois->roi_array[0].width); - setIntegerParam(NDArraySizeY, paramRois->roi_array[0].height); - if (roiConstraint->rules & PicamRoisConstraintRulesMask_HorizontalSymmetry) { - setIntegerParam(PICAM_EnableROIMinXInput, 0); - } - else { - setIntegerParam(PICAM_EnableROIMinXInput, 1); - } - if (roiConstraint->rules & PicamRoisConstraintRulesMask_VerticalSymmetry) { - setIntegerParam(PICAM_EnableROIMinYInput, 0); - } - else { - setIntegerParam(PICAM_EnableROIMinYInput, 1); - } - } - } + } + + } } Picam_DestroyString(paramString); } @@ -3711,25 +3741,21 @@ asynStatus ADPICam::piSetParameterValuesFromSelectedCamera() { * Set values for the ROI parameters. PICAM holds these parameters in a single * object instead of as separate parameters. */ -asynStatus ADPICam::piSetRois(int minX, int minY, int width, int height, +asynStatus ADPICam::piSetSingleRoi(int minX, int minY, int sizeX, int sizeY, int binX, int binY) { int status = asynSuccess; - const PicamRois *rois; - const PicamRoisConstraint *roisConstraints; - const char *functionName = "piSetRois"; - int numXPixels, numYPixels; - const pichar *errorString; + const PicamRoisConstraint *roisConstraints=NULL; + int numXPixels=0, numYPixels=0; + const pichar *errorString = NULL; PicamError error = PicamError_None; getIntegerParam(ADMaxSizeX, & numXPixels); getIntegerParam(ADMaxSizeY, & numYPixels); - error = Picam_GetParameterRoisValue(currentCameraHandle, - PicamParameter_Rois, &rois); if (error != PicamError_None) { Picam_GetEnumerationString(PicamEnumeratedType_Error, error, &errorString); asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Error retrieving rois %s\n", driverName, functionName, + "%s:%s Error retrieving rois %s\n", driverName, __func__, errorString); Picam_DestroyString(errorString); return asynError; @@ -3737,126 +3763,185 @@ asynStatus ADPICam::piSetRois(int minX, int minY, int width, int height, error = Picam_GetParameterRoisConstraint(currentCameraHandle, PicamParameter_Rois, PicamConstraintCategory_Required, &roisConstraints); - printf ("ROIConstraints->rules 0x%X\n", roisConstraints->rules); + if (roisConstraints) + printf ("ROIConstraints->rules 0x%X\n", roisConstraints->rules); if (error != PicamError_None) { Picam_GetEnumerationString(PicamEnumeratedType_Error, error, &errorString); asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, "%s:%s Error retrieving rois constraints %s\n", driverName, - functionName, errorString); + __func__, errorString); Picam_DestroyString(errorString); return asynError; } - if (rois->roi_count == 1) { - PicamRoi *roi = &(rois->roi_array[0]); - bool allInRange = true; - if (binX == 0) binX = 1; - if (roisConstraints->rules & PicamRoisConstraintRulesMask_HorizontalSymmetry) { - if (width >= numXPixels/binX){ - width = numXPixels/binX; - } - //make sure pixels in each quadrant are divisible by binnning - if ((((width/2)/binX) * binX) * 2 != width){ - width = (((width/2)/binX) * binX)*2; - } - roi->x = ((numXPixels + 1)/2 ) - ((width/2) * binX) ; - roi->width = width * binX; - roi->x_binning = binX; - setIntegerParam(ADMinX, roi->x); - setIntegerParam(ADSizeX, width); - setIntegerParam(ADBinX, binX); + PicamRoi roi; + bool allInRange = true; + if (binX == 0) binX = 1; + if ((roisConstraints) && (roisConstraints->rules & PicamRoisConstraintRulesMask_HorizontalSymmetry)) { + if (sizeX >= numXPixels / binX) { + sizeX = numXPixels / binX; } - else { + //make sure pixels in each quadrant are divisible by binnning + if ((((sizeX / 2) / binX) * binX) * 2 != sizeX) { + sizeX = (((sizeX / 2) / binX) * binX) * 2; + } + roi.x = ((numXPixels + 1) / 2) - ((sizeX / 2) * binX); + roi.width = sizeX * binX; + roi.x_binning = binX; + } + else { - if (minX < 1) { - minX = 1; - } else if (minX > numXPixels-binX) { - minX = numXPixels; - } - roi->x = minX; - setIntegerParam(ADMinX, minX); - if (width < 1){ - width = 1; - } else if (width > (numXPixels - minX + 1)/binX) { - width = (numXPixels - minX + 1)/binX; - if (width < 1) { - width = 1; - } + if (minX < 0) { + minX = 0; + } + else if (minX > numXPixels - binX) { + minX = numXPixels; + } + roi.x = minX; + if (sizeX < 1) { + sizeX = 1; + } + else if (sizeX > (numXPixels - minX) / binX) { + sizeX = (numXPixels - minX) / binX; + if (sizeX < 1) { + sizeX = 1; } - roi->width = width * binX; - roi->x_binning = binX; - setIntegerParam(ADSizeX, width); - setIntegerParam(ADBinX, binX); - } - if (binY == 0) binY = 1; - if (roisConstraints->rules & PicamRoisConstraintRulesMask_VerticalSymmetry) { - if (height >= numYPixels/binY ){ - height = numYPixels/binY; - } - //make sure pixels in each quadrant are divisible by binnning - if (((height/2)/binY) * binY != height){ - height = (((height/2)/binY) * binY)*2; - } - roi->y = ((numYPixels + 1)/2 ) - ((height/2) * binY) ; - roi->height = height * binY; - roi->y_binning = binY; - setIntegerParam(ADMinY, roi->y); - setIntegerParam(ADSizeY, height); - setIntegerParam(ADBinY, binY); + roi.width = sizeX * binX; + roi.x_binning = binX; + } + if (binY == 0) binY = 1; + if (roisConstraints->rules & PicamRoisConstraintRulesMask_VerticalSymmetry) { + if (sizeY >= numYPixels / binY) { + sizeX = numYPixels / binY; } - else { - - if (minY < 1){ - minY = 1; - } - else if (minY > numYPixels){ - minY = numYPixels; - } - roi->y = minY; - setIntegerParam(ADMinY, minY); - if (height > (numYPixels - minY + 1)/binY) { - height = (numYPixels - minY + 1)/binY; - if (height < 1) { - height = 1; - } - } else if (height < 1 ) { - height = 1; - } - roi->height = height * binY; - roi->y_binning = binY; - setIntegerParam(ADSizeY, height); - setIntegerParam(ADBinY, binY); + //make sure pixels in each quadrant are divisible by binnning + if (((sizeY / 2) / binY) * binY != sizeY) { + sizeY = (((sizeY / 2) / binY) * binY) * 2; } - error = Picam_SetParameterRoisValue(currentCameraHandle, - PicamParameter_Rois, rois); - if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, error, - &errorString); - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Error writing rois %s\n" - "(x,y) = (%d, %d), (height, width) = (%d, %d), " - "(xbin, ybin) = (%d, %d)\n" - , driverName, - functionName, - errorString, - roi->x, - roi->y, - roi->width, - roi->height, - roi->x_binning, - roi->y_binning); + roi.y = ((numYPixels + 1) / 2) - ((sizeY / 2) * binY); + roi.height = sizeY * binY; + roi.y_binning = binY; + } + else { - Picam_DestroyString(errorString); - return asynError; + if (minY < 0) { + minY = 0; + } + else if (minY > numYPixels) { + minY = numYPixels; + } + roi.y = minY; + if (sizeY > (numYPixels - minY) / binY) { + sizeY = (numYPixels - minY) / binY; + if (sizeY < 1) { + sizeY = 1; + } } + else if (sizeY < 1) { + sizeY = 1; + } + roi.height = sizeY * binY; + roi.y_binning = binY; + } + PicamRois rois = { &(roi), 1 }; + error = Picam_SetParameterRoisValue(currentCameraHandle, + PicamParameter_Rois, &rois); + if (error != PicamError_None) { + Picam_GetEnumerationString(PicamEnumeratedType_Error, error, + &errorString); + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s Error writing rois %s\n" + "(x,y) = (%d, %d), (width, height) = (%d, %d), " + "(xbin, ybin) = (%d, %d)\n", + driverName, + __func__, + errorString, + roi.x, + roi.y, + roi.width, + roi.height, + roi.x_binning, + roi.y_binning); + + Picam_DestroyString(errorString); + return asynError; } callParamCallbacks(); Picam_DestroyRoisConstraints(roisConstraints); - Picam_DestroyRois(rois); return (asynStatus) status; } +asynStatus ADPICam::piSetMultiRoi(asynUser *pasynUser, int minX, int sizeX, int binX) { + // Tracks + asynPrint(pasynUser, ASYN_TRACEIO_DEVICE, + "%s:%s Enter\n", + driverName, + __func__); + if (PICAM_CCDMultiTrack.size() == 0) + { + asynPrint(pasynUser, ASYN_TRACE_WARNING, + "%s:%s: A track defintion must be set in order to use tracks mode\n", + driverName, __func__); + return asynError; + } + + asynStatus status = setIntegerParam(NDArraySizeY, PICAM_CCDMultiTrack.DataHeight()); + if (status == asynSuccess) + status = setIntegerParam(ADSizeY, PICAM_CCDMultiTrack.DataHeight()); + if (status == asynSuccess) + status = setIntegerParam(NDArraySizeX, sizeX / binX); + if (status == asynSuccess) + status = setIntegerParam(ADSizeX, sizeX / binX); + + PicamError error = PicamError_None; + + std::vector Regions; + for (size_t TrackNo = 0; TrackNo < PICAM_CCDMultiTrack.size(); TrackNo++) + { + /* + Princeton use 0-based exclusive co-ordinates: + x: The left-most column coordinate (zero-based). + width: The number of columns. + x_binning: The number of columns to group into a sum. + y: The top-most row coordinate (zero-based). + height: The number of rows. + y_binning: The number of rows to group into a sum. + */ + int BeginY = PICAM_CCDMultiTrack.TrackStart(TrackNo); + int BinY = PICAM_CCDMultiTrack.TrackBin(TrackNo); + int EndY = PICAM_CCDMultiTrack.TrackEnd(TrackNo); + PicamRoi Rgn = { minX, sizeX, binX, + BeginY, EndY - BeginY + 1, BinY }; + Regions.push_back(Rgn); + } + PicamRois Rois = { &(Regions[0]), piint(Regions.size()) }; + for (size_t Roi = 0; Roi < Regions.size(); Roi++) + { + asynPrint(pasynUser, ASYN_TRACEIO_DEVICE, + "(x,y) = (%d, %d), (width, height) = (%d, %d), " + "(xbin, ybin) = (%d, %d)\n", + Regions[Roi].x, + Regions[Roi].y, + Regions[Roi].width, + Regions[Roi].height, + Regions[Roi].x_binning, + Regions[Roi].y_binning); + } + error = Picam_SetParameterRoisValue(currentCameraHandle, PicamParameter_Rois, &Rois); + if (error != PicamError_None) + { + const pichar *errorString; + Picam_GetEnumerationString(PicamEnumeratedType_Error, error, + &errorString); + asynPrint(pasynUser, ASYN_TRACE_ERROR, + "%s:%s Error writing rois %s\n", driverName, __func__, errorString); + Picam_DestroyString(errorString); + status = asynError; + } + return status; +} + /** * Set the selected camera based on user input */ @@ -3870,7 +3955,7 @@ asynStatus ADPICam::piSetSelectedCamera(asynUser *pasynUser, const char *interfaceString; static const char *functionName = "piSetSelectedCamera"; char enumString[64]; - char firmwareString[64]; + char firmwareString[PicamStringSize_FirmwareDetail]; const char *errorString; asynPrint(pasynUser, ASYN_TRACE_FLOW, "%s:%s: Selected camera value=%d\n", @@ -3881,7 +3966,7 @@ asynStatus ADPICam::piSetSelectedCamera(asynUser *pasynUser, // piUnregisterConstraintChangeWatch(currentCameraHandle); status |= piUnregisterValueChangeWatch(currentCameraHandle); error = PicamAdvanced_UnregisterForAcquisitionUpdated( - currentDeviceHandle, + currentDeviceHandle, piAcquistionUpdated); if (error != PicamError_None){ const char *errorString; @@ -3890,7 +3975,7 @@ asynStatus ADPICam::piSetSelectedCamera(asynUser *pasynUser, &errorString); asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, "%s:%s Error With Picam_UnregisterForAcquisitionUpdate " - "%d: %s\n", + "%d: %s\n", driverName, functionName, currentCameraHandle, @@ -3899,11 +3984,6 @@ asynStatus ADPICam::piSetSelectedCamera(asynUser *pasynUser, return (asynStatus)asynError; } } - if (selectedCameraIndex >= 0) { - error = Picam_CloseCamera(currentCameraHandle); - asynPrint(pasynUser, ASYN_TRACE_FLOW, "Picam_CloseCameraError %d\n", - error); - } asynPrint(pasynUser, ASYN_TRACE_FLOW, "%s:%s: Number of available cameras=%d\n", driverName, functionName, availableCamerasCount); @@ -3916,9 +3996,17 @@ asynStatus ADPICam::piSetSelectedCamera(asynUser *pasynUser, modelString, availableCameraIDs[ii].computer_interface, availableCameraIDs[ii].sensor_name, availableCameraIDs[ii].serial_number); + if ((selectedIndex >= availableCamerasCount) && (selectedIndex == atoi(availableCameraIDs[ii].serial_number))) + // Assumption: the number of cameras is less than any possible serial number. + selectedIndex = ii; Picam_DestroyString(modelString); //PicamAdvanced_SetUserState(availableCameraIDs[ii].model, this); } + if (selectedCameraIndex >= 0) { + error = Picam_CloseCamera(currentCameraHandle); + asynPrint(pasynUser, ASYN_TRACE_FLOW, "Picam_CloseCameraError %d\n", + error); + } if (selectedIndex < availableCamerasCount) { selectedCameraIndex = selectedIndex; @@ -3926,16 +4014,16 @@ asynStatus ADPICam::piSetSelectedCamera(asynUser *pasynUser, ¤tCameraHandle); if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, "%s:%s Trouble Opening Camera. %s\n", - driverName, - functionName, - errorString); - Picam_DestroyString(errorString); - return (asynStatus)asynError; + driverName, + functionName, + errorString); + Picam_DestroyString(errorString); + return (asynStatus)asynError; } error = PicamAdvanced_GetCameraDevice(currentCameraHandle, ¤tDeviceHandle); @@ -3968,6 +4056,7 @@ asynStatus ADPICam::piSetSelectedCamera(asynUser *pasynUser, asynPrint(pasynUser, ASYN_TRACE_FLOW, "%s:%s: Selected camera value=%d, %s\n", driverName, functionName, selectedIndex, modelString); + status |= setStringParam(ADModel, modelString); Picam_DestroyString(modelString); Picam_GetEnumerationString(PicamEnumeratedType_ComputerInterface, @@ -4015,6 +4104,8 @@ asynStatus ADPICam::piSetSelectedCamera(asynUser *pasynUser, status |= piUpdateParameterRelevance(); status |= piRegisterRelevantWatch(currentCameraHandle); + status |= piSetParameterValuesFromSelectedCamera(); + return (asynStatus) status; } @@ -4101,26 +4192,26 @@ asynStatus ADPICam::piSetSelectedUnavailableCamera(asynUser *pasynUser, asynStatus ADPICam::piUnregisterConstraintChangeWatch( PicamHandle cameraHandle) { int status = asynSuccess; - piint parameterCount; - const PicamParameter *parameterList; - PicamError error; - const char *errorString; + piint parameterCount = 0; + const PicamParameter *parameterList = NULL; + PicamError error = PicamError_None; + const char *errorString = NULL; error = Picam_GetParameters(currentCameraHandle, ¶meterList, ¶meterCount); if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s ERROR getting list of parameters\n"); - Picam_DestroyString(errorString); - return asynError; + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s ERROR getting list of parameters\n"); + Picam_DestroyString(errorString); + return asynError; } for (int ii = 0; ii < parameterCount; ii++) { - //TODO Need to change to unregister constraint change watch. Depends - // on parameter - error = PicamAdvanced_UnregisterForIsRelevantChanged(cameraHandle, + //TODO Need to change to unregister constraint change watch. Depends + // on parameter + error = PicamAdvanced_UnregisterForIsRelevantChanged(cameraHandle, parameterList[ii], piParameterRelevanceChanged); } return (asynStatus) status; @@ -4132,43 +4223,44 @@ asynStatus ADPICam::piUnregisterConstraintChangeWatch( */ asynStatus ADPICam::piUnregisterRelevantWatch(PicamHandle cameraHandle) { int status = asynSuccess; - piint parameterCount; - const PicamParameter *parameterList; - PicamError error; - const char *errorString; - const char *paramString; + piint parameterCount = 0; + const PicamParameter *parameterList = NULL; + PicamError error = PicamError_None; + const char *errorString = NULL; + const char *paramString = NULL; error = Picam_GetParameters(currentCameraHandle, ¶meterList, ¶meterCount); if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s ERROR getting list of parameters\n"); - Picam_DestroyString(errorString); - return asynError; + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s ERROR getting list of parameters\n", + driverName, __func__); + Picam_DestroyString(errorString); + return asynError; } for (int ii = 0; ii < parameterCount; ii++) { error = PicamAdvanced_UnregisterForIsRelevantChanged(cameraHandle, parameterList[ii], piParameterRelevanceChanged); if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); - Picam_GetEnumerationString(PicamEnumeratedType_Parameter, - parameterList[ii], - ¶mString); - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Trouble Unregistering RelevantChanged for parameter" - "%s. %s\n", - driverName, - __func__, - paramString, - errorString); - - Picam_DestroyString(paramString); - Picam_DestroyString(errorString); + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + Picam_GetEnumerationString(PicamEnumeratedType_Parameter, + parameterList[ii], + ¶mString); + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s Trouble Unregistering RelevantChanged for parameter" + "%s. %s\n", + driverName, + __func__, + paramString, + errorString); + + Picam_DestroyString(paramString); + Picam_DestroyString(errorString); } } return (asynStatus) status; @@ -4180,97 +4272,97 @@ asynStatus ADPICam::piUnregisterRelevantWatch(PicamHandle cameraHandle) { */ asynStatus ADPICam::piUnregisterValueChangeWatch(PicamHandle cameraHandle) { int status = asynSuccess; - piint parameterCount; - const PicamParameter *parameterList; - PicamValueType valueType; - PicamError error; + piint parameterCount = 0; + const PicamParameter *parameterList = NULL; + PicamValueType valueType = PicamValueType_Integer; + PicamError error = PicamError_None; const char *functionName = "piUnregisterValueChangeWatch"; - pibln doesParamExist; - const char *errorString; - const char *paramString; + pibln doesParamExist = 0; + const char *errorString = NULL; + const char *paramString = NULL; error = Picam_GetParameters(currentCameraHandle, ¶meterList, ¶meterCount); if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s ERROR getting list of parameters\n"); - Picam_DestroyString(errorString); - return asynError; + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s ERROR getting list of parameters\n", driverName, functionName); + Picam_DestroyString(errorString); + return asynError; } for (int ii = 0; ii < parameterCount; ii++) { - Picam_DoesParameterExist(currentCameraHandle, - parameterList[ii], - &doesParamExist); - if (doesParamExist){ - error = Picam_GetParameterValueType(cameraHandle, parameterList[ii], - &valueType); - if (error != PicamError_None) { - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s \n", - driverName, - functionName); - return asynError; - } - switch (valueType) { - case PicamValueType_Integer: - case PicamValueType_Boolean: - case PicamValueType_Enumeration: - error = PicamAdvanced_UnregisterForIntegerValueChanged(cameraHandle, - parameterList[ii], piParameterIntegerValueChanged); - break; - case PicamValueType_LargeInteger: - error = PicamAdvanced_UnregisterForLargeIntegerValueChanged( - cameraHandle, parameterList[ii], - piParameterLargeIntegerValueChanged); - break; - case PicamValueType_FloatingPoint: - error = PicamAdvanced_UnregisterForFloatingPointValueChanged( - cameraHandle, parameterList[ii], - piParameterFloatingPointValueChanged); - break; - case PicamValueType_Rois: - printf("Unregistering ROIS value change\n"); - error = PicamAdvanced_UnregisterForRoisValueChanged(cameraHandle, - parameterList[ii], piParameterRoisValueChanged); - break; - case PicamValueType_Pulse: - error = PicamAdvanced_UnregisterForPulseValueChanged(cameraHandle, - parameterList[ii], piParameterPulseValueChanged); - break; - case PicamValueType_Modulations: - error = PicamAdvanced_UnregisterForModulationsValueChanged( - cameraHandle, parameterList[ii], - piParameterModulationsValueChanged); - break; - default: { - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Unexpected valueType %s", driverName, functionName, - valueType); - return asynError; - } - } - if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); - Picam_GetEnumerationString(PicamEnumeratedType_Parameter, - parameterList[ii], - ¶mString); - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Trouble Unregistering ValueChangeWatch for " - "parameter %s. %s\n", - driverName, - __func__, - paramString, - errorString); - - Picam_DestroyString(paramString); - Picam_DestroyString(errorString); - } - } + Picam_DoesParameterExist(currentCameraHandle, + parameterList[ii], + &doesParamExist); + if (doesParamExist){ + error = Picam_GetParameterValueType(cameraHandle, parameterList[ii], + &valueType); + if (error != PicamError_None) { + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s \n", + driverName, + functionName); + return asynError; + } + switch (valueType) { + case PicamValueType_Integer: + case PicamValueType_Boolean: + case PicamValueType_Enumeration: + error = PicamAdvanced_UnregisterForIntegerValueChanged(cameraHandle, + parameterList[ii], piParameterIntegerValueChanged); + break; + case PicamValueType_LargeInteger: + error = PicamAdvanced_UnregisterForLargeIntegerValueChanged( + cameraHandle, parameterList[ii], + piParameterLargeIntegerValueChanged); + break; + case PicamValueType_FloatingPoint: + error = PicamAdvanced_UnregisterForFloatingPointValueChanged( + cameraHandle, parameterList[ii], + piParameterFloatingPointValueChanged); + break; + case PicamValueType_Rois: + printf("Unregistering ROIS value change\n"); + error = PicamAdvanced_UnregisterForRoisValueChanged(cameraHandle, + parameterList[ii], piParameterRoisValueChanged); + break; + case PicamValueType_Pulse: + error = PicamAdvanced_UnregisterForPulseValueChanged(cameraHandle, + parameterList[ii], piParameterPulseValueChanged); + break; + case PicamValueType_Modulations: + error = PicamAdvanced_UnregisterForModulationsValueChanged( + cameraHandle, parameterList[ii], + piParameterModulationsValueChanged); + break; + default: { + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s Unexpected valueType %s", driverName, functionName, + valueType); + return asynError; + } + } + if (error != PicamError_None) { + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + Picam_GetEnumerationString(PicamEnumeratedType_Parameter, + parameterList[ii], + ¶mString); + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s Trouble Unregistering ValueChangeWatch for " + "parameter %s. %s\n", + driverName, + __func__, + paramString, + errorString); + + Picam_DestroyString(paramString); + Picam_DestroyString(errorString); + } + } } return (asynStatus) status; } @@ -4280,9 +4372,9 @@ asynStatus ADPICam::piUnregisterValueChangeWatch(PicamHandle cameraHandle) { */ asynStatus ADPICam::piUpdateParameterExists() { int status = asynSuccess; - piint parameterCount; + piint parameterCount = 0; const PicamParameter *parameterList; - const pichar* string; + const pichar* string = NULL; Picam_GetParameters(currentCameraHandle, ¶meterList, ¶meterCount); asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, "%s:%s %d parameters found\n", driverName, @@ -4306,9 +4398,9 @@ asynStatus ADPICam::piUpdateParameterExists() { */ asynStatus ADPICam::piUpdateParameterRelevance() { int status = asynSuccess; - piint parameterCount; + piint parameterCount = 0; const PicamParameter *parameterList; - const pichar* string; + const pichar* string = NULL; Picam_GetParameters(currentCameraHandle, ¶meterList, ¶meterCount); asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, "%s:%s %d parameters found\n", driverName, @@ -4323,10 +4415,10 @@ asynStatus ADPICam::piUpdateParameterRelevance() { asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, "---- Found %s\n", string); Picam_DestroyString(string); Picam_IsParameterRelevant(currentCameraHandle, parameterList[ii], - &isRelevant); + &isRelevant); iRelevant = (int)isRelevant; status |= piSetParameterRelevance(pasynUserSelf, parameterList[ii], - iRelevant); + iRelevant); } Picam_DestroyParameters(parameterList); callParamCallbacks(); @@ -4431,67 +4523,67 @@ asynStatus ADPICam::piWriteFloat64RangeType(asynUser *pasynUser, const char *functionName = "piWriteFloat64RangeType"; int status = asynSuccess; PicamError error; - PicamConstraintType paramCT; + PicamConstraintType paramCT; PicamValueType valType; - const PicamRangeConstraint *constraint; + const PicamRangeConstraint *constraint; const pichar *errorString; const pichar *paramString; error = Picam_GetParameterValueType(currentCameraHandle, - picamParameter, - &valType); + picamParameter, + &valType); if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - ¶mString); - asynPrint(pasynUser, ASYN_TRACE_ERROR, - "%s:%s ERROR: problem getting Parameter value type for" - " parameter %s. %s\n", - driverName, - __func__, - paramString, - errorString); - Picam_DestroyString(paramString); - Picam_DestroyString(errorString); - return asynError; + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + ¶mString); + asynPrint(pasynUser, ASYN_TRACE_ERROR, + "%s:%s ERROR: problem getting Parameter value type for" + " parameter %s. %s\n", + driverName, + __func__, + paramString, + errorString); + Picam_DestroyString(paramString); + Picam_DestroyString(errorString); + return asynError; } if (valType == PicamValueType_FloatingPoint){ - error = Picam_SetParameterFloatingPointValue(currentCameraHandle, - picamParameter, - value); - if (error == PicamError_InvalidParameterValue) { - Picam_GetParameterConstraintType( currentCameraHandle, - picamParameter, - ¶mCT); - if (paramCT == PicamConstraintType_Range) { - Picam_GetParameterRangeConstraint(currentCameraHandle, - picamParameter, - PicamConstraintCategory_Required, - &constraint); + error = Picam_SetParameterFloatingPointValue(currentCameraHandle, + picamParameter, + value); + if (error == PicamError_InvalidParameterValue) { + Picam_GetParameterConstraintType( currentCameraHandle, + picamParameter, + ¶mCT); + if (paramCT == PicamConstraintType_Range) { + Picam_GetParameterRangeConstraint(currentCameraHandle, + picamParameter, + PicamConstraintCategory_Required, + &constraint); Picam_GetEnumerationString(PicamEnumeratedType_Parameter, picamParameter, ¶mString); - if ((value < constraint->minimum) || - (value > constraint->maximum)){ - asynPrint(pasynUser, ASYN_TRACE_WARNING, - "%s,%s Value %f is out of range %f,%f for " - "parameter %s\n", - driverName, - functionName, - value, - constraint->minimum, - constraint->maximum, - paramString); - value = (double)constraint->minimum; - } - error = Picam_SetParameterFloatingPointValue( - currentCameraHandle, - picamParameter, - value); - if (error != PicamError_None) { + if ((value < constraint->minimum) || + (value > constraint->maximum)){ + asynPrint(pasynUser, ASYN_TRACE_WARNING, + "%s,%s Value %f is out of range %f,%f for " + "parameter %s\n", + driverName, + functionName, + value, + constraint->minimum, + constraint->maximum, + paramString); + value = (double)constraint->minimum; + } + error = Picam_SetParameterFloatingPointValue( + currentCameraHandle, + picamParameter, + value); + if (error != PicamError_None) { Picam_GetEnumerationString(PicamEnumeratedType_Error, error, &errorString); Picam_GetEnumerationString(PicamEnumeratedType_Parameter, @@ -4510,8 +4602,8 @@ asynStatus ADPICam::piWriteFloat64RangeType(asynUser *pasynUser, } Picam_DestroyString(paramString); - } - } + } + } } return (asynStatus)status; } @@ -4530,74 +4622,67 @@ asynStatus ADPICam::piWriteInt32RangeType(asynUser *pasynUser, int status = asynSuccess; PicamValueType valType; PicamError error; - PicamConstraintType paramCT; - const PicamRangeConstraint *constraint; - const pichar *errorString; - const pichar *paramString; + PicamConstraintType paramCT; + const PicamRangeConstraint *constraint=NULL; + const pichar *errorString=NULL; + const pichar *paramString=NULL; error = Picam_GetParameterValueType(currentCameraHandle, picamParameter, &valType); if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - ¶mString); - asynPrint(pasynUser, ASYN_TRACE_ERROR, - "%s:%s ERROR: problem getting Parameter value type for" - " parameter %s. %s\n", - driverName, - __func__, - paramString, - errorString); - Picam_DestroyString(paramString); - Picam_DestroyString(errorString); + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + ¶mString); + asynPrint(pasynUser, ASYN_TRACE_ERROR, + "%s:%s ERROR: problem getting Parameter value type for" + " parameter %s. %s\n", + driverName, + __func__, + paramString, + errorString); + Picam_DestroyString(paramString); + Picam_DestroyString(errorString); return asynError; } if (valType == PicamValueType_Integer) { error = Picam_SetParameterIntegerValue(currentCameraHandle, picamParameter, value); if (error == PicamError_InvalidParameterValue) { - Picam_GetParameterConstraintType(currentCameraHandle, - picamParameter, - ¶mCT); - if (paramCT == PicamConstraintType_Range){ - Picam_GetParameterRangeConstraint(currentCameraHandle, - picamParameter, - PicamConstraintCategory_Required, - &constraint); + Picam_GetParameterConstraintType(currentCameraHandle, + picamParameter, + ¶mCT); + if (paramCT == PicamConstraintType_Range){ + Picam_GetParameterRangeConstraint(currentCameraHandle, + picamParameter, + PicamConstraintCategory_Required, + &constraint); Picam_GetEnumerationString(PicamEnumeratedType_Parameter, picamParameter, ¶mString); - if (value < constraint->minimum){ - asynPrint(pasynUser, ASYN_TRACE_ERROR, - "%s,%s Value %f is out of range %f,%f for " - "parameter %s\n", - driverName, - functionName, - value, - constraint->minimum, - constraint->maximum, - paramString); - value = (int)constraint->minimum; - } - else if (value > constraint->maximum){ - asynPrint(pasynUser, ASYN_TRACE_ERROR, - "%s,%s Value %f is out of range %f,%f for " - "parameter %s\n", - driverName, - functionName, - value, - constraint->minimum, - constraint->maximum, - paramString); - value = (int)constraint->maximum; - } + if ((value < constraint->minimum) || (value > constraint->maximum)) { + int existingValue; + error = Picam_GetParameterIntegerValue(currentCameraHandle, picamParameter, &existingValue); + asynPrint(pasynUser, ASYN_TRACE_WARNING, + "%s,%s Value %d is out of range %f,%f for " + "parameter %s, reverted to %d\n", + driverName, + functionName, + value, + constraint->minimum, + constraint->maximum, + paramString, + existingValue); + value = existingValue; + setIntegerParam(driverParameter, value); + callParamCallbacks(); + } error = Picam_SetParameterIntegerValue(currentCameraHandle, picamParameter, value); - if (error != PicamError_None) { + if (error != PicamError_None) { Picam_GetEnumerationString(PicamEnumeratedType_Error, error, &errorString); asynPrint(pasynUser, ASYN_TRACE_ERROR, @@ -4612,7 +4697,7 @@ asynStatus ADPICam::piWriteInt32RangeType(asynUser *pasynUser, return asynError; } Picam_DestroyString(paramString); - } + } } else if (error != PicamError_None) { Picam_GetEnumerationString(PicamEnumeratedType_Error, error, @@ -4639,45 +4724,45 @@ asynStatus ADPICam::piWriteInt32RangeType(asynUser *pasynUser, error = Picam_SetParameterLargeIntegerValue(currentCameraHandle, picamParameter, largeValue); if (error == PicamError_InvalidParameterValue) { - Picam_GetParameterConstraintType(currentCameraHandle, - picamParameter, - ¶mCT); - if (paramCT == PicamConstraintType_Range){ - Picam_GetParameterRangeConstraint(currentCameraHandle, - picamParameter, - PicamConstraintCategory_Required, - &constraint); + Picam_GetParameterConstraintType(currentCameraHandle, + picamParameter, + ¶mCT); + if (paramCT == PicamConstraintType_Range){ + Picam_GetParameterRangeConstraint(currentCameraHandle, + picamParameter, + PicamConstraintCategory_Required, + &constraint); Picam_GetEnumerationString(PicamEnumeratedType_Parameter, picamParameter, ¶mString); - if (value < constraint->minimum){ - asynPrint(pasynUser, ASYN_TRACE_ERROR, - "%s,%s Value %f is out of range %f,%f for " - "parameter %s\n", - driverName, - functionName, - value, - constraint->minimum, - constraint->maximum, - paramString); - value = (int)constraint->minimum; - } - else if (value > constraint->maximum){ - asynPrint(pasynUser, ASYN_TRACE_ERROR, - "%s,%s Value %f is out of range %f,%f for " - "parameter %s\n", - driverName, - functionName, - value, - constraint->minimum, - constraint->maximum, - paramString); - value = (int)constraint->maximum; - } - largeValue = (pi64s)value; + if (value < constraint->minimum){ + asynPrint(pasynUser, ASYN_TRACE_ERROR, + "%s,%s Value %f is out of range %f,%f for " + "parameter %s\n", + driverName, + functionName, + value, + constraint->minimum, + constraint->maximum, + paramString); + value = (int)constraint->minimum; + } + else if (value > constraint->maximum){ + asynPrint(pasynUser, ASYN_TRACE_ERROR, + "%s,%s Value %f is out of range %f,%f for " + "parameter %s\n", + driverName, + functionName, + value, + constraint->minimum, + constraint->maximum, + paramString); + value = (int)constraint->maximum; + } + largeValue = (pi64s)value; error = Picam_SetParameterLargeIntegerValue(currentCameraHandle, picamParameter, largeValue); - if (error != PicamError_None) { + if (error != PicamError_None) { Picam_GetEnumerationString(PicamEnumeratedType_Error, error, &errorString); asynPrint(pasynUser, ASYN_TRACE_ERROR, @@ -4690,9 +4775,9 @@ asynStatus ADPICam::piWriteInt32RangeType(asynUser *pasynUser, errorString); Picam_DestroyString(errorString); return asynError; - } + } Picam_DestroyString(paramString); - } + } } if (error != PicamError_None) { Picam_GetEnumerationString(PicamEnumeratedType_Error, error, @@ -4722,7 +4807,6 @@ asynStatus ADPICam::piWriteInt32CollectionType(asynUser *pasynUser, epicsInt32 value, int driverParameter, PicamParameter picamParameter){ - const char *functionName = "piWriteInt32CollectionType"; int status = asynSuccess; PicamValueType valType; PicamError error; @@ -4733,43 +4817,43 @@ asynStatus ADPICam::piWriteInt32CollectionType(asynUser *pasynUser, picamParameter, &valType); if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - ¶mString); - asynPrint(pasynUser, ASYN_TRACE_ERROR, - "%s:%s ERROR: problem getting Parameter value type for" - " parameter %s. %s\n", - driverName, - __func__, - paramString, - errorString); - Picam_DestroyString(paramString); - Picam_DestroyString(errorString); + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + ¶mString); + asynPrint(pasynUser, ASYN_TRACE_ERROR, + "%s:%s ERROR: problem getting Parameter value type for" + " parameter %s. %s\n", + driverName, + __func__, + paramString, + errorString); + Picam_DestroyString(paramString); + Picam_DestroyString(errorString); return asynError; } if (valType == PicamValueType_Boolean) { error = Picam_SetParameterIntegerValue(currentCameraHandle, picamParameter, value); if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - ¶mString); - asynPrint(pasynUser, ASYN_TRACE_ERROR, - "%s:%s ERROR: problem setting Parameter value for" - " parameter %s trying to set value to %d. %s\n", - driverName, - __func__, - paramString, - value, - errorString); - Picam_DestroyString(paramString); - Picam_DestroyString(errorString); + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + ¶mString); + asynPrint(pasynUser, ASYN_TRACE_ERROR, + "%s:%s ERROR: problem setting Parameter value for" + " parameter %s trying to set value to %d. %s\n", + driverName, + __func__, + paramString, + value, + errorString); + Picam_DestroyString(paramString); + Picam_DestroyString(errorString); return asynError; } } @@ -4777,22 +4861,22 @@ asynStatus ADPICam::piWriteInt32CollectionType(asynUser *pasynUser, error = Picam_SetParameterIntegerValue(currentCameraHandle, picamParameter, value); if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - ¶mString); - asynPrint(pasynUser, ASYN_TRACE_ERROR, - "%s:%s ERROR: problem setting Parameter value for" - " parameter %s trying to set value to %d. %s\n", - driverName, - __func__, - paramString, - value, - errorString); - Picam_DestroyString(paramString); - Picam_DestroyString(errorString); + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + ¶mString); + asynPrint(pasynUser, ASYN_TRACE_ERROR, + "%s:%s ERROR: problem setting Parameter value for" + " parameter %s trying to set value to %d. %s\n", + driverName, + __func__, + paramString, + value, + errorString); + Picam_DestroyString(paramString); + Picam_DestroyString(errorString); return asynError; } } @@ -4801,22 +4885,22 @@ asynStatus ADPICam::piWriteInt32CollectionType(asynUser *pasynUser, error = Picam_SetParameterLargeIntegerValue(currentCameraHandle, picamParameter, largeVal); if (error != PicamError_None) { - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - &errorString); - Picam_GetEnumerationString(PicamEnumeratedType_Error, - error, - ¶mString); - asynPrint(pasynUser, ASYN_TRACE_ERROR, - "%s:%s ERROR: problem setting Parameter value for" - " parameter %s trying to set value to %s. %s\n", - driverName, - __func__, - paramString, + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + &errorString); + Picam_GetEnumerationString(PicamEnumeratedType_Error, + error, + ¶mString); + asynPrint(pasynUser, ASYN_TRACE_ERROR, + "%s:%s ERROR: problem setting Parameter value for" + " parameter %s trying to set value to %s. %s\n", + driverName, + __func__, + paramString, largeVal, - errorString); - Picam_DestroyString(paramString); - Picam_DestroyString(errorString); + errorString); + Picam_DestroyString(paramString); + Picam_DestroyString(errorString); return asynError; } } @@ -4826,7 +4910,7 @@ asynStatus ADPICam::piWriteInt32CollectionType(asynUser *pasynUser, picamParameter, PicamConstraintCategory_Capable, ¶mCollection); if (error == PicamError_None) { - Picam_SetParameterFloatingPointValue(currentCameraHandle, + error = Picam_SetParameterFloatingPointValue(currentCameraHandle, picamParameter, paramCollection->values_array[value]); } else { @@ -4873,14 +4957,14 @@ static void piHandleNewImageTaskC(void *drvPvt) void ADPICam::piHandleNewImageTask(void) { const char * functionName = "piHandleNewImageTask"; - int imageMode; - int imagesCounter; - int numImages; - int arrayCounter; + int imageMode=0; + int imagesCounter=0; + int numImages=0; + int arrayCounter=0; int arrayCallbacks; NDArrayInfo arrayInfo; epicsTimeStamp currentTime; - PicamError error; + PicamError error; int useDriverTimestamps; int useFrameTracking; int frameTrackingBitDepth; @@ -4889,43 +4973,45 @@ void ADPICam::piHandleNewImageTask(void) pi64s *pFrameValue; int timeStampsRel; int trackFramesRel; - int timeStampBitDepth; + int timeStampBitDepth=0; int timeStampResolution; int frameSize; int numTimeStamps; epicsEventWaitStatus newImageTimeoutStatus = epicsEventWaitTimeout; double imageTimeout = 0.000001; - while (true) { - unlock(); - dataLock.unlock(); - while ( newImageTimeoutStatus ) { - newImageTimeoutStatus = epicsEventWaitWithTimeout(piHandleNewImageEvent, - imageTimeout); - if (!imageThreadKeepAlive){ - asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, - "%s:%s Image handling thread has been terminated.\n", - driverName, - __func__); - return; - } - } - newImageTimeoutStatus = epicsEventWaitTimeout; - dataLock.lock(); - lock(); - getIntegerParam(PICAM_TimeStampBitDepthRelevant, &timeStampsRel); - if (timeStampsRel){ - getIntegerParam(PICAM_TimeStamps, &useDriverTimestamps); - }else { - useDriverTimestamps = false; - } - getIntegerParam(PICAM_FrameTrackingBitDepthRelevant, &trackFramesRel); - if (trackFramesRel){ - getIntegerParam(PICAM_TrackFrames, &useFrameTracking); - }else { - useFrameTracking = false; - } - if (acqStatusErrors == PicamAcquisitionErrorsMask_None) { + while (true) { + unlock(); + dataLock.unlock(); + while (newImageTimeoutStatus) { + newImageTimeoutStatus = epicsEventWaitWithTimeout(piHandleNewImageEvent, + imageTimeout); + if (!imageThreadKeepAlive) { + asynPrint(pasynUserSelf, ASYN_TRACEIO_DEVICE, + "%s:%s Image handling thread has been terminated.\n", + driverName, + __func__); + return; + } + } + newImageTimeoutStatus = epicsEventWaitTimeout; + dataLock.lock(); + lock(); + getIntegerParam(PICAM_TimeStampBitDepthRelevant, &timeStampsRel); + if (timeStampsRel) { + getIntegerParam(PICAM_TimeStamps, &useDriverTimestamps); + } + else { + useDriverTimestamps = false; + } + getIntegerParam(PICAM_FrameTrackingBitDepthRelevant, &trackFramesRel); + if (trackFramesRel) { + getIntegerParam(PICAM_TrackFrames, &useFrameTracking); + } + else { + useFrameTracking = false; + } + if (acqStatusErrors == PicamAcquisitionErrorsMask_None) { if (acqStatusRunning || (!acqStatusRunning && (acqAvailableReadoutCount != 0) )) { getIntegerParam(ADImageMode, &imageMode); @@ -4935,7 +5021,7 @@ void ADPICam::piHandleNewImageTask(void) setIntegerParam(ADNumImagesCounter, imagesCounter); asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, "Acquire, Running %s, errors %d, rate %f, " - "availableDataCount %d\n", + "availableDataCount %d\n", acqStatusRunning ? "True" : "False", acqStatusErrors, acqStatusReadoutRate, acqAvailableReadoutCount); @@ -4952,132 +5038,139 @@ void ADPICam::piHandleNewImageTask(void) imageDataType, 0, NULL); if (this->pArrays[0] != NULL) { - if (acqStatusErrors != PicamAcquisitionErrorsMask_None) { - const char *acqStatusErrorString; - Picam_GetEnumerationString( - PicamEnumeratedType_AcquisitionErrorsMask, - acqStatusErrors, &acqStatusErrorString); - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Error found during acquisition: %s", - driverName, - functionName, - acqStatusErrorString); - Picam_DestroyString(acqStatusErrorString); - } - pibln overran; - error = PicamAdvanced_HasAcquisitionBufferOverrun( - currentDeviceHandle, &overran); - if (overran) { - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, - "%s:%s Overrun in acquisition buffer", - driverName, functionName); - } - pImage = this->pArrays[0]; - pImage->getInfo(&arrayInfo); - // Copy data from the input to the output - memcpy(pImage->pData, acqAvailableInitialReadout, - arrayInfo.totalBytes); - getIntegerParam(NDArrayCounter, &arrayCounter); - arrayCounter++; - setIntegerParam(NDArrayCounter, arrayCounter); - // Get timestamp from the driver if requested - if (timeStampsRel) { + if (acqStatusErrors != PicamAcquisitionErrorsMask_None) { + const char *acqStatusErrorString; + Picam_GetEnumerationString( + PicamEnumeratedType_AcquisitionErrorsMask, + acqStatusErrors, &acqStatusErrorString); + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s Error found during acquisition: %s", + driverName, + functionName, + acqStatusErrorString); + Picam_DestroyString(acqStatusErrorString); + } + pibln overran; + error = PicamAdvanced_HasAcquisitionBufferOverrun( + currentDeviceHandle, &overran); + if (overran) { + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s Overrun in acquisition buffer", + driverName, functionName); + } + pImage = this->pArrays[0]; + pImage->getInfo(&arrayInfo); + // Copy data from the input to the output + if (arrayInfo.totalBytes > pImage->dataSize) + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + "%s:%s Data size exceeds image", + driverName, functionName); + else + memcpy(pImage->pData, acqAvailableInitialReadout, + arrayInfo.totalBytes); + getIntegerParam(NDArrayCounter, &arrayCounter); + arrayCounter++; + setIntegerParam(NDArrayCounter, arrayCounter); + // Get timestamp from the driver if requested + if (timeStampsRel) { getIntegerParam(PICAM_TimeStampBitDepth, &timeStampBitDepth); getIntegerParam(PICAM_TimeStampResolution, &timeStampResolution); - } + } Picam_GetParameterIntegerValue(currentCameraHandle, - PicamParameter_FrameSize, - &frameSize); - if (!useDriverTimestamps){ - epicsTimeGetCurrent(¤tTime); - pImage->timeStamp = currentTime.secPastEpoch - + currentTime.nsec / 1.e9; - updateTimeStamp(&pImage->epicsTS); - } - else { - pTimeStampValue = - (pi64s*) ((pibyte *)acqAvailableInitialReadout - + frameSize); - timeStampValue = *pTimeStampValue; - asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, - "%s%s TimeStamp %d Res %d frame size %d " - "timestamp %f\n", - driverName, - functionName, - timeStampValue, - timeStampResolution, - frameSize, - (double)timeStampValue /(double)timeStampResolution); - pImage->timeStamp = (double)timeStampValue / - (double)timeStampResolution; - updateTimeStamp(&pImage->epicsTS); - } - // use frame tracking for UniqueID if requested - if (!useFrameTracking) { - pImage->uniqueId = arrayCounter; - } - else { - asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, - "%s:%s TimeStamps 0X%X\n", - driverName, - functionName, - useDriverTimestamps); - // Frame tracking info follows data and time stamps. - // need to determine the correct number of time - // stamps to skip - if ((useDriverTimestamps == - PicamTimeStampsMask_None)) { - numTimeStamps = 0; - } - else if ((useDriverTimestamps == - PicamTimeStampsMask_ExposureStarted) || - (useDriverTimestamps == - PicamTimeStampsMask_ExposureEnded) ) { - numTimeStamps = 1; - } - else { - numTimeStamps = 2; - } - getIntegerParam(PICAM_FrameTrackingBitDepth, - &frameTrackingBitDepth); - switch (frameTrackingBitDepth){ - case 64: - pFrameValue = - (pi64s*) ((pibyte *)acqAvailableInitialReadout - + frameSize - + (numTimeStamps * timeStampBitDepth/8)); - asynPrint (pasynUserSelf, ASYN_TRACE_FLOW, - "%s:%s Frame tracking bit depth %d" - " timeStampBitDepth %d, frameValue %d " - " readout count %d\n", - driverName, - functionName, - frameTrackingBitDepth, - timeStampBitDepth, - *pFrameValue, - acqAvailableReadoutCount); - pImage->uniqueId = (int)(*pFrameValue); - break; - } - } - - /* Get attributes that have been defined for this driver */ - getAttributes(pImage->pAttributeList); - - asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, - "%s:%s: calling imageDataCallback\n", - driverName, - functionName); - - doCallbacksGenericPointer(pImage, NDArrayData, 0); + PicamParameter_FrameSize, + &frameSize); + if (!useDriverTimestamps){ + epicsTimeGetCurrent(¤tTime); + pImage->timeStamp = currentTime.secPastEpoch + + currentTime.nsec / 1.e9; + updateTimeStamp(&pImage->epicsTS); + } + else { + pTimeStampValue = + (pi64s*) ((pibyte *)acqAvailableInitialReadout + + frameSize); + timeStampValue = *pTimeStampValue; + asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, + "%s%s TimeStamp %d Res %d frame size %d " + "timestamp %f\n", + driverName, + functionName, + timeStampValue, + timeStampResolution, + frameSize, + (double)timeStampValue /(double)timeStampResolution); + pImage->timeStamp = (double)timeStampValue / + (double)timeStampResolution; + updateTimeStamp(&pImage->epicsTS); + } + // use frame tracking for UniqueID if requested + if (!useFrameTracking) { + pImage->uniqueId = arrayCounter; + } + else { + asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, + "%s:%s TimeStamps 0X%X\n", + driverName, + functionName, + useDriverTimestamps); + // Frame tracking info follows data and time stamps. + // need to determine the correct number of time + // stamps to skip + if ((useDriverTimestamps == + PicamTimeStampsMask_None)) { + numTimeStamps = 0; + } + else if ((useDriverTimestamps == + PicamTimeStampsMask_ExposureStarted) || + (useDriverTimestamps == + PicamTimeStampsMask_ExposureEnded) ) { + numTimeStamps = 1; + } + else { + numTimeStamps = 2; + } + getIntegerParam(PICAM_FrameTrackingBitDepth, + &frameTrackingBitDepth); + switch (frameTrackingBitDepth){ + case 64: + pFrameValue = + (pi64s*) ((pibyte *)acqAvailableInitialReadout + + frameSize + + (numTimeStamps * timeStampBitDepth/8)); + asynPrint (pasynUserSelf, ASYN_TRACE_FLOW, + "%s:%s Frame tracking bit depth %d" + " timeStampBitDepth %d, frameValue %d " + " readout count %d\n", + driverName, + functionName, + frameTrackingBitDepth, + timeStampBitDepth, + *pFrameValue, + acqAvailableReadoutCount); + pImage->uniqueId = (int)(*pFrameValue); + break; + } + } + + /* Get attributes that have been defined for this driver */ + getAttributes(pImage->pAttributeList); + if (PICAM_CCDMultiTrack.size() > 0) + PICAM_CCDMultiTrack.storeTrackAttributes(pImage->pAttributeList); + + asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, + "%s:%s: calling imageDataCallback\n", + driverName, + functionName); + + doCallbacksGenericPointer(pImage, NDArrayData, 0); } else { asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, "%s:%s error allocating buffer\n", driverName, functionName); - piAcquireStop(); + piAcquireStop(pasynUserSelf); setIntegerParam(ADStatus, ADStatusError); callParamCallbacks(); } @@ -5086,11 +5179,11 @@ void ADPICam::piHandleNewImageTask(void) } else if (!(acqStatusRunning) && acqAvailableReadoutCount == 0) { - const char *errorMaskString; + const char *errorMaskString=NULL; Picam_GetEnumerationString( - PicamEnumeratedType_AcquisitionErrorsMask, + PicamEnumeratedType_AcquisitionErrorsMask, acqStatusErrors, - &errorMaskString); + &errorMaskString); asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, "Acquire1, Running %s, errors %d, rate %f, array " "counter %d\n", @@ -5099,34 +5192,34 @@ void ADPICam::piHandleNewImageTask(void) acqStatusReadoutRate, arrayCounter); Picam_DestroyString(errorMaskString); - piAcquireStop(); + piAcquireStop(pasynUserSelf); } - } - else if (acqStatusErrors != PicamAcquisitionErrorsMask_None) { - const char *errorMaskString; - Picam_GetEnumerationString(PicamEnumeratedType_AcquisitionErrorsMask, + } + else if (acqStatusErrors != PicamAcquisitionErrorsMask_None) { + const char *errorMaskString=NULL; + Picam_GetEnumerationString(PicamEnumeratedType_AcquisitionErrorsMask, acqStatusErrors, &errorMaskString); - asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, + asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, "Acquire2, Running %s, errors %d, rate %f\n", - acqStatusRunning ? "True":"false", - errorMaskString, - acqStatusReadoutRate); - Picam_DestroyString(errorMaskString); - piAcquireStop(); - } - callParamCallbacks(); - if (((imageMode == ADImageMultiple) + acqStatusRunning ? "True" : "false", + errorMaskString, + acqStatusReadoutRate); + Picam_DestroyString(errorMaskString); + piAcquireStop(pasynUserSelf); + } + callParamCallbacks(); + if (((imageMode == ADImageMultiple) && (imagesCounter >= numImages)) || ((imageMode == ADImageSingle) && - (imagesCounter == 1))) { - asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, + (imagesCounter == 1))) { + asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, "%s:%s Calling piAcquireStop()\n", driverName, __func__); - lock(); - piAcquireStop(); - unlock(); + lock(); + piAcquireStop(pasynUserSelf); + unlock(); + } } - } } @@ -5138,10 +5231,11 @@ static const iocshArg PICamConfigArg1 = { "maxBuffers", iocshArgInt }; static const iocshArg PICamConfigArg2 = { "maxMemory", iocshArgInt }; static const iocshArg PICamConfigArg3 = { "priority", iocshArgInt }; static const iocshArg PICamConfigArg4 = { "stackSize", iocshArgInt }; +static const iocshArg PICamConfigArg5 = { "selectedCamera", iocshArgInt }; static const iocshArg * const PICamConfigArgs[] = { &PICamConfigArg0, - &PICamConfigArg1, &PICamConfigArg2, &PICamConfigArg3, &PICamConfigArg4 }; + &PICamConfigArg1, &PICamConfigArg2, &PICamConfigArg3, &PICamConfigArg4, &PICamConfigArg5 }; -static const iocshFuncDef configPICam = { "PICamConfig", 5, PICamConfigArgs }; +static const iocshFuncDef configPICam = { "PICamConfig", 6, PICamConfigArgs }; static const iocshArg PICamAddDemoCamArg0 = { "Demo Camera name", iocshArgString }; @@ -5152,7 +5246,7 @@ static const iocshFuncDef addDemoCamPICam = { "PICamAddDemoCamera", 1, static void configPICamCallFunc(const iocshArgBuf *args) { PICamConfig(args[0].sval, args[1].ival, args[2].ival, args[3].ival, - args[4].ival); + args[4].ival, args[5].ival); } static void addDemoCamPICamCallFunc(const iocshArgBuf *args) { @@ -5165,5 +5259,5 @@ static void PICamRegister(void) { } extern "C" { -epicsExportRegistrar(PICamRegister); + epicsExportRegistrar(PICamRegister); } diff --git a/PICamApp/src/ADPICam.h b/PICamApp/src/ADPICam.h index 1aeaedd..70e9cf9 100644 --- a/PICamApp/src/ADPICam.h +++ b/PICamApp/src/ADPICam.h @@ -21,7 +21,7 @@ #include #include #include - +#include #include "picam_advanced.h" @@ -32,7 +32,7 @@ class epicsShareClass ADPICam: public ADDriver { static const char *driverName; ADPICam(const char *portName, int maxBuffers, size_t maxMemory, - int priority, int stackSize); + int priority, int stackSize, int selectedCamera); ~ADPICam(); /* These are the methods that we override from ADDriver */ virtual asynStatus readEnum(asynUser *pasynUser, char *strings[], @@ -99,10 +99,11 @@ class epicsShareClass ADPICam: public ADDriver { void piHandleNewImageTask(void); void report(FILE *fp, int details); virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value); + virtual asynStatus writeInt32Array(asynUser *pasynUser, epicsInt32 *value, size_t nElements); virtual asynStatus writeFloat64(asynUser *pasynUser, epicsFloat64 value); virtual asynStatus readOctet(asynUser *pasynUser, char *value, size_t nChars, size_t *nActual, - int *eomReason); + int *eomReason); protected: int PICAM_VersionNumber; @@ -120,9 +121,7 @@ class epicsShareClass ADPICam: public ADDriver { int PICAM_FirmwareRevisionUnavailable; //Shutter Timing - int PICAM_ShutterClosingDelay; int PICAM_ShutterDelayResolution; - int PICAM_ShutterOpeningDelay; int PICAM_ShutterTimingMode; // Intensifier @@ -222,6 +221,8 @@ class epicsShareClass ADPICam: public ADDriver { int PICAM_PixelHeight; int PICAM_PixelWidth; int PICAM_SensorActiveBottomMargin; + + CCDMultiTrack PICAM_CCDMultiTrack; // int PICAM_SensorActiveHeight; int PICAM_SensorActiveLeftMargin; int PICAM_SensorActiveRightMargin; @@ -231,6 +232,7 @@ class epicsShareClass ADPICam: public ADDriver { int PICAM_SensorMaskedHeight; int PICAM_SensorMaskedTopMargin; int PICAM_SensorSecondaryActiveHeight; + int PICAM_SensorActiveExtendedHeight; int PICAM_SensorSecondaryMaskedHeight; int PICAM_SensorType; @@ -372,6 +374,7 @@ class epicsShareClass ADPICam: public ADDriver { int PICAM_SensorMaskedHeightExists; int PICAM_SensorMaskedTopMarginExists; int PICAM_SensorSecondaryActiveHeightExists; + int PICAM_SensorActiveExtendedHeightExists; int PICAM_SensorSecondaryMaskedHeightExists; int PICAM_SensorTypeExists; int PICAM_ActiveBottomMarginExists; @@ -502,6 +505,7 @@ class epicsShareClass ADPICam: public ADDriver { int PICAM_SensorMaskedHeightRelevant; int PICAM_SensorMaskedTopMarginRelevant; int PICAM_SensorSecondaryActiveHeightRelevant; + int PICAM_SensorActiveExtendedHeightRelevant; int PICAM_SensorSecondaryMaskedHeightRelevant; int PICAM_SensorTypeRelevant; int PICAM_ActiveBottomMarginRelevant; @@ -537,7 +541,7 @@ class epicsShareClass ADPICam: public ADDriver { pibln acqStatusRunning; piint availableCamerasCount; const PicamCameraID *availableCameraIDs; - std::vector buffer_; + std::vector buffer_; PicamHandle currentCameraHandle; PicamHandle currentDeviceHandle; epicsMutex dataLock; @@ -555,8 +559,8 @@ class epicsShareClass ADPICam: public ADDriver { std::unordered_map parameterValueMap; std::unordered_map picamParameterMap; asynStatus initializeDetector(); - asynStatus piAcquireStart(); - asynStatus piAcquireStop(); + asynStatus piAcquireStart(asynUser *pasynUser); + asynStatus piAcquireStop(asynUser *pasynUser); asynStatus piClearParameterExists(); asynStatus piClearParameterRelevance(); asynStatus piCreateAndIndexADParam(const char * name, @@ -593,8 +597,10 @@ class epicsShareClass ADPICam: public ADDriver { asynStatus piSetParameterRelevance(asynUser *pasynUser, PicamParameter parameter, int relevence); asynStatus piSetParameterValuesFromSelectedCamera(); - asynStatus piSetRois(int minX, int minY, int width, int height, int binX, - int binY); + asynStatus piSetRoisValuesFromSelectedCamera(const PicamParameter& parameter); + asynStatus piSetSingleRoi(int minX, int minY, int sizeX, int sizeY, int binX, + int binY); + asynStatus piSetMultiRoi(asynUser *pasynUser, int minX, int sizeX, int binX); asynStatus piSetSelectedCamera(asynUser *pasynUser, int selectedIndex); asynStatus piSetSelectedUnavailableCamera(asynUser *pasynUser, int selectedIndex); @@ -754,6 +760,7 @@ class epicsShareClass ADPICam: public ADDriver { #define PICAM_SensorMaskedHeightString "PICAM_SENSOR_MASKED_HEIGHT" #define PICAM_SensorMaskedTopMarginString "PICAM_SENSOR_MASKED_TOP_MARGIN" #define PICAM_SensorSecondaryActiveHeightString "PICAM_SENSOR_SECONDARY_ACTIVE_HEIGHT" +#define PICAM_SensorActiveExtendedHeightString "PICAM_SENSOR_ACTIVE_EXTENDED_HEIGHT" #define PICAM_SensorSecondaryMaskedHeightString "PICAM_SENSOR_SECONDARY_MASKED_HEIGHT" #define PICAM_SensorTypeString "PICAM_SENSOR_TYPE" diff --git a/PICamApp/src/Makefile b/PICamApp/src/Makefile index 86f033e..765baff 100644 --- a/PICamApp/src/Makefile +++ b/PICamApp/src/Makefile @@ -8,11 +8,24 @@ USR_CPPFLAGS += -D__X64 endif LIBRARY_IOC_WIN32 = ADPICam -LIB_SRCS_WIN32 += ADPICam.cpp +LIBRARY_IOC_Linux = ADPICam +LIB_SRCS += ADPICam.cpp + +ifeq (win32-x86, $(findstring win32-x86, $(T_A))) +LIB_LIBS += Picam32 +else ifeq (windows-x64, $(findstring windows-x64, $(T_A))) LIB_LIBS += Picam +else +LIB_SYS_LIBS += picam piac picc pida pidi +endif DBD += PICamSupport.dbd +ifeq (mingw, $(findstring mingw, $(T_A))) + # multiple definition of `_Unwind_Resume on Linux. I don't know how to fix it. + USR_LDFLAGS += -Wl,-allow-multiple-definition +endif + include $(ADCORE)/ADApp/commonLibraryMakefile #============================= diff --git a/PICamSupport/Makefile b/PICamSupport/Makefile index f560cc2..bcf018e 100644 --- a/PICamSupport/Makefile +++ b/PICamSupport/Makefile @@ -12,6 +12,59 @@ INC += pil_platform.h ifeq (windows-x64, $(findstring windows-x64, $(T_A))) LIB_INSTALLS_WIN32 += ../os/windows-x64/Picam.lib +else ifeq (win32-x86, $(findstring win32-x86, $(T_A))) +LIB_INSTALLS_WIN32 += ../os/windows-x86/Picam32.lib +else +# These are Princeton libraries +LIB_INSTALLS_Linux += ../os/linux-x64/libpiac.so +LIB_INSTALLS_Linux += ../os/linux-x64/libpicam.so +LIB_INSTALLS_Linux += ../os/linux-x64/libpicc.so +LIB_INSTALLS_Linux += ../os/linux-x64/libpida.so +LIB_INSTALLS_Linux += ../os/linux-x64/libpidi.so +# These are Pleora libraries +LIB_INSTALLS_Linux += ../os/linux-x64/libGCBase_gcc40_v2_4.so +LIB_INSTALLS_Linux += ../os/linux-x64/libGenApi_gcc40_v2_4.so +LIB_INSTALLS_Linux += ../os/linux-x64/liblog4cpp_gcc40_v2_4.so +LIB_INSTALLS_Linux += ../os/linux-x64/libLog_gcc40_v2_4.so +LIB_INSTALLS_Linux += ../os/linux-x64/libMathParser_gcc40_v2_4.so +LIB_INSTALLS_Linux += ../os/linux-x64/libEbTransportLayerLib.so.5.1.7.3988 +LIB_INSTALLS_Linux += ../os/linux-x64/libEbTransportLayerLib.so +LIB_INSTALLS_Linux += ../os/linux-x64/libEbUtilsLib.so.5.1.7.3988 +LIB_INSTALLS_Linux += ../os/linux-x64/libEbUtilsLib.so +LIB_INSTALLS_Linux += ../os/linux-x64/libftd2xx.so +LIB_INSTALLS_Linux += ../os/linux-x64/libPtConvertersLib.so.5.1.7.3988 +LIB_INSTALLS_Linux += ../os/linux-x64/libPtConvertersLib.so +LIB_INSTALLS_Linux += ../os/linux-x64/libPtUtilsLib.so.5.1.7.3988 +LIB_INSTALLS_Linux += ../os/linux-x64/libPtUtilsLib.so +LIB_INSTALLS_Linux += ../os/linux-x64/libPvAppUtils.so.4.1.7.3988 +LIB_INSTALLS_Linux += ../os/linux-x64/libPvAppUtils.so +LIB_INSTALLS_Linux += ../os/linux-x64/libPvBase.so.4.1.7.3988 +LIB_INSTALLS_Linux += ../os/linux-x64/libPvBase.so +LIB_INSTALLS_Linux += ../os/linux-x64/libPvBuffer.so.4.1.7.3988 +LIB_INSTALLS_Linux += ../os/linux-x64/libPvBuffer.so +LIB_INSTALLS_Linux += ../os/linux-x64/libPvDevice.so.4.1.7.3988 +LIB_INSTALLS_Linux += ../os/linux-x64/libPvDevice.so +LIB_INSTALLS_Linux += ../os/linux-x64/libPvGenICam.so.4.1.7.3988 +LIB_INSTALLS_Linux += ../os/linux-x64/libPvGenICam.so +LIB_INSTALLS_Linux += ../os/linux-x64/libPvGUI.so.4.1.7.3988 +LIB_INSTALLS_Linux += ../os/linux-x64/libPvGUI.so +LIB_INSTALLS_Linux += ../os/linux-x64/libPvPersistence.so.4.1.7.3988 +LIB_INSTALLS_Linux += ../os/linux-x64/libPvPersistence.so +LIB_INSTALLS_Linux += ../os/linux-x64/libPvSerial.so.4.1.7.3988 +LIB_INSTALLS_Linux += ../os/linux-x64/libPvSerial.so +LIB_INSTALLS_Linux += ../os/linux-x64/libPvStream.so.4.1.7.3988 +LIB_INSTALLS_Linux += ../os/linux-x64/libPvStream.so +LIB_INSTALLS_Linux += ../os/linux-x64/libPvTransmitter.so.4.1.7.3988 +LIB_INSTALLS_Linux += ../os/linux-x64/libPvTransmitter.so +LIB_INSTALLS_Linux += ../os/linux-x64/libPvVirtualDevice.so.4.1.7.3988 +LIB_INSTALLS_Linux += ../os/linux-x64/libPvVirtualDevice.so +LIB_INSTALLS_Linux += ../os/linux-x64/libPvSerial.so +LIB_INSTALLS_Linux += ../os/linux-x64/libSimpleImagingLib.so.4.1.7.3988 +LIB_INSTALLS_Linux += ../os/linux-x64/libSimpleImagingLib.so +LIB_INSTALLS_Linux += ../os/linux-x64/libXalan-C_gcc40_v1_10_1.so +LIB_INSTALLS_Linux += ../os/linux-x64/libXalanMessages_gcc40_v1_10_1.so +LIB_INSTALLS_Linux += ../os/linux-x64/libXerces-C_gcc40_v2_7_1.so +LIB_INSTALLS_Linux += ../os/linux-x64/libXMLLoader_gcc40_v2_4.so endif #============================= diff --git a/PICamSupport/os/linux-x64/libEbTransportLayerLib.so b/PICamSupport/os/linux-x64/libEbTransportLayerLib.so new file mode 100644 index 0000000..ca04465 --- /dev/null +++ b/PICamSupport/os/linux-x64/libEbTransportLayerLib.so @@ -0,0 +1 @@ +libEbTransportLayerLib.so.5.1.7.3988 \ No newline at end of file diff --git a/PICamSupport/os/linux-x64/libEbTransportLayerLib.so.5.1.7.3988 b/PICamSupport/os/linux-x64/libEbTransportLayerLib.so.5.1.7.3988 new file mode 100644 index 0000000..044c4a3 Binary files /dev/null and b/PICamSupport/os/linux-x64/libEbTransportLayerLib.so.5.1.7.3988 differ diff --git a/PICamSupport/os/linux-x64/libEbUtilsLib.so b/PICamSupport/os/linux-x64/libEbUtilsLib.so new file mode 100644 index 0000000..adc1cb1 --- /dev/null +++ b/PICamSupport/os/linux-x64/libEbUtilsLib.so @@ -0,0 +1 @@ +libEbUtilsLib.so.5.1.7.3988 \ No newline at end of file diff --git a/PICamSupport/os/linux-x64/libEbUtilsLib.so.5.1.7.3988 b/PICamSupport/os/linux-x64/libEbUtilsLib.so.5.1.7.3988 new file mode 100644 index 0000000..422711e Binary files /dev/null and b/PICamSupport/os/linux-x64/libEbUtilsLib.so.5.1.7.3988 differ diff --git a/PICamSupport/os/linux-x64/libGCBase_gcc40_v2_4.so b/PICamSupport/os/linux-x64/libGCBase_gcc40_v2_4.so new file mode 100644 index 0000000..a300bbb Binary files /dev/null and b/PICamSupport/os/linux-x64/libGCBase_gcc40_v2_4.so differ diff --git a/PICamSupport/os/linux-x64/libGenApi_gcc40_v2_4.so b/PICamSupport/os/linux-x64/libGenApi_gcc40_v2_4.so new file mode 100644 index 0000000..79d65c8 Binary files /dev/null and b/PICamSupport/os/linux-x64/libGenApi_gcc40_v2_4.so differ diff --git a/PICamSupport/os/linux-x64/libLog_gcc40_v2_4.so b/PICamSupport/os/linux-x64/libLog_gcc40_v2_4.so new file mode 100644 index 0000000..1fe2e4a Binary files /dev/null and b/PICamSupport/os/linux-x64/libLog_gcc40_v2_4.so differ diff --git a/PICamSupport/os/linux-x64/libMathParser_gcc40_v2_4.so b/PICamSupport/os/linux-x64/libMathParser_gcc40_v2_4.so new file mode 100644 index 0000000..953108f Binary files /dev/null and b/PICamSupport/os/linux-x64/libMathParser_gcc40_v2_4.so differ diff --git a/PICamSupport/os/linux-x64/libPtConvertersLib.so b/PICamSupport/os/linux-x64/libPtConvertersLib.so new file mode 100644 index 0000000..83b74bf --- /dev/null +++ b/PICamSupport/os/linux-x64/libPtConvertersLib.so @@ -0,0 +1 @@ +libPtConvertersLib.so.5.1.7.3988 \ No newline at end of file diff --git a/PICamSupport/os/linux-x64/libPtConvertersLib.so.5.1.7.3988 b/PICamSupport/os/linux-x64/libPtConvertersLib.so.5.1.7.3988 new file mode 100644 index 0000000..79051f8 Binary files /dev/null and b/PICamSupport/os/linux-x64/libPtConvertersLib.so.5.1.7.3988 differ diff --git a/PICamSupport/os/linux-x64/libPtUtilsLib.so b/PICamSupport/os/linux-x64/libPtUtilsLib.so new file mode 100644 index 0000000..b8ccaf8 --- /dev/null +++ b/PICamSupport/os/linux-x64/libPtUtilsLib.so @@ -0,0 +1 @@ +libPtUtilsLib.so.5.1.7.3988 \ No newline at end of file diff --git a/PICamSupport/os/linux-x64/libPtUtilsLib.so.5.1.7.3988 b/PICamSupport/os/linux-x64/libPtUtilsLib.so.5.1.7.3988 new file mode 100644 index 0000000..63c4ad6 Binary files /dev/null and b/PICamSupport/os/linux-x64/libPtUtilsLib.so.5.1.7.3988 differ diff --git a/PICamSupport/os/linux-x64/libPvAppUtils.so b/PICamSupport/os/linux-x64/libPvAppUtils.so new file mode 100644 index 0000000..ee29d6c --- /dev/null +++ b/PICamSupport/os/linux-x64/libPvAppUtils.so @@ -0,0 +1 @@ +libPvAppUtils.so.4.1.7.3988 \ No newline at end of file diff --git a/PICamSupport/os/linux-x64/libPvAppUtils.so.4.1.7.3988 b/PICamSupport/os/linux-x64/libPvAppUtils.so.4.1.7.3988 new file mode 100644 index 0000000..8a0265b Binary files /dev/null and b/PICamSupport/os/linux-x64/libPvAppUtils.so.4.1.7.3988 differ diff --git a/PICamSupport/os/linux-x64/libPvBase.so b/PICamSupport/os/linux-x64/libPvBase.so new file mode 100644 index 0000000..cee2cad --- /dev/null +++ b/PICamSupport/os/linux-x64/libPvBase.so @@ -0,0 +1 @@ +libPvBase.so.4.1.7.3988 \ No newline at end of file diff --git a/PICamSupport/os/linux-x64/libPvBase.so.4.1.7.3988 b/PICamSupport/os/linux-x64/libPvBase.so.4.1.7.3988 new file mode 100644 index 0000000..64278f9 Binary files /dev/null and b/PICamSupport/os/linux-x64/libPvBase.so.4.1.7.3988 differ diff --git a/PICamSupport/os/linux-x64/libPvBuffer.so b/PICamSupport/os/linux-x64/libPvBuffer.so new file mode 100644 index 0000000..709d170 --- /dev/null +++ b/PICamSupport/os/linux-x64/libPvBuffer.so @@ -0,0 +1 @@ +libPvBuffer.so.4.1.7.3988 \ No newline at end of file diff --git a/PICamSupport/os/linux-x64/libPvBuffer.so.4.1.7.3988 b/PICamSupport/os/linux-x64/libPvBuffer.so.4.1.7.3988 new file mode 100644 index 0000000..867658a Binary files /dev/null and b/PICamSupport/os/linux-x64/libPvBuffer.so.4.1.7.3988 differ diff --git a/PICamSupport/os/linux-x64/libPvDevice.so b/PICamSupport/os/linux-x64/libPvDevice.so new file mode 100644 index 0000000..9d3795b --- /dev/null +++ b/PICamSupport/os/linux-x64/libPvDevice.so @@ -0,0 +1 @@ +libPvDevice.so.4.1.7.3988 \ No newline at end of file diff --git a/PICamSupport/os/linux-x64/libPvDevice.so.4.1.7.3988 b/PICamSupport/os/linux-x64/libPvDevice.so.4.1.7.3988 new file mode 100644 index 0000000..67dbaf0 Binary files /dev/null and b/PICamSupport/os/linux-x64/libPvDevice.so.4.1.7.3988 differ diff --git a/PICamSupport/os/linux-x64/libPvGUI.so b/PICamSupport/os/linux-x64/libPvGUI.so new file mode 100644 index 0000000..bd43872 --- /dev/null +++ b/PICamSupport/os/linux-x64/libPvGUI.so @@ -0,0 +1 @@ +libPvGUI.so.4.1.7.3988 \ No newline at end of file diff --git a/PICamSupport/os/linux-x64/libPvGUI.so.4.1.7.3988 b/PICamSupport/os/linux-x64/libPvGUI.so.4.1.7.3988 new file mode 100644 index 0000000..f9ed3d0 Binary files /dev/null and b/PICamSupport/os/linux-x64/libPvGUI.so.4.1.7.3988 differ diff --git a/PICamSupport/os/linux-x64/libPvGenICam.so b/PICamSupport/os/linux-x64/libPvGenICam.so new file mode 100644 index 0000000..86403a6 --- /dev/null +++ b/PICamSupport/os/linux-x64/libPvGenICam.so @@ -0,0 +1 @@ +libPvGenICam.so.4.1.7.3988 \ No newline at end of file diff --git a/PICamSupport/os/linux-x64/libPvGenICam.so.4.1.7.3988 b/PICamSupport/os/linux-x64/libPvGenICam.so.4.1.7.3988 new file mode 100644 index 0000000..2217262 Binary files /dev/null and b/PICamSupport/os/linux-x64/libPvGenICam.so.4.1.7.3988 differ diff --git a/PICamSupport/os/linux-x64/libPvPersistence.so b/PICamSupport/os/linux-x64/libPvPersistence.so new file mode 100644 index 0000000..126a21d --- /dev/null +++ b/PICamSupport/os/linux-x64/libPvPersistence.so @@ -0,0 +1 @@ +libPvPersistence.so.4.1.7.3988 \ No newline at end of file diff --git a/PICamSupport/os/linux-x64/libPvPersistence.so.4.1.7.3988 b/PICamSupport/os/linux-x64/libPvPersistence.so.4.1.7.3988 new file mode 100644 index 0000000..58791ff Binary files /dev/null and b/PICamSupport/os/linux-x64/libPvPersistence.so.4.1.7.3988 differ diff --git a/PICamSupport/os/linux-x64/libPvSerial.so b/PICamSupport/os/linux-x64/libPvSerial.so new file mode 100644 index 0000000..965e018 --- /dev/null +++ b/PICamSupport/os/linux-x64/libPvSerial.so @@ -0,0 +1 @@ +libPvSerial.so.4.1.7.3988 \ No newline at end of file diff --git a/PICamSupport/os/linux-x64/libPvSerial.so.4.1.7.3988 b/PICamSupport/os/linux-x64/libPvSerial.so.4.1.7.3988 new file mode 100644 index 0000000..cabdb94 Binary files /dev/null and b/PICamSupport/os/linux-x64/libPvSerial.so.4.1.7.3988 differ diff --git a/PICamSupport/os/linux-x64/libPvStream.so b/PICamSupport/os/linux-x64/libPvStream.so new file mode 100644 index 0000000..eaf0528 --- /dev/null +++ b/PICamSupport/os/linux-x64/libPvStream.so @@ -0,0 +1 @@ +libPvStream.so.4.1.7.3988 \ No newline at end of file diff --git a/PICamSupport/os/linux-x64/libPvStream.so.4.1.7.3988 b/PICamSupport/os/linux-x64/libPvStream.so.4.1.7.3988 new file mode 100644 index 0000000..16810b8 Binary files /dev/null and b/PICamSupport/os/linux-x64/libPvStream.so.4.1.7.3988 differ diff --git a/PICamSupport/os/linux-x64/libPvTransmitter.so b/PICamSupport/os/linux-x64/libPvTransmitter.so new file mode 100644 index 0000000..ff6579e --- /dev/null +++ b/PICamSupport/os/linux-x64/libPvTransmitter.so @@ -0,0 +1 @@ +libPvTransmitter.so.4.1.7.3988 \ No newline at end of file diff --git a/PICamSupport/os/linux-x64/libPvTransmitter.so.4.1.7.3988 b/PICamSupport/os/linux-x64/libPvTransmitter.so.4.1.7.3988 new file mode 100644 index 0000000..16b6196 Binary files /dev/null and b/PICamSupport/os/linux-x64/libPvTransmitter.so.4.1.7.3988 differ diff --git a/PICamSupport/os/linux-x64/libPvVirtualDevice.so b/PICamSupport/os/linux-x64/libPvVirtualDevice.so new file mode 100644 index 0000000..9b9100f --- /dev/null +++ b/PICamSupport/os/linux-x64/libPvVirtualDevice.so @@ -0,0 +1 @@ +libPvVirtualDevice.so.4.1.7.3988 \ No newline at end of file diff --git a/PICamSupport/os/linux-x64/libPvVirtualDevice.so.4.1.7.3988 b/PICamSupport/os/linux-x64/libPvVirtualDevice.so.4.1.7.3988 new file mode 100644 index 0000000..2523882 Binary files /dev/null and b/PICamSupport/os/linux-x64/libPvVirtualDevice.so.4.1.7.3988 differ diff --git a/PICamSupport/os/linux-x64/libSimpleImagingLib.so b/PICamSupport/os/linux-x64/libSimpleImagingLib.so new file mode 100644 index 0000000..15c16d7 --- /dev/null +++ b/PICamSupport/os/linux-x64/libSimpleImagingLib.so @@ -0,0 +1 @@ +libSimpleImagingLib.so.4.1.7.3988 \ No newline at end of file diff --git a/PICamSupport/os/linux-x64/libSimpleImagingLib.so.4.1.7.3988 b/PICamSupport/os/linux-x64/libSimpleImagingLib.so.4.1.7.3988 new file mode 100644 index 0000000..38bc4bd Binary files /dev/null and b/PICamSupport/os/linux-x64/libSimpleImagingLib.so.4.1.7.3988 differ diff --git a/PICamSupport/os/linux-x64/libXMLLoader_gcc40_v2_4.so b/PICamSupport/os/linux-x64/libXMLLoader_gcc40_v2_4.so new file mode 100644 index 0000000..e414770 Binary files /dev/null and b/PICamSupport/os/linux-x64/libXMLLoader_gcc40_v2_4.so differ diff --git a/PICamSupport/os/linux-x64/libXalan-C_gcc40_v1_10_1.so b/PICamSupport/os/linux-x64/libXalan-C_gcc40_v1_10_1.so new file mode 100644 index 0000000..304ec3d Binary files /dev/null and b/PICamSupport/os/linux-x64/libXalan-C_gcc40_v1_10_1.so differ diff --git a/PICamSupport/os/linux-x64/libXalanMessages_gcc40_v1_10_1.so b/PICamSupport/os/linux-x64/libXalanMessages_gcc40_v1_10_1.so new file mode 100644 index 0000000..8f3dc6b Binary files /dev/null and b/PICamSupport/os/linux-x64/libXalanMessages_gcc40_v1_10_1.so differ diff --git a/PICamSupport/os/linux-x64/libXerces-C_gcc40_v2_7_1.so b/PICamSupport/os/linux-x64/libXerces-C_gcc40_v2_7_1.so new file mode 100644 index 0000000..7de75f6 Binary files /dev/null and b/PICamSupport/os/linux-x64/libXerces-C_gcc40_v2_7_1.so differ diff --git a/PICamSupport/os/linux-x64/libftd2xx.so b/PICamSupport/os/linux-x64/libftd2xx.so new file mode 100644 index 0000000..eaaf77e Binary files /dev/null and b/PICamSupport/os/linux-x64/libftd2xx.so differ diff --git a/PICamSupport/os/linux-x64/liblog4cpp_gcc40_v2_4.so b/PICamSupport/os/linux-x64/liblog4cpp_gcc40_v2_4.so new file mode 100644 index 0000000..d3633c9 Binary files /dev/null and b/PICamSupport/os/linux-x64/liblog4cpp_gcc40_v2_4.so differ diff --git a/PICamSupport/os/linux-x64/libpiac.so b/PICamSupport/os/linux-x64/libpiac.so new file mode 100644 index 0000000..204da28 Binary files /dev/null and b/PICamSupport/os/linux-x64/libpiac.so differ diff --git a/PICamSupport/os/linux-x64/libpicam.so b/PICamSupport/os/linux-x64/libpicam.so new file mode 100644 index 0000000..de065d1 Binary files /dev/null and b/PICamSupport/os/linux-x64/libpicam.so differ diff --git a/PICamSupport/os/linux-x64/libpicc.so b/PICamSupport/os/linux-x64/libpicc.so new file mode 100644 index 0000000..b416b28 Binary files /dev/null and b/PICamSupport/os/linux-x64/libpicc.so differ diff --git a/PICamSupport/os/linux-x64/libpida.so b/PICamSupport/os/linux-x64/libpida.so new file mode 100644 index 0000000..8d9a4ba Binary files /dev/null and b/PICamSupport/os/linux-x64/libpida.so differ diff --git a/PICamSupport/os/linux-x64/libpidi.so b/PICamSupport/os/linux-x64/libpidi.so new file mode 100644 index 0000000..56554ef Binary files /dev/null and b/PICamSupport/os/linux-x64/libpidi.so differ diff --git a/PICamSupport/os/windows-x64/Picam.lib b/PICamSupport/os/windows-x64/Picam.lib index eb78f64..fc77987 100644 Binary files a/PICamSupport/os/windows-x64/Picam.lib and b/PICamSupport/os/windows-x64/Picam.lib differ diff --git a/PICamSupport/os/windows-x86/Picam32.lib b/PICamSupport/os/windows-x86/Picam32.lib new file mode 100644 index 0000000..760bdb9 Binary files /dev/null and b/PICamSupport/os/windows-x86/Picam32.lib differ diff --git a/PICamSupport/picam.h b/PICamSupport/picam.h index a6dbb43..8bce500 100644 --- a/PICamSupport/picam.h +++ b/PICamSupport/picam.h @@ -1,1535 +1,1983 @@ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/* picam.h - Princeton Instruments Camera Control API */ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -#if !defined PICAM_H -#define PICAM_H - -#include "pil_platform.h" - -/******************************************************************************/ -/* C++ Prologue */ -/******************************************************************************/ -#if defined __cplusplus && !defined PICAM_EXPORTS - extern "C" - { -#endif - -/******************************************************************************/ -/* Function Declarations */ -/******************************************************************************/ -#if defined PICAM_EXPORTS -# define PICAM_FUNCTION PIL_EXPORT_DEF -#else -# define PICAM_FUNCTION PIL_IMPORT -#endif -#define PICAM_API PICAM_FUNCTION PicamError PIL_CALL - -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/* General Library Usage - Error Codes, Version, Initialization and Strings */ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ - -/*----------------------------------------------------------------------------*/ -/* Function Return Error Codes -----------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef enum PicamError -{ - /*------------------------------------------------------------------------*/ - /* Success ---------------------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamError_None = 0, - /*------------------------------------------------------------------------*/ - /* General Errors --------------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamError_UnexpectedError = 4, - PicamError_UnexpectedNullPointer = 3, - PicamError_InvalidPointer = 35, - PicamError_InvalidCount = 39, - PicamError_InvalidOperation = 42, - PicamError_OperationCanceled = 43, - /*------------------------------------------------------------------------*/ - /* Library Initialization Errors -----------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamError_LibraryNotInitialized = 1, - PicamError_LibraryAlreadyInitialized = 5, - /*------------------------------------------------------------------------*/ - /* General String Handling Errors ----------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamError_InvalidEnumeratedType = 16, - PicamError_EnumerationValueNotDefined = 17, - /*------------------------------------------------------------------------*/ - /* Plug 'n Play Discovery Errors -----------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamError_NotDiscoveringCameras = 18, - PicamError_AlreadyDiscoveringCameras = 19, - /*------------------------------------------------------------------------*/ - /* Camera Access Errors --------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamError_NoCamerasAvailable = 34, - PicamError_CameraAlreadyOpened = 7, - PicamError_InvalidCameraID = 8, - PicamError_InvalidHandle = 9, - PicamError_DeviceCommunicationFailed = 15, - PicamError_DeviceDisconnected = 23, - PicamError_DeviceOpenElsewhere = 24, - /*------------------------------------------------------------------------*/ - /* Demo Errors -----------------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamError_InvalidDemoModel = 6, - PicamError_InvalidDemoSerialNumber = 21, - PicamError_DemoAlreadyConnected = 22, - PicamError_DemoNotSupported = 40, - /*------------------------------------------------------------------------*/ - /* Camera Parameter Access Errors ----------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamError_ParameterHasInvalidValueType = 11, - PicamError_ParameterHasInvalidConstraintType = 13, - PicamError_ParameterDoesNotExist = 12, - PicamError_ParameterValueIsReadOnly = 10, - PicamError_InvalidParameterValue = 2, - PicamError_InvalidConstraintCategory = 38, - PicamError_ParameterValueIsIrrelevant = 14, - PicamError_ParameterIsNotOnlineable = 25, - PicamError_ParameterIsNotReadable = 26, - /*------------------------------------------------------------------------*/ - /* Camera Data Acquisition Errors ----------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamError_InvalidParameterValues = 28, - PicamError_ParametersNotCommitted = 29, - PicamError_InvalidAcquisitionBuffer = 30, - PicamError_InvalidReadoutCount = 36, - PicamError_InvalidReadoutTimeOut = 37, - PicamError_InsufficientMemory = 31, - PicamError_AcquisitionInProgress = 20, - PicamError_AcquisitionNotInProgress = 27, - PicamError_TimeOutOccurred = 32, - PicamError_AcquisitionUpdatedHandlerRegistered = 33, - PicamError_NondestructiveReadoutEnabled = 41 - /*------------------------------------------------------------------------*/ -} PicamError; /* (44) */ -/*----------------------------------------------------------------------------*/ -/* Library Version -----------------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetVersion( - piint* major, - piint* minor, - piint* distribution, - piint* released ); -/*----------------------------------------------------------------------------*/ -/* Library Initialization ----------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_IsLibraryInitialized( pibln* inited ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_InitializeLibrary( void ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_UninitializeLibrary( void ); -/*----------------------------------------------------------------------------*/ -/* General String Handling ---------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_DestroyString( const pichar* s ); -/*----------------------------------------------------------------------------*/ -typedef enum PicamEnumeratedType -{ - /*------------------------------------------------------------------------*/ - /* Function Return Error Codes -------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamEnumeratedType_Error = 1, - /*------------------------------------------------------------------------*/ - /* General String Handling -----------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamEnumeratedType_EnumeratedType = 29, - /*------------------------------------------------------------------------*/ - /* Camera Identification -------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamEnumeratedType_Model = 2, - PicamEnumeratedType_ComputerInterface = 3, - /*------------------------------------------------------------------------*/ - /* Camera Plug 'n Play Discovery -----------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamEnumeratedType_DiscoveryAction = 26, - /*------------------------------------------------------------------------*/ - /* Camera Access ---------------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamEnumeratedType_HandleType = 27, - /*------------------------------------------------------------------------*/ - /* Camera Parameters -----------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamEnumeratedType_ValueType = 4, - PicamEnumeratedType_ConstraintType = 5, - PicamEnumeratedType_Parameter = 6, - /*------------------------------------------------------------------------*/ - /* Camera Parameter Values - Enumerated Types ----------------------------*/ - /*------------------------------------------------------------------------*/ - PicamEnumeratedType_AdcAnalogGain = 7, - PicamEnumeratedType_AdcQuality = 8, - PicamEnumeratedType_CcdCharacteristicsMask = 9, - PicamEnumeratedType_GateTrackingMask = 36, - PicamEnumeratedType_GatingMode = 34, - PicamEnumeratedType_GatingSpeed = 38, - PicamEnumeratedType_EMIccdGainControlMode = 42, - PicamEnumeratedType_IntensifierOptionsMask = 35, - PicamEnumeratedType_IntensifierStatus = 33, - PicamEnumeratedType_ModulationTrackingMask = 41, - PicamEnumeratedType_OrientationMask = 10, - PicamEnumeratedType_OutputSignal = 11, - PicamEnumeratedType_PhosphorType = 39, - PicamEnumeratedType_PhotocathodeSensitivity = 40, - PicamEnumeratedType_PhotonDetectionMode = 43, - PicamEnumeratedType_PixelFormat = 12, - PicamEnumeratedType_ReadoutControlMode = 13, - PicamEnumeratedType_SensorTemperatureStatus = 14, - PicamEnumeratedType_SensorType = 15, - PicamEnumeratedType_ShutterTimingMode = 16, - PicamEnumeratedType_TimeStampsMask = 17, - PicamEnumeratedType_TriggerCoupling = 30, - PicamEnumeratedType_TriggerDetermination = 18, - PicamEnumeratedType_TriggerResponse = 19, - PicamEnumeratedType_TriggerSource = 31, - PicamEnumeratedType_TriggerTermination = 32, - /*------------------------------------------------------------------------*/ - /* Camera Parameter Information - Value Access ---------------------------*/ - /*------------------------------------------------------------------------*/ - PicamEnumeratedType_ValueAccess = 20, - /*------------------------------------------------------------------------*/ - /* Camera Parameter Information - Dynamics -------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamEnumeratedType_DynamicsMask = 28, - /*------------------------------------------------------------------------*/ - /* Camera Parameter Constraints - Enumerated Types -----------------------*/ - /*------------------------------------------------------------------------*/ - PicamEnumeratedType_ConstraintScope = 21, - PicamEnumeratedType_ConstraintSeverity = 22, - PicamEnumeratedType_ConstraintCategory = 23, - /*------------------------------------------------------------------------*/ - /* Camera Parameter Constraints - Regions Of Interest --------------------*/ - /*------------------------------------------------------------------------*/ - PicamEnumeratedType_RoisConstraintRulesMask = 24, - /*------------------------------------------------------------------------*/ - /* Acquisition Control ---------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamEnumeratedType_AcquisitionErrorsMask = 25 - /*------------------------------------------------------------------------*/ -} PicamEnumeratedType; /* (37,44) */ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetEnumerationString( - PicamEnumeratedType type, - piint value, - const pichar** s ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ - -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/* Camera Identification, Access, Information and Demo */ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ - -/*----------------------------------------------------------------------------*/ -/* Camera Identification -----------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef enum PicamModel -{ - /*------------------------------------------------------------------------*/ - /* PIXIS Series (76) -----------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamModel_PixisSeries = 0, - /* PIXIS 100 Series ------------------------------------------------------*/ - PicamModel_Pixis100Series = 1, - PicamModel_Pixis100F = 2, - PicamModel_Pixis100B = 6, - PicamModel_Pixis100R = 3, - PicamModel_Pixis100C = 4, - PicamModel_Pixis100BR = 5, - PicamModel_Pixis100BExcelon = 54, - PicamModel_Pixis100BRExcelon = 55, - PicamModel_PixisXO100B = 7, - PicamModel_PixisXO100BR = 8, - PicamModel_PixisXB100B = 68, - PicamModel_PixisXB100BR = 69, - /* PIXIS 256 Series ------------------------------------------------------*/ - PicamModel_Pixis256Series = 26, - PicamModel_Pixis256F = 27, - PicamModel_Pixis256B = 29, - PicamModel_Pixis256E = 28, - PicamModel_Pixis256BR = 30, - PicamModel_PixisXB256BR = 31, - /* PIXIS 400 Series ------------------------------------------------------*/ - PicamModel_Pixis400Series = 37, - PicamModel_Pixis400F = 38, - PicamModel_Pixis400B = 40, - PicamModel_Pixis400R = 39, - PicamModel_Pixis400BR = 41, - PicamModel_Pixis400BExcelon = 56, - PicamModel_Pixis400BRExcelon = 57, - PicamModel_PixisXO400B = 42, - PicamModel_PixisXB400BR = 70, - /* PIXIS 512 Series ------------------------------------------------------*/ - PicamModel_Pixis512Series = 43, - PicamModel_Pixis512F = 44, - PicamModel_Pixis512B = 45, - PicamModel_Pixis512BUV = 46, - PicamModel_Pixis512BExcelon = 58, - PicamModel_PixisXO512F = 49, - PicamModel_PixisXO512B = 50, - PicamModel_PixisXF512F = 48, - PicamModel_PixisXF512B = 47, - /* PIXIS 1024 Series -----------------------------------------------------*/ - PicamModel_Pixis1024Series = 9, - PicamModel_Pixis1024F = 10, - PicamModel_Pixis1024B = 11, - PicamModel_Pixis1024BR = 13, - PicamModel_Pixis1024BUV = 12, - PicamModel_Pixis1024BExcelon = 59, - PicamModel_Pixis1024BRExcelon = 60, - PicamModel_PixisXO1024F = 16, - PicamModel_PixisXO1024B = 14, - PicamModel_PixisXO1024BR = 15, - PicamModel_PixisXF1024F = 17, - PicamModel_PixisXF1024B = 18, - PicamModel_PixisXB1024BR = 71, - /* PIXIS 1300 Series -----------------------------------------------------*/ - PicamModel_Pixis1300Series = 51, - PicamModel_Pixis1300F = 52, - PicamModel_Pixis1300F_2 = 75, - PicamModel_Pixis1300B = 53, - PicamModel_Pixis1300BR = 73, - PicamModel_Pixis1300BExcelon = 61, - PicamModel_Pixis1300BRExcelon = 62, - PicamModel_PixisXO1300B = 65, - PicamModel_PixisXF1300B = 66, - PicamModel_PixisXB1300R = 72, - /* PIXIS 2048 Series -----------------------------------------------------*/ - PicamModel_Pixis2048Series = 20, - PicamModel_Pixis2048F = 21, - PicamModel_Pixis2048B = 22, - PicamModel_Pixis2048BR = 67, - PicamModel_Pixis2048BExcelon = 63, - PicamModel_Pixis2048BRExcelon = 74, - PicamModel_PixisXO2048B = 23, - PicamModel_PixisXF2048F = 25, - PicamModel_PixisXF2048B = 24, - /* PIXIS 2K Series -------------------------------------------------------*/ - PicamModel_Pixis2KSeries = 32, - PicamModel_Pixis2KF = 33, - PicamModel_Pixis2KB = 34, - PicamModel_Pixis2KBUV = 36, - PicamModel_Pixis2KBExcelon = 64, - PicamModel_PixisXO2KB = 35, - /*------------------------------------------------------------------------*/ - /* Quad-RO Series (104) --------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamModel_QuadroSeries = 100, - PicamModel_Quadro4096 = 101, - PicamModel_Quadro4096_2 = 103, - PicamModel_Quadro4320 = 102, - /*------------------------------------------------------------------------*/ - /* ProEM Series (214) ----------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamModel_ProEMSeries = 200, - /* ProEM 512 Series ------------------------------------------------------*/ - PicamModel_ProEM512Series = 203, - PicamModel_ProEM512B = 201, - PicamModel_ProEM512BK = 205, - PicamModel_ProEM512BExcelon = 204, - PicamModel_ProEM512BKExcelon = 206, - /* ProEM 1024 Series -----------------------------------------------------*/ - PicamModel_ProEM1024Series = 207, - PicamModel_ProEM1024B = 202, - PicamModel_ProEM1024BExcelon = 208, - /* ProEM 1600 Series -----------------------------------------------------*/ - PicamModel_ProEM1600Series = 209, - PicamModel_ProEM1600xx2B = 212, - PicamModel_ProEM1600xx2BExcelon = 210, - PicamModel_ProEM1600xx4B = 213, - PicamModel_ProEM1600xx4BExcelon = 211, - /*------------------------------------------------------------------------*/ - /* ProEM+ Series (614) ---------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamModel_ProEMPlusSeries = 600, - /* ProEM+ 512 Series -----------------------------------------------------*/ - PicamModel_ProEMPlus512Series = 603, - PicamModel_ProEMPlus512B = 601, - PicamModel_ProEMPlus512BK = 605, - PicamModel_ProEMPlus512BExcelon = 604, - PicamModel_ProEMPlus512BKExcelon = 606, - /* ProEM+ 1024 Series ----------------------------------------------------*/ - PicamModel_ProEMPlus1024Series = 607, - PicamModel_ProEMPlus1024B = 602, - PicamModel_ProEMPlus1024BExcelon = 608, - /* ProEM+ 1600 Series ----------------------------------------------------*/ - PicamModel_ProEMPlus1600Series = 609, - PicamModel_ProEMPlus1600xx2B = 612, - PicamModel_ProEMPlus1600xx2BExcelon = 610, - PicamModel_ProEMPlus1600xx4B = 613, - PicamModel_ProEMPlus1600xx4BExcelon = 611, - /*------------------------------------------------------------------------*/ - /* ProEM-HS Series (1209) ------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamModel_ProEMHSSeries = 1200, - /* ProEM-HS 512 Series ---------------------------------------------------*/ - PicamModel_ProEMHS512Series = 1201, - PicamModel_ProEMHS512B = 1202, - PicamModel_ProEMHS512BK = 1207, - PicamModel_ProEMHS512BExcelon = 1203, - PicamModel_ProEMHS512BKExcelon = 1208, - /* ProEM-HS 1024 Series --------------------------------------------------*/ - PicamModel_ProEMHS1024Series = 1204, - PicamModel_ProEMHS1024B = 1205, - PicamModel_ProEMHS1024BExcelon = 1206, - /*------------------------------------------------------------------------*/ - /* PI-MAX3 Series (303) --------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamModel_PIMax3Series = 300, - PicamModel_PIMax31024I = 301, - PicamModel_PIMax31024x256 = 302, - /*------------------------------------------------------------------------*/ - /* PI-MAX4 Series (721) --------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamModel_PIMax4Series = 700, - /* PI-MAX4 1024i Series --------------------------------------------------*/ - PicamModel_PIMax41024ISeries = 703, - PicamModel_PIMax41024I = 701, - PicamModel_PIMax41024IRF = 704, - /* PI-MAX4 1024f Series --------------------------------------------------*/ - PicamModel_PIMax41024FSeries = 710, - PicamModel_PIMax41024F = 711, - PicamModel_PIMax41024FRF = 712, - /* PI-MAX4 1024x256 Series -----------------------------------------------*/ - PicamModel_PIMax41024x256Series = 705, - PicamModel_PIMax41024x256 = 702, - PicamModel_PIMax41024x256RF = 706, - /* PI-MAX4 2048 Series ---------------------------------------------------*/ - PicamModel_PIMax42048Series = 716, - PicamModel_PIMax42048F = 717, - PicamModel_PIMax42048B = 718, - PicamModel_PIMax42048FRF = 719, - PicamModel_PIMax42048BRF = 720, - /* PI-MAX4 512EM Series --------------------------------------------------*/ - PicamModel_PIMax4512EMSeries = 708, - PicamModel_PIMax4512EM = 707, - PicamModel_PIMax4512BEM = 709, - /* PI-MAX4 1024EM Series -------------------------------------------------*/ - PicamModel_PIMax41024EMSeries = 713, - PicamModel_PIMax41024EM = 715, - PicamModel_PIMax41024BEM = 714, - /*------------------------------------------------------------------------*/ - /* PyLoN Series (439) ----------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamModel_PylonSeries = 400, - /* PyLoN 100 Series ------------------------------------------------------*/ - PicamModel_Pylon100Series = 418, - PicamModel_Pylon100F = 404, - PicamModel_Pylon100B = 401, - PicamModel_Pylon100BR = 407, - PicamModel_Pylon100BExcelon = 425, - PicamModel_Pylon100BRExcelon = 426, - /* PyLoN 256 Series ------------------------------------------------------*/ - PicamModel_Pylon256Series = 419, - PicamModel_Pylon256F = 409, - PicamModel_Pylon256B = 410, - PicamModel_Pylon256E = 411, - PicamModel_Pylon256BR = 412, - /* PyLoN 400 Series ------------------------------------------------------*/ - PicamModel_Pylon400Series = 420, - PicamModel_Pylon400F = 405, - PicamModel_Pylon400B = 402, - PicamModel_Pylon400BR = 408, - PicamModel_Pylon400BExcelon = 427, - PicamModel_Pylon400BRExcelon = 428, - /* PyLoN 1024 Series -----------------------------------------------------*/ - PicamModel_Pylon1024Series = 421, - PicamModel_Pylon1024B = 417, - PicamModel_Pylon1024BExcelon = 429, - /* PyLoN 1300 Series -----------------------------------------------------*/ - PicamModel_Pylon1300Series = 422, - PicamModel_Pylon1300F = 406, - PicamModel_Pylon1300B = 403, - PicamModel_Pylon1300R = 438, - PicamModel_Pylon1300BR = 432, - PicamModel_Pylon1300BExcelon = 430, - PicamModel_Pylon1300BRExcelon = 433, - /* PyLoN 2048 Series -----------------------------------------------------*/ - PicamModel_Pylon2048Series = 423, - PicamModel_Pylon2048F = 415, - PicamModel_Pylon2048B = 434, - PicamModel_Pylon2048BR = 416, - PicamModel_Pylon2048BExcelon = 435, - PicamModel_Pylon2048BRExcelon = 436, - /* PyLoN 2K Series -------------------------------------------------------*/ - PicamModel_Pylon2KSeries = 424, - PicamModel_Pylon2KF = 413, - PicamModel_Pylon2KB = 414, - PicamModel_Pylon2KBUV = 437, - PicamModel_Pylon2KBExcelon = 431, - /*------------------------------------------------------------------------*/ - /* PyLoN-IR Series (904) -------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamModel_PylonirSeries = 900, - /* PyLoN-IR 1024 Series --------------------------------------------------*/ - PicamModel_Pylonir1024Series = 901, - PicamModel_Pylonir102422 = 902, - PicamModel_Pylonir102417 = 903, - /*------------------------------------------------------------------------*/ - /* PIoNIR Series (502) ---------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamModel_PionirSeries = 500, - PicamModel_Pionir640 = 501, - /*------------------------------------------------------------------------*/ - /* NIRvana Series (802) --------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamModel_NirvanaSeries = 800, - PicamModel_Nirvana640 = 801, - /*------------------------------------------------------------------------*/ - /* NIRvana ST Series (1302) ----------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamModel_NirvanaSTSeries = 1300, - PicamModel_NirvanaST640 = 1301, - /*------------------------------------------------------------------------*/ - /* NIRvana-LN Series (1102) ----------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamModel_NirvanaLNSeries = 1100, - PicamModel_NirvanaLN640 = 1101 - /*------------------------------------------------------------------------*/ -} PicamModel; -/*----------------------------------------------------------------------------*/ -typedef enum PicamComputerInterface -{ - PicamComputerInterface_Usb2 = 1, - PicamComputerInterface_1394A = 2, - PicamComputerInterface_GigabitEthernet = 3 -} PicamComputerInterface; /* (4) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamStringSize -{ - PicamStringSize_SensorName = 64, - PicamStringSize_SerialNumber = 64, - PicamStringSize_FirmwareName = 64, - PicamStringSize_FirmwareDetail = 256 -} PicamStringSize; -/*----------------------------------------------------------------------------*/ -typedef struct PicamCameraID -{ - PicamModel model; - PicamComputerInterface computer_interface; - pichar sensor_name[PicamStringSize_SensorName]; - pichar serial_number[PicamStringSize_SerialNumber]; -} PicamCameraID; -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_DestroyCameraIDs( const PicamCameraID* id_array ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetAvailableCameraIDs( - const PicamCameraID** id_array, - piint* id_count ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetUnavailableCameraIDs( - const PicamCameraID** id_array, - piint* id_count ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_IsCameraIDConnected( - const PicamCameraID* id, - pibln* connected ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_IsCameraIDOpenElsewhere( - const PicamCameraID* id, - pibln* open_elsewhere ); -/*----------------------------------------------------------------------------*/ -/* Camera Access -------------------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef void* PicamHandle; -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_DestroyHandles( const PicamHandle* handle_array ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_OpenFirstCamera( PicamHandle* camera ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_OpenCamera( - const PicamCameraID* id, - PicamHandle* camera ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_CloseCamera( PicamHandle camera ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetOpenCameras( - const PicamHandle** camera_array, - piint* camera_count ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_IsCameraConnected( - PicamHandle camera, - pibln* connected ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetCameraID( - PicamHandle camera, - PicamCameraID* id ); -/*----------------------------------------------------------------------------*/ -/* Camera Information --------------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef struct PicamFirmwareDetail -{ - pichar name[PicamStringSize_FirmwareName]; - pichar detail[PicamStringSize_FirmwareDetail]; -} PicamFirmwareDetail; -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_DestroyFirmwareDetails( - const PicamFirmwareDetail* firmware_array ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetFirmwareDetails( - const PicamCameraID* id, - const PicamFirmwareDetail** firmware_array, - piint* firmware_count ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -/* Demo Camera ---------------------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_DestroyModels( const PicamModel* model_array ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetAvailableDemoCameraModels( - const PicamModel** model_array, - piint* model_count ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_ConnectDemoCamera( - PicamModel model, - const pichar* serial_number, - PicamCameraID* id ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_DisconnectDemoCamera( const PicamCameraID* id ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_IsDemoCamera( - const PicamCameraID* id, - pibln* demo ); -/*----------------------------------------------------------------------------*/ - -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/* Camera Parameter Values, Information, Constraints and Commitment */ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ - -/*----------------------------------------------------------------------------*/ -/* Camera Parameters ---------------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef enum PicamValueType -{ - /*------------------------------------------------------------------------*/ - /* Integral Types --------------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamValueType_Integer = 1, - PicamValueType_Boolean = 3, - PicamValueType_Enumeration = 4, - /*------------------------------------------------------------------------*/ - /* Large Integral Type ---------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamValueType_LargeInteger = 6, - /*------------------------------------------------------------------------*/ - /* Floating Point Type ---------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamValueType_FloatingPoint = 2, - /*------------------------------------------------------------------------*/ - /* Regions of Interest Type ----------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamValueType_Rois = 5, - /*------------------------------------------------------------------------*/ - /* Pulse Type ------------------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - PicamValueType_Pulse = 7, - /*------------------------------------------------------------------------*/ - /* Custom Intensifier Modulation Sequence Type ---------------------------*/ - /*------------------------------------------------------------------------*/ - PicamValueType_Modulations = 8 - /*------------------------------------------------------------------------*/ -} PicamValueType; /* (9) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamConstraintType -{ - PicamConstraintType_None = 1, - PicamConstraintType_Range = 2, - PicamConstraintType_Collection = 3, - PicamConstraintType_Rois = 4, - PicamConstraintType_Pulse = 5, - PicamConstraintType_Modulations = 6 -} PicamConstraintType; /* (7) */ -/*-----------------------------------------------------------------------------------------*/ -typedef enum PicamParameter -{ -#define PI_V(v,c,n) (((PicamConstraintType_##c)<<24)+((PicamValueType_##v)<<16)+(n)) - /*-------------------------------------------------------------------------------------*/ - /* Shutter Timing ---------------------------------------------------------------------*/ - /*-------------------------------------------------------------------------------------*/ - PicamParameter_ExposureTime = PI_V(FloatingPoint, Range, 23), - PicamParameter_ShutterTimingMode = PI_V(Enumeration, Collection, 24), - PicamParameter_ShutterOpeningDelay = PI_V(FloatingPoint, Range, 46), - PicamParameter_ShutterClosingDelay = PI_V(FloatingPoint, Range, 25), - PicamParameter_ShutterDelayResolution = PI_V(FloatingPoint, Collection, 47), - /*-------------------------------------------------------------------------------------*/ - /* Intensifier ------------------------------------------------------------------------*/ - /*-------------------------------------------------------------------------------------*/ - PicamParameter_EnableIntensifier = PI_V(Boolean, Collection, 86), - PicamParameter_IntensifierStatus = PI_V(Enumeration, None, 87), - PicamParameter_IntensifierGain = PI_V(Integer, Range, 88), - PicamParameter_EMIccdGainControlMode = PI_V(Enumeration, Collection, 123), - PicamParameter_EMIccdGain = PI_V(Integer, Range, 124), - PicamParameter_PhosphorDecayDelay = PI_V(FloatingPoint, Range, 89), - PicamParameter_PhosphorDecayDelayResolution = PI_V(FloatingPoint, Collection, 90), - PicamParameter_GatingMode = PI_V(Enumeration, Collection, 93), - PicamParameter_RepetitiveGate = PI_V(Pulse, Pulse, 94), - PicamParameter_SequentialStartingGate = PI_V(Pulse, Pulse, 95), - PicamParameter_SequentialEndingGate = PI_V(Pulse, Pulse, 96), - PicamParameter_SequentialGateStepCount = PI_V(LargeInteger, Range, 97), - PicamParameter_SequentialGateStepIterations = PI_V(LargeInteger, Range, 98), - PicamParameter_DifStartingGate = PI_V(Pulse, Pulse, 102), - PicamParameter_DifEndingGate = PI_V(Pulse, Pulse, 103), - PicamParameter_BracketGating = PI_V(Boolean, Collection, 100), - PicamParameter_IntensifierOptions = PI_V(Enumeration, None, 101), - PicamParameter_EnableModulation = PI_V(Boolean, Collection, 111), - PicamParameter_ModulationDuration = PI_V(FloatingPoint, Range, 118), - PicamParameter_ModulationFrequency = PI_V(FloatingPoint, Range, 112), - PicamParameter_RepetitiveModulationPhase = PI_V(FloatingPoint, Range, 113), - PicamParameter_SequentialStartingModulationPhase = PI_V(FloatingPoint, Range, 114), - PicamParameter_SequentialEndingModulationPhase = PI_V(FloatingPoint, Range, 115), - PicamParameter_CustomModulationSequence = PI_V(Modulations, Modulations, 119), - PicamParameter_PhotocathodeSensitivity = PI_V(Enumeration, None, 107), - PicamParameter_GatingSpeed = PI_V(Enumeration, None, 108), - PicamParameter_PhosphorType = PI_V(Enumeration, None, 109), - PicamParameter_IntensifierDiameter = PI_V(FloatingPoint, None, 110), - /*-------------------------------------------------------------------------------------*/ - /* Analog to Digital Conversion -------------------------------------------------------*/ - /*-------------------------------------------------------------------------------------*/ - PicamParameter_AdcSpeed = PI_V(FloatingPoint, Collection, 33), - PicamParameter_AdcBitDepth = PI_V(Integer, Collection, 34), - PicamParameter_AdcAnalogGain = PI_V(Enumeration, Collection, 35), - PicamParameter_AdcQuality = PI_V(Enumeration, Collection, 36), - PicamParameter_AdcEMGain = PI_V(Integer, Range, 53), - PicamParameter_CorrectPixelBias = PI_V(Boolean, Collection, 106), - /*-------------------------------------------------------------------------------------*/ - /* Hardware I/O -----------------------------------------------------------------------*/ - /*-------------------------------------------------------------------------------------*/ - PicamParameter_TriggerSource = PI_V(Enumeration, Collection, 79), - PicamParameter_TriggerResponse = PI_V(Enumeration, Collection, 30), - PicamParameter_TriggerDetermination = PI_V(Enumeration, Collection, 31), - PicamParameter_TriggerFrequency = PI_V(FloatingPoint, Range, 80), - PicamParameter_TriggerTermination = PI_V(Enumeration, Collection, 81), - PicamParameter_TriggerCoupling = PI_V(Enumeration, Collection, 82), - PicamParameter_TriggerThreshold = PI_V(FloatingPoint, Range, 83), - PicamParameter_OutputSignal = PI_V(Enumeration, Collection, 32), - PicamParameter_InvertOutputSignal = PI_V(Boolean, Collection, 52), - PicamParameter_AuxOutput = PI_V(Pulse, Pulse, 91), - PicamParameter_EnableSyncMaster = PI_V(Boolean, Collection, 84), - PicamParameter_SyncMaster2Delay = PI_V(FloatingPoint, Range, 85), - PicamParameter_EnableModulationOutputSignal = PI_V(Boolean, Collection, 116), - PicamParameter_ModulationOutputSignalFrequency = PI_V(FloatingPoint, Range, 117), - PicamParameter_ModulationOutputSignalAmplitude = PI_V(FloatingPoint, Range, 120), - /*-------------------------------------------------------------------------------------*/ - /* Readout Control --------------------------------------------------------------------*/ - /*-------------------------------------------------------------------------------------*/ - PicamParameter_ReadoutControlMode = PI_V(Enumeration, Collection, 26), - PicamParameter_ReadoutTimeCalculation = PI_V(FloatingPoint, None, 27), - PicamParameter_ReadoutPortCount = PI_V(Integer, Collection, 28), - PicamParameter_ReadoutOrientation = PI_V(Enumeration, None, 54), - PicamParameter_KineticsWindowHeight = PI_V(Integer, Range, 56), - PicamParameter_VerticalShiftRate = PI_V(FloatingPoint, Collection, 13), - PicamParameter_Accumulations = PI_V(LargeInteger, Range, 92), - PicamParameter_EnableNondestructiveReadout = PI_V(Boolean, Collection, 128), - PicamParameter_NondestructiveReadoutPeriod = PI_V(FloatingPoint, Range, 129), - /*-------------------------------------------------------------------------------------*/ - /* Data Acquisition -------------------------------------------------------------------*/ - /*-------------------------------------------------------------------------------------*/ - PicamParameter_Rois = PI_V(Rois, Rois, 37), - PicamParameter_NormalizeOrientation = PI_V(Boolean, Collection, 39), - PicamParameter_DisableDataFormatting = PI_V(Boolean, Collection, 55), - PicamParameter_ReadoutCount = PI_V(LargeInteger, Range, 40), - PicamParameter_ExactReadoutCountMaximum = PI_V(LargeInteger, None, 77), - PicamParameter_PhotonDetectionMode = PI_V(Enumeration, Collection, 125), - PicamParameter_PhotonDetectionThreshold = PI_V(FloatingPoint, Range, 126), - PicamParameter_PixelFormat = PI_V(Enumeration, Collection, 41), - PicamParameter_FrameSize = PI_V(Integer, None, 42), - PicamParameter_FrameStride = PI_V(Integer, None, 43), - PicamParameter_FramesPerReadout = PI_V(Integer, None, 44), - PicamParameter_ReadoutStride = PI_V(Integer, None, 45), - PicamParameter_PixelBitDepth = PI_V(Integer, None, 48), - PicamParameter_ReadoutRateCalculation = PI_V(FloatingPoint, None, 50), - PicamParameter_OnlineReadoutRateCalculation = PI_V(FloatingPoint, None, 99), - PicamParameter_FrameRateCalculation = PI_V(FloatingPoint, None, 51), - PicamParameter_Orientation = PI_V(Enumeration, None, 38), - PicamParameter_TimeStamps = PI_V(Enumeration, Collection, 68), - PicamParameter_TimeStampResolution = PI_V(LargeInteger, Collection, 69), - PicamParameter_TimeStampBitDepth = PI_V(Integer, Collection, 70), - PicamParameter_TrackFrames = PI_V(Boolean, Collection, 71), - PicamParameter_FrameTrackingBitDepth = PI_V(Integer, Collection, 72), - PicamParameter_GateTracking = PI_V(Enumeration, Collection, 104), - PicamParameter_GateTrackingBitDepth = PI_V(Integer, Collection, 105), - PicamParameter_ModulationTracking = PI_V(Enumeration, Collection, 121), - PicamParameter_ModulationTrackingBitDepth = PI_V(Integer, Collection, 122), - /*-------------------------------------------------------------------------------------*/ - /* Sensor Information -----------------------------------------------------------------*/ - /*-------------------------------------------------------------------------------------*/ - PicamParameter_SensorType = PI_V(Enumeration, None, 57), - PicamParameter_CcdCharacteristics = PI_V(Enumeration, None, 58), - PicamParameter_SensorActiveWidth = PI_V(Integer, None, 59), - PicamParameter_SensorActiveHeight = PI_V(Integer, None, 60), - PicamParameter_SensorActiveLeftMargin = PI_V(Integer, None, 61), - PicamParameter_SensorActiveTopMargin = PI_V(Integer, None, 62), - PicamParameter_SensorActiveRightMargin = PI_V(Integer, None, 63), - PicamParameter_SensorActiveBottomMargin = PI_V(Integer, None, 64), - PicamParameter_SensorMaskedHeight = PI_V(Integer, None, 65), - PicamParameter_SensorMaskedTopMargin = PI_V(Integer, None, 66), - PicamParameter_SensorMaskedBottomMargin = PI_V(Integer, None, 67), - PicamParameter_SensorSecondaryMaskedHeight = PI_V(Integer, None, 49), - PicamParameter_SensorSecondaryActiveHeight = PI_V(Integer, None, 74), - PicamParameter_PixelWidth = PI_V(FloatingPoint, None, 9), - PicamParameter_PixelHeight = PI_V(FloatingPoint, None, 10), - PicamParameter_PixelGapWidth = PI_V(FloatingPoint, None, 11), - PicamParameter_PixelGapHeight = PI_V(FloatingPoint, None, 12), - /*-------------------------------------------------------------------------------------*/ - /* Sensor Layout ----------------------------------------------------------------------*/ - /*-------------------------------------------------------------------------------------*/ - PicamParameter_ActiveWidth = PI_V(Integer, Range, 1), - PicamParameter_ActiveHeight = PI_V(Integer, Range, 2), - PicamParameter_ActiveLeftMargin = PI_V(Integer, Range, 3), - PicamParameter_ActiveTopMargin = PI_V(Integer, Range, 4), - PicamParameter_ActiveRightMargin = PI_V(Integer, Range, 5), - PicamParameter_ActiveBottomMargin = PI_V(Integer, Range, 6), - PicamParameter_MaskedHeight = PI_V(Integer, Range, 7), - PicamParameter_MaskedTopMargin = PI_V(Integer, Range, 8), - PicamParameter_MaskedBottomMargin = PI_V(Integer, Range, 73), - PicamParameter_SecondaryMaskedHeight = PI_V(Integer, Range, 75), - PicamParameter_SecondaryActiveHeight = PI_V(Integer, Range, 76), - /*-------------------------------------------------------------------------------------*/ - /* Sensor Cleaning --------------------------------------------------------------------*/ - /*-------------------------------------------------------------------------------------*/ - PicamParameter_CleanSectionFinalHeight = PI_V(Integer, Range, 17), - PicamParameter_CleanSectionFinalHeightCount = PI_V(Integer, Range, 18), - PicamParameter_CleanSerialRegister = PI_V(Boolean, Collection, 19), - PicamParameter_CleanCycleCount = PI_V(Integer, Range, 20), - PicamParameter_CleanCycleHeight = PI_V(Integer, Range, 21), - PicamParameter_CleanBeforeExposure = PI_V(Boolean, Collection, 78), - PicamParameter_CleanUntilTrigger = PI_V(Boolean, Collection, 22), - /*-------------------------------------------------------------------------------------*/ - /* Sensor Temperature -----------------------------------------------------------------*/ - /*-------------------------------------------------------------------------------------*/ - PicamParameter_SensorTemperatureSetPoint = PI_V(FloatingPoint, Range, 14), - PicamParameter_SensorTemperatureReading = PI_V(FloatingPoint, None, 15), - PicamParameter_SensorTemperatureStatus = PI_V(Enumeration, None, 16), - PicamParameter_DisableCoolingFan = PI_V(Boolean, Collection, 29), - PicamParameter_EnableSensorWindowHeater = PI_V(Boolean, Collection, 127) - /*-------------------------------------------------------------------------------------*/ -#undef PI_V -} PicamParameter; /* (130) */ -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Values - Integer -----------------------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetParameterIntegerValue( - PicamHandle camera, - PicamParameter parameter, - piint* value ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_SetParameterIntegerValue( - PicamHandle camera, - PicamParameter parameter, - piint value ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_CanSetParameterIntegerValue( - PicamHandle camera, - PicamParameter parameter, - piint value, - pibln* settable ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Values - Large Integer -----------------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetParameterLargeIntegerValue( - PicamHandle camera, - PicamParameter parameter, - pi64s* value ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_SetParameterLargeIntegerValue( - PicamHandle camera, - PicamParameter parameter, - pi64s value ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_CanSetParameterLargeIntegerValue( - PicamHandle camera, - PicamParameter parameter, - pi64s value, - pibln* settable ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Values - Floating Point ----------------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetParameterFloatingPointValue( - PicamHandle camera, - PicamParameter parameter, - piflt* value ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_SetParameterFloatingPointValue( - PicamHandle camera, - PicamParameter parameter, - piflt value ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_CanSetParameterFloatingPointValue( - PicamHandle camera, - PicamParameter parameter, - piflt value, - pibln* settable ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Values - Regions of Interest -----------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef struct PicamRoi -{ - piint x; - piint width; - piint x_binning; - piint y; - piint height; - piint y_binning; -} PicamRoi; -/*----------------------------------------------------------------------------*/ -typedef struct PicamRois -{ - PicamRoi* roi_array; - piint roi_count; -} PicamRois; -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_DestroyRois( const PicamRois* rois ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetParameterRoisValue( - PicamHandle camera, - PicamParameter parameter, - const PicamRois** value ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_SetParameterRoisValue( - PicamHandle camera, - PicamParameter parameter, - const PicamRois* value ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_CanSetParameterRoisValue( - PicamHandle camera, - PicamParameter parameter, - const PicamRois* value, - pibln* settable ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Values - Pulse -------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef struct PicamPulse -{ - piflt delay; - piflt width; -} PicamPulse; -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_DestroyPulses( const PicamPulse* pulses ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetParameterPulseValue( - PicamHandle camera, - PicamParameter parameter, - const PicamPulse** value ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_SetParameterPulseValue( - PicamHandle camera, - PicamParameter parameter, - const PicamPulse* value ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_CanSetParameterPulseValue( - PicamHandle camera, - PicamParameter parameter, - const PicamPulse* value, - pibln* settable ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Values - Custom Intensifier Modulation Sequence ----------*/ -/*----------------------------------------------------------------------------*/ -typedef struct PicamModulation -{ - piflt duration; - piflt frequency; - piflt phase; - piflt output_signal_frequency; -} PicamModulation; -/*----------------------------------------------------------------------------*/ -typedef struct PicamModulations -{ - PicamModulation* modulation_array; - piint modulation_count; -} PicamModulations; -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_DestroyModulations( const PicamModulations* modulations ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetParameterModulationsValue( - PicamHandle camera, - PicamParameter parameter, - const PicamModulations** value ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_SetParameterModulationsValue( - PicamHandle camera, - PicamParameter parameter, - const PicamModulations* value ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_CanSetParameterModulationsValue( - PicamHandle camera, - PicamParameter parameter, - const PicamModulations* value, - pibln* settable ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Values - Enumerated Types --------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef enum PicamAdcAnalogGain -{ - PicamAdcAnalogGain_Low = 1, - PicamAdcAnalogGain_Medium = 2, - PicamAdcAnalogGain_High = 3 -} PicamAdcAnalogGain; /* (4) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamAdcQuality -{ - PicamAdcQuality_LowNoise = 1, - PicamAdcQuality_HighCapacity = 2, - PicamAdcQuality_HighSpeed = 4, - PicamAdcQuality_ElectronMultiplied = 3 -} PicamAdcQuality; /* (5) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamCcdCharacteristicsMask -{ - PicamCcdCharacteristicsMask_None = 0x000, - PicamCcdCharacteristicsMask_BackIlluminated = 0x001, - PicamCcdCharacteristicsMask_DeepDepleted = 0x002, - PicamCcdCharacteristicsMask_OpenElectrode = 0x004, - PicamCcdCharacteristicsMask_UVEnhanced = 0x008, - PicamCcdCharacteristicsMask_ExcelonEnabled = 0x010, - PicamCcdCharacteristicsMask_SecondaryMask = 0x020, - PicamCcdCharacteristicsMask_Multiport = 0x040, - PicamCcdCharacteristicsMask_AdvancedInvertedMode = 0x080, - PicamCcdCharacteristicsMask_HighResistivity = 0x100 -} PicamCcdCharacteristicsMask; /* (0x200) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamEMIccdGainControlMode -{ - PicamEMIccdGainControlMode_Optimal = 1, - PicamEMIccdGainControlMode_Manual = 2 -} PicamEMIccdGainControlMode; /* (3) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamGateTrackingMask -{ - PicamGateTrackingMask_None = 0x0, - PicamGateTrackingMask_Delay = 0x1, - PicamGateTrackingMask_Width = 0x2 -} PicamGateTrackingMask; /* (0x4) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamGatingMode -{ - PicamGatingMode_Repetitive = 1, - PicamGatingMode_Sequential = 2, - PicamGatingMode_Custom = 3 -} PicamGatingMode; /* (4) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamGatingSpeed -{ - PicamGatingSpeed_Fast = 1, - PicamGatingSpeed_Slow = 2 -} PicamGatingSpeed; /* (3) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamIntensifierOptionsMask -{ - PicamIntensifierOptionsMask_None = 0x0, - PicamIntensifierOptionsMask_McpGating = 0x1, - PicamIntensifierOptionsMask_SubNanosecondGating = 0x2, - PicamIntensifierOptionsMask_Modulation = 0x4 -} PicamIntensifierOptionsMask; /* (0x8) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamIntensifierStatus -{ - PicamIntensifierStatus_PoweredOff = 1, - PicamIntensifierStatus_PoweredOn = 2 -} PicamIntensifierStatus; /* (3) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamModulationTrackingMask -{ - PicamModulationTrackingMask_None = 0x0, - PicamModulationTrackingMask_Duration = 0x1, - PicamModulationTrackingMask_Frequency = 0x2, - PicamModulationTrackingMask_Phase = 0x4, - PicamModulationTrackingMask_OutputSignalFrequency = 0x8 -} PicamModulationTrackingMask; /* (0x10) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamOrientationMask -{ - PicamOrientationMask_Normal = 0x0, - PicamOrientationMask_FlippedHorizontally = 0x1, - PicamOrientationMask_FlippedVertically = 0x2 -} PicamOrientationMask; /* (0x4) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamOutputSignal -{ - PicamOutputSignal_NotReadingOut = 1, - PicamOutputSignal_ShutterOpen = 2, - PicamOutputSignal_Busy = 3, - PicamOutputSignal_AlwaysLow = 4, - PicamOutputSignal_AlwaysHigh = 5, - PicamOutputSignal_Acquiring = 6, - PicamOutputSignal_ShiftingUnderMask = 7, - PicamOutputSignal_Exposing = 8, - PicamOutputSignal_EffectivelyExposing = 9, - PicamOutputSignal_ReadingOut = 10, - PicamOutputSignal_WaitingForTrigger = 11 -} PicamOutputSignal; /* (12) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamPhosphorType -{ - PicamPhosphorType_P43 = 1, - PicamPhosphorType_P46 = 2 -} PicamPhosphorType; /* (3) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamPhotocathodeSensitivity -{ - PicamPhotocathodeSensitivity_RedBlue = 1, - PicamPhotocathodeSensitivity_SuperRed = 7, - PicamPhotocathodeSensitivity_SuperBlue = 2, - PicamPhotocathodeSensitivity_UV = 3, - PicamPhotocathodeSensitivity_SolarBlind = 10, - PicamPhotocathodeSensitivity_Unigen2Filmless = 4, - PicamPhotocathodeSensitivity_InGaAsFilmless = 9, - PicamPhotocathodeSensitivity_HighQEFilmless = 5, - PicamPhotocathodeSensitivity_HighRedFilmless = 8, - PicamPhotocathodeSensitivity_HighBlueFilmless = 6 -} PicamPhotocathodeSensitivity; /* (11) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamPhotonDetectionMode -{ - PicamPhotonDetectionMode_Disabled = 1, - PicamPhotonDetectionMode_Thresholding = 2, - PicamPhotonDetectionMode_Clipping = 3 -} PicamPhotonDetectionMode; /* (4) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamPixelFormat -{ - PicamPixelFormat_Monochrome16Bit = 1 -} PicamPixelFormat; /* (2) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamReadoutControlMode -{ - PicamReadoutControlMode_FullFrame = 1, - PicamReadoutControlMode_FrameTransfer = 2, - PicamReadoutControlMode_Interline = 5, - PicamReadoutControlMode_Kinetics = 3, - PicamReadoutControlMode_SpectraKinetics = 4, - PicamReadoutControlMode_Dif = 6 -} PicamReadoutControlMode; /* (7) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamSensorTemperatureStatus -{ - PicamSensorTemperatureStatus_Unlocked = 1, - PicamSensorTemperatureStatus_Locked = 2 -} PicamSensorTemperatureStatus; /* (3) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamSensorType -{ - PicamSensorType_Ccd = 1, - PicamSensorType_InGaAs = 2 -} PicamSensorType; /* (3) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamShutterTimingMode -{ - PicamShutterTimingMode_Normal = 1, - PicamShutterTimingMode_AlwaysClosed = 2, - PicamShutterTimingMode_AlwaysOpen = 3, - PicamShutterTimingMode_OpenBeforeTrigger = 4 -} PicamShutterTimingMode; /* (5) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamTimeStampsMask -{ - PicamTimeStampsMask_None = 0x0, - PicamTimeStampsMask_ExposureStarted = 0x1, - PicamTimeStampsMask_ExposureEnded = 0x2 -} PicamTimeStampsMask; /* (0x4) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamTriggerCoupling -{ - PicamTriggerCoupling_AC = 1, - PicamTriggerCoupling_DC = 2 -} PicamTriggerCoupling; /* (3) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamTriggerDetermination -{ - PicamTriggerDetermination_PositivePolarity = 1, - PicamTriggerDetermination_NegativePolarity = 2, - PicamTriggerDetermination_RisingEdge = 3, - PicamTriggerDetermination_FallingEdge = 4 -} PicamTriggerDetermination; /* (5) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamTriggerResponse -{ - PicamTriggerResponse_NoResponse = 1, - PicamTriggerResponse_ReadoutPerTrigger = 2, - PicamTriggerResponse_ShiftPerTrigger = 3, - PicamTriggerResponse_ExposeDuringTriggerPulse = 4, - PicamTriggerResponse_StartOnSingleTrigger = 5 -} PicamTriggerResponse; /* (6) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamTriggerSource -{ - PicamTriggerSource_External = 1, - PicamTriggerSource_Internal = 2 -} PicamTriggerSource; /* (3) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamTriggerTermination -{ - PicamTriggerTermination_FiftyOhms = 1, - PicamTriggerTermination_HighImpedance = 2 -} PicamTriggerTermination; /* (3) */ -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Values - Default -----------------------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetParameterIntegerDefaultValue( - PicamHandle camera, - PicamParameter parameter, - piint* value ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetParameterLargeIntegerDefaultValue( - PicamHandle camera, - PicamParameter parameter, - pi64s* value ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetParameterFloatingPointDefaultValue( - PicamHandle camera, - PicamParameter parameter, - piflt* value ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetParameterRoisDefaultValue( - PicamHandle camera, - PicamParameter parameter, - const PicamRois** value ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetParameterPulseDefaultValue( - PicamHandle camera, - PicamParameter parameter, - const PicamPulse** value ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetParameterModulationsDefaultValue( - PicamHandle camera, - PicamParameter parameter, - const PicamModulations** value ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Values - Online ------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_CanSetParameterOnline( - PicamHandle camera, - PicamParameter parameter, - pibln* onlineable ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_SetParameterIntegerValueOnline( - PicamHandle camera, - PicamParameter parameter, - piint value ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_SetParameterFloatingPointValueOnline( - PicamHandle camera, - PicamParameter parameter, - piflt value ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_SetParameterPulseValueOnline( - PicamHandle camera, - PicamParameter parameter, - const PicamPulse* value ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Values - Reading -----------------------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_CanReadParameter( - PicamHandle camera, - PicamParameter parameter, - pibln* readable ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_ReadParameterIntegerValue( - PicamHandle camera, - PicamParameter parameter, - piint* value ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_ReadParameterFloatingPointValue( - PicamHandle camera, - PicamParameter parameter, - piflt* value ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Information - Available Parameters -----------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_DestroyParameters( const PicamParameter* parameter_array ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetParameters( - PicamHandle camera, - const PicamParameter** parameter_array, - piint* parameter_count ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_DoesParameterExist( - PicamHandle camera, - PicamParameter parameter, - pibln* exists ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Information - Relevance ----------------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_IsParameterRelevant( - PicamHandle camera, - PicamParameter parameter, - pibln* relevant ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Information - Value Type ---------------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetParameterValueType( - PicamHandle camera, - PicamParameter parameter, - PicamValueType* type ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetParameterEnumeratedType( - PicamHandle camera, - PicamParameter parameter, - PicamEnumeratedType* type ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Information - Value Access -------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef enum PicamValueAccess -{ - PicamValueAccess_ReadOnly = 1, - PicamValueAccess_ReadWriteTrivial = 3, - PicamValueAccess_ReadWrite = 2 -} PicamValueAccess; /* (4) */ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetParameterValueAccess( - PicamHandle camera, - PicamParameter parameter, - PicamValueAccess* access ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Constraints - Constraint Type ----------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetParameterConstraintType( - PicamHandle camera, - PicamParameter parameter, - PicamConstraintType* type ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Constraints - Enumerated Types ---------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef enum PicamConstraintScope -{ - PicamConstraintScope_Independent = 1, - PicamConstraintScope_Dependent = 2 -} PicamConstraintScope; /* (3) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamConstraintSeverity -{ - PicamConstraintSeverity_Error = 1, - PicamConstraintSeverity_Warning = 2 -} PicamConstraintSeverity; /* (3) */ -/*----------------------------------------------------------------------------*/ -typedef enum PicamConstraintCategory -{ - PicamConstraintCategory_Capable = 1, - PicamConstraintCategory_Required = 2, - PicamConstraintCategory_Recommended = 3 -} PicamConstraintCategory; /* (4) */ -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Constraints - Collection ---------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef struct PicamCollectionConstraint -{ - PicamConstraintScope scope; - PicamConstraintSeverity severity; - const piflt* values_array; - piint values_count; -} PicamCollectionConstraint; -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_DestroyCollectionConstraints( - const PicamCollectionConstraint* constraint_array ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetParameterCollectionConstraint( - PicamHandle camera, - PicamParameter parameter, - PicamConstraintCategory category, - const PicamCollectionConstraint** constraint ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Constraints - Range --------------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef struct PicamRangeConstraint -{ - PicamConstraintScope scope; - PicamConstraintSeverity severity; - pibln empty_set; - piflt minimum; - piflt maximum; - piflt increment; - const piflt* excluded_values_array; - piint excluded_values_count; - const piflt* outlying_values_array; - piint outlying_values_count; -} PicamRangeConstraint; -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_DestroyRangeConstraints( - const PicamRangeConstraint* constraint_array ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetParameterRangeConstraint( - PicamHandle camera, - PicamParameter parameter, - PicamConstraintCategory category, - const PicamRangeConstraint** constraint ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Constraints - Regions Of Interest ------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef enum PicamRoisConstraintRulesMask -{ - PicamRoisConstraintRulesMask_None = 0x00, - PicamRoisConstraintRulesMask_XBinningAlignment = 0x01, - PicamRoisConstraintRulesMask_YBinningAlignment = 0x02, - PicamRoisConstraintRulesMask_HorizontalSymmetry = 0x04, - PicamRoisConstraintRulesMask_VerticalSymmetry = 0x08, - PicamRoisConstraintRulesMask_SymmetryBoundsBinning = 0x10 -} PicamRoisConstraintRulesMask; /* (0x20) */ -/*----------------------------------------------------------------------------*/ -typedef struct PicamRoisConstraint -{ - PicamConstraintScope scope; - PicamConstraintSeverity severity; - pibln empty_set; - PicamRoisConstraintRulesMask rules; - piint maximum_roi_count; - PicamRangeConstraint x_constraint; - PicamRangeConstraint width_constraint; - const piint* x_binning_limits_array; - piint x_binning_limits_count; - PicamRangeConstraint y_constraint; - PicamRangeConstraint height_constraint; - const piint* y_binning_limits_array; - piint y_binning_limits_count; -} PicamRoisConstraint; -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_DestroyRoisConstraints( - const PicamRoisConstraint* constraint_array ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetParameterRoisConstraint( - PicamHandle camera, - PicamParameter parameter, - PicamConstraintCategory category, - const PicamRoisConstraint** constraint ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Constraints - Pulse --------------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef struct PicamPulseConstraint -{ - PicamConstraintScope scope; - PicamConstraintSeverity severity; - pibln empty_set; - PicamRangeConstraint delay_constraint; - PicamRangeConstraint width_constraint; - piflt minimum_duration; - piflt maximum_duration; -} PicamPulseConstraint; -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_DestroyPulseConstraints( - const PicamPulseConstraint* constraint_array ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetParameterPulseConstraint( - PicamHandle camera, - PicamParameter parameter, - PicamConstraintCategory category, - const PicamPulseConstraint** constraint ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Constraints - Custom Intensifier Modulation Sequence -----*/ -/*----------------------------------------------------------------------------*/ -typedef struct PicamModulationsConstraint -{ - PicamConstraintScope scope; - PicamConstraintSeverity severity; - pibln empty_set; - piint maximum_modulation_count; - PicamRangeConstraint duration_constraint; - PicamRangeConstraint frequency_constraint; - PicamRangeConstraint phase_constraint; - PicamRangeConstraint output_signal_frequency_constraint; -} PicamModulationsConstraint; -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_DestroyModulationsConstraints( - const PicamModulationsConstraint* constraint_array ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_GetParameterModulationsConstraint( - PicamHandle camera, - PicamParameter parameter, - PicamConstraintCategory category, - const PicamModulationsConstraint** constraint ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -/* Parameter Commitment ------------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_AreParametersCommitted( - PicamHandle camera, - pibln* committed ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_CommitParameters( - PicamHandle camera, - const PicamParameter** failed_parameter_array, - piint* failed_parameter_count ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ - -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/* Camera Data Acquisition */ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ - -/*----------------------------------------------------------------------------*/ -/* Acquisition Control -------------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef struct PicamAvailableData -{ - void* initial_readout; - pi64s readout_count; -} PicamAvailableData; -/*----------------------------------------------------------------------------*/ -typedef enum PicamAcquisitionErrorsMask -{ - PicamAcquisitionErrorsMask_None = 0x0, - PicamAcquisitionErrorsMask_DataLost = 0x1, - PicamAcquisitionErrorsMask_ConnectionLost = 0x2 -} PicamAcquisitionErrorsMask; /* (0x4) */ -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_Acquire( - PicamHandle camera, - pi64s readout_count, - piint readout_time_out, - PicamAvailableData* available, - PicamAcquisitionErrorsMask* errors ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_StartAcquisition( PicamHandle camera ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_StopAcquisition( PicamHandle camera ); -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_IsAcquisitionRunning( - PicamHandle camera, - pibln* running ); -/*----------------------------------------------------------------------------*/ -typedef struct PicamAcquisitionStatus -{ - pibln running; - PicamAcquisitionErrorsMask errors; - piflt readout_rate; -} PicamAcquisitionStatus; -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_WaitForAcquisitionUpdate( - PicamHandle camera, - piint readout_time_out, - PicamAvailableData* available, - PicamAcquisitionStatus* status ); -/*----------------------------------------------------------------------------*/ - -/******************************************************************************/ -/* C++ Epilogue */ -/******************************************************************************/ -#if defined __cplusplus && !defined PICAM_EXPORTS - } /* end extern "C" */ -#endif - -#endif +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/* picam.h - Teledyne Princeton Instruments Camera Control API */ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +#if !defined PICAM_H +#define PICAM_H + +#include "pil_platform.h" + +/******************************************************************************/ +/* C++ Prologue */ +/******************************************************************************/ +#if defined __cplusplus && !defined PICAM_EXPORTS + extern "C" + { +#endif + +/******************************************************************************/ +/* Function Declarations */ +/******************************************************************************/ +#if defined PICAM_EXPORTS +# define PICAM_FUNCTION PIL_EXPORT_DEF +#else +# define PICAM_FUNCTION PIL_IMPORT +#endif +#define PICAM_API PICAM_FUNCTION PicamError PIL_CALL + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/* General Library Usage - Error Codes, Version, Initialization and Strings */ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ + +/*----------------------------------------------------------------------------*/ +/* Function Return Error Codes -----------------------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef enum PicamError +{ + /*------------------------------------------------------------------------*/ + /* Success ---------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamError_None = 0, + /*------------------------------------------------------------------------*/ + /* General Errors --------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamError_UnexpectedError = 4, + PicamError_UnexpectedNullPointer = 3, + PicamError_InvalidPointer = 35, + PicamError_InvalidCount = 39, + PicamError_EnumerationValueNotDefined = 17, + PicamError_InvalidOperation = 42, + PicamError_OperationCanceled = 43, + /*------------------------------------------------------------------------*/ + /* Library Initialization Errors -----------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamError_LibraryNotInitialized = 1, + PicamError_LibraryAlreadyInitialized = 5, + /*------------------------------------------------------------------------*/ + /* General String Handling Errors ----------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamError_InvalidEnumeratedType = 16, + /*------------------------------------------------------------------------*/ + /* Camera/Accessory Plug 'n Play Discovery Errors ------------------------*/ + /*------------------------------------------------------------------------*/ + PicamError_NotDiscoveringCameras = 18, + PicamError_AlreadyDiscoveringCameras = 19, + PicamError_NotDiscoveringAccessories = 48, + PicamError_AlreadyDiscoveringAccessories = 49, + /*------------------------------------------------------------------------*/ + /* Camera/Accessory Access Errors ----------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamError_NoCamerasAvailable = 34, + PicamError_CameraAlreadyOpened = 7, + PicamError_InvalidCameraID = 8, + PicamError_NoAccessoriesAvailable = 45, + PicamError_AccessoryAlreadyOpened = 46, + PicamError_InvalidAccessoryID = 47, + PicamError_InvalidHandle = 9, + PicamError_DeviceCommunicationFailed = 15, + PicamError_DeviceDisconnected = 23, + PicamError_DeviceOpenElsewhere = 24, + /*------------------------------------------------------------------------*/ + /* Demo Camera Errors ----------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamError_InvalidDemoModel = 6, + PicamError_InvalidDemoSerialNumber = 21, + PicamError_DemoAlreadyConnected = 22, + PicamError_DemoNotSupported = 40, + /*------------------------------------------------------------------------*/ + /* Camera/Accessory Parameter Access Errors ------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamError_ParameterHasInvalidValueType = 11, + PicamError_ParameterHasInvalidConstraintType = 13, + PicamError_ParameterDoesNotExist = 12, + PicamError_ParameterValueIsReadOnly = 10, + PicamError_InvalidParameterValue = 2, + PicamError_InvalidConstraintCategory = 38, + PicamError_ParameterValueIsIrrelevant = 14, + PicamError_ParameterIsNotOnlineable = 25, + PicamError_ParameterIsNotReadable = 26, + PicamError_ParameterIsNotWaitableStatus = 50, + PicamError_InvalidWaitableStatusParameterTimeOut = 51, + /*------------------------------------------------------------------------*/ + /* Camera Data Acquisition Errors ----------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamError_InvalidParameterValues = 28, + PicamError_ParametersNotCommitted = 29, + PicamError_InvalidAcquisitionBuffer = 30, + PicamError_InvalidReadoutCount = 36, + PicamError_InvalidReadoutTimeOut = 37, + PicamError_InsufficientMemory = 31, + PicamError_AcquisitionInProgress = 20, + PicamError_AcquisitionNotInProgress = 27, + PicamError_TimeOutOccurred = 32, + PicamError_AcquisitionUpdatedHandlerRegistered = 33, + PicamError_InvalidAcquisitionState = 44, + PicamError_NondestructiveReadoutEnabled = 41, + PicamError_ShutterOverheated = 52, + PicamError_CenterWavelengthFaulted = 54, + PicamError_CameraFaulted = 53 + /*------------------------------------------------------------------------*/ +} PicamError; /* (55) */ +/*----------------------------------------------------------------------------*/ +/* Library Version -----------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetVersion( + piint* major, + piint* minor, + piint* distribution, + piint* released ); +/*----------------------------------------------------------------------------*/ +/* Library Initialization ----------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_IsLibraryInitialized( pibln* inited ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_InitializeLibrary( void ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_UninitializeLibrary( void ); +/*----------------------------------------------------------------------------*/ +/* General String Handling ---------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_DestroyString( const pichar* s ); +/*----------------------------------------------------------------------------*/ +typedef enum PicamEnumeratedType +{ + /*------------------------------------------------------------------------*/ + /* Function Return Error Codes -------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamEnumeratedType_Error = 1, + /*------------------------------------------------------------------------*/ + /* General String Handling -----------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamEnumeratedType_EnumeratedType = 29, + /*------------------------------------------------------------------------*/ + /* Camera/Accessory Identification ---------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamEnumeratedType_Model = 2, + PicamEnumeratedType_ComputerInterface = 3, + /*------------------------------------------------------------------------*/ + /* Camera/Accessory Plug 'n Play Discovery -------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamEnumeratedType_DiscoveryAction = 26, + /*------------------------------------------------------------------------*/ + /* Camera/Accessory Access -----------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamEnumeratedType_HandleType = 27, + /*------------------------------------------------------------------------*/ + /* Camera/Accessory Parameters -------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamEnumeratedType_ValueType = 4, + PicamEnumeratedType_ConstraintType = 5, + PicamEnumeratedType_Parameter = 6, + /*------------------------------------------------------------------------*/ + /* Camera/Accessory Parameter Values - Enumerated Types ------------------*/ + /*------------------------------------------------------------------------*/ + PicamEnumeratedType_ActiveShutter = 53, + PicamEnumeratedType_AdcAnalogGain = 7, + PicamEnumeratedType_AdcQuality = 8, + PicamEnumeratedType_CcdCharacteristicsMask = 9, + PicamEnumeratedType_CenterWavelengthStatus = 51, + PicamEnumeratedType_CoolingFanStatus = 56, + PicamEnumeratedType_EMIccdGainControlMode = 42, + PicamEnumeratedType_GateTrackingMask = 36, + PicamEnumeratedType_GatingMode = 34, + PicamEnumeratedType_GatingSpeed = 38, + PicamEnumeratedType_GratingCoating = 48, + PicamEnumeratedType_GratingType = 49, + PicamEnumeratedType_IntensifierOptionsMask = 35, + PicamEnumeratedType_IntensifierStatus = 33, + PicamEnumeratedType_LaserOutputMode = 45, + PicamEnumeratedType_LaserStatus = 54, + PicamEnumeratedType_LightSource = 46, + PicamEnumeratedType_LightSourceStatus = 47, + PicamEnumeratedType_ModulationTrackingMask = 41, + PicamEnumeratedType_OrientationMask = 10, + PicamEnumeratedType_OutputSignal = 11, + PicamEnumeratedType_PhosphorType = 39, + PicamEnumeratedType_PhotocathodeSensitivity = 40, + PicamEnumeratedType_PhotonDetectionMode = 43, + PicamEnumeratedType_PixelFormat = 12, + PicamEnumeratedType_ReadoutControlMode = 13, + PicamEnumeratedType_SensorTemperatureStatus = 14, + PicamEnumeratedType_SensorType = 15, + PicamEnumeratedType_ShutterStatus = 52, + PicamEnumeratedType_ShutterTimingMode = 16, + PicamEnumeratedType_ShutterType = 50, + PicamEnumeratedType_TimeStampsMask = 17, + PicamEnumeratedType_TriggerCoupling = 30, + PicamEnumeratedType_TriggerDetermination = 18, + PicamEnumeratedType_TriggerResponse = 19, + PicamEnumeratedType_TriggerSource = 31, + PicamEnumeratedType_TriggerStatus = 55, + PicamEnumeratedType_TriggerTermination = 32, + PicamEnumeratedType_VacuumStatus = 57, + /*------------------------------------------------------------------------*/ + /* Camera/Accessory Parameter Information - Value Access -----------------*/ + /*------------------------------------------------------------------------*/ + PicamEnumeratedType_ValueAccess = 20, + /*------------------------------------------------------------------------*/ + /* Camera/Accessory Parameter Information - Dynamics ---------------------*/ + /*------------------------------------------------------------------------*/ + PicamEnumeratedType_DynamicsMask = 28, + /*------------------------------------------------------------------------*/ + /* Camera/Accessory Parameter Constraints - Enumerated Types -------------*/ + /*------------------------------------------------------------------------*/ + PicamEnumeratedType_ConstraintScope = 21, + PicamEnumeratedType_ConstraintSeverity = 22, + PicamEnumeratedType_ConstraintCategory = 23, + /*------------------------------------------------------------------------*/ + /* Camera Parameter Constraints - Regions of Interest --------------------*/ + /*------------------------------------------------------------------------*/ + PicamEnumeratedType_RoisConstraintRulesMask = 24, + /*------------------------------------------------------------------------*/ + /* Camera Acquisition Control --------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamEnumeratedType_AcquisitionErrorsMask = 25, + /*------------------------------------------------------------------------*/ + /* Camera Acquisition Notification ---------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamEnumeratedType_AcquisitionState = 37, + PicamEnumeratedType_AcquisitionStateErrorsMask = 44 + /*------------------------------------------------------------------------*/ +} PicamEnumeratedType; /* (58) */ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetEnumerationString( + PicamEnumeratedType type, + piint value, + const pichar** s ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/* Camera Identification, Access, Information and Demo */ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ + +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Identification -------------------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef enum PicamModel +{ + /*------------------------------------------------------------------------*/ + /* PI-MTE Series (1419) --------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_PIMteSeries = 1400, + /* PI-MTE 1024 Series ----------------------------------------------------*/ + PicamModel_PIMte1024Series = 1401, + PicamModel_PIMte1024F = 1402, + PicamModel_PIMte1024B = 1403, + PicamModel_PIMte1024BR = 1405, + PicamModel_PIMte1024BUV = 1404, + /* PI-MTE 1024FT Series --------------------------------------------------*/ + PicamModel_PIMte1024FTSeries = 1406, + PicamModel_PIMte1024FT = 1407, + PicamModel_PIMte1024BFT = 1408, + /* PI-MTE 1300 Series ----------------------------------------------------*/ + PicamModel_PIMte1300Series = 1412, + PicamModel_PIMte1300B = 1413, + PicamModel_PIMte1300R = 1414, + PicamModel_PIMte1300BR = 1415, + /* PI-MTE 2048 Series ----------------------------------------------------*/ + PicamModel_PIMte2048Series = 1416, + PicamModel_PIMte2048B = 1417, + PicamModel_PIMte2048BR = 1418, + /* PI-MTE 2K Series ------------------------------------------------------*/ + PicamModel_PIMte2KSeries = 1409, + PicamModel_PIMte2KB = 1410, + PicamModel_PIMte2KBUV = 1411, + /*------------------------------------------------------------------------*/ + /* PI-MTE3 Series (2006) -------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_PIMte3Series = 2000, + /* PI-MTE3 2048 Series ---------------------------------------------------*/ + PicamModel_PIMte32048Series = 2001, + PicamModel_PIMte32048B = 2002, + /* PI-MTE3 4096 Series ---------------------------------------------------*/ + PicamModel_PIMte34096Series = 2003, + PicamModel_PIMte34096B = 2004, + PicamModel_PIMte34096B_2 = 2005, + /*------------------------------------------------------------------------*/ + /* PIXIS Series (76) -----------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_PixisSeries = 0, + /* PIXIS 100 Series ------------------------------------------------------*/ + PicamModel_Pixis100Series = 1, + PicamModel_Pixis100F = 2, + PicamModel_Pixis100B = 6, + PicamModel_Pixis100R = 3, + PicamModel_Pixis100C = 4, + PicamModel_Pixis100BR = 5, + PicamModel_Pixis100BExcelon = 54, + PicamModel_Pixis100BRExcelon = 55, + PicamModel_PixisXO100B = 7, + PicamModel_PixisXO100BR = 8, + PicamModel_PixisXB100B = 68, + PicamModel_PixisXB100BR = 69, + /* PIXIS 256 Series ------------------------------------------------------*/ + PicamModel_Pixis256Series = 26, + PicamModel_Pixis256F = 27, + PicamModel_Pixis256B = 29, + PicamModel_Pixis256E = 28, + PicamModel_Pixis256BR = 30, + PicamModel_PixisXB256BR = 31, + /* PIXIS 400 Series ------------------------------------------------------*/ + PicamModel_Pixis400Series = 37, + PicamModel_Pixis400F = 38, + PicamModel_Pixis400B = 40, + PicamModel_Pixis400R = 39, + PicamModel_Pixis400BR = 41, + PicamModel_Pixis400BExcelon = 56, + PicamModel_Pixis400BRExcelon = 57, + PicamModel_PixisXO400B = 42, + PicamModel_PixisXB400BR = 70, + /* PIXIS 512 Series ------------------------------------------------------*/ + PicamModel_Pixis512Series = 43, + PicamModel_Pixis512F = 44, + PicamModel_Pixis512B = 45, + PicamModel_Pixis512BUV = 46, + PicamModel_Pixis512BExcelon = 58, + PicamModel_PixisXO512F = 49, + PicamModel_PixisXO512B = 50, + PicamModel_PixisXF512F = 48, + PicamModel_PixisXF512B = 47, + /* PIXIS 1024 Series -----------------------------------------------------*/ + PicamModel_Pixis1024Series = 9, + PicamModel_Pixis1024F = 10, + PicamModel_Pixis1024B = 11, + PicamModel_Pixis1024BR = 13, + PicamModel_Pixis1024BUV = 12, + PicamModel_Pixis1024BExcelon = 59, + PicamModel_Pixis1024BRExcelon = 60, + PicamModel_PixisXO1024F = 16, + PicamModel_PixisXO1024B = 14, + PicamModel_PixisXO1024BR = 15, + PicamModel_PixisXF1024F = 17, + PicamModel_PixisXF1024B = 18, + PicamModel_PixisXB1024BR = 71, + /* PIXIS 1300 Series -----------------------------------------------------*/ + PicamModel_Pixis1300Series = 51, + PicamModel_Pixis1300F = 52, + PicamModel_Pixis1300F_2 = 75, + PicamModel_Pixis1300B = 53, + PicamModel_Pixis1300BR = 73, + PicamModel_Pixis1300BExcelon = 61, + PicamModel_Pixis1300BRExcelon = 62, + PicamModel_PixisXO1300B = 65, + PicamModel_PixisXF1300B = 66, + PicamModel_PixisXB1300R = 72, + /* PIXIS 2048 Series -----------------------------------------------------*/ + PicamModel_Pixis2048Series = 20, + PicamModel_Pixis2048F = 21, + PicamModel_Pixis2048B = 22, + PicamModel_Pixis2048BR = 67, + PicamModel_Pixis2048BExcelon = 63, + PicamModel_Pixis2048BRExcelon = 74, + PicamModel_PixisXO2048B = 23, + PicamModel_PixisXF2048F = 25, + PicamModel_PixisXF2048B = 24, + /* PIXIS 2K Series -------------------------------------------------------*/ + PicamModel_Pixis2KSeries = 32, + PicamModel_Pixis2KF = 33, + PicamModel_Pixis2KB = 34, + PicamModel_Pixis2KBUV = 36, + PicamModel_Pixis2KBExcelon = 64, + PicamModel_PixisXO2KB = 35, + /*------------------------------------------------------------------------*/ + /* Quad-RO Series (104) --------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_QuadroSeries = 100, + PicamModel_Quadro4096 = 101, + PicamModel_Quadro4096_2 = 103, + PicamModel_Quadro4320 = 102, + /*------------------------------------------------------------------------*/ + /* ProEM Series (214) ----------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_ProEMSeries = 200, + /* ProEM 512 Series ------------------------------------------------------*/ + PicamModel_ProEM512Series = 203, + PicamModel_ProEM512B = 201, + PicamModel_ProEM512BK = 205, + PicamModel_ProEM512BExcelon = 204, + PicamModel_ProEM512BKExcelon = 206, + /* ProEM 1024 Series -----------------------------------------------------*/ + PicamModel_ProEM1024Series = 207, + PicamModel_ProEM1024B = 202, + PicamModel_ProEM1024BExcelon = 208, + /* ProEM 1600 Series -----------------------------------------------------*/ + PicamModel_ProEM1600Series = 209, + PicamModel_ProEM1600xx2B = 212, + PicamModel_ProEM1600xx2BExcelon = 210, + PicamModel_ProEM1600xx4B = 213, + PicamModel_ProEM1600xx4BExcelon = 211, + /*------------------------------------------------------------------------*/ + /* ProEM+ Series (614) ---------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_ProEMPlusSeries = 600, + /* ProEM+ 512 Series -----------------------------------------------------*/ + PicamModel_ProEMPlus512Series = 603, + PicamModel_ProEMPlus512B = 601, + PicamModel_ProEMPlus512BK = 605, + PicamModel_ProEMPlus512BExcelon = 604, + PicamModel_ProEMPlus512BKExcelon = 606, + /* ProEM+ 1024 Series ----------------------------------------------------*/ + PicamModel_ProEMPlus1024Series = 607, + PicamModel_ProEMPlus1024B = 602, + PicamModel_ProEMPlus1024BExcelon = 608, + /* ProEM+ 1600 Series ----------------------------------------------------*/ + PicamModel_ProEMPlus1600Series = 609, + PicamModel_ProEMPlus1600xx2B = 612, + PicamModel_ProEMPlus1600xx2BExcelon = 610, + PicamModel_ProEMPlus1600xx4B = 613, + PicamModel_ProEMPlus1600xx4BExcelon = 611, + /*------------------------------------------------------------------------*/ + /* ProEM-HS Series (1218) ------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_ProEMHSSeries = 1200, + /* ProEM-HS 512 Series ---------------------------------------------------*/ + PicamModel_ProEMHS512Series = 1201, + PicamModel_ProEMHS512B = 1202, + PicamModel_ProEMHS512BK = 1207, + PicamModel_ProEMHS512BExcelon = 1203, + PicamModel_ProEMHS512BKExcelon = 1208, + PicamModel_ProEMHS512B_2 = 1216, + PicamModel_ProEMHS512BExcelon_2 = 1217, + /* ProEM-HS 1024 Series --------------------------------------------------*/ + PicamModel_ProEMHS1024Series = 1204, + PicamModel_ProEMHS1024B = 1205, + PicamModel_ProEMHS1024BExcelon = 1206, + PicamModel_ProEMHS1024B_2 = 1212, + PicamModel_ProEMHS1024BExcelon_2 = 1213, + PicamModel_ProEMHS1024B_3 = 1214, + PicamModel_ProEMHS1024BExcelon_3 = 1215, + /* ProEM-HS 1K-10 Series -------------------------------------------------*/ + PicamModel_ProEMHS1K10Series = 1209, + PicamModel_ProEMHS1KB10 = 1210, + PicamModel_ProEMHS1KB10Excelon = 1211, + /*------------------------------------------------------------------------*/ + /* PI-MAX3 Series (303) --------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_PIMax3Series = 300, + PicamModel_PIMax31024I = 301, + PicamModel_PIMax31024x256 = 302, + /*------------------------------------------------------------------------*/ + /* PI-MAX4 Series (721) --------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_PIMax4Series = 700, + /* PI-MAX4 1024i Series --------------------------------------------------*/ + PicamModel_PIMax41024ISeries = 703, + PicamModel_PIMax41024I = 701, + PicamModel_PIMax41024IRF = 704, + /* PI-MAX4 1024f Series --------------------------------------------------*/ + PicamModel_PIMax41024FSeries = 710, + PicamModel_PIMax41024F = 711, + PicamModel_PIMax41024FRF = 712, + /* PI-MAX4 1024x256 Series -----------------------------------------------*/ + PicamModel_PIMax41024x256Series = 705, + PicamModel_PIMax41024x256 = 702, + PicamModel_PIMax41024x256RF = 706, + /* PI-MAX4 2048 Series ---------------------------------------------------*/ + PicamModel_PIMax42048Series = 716, + PicamModel_PIMax42048F = 717, + PicamModel_PIMax42048B = 718, + PicamModel_PIMax42048FRF = 719, + PicamModel_PIMax42048BRF = 720, + /* PI-MAX4 512EM Series --------------------------------------------------*/ + PicamModel_PIMax4512EMSeries = 708, + PicamModel_PIMax4512EM = 707, + PicamModel_PIMax4512BEM = 709, + /* PI-MAX4 1024EM Series -------------------------------------------------*/ + PicamModel_PIMax41024EMSeries = 713, + PicamModel_PIMax41024EM = 715, + PicamModel_PIMax41024BEM = 714, + /*------------------------------------------------------------------------*/ + /* PyLoN Series (439) ----------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_PylonSeries = 400, + /* PyLoN 100 Series ------------------------------------------------------*/ + PicamModel_Pylon100Series = 418, + PicamModel_Pylon100F = 404, + PicamModel_Pylon100B = 401, + PicamModel_Pylon100BR = 407, + PicamModel_Pylon100BExcelon = 425, + PicamModel_Pylon100BRExcelon = 426, + /* PyLoN 256 Series ------------------------------------------------------*/ + PicamModel_Pylon256Series = 419, + PicamModel_Pylon256F = 409, + PicamModel_Pylon256B = 410, + PicamModel_Pylon256E = 411, + PicamModel_Pylon256BR = 412, + /* PyLoN 400 Series ------------------------------------------------------*/ + PicamModel_Pylon400Series = 420, + PicamModel_Pylon400F = 405, + PicamModel_Pylon400B = 402, + PicamModel_Pylon400BR = 408, + PicamModel_Pylon400BExcelon = 427, + PicamModel_Pylon400BRExcelon = 428, + /* PyLoN 1024 Series -----------------------------------------------------*/ + PicamModel_Pylon1024Series = 421, + PicamModel_Pylon1024B = 417, + PicamModel_Pylon1024BExcelon = 429, + /* PyLoN 1300 Series -----------------------------------------------------*/ + PicamModel_Pylon1300Series = 422, + PicamModel_Pylon1300F = 406, + PicamModel_Pylon1300B = 403, + PicamModel_Pylon1300R = 438, + PicamModel_Pylon1300BR = 432, + PicamModel_Pylon1300BExcelon = 430, + PicamModel_Pylon1300BRExcelon = 433, + /* PyLoN 2048 Series -----------------------------------------------------*/ + PicamModel_Pylon2048Series = 423, + PicamModel_Pylon2048F = 415, + PicamModel_Pylon2048B = 434, + PicamModel_Pylon2048BR = 416, + PicamModel_Pylon2048BExcelon = 435, + PicamModel_Pylon2048BRExcelon = 436, + /* PyLoN 2K Series -------------------------------------------------------*/ + PicamModel_Pylon2KSeries = 424, + PicamModel_Pylon2KF = 413, + PicamModel_Pylon2KB = 414, + PicamModel_Pylon2KBUV = 437, + PicamModel_Pylon2KBExcelon = 431, + /*------------------------------------------------------------------------*/ + /* PyLoN-IR Series (904) -------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_PylonirSeries = 900, + /* PyLoN-IR 1024 Series --------------------------------------------------*/ + PicamModel_Pylonir1024Series = 901, + PicamModel_Pylonir102422 = 902, + PicamModel_Pylonir102417 = 903, + /*------------------------------------------------------------------------*/ + /* PIoNIR Series (502) ---------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_PionirSeries = 500, + PicamModel_Pionir640 = 501, + /*------------------------------------------------------------------------*/ + /* NIRvana Series (802) --------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_NirvanaSeries = 800, + PicamModel_Nirvana640 = 801, + /*------------------------------------------------------------------------*/ + /* NIRvana ST Series (1302) ----------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_NirvanaSTSeries = 1300, + PicamModel_NirvanaST640 = 1301, + /*------------------------------------------------------------------------*/ + /* NIRvana-LN Series (1102) ----------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_NirvanaLNSeries = 1100, + PicamModel_NirvanaLN640 = 1101, + /*------------------------------------------------------------------------*/ + /* NIRvana HS Series (2202) ----------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_NirvanaHSSeries = 2200, + PicamModel_NirvanaHS = 2201, + /*------------------------------------------------------------------------*/ + /* SOPHIA Series (1845) --------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_SophiaSeries = 1800, + /* SOPHIA 2048 Series ----------------------------------------------------*/ + PicamModel_Sophia2048Series = 1801, + PicamModel_Sophia2048B = 1802, + PicamModel_Sophia2048BExcelon = 1803, + PicamModel_SophiaXO2048B = 1804, + PicamModel_SophiaXF2048B = 1805, + PicamModel_SophiaXB2048B = 1806, + /* SOPHIA 2048-13.5 Series -----------------------------------------------*/ + PicamModel_Sophia2048135Series = 1807, + PicamModel_Sophia2048135 = 1808, + PicamModel_Sophia2048B135 = 1809, + PicamModel_Sophia2048BR135 = 1810, + PicamModel_Sophia2048BUV135 = 1844, + PicamModel_Sophia2048B135Excelon = 1811, + PicamModel_Sophia2048BR135Excelon = 1812, + PicamModel_SophiaXO2048B135 = 1813, + PicamModel_SophiaXO2048BR135 = 1814, + PicamModel_Sophia2048B135Excelon_2 = 1840, + /* SOPHIA 4096 Series ----------------------------------------------------*/ + PicamModel_Sophia4096Series = 1826, + PicamModel_Sophia4096B = 1827, + PicamModel_SophiaXO4096B = 1829, + PicamModel_SophiaXF4096B = 1830, + PicamModel_SophiaXB4096B = 1831, + PicamModel_Sophia4096B_2 = 1841, + /* SOPHIA 4096-HDR Series ------------------------------------------------*/ + PicamModel_Sophia4096HdrSeries = 1832, + PicamModel_Sophia4096BHdr = 1833, + PicamModel_Sophia4096BRHdr = 1834, + PicamModel_SophiaXO4096BHdr = 1837, + PicamModel_SophiaXO4096BRHdr = 1838, + PicamModel_SophiaXF4096BHdr = 1839, + PicamModel_SophiaXF4096BRHdr = 1828, + PicamModel_SophiaXB4096BHdr = 1835, + PicamModel_SophiaXB4096BRHdr = 1836, + PicamModel_Sophia4096BHdr_2 = 1842, + PicamModel_Sophia4096BRHdr_2 = 1843, + /*------------------------------------------------------------------------*/ + /* BLAZE Series (1519) ---------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_BlazeSeries = 1500, + /* BLAZE 100 Series ------------------------------------------------------*/ + PicamModel_Blaze100Series = 1507, + PicamModel_Blaze100B = 1501, + PicamModel_Blaze100BR = 1505, + PicamModel_Blaze100HR = 1503, + PicamModel_Blaze100BRLD = 1509, + PicamModel_Blaze100BExcelon = 1511, + PicamModel_Blaze100BRExcelon = 1513, + PicamModel_Blaze100HRExcelon = 1515, + PicamModel_Blaze100BRLDExcelon = 1517, + /* BLAZE 400 Series ------------------------------------------------------*/ + PicamModel_Blaze400Series = 1508, + PicamModel_Blaze400B = 1502, + PicamModel_Blaze400BR = 1506, + PicamModel_Blaze400HR = 1504, + PicamModel_Blaze400BRLD = 1510, + PicamModel_Blaze400BExcelon = 1512, + PicamModel_Blaze400BRExcelon = 1514, + PicamModel_Blaze400HRExcelon = 1516, + PicamModel_Blaze400BRLDExcelon = 1518, + /*------------------------------------------------------------------------*/ + /* FERGIE Series (1612) --------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_FergieSeries = 1600, + /* FERGIE 256 Series -----------------------------------------------------*/ + PicamModel_Fergie256Series = 1601, + PicamModel_Fergie256B = 1602, + PicamModel_Fergie256BR = 1607, + PicamModel_Fergie256BExcelon = 1603, + PicamModel_Fergie256BRExcelon = 1608, + /* FERGIE 256FT Series ---------------------------------------------------*/ + PicamModel_Fergie256FTSeries = 1604, + PicamModel_Fergie256FFT = 1609, + PicamModel_Fergie256BFT = 1605, + PicamModel_Fergie256BRFT = 1610, + PicamModel_Fergie256BFTExcelon = 1606, + PicamModel_Fergie256BRFTExcelon = 1611, + /*------------------------------------------------------------------------*/ + /* FERGIE-ISO-81 Series (2104) -------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_FergieIso81Series = 2100, + /* FERGIE-ISO-81 256FT Series --------------------------------------------*/ + PicamModel_FergieIso81256FTSeries = 2101, + PicamModel_FergieIso81256BFTExcelon = 2102, + PicamModel_FergieIso81256BRFTExcelon = 2103, + /*------------------------------------------------------------------------*/ + /* FERGIE Accessory Series (1707) ----------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_FergieAccessorySeries = 1700, + /* FERGIE Lamp Series ----------------------------------------------------*/ + PicamModel_FergieLampSeries = 1701, + PicamModel_FergieAEL = 1702, + PicamModel_FergieQTH = 1703, + /* FERGIE Laser Series ---------------------------------------------------*/ + PicamModel_FergieLaserSeries = 1704, + PicamModel_FergieLaser785 = 1705, + PicamModel_FergieLaser532 = 1706, + /*------------------------------------------------------------------------*/ + /* KURO Series (1904) ----------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_KuroSeries = 1900, + PicamModel_Kuro1200B = 1901, + PicamModel_Kuro1608B = 1902, + PicamModel_Kuro2048B = 1903, + /*------------------------------------------------------------------------*/ + /* IntelliCal Accessory Series (2603) ------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_IntellicalAccessorySeries = 2600, + /* IntelliCal Lamp Series ------------------------------------------------*/ + PicamModel_IntellicalLampSeries = 2601, + PicamModel_IntellicalSwirQTH = 2602, + /*------------------------------------------------------------------------*/ + /* TPIR Series (2304) ----------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_TpirSeries = 2300, + /* TPIR-785 Series -------------------------------------------------------*/ + PicamModel_Tpir785Series = 2301, + PicamModel_Tpir785100 = 2302, + PicamModel_Tpir785400 = 2303, + /*------------------------------------------------------------------------*/ + /* TPIR HR Series (2404) -------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamModel_TpirHRSeries = 2400, + /* TPIR-785 HR Series ----------------------------------------------------*/ + PicamModel_Tpir785HRSeries = 2401, + PicamModel_Tpir785HR100 = 2402, + PicamModel_Tpir785HR400 = 2403 + /*------------------------------------------------------------------------*/ +} PicamModel; +/*----------------------------------------------------------------------------*/ +typedef enum PicamComputerInterface +{ + PicamComputerInterface_Usb2 = 1, + PicamComputerInterface_1394A = 2, + PicamComputerInterface_GigabitEthernet = 3, + PicamComputerInterface_Usb3 = 4 +} PicamComputerInterface; /* (5) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamStringSize +{ + PicamStringSize_SensorName = 64, + PicamStringSize_SerialNumber = 64, + PicamStringSize_FirmwareName = 64, + PicamStringSize_FirmwareDetail = 256 +} PicamStringSize; +/*----------------------------------------------------------------------------*/ +typedef struct PicamCameraID +{ + PicamModel model; + PicamComputerInterface computer_interface; + pichar sensor_name[PicamStringSize_SensorName]; + pichar serial_number[PicamStringSize_SerialNumber]; +} PicamCameraID; +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_DestroyCameraIDs( const PicamCameraID* id_array ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetAvailableCameraIDs( + const PicamCameraID** id_array, + piint* id_count ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetUnavailableCameraIDs( + const PicamCameraID** id_array, + piint* id_count ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_IsCameraIDConnected( + const PicamCameraID* id, + pibln* connected ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_IsCameraIDOpenElsewhere( + const PicamCameraID* id, + pibln* open_elsewhere ); +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Access ---------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef void* PicamHandle; +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_DestroyHandles( const PicamHandle* handle_array ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_OpenFirstCamera( PicamHandle* camera ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_OpenCamera( + const PicamCameraID* id, + PicamHandle* camera ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_CloseCamera( PicamHandle camera ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetOpenCameras( + const PicamHandle** camera_array, + piint* camera_count ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_IsCameraConnected( + PicamHandle camera, + pibln* connected ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_IsCameraFaulted( + PicamHandle camera, + pibln* faulted ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetCameraID( + PicamHandle camera, + PicamCameraID* id ); +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Information - Firmware -----------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef struct PicamFirmwareDetail +{ + pichar name[PicamStringSize_FirmwareName]; + pichar detail[PicamStringSize_FirmwareDetail]; +} PicamFirmwareDetail; +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_DestroyFirmwareDetails( + const PicamFirmwareDetail* firmware_array ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetFirmwareDetails( + const PicamCameraID* id, + const PicamFirmwareDetail** firmware_array, + piint* firmware_count ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Information - Calibration --------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef struct PicamCalibrationPoint +{ + piflt x; + piflt y; +} PicamCalibrationPoint; +/*----------------------------------------------------------------------------*/ +typedef struct PicamCalibration +{ + const PicamCalibrationPoint* point_array; + piint point_count; +} PicamCalibration; +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_DestroyCalibrations( + const PicamCalibration* calibration_array ); +/*----------------------------------------------------------------------------*/ +/* Demo Camera ---------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_DestroyModels( const PicamModel* model_array ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetAvailableDemoCameraModels( + const PicamModel** model_array, + piint* model_count ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_ConnectDemoCamera( + PicamModel model, + const pichar* serial_number, + PicamCameraID* id ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_DisconnectDemoCamera( const PicamCameraID* id ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_IsDemoCamera( + const PicamCameraID* id, + pibln* demo ); +/*----------------------------------------------------------------------------*/ + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/* Camera/Acccessory Parameter Values, Information, Constraints and Commitment*/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ + +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameters -----------------------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef enum PicamValueType +{ + /*------------------------------------------------------------------------*/ + /* Integral Types --------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamValueType_Integer = 1, + PicamValueType_Boolean = 3, + PicamValueType_Enumeration = 4, + /*------------------------------------------------------------------------*/ + /* Large Integral Type ---------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamValueType_LargeInteger = 6, + /*------------------------------------------------------------------------*/ + /* Floating Point Type ---------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamValueType_FloatingPoint = 2, + /*------------------------------------------------------------------------*/ + /* Regions of Interest Type ----------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamValueType_Rois = 5, + /*------------------------------------------------------------------------*/ + /* Pulse Type ------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + PicamValueType_Pulse = 7, + /*------------------------------------------------------------------------*/ + /* Custom Intensifier Modulation Sequence Type ---------------------------*/ + /*------------------------------------------------------------------------*/ + PicamValueType_Modulations = 8 + /*------------------------------------------------------------------------*/ +} PicamValueType; /* (9) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamConstraintType +{ + PicamConstraintType_None = 1, + PicamConstraintType_Range = 2, + PicamConstraintType_Collection = 3, + PicamConstraintType_Rois = 4, + PicamConstraintType_Pulse = 5, + PicamConstraintType_Modulations = 6 +} PicamConstraintType; /* (7) */ +/*-----------------------------------------------------------------------------------------*/ +typedef enum PicamParameter +{ +#define PI_V(v,c,n) (((PicamConstraintType_##c)<<24)+((PicamValueType_##v)<<16)+(n)) + /***************************************************************************************/ + /* Camera Parameters *******************************************************************/ + /***************************************************************************************/ + /*-------------------------------------------------------------------------------------*/ + /* Shutter Timing ---------------------------------------------------------------------*/ + /*-------------------------------------------------------------------------------------*/ + PicamParameter_ExposureTime = PI_V(FloatingPoint, Range, 23), + PicamParameter_ShutterTimingMode = PI_V(Enumeration, Collection, 24), + PicamParameter_ShutterOpeningDelay = PI_V(FloatingPoint, Range, 46), + PicamParameter_ShutterClosingDelay = PI_V(FloatingPoint, Range, 25), + PicamParameter_ShutterDelayResolution = PI_V(FloatingPoint, Collection, 47), + PicamParameter_InternalShutterType = PI_V(Enumeration, None, 139), + PicamParameter_InternalShutterStatus = PI_V(Enumeration, None, 153), + PicamParameter_ExternalShutterType = PI_V(Enumeration, None, 152), + PicamParameter_ExternalShutterStatus = PI_V(Enumeration, None, 154), + PicamParameter_ActiveShutter = PI_V(Enumeration, Collection, 155), + PicamParameter_InactiveShutterTimingModeResult = PI_V(Enumeration, None, 156), + /*-------------------------------------------------------------------------------------*/ + /* Gating -----------------------------------------------------------------------------*/ + /*-------------------------------------------------------------------------------------*/ + PicamParameter_GatingMode = PI_V(Enumeration, Collection, 93), + PicamParameter_RepetitiveGate = PI_V(Pulse, Pulse, 94), + PicamParameter_SequentialStartingGate = PI_V(Pulse, Pulse, 95), + PicamParameter_SequentialEndingGate = PI_V(Pulse, Pulse, 96), + PicamParameter_SequentialGateStepCount = PI_V(LargeInteger, Range, 97), + PicamParameter_SequentialGateStepIterations = PI_V(LargeInteger, Range, 98), + PicamParameter_DifStartingGate = PI_V(Pulse, Pulse, 102), + PicamParameter_DifEndingGate = PI_V(Pulse, Pulse, 103), + /*-------------------------------------------------------------------------------------*/ + /* Intensifier ------------------------------------------------------------------------*/ + /*-------------------------------------------------------------------------------------*/ + PicamParameter_EnableIntensifier = PI_V(Boolean, Collection, 86), + PicamParameter_IntensifierStatus = PI_V(Enumeration, None, 87), + PicamParameter_IntensifierGain = PI_V(Integer, Range, 88), + PicamParameter_EMIccdGainControlMode = PI_V(Enumeration, Collection, 123), + PicamParameter_EMIccdGain = PI_V(Integer, Range, 124), + PicamParameter_PhosphorDecayDelay = PI_V(FloatingPoint, Range, 89), + PicamParameter_PhosphorDecayDelayResolution = PI_V(FloatingPoint, Collection, 90), + PicamParameter_BracketGating = PI_V(Boolean, Collection, 100), + PicamParameter_IntensifierOptions = PI_V(Enumeration, None, 101), + PicamParameter_EnableModulation = PI_V(Boolean, Collection, 111), + PicamParameter_ModulationDuration = PI_V(FloatingPoint, Range, 118), + PicamParameter_ModulationFrequency = PI_V(FloatingPoint, Range, 112), + PicamParameter_RepetitiveModulationPhase = PI_V(FloatingPoint, Range, 113), + PicamParameter_SequentialStartingModulationPhase = PI_V(FloatingPoint, Range, 114), + PicamParameter_SequentialEndingModulationPhase = PI_V(FloatingPoint, Range, 115), + PicamParameter_CustomModulationSequence = PI_V(Modulations, Modulations, 119), + PicamParameter_PhotocathodeSensitivity = PI_V(Enumeration, None, 107), + PicamParameter_GatingSpeed = PI_V(Enumeration, None, 108), + PicamParameter_PhosphorType = PI_V(Enumeration, None, 109), + PicamParameter_IntensifierDiameter = PI_V(FloatingPoint, None, 110), + /*-------------------------------------------------------------------------------------*/ + /* Analog to Digital Conversion -------------------------------------------------------*/ + /*-------------------------------------------------------------------------------------*/ + PicamParameter_AdcSpeed = PI_V(FloatingPoint, Collection, 33), + PicamParameter_AdcBitDepth = PI_V(Integer, Collection, 34), + PicamParameter_AdcAnalogGain = PI_V(Enumeration, Collection, 35), + PicamParameter_AdcQuality = PI_V(Enumeration, Collection, 36), + PicamParameter_AdcEMGain = PI_V(Integer, Range, 53), + PicamParameter_CorrectPixelBias = PI_V(Boolean, Collection, 106), + /*-------------------------------------------------------------------------------------*/ + /* Hardware I/O -----------------------------------------------------------------------*/ + /*-------------------------------------------------------------------------------------*/ + PicamParameter_TriggerSource = PI_V(Enumeration, Collection, 79), + PicamParameter_TriggerResponse = PI_V(Enumeration, Collection, 30), + PicamParameter_TriggerDetermination = PI_V(Enumeration, Collection, 31), + PicamParameter_TriggerFrequency = PI_V(FloatingPoint, Range, 80), + PicamParameter_TriggerTermination = PI_V(Enumeration, Collection, 81), + PicamParameter_TriggerCoupling = PI_V(Enumeration, Collection, 82), + PicamParameter_TriggerThreshold = PI_V(FloatingPoint, Range, 83), + PicamParameter_TriggerDelay = PI_V(FloatingPoint, Range, 164), + PicamParameter_OutputSignal = PI_V(Enumeration, Collection, 32), + PicamParameter_InvertOutputSignal = PI_V(Boolean, Collection, 52), + PicamParameter_OutputSignal2 = PI_V(Enumeration, Collection, 150), + PicamParameter_InvertOutputSignal2 = PI_V(Boolean, Collection, 151), + PicamParameter_EnableAuxOutput = PI_V(Boolean, Collection, 161), + PicamParameter_AuxOutput = PI_V(Pulse, Pulse, 91), + PicamParameter_EnableSyncMaster = PI_V(Boolean, Collection, 84), + PicamParameter_SyncMaster2Delay = PI_V(FloatingPoint, Range, 85), + PicamParameter_EnableModulationOutputSignal = PI_V(Boolean, Collection, 116), + PicamParameter_ModulationOutputSignalFrequency = PI_V(FloatingPoint, Range, 117), + PicamParameter_ModulationOutputSignalAmplitude = PI_V(FloatingPoint, Range, 120), + PicamParameter_AnticipateTrigger = PI_V(Boolean, Collection, 131), + PicamParameter_DelayFromPreTrigger = PI_V(FloatingPoint, Range, 132), + /*-------------------------------------------------------------------------------------*/ + /* Readout Control --------------------------------------------------------------------*/ + /*-------------------------------------------------------------------------------------*/ + PicamParameter_ReadoutControlMode = PI_V(Enumeration, Collection, 26), + PicamParameter_ReadoutTimeCalculation = PI_V(FloatingPoint, None, 27), + PicamParameter_ReadoutPortCount = PI_V(Integer, Collection, 28), + PicamParameter_ReadoutOrientation = PI_V(Enumeration, None, 54), + PicamParameter_KineticsWindowHeight = PI_V(Integer, Range, 56), + PicamParameter_SeNsRWindowHeight = PI_V(Integer, Range, 163), + PicamParameter_VerticalShiftRate = PI_V(FloatingPoint, Collection, 13), + PicamParameter_Accumulations = PI_V(LargeInteger, Range, 92), + PicamParameter_EnableNondestructiveReadout = PI_V(Boolean, Collection, 128), + PicamParameter_NondestructiveReadoutPeriod = PI_V(FloatingPoint, Range, 129), + /*-------------------------------------------------------------------------------------*/ + /* Data Acquisition -------------------------------------------------------------------*/ + /*-------------------------------------------------------------------------------------*/ + PicamParameter_Rois = PI_V(Rois, Rois, 37), + PicamParameter_NormalizeOrientation = PI_V(Boolean, Collection, 39), + PicamParameter_DisableDataFormatting = PI_V(Boolean, Collection, 55), + PicamParameter_ReadoutCount = PI_V(LargeInteger, Range, 40), + PicamParameter_ExactReadoutCountMaximum = PI_V(LargeInteger, None, 77), + PicamParameter_PhotonDetectionMode = PI_V(Enumeration, Collection, 125), + PicamParameter_PhotonDetectionThreshold = PI_V(FloatingPoint, Range, 126), + PicamParameter_PixelFormat = PI_V(Enumeration, Collection, 41), + PicamParameter_FrameSize = PI_V(Integer, None, 42), + PicamParameter_FrameStride = PI_V(Integer, None, 43), + PicamParameter_FramesPerReadout = PI_V(Integer, None, 44), + PicamParameter_ReadoutStride = PI_V(Integer, None, 45), + PicamParameter_PixelBitDepth = PI_V(Integer, None, 48), + PicamParameter_ReadoutRateCalculation = PI_V(FloatingPoint, None, 50), + PicamParameter_OnlineReadoutRateCalculation = PI_V(FloatingPoint, None, 99), + PicamParameter_FrameRateCalculation = PI_V(FloatingPoint, None, 51), + PicamParameter_Orientation = PI_V(Enumeration, None, 38), + PicamParameter_TimeStamps = PI_V(Enumeration, Collection, 68), + PicamParameter_TimeStampResolution = PI_V(LargeInteger, Collection, 69), + PicamParameter_TimeStampBitDepth = PI_V(Integer, Collection, 70), + PicamParameter_TrackFrames = PI_V(Boolean, Collection, 71), + PicamParameter_FrameTrackingBitDepth = PI_V(Integer, Collection, 72), + PicamParameter_GateTracking = PI_V(Enumeration, Collection, 104), + PicamParameter_GateTrackingBitDepth = PI_V(Integer, Collection, 105), + PicamParameter_ModulationTracking = PI_V(Enumeration, Collection, 121), + PicamParameter_ModulationTrackingBitDepth = PI_V(Integer, Collection, 122), + /*-------------------------------------------------------------------------------------*/ + /* Sensor Information -----------------------------------------------------------------*/ + /*-------------------------------------------------------------------------------------*/ + PicamParameter_SensorType = PI_V(Enumeration, None, 57), + PicamParameter_CcdCharacteristics = PI_V(Enumeration, None, 58), + PicamParameter_SensorActiveWidth = PI_V(Integer, None, 59), + PicamParameter_SensorActiveHeight = PI_V(Integer, None, 60), + PicamParameter_SensorActiveExtendedHeight = PI_V(Integer, None, 159), + PicamParameter_SensorActiveLeftMargin = PI_V(Integer, None, 61), + PicamParameter_SensorActiveTopMargin = PI_V(Integer, None, 62), + PicamParameter_SensorActiveRightMargin = PI_V(Integer, None, 63), + PicamParameter_SensorActiveBottomMargin = PI_V(Integer, None, 64), + PicamParameter_SensorMaskedHeight = PI_V(Integer, None, 65), + PicamParameter_SensorMaskedTopMargin = PI_V(Integer, None, 66), + PicamParameter_SensorMaskedBottomMargin = PI_V(Integer, None, 67), + PicamParameter_SensorSecondaryMaskedHeight = PI_V(Integer, None, 49), + PicamParameter_SensorSecondaryActiveHeight = PI_V(Integer, None, 74), + PicamParameter_PixelWidth = PI_V(FloatingPoint, None, 9), + PicamParameter_PixelHeight = PI_V(FloatingPoint, None, 10), + PicamParameter_PixelGapWidth = PI_V(FloatingPoint, None, 11), + PicamParameter_PixelGapHeight = PI_V(FloatingPoint, None, 12), + PicamParameter_ApplicableStarDefectMapID = PI_V(Integer, None, 166), + /*-------------------------------------------------------------------------------------*/ + /* Sensor Layout ----------------------------------------------------------------------*/ + /*-------------------------------------------------------------------------------------*/ + PicamParameter_ActiveWidth = PI_V(Integer, Range, 1), + PicamParameter_ActiveHeight = PI_V(Integer, Range, 2), + PicamParameter_ActiveExtendedHeight = PI_V(Integer, Range, 160), + PicamParameter_ActiveLeftMargin = PI_V(Integer, Range, 3), + PicamParameter_ActiveTopMargin = PI_V(Integer, Range, 4), + PicamParameter_ActiveRightMargin = PI_V(Integer, Range, 5), + PicamParameter_ActiveBottomMargin = PI_V(Integer, Range, 6), + PicamParameter_MaskedHeight = PI_V(Integer, Range, 7), + PicamParameter_MaskedTopMargin = PI_V(Integer, Range, 8), + PicamParameter_MaskedBottomMargin = PI_V(Integer, Range, 73), + PicamParameter_SecondaryMaskedHeight = PI_V(Integer, Range, 75), + PicamParameter_SecondaryActiveHeight = PI_V(Integer, Range, 76), + /*-------------------------------------------------------------------------------------*/ + /* Sensor Cleaning --------------------------------------------------------------------*/ + /*-------------------------------------------------------------------------------------*/ + PicamParameter_CleanSectionFinalHeight = PI_V(Integer, Range, 17), + PicamParameter_CleanSectionFinalHeightCount = PI_V(Integer, Range, 18), + PicamParameter_CleanSerialRegister = PI_V(Boolean, Collection, 19), + PicamParameter_CleanCycleCount = PI_V(Integer, Range, 20), + PicamParameter_CleanCycleHeight = PI_V(Integer, Range, 21), + PicamParameter_CleanBeforeExposure = PI_V(Boolean, Collection, 78), + PicamParameter_CleanUntilTrigger = PI_V(Boolean, Collection, 22), + PicamParameter_StopCleaningOnPreTrigger = PI_V(Boolean, Collection, 130), + /*-------------------------------------------------------------------------------------*/ + /* Sensor Temperature -----------------------------------------------------------------*/ + /*-------------------------------------------------------------------------------------*/ + PicamParameter_SensorTemperatureSetPoint = PI_V(FloatingPoint, Range, 14), + PicamParameter_SensorTemperatureReading = PI_V(FloatingPoint, None, 15), + PicamParameter_SensorTemperatureStatus = PI_V(Enumeration, None, 16), + PicamParameter_DisableCoolingFan = PI_V(Boolean, Collection, 29), + PicamParameter_CoolingFanStatus = PI_V(Enumeration, None, 162), + PicamParameter_EnableSensorWindowHeater = PI_V(Boolean, Collection, 127), + PicamParameter_VacuumStatus = PI_V(Enumeration, None, 165), + /*-------------------------------------------------------------------------------------*/ + /* Spectrograph -----------------------------------------------------------------------*/ + /*-------------------------------------------------------------------------------------*/ + PicamParameter_CenterWavelengthSetPoint = PI_V(FloatingPoint, Range, 140), + PicamParameter_CenterWavelengthReading = PI_V(FloatingPoint, None, 141), + PicamParameter_CenterWavelengthStatus = PI_V(Enumeration, None, 149), + PicamParameter_GratingType = PI_V(Enumeration, None, 142), + PicamParameter_GratingCoating = PI_V(Enumeration, None, 143), + PicamParameter_GratingGrooveDensity = PI_V(FloatingPoint, None, 144), + PicamParameter_GratingBlazingWavelength = PI_V(FloatingPoint, None, 145), + PicamParameter_FocalLength = PI_V(FloatingPoint, None, 146), + PicamParameter_InclusionAngle = PI_V(FloatingPoint, None, 147), + PicamParameter_SensorAngle = PI_V(FloatingPoint, None, 148), + /***************************************************************************************/ + /* Camera/Accessory Parameters *********************************************************/ + /***************************************************************************************/ + /*-------------------------------------------------------------------------------------*/ + /* Laser ------------------------------------------------------------------------------*/ + /*-------------------------------------------------------------------------------------*/ + PicamParameter_LaserOutputMode = PI_V(Enumeration, Collection, 137), + PicamParameter_LaserPower = PI_V(FloatingPoint, Range, 138), + PicamParameter_LaserWavelength = PI_V(FloatingPoint, None, 167), + PicamParameter_LaserStatus = PI_V(Enumeration, None, 157), + PicamParameter_InputTriggerStatus = PI_V(Enumeration, None, 158), + /***************************************************************************************/ + /* Accessory Parameters ****************************************************************/ + /***************************************************************************************/ + /*-------------------------------------------------------------------------------------*/ + /* Lamp -------------------------------------------------------------------------------*/ + /*-------------------------------------------------------------------------------------*/ + PicamParameter_LightSource = PI_V(Enumeration, Collection, 133), + PicamParameter_LightSourceStatus = PI_V(Enumeration, None, 134), + PicamParameter_Age = PI_V(FloatingPoint, None, 135), + PicamParameter_LifeExpectancy = PI_V(FloatingPoint, None, 136) + /*-------------------------------------------------------------------------------------*/ +#undef PI_V +} PicamParameter; /* (168) */ +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Values - Integer -------------------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetParameterIntegerValue( + PicamHandle camera_or_accessory, + PicamParameter parameter, + piint* value ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_SetParameterIntegerValue( + PicamHandle camera_or_accessory, + PicamParameter parameter, + piint value ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_CanSetParameterIntegerValue( + PicamHandle camera_or_accessory, + PicamParameter parameter, + piint value, + pibln* settable ); +/*----------------------------------------------------------------------------*/ +/* Camera Parameter Values - Large Integer -----------------------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetParameterLargeIntegerValue( + PicamHandle camera, + PicamParameter parameter, + pi64s* value ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_SetParameterLargeIntegerValue( + PicamHandle camera, + PicamParameter parameter, + pi64s value ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_CanSetParameterLargeIntegerValue( + PicamHandle camera, + PicamParameter parameter, + pi64s value, + pibln* settable ); +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Values - Floating Point ------------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetParameterFloatingPointValue( + PicamHandle camera_or_accessory, + PicamParameter parameter, + piflt* value ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_SetParameterFloatingPointValue( + PicamHandle camera_or_accessory, + PicamParameter parameter, + piflt value ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_CanSetParameterFloatingPointValue( + PicamHandle camera_or_accessory, + PicamParameter parameter, + piflt value, + pibln* settable ); +/*----------------------------------------------------------------------------*/ +/* Camera Parameter Values - Regions of Interest -----------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef struct PicamRoi +{ + piint x; + piint width; + piint x_binning; + piint y; + piint height; + piint y_binning; +} PicamRoi; +/*----------------------------------------------------------------------------*/ +typedef struct PicamRois +{ + PicamRoi* roi_array; + piint roi_count; +} PicamRois; +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_DestroyRois( const PicamRois* rois ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetParameterRoisValue( + PicamHandle camera, + PicamParameter parameter, + const PicamRois** value ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_SetParameterRoisValue( + PicamHandle camera, + PicamParameter parameter, + const PicamRois* value ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_CanSetParameterRoisValue( + PicamHandle camera, + PicamParameter parameter, + const PicamRois* value, + pibln* settable ); +/*----------------------------------------------------------------------------*/ +/* Camera Parameter Values - Pulse -------------------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef struct PicamPulse +{ + piflt delay; + piflt width; +} PicamPulse; +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_DestroyPulses( const PicamPulse* pulses ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetParameterPulseValue( + PicamHandle camera, + PicamParameter parameter, + const PicamPulse** value ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_SetParameterPulseValue( + PicamHandle camera, + PicamParameter parameter, + const PicamPulse* value ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_CanSetParameterPulseValue( + PicamHandle camera, + PicamParameter parameter, + const PicamPulse* value, + pibln* settable ); +/*----------------------------------------------------------------------------*/ +/* Camera Parameter Values - Custom Intensifier Modulation Sequence ----------*/ +/*----------------------------------------------------------------------------*/ +typedef struct PicamModulation +{ + piflt duration; + piflt frequency; + piflt phase; + piflt output_signal_frequency; +} PicamModulation; +/*----------------------------------------------------------------------------*/ +typedef struct PicamModulations +{ + PicamModulation* modulation_array; + piint modulation_count; +} PicamModulations; +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_DestroyModulations( const PicamModulations* modulations ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetParameterModulationsValue( + PicamHandle camera, + PicamParameter parameter, + const PicamModulations** value ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_SetParameterModulationsValue( + PicamHandle camera, + PicamParameter parameter, + const PicamModulations* value ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_CanSetParameterModulationsValue( + PicamHandle camera, + PicamParameter parameter, + const PicamModulations* value, + pibln* settable ); +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Values - Enumerated Types ----------------------*/ +/*----------------------------------------------------------------------------*/ +typedef enum PicamActiveShutter +{ + PicamActiveShutter_None = 1, + PicamActiveShutter_Internal = 2, + PicamActiveShutter_External = 3 +} PicamActiveShutter; /* (4) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamAdcAnalogGain +{ + PicamAdcAnalogGain_Low = 1, + PicamAdcAnalogGain_Medium = 2, + PicamAdcAnalogGain_High = 3 +} PicamAdcAnalogGain; /* (4) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamAdcQuality +{ + PicamAdcQuality_LowNoise = 1, + PicamAdcQuality_HighCapacity = 2, + PicamAdcQuality_HighSpeed = 4, + PicamAdcQuality_ElectronMultiplied = 3 +} PicamAdcQuality; /* (5) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamCcdCharacteristicsMask +{ + PicamCcdCharacteristicsMask_None = 0x000, + PicamCcdCharacteristicsMask_BackIlluminated = 0x001, + PicamCcdCharacteristicsMask_DeepDepleted = 0x002, + PicamCcdCharacteristicsMask_OpenElectrode = 0x004, + PicamCcdCharacteristicsMask_UVEnhanced = 0x008, + PicamCcdCharacteristicsMask_ExcelonEnabled = 0x010, + PicamCcdCharacteristicsMask_SecondaryMask = 0x020, + PicamCcdCharacteristicsMask_Multiport = 0x040, + PicamCcdCharacteristicsMask_AdvancedInvertedMode = 0x080, + PicamCcdCharacteristicsMask_HighResistivity = 0x100 +} PicamCcdCharacteristicsMask; /* (0x200) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamCenterWavelengthStatus +{ + PicamCenterWavelengthStatus_Moving = 1, + PicamCenterWavelengthStatus_Stationary = 2, + PicamCenterWavelengthStatus_Faulted = 3 +} PicamCenterWavelengthStatus; /* (4) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamCoolingFanStatus +{ + PicamCoolingFanStatus_Off = 1, + PicamCoolingFanStatus_On = 2, + PicamCoolingFanStatus_ForcedOn = 3 +} PicamCoolingFanStatus; /* (4) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamEMIccdGainControlMode +{ + PicamEMIccdGainControlMode_Optimal = 1, + PicamEMIccdGainControlMode_Manual = 2 +} PicamEMIccdGainControlMode; /* (3) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamGateTrackingMask +{ + PicamGateTrackingMask_None = 0x0, + PicamGateTrackingMask_Delay = 0x1, + PicamGateTrackingMask_Width = 0x2 +} PicamGateTrackingMask; /* (0x4) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamGatingMode +{ + PicamGatingMode_Disabled = 4, + PicamGatingMode_Repetitive = 1, + PicamGatingMode_Sequential = 2, + PicamGatingMode_Custom = 3 +} PicamGatingMode; /* (5) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamGatingSpeed +{ + PicamGatingSpeed_Fast = 1, + PicamGatingSpeed_Slow = 2 +} PicamGatingSpeed; /* (3) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamGratingCoating +{ + PicamGratingCoating_Al = 1, + PicamGratingCoating_AlMgF2 = 4, + PicamGratingCoating_Ag = 2, + PicamGratingCoating_Au = 3 +} PicamGratingCoating; /* (5) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamGratingType +{ + PicamGratingType_Ruled = 1, + PicamGratingType_HolographicVisible = 2, + PicamGratingType_HolographicNir = 3, + PicamGratingType_HolographicUV = 4, + PicamGratingType_Mirror = 5 +} PicamGratingType; /* (6) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamIntensifierOptionsMask +{ + PicamIntensifierOptionsMask_None = 0x0, + PicamIntensifierOptionsMask_McpGating = 0x1, + PicamIntensifierOptionsMask_SubNanosecondGating = 0x2, + PicamIntensifierOptionsMask_Modulation = 0x4 +} PicamIntensifierOptionsMask; /* (0x8) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamIntensifierStatus +{ + PicamIntensifierStatus_PoweredOff = 1, + PicamIntensifierStatus_PoweredOn = 2 +} PicamIntensifierStatus; /* (3) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamLaserOutputMode +{ + PicamLaserOutputMode_Disabled = 1, + PicamLaserOutputMode_ContinuousWave = 2, + PicamLaserOutputMode_Pulsed = 3 +} PicamLaserOutputMode; /* (4) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamLaserStatus +{ + PicamLaserStatus_Disarmed = 1, + PicamLaserStatus_Unarmed = 2, + PicamLaserStatus_Arming = 3, + PicamLaserStatus_Armed = 4 +} PicamLaserStatus; /* (5) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamLightSource +{ + PicamLightSource_Disabled = 1, + PicamLightSource_Hg = 2, + PicamLightSource_NeAr = 3, + PicamLightSource_Qth = 4 +} PicamLightSource; /* (5) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamLightSourceStatus +{ + PicamLightSourceStatus_Unstable = 1, + PicamLightSourceStatus_Stable = 2 +} PicamLightSourceStatus; /* (3) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamModulationTrackingMask +{ + PicamModulationTrackingMask_None = 0x0, + PicamModulationTrackingMask_Duration = 0x1, + PicamModulationTrackingMask_Frequency = 0x2, + PicamModulationTrackingMask_Phase = 0x4, + PicamModulationTrackingMask_OutputSignalFrequency = 0x8 +} PicamModulationTrackingMask; /* (0x10) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamOrientationMask +{ + PicamOrientationMask_Normal = 0x0, + PicamOrientationMask_FlippedHorizontally = 0x1, + PicamOrientationMask_FlippedVertically = 0x2 +} PicamOrientationMask; /* (0x4) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamOutputSignal +{ + PicamOutputSignal_Acquiring = 6, + PicamOutputSignal_AlwaysHigh = 5, + PicamOutputSignal_AlwaysLow = 4, + PicamOutputSignal_AuxOutput = 14, + PicamOutputSignal_Busy = 3, + PicamOutputSignal_EffectivelyExposing = 9, + PicamOutputSignal_EffectivelyExposingAlternation = 15, + PicamOutputSignal_Exposing = 8, + PicamOutputSignal_Gate = 13, + PicamOutputSignal_InternalTriggerT0 = 12, + PicamOutputSignal_NotReadingOut = 1, + PicamOutputSignal_ReadingOut = 10, + PicamOutputSignal_ShiftingUnderMask = 7, + PicamOutputSignal_ShutterOpen = 2, + PicamOutputSignal_WaitingForTrigger = 11 +} PicamOutputSignal; /* (16) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamPhosphorType +{ + PicamPhosphorType_P43 = 1, + PicamPhosphorType_P46 = 2 +} PicamPhosphorType; /* (3) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamPhotocathodeSensitivity +{ + PicamPhotocathodeSensitivity_RedBlue = 1, + PicamPhotocathodeSensitivity_SuperRed = 7, + PicamPhotocathodeSensitivity_SuperBlue = 2, + PicamPhotocathodeSensitivity_UV = 3, + PicamPhotocathodeSensitivity_SolarBlind = 10, + PicamPhotocathodeSensitivity_Unigen2Filmless = 4, + PicamPhotocathodeSensitivity_InGaAsFilmless = 9, + PicamPhotocathodeSensitivity_HighQEFilmless = 5, + PicamPhotocathodeSensitivity_HighRedFilmless = 8, + PicamPhotocathodeSensitivity_HighBlueFilmless = 6 +} PicamPhotocathodeSensitivity; /* (11) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamPhotonDetectionMode +{ + PicamPhotonDetectionMode_Disabled = 1, + PicamPhotonDetectionMode_Thresholding = 2, + PicamPhotonDetectionMode_Clipping = 3 +} PicamPhotonDetectionMode; /* (4) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamPixelFormat +{ + PicamPixelFormat_Monochrome16Bit = 1, + PicamPixelFormat_Monochrome32Bit = 2 +} PicamPixelFormat; /* (3) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamReadoutControlMode +{ + PicamReadoutControlMode_FullFrame = 1, + PicamReadoutControlMode_FrameTransfer = 2, + PicamReadoutControlMode_Interline = 5, + PicamReadoutControlMode_RollingShutter = 8, + PicamReadoutControlMode_ExposeDuringReadout = 9, + PicamReadoutControlMode_Kinetics = 3, + PicamReadoutControlMode_SpectraKinetics = 4, + PicamReadoutControlMode_Dif = 6, + PicamReadoutControlMode_SeNsR = 7 +} PicamReadoutControlMode; /* (10) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamSensorTemperatureStatus +{ + PicamSensorTemperatureStatus_Unlocked = 1, + PicamSensorTemperatureStatus_Locked = 2, + PicamSensorTemperatureStatus_Faulted = 3 +} PicamSensorTemperatureStatus; /* (4) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamSensorType +{ + PicamSensorType_Ccd = 1, + PicamSensorType_InGaAs = 2, + PicamSensorType_Cmos = 3 +} PicamSensorType; /* (4) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamShutterStatus +{ + PicamShutterStatus_NotConnected = 1, + PicamShutterStatus_Connected = 2, + PicamShutterStatus_Overheated = 3 +} PicamShutterStatus; /* (4) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamShutterTimingMode +{ + PicamShutterTimingMode_Normal = 1, + PicamShutterTimingMode_AlwaysClosed = 2, + PicamShutterTimingMode_AlwaysOpen = 3, + PicamShutterTimingMode_OpenBeforeTrigger = 4 +} PicamShutterTimingMode; /* (5) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamShutterType +{ + PicamShutterType_None = 1, + PicamShutterType_VincentCS25 = 2, + PicamShutterType_VincentCS45 = 3, + PicamShutterType_VincentCS90 = 9, + PicamShutterType_VincentDSS10 = 8, + PicamShutterType_VincentVS25 = 4, + PicamShutterType_VincentVS35 = 5, + PicamShutterType_ProntorMagnetic0 = 6, + PicamShutterType_ProntorMagneticE40 = 7 +} PicamShutterType; /* (10) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamTimeStampsMask +{ + PicamTimeStampsMask_None = 0x0, + PicamTimeStampsMask_ExposureStarted = 0x1, + PicamTimeStampsMask_ExposureEnded = 0x2 +} PicamTimeStampsMask; /* (0x4) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamTriggerCoupling +{ + PicamTriggerCoupling_AC = 1, + PicamTriggerCoupling_DC = 2 +} PicamTriggerCoupling; /* (3) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamTriggerDetermination +{ + PicamTriggerDetermination_PositivePolarity = 1, + PicamTriggerDetermination_NegativePolarity = 2, + PicamTriggerDetermination_RisingEdge = 3, + PicamTriggerDetermination_FallingEdge = 4, + PicamTriggerDetermination_AlternatingEdgeRising = 5, + PicamTriggerDetermination_AlternatingEdgeFalling = 6 +} PicamTriggerDetermination; /* (7) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamTriggerResponse +{ + PicamTriggerResponse_NoResponse = 1, + PicamTriggerResponse_StartOnSingleTrigger = 5, + PicamTriggerResponse_ReadoutPerTrigger = 2, + PicamTriggerResponse_ShiftPerTrigger = 3, + PicamTriggerResponse_GatePerTrigger = 6, + PicamTriggerResponse_ExposeDuringTriggerPulse = 4 +} PicamTriggerResponse; /* (7) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamTriggerSource +{ + PicamTriggerSource_None = 3, + PicamTriggerSource_Internal = 2, + PicamTriggerSource_External = 1 +} PicamTriggerSource; /* (4) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamTriggerStatus +{ + PicamTriggerStatus_NotConnected = 1, + PicamTriggerStatus_Connected = 2 +} PicamTriggerStatus; /* (3) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamTriggerTermination +{ + PicamTriggerTermination_FiftyOhms = 1, + PicamTriggerTermination_HighImpedance = 2 +} PicamTriggerTermination; /* (3) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamVacuumStatus +{ + PicamVacuumStatus_Sufficient = 1, + PicamVacuumStatus_Low = 2 +} PicamVacuumStatus; /* (3) */ +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Values - Default -------------------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetParameterIntegerDefaultValue( + PicamHandle camera_or_accessory, + PicamParameter parameter, + piint* value ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetParameterLargeIntegerDefaultValue( + PicamHandle camera, + PicamParameter parameter, + pi64s* value ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetParameterFloatingPointDefaultValue( + PicamHandle camera_or_accessory, + PicamParameter parameter, + piflt* value ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetParameterRoisDefaultValue( + PicamHandle camera, + PicamParameter parameter, + const PicamRois** value ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetParameterPulseDefaultValue( + PicamHandle camera, + PicamParameter parameter, + const PicamPulse** value ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetParameterModulationsDefaultValue( + PicamHandle camera, + PicamParameter parameter, + const PicamModulations** value ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_RestoreParametersToDefaultValues( + PicamHandle camera_or_accessory ); +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Values - Online --------------------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_CanSetParameterOnline( + PicamHandle camera_or_accessory, + PicamParameter parameter, + pibln* onlineable ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_SetParameterIntegerValueOnline( + PicamHandle camera, + PicamParameter parameter, + piint value ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_SetParameterFloatingPointValueOnline( + PicamHandle camera, + PicamParameter parameter, + piflt value ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_SetParameterPulseValueOnline( + PicamHandle camera, + PicamParameter parameter, + const PicamPulse* value ); +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Values - Reading -------------------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_CanReadParameter( + PicamHandle camera_or_accessory, + PicamParameter parameter, + pibln* readable ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_ReadParameterIntegerValue( + PicamHandle camera_or_accessory, + PicamParameter parameter, + piint* value ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_ReadParameterFloatingPointValue( + PicamHandle camera_or_accessory, + PicamParameter parameter, + piflt* value ); +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Values - Status Waiting ------------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_CanWaitForStatusParameter( + PicamHandle camera_or_accessory, + PicamParameter parameter, + pibln* waitable ); +/*----------------------------------------------------------------------------*/ +typedef struct PicamStatusPurview +{ + const piint* values_array; + piint values_count; +} PicamStatusPurview; +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_DestroyStatusPurviews( + const PicamStatusPurview* purviews_array ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetStatusParameterPurview( + PicamHandle camera_or_accessory, + PicamParameter parameter, + const PicamStatusPurview** purview ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_EstimateTimeToStatusParameterValue( + PicamHandle camera_or_accessory, + PicamParameter parameter, + piint value, + piint* estimated_time ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_WaitForStatusParameterValue( + PicamHandle camera_or_accessory, + PicamParameter parameter, + piint value, + piint time_out ); +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Information - Available Parameters -------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_DestroyParameters( const PicamParameter* parameter_array ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetParameters( + PicamHandle camera_or_accessory, + const PicamParameter** parameter_array, + piint* parameter_count ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_DoesParameterExist( + PicamHandle camera_or_accessory, + PicamParameter parameter, + pibln* exists ); +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Information - Relevance ------------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_IsParameterRelevant( + PicamHandle camera_or_accessory, + PicamParameter parameter, + pibln* relevant ); +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Information - Value Type -----------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetParameterValueType( + PicamHandle camera_or_accessory, + PicamParameter parameter, + PicamValueType* type ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetParameterEnumeratedType( + PicamHandle camera_or_accessory, + PicamParameter parameter, + PicamEnumeratedType* type ); +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Information - Value Access ---------------------*/ +/*----------------------------------------------------------------------------*/ +typedef enum PicamValueAccess +{ + PicamValueAccess_ReadOnly = 1, + PicamValueAccess_ReadWriteTrivial = 3, + PicamValueAccess_ReadWrite = 2 +} PicamValueAccess; /* (4) */ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetParameterValueAccess( + PicamHandle camera_or_accessory, + PicamParameter parameter, + PicamValueAccess* access ); +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Constraints - Constraint Type ------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetParameterConstraintType( + PicamHandle camera_or_accessory, + PicamParameter parameter, + PicamConstraintType* type ); +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Constraints - Enumerated Types -----------------*/ +/*----------------------------------------------------------------------------*/ +typedef enum PicamConstraintScope +{ + PicamConstraintScope_Independent = 1, + PicamConstraintScope_Dependent = 2 +} PicamConstraintScope; /* (3) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamConstraintSeverity +{ + PicamConstraintSeverity_Error = 1, + PicamConstraintSeverity_Warning = 2 +} PicamConstraintSeverity; /* (3) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamConstraintCategory +{ + PicamConstraintCategory_Capable = 1, + PicamConstraintCategory_Required = 2, + PicamConstraintCategory_Recommended = 3 +} PicamConstraintCategory; /* (4) */ +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Constraints - Collection -----------------------*/ +/*----------------------------------------------------------------------------*/ +typedef struct PicamCollectionConstraint +{ + PicamConstraintScope scope; + PicamConstraintSeverity severity; + const piflt* values_array; + piint values_count; +} PicamCollectionConstraint; +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_DestroyCollectionConstraints( + const PicamCollectionConstraint* constraint_array ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetParameterCollectionConstraint( + PicamHandle camera_or_accessory, + PicamParameter parameter, + PicamConstraintCategory category, + const PicamCollectionConstraint** constraint ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Constraints - Range ----------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef struct PicamRangeConstraint +{ + PicamConstraintScope scope; + PicamConstraintSeverity severity; + pibln empty_set; + piflt minimum; + piflt maximum; + piflt increment; + const piflt* excluded_values_array; + piint excluded_values_count; + const piflt* outlying_values_array; + piint outlying_values_count; +} PicamRangeConstraint; +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_DestroyRangeConstraints( + const PicamRangeConstraint* constraint_array ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetParameterRangeConstraint( + PicamHandle camera_or_accessory, + PicamParameter parameter, + PicamConstraintCategory category, + const PicamRangeConstraint** constraint ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +/* Camera Parameter Constraints - Regions of Interest ------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef enum PicamRoisConstraintRulesMask +{ + PicamRoisConstraintRulesMask_None = 0x00, + PicamRoisConstraintRulesMask_XBinningAlignment = 0x01, + PicamRoisConstraintRulesMask_YBinningAlignment = 0x02, + PicamRoisConstraintRulesMask_HorizontalSymmetry = 0x04, + PicamRoisConstraintRulesMask_VerticalSymmetry = 0x08, + PicamRoisConstraintRulesMask_SymmetryBoundsBinning = 0x10 +} PicamRoisConstraintRulesMask; /* (0x20) */ +/*----------------------------------------------------------------------------*/ +typedef struct PicamRoisConstraint +{ + PicamConstraintScope scope; + PicamConstraintSeverity severity; + pibln empty_set; + PicamRoisConstraintRulesMask rules; + piint maximum_roi_count; + PicamRangeConstraint x_constraint; + PicamRangeConstraint width_constraint; + const piint* x_binning_limits_array; + piint x_binning_limits_count; + PicamRangeConstraint y_constraint; + PicamRangeConstraint height_constraint; + const piint* y_binning_limits_array; + piint y_binning_limits_count; +} PicamRoisConstraint; +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_DestroyRoisConstraints( + const PicamRoisConstraint* constraint_array ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetParameterRoisConstraint( + PicamHandle camera, + PicamParameter parameter, + PicamConstraintCategory category, + const PicamRoisConstraint** constraint ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +/* Camera Parameter Constraints - Pulse --------------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef struct PicamPulseConstraint +{ + PicamConstraintScope scope; + PicamConstraintSeverity severity; + pibln empty_set; + PicamRangeConstraint delay_constraint; + PicamRangeConstraint width_constraint; + piflt minimum_duration; + piflt maximum_duration; +} PicamPulseConstraint; +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_DestroyPulseConstraints( + const PicamPulseConstraint* constraint_array ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetParameterPulseConstraint( + PicamHandle camera, + PicamParameter parameter, + PicamConstraintCategory category, + const PicamPulseConstraint** constraint ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +/* Camera Parameter Constraints - Custom Intensifier Modulation Sequence -----*/ +/*----------------------------------------------------------------------------*/ +typedef struct PicamModulationsConstraint +{ + PicamConstraintScope scope; + PicamConstraintSeverity severity; + pibln empty_set; + piint maximum_modulation_count; + PicamRangeConstraint duration_constraint; + PicamRangeConstraint frequency_constraint; + PicamRangeConstraint phase_constraint; + PicamRangeConstraint output_signal_frequency_constraint; +} PicamModulationsConstraint; +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_DestroyModulationsConstraints( + const PicamModulationsConstraint* constraint_array ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_GetParameterModulationsConstraint( + PicamHandle camera, + PicamParameter parameter, + PicamConstraintCategory category, + const PicamModulationsConstraint** constraint ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Commitment -------------------------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_AreParametersCommitted( + PicamHandle camera_or_accessory, + pibln* committed ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_CommitParameters( + PicamHandle camera_or_accessory, + const PicamParameter** failed_parameter_array, + piint* failed_parameter_count ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/* Camera Data Acquisition */ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ + +/*----------------------------------------------------------------------------*/ +/* Camera Acquisition Control ------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef struct PicamAvailableData +{ + void* initial_readout; + pi64s readout_count; +} PicamAvailableData; +/*----------------------------------------------------------------------------*/ +typedef enum PicamAcquisitionErrorsMask +{ + PicamAcquisitionErrorsMask_None = 0x00, + PicamAcquisitionErrorsMask_CameraFaulted = 0x10, + PicamAcquisitionErrorsMask_ConnectionLost = 0x02, + PicamAcquisitionErrorsMask_ShutterOverheated = 0x08, + PicamAcquisitionErrorsMask_DataLost = 0x01, + PicamAcquisitionErrorsMask_DataNotArriving = 0x04 +} PicamAcquisitionErrorsMask; /* (0x20) */ +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_Acquire( + PicamHandle camera, + pi64s readout_count, + piint readout_time_out, + PicamAvailableData* available, + PicamAcquisitionErrorsMask* errors ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_StartAcquisition( PicamHandle camera ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_StopAcquisition( PicamHandle camera ); +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_IsAcquisitionRunning( + PicamHandle camera, + pibln* running ); +/*----------------------------------------------------------------------------*/ +typedef struct PicamAcquisitionStatus +{ + pibln running; + PicamAcquisitionErrorsMask errors; + piflt readout_rate; +} PicamAcquisitionStatus; +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_WaitForAcquisitionUpdate( + PicamHandle camera, + piint readout_time_out, + PicamAvailableData* available, + PicamAcquisitionStatus* status ); +/*----------------------------------------------------------------------------*/ + +/******************************************************************************/ +/* C++ Epilogue */ +/******************************************************************************/ +#if defined __cplusplus && !defined PICAM_EXPORTS + } /* end extern "C" */ +#endif + +#endif diff --git a/PICamSupport/picam_advanced.h b/PICamSupport/picam_advanced.h index 6ed89b1..5df82f5 100644 --- a/PICamSupport/picam_advanced.h +++ b/PICamSupport/picam_advanced.h @@ -1,547 +1,676 @@ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/* picam_advanced.h - Princeton Instruments Advanced Camera Control API */ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -#if !defined PICAM_ADVANCED_H -#define PICAM_ADVANCED_H - -#include "picam.h" - -/******************************************************************************/ -/* C++ Prologue */ -/******************************************************************************/ -#if defined __cplusplus && !defined PICAM_EXPORTS - extern "C" - { -#endif - -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/* Plug 'n Play Discovery, Camera Information and Access */ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ - -/*----------------------------------------------------------------------------*/ -/* Camera Plug 'n Play Discovery ---------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef enum PicamDiscoveryAction -{ - PicamDiscoveryAction_Found = 1, - PicamDiscoveryAction_Lost = 2 -} PicamDiscoveryAction; /* (3) */ -/*----------------------------------------------------------------------------*/ -typedef PicamError (PIL_CALL* PicamDiscoveryCallback)( - const PicamCameraID* id, - PicamHandle device, - PicamDiscoveryAction action ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_RegisterForDiscovery( PicamDiscoveryCallback discover ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_UnregisterForDiscovery( - PicamDiscoveryCallback discover ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_DiscoverCameras( void ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_StopDiscoveringCameras( void ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_IsDiscoveringCameras( pibln* discovering ); -/*----------------------------------------------------------------------------*/ -/* Camera Access -------------------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_OpenCameraDevice( - const PicamCameraID* id, - PicamHandle* device ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_CloseCameraDevice( PicamHandle device ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_GetOpenCameraDevices( - const PicamHandle** device_array, - piint* device_count ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_GetCameraModel( - PicamHandle camera, - PicamHandle* model ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_GetCameraDevice( - PicamHandle camera, - PicamHandle* device ); -/*----------------------------------------------------------------------------*/ -typedef enum PicamHandleType -{ - PicamHandleType_CameraDevice = 1, - PicamHandleType_CameraModel = 2 -} PicamHandleType; /* (3) */ -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_GetHandleType( - PicamHandle camera, - PicamHandleType* type ); -/*----------------------------------------------------------------------------*/ -/* Camera Information - User State -------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_GetUserState( PicamHandle camera, void** user_state ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_SetUserState( PicamHandle camera, void* user_state ); -/*----------------------------------------------------------------------------*/ -/* Camera Information - Pixel Defects ----------------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef struct PicamPixelLocation -{ - pi16s x; - pi16s y; -} PicamPixelLocation; -/*----------------------------------------------------------------------------*/ -typedef struct PicamColumnDefect -{ - PicamPixelLocation start; - piint height; -} PicamColumnDefect; -/*----------------------------------------------------------------------------*/ -typedef struct PicamRowDefect -{ - PicamPixelLocation start; - piint width; -} PicamRowDefect; -/*----------------------------------------------------------------------------*/ -typedef struct PicamPixelDefectMap -{ - const PicamColumnDefect* column_defect_array; - piint column_defect_count; - const PicamRowDefect* row_defect_array; - piint row_defect_count; - const PicamPixelLocation* point_defect_array; - piint point_defect_count; -} PicamPixelDefectMap; -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_DestroyPixelDefectMaps( - const PicamPixelDefectMap* pixel_defect_map_array ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_GetPixelDefectMap( - PicamHandle camera, - const PicamPixelDefectMap** pixel_defect_map ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ - -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/* Camera Parameter Values, Information, Constraints and Commitment */ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ - -/*----------------------------------------------------------------------------*/ -/* Camera Parameters ---------------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Values - Integer -----------------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef PicamError (PIL_CALL* PicamIntegerValueChangedCallback)( - PicamHandle camera, - PicamParameter parameter, - piint value ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_RegisterForIntegerValueChanged( - PicamHandle camera, - PicamParameter parameter, - PicamIntegerValueChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_UnregisterForIntegerValueChanged( - PicamHandle camera, - PicamParameter parameter, - PicamIntegerValueChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Values - Large Integer -----------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef PicamError (PIL_CALL* PicamLargeIntegerValueChangedCallback)( - PicamHandle camera, - PicamParameter parameter, - pi64s value ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_RegisterForLargeIntegerValueChanged( - PicamHandle camera, - PicamParameter parameter, - PicamLargeIntegerValueChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_UnregisterForLargeIntegerValueChanged( - PicamHandle camera, - PicamParameter parameter, - PicamLargeIntegerValueChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Values - Floating Point ----------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef PicamError (PIL_CALL* PicamFloatingPointValueChangedCallback)( - PicamHandle camera, - PicamParameter parameter, - piflt value ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_RegisterForFloatingPointValueChanged( - PicamHandle camera, - PicamParameter parameter, - PicamFloatingPointValueChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_UnregisterForFloatingPointValueChanged( - PicamHandle camera, - PicamParameter parameter, - PicamFloatingPointValueChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Values - Regions of Interest -----------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef PicamError (PIL_CALL* PicamRoisValueChangedCallback)( - PicamHandle camera, - PicamParameter parameter, - const PicamRois* value ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_RegisterForRoisValueChanged( - PicamHandle camera, - PicamParameter parameter, - PicamRoisValueChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_UnregisterForRoisValueChanged( - PicamHandle camera, - PicamParameter parameter, - PicamRoisValueChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Values - Pulse -------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef PicamError (PIL_CALL* PicamPulseValueChangedCallback)( - PicamHandle camera, - PicamParameter parameter, - const PicamPulse* value ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_RegisterForPulseValueChanged( - PicamHandle camera, - PicamParameter parameter, - PicamPulseValueChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_UnregisterForPulseValueChanged( - PicamHandle camera, - PicamParameter parameter, - PicamPulseValueChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Values - Custom Intensifier Modulation Sequence ----------*/ -/*----------------------------------------------------------------------------*/ -typedef PicamError (PIL_CALL* PicamModulationsValueChangedCallback)( - PicamHandle camera, - PicamParameter parameter, - const PicamModulations* value ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_RegisterForModulationsValueChanged( - PicamHandle camera, - PicamParameter parameter, - PicamModulationsValueChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_UnregisterForModulationsValueChanged( - PicamHandle camera, - PicamParameter parameter, - PicamModulationsValueChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Information - Relevance ----------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef PicamError (PIL_CALL* PicamIsRelevantChangedCallback)( - PicamHandle camera, - PicamParameter parameter, - pibln relevant ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_RegisterForIsRelevantChanged( - PicamHandle camera, - PicamParameter parameter, - PicamIsRelevantChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_UnregisterForIsRelevantChanged( - PicamHandle camera, - PicamParameter parameter, - PicamIsRelevantChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Information - Value Access -------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef PicamError (PIL_CALL* PicamValueAccessChangedCallback)( - PicamHandle camera, - PicamParameter parameter, - PicamValueAccess access ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_RegisterForValueAccessChanged( - PicamHandle camera, - PicamParameter parameter, - PicamValueAccessChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_UnregisterForValueAccessChanged( - PicamHandle camera, - PicamParameter parameter, - PicamValueAccessChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Information - Dynamics -----------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef enum PicamDynamicsMask -{ - PicamDynamicsMask_None = 0x0, - PicamDynamicsMask_Value = 0x1, - PicamDynamicsMask_ValueAccess = 0x2, - PicamDynamicsMask_IsRelevant = 0x4, - PicamDynamicsMask_Constraint = 0x8 -} PicamDynamicsMask; /* (0x10) */ -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_GetParameterDynamics( - PicamHandle camera, - PicamParameter parameter, - PicamDynamicsMask* dynamics ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Constraints - Collection ---------------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_GetParameterCollectionConstraints( - PicamHandle camera, - PicamParameter parameter, - const PicamCollectionConstraint** constraint_array, - piint* constraint_count ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -typedef PicamError (PIL_CALL*PicamDependentCollectionConstraintChangedCallback)( - PicamHandle camera, - PicamParameter parameter, - const PicamCollectionConstraint* constraint ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_RegisterForDependentCollectionConstraintChanged( - PicamHandle camera, - PicamParameter parameter, - PicamDependentCollectionConstraintChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_UnregisterForDependentCollectionConstraintChanged( - PicamHandle camera, - PicamParameter parameter, - PicamDependentCollectionConstraintChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Constraints - Range --------------------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_GetParameterRangeConstraints( - PicamHandle camera, - PicamParameter parameter, - const PicamRangeConstraint** constraint_array, - piint* constraint_count ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -typedef PicamError (PIL_CALL*PicamDependentRangeConstraintChangedCallback)( - PicamHandle camera, - PicamParameter parameter, - const PicamRangeConstraint* constraint ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_RegisterForDependentRangeConstraintChanged( - PicamHandle camera, - PicamParameter parameter, - PicamDependentRangeConstraintChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_UnregisterForDependentRangeConstraintChanged( - PicamHandle camera, - PicamParameter parameter, - PicamDependentRangeConstraintChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Constraints - Regions Of Interest ------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_GetParameterRoisConstraints( - PicamHandle camera, - PicamParameter parameter, - const PicamRoisConstraint** constraint_array, - piint* constraint_count ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -typedef PicamError (PIL_CALL* PicamDependentRoisConstraintChangedCallback)( - PicamHandle camera, - PicamParameter parameter, - const PicamRoisConstraint* constraint ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_RegisterForDependentRoisConstraintChanged( - PicamHandle camera, - PicamParameter parameter, - PicamDependentRoisConstraintChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_UnregisterForDependentRoisConstraintChanged( - PicamHandle camera, - PicamParameter parameter, - PicamDependentRoisConstraintChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Constraints - Pulse --------------------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_GetParameterPulseConstraints( - PicamHandle camera, - PicamParameter parameter, - const PicamPulseConstraint** constraint_array, - piint* constraint_count ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -typedef PicamError (PIL_CALL* PicamDependentPulseConstraintChangedCallback)( - PicamHandle camera, - PicamParameter parameter, - const PicamPulseConstraint* constraint ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_RegisterForDependentPulseConstraintChanged( - PicamHandle camera, - PicamParameter parameter, - PicamDependentPulseConstraintChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_UnregisterForDependentPulseConstraintChanged( - PicamHandle camera, - PicamParameter parameter, - PicamDependentPulseConstraintChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -/* Camera Parameter Constraints - Custom Intensifier Modulation Sequence -----*/ -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_GetParameterModulationsConstraints( - PicamHandle camera, - PicamParameter parameter, - const PicamModulationsConstraint** constraint_array, - piint* constraint_count ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -typedef PicamError (PIL_CALL* PicamDependentModulationsConstraintChangedCallback)( - PicamHandle camera, - PicamParameter parameter, - const PicamModulationsConstraint* constraint ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_RegisterForDependentModulationsConstraintChanged( - PicamHandle camera, - PicamParameter parameter, - PicamDependentModulationsConstraintChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_UnregisterForDependentModulationsConstraintChanged( - PicamHandle camera, - PicamParameter parameter, - PicamDependentModulationsConstraintChangedCallback changed ); -/*----------------------------------------------------------------------------*/ -/* Camera Commitment ---------------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -/* Parameter Validation ------------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef struct PicamValidationResult -{ - pibln is_valid; - const PicamParameter* failed_parameter; - const PicamConstraintScope* failed_error_constraint_scope; - const PicamConstraintScope* failed_warning_constraint_scope; - const PicamParameter* error_constraining_parameter_array; - piint error_constraining_parameter_count; - const PicamParameter* warning_constraining_parameter_array; - piint warning_constraining_parameter_count; -} PicamValidationResult; -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_DestroyValidationResult( - const PicamValidationResult* result ); -/*----------------------------------------------------------------------------*/ -typedef struct PicamValidationResults -{ - pibln is_valid; - const PicamValidationResult* validation_result_array; - piint validation_result_count; -} PicamValidationResults; -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_DestroyValidationResults( - const PicamValidationResults* results ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_ValidateParameter( - PicamHandle model, - PicamParameter parameter, - const PicamValidationResult** result ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_ValidateParameters( - PicamHandle model, - const PicamValidationResults** results ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -/* Dependent Parameter Validation --------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef struct PicamFailedDependentParameter -{ - PicamParameter failed_parameter; - const PicamConstraintScope* failed_error_constraint_scope; - const PicamConstraintScope* failed_warning_constraint_scope; -} PicamFailedDependentParameter; -/*----------------------------------------------------------------------------*/ -typedef struct PicamDependentValidationResult -{ - pibln is_valid; - PicamParameter constraining_parameter; - const PicamFailedDependentParameter* failed_dependent_parameter_array; - piint failed_dependent_parameter_count; -} PicamDependentValidationResult; -/*----------------------------------------------------------------------------*/ -PICAM_API Picam_DestroyDependentValidationResult( - const PicamDependentValidationResult* result ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_ValidateDependentParameter( - PicamHandle model, - PicamParameter parameter, - const PicamDependentValidationResult** result ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -/* Parameter Commitment ------------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_CommitParametersToCameraDevice( PicamHandle model ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_RefreshParameterFromCameraDevice( - PicamHandle model, - PicamParameter parameter ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_RefreshParametersFromCameraDevice( - PicamHandle model ); -/*----------------------------------------------------------------------------*/ - -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/* Camera Data Acquisition */ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ - -/*----------------------------------------------------------------------------*/ -/* Acquisition Setup - Buffer ------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef struct PicamAcquisitionBuffer -{ - void* memory; - pi64s memory_size; -} PicamAcquisitionBuffer; -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_GetAcquisitionBuffer( - PicamHandle device, - PicamAcquisitionBuffer* buffer ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_SetAcquisitionBuffer( - PicamHandle device, - const PicamAcquisitionBuffer* buffer ); -/*----------------------------------------------------------------------------*/ -/* Acquisition Setup - Notification ------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef PicamError (PIL_CALL* PicamAcquisitionUpdatedCallback)( - PicamHandle device, - const PicamAvailableData* available, - const PicamAcquisitionStatus* status ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_RegisterForAcquisitionUpdated( - PicamHandle device, - PicamAcquisitionUpdatedCallback updated ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_UnregisterForAcquisitionUpdated( - PicamHandle device, - PicamAcquisitionUpdatedCallback updated ); -/*----------------------------------------------------------------------------*/ -/* Acquisition Control -------------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_HasAcquisitionBufferOverrun( - PicamHandle device, - pibln* overran ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamAdvanced_ClearReadoutCountOnline( - PicamHandle device, - pibln* cleared ); -/*----------------------------------------------------------------------------*/ - -/******************************************************************************/ -/* C++ Epilogue */ -/******************************************************************************/ -#if defined __cplusplus && !defined PICAM_EXPORTS - } /* end extern "C" */ -#endif - -#endif +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/* picam_advanced.h - Teledyne Princeton Instruments Advanced Control API */ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +#if !defined PICAM_ADVANCED_H +#define PICAM_ADVANCED_H + +#include "picam.h" + +/******************************************************************************/ +/* C++ Prologue */ +/******************************************************************************/ +#if defined __cplusplus && !defined PICAM_EXPORTS + extern "C" + { +#endif + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/* Camera Plug 'n Play Discovery, Access and Information */ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ + +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Plug 'n Play Discovery -----------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef enum PicamDiscoveryAction +{ + PicamDiscoveryAction_Found = 1, + PicamDiscoveryAction_Lost = 2, + PicamDiscoveryAction_Faulted = 3 +} PicamDiscoveryAction; /* (4) */ +/*----------------------------------------------------------------------------*/ +typedef PicamError (PIL_CALL* PicamDiscoveryCallback)( + const PicamCameraID* id, + PicamHandle device, + PicamDiscoveryAction action ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_RegisterForDiscovery( + PicamDiscoveryCallback discover ); /* ASYNC */ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_UnregisterForDiscovery( + PicamDiscoveryCallback discover ); /* ASYNC */ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_DiscoverCameras( void ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_StopDiscoveringCameras( void ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_IsDiscoveringCameras( pibln* discovering ); +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Access ---------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef enum PicamHandleType +{ + PicamHandleType_CameraDevice = 1, + PicamHandleType_CameraModel = 2, + PicamHandleType_Accessory = 4, + PicamHandleType_EMCalibration = 3 +} PicamHandleType; /* (5) */ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_GetHandleType( + PicamHandle handle, + PicamHandleType* type ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_OpenCameraDevice( + const PicamCameraID* id, + PicamHandle* device ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_CloseCameraDevice( PicamHandle device ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_GetOpenCameraDevices( + const PicamHandle** device_array, + piint* device_count ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_GetCameraModel( + PicamHandle camera, + PicamHandle* model ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_GetCameraDevice( + PicamHandle camera, + PicamHandle* device ); +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Information - User State ---------------------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_GetUserState( + PicamHandle camera_or_accessory, + void** user_state ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_SetUserState( + PicamHandle camera_or_accessory, + void* user_state ); +/*----------------------------------------------------------------------------*/ +/* Camera Information - Pixel Defects ----------------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef struct PicamPixelLocation +{ + pi16s x; + pi16s y; +} PicamPixelLocation; +/*----------------------------------------------------------------------------*/ +typedef struct PicamColumnDefect +{ + PicamPixelLocation start; + piint height; +} PicamColumnDefect; +/*----------------------------------------------------------------------------*/ +typedef struct PicamRowDefect +{ + PicamPixelLocation start; + piint width; +} PicamRowDefect; +/*----------------------------------------------------------------------------*/ +typedef struct PicamPixelDefectMap +{ + const PicamColumnDefect* column_defect_array; + piint column_defect_count; + const PicamRowDefect* row_defect_array; + piint row_defect_count; + const PicamPixelLocation* point_defect_array; + piint point_defect_count; +} PicamPixelDefectMap; +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_DestroyPixelDefectMaps( + const PicamPixelDefectMap* pixel_defect_map_array ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_GetPixelDefectMap( + PicamHandle camera, + const PicamPixelDefectMap** pixel_defect_map ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +/* Camera Information - Star Defects -----------------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef struct PicamStarDefect +{ + PicamPixelLocation center; + pi32f bias; + pi32f adjacent_factor; + pi32f diagonal_factor; +} PicamStarDefect; +/*----------------------------------------------------------------------------*/ +typedef struct PicamStarDefectMap +{ + piint id; + const PicamStarDefect* star_defect_array; + piint star_defect_count; +} PicamStarDefectMap; +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_DestroyStarDefectMaps( + const PicamStarDefectMap* star_defect_map_array ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_GetStarDefectMap( + PicamHandle camera, + const PicamStarDefectMap** star_defect_map ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_GetStarDefectMaps( + PicamHandle camera, + const PicamStarDefectMap** star_defect_map_array, + piint* star_defect_map_count ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/* Camera/Accessory Parameter Values, Information, Constraints and Commitment */ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ + +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameters -----------------------------------------------*/ +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Values - Integer -------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef PicamError (PIL_CALL* PicamIntegerValueChangedCallback)( + PicamHandle camera_or_accessory, + PicamParameter parameter, + piint value ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_RegisterForIntegerValueChanged( + PicamHandle camera_or_accessory, + PicamParameter parameter, + PicamIntegerValueChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_UnregisterForIntegerValueChanged( + PicamHandle camera_or_accessory, + PicamParameter parameter, + PicamIntegerValueChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_RegisterForExtrinsicIntegerValueChanged( + PicamHandle device_or_accessory, + PicamParameter parameter, + PicamIntegerValueChangedCallback changed ); /* ASYNC */ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_UnregisterForExtrinsicIntegerValueChanged( + PicamHandle device_or_accessory, + PicamParameter parameter, + PicamIntegerValueChangedCallback changed ); /* ASYNC */ +/*----------------------------------------------------------------------------*/ +/* Camera Parameter Values - Large Integer -----------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef PicamError (PIL_CALL* PicamLargeIntegerValueChangedCallback)( + PicamHandle camera, + PicamParameter parameter, + pi64s value ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_RegisterForLargeIntegerValueChanged( + PicamHandle camera, + PicamParameter parameter, + PicamLargeIntegerValueChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_UnregisterForLargeIntegerValueChanged( + PicamHandle camera, + PicamParameter parameter, + PicamLargeIntegerValueChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Values - Floating Point ------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef PicamError (PIL_CALL* PicamFloatingPointValueChangedCallback)( + PicamHandle camera_or_accessory, + PicamParameter parameter, + piflt value ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_RegisterForFloatingPointValueChanged( + PicamHandle camera_or_accessory, + PicamParameter parameter, + PicamFloatingPointValueChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_UnregisterForFloatingPointValueChanged( + PicamHandle camera_or_accessory, + PicamParameter parameter, + PicamFloatingPointValueChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_RegisterForExtrinsicFloatingPointValueChanged( + PicamHandle device_or_accessory, + PicamParameter parameter, + PicamFloatingPointValueChangedCallback changed ); /* ASYNC */ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_UnregisterForExtrinsicFloatingPointValueChanged( + PicamHandle device_or_accessory, + PicamParameter parameter, + PicamFloatingPointValueChangedCallback changed ); /* ASYNC */ +/*----------------------------------------------------------------------------*/ +/* Camera Parameter Values - Regions of Interest -----------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef PicamError (PIL_CALL* PicamRoisValueChangedCallback)( + PicamHandle camera, + PicamParameter parameter, + const PicamRois* value ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_RegisterForRoisValueChanged( + PicamHandle camera, + PicamParameter parameter, + PicamRoisValueChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_UnregisterForRoisValueChanged( + PicamHandle camera, + PicamParameter parameter, + PicamRoisValueChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +/* Camera Parameter Values - Pulse -------------------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef PicamError (PIL_CALL* PicamPulseValueChangedCallback)( + PicamHandle camera, + PicamParameter parameter, + const PicamPulse* value ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_RegisterForPulseValueChanged( + PicamHandle camera, + PicamParameter parameter, + PicamPulseValueChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_UnregisterForPulseValueChanged( + PicamHandle camera, + PicamParameter parameter, + PicamPulseValueChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +/* Camera Parameter Values - Custom Intensifier Modulation Sequence ----------*/ +/*----------------------------------------------------------------------------*/ +typedef PicamError (PIL_CALL* PicamModulationsValueChangedCallback)( + PicamHandle camera, + PicamParameter parameter, + const PicamModulations* value ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_RegisterForModulationsValueChanged( + PicamHandle camera, + PicamParameter parameter, + PicamModulationsValueChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_UnregisterForModulationsValueChanged( + PicamHandle camera, + PicamParameter parameter, + PicamModulationsValueChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Values - Status Waiting ------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef PicamError (PIL_CALL* PicamWhenStatusParameterValueCallback)( + PicamHandle device_or_accessory, + PicamParameter parameter, + piint value, + PicamError error ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_NotifyWhenStatusParameterValue( + PicamHandle device_or_accessory, + PicamParameter parameter, + piint value, + PicamWhenStatusParameterValueCallback when ); /* ASYNC */ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_CancelNotifyWhenStatusParameterValue( + PicamHandle device_or_accessory, + PicamParameter parameter, + piint value, + PicamWhenStatusParameterValueCallback when ); /* ASYNC */ +/*----------------------------------------------------------------------------*/ +/* Camera Parameter Information - Relevance ----------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef PicamError (PIL_CALL* PicamIsRelevantChangedCallback)( + PicamHandle camera_or_accessory, + PicamParameter parameter, + pibln relevant ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_RegisterForIsRelevantChanged( + PicamHandle camera_or_accessory, + PicamParameter parameter, + PicamIsRelevantChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_UnregisterForIsRelevantChanged( + PicamHandle camera_or_accessory, + PicamParameter parameter, + PicamIsRelevantChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Information - Value Access ---------------------*/ +/*----------------------------------------------------------------------------*/ +typedef PicamError (PIL_CALL* PicamValueAccessChangedCallback)( + PicamHandle camera_or_accessory, + PicamParameter parameter, + PicamValueAccess access ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_RegisterForValueAccessChanged( + PicamHandle camera_or_accessory, + PicamParameter parameter, + PicamValueAccessChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_UnregisterForValueAccessChanged( + PicamHandle camera_or_accessory, + PicamParameter parameter, + PicamValueAccessChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Information - Dynamics -------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef enum PicamDynamicsMask +{ + PicamDynamicsMask_None = 0x0, + PicamDynamicsMask_Value = 0x1, + PicamDynamicsMask_ValueAccess = 0x2, + PicamDynamicsMask_IsRelevant = 0x4, + PicamDynamicsMask_Constraint = 0x8 +} PicamDynamicsMask; /* (0x10) */ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_GetParameterDynamics( + PicamHandle camera_or_accessory, + PicamParameter parameter, + PicamDynamicsMask* dynamics ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_GetParameterExtrinsicDynamics( + PicamHandle camera_or_accessory, + PicamParameter parameter, + PicamDynamicsMask* extrinsic ); +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Constraints - Collection -----------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_GetParameterCollectionConstraints( + PicamHandle camera_or_accessory, + PicamParameter parameter, + const PicamCollectionConstraint** constraint_array, + piint* constraint_count ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +typedef PicamError (PIL_CALL*PicamDependentCollectionConstraintChangedCallback)( + PicamHandle camera_or_accessory, + PicamParameter parameter, + const PicamCollectionConstraint* constraint ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_RegisterForDependentCollectionConstraintChanged( + PicamHandle camera_or_accessory, + PicamParameter parameter, + PicamDependentCollectionConstraintChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_UnregisterForDependentCollectionConstraintChanged( + PicamHandle camera_or_accessory, + PicamParameter parameter, + PicamDependentCollectionConstraintChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +/* Camera/Accessory Parameter Constraints - Range ----------------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_GetParameterRangeConstraints( + PicamHandle camera_or_accessory, + PicamParameter parameter, + const PicamRangeConstraint** constraint_array, + piint* constraint_count ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +typedef PicamError (PIL_CALL*PicamDependentRangeConstraintChangedCallback)( + PicamHandle camera_or_accessory, + PicamParameter parameter, + const PicamRangeConstraint* constraint ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_RegisterForDependentRangeConstraintChanged( + PicamHandle camera_or_accessory, + PicamParameter parameter, + PicamDependentRangeConstraintChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_UnregisterForDependentRangeConstraintChanged( + PicamHandle camera_or_accessory, + PicamParameter parameter, + PicamDependentRangeConstraintChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +/* Camera Parameter Constraints - Regions of Interest ------------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_GetParameterRoisConstraints( + PicamHandle camera, + PicamParameter parameter, + const PicamRoisConstraint** constraint_array, + piint* constraint_count ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +typedef PicamError (PIL_CALL* PicamDependentRoisConstraintChangedCallback)( + PicamHandle camera, + PicamParameter parameter, + const PicamRoisConstraint* constraint ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_RegisterForDependentRoisConstraintChanged( + PicamHandle camera, + PicamParameter parameter, + PicamDependentRoisConstraintChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_UnregisterForDependentRoisConstraintChanged( + PicamHandle camera, + PicamParameter parameter, + PicamDependentRoisConstraintChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +/* Camera Parameter Constraints - Pulse --------------------------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_GetParameterPulseConstraints( + PicamHandle camera, + PicamParameter parameter, + const PicamPulseConstraint** constraint_array, + piint* constraint_count ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +typedef PicamError (PIL_CALL* PicamDependentPulseConstraintChangedCallback)( + PicamHandle camera, + PicamParameter parameter, + const PicamPulseConstraint* constraint ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_RegisterForDependentPulseConstraintChanged( + PicamHandle camera, + PicamParameter parameter, + PicamDependentPulseConstraintChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_UnregisterForDependentPulseConstraintChanged( + PicamHandle camera, + PicamParameter parameter, + PicamDependentPulseConstraintChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +/* Camera Parameter Constraints - Custom Intensifier Modulation Sequence -----*/ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_GetParameterModulationsConstraints( + PicamHandle camera, + PicamParameter parameter, + const PicamModulationsConstraint** constraint_array, + piint* constraint_count ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +typedef PicamError (PIL_CALL* PicamDependentModulationsConstraintChangedCallback)( + PicamHandle camera, + PicamParameter parameter, + const PicamModulationsConstraint* constraint ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_RegisterForDependentModulationsConstraintChanged( + PicamHandle camera, + PicamParameter parameter, + PicamDependentModulationsConstraintChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_UnregisterForDependentModulationsConstraintChanged( + PicamHandle camera, + PicamParameter parameter, + PicamDependentModulationsConstraintChangedCallback changed ); +/*----------------------------------------------------------------------------*/ +/* Camera Commitment ---------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ +/* Camera Parameter Validation -----------------------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef struct PicamValidationResult +{ + pibln is_valid; + const PicamParameter* failed_parameter; + const PicamConstraintScope* failed_error_constraint_scope; + const PicamConstraintScope* failed_warning_constraint_scope; + const PicamParameter* error_constraining_parameter_array; + piint error_constraining_parameter_count; + const PicamParameter* warning_constraining_parameter_array; + piint warning_constraining_parameter_count; +} PicamValidationResult; +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_DestroyValidationResult( + const PicamValidationResult* result ); +/*----------------------------------------------------------------------------*/ +typedef struct PicamValidationResults +{ + pibln is_valid; + const PicamValidationResult* validation_result_array; + piint validation_result_count; +} PicamValidationResults; +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_DestroyValidationResults( + const PicamValidationResults* results ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_ValidateParameter( + PicamHandle model, + PicamParameter parameter, + const PicamValidationResult** result ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_ValidateParameters( + PicamHandle model, + const PicamValidationResults** results ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +/* Camera Dependent Parameter Validation -------------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef struct PicamFailedDependentParameter +{ + PicamParameter failed_parameter; + const PicamConstraintScope* failed_error_constraint_scope; + const PicamConstraintScope* failed_warning_constraint_scope; +} PicamFailedDependentParameter; +/*----------------------------------------------------------------------------*/ +typedef struct PicamDependentValidationResult +{ + pibln is_valid; + PicamParameter constraining_parameter; + const PicamFailedDependentParameter* failed_dependent_parameter_array; + piint failed_dependent_parameter_count; +} PicamDependentValidationResult; +/*----------------------------------------------------------------------------*/ +PICAM_API Picam_DestroyDependentValidationResult( + const PicamDependentValidationResult* result ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_ValidateDependentParameter( + PicamHandle model, + PicamParameter parameter, + const PicamDependentValidationResult** result ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +/* Camera Parameter Commitment -----------------------------------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_CommitParametersToCameraDevice( PicamHandle model ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_RefreshParameterFromCameraDevice( + PicamHandle model, + PicamParameter parameter ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_RefreshParametersFromCameraDevice( + PicamHandle model ); +/*----------------------------------------------------------------------------*/ + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/* Camera Data Acquisition */ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ + +/*----------------------------------------------------------------------------*/ +/* Camera Acquisition Setup - Buffer -----------------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef struct PicamAcquisitionBuffer +{ + void* memory; + pi64s memory_size; +} PicamAcquisitionBuffer; +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_GetAcquisitionBuffer( + PicamHandle device, + PicamAcquisitionBuffer* buffer ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_SetAcquisitionBuffer( + PicamHandle device, + const PicamAcquisitionBuffer* buffer ); +/*----------------------------------------------------------------------------*/ +/* Camera Notification -------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ +/* Camera Notification - Acquisition -----------------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef PicamError (PIL_CALL* PicamAcquisitionUpdatedCallback)( + PicamHandle device, + const PicamAvailableData* available, + const PicamAcquisitionStatus* status ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_RegisterForAcquisitionUpdated( + PicamHandle device, + PicamAcquisitionUpdatedCallback updated ); /* ASYNC */ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_UnregisterForAcquisitionUpdated( + PicamHandle device, + PicamAcquisitionUpdatedCallback updated ); /* ASYNC */ +/*----------------------------------------------------------------------------*/ +/* Camera Notification - Acquisition States ----------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef enum PicamAcquisitionState +{ + PicamAcquisitionState_ReadoutStarted = 1, + PicamAcquisitionState_ReadoutEnded = 2 +} PicamAcquisitionState; /* (3) */ +/*----------------------------------------------------------------------------*/ +typedef enum PicamAcquisitionStateErrorsMask +{ + PicamAcquisitionStateErrorsMask_None = 0x0, + PicamAcquisitionStateErrorsMask_LostCount = 0x1 +} PicamAcquisitionStateErrorsMask; /* (0x2) */ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_CanRegisterForAcquisitionStateUpdated( + PicamHandle device, + PicamAcquisitionState state, + pibln* detectable ); +/*----------------------------------------------------------------------------*/ +typedef struct PicamAcquisitionStateCounters +{ + pi64s readout_started_count; + pi64s readout_ended_count; +} PicamAcquisitionStateCounters; +/*----------------------------------------------------------------------------*/ +typedef PicamError (PIL_CALL* PicamAcquisitionStateUpdatedCallback)( + PicamHandle device, + PicamAcquisitionState current, + const PicamAcquisitionStateCounters* counters, + PicamAcquisitionStateErrorsMask errors ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_RegisterForAcquisitionStateUpdated( + PicamHandle device, + PicamAcquisitionState state, + PicamAcquisitionStateUpdatedCallback updated ); /* ASYNC */ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_UnregisterForAcquisitionStateUpdated( + PicamHandle device, + PicamAcquisitionState state, + PicamAcquisitionStateUpdatedCallback updated ); /* ASYNC */ +/*----------------------------------------------------------------------------*/ +/* Camera Acquisition Control ------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_HasAcquisitionBufferOverrun( + PicamHandle device, + pibln* overran ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_CanClearReadoutCountOnline( + PicamHandle device, + pibln* clearable ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamAdvanced_ClearReadoutCountOnline( + PicamHandle device, + pibln* cleared ); +/*----------------------------------------------------------------------------*/ + +/******************************************************************************/ +/* C++ Epilogue */ +/******************************************************************************/ +#if defined __cplusplus && !defined PICAM_EXPORTS + } /* end extern "C" */ +#endif + +#endif diff --git a/PICamSupport/picam_em_calibration.h b/PICamSupport/picam_em_calibration.h index a0e6e6e..45d2c81 100644 --- a/PICamSupport/picam_em_calibration.h +++ b/PICamSupport/picam_em_calibration.h @@ -1,125 +1,125 @@ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/* picam_em_calibration.h - Princeton Instruments EM Calibration API */ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -#if !defined PICAM_EM_CALIBRATION_H -#define PICAM_EM_CALIBRATION_H - -#include "picam.h" - -/******************************************************************************/ -/* C++ Prologue */ -/******************************************************************************/ -#if defined __cplusplus && !defined PICAM_EXPORTS - extern "C" - { -#endif - -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/* EM Calibration Access */ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ - -/*----------------------------------------------------------------------------*/ -PICAM_API PicamEMCalibration_OpenCalibration( - const PicamCameraID* id, - PicamHandle* calibration ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamEMCalibration_CloseCalibration( PicamHandle calibration ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamEMCalibration_GetOpenCalibrations( - const PicamHandle** calibrations_array, - piint* calibrations_count ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ -PICAM_API PicamEMCalibration_GetCameraID( - PicamHandle calibration, - PicamCameraID* id ); -/*----------------------------------------------------------------------------*/ - -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/* EM Calibration Parameter Values and Constraints */ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ - -/*----------------------------------------------------------------------------*/ -/* EM Calibration Parameter Values -------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -typedef struct PicamEMCalibrationDate -{ - piint year; - piint month; - piint day; -} PicamEMCalibrationDate; -/*----------------------------------------------------------------------------*/ -PICAM_API PicamEMCalibration_GetCalibrationDate( - PicamHandle calibration, - PicamEMCalibrationDate* value ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamEMCalibration_ReadSensorTemperatureReading( - PicamHandle calibration, - piflt* value ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamEMCalibration_ReadSensorTemperatureStatus( - PicamHandle calibration, - PicamSensorTemperatureStatus* value ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamEMCalibration_GetSensorTemperatureSetPoint( - PicamHandle calibration, - piflt* value ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamEMCalibration_SetSensorTemperatureSetPoint( - PicamHandle calibration, - piflt value ); -/*----------------------------------------------------------------------------*/ -/* EM Calibration Parameter Constraints --------------------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API PicamEMCalibration_GetSensorTemperatureSetPointConstraint( - PicamHandle calibration, - const PicamRangeConstraint** constraint ); /* ALLOCATES */ -/*----------------------------------------------------------------------------*/ - -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/* EM Calibration */ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ - -/*----------------------------------------------------------------------------*/ -typedef pibln (PIL_CALL* PicamEMCalibrationCallback)( - PicamHandle calibration, - piflt progress, - void* user_state ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamEMCalibration_Calibrate( - PicamHandle calibration, - PicamEMCalibrationCallback calllback, - void* user_state ); -/*----------------------------------------------------------------------------*/ - -/******************************************************************************/ -/* C++ Epilogue */ -/******************************************************************************/ -#if defined __cplusplus && !defined PICAM_EXPORTS - } /* end extern "C" */ -#endif - -#endif +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/* picam_em_calibration.h - Teledyne Princeton Instruments EM Calibration API */ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +#if !defined PICAM_EM_CALIBRATION_H +#define PICAM_EM_CALIBRATION_H + +#include "picam.h" + +/******************************************************************************/ +/* C++ Prologue */ +/******************************************************************************/ +#if defined __cplusplus && !defined PICAM_EXPORTS + extern "C" + { +#endif + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/* EM Calibration Access */ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ + +/*----------------------------------------------------------------------------*/ +PICAM_API PicamEMCalibration_OpenCalibration( + const PicamCameraID* id, + PicamHandle* calibration ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamEMCalibration_CloseCalibration( PicamHandle calibration ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamEMCalibration_GetOpenCalibrations( + const PicamHandle** calibrations_array, + piint* calibrations_count ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamEMCalibration_GetCameraID( + PicamHandle calibration, + PicamCameraID* id ); +/*----------------------------------------------------------------------------*/ + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/* EM Calibration Parameter Values and Constraints */ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ + +/*----------------------------------------------------------------------------*/ +/* EM Calibration Parameter Values -------------------------------------------*/ +/*----------------------------------------------------------------------------*/ +typedef struct PicamEMCalibrationDate +{ + piint year; + piint month; + piint day; +} PicamEMCalibrationDate; +/*----------------------------------------------------------------------------*/ +PICAM_API PicamEMCalibration_GetCalibrationDate( + PicamHandle calibration, + PicamEMCalibrationDate* value ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamEMCalibration_ReadSensorTemperatureReading( + PicamHandle calibration, + piflt* value ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamEMCalibration_ReadSensorTemperatureStatus( + PicamHandle calibration, + PicamSensorTemperatureStatus* value ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamEMCalibration_GetSensorTemperatureSetPoint( + PicamHandle calibration, + piflt* value ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamEMCalibration_SetSensorTemperatureSetPoint( + PicamHandle calibration, + piflt value ); +/*----------------------------------------------------------------------------*/ +/* EM Calibration Parameter Constraints --------------------------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamEMCalibration_GetSensorTemperatureSetPointConstraint( + PicamHandle calibration, + const PicamRangeConstraint** constraint ); /* ALLOCATES */ +/*----------------------------------------------------------------------------*/ + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/* EM Calibration */ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ + +/*----------------------------------------------------------------------------*/ +typedef pibln (PIL_CALL* PicamEMCalibrationCallback)( + PicamHandle calibration, + piflt progress, + void* user_state ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamEMCalibration_Calibrate( + PicamHandle calibration, + PicamEMCalibrationCallback calllback, + void* user_state ); +/*----------------------------------------------------------------------------*/ + +/******************************************************************************/ +/* C++ Epilogue */ +/******************************************************************************/ +#if defined __cplusplus && !defined PICAM_EXPORTS + } /* end extern "C" */ +#endif + +#endif diff --git a/PICamSupport/picam_special.h b/PICamSupport/picam_special.h index 3b16b46..a126ad3 100644 --- a/PICamSupport/picam_special.h +++ b/PICamSupport/picam_special.h @@ -1,50 +1,50 @@ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/* picam_special.h - Princeton Instruments Special Functionality API */ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -#if !defined PICAM_SPECIAL_H -#define PICAM_SPECIAL_H - -#include "picam.h" - -/******************************************************************************/ -/* C++ Prologue */ -/******************************************************************************/ -#if defined __cplusplus && !defined PICAM_EXPORTS - extern "C" - { -#endif - -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/* Special Functionality */ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ - -/*----------------------------------------------------------------------------*/ -/* Residual Erasure ----------------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -PICAM_API PicamSpecial_CanEraseResidual( - PicamHandle device, - pibln* erasable ); -/*----------------------------------------------------------------------------*/ -PICAM_API PicamSpecial_EraseResidual( PicamHandle device ); -/*----------------------------------------------------------------------------*/ - -/******************************************************************************/ -/* C++ Epilogue */ -/******************************************************************************/ -#if defined __cplusplus && !defined PICAM_EXPORTS - } /* end extern "C" */ -#endif - -#endif +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/* picam_special.h - Teledyne Princeton Instruments Special Functionality API */ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +#if !defined PICAM_SPECIAL_H +#define PICAM_SPECIAL_H + +#include "picam.h" + +/******************************************************************************/ +/* C++ Prologue */ +/******************************************************************************/ +#if defined __cplusplus && !defined PICAM_EXPORTS + extern "C" + { +#endif + +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/* Special Functionality */ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ + +/*----------------------------------------------------------------------------*/ +/* Residual Erasure ----------------------------------------------------------*/ +/*----------------------------------------------------------------------------*/ +PICAM_API PicamSpecial_CanEraseResidual( + PicamHandle device, + pibln* erasable ); +/*----------------------------------------------------------------------------*/ +PICAM_API PicamSpecial_EraseResidual( PicamHandle device ); +/*----------------------------------------------------------------------------*/ + +/******************************************************************************/ +/* C++ Epilogue */ +/******************************************************************************/ +#if defined __cplusplus && !defined PICAM_EXPORTS + } /* end extern "C" */ +#endif + +#endif diff --git a/PICamSupport/pil_platform.h b/PICamSupport/pil_platform.h index d6afe82..add8ff9 100644 --- a/PICamSupport/pil_platform.h +++ b/PICamSupport/pil_platform.h @@ -1,86 +1,105 @@ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/* pil_platform.h - Princeton Instruments Library Platform Support */ -/* */ -/* Supported Platforms: */ -/* - PIL_WIN64 */ -/* - PIL_LIN64 */ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -/******************************************************************************/ -#if !defined PIL_PLATFORM_H -#define PIL_PLATFORM_H - -/******************************************************************************/ -/* OS Detection */ -/******************************************************************************/ -#if defined _WIN64 -# define PIL_WIN64 -#elif defined __linux__ && defined __x86_64__ -# define PIL_LIN64 -#else -# error PI Library - Platform Not Supported -#endif - -/******************************************************************************/ -/* Basic Native Data Types */ -/******************************************************************************/ -typedef int piint; /* integer native to platform */ -typedef double piflt; /* floating point native to platform */ -typedef int pibln; /* boolean native to platform */ -typedef char pichar; /* character native to platform */ -typedef unsigned char pibyte; /* byte native to platform */ -#if defined __cplusplus - typedef bool pibool; /* C++ boolean native to platform */ -#endif - -/******************************************************************************/ -/* Basic Sized Data Types */ -/******************************************************************************/ -#if defined PIL_WIN64 - typedef signed char pi8s; /* 8-bit signed integer */ - typedef unsigned char pi8u; /* 8-bit unsigned integer */ - typedef short pi16s; /* 16-bit signed integer */ - typedef unsigned short pi16u; /* 16-bit unsigned integer */ - typedef long pi32s; /* 32-bit signed integer */ - typedef unsigned long pi32u; /* 32-bit unsigned integer */ - typedef long long pi64s; /* 64-bit signed integer */ - typedef unsigned long long pi64u; /* 64-bit unsigned integer */ - typedef float pi32f; /* 32-bit floating point */ - typedef double pi64f; /* 64-bit floating point */ -#elif defined PIL_LIN64 - typedef signed char pi8s; /* 8-bit signed integer */ - typedef unsigned char pi8u; /* 8-bit unsigned integer */ - typedef short pi16s; /* 16-bit signed integer */ - typedef unsigned short pi16u; /* 16-bit unsigned integer */ - typedef int pi32s; /* 32-bit signed integer */ - typedef unsigned int pi32u; /* 32-bit unsigned integer */ - typedef long pi64s; /* 64-bit signed integer */ - typedef unsigned long pi64u; /* 64-bit unsigned integer */ - typedef float pi32f; /* 32-bit floating point */ - typedef double pi64f; /* 64-bit floating point */ -#else -# error PI Library - Platform Missing Sized Data Type Definition -#endif - -/******************************************************************************/ -/* Function Declarations */ -/******************************************************************************/ -#if defined PIL_WIN64 -# define PIL_EXPORT_DEF extern "C" -# define PIL_EXPORT __declspec(dllexport) -# define PIL_IMPORT __declspec(dllimport) -# define PIL_CALL __stdcall -#elif defined PIL_LIN64 -# define PIL_EXPORT_DEF extern "C" __attribute__((visibility("default"))) -# define PIL_EXPORT __attribute__((visibility("default"))) -# define PIL_IMPORT -# define PIL_CALL -#else -# error PI Library - Platform Missing Function Declaration Definition -#endif - -#endif +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/* pil_platform.h - Teledyne Princeton Instruments Library Platform Support */ +/* */ +/* Supported Platforms: */ +/* - PIL_WIN64 */ +/* - PIL_WIN32 */ +/* - PIL_LIN64 */ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +/******************************************************************************/ +#if !defined PIL_PLATFORM_H +#define PIL_PLATFORM_H + +/******************************************************************************/ +/* OS Detection */ +/******************************************************************************/ +#if defined _WIN64 +# define PIL_WIN64 +#elif defined _WIN32 +# define PIL_WIN32 +#elif defined __linux__ && defined __x86_64__ +# define PIL_LIN64 +#else +# error PI Library - Platform Not Supported +#endif + +/******************************************************************************/ +/* Basic Native Data Types */ +/******************************************************************************/ +typedef int piint; /* integer native to platform */ +typedef double piflt; /* floating point native to platform */ +typedef int pibln; /* boolean native to platform */ +typedef char pichar; /* character native to platform */ +typedef unsigned char pibyte; /* byte native to platform */ +#if defined __cplusplus + typedef bool pibool; /* C++ boolean native to platform */ +#endif + +/******************************************************************************/ +/* Basic Sized Data Types */ +/******************************************************************************/ +#if defined PIL_WIN64 + typedef signed char pi8s; /* 8-bit signed integer */ + typedef unsigned char pi8u; /* 8-bit unsigned integer */ + typedef short pi16s; /* 16-bit signed integer */ + typedef unsigned short pi16u; /* 16-bit unsigned integer */ + typedef long pi32s; /* 32-bit signed integer */ + typedef unsigned long pi32u; /* 32-bit unsigned integer */ + typedef long long pi64s; /* 64-bit signed integer */ + typedef unsigned long long pi64u; /* 64-bit unsigned integer */ + typedef float pi32f; /* 32-bit floating point */ + typedef double pi64f; /* 64-bit floating point */ +#elif defined PIL_WIN32 + typedef signed char pi8s; /* 8-bit signed integer */ + typedef unsigned char pi8u; /* 8-bit unsigned integer */ + typedef short pi16s; /* 16-bit signed integer */ + typedef unsigned short pi16u; /* 16-bit unsigned integer */ + typedef long pi32s; /* 32-bit signed integer */ + typedef unsigned long pi32u; /* 32-bit unsigned integer */ + typedef long long pi64s; /* 64-bit signed integer */ + typedef unsigned long long pi64u; /* 64-bit unsigned integer */ + typedef float pi32f; /* 32-bit floating point */ + typedef double pi64f; /* 64-bit floating point */ +#elif defined PIL_LIN64 + typedef signed char pi8s; /* 8-bit signed integer */ + typedef unsigned char pi8u; /* 8-bit unsigned integer */ + typedef short pi16s; /* 16-bit signed integer */ + typedef unsigned short pi16u; /* 16-bit unsigned integer */ + typedef int pi32s; /* 32-bit signed integer */ + typedef unsigned int pi32u; /* 32-bit unsigned integer */ + typedef long pi64s; /* 64-bit signed integer */ + typedef unsigned long pi64u; /* 64-bit unsigned integer */ + typedef float pi32f; /* 32-bit floating point */ + typedef double pi64f; /* 64-bit floating point */ +#else +# error PI Library - Platform Missing Sized Data Type Definition +#endif + +/******************************************************************************/ +/* Function Declarations */ +/******************************************************************************/ +#if defined PIL_WIN64 +# define PIL_EXPORT_DEF extern "C" +# define PIL_EXPORT __declspec(dllexport) +# define PIL_IMPORT __declspec(dllimport) +# define PIL_CALL __stdcall +#elif defined PIL_WIN32 +# define PIL_EXPORT_DEF extern "C" +# define PIL_EXPORT __declspec(dllexport) +# define PIL_IMPORT __declspec(dllimport) +# define PIL_CALL __stdcall +#elif defined PIL_LIN64 +# define PIL_EXPORT_DEF extern "C" __attribute__((visibility("default"))) +# define PIL_EXPORT __attribute__((visibility("default"))) +# define PIL_IMPORT +# define PIL_CALL +#else +# error PI Library - Platform Missing Function Declaration Definition +#endif + +#endif diff --git a/README.md b/README.md index cc91994..7daddcf 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,12 @@ An driver for Cameras from Princeton Instruments that support the PICAM library. [PICam](ftp://ftp.princetoninstruments.com/public/Manuals/Princeton%20Instruments/PICam%20User%20Manual.pdf) This driver is based on the PICAM Virtual Camera Library. -It only runs on Microsoft Windows (Vista, 7 & 8) and supports only 64-bit -versions of Windows. Detectors supported by the vendor PICAM driver library include: + +I have built (but not tested) it using Centos 8 x86_64. +This requires the SDK installed, it is available from Princetond FTP site. + +It runs on Microsoft Windows 7 and above, and supports 32- and 64-bit use. +Detectors supported by the vendor PICAM driver library include: * PI-MAX3 * PI-MAX4, PI-MAX4:RF, PI-MAX4:EM * PIoNIR/NIRvana @@ -19,7 +23,7 @@ versions of Windows. Detectors supported by the vendor PICAM driver library incl * PyLoN-IR * Quad-RO -This detector has been tested with a Quad-RO camera and to some degree with the +This detector has been tested with ProEM and Quad-RO cameras and to some degree with the PIXIS Demo camera (soft camera in the library). Most notably missing from the library so far are the Pulse and Modulation Parameters used mostly in the PI-MAX3 & 4 cameras. diff --git a/documentation/PICam Programmers Manual.pdf b/documentation/PICam Programmers Manual.pdf new file mode 100644 index 0000000..ba92dfb Binary files /dev/null and b/documentation/PICam Programmers Manual.pdf differ diff --git a/iocs/PICamIOC/PICamApp/src/Makefile b/iocs/PICamIOC/PICamApp/src/Makefile index 0ea1369..65b29d9 100644 --- a/iocs/PICamIOC/PICamApp/src/Makefile +++ b/iocs/PICamIOC/PICamApp/src/Makefile @@ -5,6 +5,7 @@ include $(TOP)/configure/CONFIG PROD_NAME = PICamApp PROD_IOC_WIN32 += $(PROD_NAME) +PROD_IOC_Linux += $(PROD_NAME) # .dbd will be created from Include.dbd DBD += $(PROD_NAME).dbd @@ -15,7 +16,20 @@ $(PROD_NAME)_SRCS += $(PROD_NAME)_registerRecordDeviceDriver.cpp $(PROD_NAME)Mai # Add locally compiled object code $(PROD_NAME)_LIBS += ADPICam + +ifeq (win32-x86, $(findstring win32-x86, $(T_A))) +$(PROD_NAME)_LIBS += Picam32 +else ifeq (windows-x64, $(findstring windows-x64, $(T_A))) $(PROD_NAME)_LIBS += Picam +else +$(PROD_NAME)_SYS_LIBS += picam piac picc pida pidi +endif + +ifeq (mingw, $(findstring mingw, $(T_A))) + # static build only, multiple definition of pthread_create, pthread_cond_init, etc on Linux. + # I don't know how to fix it. + USR_LDFLAGS += -Wl,-allow-multiple-definition +endif include $(ADCORE)/ADApp/commonDriverMakefile diff --git a/iocs/PICamIOC/configure/RELEASE b/iocs/PICamIOC/configure/RELEASE index 9fa5be8..44e8937 100644 --- a/iocs/PICamIOC/configure/RELEASE +++ b/iocs/PICamIOC/configure/RELEASE @@ -4,6 +4,5 @@ ADPICAM=$(TOP)/../.. --include $(TOP)/../../../configure/RELEASE_PRODS_INCLUDE --include $(TOP)/RELEASE.local --include $(TOP)/configure/RELEASE.local +-include $(ADPICAM)/RELEASE.local +-include $(ADPICAM)/configure/RELEASE.local diff --git a/iocs/PICamIOC/iocBoot/iocPICam/st.cmd b/iocs/PICamIOC/iocBoot/iocPICam/st.cmd index 646dec5..b73b4e1 100644 --- a/iocs/PICamIOC/iocBoot/iocPICam/st.cmd +++ b/iocs/PICamIOC/iocBoot/iocPICam/st.cmd @@ -11,12 +11,19 @@ epicsEnvSet("QSIZE", "20") epicsEnvSet("XSIZE", "2048") epicsEnvSet("YSIZE", "2048") epicsEnvSet("NCHANS", "2048") +# The maximum number of frames buffered in the NDPluginCircularBuff plugin +epicsEnvSet("CBUFFS", "500") + +# The search path for database files +epicsEnvSet("EPICS_DB_INCLUDE_PATH", "$(ADCORE)/db") # Create a PICam driver # PICamConfig(const char *portName, IDType, IDValue, maxBuffers, size_t maxMemory, int priority, int stackSize) -# This is for a -PICamConfig("$(PORT)", 0, 0, 0, 0) +# This will select a live camera. +PICamConfig("$(PORT)", 0, 0, 0, 0, 0) + +# These will select a simulated demo camera. #PICamAddDemoCamera("PIXIS: 100F") #PICamAddDemoCamera("Quad-RO: 4320") #PICamAddDemoCamera("PI-MAX4: 2048B-RF") @@ -30,7 +37,7 @@ dbLoadRecords("$(ADPICAM)/db/PICam.template","P=$(PREFIX),R=cam1:,PORT=$(PORT),A # Create a standard arrays plugin, set it to get data from Driver. NDStdArraysConfigure("Image1", 3, 0, "$(PORT)", 0) dbLoadRecords("$(ADCORE)/db/NDPluginBase.template","P=$(PREFIX),R=image1:,PORT=Image1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT),NDARRAY_ADDR=0") -dbLoadRecords("$(ADCORE)/db/NDStdArrays.template", "P=$(PREFIX),R=image1:,PORT=Image1,ADDR=0,TIMEOUT=1,TYPE=Int16,SIZE=16,FTVL=SHORT,NELEMENTS=20000000") +dbLoadRecords("$(ADCORE)/db/NDStdArrays.template", "P=$(PREFIX),R=image1:,PORT=Image1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT),TYPE=Int16,SIZE=16,FTVL=SHORT,NELEMENTS=20000000") # Load all other plugins using commonPlugins.cmd < $(ADCORE)/iocBoot/commonPlugins.cmd diff --git a/iocs/PICamWithActonIOC/Makefile b/iocs/PICamWithActonIOC/Makefile new file mode 100644 index 0000000..054fcf7 --- /dev/null +++ b/iocs/PICamWithActonIOC/Makefile @@ -0,0 +1,11 @@ +#Makefile at top of application tree + +TOP = . +include $(TOP)/configure/CONFIG +ifdef PRINCETONSPECTRO + DIRS := $(DIRS) $(filter-out $(DIRS), configure) + DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *App)) + DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *app)) + DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard iocBoot)) +endif +include $(TOP)/configure/RULES_TOP diff --git a/iocs/PICamWithActonIOC/PICamWithActonApp/Makefile b/iocs/PICamWithActonIOC/PICamWithActonApp/Makefile new file mode 100644 index 0000000..15fbb64 --- /dev/null +++ b/iocs/PICamWithActonIOC/PICamWithActonApp/Makefile @@ -0,0 +1,9 @@ +TOP = .. +include $(TOP)/configure/CONFIG + +DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *db*)) +DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *Db*)) +DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *src*)) + +include $(TOP)/configure/RULES_DIRS + diff --git a/iocs/PICamWithActonIOC/PICamWithActonApp/PICamWithActonApp.vcxproj b/iocs/PICamWithActonIOC/PICamWithActonApp/PICamWithActonApp.vcxproj new file mode 100644 index 0000000..265348e --- /dev/null +++ b/iocs/PICamWithActonIOC/PICamWithActonApp/PICamWithActonApp.vcxproj @@ -0,0 +1,495 @@ + + + + false + + + + Debug_DLL + Win32 + + + Debug_DLL + x64 + + + Debug_LIB + Win32 + + + Debug_LIB + x64 + + + Release_DLL + Win32 + + + Release_DLL + x64 + + + Release_LIB + Win32 + + + Release_LIB + x64 + + + + + + + + + + + + + + + + + {361bcebd-8b02-4b15-b28b-863f0602cb99} + + + {422a8c73-836c-48cb-86c8-0591e69c0ca1} + + + {9cf8d9ab-e47d-4923-a251-80e40b4e7144} + + + {ce14b4d8-c63f-4ea6-9de4-cace48ea092c} + + + {e9d99fc7-e592-472b-b2e2-c3b0d81d8169} + + + {589ab311-372d-4fa2-a3e3-00d530d8c0a8} + + + {44ecea7e-d805-49b6-8e89-62ec3994c1f3} + + + {20186f2c-f4f9-489b-9936-0091d9c4ad79} + + + {c3ea0ff7-6039-4884-ba91-7b4619befea5} + + + {ec5c161c-4177-49bd-bd1f-2ba6a05f03d4} + + + {98d6b430-c1e3-47d6-aecb-846a7ee2d938} + + + {704a182e-faea-4e59-b5f4-9dc799f4556a} + + + {bc5f994e-1bfe-4c94-bf8d-86077ef84ed7} + + + {77cbc12c-ae16-40ef-a286-a61535f45a99} + + + {98dff6ea-747c-4964-a11f-7abb34b314f4} + + + {a1c1777e-50d2-47dc-91bb-3b328362214a} + + + {39a57a7c-0399-40d5-bf95-2940fc941e4d} + + + {575a12dd-9181-465b-b0e1-c3bf5b3d9171} + + + {c9c70b97-bfaf-412c-887a-5b1e19181433} + + + {a07a2021-121c-4c5c-8aef-49e8006ff4b0} + + + + {9876C3BC-3B42-4ADD-B023-F301BA92D966} + Win32Proj + WithAsyn + Svn + Svn + SubversionScc + Svn + PICamWithActonApp + 10.0.17763.0 + + + + Application + true + v141 + false + + + Application + true + v141 + false + + + Application + true + v141 + false + + + Application + true + v141 + false + + + Application + false + true + v141 + false + + + Application + false + true + v141 + false + + + Application + false + true + v141 + false + + + Application + false + true + v141 + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + false + + + false + + + false + + + false + + + + + + Level3 + Disabled + WIN32;_DEBUG;EPICS_CALL_DLL;EPICS_BUILD_DLL;_CRT_SECURE_NO_WARNINGS + ..\..\ADSupport\supportApp\xml2Src\os\default;$(SolutionDir)include;$(SolutionDir)include\os\win32;$(SolutionDir)include\compiler\msvc + true + 4251;4275 + + + Console + true + + + + + + + + + + + + Level3 + Disabled + WIN32;_DEBUG;EPICS_CALL_DLL;EPICS_BUILD_DLL;_CRT_SECURE_NO_WARNINGS + ..\..\ADSupport\supportApp\xml2Src\os\default;$(SolutionDir)include;$(SolutionDir)include\os\win32;$(SolutionDir)include\compiler\msvc + true + 4251 + + + Console + true + + + + + + + + if not exist O.Common md O.Common +if not exist $(SolutionDir)DBD md $(SolutionDir)DBD +SET PERL5LIB=$(SolutionDir)lib\perl +perl -CSD $(OutDir)dbdExpand.pl -o ../../../PICamApp/O.Common/PICamWithActonApp.dbd -I$(SolutionDir)dbd ..\..\..\..\..\..\iocTops\PrincetonSpectro\ARC_InstrumentApp\src\ARC_InstrumentInclude.dbd ..\..\..\PICamApp\src\PICamSupport.dbd base.dbd ADSupport.dbd NDPluginSupport.dbd NDFileNull.dbd NDFileNetCDF.dbd NDFileTIFF.dbd NDFileJPEG.dbd NDFileNexus.dbd NDFileHDF5.dbd NDFileMagick.dbd asyn.dbd asSupport.dbd busySupport.dbd calcSupport.dbd sscanSupport.dbd +copy ..\..\..\PICamApp\O.Common\PICamWithActonApp.dbd $(SolutionDir)dbd +perl -CSD $(OutDir)registerRecordDeviceDriver.pl -I$(SolutionDir)dbd -o O.Common\PICamWithActonApp_registerRecordDeviceDriver.cpp $(SolutionDir)DBD\PICamWithActonApp.dbd PICamWithActonApp_registerRecordDeviceDriver $(SolutionDir) + + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS + ..\..\ADSupport\supportApp\xml2Src\os\default;$(SolutionDir)include;$(SolutionDir)include\os\win32;$(SolutionDir)include\compiler\msvc + MultiThreadedDebug + true + 4251;4275 + + + Console + true + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib + + + + + + if not exist O.Common md O.Common +if not exist $(SolutionDir)DBD md $(SolutionDir)DBD +SET PERL5LIB=$(SolutionDir)lib\perl +perl -CSD $(OutDir)dbdExpand.pl -o ../../../PICamApp/O.Common/PICamWithActonApp.dbd -I$(SolutionDir)dbd ..\..\..\..\..\..\iocTops\PrincetonSpectro\ARC_InstrumentApp\src\ARC_InstrumentInclude.dbd ..\..\..\PICamApp\src\PICamSupport.dbd base.dbd ADSupport.dbd NDPluginSupport.dbd NDFileNull.dbd NDFileNetCDF.dbd NDFileTIFF.dbd NDFileJPEG.dbd NDFileNexus.dbd NDFileHDF5.dbd NDFileMagick.dbd asyn.dbd asSupport.dbd busySupport.dbd calcSupport.dbd sscanSupport.dbd +copy ..\..\..\PICamApp\O.Common\PICamWithActonApp.dbd $(SolutionDir)dbd +perl -CSD $(OutDir)registerRecordDeviceDriver.pl -I$(SolutionDir)dbd -o O.Common\PICamWithActonApp_registerRecordDeviceDriver.cpp $(SolutionDir)DBD\PICamWithActonApp.dbd PICamWithActonApp_registerRecordDeviceDriver $(SolutionDir) + + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS + ..\..\ADSupport\supportApp\xml2Src\os\default;$(SolutionDir)include;$(SolutionDir)include\os\win32;$(SolutionDir)include\compiler\msvc + MultiThreadedDebug + true + + + Console + true + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib + + + + + + if not exist O.Common md O.Common +if not exist $(SolutionDir)DBD md $(SolutionDir)DBD +SET PERL5LIB=$(SolutionDir)lib\perl +perl -CSD $(OutDir)dbdExpand.pl -o ../../../PICamApp/O.Common/PICamWithActonApp.dbd -I$(SolutionDir)dbd ..\..\..\..\..\..\iocTops\PrincetonSpectro\ARC_InstrumentApp\src\ARC_InstrumentInclude.dbd ..\..\..\PICamApp\src\PICamSupport.dbd base.dbd ADSupport.dbd NDPluginSupport.dbd NDFileNull.dbd NDFileNetCDF.dbd NDFileTIFF.dbd NDFileJPEG.dbd NDFileNexus.dbd NDFileHDF5.dbd NDFileMagick.dbd asyn.dbd asSupport.dbd busySupport.dbd calcSupport.dbd sscanSupport.dbd +copy ..\..\..\PICamApp\O.Common\PICamWithActonApp.dbd $(SolutionDir)dbd +perl -CSD $(OutDir)registerRecordDeviceDriver.pl -I$(SolutionDir)dbd -o O.Common\PICamWithActonApp_registerRecordDeviceDriver.cpp $(SolutionDir)DBD\PICamWithActonApp.dbd PICamWithActonApp_registerRecordDeviceDriver $(SolutionDir) + + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;EPICS_CALL_DLL;EPICS_BUILD_DLL;_CRT_SECURE_NO_WARNINGS + ..\..\ADSupport\supportApp\xml2Src\os\default;$(SolutionDir)include;$(SolutionDir)include\os\win32;$(SolutionDir)include\compiler\msvc + true + 4251;4275 + + + Console + true + true + true + + + + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;EPICS_CALL_DLL;EPICS_BUILD_DLL;_CRT_SECURE_NO_WARNINGS + ..\..\ADSupport\supportApp\xml2Src\os\default;$(SolutionDir)include;$(SolutionDir)include\os\win32;$(SolutionDir)include\compiler\msvc + true + 4251 + + + Console + true + true + true + + + + + + if not exist O.Common md O.Common +if not exist $(SolutionDir)DBD md $(SolutionDir)DBD +SET PERL5LIB=$(SolutionDir)lib\perl +perl -CSD $(OutDir)dbdExpand.pl -o ../../../PICamApp/O.Common/PICamWithActonApp.dbd -I$(SolutionDir)dbd ..\..\..\..\..\..\iocTops\PrincetonSpectro\ARC_InstrumentApp\src\ARC_InstrumentInclude.dbd ..\..\..\PICamApp\src\PICamSupport.dbd base.dbd ADSupport.dbd NDPluginSupport.dbd NDFileNull.dbd NDFileNetCDF.dbd NDFileTIFF.dbd NDFileJPEG.dbd NDFileNexus.dbd NDFileHDF5.dbd NDFileMagick.dbd asyn.dbd asSupport.dbd busySupport.dbd calcSupport.dbd sscanSupport.dbd +copy ..\..\..\PICamApp\O.Common\PICamWithActonApp.dbd $(SolutionDir)dbd +perl -CSD $(OutDir)registerRecordDeviceDriver.pl -I$(SolutionDir)dbd -o O.Common\PICamWithActonApp_registerRecordDeviceDriver.cpp $(SolutionDir)DBD\PICamWithActonApp.dbd PICamWithActonApp_registerRecordDeviceDriver $(SolutionDir) + + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS + ..\..\ADSupport\supportApp\xml2Src\os\default;$(SolutionDir)include;$(SolutionDir)include\os\win32;$(SolutionDir)include\compiler\msvc + MultiThreaded + true + 4251;4275 + + + Console + true + true + true + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib + + + + + + if not exist O.Common md O.Common +if not exist $(SolutionDir)DBD md $(SolutionDir)DBD +SET PERL5LIB=$(SolutionDir)lib\perl +perl -CSD $(OutDir)dbdExpand.pl -o ../../../PICamApp/O.Common/PICamWithActonApp.dbd -I$(SolutionDir)dbd ..\..\..\..\..\..\iocTops\PrincetonSpectro\ARC_InstrumentApp\src\ARC_InstrumentInclude.dbd ..\..\..\PICamApp\src\PICamSupport.dbd base.dbd ADSupport.dbd NDPluginSupport.dbd NDFileNull.dbd NDFileNetCDF.dbd NDFileTIFF.dbd NDFileJPEG.dbd NDFileNexus.dbd NDFileHDF5.dbd NDFileMagick.dbd asyn.dbd asSupport.dbd busySupport.dbd calcSupport.dbd sscanSupport.dbd +copy ..\..\..\PICamApp\O.Common\PICamWithActonApp.dbd $(SolutionDir)dbd +perl -CSD $(OutDir)registerRecordDeviceDriver.pl -I$(SolutionDir)dbd -o O.Common\PICamWithActonApp_registerRecordDeviceDriver.cpp $(SolutionDir)DBD\PICamWithActonApp.dbd PICamWithActonApp_registerRecordDeviceDriver $(SolutionDir) + + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS + ..\..\ADSupport\supportApp\xml2Src\os\default;$(SolutionDir)include;$(SolutionDir)include\os\win32;$(SolutionDir)include\compiler\msvc + MultiThreaded + true + + + Console + true + true + true + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib + + + + + + if not exist O.Common md O.Common +if not exist $(SolutionDir)DBD md $(SolutionDir)DBD +SET PERL5LIB=$(SolutionDir)lib\perl +perl -CSD $(OutDir)dbdExpand.pl -o ../../../PICamApp/O.Common/PICamWithActonApp.dbd -I$(SolutionDir)dbd ..\..\..\..\..\..\iocTops\PrincetonSpectro\ARC_InstrumentApp\src\ARC_InstrumentInclude.dbd ..\..\..\PICamApp\src\PICamSupport.dbd base.dbd ADSupport.dbd NDPluginSupport.dbd NDFileNull.dbd NDFileNetCDF.dbd NDFileTIFF.dbd NDFileJPEG.dbd NDFileNexus.dbd NDFileHDF5.dbd NDFileMagick.dbd asyn.dbd asSupport.dbd busySupport.dbd calcSupport.dbd sscanSupport.dbd +copy ..\..\..\PICamApp\O.Common\PICamWithActonApp.dbd $(SolutionDir)dbd +perl -CSD $(OutDir)registerRecordDeviceDriver.pl -I$(SolutionDir)dbd -o O.Common\PICamWithActonApp_registerRecordDeviceDriver.cpp $(SolutionDir)DBD\PICamWithActonApp.dbd PICamWithActonApp_registerRecordDeviceDriver $(SolutionDir) + + + + + + WIN32;NDEBUG;EPICS_CALL_DLL;EPICS_BUILD_DLL;_CRT_SECURE_NO_WARNINGS + $(SolutionDir)include;$(SolutionDir)include\os\win32;$(SolutionDir)include\compiler\msvc + + + if not exist O.Common md O.Common +if not exist $(SolutionDir)DBD md $(SolutionDir)DBD +SET PERL5LIB=$(SolutionDir)lib\perl +perl -CSD $(OutDir)dbdExpand.pl -o ../../../PICamApp/O.Common/PICamWithActonApp.dbd -I$(SolutionDir)dbd ..\..\..\..\..\..\iocTops\PrincetonSpectro\ARC_InstrumentApp\src\ARC_InstrumentInclude.dbd ..\..\..\PICamApp\src\PICamSupport.dbd base.dbd ADSupport.dbd NDPluginSupport.dbd NDFileNull.dbd NDFileNetCDF.dbd NDFileTIFF.dbd NDFileJPEG.dbd NDFileNexus.dbd NDFileHDF5.dbd NDFileMagick.dbd asyn.dbd asSupport.dbd busySupport.dbd calcSupport.dbd sscanSupport.dbd +copy ..\..\..\PICamApp\O.Common\PICamWithActonApp.dbd $(SolutionDir)dbd +perl -CSD $(OutDir)registerRecordDeviceDriver.pl -I$(SolutionDir)dbd -o O.Common\PICamWithActonApp_registerRecordDeviceDriver.cpp $(SolutionDir)DBD\PICamWithActonApp.dbd PICamWithActonApp_registerRecordDeviceDriver $(SolutionDir) + + + + + + WIN32;_DEBUG;EPICS_CALL_DLL;EPICS_BUILD_DLL;_CRT_SECURE_NO_WARNINGS + $(SolutionDir)include;$(SolutionDir)include\os\win32;$(SolutionDir)include\compiler\msvc + + + if not exist O.Common md O.Common +if not exist $(SolutionDir)DBD md $(SolutionDir)DBD +SET PERL5LIB=$(SolutionDir)lib\perl +perl -CSD $(OutDir)dbdExpand.pl -o ../../../PICamApp/O.Common/PICamWithActonApp.dbd -I$(SolutionDir)dbd ..\..\..\..\..\..\iocTops\PrincetonSpectro\ARC_InstrumentApp\src\ARC_InstrumentInclude.dbd ..\..\..\PICamApp\src\PICamSupport.dbd base.dbd ADSupport.dbd NDPluginSupport.dbd NDFileNull.dbd NDFileNetCDF.dbd NDFileTIFF.dbd NDFileJPEG.dbd NDFileNexus.dbd NDFileHDF5.dbd NDFileMagick.dbd asyn.dbd asSupport.dbd busySupport.dbd calcSupport.dbd sscanSupport.dbd +copy ..\..\..\PICamApp\O.Common\PICamWithActonApp.dbd $(SolutionDir)dbd +perl -CSD $(OutDir)registerRecordDeviceDriver.pl -I$(SolutionDir)dbd -o O.Common\PICamWithActonApp_registerRecordDeviceDriver.cpp $(SolutionDir)DBD\PICamWithActonApp.dbd PICamWithActonApp_registerRecordDeviceDriver $(SolutionDir) + + + + + + + \ No newline at end of file diff --git a/iocs/PICamWithActonIOC/PICamWithActonApp/PICamWithActonApp.vcxproj.user b/iocs/PICamWithActonIOC/PICamWithActonApp/PICamWithActonApp.vcxproj.user new file mode 100644 index 0000000..0d29274 --- /dev/null +++ b/iocs/PICamWithActonIOC/PICamWithActonApp/PICamWithActonApp.vcxproj.user @@ -0,0 +1,91 @@ + + + + ..\iocBoot\iocPICamWithActon\ + WindowsLocalDebugger + st.cmd > PICamWithActonApp.log 2>&1 + TOP=../../../.. +ADCORE=/EPICS/support/areaDetector/ADCore +ADPICAM=/EPICS/support/areaDetector/ADPICam +AUTOSAVE=/EPICS/support/autosave +CALC=/EPICS/support/calc +PATH=%PATH%;\EPICS\iocTops\PrincetonSpectro\ARC_InstrumentApp\Acton + + + ..\iocBoot\iocPICamWithActon\ + WindowsLocalDebugger + st.cmd > PICamWithActonApp.log 2>&1 + TOP=../../../.. +ADCORE=/EPICS/support/areaDetector/ADCore +ADPICAM=/EPICS/support/areaDetector/ADPICam +AUTOSAVE=/EPICS/support/autosave +CALC=/EPICS/support/calc +PATH=%PATH%;\EPICS\iocTops\PrincetonSpectro\ARC_InstrumentApp\Acton + + + ..\iocBoot\iocPICamWithActon\ + WindowsLocalDebugger + st.cmd > PICamWithActonApp.log 2>&1 + TOP=../../../.. +ADCORE=/EPICS/support/areaDetector/ADCore +ADPICAM=/EPICS/support/areaDetector/ADPICam +AUTOSAVE=/EPICS/support/autosave +CALC=/EPICS/support/calc +PATH=%PATH%;\EPICS\iocTops\PrincetonSpectro\ARC_InstrumentApp\Acton + + + ..\iocBoot\iocPICamWithActon\ + WindowsLocalDebugger + st.cmd > PICamWithActonApp.log 2>&1 + TOP=../../../.. +ADCORE=/EPICS/support/areaDetector/ADCore +ADPICAM=/EPICS/support/areaDetector/ADPICam +AUTOSAVE=/EPICS/support/autosave +CALC=/EPICS/support/calc +PATH=%PATH%;\EPICS\iocTops\PrincetonSpectro\ARC_InstrumentApp\Acton + + + ..\iocBoot\iocPICamWithActon\ + WindowsLocalDebugger + st.cmd > PICamWithActonApp.log 2>&1 + TOP=../../../.. +ADCORE=/EPICS/support/areaDetector/ADCore +ADPICAM=/EPICS/support/areaDetector/ADPICam +AUTOSAVE=/EPICS/support/autosave +CALC=/EPICS/support/calc +PATH=%PATH%;\EPICS\iocTops\PrincetonSpectro\ARC_InstrumentApp\Acton + + + ..\iocBoot\iocPICamWithActon\ + WindowsLocalDebugger + st.cmd > PICamWithActonApp.log 2>&1 + TOP=../../../.. +ADCORE=/EPICS/support/areaDetector/ADCore +ADPICAM=/EPICS/support/areaDetector/ADPICam +AUTOSAVE=/EPICS/support/autosave +CALC=/EPICS/support/calc +PATH=%PATH%;\EPICS\iocTops\PrincetonSpectro\ARC_InstrumentApp\Acton + + + ..\iocBoot\iocPICamWithActon\ + WindowsLocalDebugger + st.cmd > PICamWithActonApp.log 2>&1 + TOP=../../../.. +ADCORE=/EPICS/support/areaDetector/ADCore +ADPICAM=/EPICS/support/areaDetector/ADPICam +AUTOSAVE=/EPICS/support/autosave +CALC=/EPICS/support/calc +PATH=%PATH%;\EPICS\iocTops\PrincetonSpectro\ARC_InstrumentApp\Acton + + + ..\iocBoot\iocPICamWithActon\ + WindowsLocalDebugger + st.cmd > PICamWithActonApp.log 2>&1 + TOP=../../../.. +ADCORE=/EPICS/support/areaDetector/ADCore +ADPICAM=/EPICS/support/areaDetector/ADPICam +AUTOSAVE=/EPICS/support/autosave +CALC=/EPICS/support/calc +PATH=%PATH%;\EPICS\iocTops\PrincetonSpectro\ARC_InstrumentApp\Acton + + \ No newline at end of file diff --git a/iocs/PICamWithActonIOC/PICamWithActonApp/src/Makefile b/iocs/PICamWithActonIOC/PICamWithActonApp/src/Makefile new file mode 100644 index 0000000..0171eaf --- /dev/null +++ b/iocs/PICamWithActonIOC/PICamWithActonApp/src/Makefile @@ -0,0 +1,43 @@ +TOP=../.. +include $(TOP)/configure/CONFIG +#---------------------------------------- +# ADD MACRO DEFINITIONS AFTER THIS LINE + +PROD_NAME = PICamWithActonApp +PROD_IOC_WIN32 += $(PROD_NAME) + +# .dbd will be created from Include.dbd +DBD += $(PROD_NAME).dbd +$(PROD_NAME)_DBD += PICamSupport.dbd +$(PROD_NAME)_DBD_WIN32 += ARC_Instrument.dbd + +SRC_DIRS += $(PRINCETONSPECTRO) + +# _registerRecordDeviceDriver.cpp will be created from .dbd +$(PROD_NAME)_SRCS += $(PROD_NAME)_registerRecordDeviceDriver.cpp $(PROD_NAME)Main.cpp + +# Add locally compiled object code +$(PROD_NAME)_LIBS += ADPICam + +ifeq (windows-x64, $(findstring windows-x64, $(T_A))) +$(PROD_NAME)_LIBS += Picam +$(PROD_NAME)_LIBS += ARC_InstrumentDev +else ifeq (win32-x86, $(findstring win32-x86, $(T_A))) +$(PROD_NAME)_LIBS += Picam32 + +endif + +ifeq (mingw, $(findstring mingw, $(T_A))) + # static build only, multiple definition of pthread_create, pthread_cond_init, etc on Linux. + # I don't know how to fix it. + USR_LDFLAGS += -Wl,-allow-multiple-definition +endif + +include $(ADCORE)/ADApp/commonDriverMakefile + +#============================= + +include $(TOP)/configure/RULES +#---------------------------------------- +# ADD RULES AFTER THIS LINE + diff --git a/iocs/PICamWithActonIOC/PICamWithActonApp/src/PICamWithActonAppMain.cpp b/iocs/PICamWithActonIOC/PICamWithActonApp/src/PICamWithActonAppMain.cpp new file mode 100644 index 0000000..5dd4c0a --- /dev/null +++ b/iocs/PICamWithActonIOC/PICamWithActonApp/src/PICamWithActonAppMain.cpp @@ -0,0 +1,23 @@ +/* exampleMain.cpp */ +/* Author: Marty Kraimer Date: 17MAR2000 */ + +#include +#include +#include +#include +#include + +#include "epicsExit.h" +#include "epicsThread.h" +#include "iocsh.h" + +int main(int argc,char *argv[]) +{ + if(argc>=2) { + iocsh(argv[1]); + epicsThreadSleep(.2); + } + iocsh(NULL); + epicsExit(0); + return(0); +} diff --git a/iocs/PICamWithActonIOC/configure/CONFIG b/iocs/PICamWithActonIOC/configure/CONFIG new file mode 100644 index 0000000..c1a4703 --- /dev/null +++ b/iocs/PICamWithActonIOC/configure/CONFIG @@ -0,0 +1,29 @@ +# CONFIG - Load build configuration data +# +# Do not make changes to this file! + +# Allow user to override where the build rules come from +RULES = $(EPICS_BASE) + +# RELEASE files point to other application tops +include $(TOP)/configure/RELEASE +-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).Common +ifdef T_A +-include $(TOP)/configure/RELEASE.Common.$(T_A) +-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).$(T_A) +endif + +CONFIG = $(RULES)/configure +include $(CONFIG)/CONFIG + +# Override the Base definition: +INSTALL_LOCATION = $(TOP) + +# CONFIG_SITE files contain other build configuration settings +include $(TOP)/configure/CONFIG_SITE +-include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).Common +ifdef T_A + -include $(TOP)/configure/CONFIG_SITE.Common.$(T_A) + -include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A) +endif + diff --git a/iocs/PICamWithActonIOC/configure/CONFIG_SITE b/iocs/PICamWithActonIOC/configure/CONFIG_SITE new file mode 100644 index 0000000..4df968f --- /dev/null +++ b/iocs/PICamWithActonIOC/configure/CONFIG_SITE @@ -0,0 +1,42 @@ +# CONFIG_SITE + +# Make any application-specific changes to the EPICS build +# configuration variables in this file. +# +# Host/target specific settings can be specified in files named +# CONFIG_SITE.$(EPICS_HOST_ARCH).Common +# CONFIG_SITE.Common.$(T_A) +# CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A) + +# CHECK_RELEASE controls the consistency checking of the support +# applications pointed to by the RELEASE* files. +# Normally CHECK_RELEASE should be set to YES. +# Set CHECK_RELEASE to NO to disable checking completely. +# Set CHECK_RELEASE to WARN to perform consistency checking but +# continue building anyway if conflicts are found. +CHECK_RELEASE = YES + +# Set this when you only want to compile this application +# for a subset of the cross-compiled target architectures +# that Base is built for. +#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040 + +# To install files into a location other than $(TOP) define +# INSTALL_LOCATION here. +#INSTALL_LOCATION= + +# Set this when your IOC and the host use different paths +# to access the application. This will be needed to boot +# from a Microsoft FTP server or with some NFS mounts. +# You must rebuild in the iocBoot directory for this to +# take effect. +#IOCS_APPL_TOP = + +# Get settings from AREA_DETECTOR, so we only have to configure once for all detectors if we want to +-include $(AREA_DETECTOR)/configure/CONFIG_SITE +-include $(AREA_DETECTOR)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH) +-include $(AREA_DETECTOR)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).Common +ifdef T_A + -include $(AREA_DETECTOR)/configure/CONFIG_SITE.Common.$(T_A) + -include $(AREA_DETECTOR)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A) +endif diff --git a/iocs/PICamWithActonIOC/configure/CONFIG_SITE.Common.linux-x86 b/iocs/PICamWithActonIOC/configure/CONFIG_SITE.Common.linux-x86 new file mode 100644 index 0000000..03934db --- /dev/null +++ b/iocs/PICamWithActonIOC/configure/CONFIG_SITE.Common.linux-x86 @@ -0,0 +1,7 @@ +# There is a problem when building dynamically on our linux-x86 system, due to functions called in PvAPI.a. + +# These can be fixed either by building statically with this line: +#STATIC_BUILD=YES +# Or by building dynamically with this line: +PROD_SYS_LIBS += pthread rt + diff --git a/iocs/PICamWithActonIOC/configure/Makefile b/iocs/PICamWithActonIOC/configure/Makefile new file mode 100644 index 0000000..9254309 --- /dev/null +++ b/iocs/PICamWithActonIOC/configure/Makefile @@ -0,0 +1,8 @@ +TOP=.. + +include $(TOP)/configure/CONFIG + +TARGETS = $(CONFIG_TARGETS) +CONFIGS += $(subst ../,,$(wildcard $(CONFIG_INSTALLS))) + +include $(TOP)/configure/RULES diff --git a/iocs/PICamWithActonIOC/configure/RELEASE b/iocs/PICamWithActonIOC/configure/RELEASE new file mode 100644 index 0000000..44e8937 --- /dev/null +++ b/iocs/PICamWithActonIOC/configure/RELEASE @@ -0,0 +1,8 @@ +#RELEASE Location of external products +# Run "gnumake clean uninstall install" in the application +# top directory each time this file is changed. + +ADPICAM=$(TOP)/../.. + +-include $(ADPICAM)/RELEASE.local +-include $(ADPICAM)/configure/RELEASE.local diff --git a/iocs/PICamWithActonIOC/configure/RULES b/iocs/PICamWithActonIOC/configure/RULES new file mode 100644 index 0000000..6d56e14 --- /dev/null +++ b/iocs/PICamWithActonIOC/configure/RULES @@ -0,0 +1,6 @@ +# RULES + +include $(CONFIG)/RULES + +# Library should be rebuilt because LIBOBJS may have changed. +$(LIBNAME): ../Makefile diff --git a/iocs/PICamWithActonIOC/configure/RULES.ioc b/iocs/PICamWithActonIOC/configure/RULES.ioc new file mode 100644 index 0000000..901987c --- /dev/null +++ b/iocs/PICamWithActonIOC/configure/RULES.ioc @@ -0,0 +1,2 @@ +#RULES.ioc +include $(CONFIG)/RULES.ioc diff --git a/iocs/PICamWithActonIOC/configure/RULES_DIRS b/iocs/PICamWithActonIOC/configure/RULES_DIRS new file mode 100644 index 0000000..3ba269d --- /dev/null +++ b/iocs/PICamWithActonIOC/configure/RULES_DIRS @@ -0,0 +1,2 @@ +#RULES_DIRS +include $(CONFIG)/RULES_DIRS diff --git a/iocs/PICamWithActonIOC/configure/RULES_TOP b/iocs/PICamWithActonIOC/configure/RULES_TOP new file mode 100644 index 0000000..d09d668 --- /dev/null +++ b/iocs/PICamWithActonIOC/configure/RULES_TOP @@ -0,0 +1,3 @@ +#RULES_TOP +include $(CONFIG)/RULES_TOP + diff --git a/iocs/PICamWithActonIOC/iocBoot/Makefile b/iocs/PICamWithActonIOC/iocBoot/Makefile new file mode 100644 index 0000000..d097ef0 --- /dev/null +++ b/iocs/PICamWithActonIOC/iocBoot/Makefile @@ -0,0 +1,6 @@ +TOP = .. +include $(TOP)/configure/CONFIG +DIRS += $(wildcard *ioc*) +DIRS += $(wildcard as*) +include $(EPICS_BASE)/configure/RULES_DIRS + diff --git a/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/Makefile b/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/Makefile new file mode 100644 index 0000000..c32eca0 --- /dev/null +++ b/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/Makefile @@ -0,0 +1,9 @@ +TOP = ../.. +include $(TOP)/configure/CONFIG +#ARCH = win32-x86 +#ARCH = win32-x86-debug +#ARCH = windows-x64 +ARCH = windows-x64-debug +#ARCH = linux-x86 +TARGETS = envPaths +include $(TOP)/configure/RULES.ioc diff --git a/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/auto_settings.req b/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/auto_settings.req new file mode 100644 index 0000000..5d4d426 --- /dev/null +++ b/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/auto_settings.req @@ -0,0 +1,3 @@ +file "PICam_settings.req", P=$(P), R=cam1: +file "NDStdArrays_settings.req", P=$(P), R=image1: +file "commonPlugin_settings.req", P=$(P) diff --git a/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/autosave/README b/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/autosave/README new file mode 100644 index 0000000..23b0534 --- /dev/null +++ b/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/autosave/README @@ -0,0 +1,3 @@ +This directory contains the save/restore files to retain settings between IOC reboots. +The distribution directory does not contain a auto_settings.sav file, but this will +be created the first time the IOC is run. diff --git a/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/makerelease.bat b/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/makerelease.bat new file mode 100644 index 0000000..f5107d3 --- /dev/null +++ b/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/makerelease.bat @@ -0,0 +1,44 @@ +set RELEASEDIR=\\catsserver.jetcats.jet.efda.org\CopyArea\areaDetector\ADPICam +REM set RELEASEDIR=C:\ADPICam +set SOURCEDIR=D:\EPICS\support\areaDetector\ADPICam + +REM https://social.technet.microsoft.com/Forums/windows/en-US/22f8ae0b-41e0-48c8-905a-71fe985600be/batch-files-and-the-remove-directory-command-rmdir?forum=w7itprogeneral +if exist %RELEASEDIR% RD /Q/S %RELEASEDIR% + +timeout 1 + +if not exist %RELEASEDIR%\PICamApp\Scripts mkdir %RELEASEDIR%\PICamApp\Scripts +copy %SOURCEDIR%\PICamApp\Scripts\*.bat %RELEASEDIR%\PICamApp\Scripts + +if not exist %RELEASEDIR%\op\opi\autoconvert mkdir %RELEASEDIR%\PICamApp\op\opi\autoconvert + +copy %SOURCEDIR%\PICamApp\op\opi\autoconvert\*.opi %RELEASEDIR%\PICamApp\op\opi\autoconvert + +if not exist %RELEASEDIR%\db mkdir %RELEASEDIR%\db +copy %SOURCEDIR%\db\*.template %RELEASEDIR%\db\ +if not exist %RELEASEDIR%\dbd mkdir %RELEASEDIR%\dbd +copy %SOURCEDIR%\dbd\PICamWithActonApp.dbd %RELEASEDIR%\dbd\ +copy %SOURCEDIR%\dbd\PICamApp.dbd %RELEASEDIR%\dbd\ + +if not exist %RELEASEDIR%\iocBoot\iocPICamWithActon mkdir %RELEASEDIR%\iocBoot\iocPICamWithActon +if not exist %RELEASEDIR%\iocBoot\iocPICam mkdir %RELEASEDIR%\iocBoot\iocPICam + + +copy %SOURCEDIR%\iocs\PICamIOC\iocBoot\iocPICam\st.cmd %RELEASEDIR%\iocBoot\iocPICam +SET TOP=../.. +echo SET TOP=%TOP%> %RELEASEDIR%\iocBoot\iocPICam\start_epics.bat +echo SET ADCORE=%TOP%>> %RELEASEDIR%\iocBoot\iocPICam\start_epics.bat +echo SET ADPICAM=%TOP%>> %RELEASEDIR%\iocBoot\iocPICam\start_epics.bat +echo SET CALC=%TOP%>> %RELEASEDIR%\iocBoot\iocPICam\start_epics.bat +echo SET AUTOSAVE=%TOP%>> %RELEASEDIR%\iocBoot\iocPICam\start_epics.bat +echo ..\..\bin\windows-x64-static\PICamApp st.cmd>> %RELEASEDIR%\iocBoot\iocPICam\start_epics.bat + +copy %SOURCEDIR%\iocs\PICamWithActonIOC\iocBoot\iocPICamWithActon\st.cmd %RELEASEDIR%\iocBoot\iocPICamWithActon +copy %SOURCEDIR%\iocs\PICamWithActonIOC\iocBoot\iocPICamWithActon\start_epics.bat %RELEASEDIR%\iocBoot\iocPICamWithActon +copy \epics\support\areaDetector\ADCore\iocBoot\commonPlugins.cmd %RELEASEDIR%\iocBoot + +if not exist %RELEASEDIR%\bin\windows-x64-static mkdir %RELEASEDIR%\bin\windows-x64-static +copy \epics\iocTops\PrincetonSpectro\ARC_InstrumentApp\Acton\ARC_Instrument_x64.dll %RELEASEDIR%\bin\windows-x64-static +copy %SOURCEDIR%\x64\Release_LIB\PICamApp.exe %RELEASEDIR%\bin\windows-x64-static +copy %SOURCEDIR%\x64\Release_LIB\PICamWithActonApp.exe %RELEASEDIR%\bin\windows-x64-static +copy %SOURCEDIR%\x64\Release_LIB\caRepeater.exe %RELEASEDIR%\bin\windows-x64-static diff --git a/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/nexus_templates/PerkinElmerParams.xml b/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/nexus_templates/PerkinElmerParams.xml new file mode 100644 index 0000000..74eb44c --- /dev/null +++ b/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/nexus_templates/PerkinElmerParams.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/nexus_templates/example.xml b/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/nexus_templates/example.xml new file mode 100644 index 0000000..d53c778 --- /dev/null +++ b/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/nexus_templates/example.xml @@ -0,0 +1,62 @@ + + + + + APS + XSD/34 + 34ID + E + 3.1415 + 12 + + + My title + + Describe here + Add here + + + + + 1.0 + https://svn.nexusformat.org/definitions/trunk/base_classes/NXentry.nxdl.xml + + + + + + 2009-02 + + + + + + Joe User + principal_investigator + Okiboji U +
123 Sesame Street
+ (999)555-1212 + (999)555-1213 + joeUser@okiboji.edu + 12345 +
+ + + + + + + 1 + + + 1.0 + 2.0 + + + + + + + +
+
diff --git a/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/st.cmd b/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/st.cmd new file mode 100644 index 0000000..c4a8d2d --- /dev/null +++ b/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/st.cmd @@ -0,0 +1,42 @@ +errlogInit(20000) + +< envPaths +#epicsThreadSleep(20) +dbLoadDatabase("$(TOP)/dbd/PICamWithActonApp.dbd") +PICamWithActonApp_registerRecordDeviceDriver(pdbbase) + +epicsEnvSet("PREFIX", "13PICAM1:") +epicsEnvSet("PORT", "PICAMDET1") +epicsEnvSet("SPECPORT", "PICAMSPEC1") +epicsEnvSet("QSIZE", "20") +epicsEnvSet("XSIZE", "2048") +epicsEnvSet("YSIZE", "2048") +epicsEnvSet("NCHANS", "2048") +# The maximum number of frames buffered in the NDPluginCircularBuff plugin +epicsEnvSet("CBUFFS", "500") + +# The search path for database files +epicsEnvSet("EPICS_DB_INCLUDE_PATH", "$(ADCORE)/db") + +# Create a PICam driver +# PICamConfig(const char *portName, IDType, IDValue, maxBuffers, size_t maxMemory, int priority, int stackSize) + +# This will select a live camera. +PICamConfig("$(PORT)", 0, 0, 0, 0, 12546318) + +asynSetTraceIOMask($(PORT), 0, 2) +#asynSetTraceMask($(PORT),0,0xff) + +dbLoadRecords("$(ADPICAM)/db/PICam.template","P=$(PREFIX),R=cam1:,PORT=$(PORT),ADDR=0,TIMEOUT=1") +dbLoadRecords("$(ADPICAM)/db/ARC_Instrument.template", "P=$(PREFIX):,PORT=$(SPECPORT),ADDR=0") + +# Create a standard arrays plugin, set it to get data from Driver. +NDStdArraysConfigure("Image1", 3, 0, "$(PORT)", 0) +ARC_InstrumentPortDriverConfigure($(SPECPORT), 0) +dbLoadRecords("NDStdArrays.template", "P=$(PREFIX),R=image1:,PORT=Image1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT),TYPE=Int16,SIZE=16,FTVL=SHORT,NELEMENTS=20000000") + +# Load all other plugins using commonPlugins.cmd +< $(ADCORE)/iocBoot/commonPlugins.cmd + +#asynSetTraceMask($(PORT),0,0x09) +iocInit() diff --git a/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/start_epics-debug.bat b/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/start_epics-debug.bat new file mode 100644 index 0000000..d7130ac --- /dev/null +++ b/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/start_epics-debug.bat @@ -0,0 +1,3 @@ +REM Start script for PICAM IOC +..\..\bin\windows-x64-debug\PICamApp st.cmd + diff --git a/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/start_epics-displays.bat b/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/start_epics-displays.bat new file mode 100644 index 0000000..84f7184 --- /dev/null +++ b/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/start_epics-displays.bat @@ -0,0 +1,6 @@ +set SUPPORT=C:\jhSrc\synApps_5_7\support +set AREA_DETECTOR=%SUPPORT%\areaDetector_2_git +set ASYN=%SUPPORT%\asyn-4-23 +set EPICS_DISPLAY_PATH=%AREA_DETECTOR%\ADPICam\PICamApp\op\adl;%AREA_DETECTOR%\ADCore\ADApp\op\adl;%ASYN%\opi\medm +echo %EPICS_DISPLAY_PATH% +start medm -x -macro "P=13PICAM1:, R=cam1:" PICAMBase.adl diff --git a/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/start_epics.bat b/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/start_epics.bat new file mode 100644 index 0000000..75bae94 --- /dev/null +++ b/iocs/PICamWithActonIOC/iocBoot/iocPICamWithActon/start_epics.bat @@ -0,0 +1,8 @@ +REM start medm -x -macro "P=13PICAM1:, R=cam1:" PICam.adl +REM start medm -x -macro "P=13PICAM1:, R=cam1:" ADBase.adl +if "%EPICS_HOST_ARCH%"=="" set EPICS_HOST_ARCH=windows-x64-static +if "%TOP%"=="" set TOP=../.. +if "%ADCORE%"=="" set ADCORE=%TOP% +if "%ADPICAM%"=="" set ADPICAM=%TOP% +..\..\bin\%EPICS_HOST_ARCH%\PICamWithActonApp.exe st.cmd > start_epics.log 2>&1 +