Commit c738bd18 authored by npereir's avatar npereir
Browse files

v1.0

parent f50383d0
*~
O.*
*.swp
*_BAK.adl
bin/
db/
dbd/
html/
include/
lib/
templates/
envPaths
**/autosave/*
!.keep
__pycache__/
# Makefile at top of application tree
TOP = .
include $(TOP)/configure/CONFIG
# Directories to build, any order
DIRS += configure
DIRS += $(wildcard *Sup)
DIRS += $(wildcard *App)
DIRS += $(wildcard *Top)
DIRS += $(wildcard iocBoot)
# The build order is controlled by these dependency rules:
# All dirs except configure depend on configure
$(foreach dir, $(filter-out configure, $(DIRS)), \
$(eval $(dir)_DEPEND_DIRS += configure))
# Any *App dirs depend on all *Sup dirs
$(foreach dir, $(filter %App, $(DIRS)), \
$(eval $(dir)_DEPEND_DIRS += $(filter %Sup, $(DIRS))))
# Any *Top dirs depend on all *Sup and *App dirs
$(foreach dir, $(filter %Top, $(DIRS)), \
$(eval $(dir)_DEPEND_DIRS += $(filter %Sup %App, $(DIRS))))
# iocBoot depends on all *App dirs
iocBoot_DEPEND_DIRS += $(filter %App,$(DIRS))
# Add any additional dependency rules here:
include $(TOP)/configure/RULES_TOP
# 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
# 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 even 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-ppc32
# To install files into a location other than $(TOP) define
# INSTALL_LOCATION here.
#INSTALL_LOCATION=</absolute/path/to/install/top>
# Set this when the IOC and build host use different paths
# to the install location. This may be needed to boot from
# a Microsoft FTP server say, or on some NFS configurations.
#IOCS_APPL_TOP = </IOC's/absolute/path/to/install/top>
# For application debugging purposes, override the HOST_OPT and/
# or CROSS_OPT settings from base/configure/CONFIG_SITE
#HOST_OPT = NO
#CROSS_OPT = NO
# These allow developers to override the CONFIG_SITE variable
# settings without having to modify the configure/CONFIG_SITE
# file itself.
-include $(TOP)/../CONFIG_SITE.local
-include $(TOP)/configure/CONFIG_SITE.local
### CONFIG_SITE
# 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
TOP=..
include $(TOP)/configure/CONFIG
TARGETS = $(CONFIG_TARGETS)
CONFIGS += $(subst ../,,$(wildcard $(CONFIG_INSTALLS)))
include $(TOP)/configure/RULES
# RELEASE - Location of external support modules
#
# IF YOU MAKE ANY CHANGES to this file you must subsequently
# do a "gnumake rebuild" in this application's top level
# directory.
#
# The build process does not check dependencies against files
# that are outside this application, thus you should do a
# "gnumake rebuild" in the top level directory after EPICS_BASE
# or any other external module pointed to below is rebuilt.
#
# Host- or target-specific settings can be given in files named
# RELEASE.$(EPICS_HOST_ARCH).Common
# RELEASE.Common.$(T_A)
# RELEASE.$(EPICS_HOST_ARCH).$(T_A)
#
# This file is parsed by both GNUmake and an EPICS Perl script,
# so it can ONLY contain definititions of paths to other support
# modules, variable definitions that are used in module paths,
# and include statements that pull in other RELEASE files.
# Variables may be used before their values have been set.
# Build variables that are NOT used in paths should be set in
# the CONFIG_SITE file.
# Variables and paths to dependent modules:
SUPPORT=/EPICS/support
ASYN=$(SUPPORT)/asyn-R4-42
AUTOSAVE=$(SUPPORT)/autosave-R5-10-1
BUSY=$(SUPPORT)/busy-R1-7-2
CALC=$(SUPPORT)/calc-R3-7-3
EXSUB=$(SUPPORT)/exsub
PTOOLS=$(SUPPORT)/ptools
SSCAN=$(SUPPORT)/sscan-R2-11-3
AREA_DETECTOR=$(SUPPORT)/areaDetector-R3-11
ADCORE=$(AREA_DETECTOR)/ADCore
ADSUPPORT=$(AREA_DETECTOR)/ADSupport
ADPOINTGREY=$(AREA_DETECTOR)/ADPointGrey
# If using the sequencer, point SNCSEQ at its top directory:
#SNCSEQ = $(MODULES)/seq-ver
# EPICS_BASE should appear last so earlier modules can override stuff:
EPICS_BASE = /EPICS/base
# Set RULES here if you want to use build rules from somewhere
# other than EPICS_BASE:
#RULES = $(MODULES)/build-rules
# These allow developers to override the RELEASE variable settings
# without having to modify the configure/RELEASE file itself.
-include $(TOP)/../RELEASE.local
-include $(TOP)/configure/RELEASE.local
# RULES
include $(CONFIG)/RULES
# Library should be rebuilt because LIBOBJS may have changed.
$(LIBNAME): ../Makefile
#RULES.ioc
include $(CONFIG)/RULES.ioc
#RULES_DIRS
include $(CONFIG)/RULES_DIRS
#RULES_TOP
include $(CONFIG)/RULES_TOP
TOP = ..
include $(TOP)/configure/CONFIG
DIRS += $(wildcard *ioc*)
DIRS += $(wildcard as*)
include $(CONFIG)/RULES_DIRS
TOP = ../..
include $(TOP)/configure/CONFIG
ARCH = $(EPICS_HOST_ARCH)
TARGETS = envPaths
include $(TOP)/configure/RULES.ioc
## records to save image in TIFF format
record(stringin, "$(BL):$(DEV):tsfilename") {
field(INP, "@%Y%m%d_%H%M%S")
field(DTYP, "Soft Timestamp")
}
record(stringout, "$(BL):$(DEV):bpmlabel") {
field(VAL, "_$(BPM).tif")
}
record (scalcout, "$(BL):$(DEV):calctsfilename")
{
field(INAA, "$(BL):$(DEV):tsfilename")
field(INBB, "$(BL):$(DEV):bpmlabel")
field(CALC, "AA+BB")
field(OUT, "$(BL):$(DEV):TIFF1:FileName PP")
}
record (calcout, "$(BL):$(DEV):writetiff")
{
field(INPA, "1")
field(CALC, "A")
field(OUT, "$(BL):$(DEV):TIFF1:WriteFile PP")
}
record (fanout, "$(BL):$(DEV):savetiff")
{
field(LNK0, "$(BL):$(DEV):tsfilename")
field(LNK1, "$(BL):$(DEV):calctsfilename")
field(LNK2, "$(BL):$(DEV):writetiff")
}
## Records to copy position of cross to profile cursor on stats2
record (calcout, "$(BL):$(DEV):CursorXcalc")
{
field(INPA, "$(BL):$(DEV):Over1:5:CenterX_RBV CPP")
field(CALC, "A")
field(OUT, "$(BL):$(DEV):Stats2:CursorX PP")
}
record (calcout, "$(BL):$(DEV):CursorYcalc")
{
field(INPA, "$(BL):$(DEV):Over1:5:CenterY_RBV CPP")
field(CALC, "A")
field(OUT, "$(BL):$(DEV):Stats2:CursorY PP")
}
## Records to mirror ROI1 and ROI2
record(calcout, "$(BL):$(DEV):ROIMirrorXpos")
{
field(INPA, "$(BL):$(DEV):ROI1:MinX CP MS")
field(CALC, "A")
field(OUT, "$(BL):$(DEV):ROI2:MinX PP")
}
record(calcout, "$(BL):$(DEV):ROIMirrorYpos")
{
field(INPA, "$(BL):$(DEV):ROI1:MinY CP MS")
field(CALC, "A")
field(OUT, "$(BL):$(DEV):ROI2:MinY PP")
}
record(calcout, "$(BL):$(DEV):ROIMirrorXsize")
{
field(INPA, "$(BL):$(DEV):ROI1:SizeX CP MS")
field(CALC, "A")
field(OUT, "$(BL):$(DEV):ROI2:SizeX PP")
}
record(calcout, "$(BL):$(DEV):ROIMirrorYsize")
{
field(INPA, "$(BL):$(DEV):ROI1:SizeY CP MS")
field(CALC, "A")
field(OUT, "$(BL):$(DEV):ROI2:SizeY PP")
}
## Records to create X array for plotting on CSS based on ROI absolute positions
record(calc, "$(BL):$(DEV):ROI_end_pos_X")
{
field(INPA, "$(BL):$(DEV):ROI1:MinX_RBV CP MS")
field(INPB, "$(BL):$(DEV):ROI1:SizeX_RBV CP MS")
field(CALC, "A+B")
}
record(calc, "$(BL):$(DEV):ROI_end_pos_Y")
{
field(INPA, "$(BL):$(DEV):ROI1:MinY_RBV CP MS")
field(INPB, "$(BL):$(DEV):ROI1:SizeY_RBV CP MS")
field(CALC, "A+B")
}
record(aSub, "$(BL):$(DEV):Xaxis_calc")
{
field(SNAM,"linspace")
field(FTA, "DOUBLE")
field(NOA, "1")
field(INPA,"$(BL):$(DEV):ROI1:MinX_RBV")
field(FTB, "DOUBLE")
field(NOB, "1")
field(INPB,"$(BL):$(DEV):ROI_end_pos_X CP MS")
field(FTC, "DOUBLE")
field(NOC, "1")
field(INPC,"$(BL):$(DEV):ROI1:SizeX_RBV")
field(FTVA, "DOUBLE")
field(NOVA, "2000")
field(OUTA, "$(BL):$(DEV):Xaxis_RBV PP")
}
record(waveform, "$(BL):$(DEV):Xaxis_RBV"){
field(FTVL, "DOUBLE")
field(NELM, "2000")
}
record(aSub, "$(BL):$(DEV):Yaxis_calc")
{
field(SNAM,"linspace")
field(FTA, "DOUBLE")
field(NOA, "1")
field(INPA,"$(BL):$(DEV):ROI1:MinY_RBV")
field(FTB, "DOUBLE")
field(NOB, "1")
field(INPB,"$(BL):$(DEV):ROI_end_pos_Y CP MS")
field(FTC, "DOUBLE")
field(NOC, "1")
field(INPC,"$(BL):$(DEV):ROI1:SizeY_RBV")
field(FTVA, "DOUBLE")
field(NOVA, "2000")
field(OUTA, "$(BL):$(DEV):Yaxis_RBV PP")
}
record(waveform, "$(BL):$(DEV):Yaxis_RBV"){
field(FTVL, "DOUBLE")
field(NELM, "2000")
}
record(aSub, "$(BL):$(DEV):Yaxis_full_calc")
{
field(SNAM,"linspace")
field(FTA, "DOUBLE")
field(NOA, "1")
field(INPA,"0")
field(FTB, "DOUBLE")
field(NOB, "1")
field(INPB,"963")
field(FTC, "DOUBLE")
field(NOC, "1")
field(INPC,"963")
field(FTVA, "DOUBLE")
field(NOVA, "2000")
field(OUTA, "$(BL):$(DEV):Yaxis_full_RBV PP")
field(PINI, "YES")
}
record(waveform, "$(BL):$(DEV):Yaxis_full_RBV"){
field(FTVL, "DOUBLE")
field(NELM, "2000")
}
# Note. These substutitions are mostly generic.
# However the PINI, PINI_VALB, and PINI_ABS fields should be changed to only be
# YES for the features the camera actually supports in device or absolute
# mode, otherwise error messages will appear on startup.
# One would normally set either PINI or PINI_ABS to YES (but not both) because
# if they are both YES the results are unpredictable, depending
# on which happens last.
# PINI_VALB should only be set to YES for the WhiteBalance property in color cameras
# that support WhiteBalance.
file "$(ADPOINTGREY)/db/pointGreyProperty.template"
{
pattern
{ P, R, PORT, PROPERTY, N, PINI, PINI_VALB, PINI_ABS, PHAS}
{PINK:, PG01:, PGP1, Brightness, 0, NO, NO, YES, 1}
{PINK:, PG01:, PGP1, AutoExposure, 1, NO, NO, YES, 1}
{PINK:, PG01:, PGP1, Sharpness, 2, NO, NO, YES, 1}
{PINK:, PG01:, PGP1, WhiteBalance, 3, YES, YES, NO, 1}
{PINK:, PG01:, PGP1, Hue, 4, NO, NO, YES, 1}
{PINK:, PG01:, PGP1, Saturation, 5, NO, NO, YES, 1}
{PINK:, PG01:, PGP1, Gamma, 6, NO, NO, YES, 1}
{PINK:, PG01:, PGP1, Iris, 7, YES, NO, NO, 1}
{PINK:, PG01:, PGP1, Focus, 8, YES, NO, NO, 1}
{PINK:, PG01:, PGP1, Zoom, 9, YES, NO, NO, 1}
{PINK:, PG01:, PGP1, Pan, 10, YES, NO, NO, 1}
{PINK:, PG01:, PGP1, Tilt, 11, YES, NO, NO, 1}
# Don't set PINI on Shutter property, it is set from AcquireTime record
{PINK:, PG01:, PGP1, Shutter, 12, NO, NO, NO, 1}
# Don't set PINI on Gain property, it is set from Gain record
{PINK:, PG01:, PGP1, Gain, 13, NO, NO, NO, 1}
{PINK:, PG01:, PGP1, TriggerMode, 14, NO, NO, NO, 1}
{PINK:, PG01:, PGP1, TriggerDelay, 15, NO, NO, YES, 1}
{PINK:, PG01:, PGP1, FrameRate, 16, NO, NO, YES, 1}
{PINK:, PG01:, PGP1, Temperature, 17, NO, NO, NO, 1}
}
file "$(ADPOINTGREY)/db/pointGreyGigEProperty.template"
{
pattern
{ P, R, PORT, PROPERTY, N, PINI}
{PINK:, PG01:, PGP1, Heartbeat, 0, NO}
{PINK:, PG01:, PGP1, HeartbeatTimeout, 1, NO}
{PINK:, PG01:, PGP1, PacketSize, 2, YES}
{PINK:, PG01:, PGP1, PacketDelay, 3, YES}
}
#!../../bin/linux-x86_64/pgs
## You may have to change pgs to something else
## everywhere it appears in this file
< envPaths
cd "${TOP}"
## Register all support components
dbLoadDatabase "dbd/pgs.dbd"
pgs_registerRecordDeviceDriver pdbbase
# Prefix for all records
#epicsEnvSet("BL", "PINK")
#epicsEnvSet("DEV", "PG01")
#epicsEnvSet("IMAGE","image1")
epicsEnvSet("BL", "$(IOCBL)")
epicsEnvSet("DEV", "$(IOCDEV)")
epicsEnvSet("PREFIX","$(BL):$(DEV):")
#epicsEnvSet("BPM","BPM1")
epicsEnvSet("EPICS_CA_MAX_ARRAY_BYTES", 10000000)
#epicsEnvSet("EPICS_CAS_INTF_ADDR_LIST", "172.17.10.48")
# Use this line for a specific camera by serial number, in this case a BlackFly GigE camera
## Camera PG01
#epicsEnvSet("CAMERA_ID", "16435513")
## Camera PG02
## epicsEnvSet("CAMERA_ID", "16435512")
## Camera PG03
## epicsEnvSet("CAMERA_ID", "16435509")
## Camera PG04
## epicsEnvSet("CAMERA_ID", "15395012")
# The port name for the detector
epicsEnvSet("PORT", "PGP1")
# Really large queue so we can stream to disk at full camera speed
epicsEnvSet("QSIZE", "2000")
# The maximim image width; used for row profiles in the NDPluginStats plugin
epicsEnvSet("XSIZE", "1288")
# The maximim image height; used for column profiles in the NDPluginStats plugin
epicsEnvSet("YSIZE", "964")
# The maximum number of time series points in the NDPluginStats plugin
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")
# Define NELEMENTS to be enough for a 1288x964 = 1241632 (Mono) image
epicsEnvSet("NELEMENTS", "1241632")
# pointGreyConfig(const char *portName, int cameraId, int traceMask, int memoryChannel, int maxBuffers, size_t maxMemory, int priority, int stackSize)
pointGreyConfig("$(PORT)", $(CAMERA_ID), 0x1, 0)
## test
#drvAsynIPPortConfigure("$(PORT)", "127.0.0.1:50123", 0, 0, 0)
dbLoadRecords("$(ADPOINTGREY)/db/pointGrey.template", "P=$(BL):,R=$(DEV):,PORT=$(PORT),ADDR=0,TIMEOUT=1")
dbLoadTemplate("${TOP}/iocBoot/${IOC}/pg01.substitutions")
# Create a standard arrays plugin
NDStdArraysConfigure("Image1", 5, 0, "$(PORT)", 0, 0)
NDStdArraysConfigure("Image2", 5, 0, "$(PORT)", 0, 0)
# Use this line for 8-bit or 16-bit data
dbLoadRecords("$(ADCORE)/db/NDStdArrays.template", "P=$(PREFIX),R=image1:,PORT=Image1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT),TYPE=Int16,FTVL=USHORT,NELEMENTS=$(NELEMENTS)")
dbLoadRecords("$(ADCORE)/db/NDStdArrays.template", "P=$(PREFIX),R=image2:,PORT=Image2,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT),TYPE=Int16,FTVL=USHORT,NELEMENTS=$(NELEMENTS)")
cd "${TOP}/iocBoot/${IOC}"
# Extra customized records for PINK Beamline
dbLoadRecords("extra.db", "BL=$(BL), DEV=$(DEV), BPM=$(BPM)")
# Load all other plugins using commonPlugins.cmd
< plugins.cmd
## Autosave Path and Restore settings
set_savefile_path("/EPICS/autosave")
set_requestfile_path("${TOP}/iocBoot/${IOC}/reqs")
set_requestfile_path("$(ADCORE)/ADApp/Db")
set_pass0_restoreFile("auto_settings.sav")
set_pass1_restoreFile("auto_settings.sav")
iocInit
## Autosave Monitor settings
create_monitor_set("auto_settings.req", 30,"BL=$(BL), DEV=$(DEV), P=$(PREFIX)")
# Records with dynamic enums need to be processed again because the enum values are not available during iocInit.
dbpf("$(BL):$(DEV):Format7Mode.PROC", "1")
dbpf("$(BL):$(DEV):PixelFormat.PROC", "1")
# Wait for callbacks on the property limits (DRVL, DRVH) to complete
epicsThreadSleep(1.0)
# Records that depend on the state of the dynamic enum records or property limits also need to be proce$
# Other property records may need to be added to this list
dbpf("$(BL):$(DEV):FrameRate.PROC", "1")
dbpf("$(BL):$(DEV):FrameRateValAbs.PROC", "1")
dbpf("$(BL):$(DEV):AcquireTime.PROC", "1")
epicsThreadSleep(1.0)
dbpf("$(BL):$(DEV):PixelFormat", "1")
dbpf("$(BL):$(DEV):ShutterAutoMode", "0")
dbpf("$(BL):$(DEV):GainAutoMode", "0")
## cross on over1:6 follows stat2 centroid
dbpf("$(BL):$(DEV):Over1:6:CenterXLink.DOL", "$(BL):$(DEV):Stats2:CentroidX_RBV CP MS")
dbpf("$(BL):$(DEV):Over1:6:CenterYLink.DOL", "$(BL):$(DEV):Stats2:CentroidY_RBV CP MS")
dbpf("$(BL):$(DEV):TIFF1:FilePath", "/home/epics/Pinkdata/BPM")
dbpf("$(BL):$(DEV):TIFF1:FileTemplate", "%s%s")
dbpf("$(BL):$(DEV):PacketDelay", "3000")
## Start any sequence programs
#seq sncxxx,"user=epics"
# Create a netCDF file saving plugin
NDFileNetCDFConfigure("FileNetCDF1", $(QSIZE), 0, "$(PORT)", 0)
dbLoadRecords("NDFileNetCDF.template","P=$(PREFIX),R=netCDF1:,PORT=FileNetCDF1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT)")
# Create a TIFF file saving plugin
NDFileTIFFConfigure("FileTIFF1", $(QSIZE), 0, "$(PORT)", 0)
dbLoadRecords("NDFileTIFF.template", "P=$(PREFIX),R=TIFF1:,PORT=FileTIFF1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT)")
# Create a JPEG file saving plugin
NDFileJPEGConfigure("FileJPEG1", $(QSIZE), 0, "$(PORT)", 0)
dbLoadRecords("NDFileJPEG.template", "P=$(PREFIX),R=JPEG1:,PORT=FileJPEG1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT)")
# Create a NeXus file saving plugin
NDFileNexusConfigure("FileNexus1", $(QSIZE), 0, "$(PORT)", 0)
dbLoadRecords("NDFileNexus.template", "P=$(PREFIX),R=Nexus1:,PORT=FileNexus1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT)")
# Create an HDF5 file saving plugin
NDFileHDF5Configure("FileHDF1", $(QSIZE), 0, "$(PORT)", 0)
dbLoadRecords("NDFileHDF5.template", "P=$(PREFIX),R=HDF1:,PORT=FileHDF1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT)")
# Create a Magick file saving plugin
#NDFileMagickConfigure("FileMagick1", $(QSIZE), 0, "$(PORT)", 0)
#dbLoadRecords("NDFileMagick.template","P=$(PREFIX),R=Magick1:,PORT=FileMagick1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT)")
# Create 4 ROI plugins
NDROIConfigure("ROI1", $(QSIZE), 0, "$(PORT)", 0, 0, 0, 0, 0, $(MAX_THREADS=5))
dbLoadRecords("NDROI.template", "P=$(PREFIX),R=ROI1:, PORT=ROI1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT)")
NDROIConfigure("ROI2", $(QSIZE), 0, "$(PORT)", 0, 0, 0, 0, 0, $(MAX_THREADS=5))
dbLoadRecords("NDROI.template", "P=$(PREFIX),R=ROI2:, PORT=ROI2,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT)")
NDROIConfigure("ROI3", $(QSIZE), 0, "$(PORT)", 0, 0, 0, 0, 0, $(MAX_THREADS=5))
dbLoadRecords("NDROI.template", "P=$(PREFIX),R=ROI3:, PORT=ROI3,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT)")
NDROIConfigure("ROI4", $(QSIZE), 0, "$(PORT)", 0, 0, 0, 0, 0, $(MAX_THREADS=5))
dbLoadRecords("NDROI.template", "P=$(PREFIX),R=ROI4:, PORT=ROI4,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT)")
# Create 8 ROIStat plugins
NDROIStatConfigure("ROISTAT1", $(QSIZE), 0, "$(PORT)", 0, 8, 0, 0, 0, 0, $(MAX_THREADS=5))
dbLoadRecords("NDROIStat.template", "P=$(PREFIX),R=ROIStat1: ,PORT=ROISTAT1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT),NCHANS=$(NCHANS)")
dbLoadRecords("NDROIStatN.template", "P=$(PREFIX),R=ROIStat1:1:,PORT=ROISTAT1,ADDR=0,TIMEOUT=1,NCHANS=$(NCHANS)")
dbLoadRecords("NDROIStatN.template", "P=$(PREFIX),R=ROIStat1:2:,PORT=ROISTAT1,ADDR=1,TIMEOUT=1,NCHANS=$(NCHANS)")
dbLoadRecords("NDROIStatN.template", "P=$(PREFIX),R=ROIStat1:3:,PORT=ROISTAT1,ADDR=2,TIMEOUT=1,NCHANS=$(NCHANS)")
dbLoadRecords("NDROIStatN.template", "P=$(PREFIX),R=ROIStat1:4:,PORT=ROISTAT1,ADDR=3,TIMEOUT=1,NCHANS=$(NCHANS)")
dbLoadRecords("NDROIStatN.template", "P=$(PREFIX),R=ROIStat1:5:,PORT=ROISTAT1,ADDR=4,TIMEOUT=1,NCHANS=$(NCHANS)")
dbLoadRecords("NDROIStatN.template", "P=$(PREFIX),R=ROIStat1:6:,PORT=ROISTAT1,ADDR=5,TIMEOUT=1,NCHANS=$(NCHANS)")
dbLoadRecords("NDROIStatN.template", "P=$(PREFIX),R=ROIStat1:7:,PORT=ROISTAT1,ADDR=6,TIMEOUT=1,NCHANS=$(NCHANS)")
dbLoadRecords("NDROIStatN.template", "P=$(PREFIX),R=ROIStat1:8:,PORT=ROISTAT1,ADDR=7,TIMEOUT=1,NCHANS=$(NCHANS)")
# Create a processing plugin
NDProcessConfigure("PROC1", $(QSIZE), 0, "$(PORT)", 0, 0, 0)
dbLoadRecords("NDProcess.template", "P=$(PREFIX),R=Proc1:, PORT=PROC1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT)")
# Create a TIFF file plugin to read dark and flatfield images into the processing plugin
NDFileTIFFConfigure("PROC1TIFF", $(QSIZE), 0, "$(PORT)", 0)
dbLoadRecords("NDFileTIFF.template", "P=$(PREFIX),R=Proc1:TIFF:,PORT=PROC1TIFF,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT)")
# Create 5 statistics plugins
NDStatsConfigure("STATS1", $(QSIZE), 0, "$(PORT)", 0, 0, 0, 0, 0, $(MAX_THREADS=5))
dbLoadRecords("NDStats.template", "P=$(PREFIX),R=Stats1:, PORT=STATS1,ADDR=0,TIMEOUT=1,HIST_SIZE=256,XSIZE=$(XSIZE),YSIZE=$(YSIZE),NCHANS=$(NCHANS),NDARRAY_PORT=$(PORT)")
NDTimeSeriesConfigure("STATS1_TS", $(QSIZE), 0, "STATS1", 1, 23)
dbLoadRecords("$(ADCORE)/db/NDTimeSeries.template", "P=$(PREFIX),R=Stats1:TS:, PORT=STATS1_TS,ADDR=0,TIMEOUT=1,NDARRAY_PORT=STATS1,NDARRAY_ADDR=1,NCHANS=$(NCHANS),ENABLED=1")
NDStatsConfigure("STATS2", $(QSIZE), 0, "ROI1", 0, 0, 0, 0, 0, $(MAX_THREADS=5))
dbLoadRecords("NDStats.template", "P=$(PREFIX),R=Stats2:, PORT=STATS2,ADDR=0,TIMEOUT=1,HIST_SIZE=256,XSIZE=$(XSIZE),YSIZE=$(YSIZE),NCHANS=$(NCHANS),NDARRAY_PORT=$(PORT)")
NDTimeSeriesConfigure("STATS2_TS", $(QSIZE), 0, "STATS2", 1, 23)
dbLoadRecords("$(ADCORE)/db/NDTimeSeries.template", "P=$(PREFIX),R=Stats2:TS:, PORT=STATS2_TS,ADDR=0,TIMEOUT=1,NDARRAY_PORT=STATS2,NDARRAY_ADDR=1,NCHANS=$(NCHANS),ENABLED=1")
NDStatsConfigure("STATS3", $(QSIZE), 0, "ROI2", 0, 0, 0, 0, 0, $(MAX_THREADS=5))
dbLoadRecords("NDStats.template", "P=$(PREFIX),R=Stats3:, PORT=STATS3,ADDR=0,TIMEOUT=1,HIST_SIZE=256,XSIZE=$(XSIZE),YSIZE=$(YSIZE),NCHANS=$(NCHANS),NDARRAY_PORT=$(PORT)")
NDTimeSeriesConfigure("STATS3_TS", $(QSIZE), 0, "STATS3", 1, 23)
dbLoadRecords("$(ADCORE)/db/NDTimeSeries.template", "P=$(PREFIX),R=Stats3:TS:, PORT=STATS3_TS,ADDR=0,TIMEOUT=1,NDARRAY_PORT=STATS3,NDARRAY_ADDR=1,NCHANS=$(NCHANS),ENABLED=1")