StrongPixelSet: ReadFPGAOutput (not tested)

This commit is contained in:
2023-11-03 12:09:33 +01:00
parent 71960d5496
commit ca4b940904
2 changed files with 21 additions and 1 deletions
+19 -1
View File
@@ -2,6 +2,7 @@
#include <bitset>
#include "StrongPixelSet.h"
#include "../common/RawToConvertedGeometry.h"
StrongPixelSet::StrongPixelSet(const DiffractionExperiment &experiment)
: xpixel(experiment.GetXPixelsNum()),
@@ -122,4 +123,21 @@ size_t StrongPixelSet::Common(const StrongPixelSet &set) const {
ret++;
}
return ret;
}
}
void StrongPixelSet::ReadFPGAOutput(const DiffractionExperiment& experiment,
const DeviceOutput &output,
uint16_t module) {
auto out_ptr = (uint32_t *) output.spot_finding_result.strong_pixel;
for (int i = 0; i < RAW_MODULE_SIZE / (8 * sizeof(out_ptr[0])); i++) {
if (out_ptr[i]) {
for (int j = 0; j < 8 * sizeof(out_ptr[0]); j++) {
if (out_ptr[i] & (1 << j)) {
size_t npixel = i * 8 * sizeof(out_ptr[0])| j;
auto [col, line] = RawToConvertedCoordinate(experiment, module, npixel);
AddStrongPixel(col, line);
}
}
}
}
}