Merge pull request #99 from slsdetectorgroup/timetest

directly writing exptime
This commit is contained in:
Dhanya Thattil 2020-05-20 09:56:34 +02:00 committed by GitHub
commit 62e69b900b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 11 deletions

View File

@ -1275,14 +1275,7 @@ void Detector::setExptime(int gateIndex, ns t, Positions pos) {
} }
Result<std::array<ns, 3>> Detector::getExptimeForAllGates(Positions pos) const { Result<std::array<ns, 3>> Detector::getExptimeForAllGates(Positions pos) const {
auto t = pimpl->Parallel(&Module::getExptimeForAllGates, pos); return pimpl->Parallel(&Module::getExptimeForAllGates, pos);
Result<std::array<ns, 3>> 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;
} }
Result<ns> Detector::getGateDelay(int gateIndex, Positions pos) const { Result<ns> Detector::getGateDelay(int gateIndex, Positions pos) const {

View File

@ -1056,8 +1056,9 @@ void Module::setExptime(int gateIndex, int64_t value) {
} }
} }
std::array<int64_t, 3> Module::getExptimeForAllGates() { std::array<time::ns, 3> Module::getExptimeForAllGates() {
return sendToDetector<std::array<int64_t, 3>>(F_GET_EXPTIME_ALL_GATES); static_assert(sizeof(time::ns) == 8, "ns needs to be 64bit");
return sendToDetector<std::array<time::ns, 3>>(F_GET_EXPTIME_ALL_GATES);
} }

View File

@ -432,7 +432,7 @@ class Module : public virtual slsDetectorDefs {
void setExptime(int gateIndex, int64_t value); void setExptime(int gateIndex, int64_t value);
/** [Mythen3] for all gates */ /** [Mythen3] for all gates */
std::array<int64_t, 3> getExptimeForAllGates(); std::array<time::ns, 3> getExptimeForAllGates();
/** [Mythen3] gatIndex: 0-2 */ /** [Mythen3] gatIndex: 0-2 */
int64_t getGateDelay(int gateIndex); int64_t getGateDelay(int gateIndex);