From b3ac81923a71a818d894f861bcd6e6cf35bb69ea Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Sat, 13 Aug 2016 14:00:57 +0200 Subject: [PATCH] cas: update enum string table on updates for enum type data --- src/cas/generic/casPVI.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/cas/generic/casPVI.cc b/src/cas/generic/casPVI.cc index 7f1b1a024..0b02a6cbf 100644 --- a/src/cas/generic/casPVI.cc +++ b/src/cas/generic/casPVI.cc @@ -221,8 +221,9 @@ void casPVI::updateEnumStringTableAsyncCompletion ( const gdd & resp ) assert ( gdd_status == 0 ); // - // preallocate the correct amount + // clear and preallocate the correct amount // + this->enumStrTbl.clear (); this->enumStrTbl.reserve ( count ); if ( resp.primitiveType() == aitEnumString ) { @@ -260,6 +261,18 @@ void casPVI::updateEnumStringTableAsyncCompletion ( const gdd & resp ) void casPVI::postEvent ( const casEventMask & select, const gdd & event ) { epicsGuard < epicsMutex > guard ( this->mutex ); + // if this is a DBE_PROPERTY event for an enum type + // update the enum string table + if ( (select & this->pCAS->propertyEventMask()).eventsSelected() ) { + const gdd *menu = NULL; + if ( event.applicationType() == gddAppType_dbr_gr_enum ) + menu = event.getDD( gddAppTypeIndex_dbr_gr_enum_enums ); + else if ( event.applicationType() == gddAppType_dbr_ctrl_enum ) + menu = event.getDD( gddAppTypeIndex_dbr_ctrl_enum_enums ); + if ( menu ) + updateEnumStringTableAsyncCompletion( *menu ); + } + if ( this->nMonAttached ) { // we are paying some significant locking overhead for // these diagnostic counters