Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion acamd/acam_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1441,19 +1441,25 @@ namespace Acam {
const bool is_acquired = this->target.is_acquired.load();
const int nacquired = this->target.nacquired;
const int attempts = this->target.attempts;
const std::string filter = this->motion.get_current_filtername();
const std::string cover = this->motion.get_current_coverpos();

// unless forced, only publish if there was a change in any one of these
//
if ( !force &&
acquire_mode == this->last_status.acquire_mode &&
is_acquired == this->last_status.is_acquired &&
nacquired == this->last_status.nacquired &&
attempts == this->last_status.attempts ) return;
attempts == this->last_status.attempts &&
filter == this->last_status.filter &&
cover == this->last_status.cover ) return;

this->last_status.acquire_mode = acquire_mode;
this->last_status.is_acquired = is_acquired;
this->last_status.nacquired = nacquired;
this->last_status.attempts = attempts;
this->last_status.filter = filter;
this->last_status.cover = cover;

// assemble the telemetry into a json message
//
Expand All @@ -1465,6 +1471,8 @@ namespace Acam {
jmessage_out[Key::Acamd::ATTEMPTS] = this->target.attempts;
jmessage_out[Key::Acamd::SEEING] = this->astrometry.get_seeing();
jmessage_out[Key::Acamd::BACKGROUND] = this->astrometry.get_background();
jmessage_out[Key::Acamd::FILTER] = filter;
jmessage_out[Key::Acamd::COVER] = cover;
jmessage_out[Key::PUBTIME] = get_time_us();

try {
Expand Down Expand Up @@ -3878,6 +3886,8 @@ logwrite( function, message.str() );
iface.guide_manager.filter="error";
}

iface.publish_status(); // push filter change to subscribers

return;
}
/***** Acam::Interface::dothread_set_filter *********************************/
Expand Down
2 changes: 2 additions & 0 deletions acamd/acam_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,8 @@ namespace Acam {
bool is_acquired = false;
int nacquired = 0;
int attempts = 0;
std::string filter = "";
std::string cover = "";
} last_status;

public:
Expand Down
2 changes: 2 additions & 0 deletions acamd/acam_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -913,13 +913,15 @@ namespace Acam {
if ( cmd == ACAMD_FILTER ) {
ret = this->interface.motion.filter( args, retstring );
if (ret==NO_ERROR) this->interface.guider_settings_control(); // update Guider GUI display igores ret
if (ret==NO_ERROR) this->interface.publish_status(); // push filter change to subscribers
}
else

// set/get dust cover
//
if ( cmd == ACAMD_COVER ) {
ret = this->interface.motion.cover( args, retstring );
if (ret==NO_ERROR) this->interface.publish_status(); // push cover change to subscribers
}
else

Expand Down
31 changes: 18 additions & 13 deletions sequencerd/sequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2455,13 +2455,13 @@ namespace Sequencer {
/***** Sequencer::Sequence::abort_process *********************************/
/**
* @brief tries to abort everything happening
* @details Sets SEQ_ABORTING via RAII for the duration of the abort,
* then on exit:
* - if aborting during RUNNING or PAUSED, restores SEQ_READY
* - if aborting during STARTING or STOPPING, sets SEQ_FAILED
* @details Sets SEQ_ABORTING for the duration of the abort, then on exit
* selects a one-hot terminal seqstate:
* - aborting during STARTING or STOPPING sets SEQ_FAILED
* (indeterminate lifecycle state; requires startup/shutdown
* to clear)
* - otherwise leaves seqstate unchanged on exit
* - otherwise the terminal state reflects actual readiness:
* SEQ_READY when all daemons are ready, else SEQ_NOTREADY
*
*/
void Sequence::abort_process() {
Expand Down Expand Up @@ -2538,17 +2538,22 @@ namespace Sequencer {
}
}

// Exit SEQ_ABORTING to a strict one-hot terminal state chosen from the
// snapshot taken at entry. If neither condition applies (e.g. abort
// invoked while READY/NOTREADY/FAILED) we leave the state at NOTREADY
// so callers never see SEQ_ABORTING linger and no prior bit is retained.
// Exit SEQ_ABORTING to a strict one-hot terminal state. A lifecycle abort
// (STARTING/STOPPING) leaves hardware in an indeterminate state, so it must
// go to SEQ_FAILED (cleared only by a subsequent startup/shutdown).
// Otherwise the abort has only stopped activity, so the terminal state is
// the system's actual readiness: SEQ_READY when every subsystem is ready,
// else SEQ_NOTREADY. This mirrors the readiness contract used by startup()
// (the are_all_set gate) and broadcast_daemonstate(), so an abort issued
// while already READY with all daemons up returns to READY -- and one
// issued after a daemon dropped correctly settles on NOTREADY.
//
if ( abort_during_run ) {
this->seq_state_manager.set_only( {Sequencer::SEQ_READY} );
}
else if ( abort_during_lifecycle ) {
if ( abort_during_lifecycle ) {
this->seq_state_manager.set_only( {Sequencer::SEQ_FAILED} );
}
else if ( this->daemon_manager.are_all_set() ) {
this->seq_state_manager.set_only( {Sequencer::SEQ_READY} );
}
else {
this->seq_state_manager.set_only( {Sequencer::SEQ_NOTREADY} );
}
Expand Down
3 changes: 3 additions & 0 deletions utils/seqgui/broadcast_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ def __init__(self, parent=None):
def init_ui(self):
self.setReadOnly(True)
self.setMaximumBlockCount(2000)
# Don't wrap long lines; show a horizontal scrollbar instead (as needed),
# mirroring the vertical one.
self.setLineWrapMode(QPlainTextEdit.NoWrap)
font = QFont("Monospace")
font.setStyleHint(QFont.TypeWriter)
font.setPointSize(9)
Expand Down
Loading
Loading