Indexer: Differentiate between no indexing attempted (e.g., indexer not available) and negative indexing result, so only the other one determines indexing rate
This commit is contained in:
@@ -61,6 +61,9 @@ IndexAndRefine::IndexingOutcome IndexAndRefine::DetermineLatticeAndSymmetry(Data
|
||||
auto indexer_result = indexer_->Run(experiment, recip);
|
||||
msg.indexing_time_s = indexer_result.indexing_time_s;
|
||||
|
||||
if (indexer_result.executed)
|
||||
msg.indexing_result = false;
|
||||
|
||||
if (indexer_result.lattice.empty())
|
||||
return outcome;
|
||||
|
||||
@@ -233,8 +236,6 @@ void IndexAndRefine::ProcessImage(DataMessage &msg,
|
||||
if (!indexer_ || !spot_finding_settings.indexing)
|
||||
return;
|
||||
|
||||
msg.indexing_result = false;
|
||||
|
||||
IndexingOutcome outcome(experiment);
|
||||
if (rotation_indexer)
|
||||
outcome = DetermineLatticeAndSymmetryRotation(msg);
|
||||
|
||||
@@ -20,5 +20,6 @@ IndexerResult Indexer::Run(const std::vector<Coord> &coord) {
|
||||
auto end = std::chrono::steady_clock::now();
|
||||
std::chrono::duration<float> duration = end - start;
|
||||
ret.indexing_time_s = duration.count();
|
||||
ret.executed = true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
struct IndexerResult {
|
||||
std::vector<CrystalLattice> lattice;
|
||||
float indexing_time_s;
|
||||
bool executed = false; // If indexing was not performed (due to indexer being not-available) mark it, so indexing result is marked accordingly
|
||||
};
|
||||
|
||||
class Indexer {
|
||||
|
||||
@@ -211,7 +211,7 @@ int IndexerThreadPool::GetFreeWorker() {
|
||||
|
||||
IndexerResult IndexerThreadPool::Run(const DiffractionExperiment &experiment, const std::vector<Coord> &recip) {
|
||||
if (experiment.GetIndexingAlgorithm() == IndexingAlgorithmEnum::None)
|
||||
return IndexerResult{.lattice = {}, .indexing_time_s = 0};
|
||||
return IndexerResult{.lattice = {}, .indexing_time_s = 0, .executed = false};
|
||||
|
||||
// Check if there is available worker
|
||||
const int task = GetFreeWorker();
|
||||
|
||||
Reference in New Issue
Block a user