mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-19 18:40:01 +02:00
some ctb funcs
This commit is contained in:
parent
21046bcae0
commit
bba6e1667b
@ -45,9 +45,9 @@ void init_experimental(py::module &m) {
|
||||
|
||||
// File
|
||||
.def("getFileName", &Detector::getFileName)
|
||||
.def("setFileName", &Detector::setFileName, py::arg())
|
||||
.def("setFileName", &Detector::setFileName, py::arg(),py::arg() = Positions{})
|
||||
.def("getFilePath", &Detector::getFilePath)
|
||||
.def("setFilePath", &Detector::setFilePath, py::arg())
|
||||
.def("setFilePath", &Detector::setFilePath, py::arg(),py::arg() = Positions{})
|
||||
.def("setFileWrite", &Detector::setFileWrite, py::arg(),
|
||||
py::arg() = Positions{})
|
||||
.def("getFileWrite", &Detector::getFileWrite, py::arg() = Positions{})
|
||||
|
@ -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)
|
||||
|
@ -117,9 +117,7 @@ Result<bool> Detector::getFileOverWrite(Positions pos) const {
|
||||
}
|
||||
|
||||
// dhanya
|
||||
int Detector::getMultiId() const {
|
||||
return pimpl->getMultiId();
|
||||
}
|
||||
int Detector::getMultiId() const { return pimpl->getMultiId(); }
|
||||
|
||||
void Detector::checkDetectorVersionCompatibility(Positions pos) const {
|
||||
pimpl->Parallel(&slsDetector::checkDetectorVersionCompatibility, pos);
|
||||
@ -130,43 +128,59 @@ void Detector::checkReceiverVersionCompatibility(Positions pos) const {
|
||||
}
|
||||
|
||||
Result<int64_t> Detector::getDetectorFirmwareVersion(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::getId, pos, defs::DETECTOR_FIRMWARE_VERSION);
|
||||
return pimpl->Parallel(&slsDetector::getId, pos,
|
||||
defs::DETECTOR_FIRMWARE_VERSION);
|
||||
}
|
||||
|
||||
Result<int64_t> Detector::getDetectorServerVersion(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::getId, pos, defs::DETECTOR_SOFTWARE_VERSION);
|
||||
return pimpl->Parallel(&slsDetector::getId, pos,
|
||||
defs::DETECTOR_SOFTWARE_VERSION);
|
||||
}
|
||||
|
||||
Result<int64_t> Detector::getDetectorSerialNumber(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::getId, pos, defs::DETECTOR_SERIAL_NUMBER);
|
||||
return pimpl->Parallel(&slsDetector::getId, pos,
|
||||
defs::DETECTOR_SERIAL_NUMBER);
|
||||
}
|
||||
|
||||
Result<int64_t> Detector::getClientSoftwareVersion() const {
|
||||
return pimpl->getClientSoftwareVersion();
|
||||
Result<int64_t> Detector::getClientSoftwareVersion() const {
|
||||
return pimpl->getClientSoftwareVersion();
|
||||
}
|
||||
|
||||
Result<int64_t> Detector::getReceiverSoftwareVersion(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::getReceiverSoftwareVersion, pos);
|
||||
}
|
||||
|
||||
std::string Detector::getUserDetails() const {
|
||||
return pimpl->getUserDetails();
|
||||
}
|
||||
std::string Detector::getUserDetails() const { return pimpl->getUserDetails(); }
|
||||
|
||||
void Detector::setHostname(const std::vector<std::string> &name) {
|
||||
void Detector::setHostname(const std::vector<std::string> &name) {
|
||||
pimpl->setHostname(name);
|
||||
}
|
||||
|
||||
defs::detectorType Detector::getDetectorTypeAsEnum() const {
|
||||
return pimpl->getDetectorTypeAsEnum();
|
||||
return pimpl->getDetectorTypeAsEnum();
|
||||
}
|
||||
|
||||
Result<defs::detectorType> Detector::getDetectorTypeAsEnum(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::getDetectorTypeAsEnum, pos);
|
||||
Result<defs::detectorType>
|
||||
Detector::getDetectorTypeAsEnum(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::getDetectorTypeAsEnum, pos);
|
||||
}
|
||||
|
||||
Result<std::string> Detector::getDetectorTypeAsString(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::getDetectorTypeAsString, pos);
|
||||
return pimpl->Parallel(&slsDetector::getDetectorTypeAsString, pos);
|
||||
}
|
||||
|
||||
// Erik
|
||||
|
||||
void Detector::setLEDEnable(bool enable, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setLEDEnable, pos, static_cast<int>(enable));
|
||||
}
|
||||
|
||||
Result<bool> Detector::getLEDEnable(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::setLEDEnable, pos, -1);
|
||||
}
|
||||
|
||||
void Detector::setDigitalIODelay(uint64_t pinMask, int delay, Positions pos){
|
||||
pimpl->Parallel(&slsDetector::setDigitalIODelay, pos, pinMask, delay);
|
||||
}
|
||||
|
||||
} // namespace sls
|
Loading…
x
Reference in New Issue
Block a user