#=================================================================#
# Template file: NDFileNexus.template
# Database for NDFileNexus driver, which saves files for NDArray data.

include "NDFile.template"
include "NDPluginBase.template"

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

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


# These records are specific to NeXus file format
# Template File path.
record(waveform, "$(P)$(R)TemplateFilePath")
{
    field(PINI, "YES")
    field(DTYP, "asynOctetWrite")
    field(INP,  "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))TEMPLATE_FILE_PATH")
    field(FTVL, "CHAR")
    field(NELM, "256")
    info(autosaveFields, "VAL")
}

record(waveform, "$(P)$(R)TemplateFilePath_RBV")
{
    field(DTYP, "asynOctetRead")
    field(INP,  "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))TEMPLATE_FILE_PATH")
    field(FTVL, "CHAR")
    field(NELM, "256")
    field(SCAN, "I/O Intr")
}

# Template Filename
record(waveform, "$(P)$(R)TemplateFileName")
{
    field(PINI, "YES")
    field(DTYP, "asynOctetWrite")
    field(INP,  "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))TEMPLATE_FILE_NAME")
    field(FTVL, "CHAR")
    field(NELM, "256")
    info(autosaveFields, "VAL")
}

record(waveform, "$(P)$(R)TemplateFileName_RBV")
{
    field(DTYP, "asynOctetRead")
    field(INP,  "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))TEMPLATE_FILE_NAME")
    field(FTVL, "CHAR")
    field(NELM, "256")
    field(SCAN, "I/O Intr")
}

record(bi, "$(P)$(R)FileTemplateValid")
{
    field(DTYP, "asynInt32")
    field(INP,  "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))TEMPLATE_FILE_VALID")
    field(ZNAM, "No")
    field(ONAM, "Yes")
    field(SCAN, "I/O Intr")
}

