Commit e0583d33 authored by legoc's avatar legoc
Browse files

Bugfix: writing 64 for the number of channels of a board writes 0 (6 bits)....

Bugfix: writing 64 for the number of channels of a board writes 0 (6 bits). Solution is to convert 0 to 64 when reading the value.
parent 0874ac58
Version 1.3.3, ?
Version 1.3.3, 2019-10-17
-------------------------
- Improved lstexporter128 with the possibility to filter a set of channels with a ratio.
- Bugfix: writing 64 for the number of channels of a board writes 0 (6 bits). Solution is to convert 0 to 64 when reading the value.
Version 1.3.2, 2019-05-28
......
......@@ -2,8 +2,8 @@
# This configure.ac script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
AC_INIT([lstdataprocess128], [1.3.2])
LIBRARY_VERSION=1:3:2
AC_INIT([lstdataprocess128], [1.3.3])
LIBRARY_VERSION=1:3:3
AM_INIT_AUTOMAKE([subdir-objects])
......
......@@ -129,7 +129,17 @@ uint32_t readListModeContextFromBinary(ListModeContext & listModeContext, uint32
listModeContext.crateBoard.crates[crate].boards[board].eventType = (uint16_t)((data[i] >> 16) & 0xFFFF);
listModeContext.crateBoard.crates[crate].boards[board].crate = crate;
listModeContext.crateBoard.crates[crate].boards[board].nbChannels = (uint16_t)((data[i] >> 6) & 0x3F);
uint16_t nbChannels = (uint16_t)((data[i] >> 6) & 0x3F);
// Special case when nbChannels is 0: it is not possible to write 64 on 6 bits.
// So we suppose that if the read value is 0, it was in fact 64 that was written.
if (nbChannels == 0) {
nbChannels = 64;
}
listModeContext.crateBoard.crates[crate].boards[board].nbChannels = nbChannels;
listModeContext.crateBoard.crates[crate].boards[board].boardType = (BoardType) (data[i] & 0x3F);
boardIndexMap[crate]++;
......
......@@ -163,7 +163,7 @@ void Rates::finish() {
void Rates::printRates() {
cout << "channel rates" << endl;
cout << "channel rates (Hz)" << endl;
BoardIterator b;
int32_t channel = 0;
......@@ -171,7 +171,7 @@ void Rates::printRates() {
cout << "crate " << (int)b.crate() << " board " << (int)b.board() << endl;
for (int32_t c = 0; c < (*b).nbChannels; ++c) {
cout << "\t" << setw(5) << c << setw(10) << _channelRates[channel] << endl;
cout << "\t" << setw(5) << c << setw(10) << std::setprecision(3) << _channelRates[channel] << endl;
++channel;
}
cout << endl;
......
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