mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-22 17:47:59 +02:00
some ctb funcs
This commit is contained in:
@ -208,6 +208,30 @@ class Detector {
|
||||
* @returns detector type as string
|
||||
*/
|
||||
Result<std::string> getDetectorTypeAsString(Positions pos = {}) const;
|
||||
|
||||
|
||||
// Erik
|
||||
|
||||
/**
|
||||
* Set LED Enable for CTB
|
||||
* @param enable true to switch on, false to switch off
|
||||
*/
|
||||
void setLEDEnable(bool enable, Positions pos = {});
|
||||
|
||||
|
||||
/**
|
||||
* Get LED enable for CTB
|
||||
*/
|
||||
Result<bool> getLEDEnable(Positions pos = {}) const;
|
||||
|
||||
|
||||
/**
|
||||
* Set Digital IO Delay CTB
|
||||
* @param digital IO mask to select the pins
|
||||
* @param delay delay in ps(1 bit=25ps, max of 775 ps)
|
||||
*/
|
||||
void setDigitalIODelay(uint64_t pinMask, int delay, Positions pos = {});
|
||||
|
||||
};
|
||||
|
||||
} // namespace sls
|
@ -31,32 +31,33 @@ template <class T, class Allocator = std::allocator<T>> class Result {
|
||||
Result() = default;
|
||||
Result(std::initializer_list<T> list) : vec(list){};
|
||||
|
||||
|
||||
/** Custom constructor from integer type to Result<ns> */
|
||||
/** Custom constructor from integer type to Result<ns> or Result<bool> */
|
||||
template <typename V, typename = typename std::enable_if<
|
||||
std::is_integral<V>::value &&
|
||||
std::is_same<T, time::ns>::value>::type>
|
||||
(std::is_same<T, time::ns>::value ||
|
||||
std::is_same<T, bool>::value)>::type>
|
||||
Result(const std::vector<V> &from) {
|
||||
|
||||
vec.reserve(from.size());
|
||||
for (const auto &item : from)
|
||||
vec.push_back(T(item));
|
||||
}
|
||||
|
||||
/** Custom constructor from integer type to Result<ns> */
|
||||
/** Custom constructor from integer type to Result<ns> or Result<bool> */
|
||||
template <typename V, typename = typename std::enable_if<
|
||||
std::is_integral<V>::value &&
|
||||
std::is_same<T, time::ns>::value>::type>
|
||||
(std::is_same<T, time::ns>::value ||
|
||||
std::is_same<T, bool>::value)>::type>
|
||||
Result(std::vector<V> &from) {
|
||||
vec.reserve(from.size());
|
||||
for (const auto &item : from)
|
||||
vec.push_back(T(item));
|
||||
}
|
||||
|
||||
/** Custom constructor from integer type to Result<ns> */
|
||||
/** Custom constructor from integer type to Result<ns> or Result<bool> */
|
||||
template <typename V, typename = typename std::enable_if<
|
||||
std::is_integral<V>::value &&
|
||||
std::is_same<T, time::ns>::value>::type>
|
||||
(std::is_same<T, time::ns>::value ||
|
||||
std::is_same<T, bool>::value)>::type>
|
||||
Result(std::vector<V> &&from) {
|
||||
vec.reserve(from.size());
|
||||
for (const auto &item : from)
|
||||
|
Reference in New Issue
Block a user