JFJochReceiver: Plot is C++ struct

This commit is contained in:
2023-11-10 21:22:42 +01:00
parent 04c251d16a
commit d83b8d465d
13 changed files with 165 additions and 87 deletions

View File

@@ -16,11 +16,13 @@ const std::vector<uint64_t> &ADUHistogram::GetHistogram() const {
return histogram;
}
void ADUHistogram::GetPlot(JFJochProtoBuf::Plot &plot) const {
Plot ADUHistogram::GetPlot() const {
std::unique_lock<std::mutex> ul(m);
Plot ret;
ret.x.resize(ADU_HISTO_BIN_COUNT);
ret.y.resize(ADU_HISTO_BIN_COUNT);
for (int i = 0; i < ADU_HISTO_BIN_COUNT; i++) {
plot.add_x(ADU_HISTO_BIN_WIDTH * i + ADU_HISTO_BIN_WIDTH / 2);
plot.add_y(histogram[i]);
ret.x[i] = ADU_HISTO_BIN_WIDTH * i + ADU_HISTO_BIN_WIDTH / 2;
ret.y[i] = histogram[i];
}
}