Merge branch 'mythen3' of github.com:slsdetectorgroup/slsDetectorPackage into mythen3

This commit is contained in:
2020-05-20 10:15:04 +02:00
5 changed files with 15 additions and 18 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 {
auto t = pimpl->Parallel(&Module::getExptimeForAllGates, pos);
Result<std::array<ns, 3>> res(t.size());
for (unsigned int i = 0; i < t.size(); ++i) {
for (unsigned int j = 0; j != 3; ++j) {
res[i][j] = static_cast<ns>(t[i][j]);
}
}
return res;
return pimpl->Parallel(&Module::getExptimeForAllGates, pos);
}
Result<ns> Detector::getGateDelay(int gateIndex, Positions pos) const {

View File

@ -151,7 +151,7 @@ template <typename Ret> Ret Module::sendToDetector(int fnum) {
<< sizeof(Ret) << "]";
Ret retval{};
sendToDetector(fnum, nullptr, 0, &retval, sizeof(retval));
LOG(logDEBUG1) << "Got back: " << retval;
LOG(logDEBUG1) << "Got back: " << ToString(retval);
return retval;
}
@ -163,7 +163,7 @@ Ret Module::sendToDetector(int fnum, const Arg &args) {
<< typeid(Ret).name() << ", " << sizeof(Ret) << "]";
Ret retval{};
sendToDetector(fnum, &args, sizeof(args), &retval, sizeof(retval));
LOG(logDEBUG1) << "Got back: " << retval;
LOG(logDEBUG1) << "Got back: " << ToString(retval);
return retval;
}
@ -1060,10 +1060,10 @@ void Module::setExptime(int gateIndex, int64_t value) {
}
}
std::array<int64_t, 3> Module::getExptimeForAllGates() {
std::array<int64_t, 3> retval;
sendToDetector(F_GET_EXPTIME_ALL_GATES, nullptr, retval);
return retval;
std::array<time::ns, 3> Module::getExptimeForAllGates() {
static_assert(sizeof(time::ns) == 8, "ns needs to be 64bit");
return sendToDetector<std::array<time::ns, 3>>(F_GET_EXPTIME_ALL_GATES);
}
int64_t Module::getGateDelay(int gateIndex) {

View File

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