# Database for the records specific to the Prosilica cameras
# Mark Rivers
# March 27, 2008

###############################################################################
#  Note: The following are records defined in ADBase.template.                #
#        We are changing some of the fields here to reflect valid values for  #
#        Prosilica                                                            #
###############################################################################

###############################################################################
#  These records control the trigger mode.                                    # 
###############################################################################
record(mbbo, "$(P)$(R)TriggerMode")
{
   field(ZRST, "Free Run")
   field(ZRVL, "0")
   field(ONST, "Sync In 1")
   field(ONVL, "1")
   field(TWST, "Sync In 2")
   field(TWVL, "2")
   field(THST, "Sync In 3")
   field(THVL, "3")
   field(FRST, "Sync In 4")
   field(FRVL, "4")
   field(FVST, "Fixed Rate")
   field(FVVL, "5")
   field(SXST, "Software")
   field(SXVL, "6")
 }

record(mbbi, "$(P)$(R)TriggerMode_RBV")
{
   field(ZRST, "Free Run")
   field(ZRVL, "0")
   field(ONST, "Sync In 1")
   field(ONVL, "1")
   field(TWST, "Sync In 2")
   field(TWVL, "2")
   field(THST, "Sync In 3")
   field(THVL, "3")
   field(FRST, "Sync In 4")
   field(FRVL, "4")
   field(FVST, "Fixed Rate")
   field(FVVL, "5")
   field(SXST, "Software")
   field(SXVL, "6")
   field(SCAN, "I/O Intr")
}

###############################################################################
#  These records control the file format.                                     # 
###############################################################################
record(mbbo, "$(P)$(R)FileFormat")
{
    field(ZRST, "TIFF")
    field(ZRVL, "0")
    field(ONST, "Invalid")
    field(ONVL, "1")
}

record(mbbi, "$(P)$(R)FileFormat_RBV")
{
    field(ZRST, "TIFF")
    field(ZRVL, "0")
    field(ONST, "Invalid")
    field(ONVL, "1")
}

# Only 2 data types are supported, unsigned 8 and 16 bit integers
record(mbbo, "$(P)$(R)DataType")
{
   field(ZRST, "UInt8")
   field(ZRVL, "1")
   field(ONST, "UInt16")
   field(ONVL, "3")
   field(TWST, "")
   field(TWVL, "")
   field(THST, "")
   field(THVL, "")
   field(FRST, "")
   field(FRVL, "")
   field(FVST, "")
   field(FVVL, "")
   field(SXST, "")
   field(SXVL, "")
   field(SVST, "")
   field(SVVL, "")
}

record(mbbi, "$(P)$(R)DataType_RBV")
{
   field(ZRST, "UInt8")
   field(ZRVL, "1")
   field(ONST, "UInt16")
   field(ONVL, "3")
   field(TWST, "")
   field(TWVL, "")
   field(THST, "")
   field(THVL, "")
   field(FRST, "")
   field(FRVL, "")
   field(FVST, "")
   field(FVVL, "")
   field(SXST, "")
   field(SXVL, "")
   field(SVST, "")
   field(SVVL, "")
}

# Only Mono, Bayer and RGB1 color modes are supported at this time
record(mbbo, "$(P)$(R)ColorMode")
{
   field(ZRST, "Mono")
   field(ZRVL, "0")
   field(ONST, "Bayer")
   field(ONVL, "1")
   field(TWST, "RGB1")
   field(TWVL, "2")
   field(THST, "")
   field(THVL, "")
   field(FRST, "")
   field(FRVL, "")
   field(FVST, "")
   field(FVVL, "")
   field(SXST, "")
   field(SXVL, "")
   field(SVST, "")
   field(SVVL, "")
}

record(mbbi, "$(P)$(R)ColorMode_RBV")
{
   field(ZRST, "Mono")
   field(ZRVL, "0")
   field(ONST, "Bayer")
   field(ONVL, "1")
   field(TWST, "RGB1")
   field(TWVL, "2")
   field(THST, "")
   field(THVL, "")
   field(FRST, "")
   field(FRVL, "")
   field(FVST, "")
   field(FVVL, "")
   field(SXST, "")
   field(SXVL, "")
   field(SVST, "")
   field(SVVL, "")
}

