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.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -3,6 +3,7 @@ recordtype(mbbo) {
|
||||
field(VAL,DBF_ENUM) {
|
||||
prompt("Desired Value")
|
||||
promptgroup(GUI_OUTPUT)
|
||||
special(SPC_DBADDR)
|
||||
asl(ASL0)
|
||||
pp(TRUE)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user