From 8e29e864488f2b4fd5ca81d53da087426bc92044 Mon Sep 17 00:00:00 2001 From: David Hale Date: Mon, 18 May 2026 16:11:05 -0700 Subject: [PATCH] fix: camerad needed to force publish his status when other daemons start --- camerad/astrocam.cpp | 2 +- common/common.h | 4 ++-- sequencerd/sequencerd.cpp | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/camerad/astrocam.cpp b/camerad/astrocam.cpp index ac80f291..1bf97f40 100644 --- a/camerad/astrocam.cpp +++ b/camerad/astrocam.cpp @@ -62,7 +62,7 @@ namespace AstroCam { * */ void Interface::handletopic_snapshot( const nlohmann::json &jmessage_in ) { - if ( jmessage_in.contains( Topic::CAMERAD ) ) this->publish_status(); + if ( jmessage_in.contains( Topic::CAMERAD ) ) this->publish_status(true); } /***** AstroCam::Interface::handletopic_snapshot ****************************/ diff --git a/common/common.h b/common/common.h index 2e5d8f8e..c045cfea 100644 --- a/common/common.h +++ b/common/common.h @@ -211,11 +211,11 @@ namespace Common { return ERROR; } - // Initialize the message subscriber. All daemons minimally subscribe to "_snapshot" + // Initialize the message subscriber. All daemons minimally subscribe to Topic::SNAPSHOT // which causes them to publish their current status. // iface.subscriber_topics.clear(); - iface.subscriber_topics.push_back("_snapshot"); + iface.subscriber_topics.push_back(Topic::SNAPSHOT); for ( const auto &topic : topics ) { iface.subscriber_topics.push_back(topic); diff --git a/sequencerd/sequencerd.cpp b/sequencerd/sequencerd.cpp index 5a709b3e..4b9269fc 100644 --- a/sequencerd/sequencerd.cpp +++ b/sequencerd/sequencerd.cpp @@ -139,8 +139,9 @@ int main(int argc, char **argv) { } sequencerd.sequence.seq_state_manager.set_only({Sequencer::SEQ_NOTREADY}); - std::this_thread::sleep_for( std::chrono::milliseconds(200) ); + std::this_thread::sleep_for( std::chrono::milliseconds(250) ); sequencerd.sequence.publish_snapshot(); + std::this_thread::sleep_for( std::chrono::milliseconds(250) ); sequencerd.sequence.request_snapshot(); // This will pre-thread N_THREADS threads.