#==============================================================
#
#  Abs:  Initalize Camera Link driver for soft IOCs
#
#  Name: init_clcam.cmd.soft
#
#  Side:  This script expectes the following
#         macros tobe defined upon entry
#           BIT      - Number of bits
#           BLOCKING - 0
#           CHAN     - Channel number
#           ID       - 3 digit of PORT Number (ie. 210)
#           PORT     - Asyn portname       (ie. C2${ID})
#           QSIZE    - Queue byte size
#           XSIZE    - Maximum size X
#           YSIZE    - Maximum size Y
#
#  Facility: EED Laser Controls
#
#  Auth: 13-Feb-2018, Shawn Alverson  (ALVERSON)
#  Rev:  dd-mmm-yyyy, Reviewer's Name (USERNAME)
#--------------------------------------------------------------
#  Mod:
#        13-Mar-2019, K. luchini      (LUCHINI):
#          extract from LaserEIC/iocBoot/common/st_clcam.cmd 
#
#==============================================================
#
# Camera Link Camera Template for use with PGP CL (SLAC) PCIe card
epicsEnvShow("PORT")

# Create a clCam driver
# pgpEdtConfig(const char *portName, int boardNo, int channelNo,
#             int maxSizeX, int maxSizeY, int numBits, int dataType,
#             int maxBuffers, int maxMemory, int priority, int stackSize)
#
pgpEdtConfig("${PORT}", 0, ${CHAN}, ${XSIZE}, ${YSIZE}, ${BIT}, 2, 8, 32000000)

# Configure Arrays for the Acquisition
NDStdArraysConfigure("Image${PORT}${ID}", 3, 0, "${PORT}", 0)

# Configure NDROI
NDROIConfigure("ROI${PORT}${ID}", ${QSIZE}, ${BLOCKING}, "${PORT}", 0, 0, 0)

# Configure Arrays for the Acquisition
NDStdArraysConfigure("ImageROI${PORT}${ID}", 3, 0, "ROI${PORT}${ID}", 0)

# Configure Processing Plugin
NDProcessConfigure("PROC${PORT}${ID}", ${QSIZE}, ${BLOCKING}, "ROI${PORT}${ID}", 0, 0, 0)

# Configure Statistics Plugin
NDStatsConfigure("STATS${PORT}${ID}", ${QSIZE}, ${BLOCKING}, "ROI${PORT}${ID}", 0, 0, 0)

asynOctetSetInputEos("${PORT}", 0, "\r\n")
asynOctetSetOutputEos("${PORT}", 0, "\r\n")

# End of file