# The following records are specific to the Prosilica

###############################################################################
#  These records are for network and frame statistics                         #
###############################################################################
record(longout, "$(P)$(R)PSReadStatistics")
{
   field(DTYP, "asynInt32")
   field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_READ_STATISTICS")
   field(SCAN, "5 second")
}

record(stringin, "$(P)$(R)PSDriverType_RBV")
{
   field(DTYP, "asynOctetRead")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_DRIVER_TYPE")
   field(SCAN, "I/O Intr")
}

record(stringin, "$(P)$(R)PSFilterVersion_RBV")
{
   field(DTYP, "asynOctetRead")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_FILTER_VERSION")
   field(SCAN, "I/O Intr")
}

record(ai, "$(P)$(R)PSFrameRate_RBV")
{
   field(DTYP, "asynFloat64")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_FRAME_RATE")
   field(PREC, "3")
   field(SCAN, "I/O Intr")
}

record(longin, "$(P)$(R)PSFramesCompleted_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_FRAMES_COMPLETED")
   field(SCAN, "I/O Intr")
}

record(longin, "$(P)$(R)PSFramesDropped_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_FRAMES_DROPPED")
   field(SCAN, "I/O Intr")
}

record(longin, "$(P)$(R)PSPacketsErroneous_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_PACKETS_ERRONEOUS")
   field(SCAN, "I/O Intr")
}

record(longin, "$(P)$(R)PSPacketsMissed_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_PACKETS_MISSED")
   field(SCAN, "I/O Intr")
}

record(longin, "$(P)$(R)PSPacketsReceived_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_PACKETS_RECEIVED")
   field(SCAN, "I/O Intr")
}

record(longin, "$(P)$(R)PSPacketsRequested_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_PACKETS_REQUESTED")
   field(SCAN, "I/O Intr")
}

record(longin, "$(P)$(R)PSPacketsResent_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_PACKETS_RESENT")
   field(SCAN, "I/O Intr")
}

record(longin, "$(P)$(R)PSBadFrameCounter_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_BAD_FRAME_COUNTER")
   field(SCAN, "I/O Intr")
}

###############################################################################
#  These records are for hardware synchronization and digital I/O             #
###############################################################################

record(bi, "$(P)$(R)SyncIn1Level_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_SYNC_IN_1_LEVEL")
   field(ZNAM, "Low")
   field(ONAM, "High")
   field(SCAN, "I/O Intr")
}

record(bi, "$(P)$(R)SyncIn2Level_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_SYNC_IN_2_LEVEL")
   field(ZNAM, "Low")
   field(ONAM, "High")
   field(SCAN, "I/O Intr")
}

record(mbbo, "$(P)$(R)SyncOut1Mode")
{
   field(PINI, "YES")
   field(DTYP, "asynInt32")
   field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_SYNC_OUT_1_MODE")
   field(ZRST, "GPO")
   field(ZRVL, "0")
   field(ONST, "AcqTrigReady")
   field(ONVL, "1")
   field(TWST, "FrameTrigReady")
   field(TWVL, "2")
   field(THST, "FrameTrigger")
   field(THVL, "3")
   field(FRST, "Exposing")
   field(FRVL, "4")
   field(FVST, "FrameReadout")
   field(FVVL, "5")
   field(SXST, "Imaging")
   field(SXVL, "6")
   field(SVST, "Acquiring")
   field(SVVL, "7")
   field(EIST, "SyncIn1")
   field(EIVL, "8")
   field(NIST, "SyncIn2")
   field(NIVL, "9")
   field(TEST, "SyncIn3")
   field(TEVL, "10")
   field(ELST, "SyncIn4")
   field(ELVL, "11")
   field(TVST, "Strobe1")
   field(TVVL, "12")
   field(TTST, "Strobe2")
   field(TTVL, "13")
   field(FTST, "Strobe3")
   field(FTVL, "14")
   field(FFST, "Strobe4")
   field(FFVL, "15")
}

