mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-09 03:20:42 +02:00
Merge branch 'refactor' into program2
This commit is contained in:
commit
d9ea8e6747
@ -161,6 +161,14 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
std::vector<RT> parallelCall(RT (slsDetector::*somefunc)(CT...) const,
|
std::vector<RT> parallelCall(RT (slsDetector::*somefunc)(CT...) const,
|
||||||
typename NonDeduced<CT>::type... Args) const;
|
typename NonDeduced<CT>::type... Args) const;
|
||||||
|
|
||||||
|
|
||||||
|
template <typename... CT>
|
||||||
|
void parallelCall(void (slsDetector::*somefunc)(CT...), typename NonDeduced<CT>::type... Args);
|
||||||
|
|
||||||
|
template <typename... CT>
|
||||||
|
void parallelCall(void (slsDetector::*somefunc)(CT...) const, typename NonDeduced<CT>::type... Args) const;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decodes which detector and the corresponding channel numbers for it
|
* Decodes which detector and the corresponding channel numbers for it
|
||||||
* Mainly useful in a multi detector setROI (Gotthard, Mythen?)
|
* Mainly useful in a multi detector setROI (Gotthard, Mythen?)
|
||||||
|
@ -98,6 +98,33 @@ std::vector<RT> multiSlsDetector::parallelCall(RT (slsDetector::*somefunc)(CT...
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename... CT>
|
||||||
|
void multiSlsDetector::parallelCall(void (slsDetector::*somefunc)(CT...),
|
||||||
|
typename NonDeduced<CT>::type... Args) {
|
||||||
|
std::vector<std::future<void>> futures;
|
||||||
|
for (auto &d : detectors) {
|
||||||
|
futures.push_back(std::async(std::launch::async, somefunc, d.get(), Args...));
|
||||||
|
}
|
||||||
|
for (auto &i : futures) {
|
||||||
|
i.get();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename... CT>
|
||||||
|
void multiSlsDetector::parallelCall(void (slsDetector::*somefunc)(CT...) const,
|
||||||
|
typename NonDeduced<CT>::type... Args) const{
|
||||||
|
std::vector<std::future<void>> futures;
|
||||||
|
for (auto &d : detectors) {
|
||||||
|
futures.push_back(std::async(std::launch::async, somefunc, d.get(), Args...));
|
||||||
|
}
|
||||||
|
for (auto &i : futures) {
|
||||||
|
i.get();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int multiSlsDetector::decodeNChannel(int offsetX, int offsetY, int &channelX, int &channelY) {
|
int multiSlsDetector::decodeNChannel(int offsetX, int offsetY, int &channelX, int &channelY) {
|
||||||
channelX = -1;
|
channelX = -1;
|
||||||
channelY = -1;
|
channelY = -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user