[Daqpp-forum] bug
Brought to you by:
lacasta
|
From: Andrej S. <and...@ij...> - 2007-01-31 22:02:24
|
Selection criteria for observers (in vmedaq.cc, line 128, marked below) i=
s
leaking. Most notably:
0xb0000 [SecDetData] & 0x10000 [NormalData] =3D=3D 0x10000 [NormalData]
( b=3D[1011] 1=3D[0001] )
and handler for SecDetData gets called on NormalData. I know that the
obvious criteria ip->second =3D=3D data_type was replaced to allow for ge=
neral
purpose observers (with ip->second=3D0xffffffff). I suggest an or:
if (ip->second =3D=3D data_type || ip->second =3D=3D 0xffffffff)
Will correct here.
Cheers
Andrej
Attached - pieces of code that should show the error:
vmedaq.cc[121-139]:
case DataRecord:
evt_num =3D data[1] & 0xffffff;
if ( _last_event !=3D evt_num ) {
NewEvent(evt_num);
_last_event =3D evt_num;
}
for (ip=3Dobservers.begin();ip!=3Dobservers.end();++ip) {
--> if ( (ip->second & data_type) =3D=3D data_type) {
if (evt_num !=3D ip->first->last_event())
{
if (ip->first->last_event()>=3D0)
ip->first->onEndOfEvent(ip->first->last_event(),
ip->first->module(id));
ip->first->last_event( evt_num );
}
ip->first->DataRecord(data);
}
}
break;
DataFormat.h[171-180]:
enum DataType {
NormalData =3D 0x10000,
PulseData =3D 0x20000,
ScanData =3D 0x30000,
ADCdata =3D 0x40000,
CSPRINTdata =3D 0x80000,
FBTDCdata =3D 0x90000,
SIS3300data =3D 0xa0000,
SecDetData =3D 0xb0000
};
|