From aa3d9e5edbec8755c7a5b8bc72ea161dbce36fe3 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Wed, 20 Sep 2023 10:53:44 +0200 Subject: [PATCH] DetectorWrapper: Add warning message when having problem stopping the detector --- detector_control/DetectorWrapper.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/detector_control/DetectorWrapper.cpp b/detector_control/DetectorWrapper.cpp index 82d3766e..f5582eaa 100644 --- a/detector_control/DetectorWrapper.cpp +++ b/detector_control/DetectorWrapper.cpp @@ -136,6 +136,7 @@ void DetectorWrapper::InternalStop() { else if (state == DetectorState::BUSY) { try { // Sometimes stop gives problem - ignore these + logger.Warning("Problem with stopping the detector - ignored."); det.stopDetector(); } catch (...) {} std::this_thread::sleep_for(std::chrono::milliseconds(10)); @@ -174,12 +175,7 @@ void DetectorWrapper::Stop() { void DetectorWrapper::Trigger() { logger.Info("Trigger"); try { - for (int i = 1; i < det.size(); i++) - det.setBit(0x4f, 2, {i}); - std::this_thread::sleep_for(std::chrono::milliseconds(100)); - det.setBit(0x4f, 2, {0}); - std::this_thread::sleep_for(std::chrono::milliseconds(100)); - det.clearBit(0x4f, 2); + det.sendSoftwareTrigger(); } catch (std::exception &e) { logger.ErrorException(e); throw JFJochException(JFJochExceptionCategory::Detector, e.what());