record(mbbi, "$(P)$(R)SyncOut1Mode_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_SYNC_OUT_1_MODE")
   field(ZRST, "GPO")
   field(ZRVL, "0")
   field(ONST, "AcqTrigReady")
   field(ONVL, "1")
   field(TWST, "FrameTrigReady")
   field(TWVL, "2")
   field(THST, "FrameTrigger")
   field(THVL, "3")
   field(FRST, "Exposing")
   field(FRVL, "4")
   field(FVST, "FrameReadout")
   field(FVVL, "5")
   field(SXST, "Imaging")
   field(SXVL, "6")
   field(SVST, "Acquiring")
   field(SVVL, "7")
   field(EIST, "SyncIn1")
   field(EIVL, "8")
   field(NIST, "SyncIn2")
   field(NIVL, "9")
   field(TEST, "SyncIn3")
   field(TEVL, "10")
   field(ELST, "SyncIn4")
   field(ELVL, "11")
   field(TVST, "Strobe1")
   field(TVVL, "12")
   field(TTST, "Strobe2")
   field(TTVL, "13")
   field(FTST, "Strobe3")
   field(FTVL, "14")
   field(FFST, "Strobe4")
   field(FFVL, "15")
   field(SCAN, "I/O Intr")
}

record(bo, "$(P)$(R)SyncOut1Level")
{
   field(PINI, "YES")
   field(DTYP, "asynInt32")
   field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_SYNC_OUT_1_LEVEL")
   field(ZNAM, "False")
   field(ONAM, "True")
}

record(bi, "$(P)$(R)SyncOut1Level_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_SYNC_OUT_1_LEVEL")
   field(ZNAM, "False")
   field(ONAM, "True")
   field(SCAN, "I/O Intr")
}

record(bo, "$(P)$(R)SyncOut1Invert")
{
   field(PINI, "YES")
   field(DTYP, "asynInt32")
   field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_SYNC_OUT_1_INVERT")
   field(ZNAM, "Off")
   field(ONAM, "On")
}

record(bi, "$(P)$(R)SyncOut1Invert_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_SYNC_OUT_1_INVERT")
   field(ZNAM, "Off")
   field(ONAM, "On")
   field(SCAN, "I/O Intr")
}

record(mbbo, "$(P)$(R)SyncOut2Mode")
{
   field(PINI, "YES")
   field(DTYP, "asynInt32")
   field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_SYNC_OUT_2_MODE")
   field(ZRST, "GPO")
   field(ZRVL, "0")
   field(ONST, "AcqTrigReady")
   field(ONVL, "1")
   field(TWST, "FrameTrigReady")
   field(TWVL, "2")
   field(THST, "FrameTrigger")
   field(THVL, "3")
   field(FRST, "Exposing")
   field(FRVL, "4")
   field(FVST, "FrameReadout")
   field(FVVL, "5")
   field(SXST, "Imaging")
   field(SXVL, "6")
   field(SVST, "Acquiring")
   field(SVVL, "7")
   field(EIST, "SyncIn1")
   field(EIVL, "8")
   field(NIST, "SyncIn2")
   field(NIVL, "9")
   field(TEST, "SyncIn3")
   field(TEVL, "10")
   field(ELST, "SyncIn4")
   field(ELVL, "11")
   field(TVST, "Strobe1")
   field(TVVL, "12")
   field(TTST, "Strobe2")
   field(TTVL, "13")
   field(FTST, "Strobe3")
   field(FTVL, "14")
   field(FFST, "Strobe4")
   field(FFVL, "15")
}

record(mbbi, "$(P)$(R)SyncOut2Mode_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_SYNC_OUT_2_MODE")
   field(ZRST, "GPO")
   field(ZRVL, "0")
   field(ONST, "AcqTrigReady")
   field(ONVL, "1")
   field(TWST, "FrameTrigReady")
   field(TWVL, "2")
   field(THST, "FrameTrigger")
   field(THVL, "3")
   field(FRST, "Exposing")
   field(FRVL, "4")
   field(FVST, "FrameReadout")
   field(FVVL, "5")
   field(SXST, "Imaging")
   field(SXVL, "6")
   field(SVST, "Acquiring")
   field(SVVL, "7")
   field(EIST, "SyncIn1")
   field(EIVL, "8")
   field(NIST, "SyncIn2")
   field(NIVL, "9")
   field(TEST, "SyncIn3")
   field(TEVL, "10")
   field(ELST, "SyncIn4")
   field(ELVL, "11")
   field(TVST, "Strobe1")
   field(TVVL, "12")
   field(TTST, "Strobe2")
   field(TTVL, "13")
   field(FTST, "Strobe3")
   field(FTVL, "14")
   field(FFST, "Strobe4")
   field(FFVL, "15")
   field(SCAN, "I/O Intr")
}

