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;
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());
@ -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);
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<double> curr_exp = std::chrono::utc_clock::now() - _acqParams->startTime;
auto remain_exp = _acqParams->expTime - curr_exp.count();

View File

@ -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) {

View File

@ -226,7 +226,7 @@ private:
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::mutex _statusMutex;
};