## ADGenICam.template
## Template database file to control some features of ADGenICam.
##
## Note: this file contains only the records that are not handled by the camera-specific GenICam autogenerated database

include "ADBase.template"

## These are the records from ADBase.template that we modify

# Some cameras use both AcquisitionFrameRate and AcquirePeriod.
# Make AcquirePeriod update if FrameRate is changed.
record(ao, "$(P)$(R)AcquirePeriod")
{
   info(asyn:READBACK, "1")
}

# This record hides the fact that some cameras use FrameRate and some use FrameRateAbs
# This is not PINI=YES because AcquirePeriod is and they control the same thing
record(ao, "$(P)$(R)FrameRate")
{
   field(DTYP, "asynFloat64")
   field(OUT,  "@asyn($(PORT) 0)GC_FRAMERATE")
   field(PREC, "3")
}

record(ai, "$(P)$(R)FrameRate_RBV")
{
   field(DTYP, "asynFloat64")
   field(INP,  "@asyn($(PORT) 0)GC_FRAMERATE")
   field(SCAN, "I/O Intr")
   field(PREC, "3")
}

# Some cameras (Basler, Point Grey, FLIR) use AcquisitionFrameRateEnable or AcquisitionFrameRateEnabled
# This record hides the fact that the feature name may differ; the record name is always the same.
record(bo, "$(P)$(R)FrameRateEnable")
{
   field(PINI, "YES")
   field(DTYP, "asynInt32")
   field(OUT,  "@asyn($(PORT) 0)GC_FRAMERATE_ENABLE")
   field(ZNAM, "No")
   field(ONAM, "Yes")
}

record(bi, "$(P)$(R)FrameRateEnable_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT) 0)GC_FRAMERATE_ENABLE")
   field(SCAN, "I/O Intr")
   field(ZNAM, "No")
   field(ONAM, "Yes")
}

# This record is used to ensure there is a record for TriggerSource even if there is no such GenICam feature
record(mbbo, "$(P)$(R)TriggerSource")
{
   field(PINI, "YES")
   field(DTYP, "asynInt32")
   field(OUT,  "@asyn($(PORT) 0)GC_TRIGGER_SOURCE")
   field(ZRST, "N.A.")
   field(ZRVL, "0")
}

record(mbbi, "$(P)$(R)TriggerSource_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT) 0)GC_TRIGGER_SOURCE")
   field(ZRST, "N.A.")
   field(ZRVL, "0")
   field(SCAN, "I/O Intr")
}

# This record is used to ensure there is a record for TriggerOverlap even if there is no such GenICam feature
record(mbbo, "$(P)$(R)TriggerOverlap")
{
   field(PINI, "YES")
   field(DTYP, "asynInt32")
   field(OUT,  "@asyn($(PORT) 0)GC_TRIGGER_OVERLAP")
   field(ZRST, "N.A.")
   field(ZRVL, "0")
}

record(mbbi, "$(P)$(R)TriggerOverlap_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT) 0)GC_TRIGGER_OVERLAP")
   field(SCAN, "I/O Intr")
   field(ZRST, "N.A.")
   field(ZRVL, "0")
}

# This record is used to ensure there is a record for TriggerSoftware even if there is no such GenICam feature
record(bo, "$(P)$(R)TriggerSoftware")
{
   field(PINI, "YES")
   field(DTYP, "asynInt32")
   field(OUT,  "@asyn($(PORT) 0)GC_TRIGGER_SOFTWARE")
   field(ZNAM, "Done")
   field(ONAM, "Trigger")
}

# This record is used to ensure there is a record for ExposureMode even if there is no such GenICam feature
record(mbbo, "$(P)$(R)ExposureMode")
{
   field(PINI, "YES")
   field(DTYP, "asynInt32")
   field(OUT,  "@asyn($(PORT) 0)GC_EXPOSURE_MODE")
   field(ZRST, "N.A.")
   field(ZRVL, "0")
}

record(mbbi, "$(P)$(R)ExposureMode_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT) 0)GC_EXPOSURE_MODE")
   field(ZRST, "N.A.")
   field(ZRVL, "0")
   field(SCAN, "I/O Intr")
}

# This record is used to ensure there is a record for ExposureAuto even if there is no such GenICam feature
record(mbbo, "$(P)$(R)ExposureAuto")
{
   field(PINI, "YES")
   field(DTYP, "asynInt32")
   field(OUT,  "@asyn($(PORT) 0)GC_EXPOSURE_AUTO")
   field(ZRST, "N.A.")
   field(ZRVL, "0")
}

record(mbbi, "$(P)$(R)ExposureAuto_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT) 0)GC_EXPOSURE_AUTO")
   field(SCAN, "I/O Intr")
   field(ZRST, "N.A.")
   field(ZRVL, "0")
}

# This record is used to ensure there is a record for GainAuto even if there is no such GenICam feature
record(mbbo, "$(P)$(R)GainAuto")
{
   field(PINI, "YES")
   field(DTYP, "asynInt32")
   field(OUT,  "@asyn($(PORT) 0)GC_GAIN_AUTO")
   field(ZRST, "N.A.")
   field(ZRVL, "0")
}

record(mbbi, "$(P)$(R)GainAuto_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT) 0)GC_GAIN_AUTO")
   field(SCAN, "I/O Intr")
   field(ZRST, "N.A.")
   field(ZRVL, "0")
}

# This record is used to ensure there is a record for PixelFormat even if there is no such GenICam feature
record(mbbo, "$(P)$(R)PixelFormat")
{
   field(PINI, "YES")
   field(DTYP, "asynInt32")
   field(OUT,  "@asyn($(PORT) 0)GC_PIXEL_FORMAT")
   field(ZRST, "N.A.")
   field(ZRVL, "0")
}

record(mbbi, "$(P)$(R)PixelFormat_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT) 0)GC_PIXEL_FORMAT")
   field(ZRST, "N.A.")
   field(ZRVL, "0")
   field(SCAN, "I/O Intr")
}