record(bo, "$(P)$(R)SyncOut2Level")
{
   field(PINI, "YES")
   field(DTYP, "asynInt32")
   field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_SYNC_OUT_2_LEVEL")
   field(ZNAM, "False")
   field(ONAM, "True")
}

record(bi, "$(P)$(R)SyncOut2Level_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_SYNC_OUT_2_LEVEL")
   field(ZNAM, "False")
   field(ONAM, "True")
   field(SCAN, "I/O Intr")
}

record(bo, "$(P)$(R)SyncOut2Invert")
{
   field(PINI, "YES")
   field(DTYP, "asynInt32")
   field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_SYNC_OUT_2_INVERT")
   field(ZNAM, "Off")
   field(ONAM, "On")
}

record(bi, "$(P)$(R)SyncOut2Invert_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_SYNC_OUT_2_INVERT")
   field(ZNAM, "Off")
   field(ONAM, "On")
   field(SCAN, "I/O Intr")
}

record(mbbo, "$(P)$(R)SyncOut3Mode")
{
   field(PINI, "YES")
   field(DTYP, "asynInt32")
   field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_SYNC_OUT_3_MODE")
   field(ZRST, "GPO")
   field(ZRVL, "0")
   field(ONST, "AcqTrigReady")
   field(ONVL, "1")
   field(TWST, "FrameTrigReady")
   field(TWVL, "2")
   field(THST, "FrameTrigger")
   field(THVL, "3")
   field(FRST, "Exposing")
   field(FRVL, "4")
   field(FVST, "FrameReadout")
   field(FVVL, "5")
   field(SXST, "Imaging")
   field(SXVL, "6")
   field(SVST, "Acquiring")
   field(SVVL, "7")
   field(EIST, "SyncIn1")
   field(EIVL, "8")
   field(NIST, "SyncIn2")
   field(NIVL, "9")
   field(TEST, "SyncIn3")
   field(TEVL, "10")
   field(ELST, "SyncIn4")
   field(ELVL, "11")
   field(TVST, "Strobe1")
   field(TVVL, "12")
   field(TTST, "Strobe2")
   field(TTVL, "13")
   field(FTST, "Strobe3")
   field(FTVL, "14")
   field(FFST, "Strobe4")
   field(FFVL, "15")
}

record(mbbi, "$(P)$(R)SyncOut3Mode_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_SYNC_OUT_3_MODE")
   field(ZRST, "GPO")
   field(ZRVL, "0")
   field(ONST, "AcqTrigReady")
   field(ONVL, "1")
   field(TWST, "FrameTrigReady")
   field(TWVL, "2")
   field(THST, "FrameTrigger")
   field(THVL, "3")
   field(FRST, "Exposing")
   field(FRVL, "4")
   field(FVST, "FrameReadout")
   field(FVVL, "5")
   field(SXST, "Imaging")
   field(SXVL, "6")
   field(SVST, "Acquiring")
   field(SVVL, "7")
   field(EIST, "SyncIn1")
   field(EIVL, "8")
   field(NIST, "SyncIn2")
   field(NIVL, "9")
   field(TEST, "SyncIn3")
   field(TEVL, "10")
   field(ELST, "SyncIn4")
   field(ELVL, "11")
   field(TVST, "Strobe1")
   field(TVVL, "12")
   field(TTST, "Strobe2")
   field(TTVL, "13")
   field(FTST, "Strobe3")
   field(FTVL, "14")
   field(FFST, "Strobe4")
   field(FFVL, "15")
   field(SCAN, "I/O Intr")
}

