diff --git a/raptor_eagle_acqproc.cpp b/raptor_eagle_acqproc.cpp index fc5587e..4fdaaf5 100644 --- a/raptor_eagle_acqproc.cpp +++ b/raptor_eagle_acqproc.cpp @@ -430,12 +430,13 @@ std::string RaptorEagleCCD::AcquisitionProcess::status() _statusString = std::format("{}", CAMERA_ATTR_CAMERA_STATUS_IDLE); break; case STATUS_ACQ: { - std::chrono::duration curr_exp = _acqParams->abortTime - _acqParams->startTime; - if (curr_exp.count() <= 0) { + std::chrono::duration curr_exp = std::chrono::utc_clock::now() - _acqParams->startTime; + auto remain_exp = _acqParams->expTime - curr_exp.count(); + if (remain_exp < 0) { _status = STATUS_READ; _statusString = std::format("{} {}", CAMERA_ATTR_CAMERA_STATUS_READ, _acqParams->filename); } else { - _statusString = std::format("{} {}", CAMERA_ATTR_CAMERA_STATUS_ACQ, curr_exp.count()); + _statusString = std::format("{} {}", CAMERA_ATTR_CAMERA_STATUS_ACQ, remain_exp); } break; } diff --git a/raptor_eagle_ccd.cpp b/raptor_eagle_ccd.cpp index 8cde2d9..f4fc88d 100644 --- a/raptor_eagle_ccd.cpp +++ b/raptor_eagle_ccd.cpp @@ -1059,13 +1059,10 @@ void RaptorEagleCCD::startAquisition() xclibApiCall(status = pxd_goneLive(_cameraUnitmap, 0), std::format("pxd_goneLive({}, 0)", _cameraUnitmap)); if (status == 0) { logError("CANNOT START ACQUIRING!!!"); + sptr->_status = AcquisitionProcess::STATUS_IDLE; + } else { + sptr->_status = AcquisitionProcess::STATUS_ACQ; } - - // std::lock_guard lock(sptr->_statusMutex); - sptr->_status = AcquisitionProcess::STATUS_IDLE; - // sptr->_status = std::format("{} {}", CAMERA_ATTR_CAMERA_STATUS_ACQ, sptr->_acqParams->expTime); - - // _cameraStatus = CAMERA_ATTR_CAMERA_STATUS_ACQ; } @@ -1230,6 +1227,7 @@ void RaptorEagleCCD::initAttrComm() std::ranges::copy(st, std::back_inserter(s)); s += ", "; } + ++it; } } }