From b8c4af0e853ed233ba4a013e34b05d1ffb3944a0 Mon Sep 17 00:00:00 2001 From: "Timur A. Fatkhullin" Date: Wed, 15 Jan 2025 11:09:33 +0300 Subject: [PATCH] fixes (delete unusefull STATUS_ARMED status) --- raptor_eagle_acqproc.cpp | 8 ++------ raptor_eagle_ccd.cpp | 6 ++++-- raptor_eagle_ccd.h | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/raptor_eagle_acqproc.cpp b/raptor_eagle_acqproc.cpp index 2b0a47e..8623cb0 100644 --- a/raptor_eagle_acqproc.cpp +++ b/raptor_eagle_acqproc.cpp @@ -76,7 +76,7 @@ void RaptorEagleCCD::AcquisitionProcess::start(const std::shared_ptrlogDebug("Arm grabber and wait for acquisition starting trigger (thread id: {}) ...", st.str()); @@ -303,7 +303,7 @@ void RaptorEagleCCD::AcquisitionProcess::start(const std::shared_ptrlogDebug("There is no one permanent keyword! Skip!"); } - for (auto & s : kwd_list) { + for (auto& s : kwd_list) { fits_parse_template(s.data(), card, &k_type, &status); if (status) { // ignore possible errors fits_get_errstatus(status, err_str); @@ -380,7 +380,6 @@ void RaptorEagleCCD::AcquisitionProcess::start(const std::shared_ptrlogDebug("Return buffer address {} to queue of free", (void*)_acqParams->imageBufferPtr); acqProcSptr.erase(self); - }).detach(); } @@ -417,9 +416,6 @@ std::string RaptorEagleCCD::AcquisitionProcess::status() case STATUS_IDLE: stat_str = std::format("{}", CAMERA_ATTR_CAMERA_STATUS_IDLE); break; - case STATUS_ARMED: // actually it should not be! but it presents here for debug reasons - stat_str = std::format("{}", CAMERA_ATTR_CAMERA_STATUS_ARMED); - break; case STATUS_ACQ: { std::chrono::duration curr_exp = std::chrono::utc_clock::now() - _acqParams->startTime; auto remain_exp = _acqParams->expTime - curr_exp.count(); diff --git a/raptor_eagle_ccd.cpp b/raptor_eagle_ccd.cpp index abb2fd2..93e56ec 100644 --- a/raptor_eagle_ccd.cpp +++ b/raptor_eagle_ccd.cpp @@ -185,7 +185,8 @@ RaptorEagleCCD::~RaptorEagleCCD() // wait for detached acquisition threads? if (AcquisitionProcess::acqProcSptr.size()) { - logInfo("DTOR: waiting for the end of the acquisition process {} ...", AcquisitionProcess::acqProcSptr.size() > 1 ? "threads" : "thread"); + logInfo("DTOR: waiting for the end of the acquisition process {} ...", + AcquisitionProcess::acqProcSptr.size() > 1 ? "threads" : "thread"); auto start = std::chrono::utc_clock::now(); while (AcquisitionProcess::acqProcSptr.size()) { @@ -1112,6 +1113,7 @@ void RaptorEagleCCD::startAquisition() // start acquisition here acq_pars->startTime = setTriggerRegisterBit(CL_TRIGGER_MODE_SNAPSHOT_BIT); + std::this_thread::sleep_for(std::chrono::milliseconds(200)); int status; xclibApiCall(status = pxd_goneLive(_cameraUnitmap, 0), std::format("pxd_goneLive({}, 0)", _cameraUnitmap)); if (status == 0) { @@ -1127,7 +1129,7 @@ void RaptorEagleCCD::stopAcquisition(bool save_acq) for (auto& sptr : AcquisitionProcess::acqProcSptr) { if (sptr->_status == AcquisitionProcess::STATUS_ACQ) { sptr->stop(save_acq); - return; // the only one active acquisition process + return; // the only one active acquisition process } } diff --git a/raptor_eagle_ccd.h b/raptor_eagle_ccd.h index c5f6f65..f014e1c 100644 --- a/raptor_eagle_ccd.h +++ b/raptor_eagle_ccd.h @@ -226,7 +226,7 @@ private: std::shared_ptr _acqParams{}; - enum int8_t { STATUS_IDLE, STATUS_ARMED, STATUS_ACQ, STATUS_READ, STATUS_SAVE }; + enum int8_t { STATUS_IDLE, STATUS_ACQ, STATUS_READ, STATUS_SAVE }; std::atomic_int8_t _status = STATUS_IDLE; std::mutex _statusMutex; };