record(bo, "$(P)$(R)SyncOut3Level")
{
   field(PINI, "YES")
   field(DTYP, "asynInt32")
   field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_SYNC_OUT_3_LEVEL")
   field(ZNAM, "False")
   field(ONAM, "True")
}

record(bi, "$(P)$(R)SyncOut3Level_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_SYNC_OUT_3_LEVEL")
   field(ZNAM, "False")
   field(ONAM, "True")
   field(SCAN, "I/O Intr")
}

record(bo, "$(P)$(R)SyncOut3Invert")
{
   field(PINI, "YES")
   field(DTYP, "asynInt32")
   field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_SYNC_OUT_3_INVERT")
   field(ZNAM, "Off")
   field(ONAM, "On")
}

record(bi, "$(P)$(R)SyncOut3Invert_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_SYNC_OUT_3_INVERT")
   field(ZNAM, "Off")
   field(ONAM, "On")
   field(SCAN, "I/O Intr")
}

record(mbbo, "$(P)$(R)Strobe1Mode")
{
   field(PINI, "YES")
   field(DTYP, "asynInt32")
   field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_STROBE_1_MODE")
   field(ZRST, "AcqTrigReady")
   field(ZRVL, "0")
   field(ONST, "FrameTrigReady")
   field(ONVL, "1")
   field(TWST, "FrameTrigger")
   field(TWVL, "2")
   field(THST, "Exposing")
   field(THVL, "3")
   field(FRST, "FrameReadout")
   field(FRVL, "4")
   field(FVST, "Acquiring")
   field(FVVL, "5")
   field(SXST, "SyncIn1")
   field(SXVL, "6")
   field(SVST, "SyncIn2")
   field(SVVL, "7")
   field(EIST, "SyncIn3")
   field(EIVL, "8")
   field(NIST, "SyncIn4")
   field(NIVL, "9")
}

record(mbbi, "$(P)$(R)Strobe1Mode_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_STROBE_1_MODE")
   field(ZRST, "AcqTrigReady")
   field(ZRVL, "0")
   field(ONST, "FrameTrigReady")
   field(ONVL, "1")
   field(TWST, "FrameTrigger")
   field(TWVL, "2")
   field(THST, "Exposing")
   field(THVL, "3")
   field(FRST, "FrameReadout")
   field(FRVL, "4")
   field(FVST, "Acquiring")
   field(FVVL, "5")
   field(SXST, "SyncIn1")
   field(SXVL, "6")
   field(SVST, "SyncIn2")
   field(SVVL, "7")
   field(EIST, "SyncIn3")
   field(EIVL, "8")
   field(NIST, "SyncIn4")
   field(NIVL, "9")
   field(SCAN, "I/O Intr")
}

record(bo, "$(P)$(R)Strobe1CtlDuration")
{
   field(PINI, "YES")
   field(DTYP, "asynInt32")
   field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_STROBE_1_CTL_DURATION")
   field(ZNAM, "Off")
   field(ONAM, "On")
}

record(bi, "$(P)$(R)Strobe1CtlDuration_RBV")
{
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_STROBE_1_CTL_DURATION")
   field(ZNAM, "Off")
   field(ONAM, "On")
   field(SCAN, "I/O Intr")
}

record(ao, "$(P)$(R)Strobe1Delay")
{
   field(PINI, "YES")
   field(DTYP, "asynFloat64")
   field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_STROBE_1_DELAY")
   field(PREC, "6")
}

record(ai, "$(P)$(R)Strobe1Delay_RBV")
{
   field(DTYP, "asynFloat64")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_STROBE_1_DELAY")
   field(PREC, "6")
   field(SCAN, "I/O Intr")
}

record(ao, "$(P)$(R)Strobe1Duration")
{
   field(PINI, "YES")
   field(DTYP, "asynFloat64")
   field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_STROBE_1_DURATION")
   field(PREC, "6")
}

record(ai, "$(P)$(R)Strobe1Duration_RBV")
{
   field(DTYP, "asynFloat64")
   field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PS_STROBE_1_DURATION")
   field(PREC, "6")
   field(SCAN, "I/O Intr")
}


