# Database for NDOverlays
# Mark Rivers
# March 22, 2010

###################################################################
#  These records control the label for the overlay                #
###################################################################
record(stringout, "$(P)$(R)Name")
{
    field(PINI, "YES")
    field(DTYP, "asynOctetWrite")
    field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))NAME")
    field(VAL,  "$(NAME)")
}

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


###################################################################
#  These records control whether this overlay is used             #
###################################################################
record(bo, "$(P)$(R)Use")
{
    field(PINI, "YES")
    field(DTYP, "asynInt32")
    field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))USE")
    field(VAL,  "0")
    field(ZNAM, "No")
    field(ONAM, "Yes")
}

record(bi, "$(P)$(R)Use_RBV")
{
    field(DTYP, "asynInt32")
    field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))USE")
    field(ZNAM, "No")
    field(ONAM, "Yes")
    field(ZSV,  "NO_ALARM")
    field(OSV,  "MINOR")
    field(SCAN, "I/O Intr")
}

###################################################################
#  These records control the overlay definition                   #
###################################################################

record(longout, "$(P)$(R)PositionXLink")
{
    field(DOL,  "$(XPOS) CP MS")
    field(OMSL, "closed_loop")
    field(OUT, "$(P)$(R)PositionX PP")
}

record(longout, "$(P)$(R)PositionX")
{
    field(PINI, "YES")
    field(DTYP, "asynInt32")
    field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))OVERLAY_POSITION_X")
    field(LOPR, "1")
    field(HOPR, "1024")
    field(VAL,  "1")
}

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

record(longout, "$(P)$(R)PositionYLink")
{
    field(DOL,  "$(YPOS) CP MS")
    field(OMSL, "closed_loop")
    field(OUT, "$(P)$(R)PositionY PP")
}

record(longout, "$(P)$(R)PositionY")
{
    field(PINI, "YES")
    field(DTYP, "asynInt32")
    field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))OVERLAY_POSITION_Y")
    field(LOPR, "1")
    field(HOPR, "1024")
    field(VAL,  "1")
}

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

record(longout, "$(P)$(R)SizeXLink")
{
    field(DOL,  "$(XSIZE) CP MS")
    field(OMSL, "closed_loop")
    field(OUT, "$(P)$(R)SizeX PP")
}

record(longout, "$(P)$(R)SizeX")
{
    field(PINI, "YES")
    field(DTYP, "asynInt32")
    field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))OVERLAY_SIZE_X")
    field(LOPR, "1")
    field(HOPR, "1024")
    field(VAL,  "1")
}

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

record(longout, "$(P)$(R)SizeYLink")
{
    field(DOL,  "$(YSIZE) CP MS")
    field(OMSL, "closed_loop")
    field(OUT, "$(P)$(R)SizeY PP")
}

record(longout, "$(P)$(R)SizeY")
{
    field(PINI, "YES")
    field(DTYP, "asynInt32")
    field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))OVERLAY_SIZE_Y")
    field(LOPR, "1")
    field(HOPR, "1024")
    field(VAL,  "1")
}

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

record(mbbo, "$(P)$(R)Shape")
{
    field(PINI, "YES")
    field(DTYP, "asynInt32")
    field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))OVERLAY_SHAPE")
    field(ZRST, "Cross")
    field(ZRVL, "0")
    field(ONST, "Rectangle")
    field(ONVL, "1")
    field(VAL,  "$(SHAPE)")
}

record(mbbi, "$(P)$(R)Shape_RBV")
{
    field(DTYP, "asynInt32")
    field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))OVERLAY_SHAPE")
    field(ZRST, "Cross")
    field(ZRVL, "0")
    field(ONST, "Rectangle")
    field(ONVL, "1")
    field(SCAN, "I/O Intr")
}

record(mbbo, "$(P)$(R)DrawMode")
{
    field(PINI, "YES")
    field(DTYP, "asynInt32")
    field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))OVERLAY_DRAW_MODE")
    field(ZRST, "Set")
    field(ZRVL, "0")
    field(ONST, "XOR")
    field(ONVL, "1")
}

record(mbbi, "$(P)$(R)DrawMode_RBV")
{
    field(DTYP, "asynInt32")
    field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))OVERLAY_DRAW_MODE")
    field(ZRST, "Set")
    field(ZRVL, "0")
    field(ONST, "XOR")
    field(ONVL, "1")
    field(SCAN, "I/O Intr")
}

record(longout, "$(P)$(R)Red")
{
    field(PINI, "YES")
    field(DTYP, "asynInt32")
    field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))OVERLAY_RED")
    field(VAL,  "1")
}

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

record(longout, "$(P)$(R)Green")
{
    field(PINI, "YES")
    field(DTYP, "asynInt32")
    field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))OVERLAY_GREEN")
    field(VAL,  "1")
}

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

record(longout, "$(P)$(R)Blue")
{
    field(PINI, "YES")
    field(DTYP, "asynInt32")
    field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))OVERLAY_BLUE")
    field(VAL,  "1")
}

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

###################################################################
#  These records set the HOPR and LOPR values for the position    #
#  and size to the maximum for the input array                    #
###################################################################

record(longin, "$(P)$(R)MaxSizeX")
{
    field(INP,  "$(P)$(O)MaxSizeX_RBV CP")
    field(FLNK, "$(P)$(R)SetXHOPR.PROC PP")
}

record(dfanout, "$(P)$(R)SetXHOPR")
{
    field(DOL,  "$(P)$(R)MaxSizeX NPP")
    field(OMSL, "closed_loop")
    field(OUTA, "$(P)$(R)PositionX.HOPR NPP")
    field(OUTB, "$(P)$(R)SizeX.HOPR NPP")
}

record(longin, "$(P)$(R)MaxSizeY")
{
    field(INP,  "$(P)$(O)MaxSizeY_RBV CP")
    field(FLNK, "$(P)$(R)SetYHOPR.PROC PP")
}

record(dfanout, "$(P)$(R)SetYHOPR")
{
    field(DOL,  "$(P)$(R)MaxSizeY NPP")
    field(OMSL, "closed_loop")
    field(OUTA, "$(P)$(R)PositionY.HOPR NPP")
    field(OUTB, "$(P)$(R)SizeY.HOPR NPP")
}

