Stream receivers: one Cancel, with the analysis cut through a virtual Cut

JFJochReceiverRugnuxRotation and JFJochReceiverRugnuxStills had the same
Cancel(bool). It now lives in JFJochReceiverStream, which calls a virtual Cut that
does nothing for a receiver with no analysis after the images. The empty
JFJochReceiverRugnuxRotation::SetSpotFindingSettings goes: the base only stores
settings the service has already checked, and nothing in the rotation receiver
reads them. Fixes the indentation RotationIndexer.cpp's settings key was left
with.

One difference for Lite and the dark mask: a non-silent cancel that comes after
the end message no longer marks the collection cancelled, as for the rugnux
receivers. Every image is in by then; the window is the end message and the
writer's finalisation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HVeDQsU5a8AJUdJPgWevAK
This commit is contained in:
leonarski_fandClaude Opus 5.5 committed 2026-11-08 10:04:06 +01:00
1 parent 3047ccd13e
commit 659b5da52d
7 files changed
+10 -40

No files matched your search

@@ -152,7 +152,7 @@ namespace {
static_cast<double>(x.GetFFT_NumVectors()), x.GetFFT_HighResolution_A(),
x.GetFFT_MinAngle_deg(), x.GetFFT_MaxAngle_deg(), x.GetUnitCellDistTolerance(),
x.GetUnitCellAngleTolerance_deg(), static_cast<double>(x.GetIndexIceRings()),
static_cast<double>(x.GetMaxExtraLattices()), static_cast<double>(x.GetLatticeClassDemoted()),
static_cast<double>(x.GetMaxExtraLattices()), static_cast<double>(x.GetLatticeClassDemoted()),
static_cast<double>(x.GetViableCellMinSpots()), static_cast<double>(x.GetAlgorithm()),
static_cast<double>(x.GetGeomRefinementAlgorithm()),
static_cast<double>(x.GetIndexingThreads()), static_cast<double>(x.GetRefineThreads())});
-15
View File
@@ -392,17 +392,6 @@ void JFJochReceiverRugnuxRotation::AddToEndMessage(EndMessage &message) {
}
}
void JFJochReceiverRugnuxRotation::Cancel(bool silent) {
detector_finished = true;
// The silent cancel is the detector reading idle at the end of every collection: rugnux goes on.
if (silent)
return;
// Ends the collection while images still arrive; in every case the analysis is cut and the end message goes out
if (!end_message_received)
JFJochReceiver::Cancel(silent);
Cut("cancel");
}
void JFJochReceiverRugnuxRotation::Cut(const std::string &reason) {
std::unique_lock ul(rugnux_mutex);
if (cut || rugnux_result)
@@ -417,10 +406,6 @@ void JFJochReceiverRugnuxRotation::Cut(const std::string &reason) {
logger.Debug("rugnux live: analysis cut ({}) - the end message carries what is established", reason);
}
void JFJochReceiverRugnuxRotation::SetSpotFindingSettings(const SpotFindingSettings &in_spot_finding_settings) {
// A rotation run takes rugnux's own spot finding
}
JFJochReceiverOutput JFJochReceiverRugnuxRotation::GetFinalStatistics() const {
JFJochReceiverOutput ret = JFJochReceiver::GetFinalStatistics();
ret.analysis_warning = skipped_warning;
+1 -7
View File
@@ -16,8 +16,6 @@
// A rotation collection forwarded to the writer and analysed by rugnux, which reads it back from the image buffer
class JFJochReceiverRugnuxRotation : public JFJochReceiverStream {
using JFJochReceiverStream::Cancel;
JFJochImageBufferReader reader;
const int rugnux_nthreads;
@@ -47,7 +45,7 @@ class JFJochReceiverRugnuxRotation : public JFJochReceiverStream {
void RugnuxThread();
void ProbeThread();
// Stops rugnux where it is, the end message goes out with what it established; reason "deadline" or "cancel"
void Cut(const std::string &reason);
void Cut(const std::string &reason) override;
void AddToEndMessage(EndMessage &message) override;
public:
JFJochReceiverRugnuxRotation(const DiffractionExperiment &experiment,
@@ -68,9 +66,5 @@ public:
ZMQMetadataSocket *zmq_metadata_socket = nullptr);
~JFJochReceiverRugnuxRotation() override;
void Cancel(bool silent) override;
JFJochReceiverOutput GetFinalStatistics() const override;
void SetSpotFindingSettings(const SpotFindingSettings &spot_finding_settings) override;
};
-11
View File
@@ -186,17 +186,6 @@ void JFJochReceiverRugnuxStills::AddToEndMessage(EndMessage &message) {
stills->FillEndMessage(message);
}
void JFJochReceiverRugnuxStills::Cancel(bool silent) {
detector_finished = true;
// The silent cancel is the detector reading idle at the end of every collection: rugnux goes on.
if (silent)
return;
// Ends the collection while images still arrive; in every case the model step is cut and the end message goes out
if (!end_message_received)
JFJochReceiver::Cancel(silent);
Cut("cancel");
}
void JFJochReceiverRugnuxStills::Cut(const std::string &reason) {
std::unique_lock ul(stills_mutex);
if (cut)
+1 -5
View File
@@ -13,8 +13,6 @@
// A serial collection analysed frame by frame at the geometry of a pre-pass, which the start message waits for
class JFJochReceiverRugnuxStills : public JFJochReceiverStream, public StillsSink {
using JFJochReceiverStream::Cancel;
const std::shared_ptr<const RugnuxModel> model;
const double deadline_s; // after the last image, the model step is cut (0 = never)
RugnuxLiveStatus &live_status;
@@ -35,7 +33,7 @@ class JFJochReceiverRugnuxStills : public JFJochReceiverStream, public StillsSin
void SendAnalysedImage(DataMessage &message, const AzimuthalIntegrationProfile &profile) override;
SpotFindingSettings AnalysisSettings() override;
void StillsSetupFailed(const JFJochException &error) override;
void Cut(const std::string &reason);
void Cut(const std::string &reason) override;
void AddToEndMessage(EndMessage &message) override;
public:
JFJochReceiverRugnuxStills(const DiffractionExperiment &experiment,
@@ -55,6 +53,4 @@ public:
ZMQMetadataSocket *zmq_metadata_socket = nullptr,
IndexerThreadPool *indexing_thread_pool = nullptr);
~JFJochReceiverRugnuxStills() override;
void Cancel(bool silent) override;
};
+6 -1
View File
@@ -246,9 +246,14 @@ void JFJochReceiverStream::StopReceiver() {
}
void JFJochReceiverStream::Cancel(bool silent) {
JFJochReceiver::Cancel(silent);
// A silent cancel is not a request to abort, it says the detector has finished. It bounds the wait for the start message.
detector_finished = true;
if (silent)
return;
// Once the end message is in, the images are all there: a cancel only cuts the analysis that goes on after them.
if (!end_message_received)
JFJochReceiver::Cancel(silent);
Cut("cancel");
}
void JFJochReceiverStream::AddToEndMessage(EndMessage &message) {
+1
View File
@@ -49,6 +49,7 @@ protected:
virtual void OnImage(uint32_t id, DataMessage &message, std::chrono::steady_clock::time_point received) = 0;
virtual void FinishCollection(); // all images are in: end message, writer, status
virtual int64_t ExpectedImages() const;
virtual void Cut(const std::string &reason) {} // the analysis that goes on after the images, if there is one
void AddToEndMessage(EndMessage &message) override;
uint64_t GetImagesDropped() const override { return image_puller.GetDroppedImages(); }