create second dbChannel for DBE_PROPERTY
Create second channel, and second set of filter states, for subscription to DBE_PROPERTY. Accommodate filters which drop events.
This commit is contained in:
@ -103,6 +103,10 @@ PDBSinglePV::PDBSinglePV(DBCH& chan,
|
||||
,hadevent_VALUE(false)
|
||||
,hadevent_PROPERTY(false)
|
||||
{
|
||||
if(ellCount(&chan.chan->pre_chain) || ellCount(&chan.chan->post_chain)) {
|
||||
DBCH temp(dbChannelName(chan.chan));
|
||||
this->chan2.swap(temp);
|
||||
}
|
||||
this->chan.swap(chan);
|
||||
fielddesc = std::tr1::static_pointer_cast<const pvd::Structure>(builder->dtype(this->chan));
|
||||
|
||||
@ -120,8 +124,9 @@ PDBSinglePV::~PDBSinglePV()
|
||||
|
||||
void PDBSinglePV::activate()
|
||||
{
|
||||
dbChannel *pchan = this->chan2.chan ? this->chan2.chan : this->chan.chan;
|
||||
evt_VALUE.create(provider->event_context, this->chan, &pdb_single_event, DBE_VALUE|DBE_ALARM);
|
||||
evt_PROPERTY.create(provider->event_context, this->chan, &pdb_single_event, DBE_PROPERTY);
|
||||
evt_PROPERTY.create(provider->event_context, pchan, &pdb_single_event, DBE_PROPERTY);
|
||||
}
|
||||
|
||||
pva::Channel::shared_pointer
|
||||
|
@ -30,6 +30,8 @@ struct QSRV_API PDBSinglePV : public PDBPV
|
||||
* is locked.
|
||||
*/
|
||||
DBCH chan;
|
||||
// used for DBE_PROPERTY subscription when chan has filters
|
||||
DBCH chan2;
|
||||
PDBProvider::shared_pointer provider;
|
||||
|
||||
// only for use in pdb_single_event()
|
||||
|
Reference in New Issue
Block a user