# Database for NDFileJPEG driver, which saves NDArray data 
# in the JPEG file format
# Mark Rivers
# May 10, 2009

# We replace some fields in records defined in NDFile.template
# File data format 
record(mbbo, "$(P)$(R)FileFormat")
{
    field(ZRST, "JPEG")
    field(ZRVL, "0")
    field(ONST, "Invalid")
    field(ONVL, "1")
}

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

# File quality 
record(longout, "$(P)$(R)JPEGQuality")
{
    field(PINI, "YES")
    field(DTYP, "asynInt32")
    field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))JPEG_QUALITY")
    field(VAL,  "50")
    field(LOPR, "0")
    field(DRVL, "0")
    field(HOPR, "100")
    field(DRVH, "100")
}

record(longin, "$(P)$(R)JPEGQuality_RBV")
{
    field(DTYP, "asynInt32")
    field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))JPEG_QUALITY")
    field(LOPR, "0")
    field(HOPR, "100")
    field(SCAN, "I/O Intr")
}
