From 30fc346e22d03317c770289265906f8a46a5991f Mon Sep 17 00:00:00 2001 From: Erik Frojdh Date: Wed, 20 May 2020 09:47:41 +0200 Subject: [PATCH] directly writing exptime --- slsDetectorSoftware/src/Detector.cpp | 9 +-------- slsDetectorSoftware/src/Module.cpp | 5 +++-- slsDetectorSoftware/src/Module.h | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index 520034748..bb627f285 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -1275,14 +1275,7 @@ void Detector::setExptime(int gateIndex, ns t, Positions pos) { } Result> Detector::getExptimeForAllGates(Positions pos) const { - auto t = pimpl->Parallel(&Module::getExptimeForAllGates, pos); - Result> res(t.size()); - for (size_t i = 0; i < t.size(); ++i) { - for (size_t j = 0; j != 3; ++j) { - res[i][j] = ns(t[i][j]); - } - } - return res; + return pimpl->Parallel(&Module::getExptimeForAllGates, pos); } Result Detector::getGateDelay(int gateIndex, Positions pos) const { diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index 20a812f63..5e7c0329b 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -1056,8 +1056,9 @@ void Module::setExptime(int gateIndex, int64_t value) { } } -std::array Module::getExptimeForAllGates() { - return sendToDetector>(F_GET_EXPTIME_ALL_GATES); +std::array Module::getExptimeForAllGates() { + static_assert(sizeof(time::ns) == 8, "ns needs to be 64bit"); + return sendToDetector>(F_GET_EXPTIME_ALL_GATES); } diff --git a/slsDetectorSoftware/src/Module.h b/slsDetectorSoftware/src/Module.h index 03ba3a3d6..81ced7b4a 100644 --- a/slsDetectorSoftware/src/Module.h +++ b/slsDetectorSoftware/src/Module.h @@ -432,7 +432,7 @@ class Module : public virtual slsDetectorDefs { void setExptime(int gateIndex, int64_t value); /** [Mythen3] for all gates */ - std::array getExptimeForAllGates(); + std::array getExptimeForAllGates(); /** [Mythen3] gatIndex: 0-2 */ int64_t getGateDelay(int gateIndex);