lucabaldini / xpedaq

Data acquisition software for the X-ray polarimetry explorers
GNU General Public License v2.0
0 stars 0 forks source link

Negative event times in the monitor info box #136

Closed albertomanfreda closed 7 years ago

albertomanfreda commented 7 years ago

The time field gets negative when the number of microseconds is too big (by the way, the label says seconds, so that is wrong, too). The obvious fix would be to change the underlying variable from a int to a long int. The code that get the n. of microseconds from the dataBlock is in daq/pDataBlock

int pDataBlock::microseconds(unsigned int event) const
{
  return dataWord(event, Microseconds) +
    65534*dataWord(event, Microseconds + 2);
}

so we need to return a long int here and propagate the type change everywhere. I suggest exploiting the occasion for a fixed size definition like:

typedef int64_t microsecond_t;

albertomanfreda commented 7 years ago

Fixed. We now have: typedef uint64_t microsecond_t; in xpoldetector.h, used by the pDataBlock and pEvent classes.