receiver: the run's lattice takes the place of the probe's answer

The lattice probe's "no lattice on the first 60 deg" stayed on the dashboard
while the main rotation run indexed the sweep. When the run reports its
lattice (the first pass's "lattice ..." note), the probe banner becomes
"lattice on the sweep: ..." and a probe answer that comes later is not shown.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HVeDQsU5a8AJUdJPgWevAK
This commit is contained in:
leonarski_fandClaude Fable 5.1 committed 2026-11-12 19:22:45 +01:00
1 parent d2e4e4d878
commit 8d4e64703b
6 files changed
+43 -5

No files matched your search

+2 -2
View File
@@ -162,12 +162,12 @@ public:
bool isaIsSet() const;
void unsetIsa();
/// <summary>
/// Answer of the early lattice probe on the first 60 degrees; empty until it answers
/// Answer of the early lattice probe on the first 60 degrees; empty until it answers, and the run&#39;s own lattice once the run has indexed
/// </summary>
std::string getProbe() const;
void setProbe(std::string const& value);
/// <summary>
/// When the probe answered, since the first image
/// When the probe answered (or the run indexed), since the first image
/// </summary>
double getProbeS() const;
void setProbeS(double const value);
+2 -2
View File
@@ -3348,11 +3348,11 @@ components:
description: ISa of the error model; absent until the run is over, or where it was not determined
probe:
type: string
description: Answer of the early lattice probe on the first 60 degrees; empty until it answers
description: Answer of the early lattice probe on the first 60 degrees; empty until it answers, and the run's own lattice once the run has indexed
probe_s:
type: number
format: double
description: When the probe answered, since the first image
description: When the probe answered (or the run indexed), since the first image
start_to_first_image_s:
type: number
format: double
+6 -1
View File
@@ -74,7 +74,12 @@ namespace {
}
void OnProgress(uint64_t done, uint64_t total) override { status.Progress(done, total); }
void OnStep(const std::string &title) override { status.Step(title); }
void OnNote(const std::string &text) override { status.Note(text); }
void OnNote(const std::string &text) override {
status.Note(text);
// The run has its lattice (RugnuxFirstPassAccept): the probe's answer on the first degrees is overtaken
if (text.starts_with("lattice "))
status.Lattice("lattice on the sweep: " + text.substr(8));
}
};
std::string StateName(RugnuxLiveState state) {
+11
View File
@@ -86,6 +86,7 @@ void RugnuxLiveStatus::Start(int64_t images_expected, std::optional<double> expe
snapshot.expected_collection_s = expected_collection_s;
start = start_received;
last_image.reset();
lattice = false;
}
void RugnuxLiveStatus::ImageReceived(std::chrono::steady_clock::time_point received) {
@@ -226,10 +227,19 @@ void RugnuxLiveStatus::Cut(const std::string &reason) {
void RugnuxLiveStatus::Probe(const std::string &text) {
std::unique_lock ul(status_mutex);
if (lattice)
return;
snapshot.probe = text;
snapshot.probe_s = Now();
}
void RugnuxLiveStatus::Lattice(const std::string &text) {
std::unique_lock ul(status_mutex);
snapshot.probe = text;
snapshot.probe_s = Now();
lattice = true;
}
void RugnuxLiveStatus::Warning(const std::string &text) {
std::unique_lock ul(status_mutex);
snapshot.warnings.push_back(text);
@@ -246,6 +256,7 @@ void RugnuxLiveStatus::Clear() {
std::unique_lock ul(status_mutex);
snapshot = RugnuxLiveSnapshot{};
last_image.reset();
lattice = false;
}
RugnuxLiveSnapshot RugnuxLiveStatus::Get() const {
+3
View File
@@ -181,6 +181,7 @@ class RugnuxLiveStatus {
// Kept since the START message, shifted to the first image by Get().
std::chrono::steady_clock::time_point start;
std::optional<std::chrono::steady_clock::time_point> last_image;
bool lattice = false; // the run has its lattice: the probe's answer is overtaken
double Since(std::chrono::steady_clock::time_point t) const;
double Now() const;
void CloseStep();
@@ -204,7 +205,9 @@ public:
// The collection is over: last_image_s is set, and the last image's time is returned (none if no image came).
std::optional<std::chrono::steady_clock::time_point> LastImage();
void Cut(const std::string &reason);
// The probe's answer, unless the run has its lattice already; Lattice: the run's, in the probe's place
void Probe(const std::string &text);
void Lattice(const std::string &text);
void Warning(const std::string &text);
void Structure(std::shared_ptr<const RugnuxStructure> structure,
std::shared_ptr<const RugnuxStructure> refined_structure = nullptr);
+19
View File
@@ -54,6 +54,25 @@ TEST_CASE("RugnuxLiveStatus_BeforeFirstImage", "[RugnuxLive]") {
CHECK(!status.LastImage());
}
TEST_CASE("RugnuxLiveStatus_RunLatticeOvertakesProbe", "[RugnuxLive]") {
RugnuxLiveStatus status;
status.Start(10, 1.0, std::chrono::steady_clock::now());
// The probe answers first, the run indexes later: the banner is the run's
status.Probe("no lattice on the first 60 deg");
CHECK(status.Get().probe == "no lattice on the first 60 deg");
status.Lattice("lattice on the sweep: monoclinic P: 35.00 29.00 63.00 90.0 105.0 90.0");
CHECK(status.Get().probe.starts_with("lattice on the sweep"));
// The run indexed before the probe answered: the probe's answer is not shown
status.Probe("no lattice on the first 60 deg");
CHECK(status.Get().probe.starts_with("lattice on the sweep"));
// The next collection starts afresh
status.Start(10, 1.0, std::chrono::steady_clock::now());
status.Probe("no lattice on the first 60 deg");
CHECK(status.Get().probe == "no lattice on the first 60 deg");
}
TEST_CASE("RugnuxLiveStatus_Clear", "[RugnuxLive]") {
RugnuxLiveStatus status;
status.Start(10, 1.0, std::chrono::steady_clock::now() - 2s);