From ba306d9b26285f79b24a8726e7aee269fdf29063 Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Mon, 8 Jul 2002 12:31:17 +0000 Subject: [PATCH] mbboRecord now implements method cvt_dbaddr for the VAL field. If no state va les or state strings are defined then it sets field_type and dbr_field_type to DBF_USHORT. --- src/rec/mbboRecord.c | 20 +++++++++++++++++++- src/rec/mbboRecord.dbd | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/rec/mbboRecord.c b/src/rec/mbboRecord.c index 510d883d9..4bd84fefd 100644 --- a/src/rec/mbboRecord.c +++ b/src/rec/mbboRecord.c @@ -91,7 +91,7 @@ static long init_record(); static long process(); static long special(); #define get_value NULL -#define cvt_dbaddr NULL +static long cvt_dbaddr(); #define get_array_info NULL #define put_array_info NULL #define get_units NULL @@ -321,6 +321,24 @@ static long special(paddr,after) } } +static long cvt_dbaddr(paddr) + struct dbAddr *paddr; +{ + struct mbboRecord *pmbbo=(struct mbboRecord *)paddr->precord; + int index; + + index = dbGetFieldIndex(paddr); + if(index!=mbboRecordVAL) { + recGblDbaddrError(S_db_badField,paddr,"mbbo: cvt_dbaddr"); + return(0); + } + if(!pmbbo->sdef) { + paddr->field_type = DBF_USHORT; + paddr->dbr_field_type = DBF_USHORT; + } + return(0); +} + static long get_enum_str(paddr,pstring) struct dbAddr *paddr; char *pstring; diff --git a/src/rec/mbboRecord.dbd b/src/rec/mbboRecord.dbd index 59260c220..6564baa64 100644 --- a/src/rec/mbboRecord.dbd +++ b/src/rec/mbboRecord.dbd @@ -3,6 +3,7 @@ recordtype(mbbo) { field(VAL,DBF_ENUM) { prompt("Desired Value") promptgroup(GUI_OUTPUT) + special(SPC_DBADDR) asl(ASL0) pp(TRUE) }