fixes (delete unusefull STATUS_ARMED status)

This commit is contained in:
Timur A. Fatkhullin 2025-01-15 11:09:33 +03:00
parent 7497b72b32
commit b8c4af0e85
3 changed files with 7 additions and 9 deletions

View File

@ -76,7 +76,7 @@ void RaptorEagleCCD::AcquisitionProcess::start(const std::shared_ptr<acq_params_
std::stringstream st; std::stringstream st;
st << std::this_thread::get_id(); st << std::this_thread::get_id();
_status = STATUS_ARMED; _status = STATUS_ACQ;
serverPtr->logDebug("Arm grabber and wait for acquisition starting trigger (thread id: {}) ...", st.str()); serverPtr->logDebug("Arm grabber and wait for acquisition starting trigger (thread id: {}) ...", st.str());
@ -303,7 +303,7 @@ void RaptorEagleCCD::AcquisitionProcess::start(const std::shared_ptr<acq_params_
} else { } else {
serverPtr->logDebug("There is no one permanent keyword! Skip!"); serverPtr->logDebug("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); fits_parse_template(s.data(), card, &k_type, &status);
if (status) { // ignore possible errors if (status) { // ignore possible errors
fits_get_errstatus(status, err_str); fits_get_errstatus(status, err_str);
@ -380,7 +380,6 @@ void RaptorEagleCCD::AcquisitionProcess::start(const std::shared_ptr<acq_params_
serverPtr->logDebug("Return buffer address {} to queue of free", (void*)_acqParams->imageBufferPtr); serverPtr->logDebug("Return buffer address {} to queue of free", (void*)_acqParams->imageBufferPtr);
acqProcSptr.erase(self); acqProcSptr.erase(self);
}).detach(); }).detach();
} }
@ -417,9 +416,6 @@ std::string RaptorEagleCCD::AcquisitionProcess::status()
case STATUS_IDLE: case STATUS_IDLE:
stat_str = std::format("{}", CAMERA_ATTR_CAMERA_STATUS_IDLE); stat_str = std::format("{}", CAMERA_ATTR_CAMERA_STATUS_IDLE);
break; 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: { case STATUS_ACQ: {
std::chrono::duration<double> curr_exp = std::chrono::utc_clock::now() - _acqParams->startTime; std::chrono::duration<double> curr_exp = std::chrono::utc_clock::now() - _acqParams->startTime;
auto remain_exp = _acqParams->expTime - curr_exp.count(); auto remain_exp = _acqParams->expTime - curr_exp.count();

View File

@ -185,7 +185,8 @@ RaptorEagleCCD::~RaptorEagleCCD()
// wait for detached acquisition threads? // wait for detached acquisition threads?
if (AcquisitionProcess::acqProcSptr.size()) { 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(); auto start = std::chrono::utc_clock::now();
while (AcquisitionProcess::acqProcSptr.size()) { while (AcquisitionProcess::acqProcSptr.size()) {
@ -1112,6 +1113,7 @@ void RaptorEagleCCD::startAquisition()
// start acquisition here // start acquisition here
acq_pars->startTime = setTriggerRegisterBit(CL_TRIGGER_MODE_SNAPSHOT_BIT); acq_pars->startTime = setTriggerRegisterBit(CL_TRIGGER_MODE_SNAPSHOT_BIT);
std::this_thread::sleep_for(std::chrono::milliseconds(200));
int status; int status;
xclibApiCall(status = pxd_goneLive(_cameraUnitmap, 0), std::format("pxd_goneLive({}, 0)", _cameraUnitmap)); xclibApiCall(status = pxd_goneLive(_cameraUnitmap, 0), std::format("pxd_goneLive({}, 0)", _cameraUnitmap));
if (status == 0) { if (status == 0) {
@ -1127,7 +1129,7 @@ void RaptorEagleCCD::stopAcquisition(bool save_acq)
for (auto& sptr : AcquisitionProcess::acqProcSptr) { for (auto& sptr : AcquisitionProcess::acqProcSptr) {
if (sptr->_status == AcquisitionProcess::STATUS_ACQ) { if (sptr->_status == AcquisitionProcess::STATUS_ACQ) {
sptr->stop(save_acq); sptr->stop(save_acq);
return; // the only one active acquisition process return; // the only one active acquisition process
} }
} }

View File

@ -226,7 +226,7 @@ private:
std::shared_ptr<acq_params_t> _acqParams{}; std::shared_ptr<acq_params_t> _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::atomic_int8_t _status = STATUS_IDLE;
std::mutex _statusMutex; std::mutex _statusMutex;
}; };