From 311120df6e316aada557bf3119bc39ec36a55007 Mon Sep 17 00:00:00 2001 From: Elijah A-B Date: Sun, 9 Nov 2025 21:31:21 -0800 Subject: [PATCH 1/3] edits for tracking camera usage pre camera2.0 --- camerad/archon.cpp | 54 +++++++++++++++++++++++++++++++++++++++++++++ camerad/archon.h | 3 +++ camerad/camerad.cpp | 9 +++++++- 3 files changed, 65 insertions(+), 1 deletion(-) diff --git a/camerad/archon.cpp b/camerad/archon.cpp index 4260f76..a14ac39 100644 --- a/camerad/archon.cpp +++ b/camerad/archon.cpp @@ -39,6 +39,7 @@ namespace Archon { this->is_longexposure_set = false; this->is_window = false; this->is_autofetch = false; + this->is_freerun = false; this->is_zmq = false; this->win_hstart = 0; this->win_hstop = 2047; @@ -4421,6 +4422,59 @@ long Interface::archon_cmd(std::string cmd, std::string &reply) { } /**************** Archon::Interface::autofetch *******************************/ + /**************** Archon::Interface::set_freerun *******************************/ + /** + * @fn set_freerun + * @brief turns freerun mode on and off + * @param set_state, string "TRUE, FALSE, 0, or 1" + * @return ERROR or NO_ERROR + * + * NOTE: Manipulates EXPOSE and Start Params and reloads acf file + */ + long Interface::set_freerun(std::string set_state){ + //Iniciate variables and messages for logs + std::string function = "Archon::Interface::set_freerun"; + std::stringstream message; + long error = NO_ERROR; + // If something is passed then try to use it to set the "freerun" state + // + if ( !set_state.empty() ) { + try { + std::transform( set_state.begin(), set_state.end(), set_state.begin(), ::toupper ); // make uppercase + if (set_state == "TRUE" || set_state == "1") { + //set expose and start on the archon or acf to 1 + + //reload the acf file + + //log + this->is_freerun = true; + + } + else { + //set expose and start on acf or archon to 0 + + //reload acf file + + //log + this->is_freerun = false; + } + } + catch (...) { + message.str(""); message << "unknown exception converting freerun state " << set_state << " to uppercase"; + this->camera.log_error( function, message.str() ); + return ERROR; + } + } + if (error != NO_ERROR) { + message.str(""); message << "setting freerun state to " << set_state; + this->camera.log_error( function, message.str() ); + return ERROR; + } + + return (error); + } + /**************** Archon::Interface::set_freerun *******************************/ + /**************** Archon::Interface::zmq ******************************/ /** * @fn zmq diff --git a/camerad/archon.h b/camerad/archon.h index b7f6067..779ec62 100644 --- a/camerad/archon.h +++ b/camerad/archon.h @@ -151,6 +151,7 @@ namespace Archon { bool is_longexposure_set; //!< true for long exposure mode (exptime in sec), false for exptime in msec bool is_window; //!< true if in window mode for h2rg, false if not bool is_autofetch; + bool is_freerun; bool is_zmq; int win_hstart; int win_hstop; @@ -281,6 +282,8 @@ namespace Archon { long autofetch(std::string state_in, std::string &state_out); + long set_freerun(std::string set_state); + long zmq(std::string state_in, std::string &state_out); long int write_to_zmq(const std::string& message); diff --git a/camerad/camerad.cpp b/camerad/camerad.cpp index beea774..d64f2d9 100644 --- a/camerad/camerad.cpp +++ b/camerad/camerad.cpp @@ -628,8 +628,15 @@ void doit(Network::TcpSocket sock) { } else if (cmd == "abort") { server.camera.abort(); ret = 0; + } else if (cmd == "autofetch") { + server. + // TODO:: Add manipulating start = 1, expose = 1 and possibly mode_VideoRX to autofetch and non stop running + // Make start to 0 will stop the autofetch + // GOAL: Be able to turn auto fetch on and off dynamically. + // Must fetch very fast for tracking camera to grab } -#ifdef ASTROCAM + + #ifdef ASTROCAM else if (cmd=="isopen") { ret = server.is_connected( retstring ); From a476742e2373ab66423af992978a36019b8ff868 Mon Sep 17 00:00:00 2001 From: Elijah A-B Date: Thu, 13 Nov 2025 11:24:34 -0800 Subject: [PATCH 2/3] freerun mode implmentation on archon.cpp-Elijah.AB --- camerad/archon.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/camerad/archon.cpp b/camerad/archon.cpp index a14ac39..2698224 100644 --- a/camerad/archon.cpp +++ b/camerad/archon.cpp @@ -4441,19 +4441,23 @@ long Interface::archon_cmd(std::string cmd, std::string &reply) { if ( !set_state.empty() ) { try { std::transform( set_state.begin(), set_state.end(), set_state.begin(), ::toupper ); // make uppercase + std::string expose_param = "Expose"; + std::string start_param = "Start"; + long new_state; if (set_state == "TRUE" || set_state == "1") { //set expose and start on the archon or acf to 1 - - //reload the acf file - + new_state = 1; + error = this->set_parameter( expose_param, new_state); + if ( error == NO_ERROR ) error = this->set_parameter( start_param, new_state); //log this->is_freerun = true; } else { //set expose and start on acf or archon to 0 - - //reload acf file + new_state = 0; + error = this->set_parameter( expose_param, new_state); + if ( error == NO_ERROR ) error = this->set_parameter( start_param, new_state); //log this->is_freerun = false; From 853f359f614fc14313c86d883d839c90958dd2f8 Mon Sep 17 00:00:00 2001 From: Elijah A-B Date: Mon, 17 Nov 2025 11:18:52 -0800 Subject: [PATCH 3/3] Testing Camerad opn FEI --- camerad/camerad.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/camerad/camerad.cpp b/camerad/camerad.cpp index d64f2d9..66e6a04 100644 --- a/camerad/camerad.cpp +++ b/camerad/camerad.cpp @@ -628,13 +628,13 @@ void doit(Network::TcpSocket sock) { } else if (cmd == "abort") { server.camera.abort(); ret = 0; - } else if (cmd == "autofetch") { - server. + } //else if (cmd == "freerun") { + // server. // TODO:: Add manipulating start = 1, expose = 1 and possibly mode_VideoRX to autofetch and non stop running // Make start to 0 will stop the autofetch // GOAL: Be able to turn auto fetch on and off dynamically. // Must fetch very fast for tracking camera to grab - } + //} #ifdef ASTROCAM else