#*************************************************************************
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
#     National Laboratory.
# Copyright (c) 2002 The Regents of the University of California, as
#     Operator of Los Alamos National Laboratory.
# EPICS BASE is distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
#*************************************************************************


menu(stringoutPOST) {
	choice(stringoutPOST_OnChange,"On Change")
	choice(stringoutPOST_Always,"Always")
}

recordtype(stringout) {
	include "dbCommon.dbd"
    %
    %/* Declare Device Support Entry Table */
    %struct stringoutRecord;
    %typedef struct stringoutdset {
    %    dset common; /*init_record returns: (-1,0)=>(failure,success)*/
    %    long (*write_stringout)(struct stringoutRecord *prec); /*(-1,0)=>(failure,success)*/
    %} stringoutdset;
    %#define HAS_stringoutdset
    %
	field(VAL,DBF_STRING) {
		prompt("Current Value")
		promptgroup("50 - Output")
		asl(ASL0)
		pp(TRUE)
		size(40)
	}
	field(OVAL,DBF_STRING) {
		prompt("Previous Value")
		special(SPC_NOMOD)
		interest(3)
		size(40)
	}



	field(DOL,DBF_INLINK) {
		prompt("Desired Output Loc")
		promptgroup("40 - Input")
		interest(1)
	}
	field(OMSL,DBF_MENU) {
		prompt("Output Mode Select")
		promptgroup("50 - Output")
		interest(1)
		menu(menuOmsl)
	}


	field(OUT,DBF_OUTLINK) {
		prompt("Output Specification")
		promptgroup("50 - Output")
		interest(1)
	}


	field(MPST,DBF_MENU) {
		prompt("Post Value Monitors")
		promptgroup("80 - Display")
		interest(1)
		menu(stringoutPOST)
	}
	field(APST,DBF_MENU) {
		prompt("Post Archive Monitors")
		promptgroup("80 - Display")
		interest(1)
		menu(stringoutPOST)
	}


        field(SIOL,DBF_OUTLINK) {
		prompt("Simulation Output Link")
		promptgroup("90 - Simulate")
		interest(1)
	}
	field(SIML,DBF_INLINK) {
		prompt("Simulation Mode Link")
		promptgroup("90 - Simulate")
		interest(1)
	}
	field(SIMM,DBF_MENU) {
		prompt("Simulation Mode")
		special(SPC_MOD)
		interest(1)
		menu(menuYesNo)
	}
	field(SIMS,DBF_MENU) {
		prompt("Simulation Mode Severity")
		promptgroup("90 - Simulate")
		interest(2)
		menu(menuAlarmSevr)
	}
    field(OLDSIMM,DBF_MENU) {
        prompt("Prev. Simulation Mode")
        special(SPC_NOMOD)
        interest(4)
        menu(menuSimm)
    }
    field(SSCN,DBF_MENU) {
        prompt("Sim. Mode Scan")
        promptgroup("90 - Simulate")
        interest(1)
        menu(menuScan)
        initial("65535")
    }
    field(SDLY,DBF_DOUBLE) {
        prompt("Sim. Mode Async Delay")
        promptgroup("90 - Simulate")
        interest(2)
        initial("-1.0")
    }
    %#include "callback.h"
    field(SIMPVT,DBF_NOACCESS) {
        prompt("Sim. Mode Private")
        special(SPC_NOMOD)
        interest(4)
        extra("epicsCallback            *simpvt")
    }


	field(IVOA,DBF_MENU) {
		prompt("INVALID output action")
		promptgroup("50 - Output")
		interest(2)
		menu(menuIvoa)
	}
	field(IVOV,DBF_STRING) {
		prompt("INVALID output value")
		promptgroup("50 - Output")
		interest(2)
		size(40)
	}


}
