Commit fdbf0f1e authored by legoc's avatar legoc

corrected readEvent for some board types

parent f5af82c1
......@@ -2,7 +2,7 @@
# This configure.ac script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
AC_INIT([lstdataprocess128], [1.0.2])
AC_INIT([lstdataprocess128], [1.0.3])
LIBRARY_VERSION=1:0:2
......
......@@ -124,14 +124,14 @@ bool readEvent(Event & event, int32_t * buffer) {
event.data = (uint16_t)((*(buffer + 2)) & 0x7FFF);
} else if ((boardType == V1724_BOARD_TYPE) || (boardType == V1730_BOARD_TYPE)) {
event.timestamp = (uint32_t)(*(buffer + 1) & 0x3FFFFFFF);
event.timestamp = (uint32_t)(*(buffer + 1) & 0xFFFFFFFF);
event.energy = (uint16_t)(*(buffer + 2) & 0x7FFF);
}
// Use printBinary(buffer) to debug if necessary.
// Set the absolute time. Here the event is still in relative time.
time_type absoluteTime = event.time() * event.timeResolution();
/* time_type absoluteTime = event.time() * event.timeResolution();
// We can set the absolute time that changes the rollover and timestamp.
event.setTime(absoluteTime);
......@@ -139,7 +139,7 @@ bool readEvent(Event & event, int32_t * buffer) {
if (absoluteTime != event.time()) {
cerr << "Problem while converting relative time to absolute time" << endl;
}
*/
return true;
}
......@@ -173,7 +173,7 @@ void writeEvent(Event const & event, int32_t * buffer) {
*(buffer + 3) = 0;
} else if ((boardType == V1724_BOARD_TYPE) || (boardType == V1730_BOARD_TYPE)) {
*(buffer + 1) = (relativeTimeEvent.timestamp & 0x3FFFFFFF);
*(buffer + 1) = (relativeTimeEvent.timestamp & 0xFFFFFFFF);
*(buffer + 2) = (relativeTimeEvent.energy & 0x7FFF);
*(buffer + 3) = 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment