MXAnalysisAfterFPGA, ImageBuffer: remove unused members and functions
- MXAnalysisAfterFPGA: the ReadFromCPU mutex (each frame thread owns its analyzer), an uncalled global stddev(), an unused constant and include. - ImageBuffer: slots_idle was counted but never read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HVeDQsU5a8AJUdJPgWevAK
This commit is contained in:
1 parent
51b2ee8804
commit
b0db946583
4 files changed
-28
No files matched your search
@@ -69,7 +69,6 @@ void ImageBuffer::StartMeasurement(size_t in_location_size) {
|
||||
slots_sending = 0;
|
||||
slots_preparation = 0;
|
||||
slots_in_preview = 0;
|
||||
slots_idle = 0;
|
||||
|
||||
// Clear queue and vectors
|
||||
while (!free_slots.empty())
|
||||
@@ -116,8 +115,6 @@ ZeroCopyReturnValue *ImageBuffer::GetImageSlot(int64_t keep_free) {
|
||||
auto i = free_slots.front();
|
||||
free_slots.pop();
|
||||
|
||||
if (v[i].status == ImageBufferEntryStatus::Idle)
|
||||
--slots_idle;
|
||||
v[i].status = ImageBufferEntryStatus::InPreparation;
|
||||
v[i].image_number = INT64_MIN;
|
||||
v[i].image_size = 0;
|
||||
@@ -181,7 +178,6 @@ void ImageBuffer::ReleaseSlot(uint32_t location) {
|
||||
if (v[location].status != ImageBufferEntryStatus::Sending)
|
||||
return;
|
||||
|
||||
++slots_idle;
|
||||
--slots_sending;
|
||||
v[location].status = ImageBufferEntryStatus::Idle;
|
||||
free_slots.push(location);
|
||||
|
||||
@@ -47,7 +47,6 @@ class ImageBuffer {
|
||||
int64_t slots_preparation = 0;
|
||||
int64_t slots_sending = 0;
|
||||
int64_t slots_in_preview = 0;
|
||||
int64_t slots_idle = 0;
|
||||
|
||||
bool disable_requests = true; // All requests fail in this state
|
||||
int64_t counter = 0; // Counter is increased when something changes in the image buffer
|
||||
|
||||
@@ -6,28 +6,9 @@
|
||||
#include <span>
|
||||
|
||||
#include "spot_finding/DetModuleSpotFinder_cpu.h"
|
||||
#include "../common/CUDAWrapper.h"
|
||||
#include "../common/JFJochException.h"
|
||||
#include "spot_finding/SpotUtils.h"
|
||||
|
||||
double stddev(const std::vector<float> &v) {
|
||||
if (v.size() <= 1)
|
||||
return 0.0;
|
||||
|
||||
double mean = 0.0f;
|
||||
|
||||
for (const auto &i: v)
|
||||
mean += i;
|
||||
mean /= v.size();
|
||||
|
||||
double stddev = 0.0f;
|
||||
for (const auto &i: v)
|
||||
stddev += (i - mean) * (i - mean);
|
||||
|
||||
return sqrt(stddev / (v.size() - 1));
|
||||
}
|
||||
|
||||
|
||||
MXAnalysisAfterFPGA::MXAnalysisAfterFPGA(const DiffractionExperiment &in_experiment,
|
||||
const AzimuthalIntegrationMapping &in_integration,
|
||||
IndexAndRefine &indexer)
|
||||
@@ -84,8 +65,6 @@ void MXAnalysisAfterFPGA::ReadFromFPGA(const DeviceOutput *output, const SpotFin
|
||||
}
|
||||
|
||||
void MXAnalysisAfterFPGA::ReadFromCPU(DeviceOutput *output, const SpotFindingSettings &settings, size_t module_number) {
|
||||
std::unique_lock ul(read_from_cpu_mutex);
|
||||
|
||||
if (state == State::Disabled || !find_spots || !settings.enable) {
|
||||
state = State::Disabled;
|
||||
} else {
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "IndexAndRefine.h"
|
||||
|
||||
class MXAnalysisAfterFPGA {
|
||||
mutable std::mutex read_from_cpu_mutex;
|
||||
const DiffractionExperiment &experiment;
|
||||
const AzimuthalIntegrationMapping &integration;
|
||||
IndexAndRefine &indexer;
|
||||
@@ -18,7 +17,6 @@ class MXAnalysisAfterFPGA {
|
||||
|
||||
bool find_spots = false;
|
||||
std::vector<DiffractionSpot> spots;
|
||||
constexpr static const float spot_distance_threshold_pxl = 2.0f;
|
||||
|
||||
std::vector<float> arr_mean;
|
||||
std::vector<float> arr_sttdev;
|
||||
|
||||
Reference in new issue
Block a user