From 11246491ed4f58c078cf806f45c1c1949f94232b Mon Sep 17 00:00:00 2001 From: David Hale Date: Thu, 30 Jul 2026 15:14:47 -0700 Subject: [PATCH 1/2] skip fine acquisition for repeat targets --- sequencerd/sequence.cpp | 11 ++++------- sequencerd/sequence.h | 5 +++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/sequencerd/sequence.cpp b/sequencerd/sequence.cpp index 8113affb..d7704f14 100644 --- a/sequencerd/sequence.cpp +++ b/sequencerd/sequence.cpp @@ -750,8 +750,9 @@ namespace Sequencer { // during acam acquisition, enable slicecam autoexpose to try to get the // exposure time set before fine acquisition starts. + // no fine acquire on repeat targets. // - const bool dofine = this->should_fineacquire.load(); + const bool dofine = this->should_fineacquire.load() && !repeat_target(); if ( dofine ) (void)this->do_slicecam_autoexpose( true ); // start ACAM acquisition. If it fails then wait for user to continue or cancel. @@ -1047,10 +1048,7 @@ namespace Sequencer { case Sequencer::VSM_ACQUIRE: // uses virtual-mode width and offset for acquire, // but only for new targets - if ( this->target.ra_hms == this->last_ra_hms && - this->target.dec_dms == this->last_dec_dms ) { - return NO_ERROR; - } + if ( repeat_target() ) return NO_ERROR; slitcmd << this->slitwidthacquire << " " << this->slitoffsetacquire; modestr = "ACQUIRE"; break; @@ -2119,8 +2117,7 @@ namespace Sequencer { // No telescope move if target coordinates didn't change // - if ( this->target.ra_hms == this->last_ra_hms && - this->target.dec_dms == this->last_dec_dms ) { + if (repeat_target()) { this->broadcast.notice( function, "no move required for repeat target" ); return NO_ERROR; } diff --git a/sequencerd/sequence.h b/sequencerd/sequence.h index 30990eb0..fb756e44 100644 --- a/sequencerd/sequence.h +++ b/sequencerd/sequence.h @@ -326,6 +326,11 @@ namespace Sequencer { }).detach(); } + /** @brief if ra/dec of this target is the same as the last then it's a repeat + * @return true|false + */ + bool repeat_target() const { return ( target.ra_hms == last_ra_hms && + target.dec_dms == last_dec_dms ); } public: Sequence() : context(), From c2334e3550315e216094c9768c908b49a697ede2 Mon Sep 17 00:00:00 2001 From: David Hale Date: Fri, 31 Jul 2026 15:49:34 -0700 Subject: [PATCH 2/2] . --- sequencerd/sequence.cpp | 23 +++++++++++++++-------- sequencerd/sequence.h | 1 + 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/sequencerd/sequence.cpp b/sequencerd/sequence.cpp index d7704f14..793d1e0a 100644 --- a/sequencerd/sequence.cpp +++ b/sequencerd/sequence.cpp @@ -669,6 +669,10 @@ namespace Sequencer { // These things can all be done in parallel, just have to sync up at the end. // + // latch repeat state before any worker starts + this->is_repeat_target.store( this->repeat_target() ); + if ( this->is_repeat_target.load() ) this->broadcast.notice( function, "repeat target" ); + // threads to start, pair their ThreadStatusBit with the function to call std::vector>> worker_threads; @@ -744,15 +748,14 @@ namespace Sequencer { break; } - // If not a calibration target then acquire, first acam then slicecam + // If not a calibration or repeat target then acquire, first acam then slicecam // - if ( !this->target.iscal ) { + if ( !this->target.iscal && !this->is_repeat_target.load() ) { // during acam acquisition, enable slicecam autoexpose to try to get the // exposure time set before fine acquisition starts. - // no fine acquire on repeat targets. // - const bool dofine = this->should_fineacquire.load() && !repeat_target(); + const bool dofine = this->should_fineacquire.load(); if ( dofine ) (void)this->do_slicecam_autoexpose( true ); // start ACAM acquisition. If it fails then wait for user to continue or cancel. @@ -785,8 +788,9 @@ namespace Sequencer { if ( !this->target.iscal ) { // send offsets only on fineacquire, otherwise user needs to fix things - if ( this->is_fineacquire_locked.load() && - this->target_offset() == ERROR ) { + if ( !this->is_repeat_target.load() && + this->is_fineacquire_locked.load() && + this->target_offset() == ERROR ) { if (this->wait_for_user()==ABORT) { this->broadcast.notice( function, "cancelled" ); return; @@ -1048,7 +1052,7 @@ namespace Sequencer { case Sequencer::VSM_ACQUIRE: // uses virtual-mode width and offset for acquire, // but only for new targets - if ( repeat_target() ) return NO_ERROR; + if ( this->is_repeat_target.load() ) return NO_ERROR; slitcmd << this->slitwidthacquire << " " << this->slitoffsetacquire; modestr = "ACQUIRE"; break; @@ -4805,13 +4809,16 @@ namespace Sequencer { else // --------------------------------------------------------- - // clearlasttarget -- clear the last target name, allowing repointing + // clearlasttarget -- clear the last target info, allowing repointing // to the same target (otherwise move_to_target won't // repoint the telescope if the name is the same) // --------------------------------------------------------- // if ( testname == "clearlasttarget" ) { this->last_target=""; + this->last_ra_hms.clear(); + this->last_dec_dms.clear(); + this->is_repeat_target.store(false); error=NO_ERROR; } else diff --git a/sequencerd/sequence.h b/sequencerd/sequence.h index fb756e44..340f5048 100644 --- a/sequencerd/sequence.h +++ b/sequencerd/sequence.h @@ -299,6 +299,7 @@ namespace Sequencer { std::atomic should_fineacquire{true}; ///< should I use fineacquire? (user-switchable) std::atomic is_fineacquire_locked{false}; ///< is slicecam fine acquisition locked? std::atomic is_fineacquire_running{false}; ///< is slicecam fine acquisition running? + std::atomic is_repeat_target{false}; ///< same coords as last target means no slew, no acquire std::atomic is_acam_guiding{false}; ///< is acam guiding (IS_ACQUIRED)? std::atomic is_acam_acquiring{false}; ///< is acam in an acquire mode? std::atomic acam_pubtime{0}; ///< publish time (us) of latest received acamd status