#==============================================================
#
#  Abs:  Initalize Prosilica GigE Camera for soft IOCs
#
#  Name: init_cam.cmd.soft
#
#  Side:  This script expectes the following
#         macros tobe defined upon entry
#           BLOCKING - 0
#           ID       - 3 digit of PORT Number
#           IP       - IP Address of camera
#           PORT     - Asyn portname       (ie. PS${ID})
#           QSIZE    - Queue byte size
#
#  Facility: EED Laser Controls
#
#  Auth: 13-Feb-2018, James Morad     (JMORAD)
#  Rev:  dd-mmm-yyyy, Reviewer's Name (USERNAME)
#--------------------------------------------------------------
#  Mod:
#        13-Mar-2019, K. luchini      (LUCHINI):
#          modify init_cam.cmd and load databases in st.cmd
#
#==============================================================
#

# prosilicaConfig(portName,    # The name of the asyn port to be created
#                 cameraId,    # Unique ID, IP address, or IP name of the camera
#                 maxBuffers,  # Maximum number of NDArray buffers driver can allocate. -1=unlimited
#                 maxMemory,   # Maximum memory bytes driver can allocate. -1=unlimited
#                 priority,    # EPICS thread priority for asyn port driver 0=default
#                 stackSize,   # EPICS thread stack size for asyn port driver 0=default
#                 maxPvAPIFrames) # Number of frames to allocate in PvAPI driver. Default=2.
# The simplest way to determine the uniqueId of a camera is to run the Prosilica GigEViewer application,
# select the camera, and press the "i" icon on the bottom of the main window to show the camera information for this camera.
# The Unique ID will be displayed on the first line in the information window.
# prosilicaConfig("${PORT}", 51031, 50, -1, 0, 0, 10)
#
prosilicaConfig("PS${ID}", ${IP}, -1, -1, 0, 0, 100)

# Configure Arrays for the Acquisition
NDStdArraysConfigure("Image${ID}", ${QSIZE}, ${BLOCKING}, "PS${ID}", 0)

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

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

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

# Configure JPEG Plugin
NDFileJPEGConfigure("FileJPEG${ID}", ${QSIZE}, ${BLOCKING}, "PS${ID}", 0)

# Configure TIFF Plugin
NDFileTIFFConfigure("FileTIFF${ID}", ${QSIZE}, ${BLOCKING}, "PS${ID}", 0)

# End of file
