mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-20 02:40:03 +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
|
// File
|
||||||
.def("getFileName", &Detector::getFileName)
|
.def("getFileName", &Detector::getFileName)
|
||||||
.def("setFileName", &Detector::setFileName, py::arg())
|
.def("setFileName", &Detector::setFileName, py::arg(),py::arg() = Positions{})
|
||||||
.def("getFilePath", &Detector::getFilePath)
|
.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(),
|
.def("setFileWrite", &Detector::setFileWrite, py::arg(),
|
||||||
py::arg() = Positions{})
|
py::arg() = Positions{})
|
||||||
.def("getFileWrite", &Detector::getFileWrite, py::arg() = Positions{})
|
.def("getFileWrite", &Detector::getFileWrite, py::arg() = Positions{})
|
||||||
|
@ -208,6 +208,30 @@ class Detector {
|
|||||||
* @returns detector type as string
|
* @returns detector type as string
|
||||||
*/
|
*/
|
||||||
Result<std::string> getDetectorTypeAsString(Positions pos = {}) const;
|
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
|
} // namespace sls
|
@ -31,32 +31,33 @@ template <class T, class Allocator = std::allocator<T>> class Result {
|
|||||||
Result() = default;
|
Result() = default;
|
||||||
Result(std::initializer_list<T> list) : vec(list){};
|
Result(std::initializer_list<T> list) : vec(list){};
|
||||||
|
|
||||||
|
/** Custom constructor from integer type to Result<ns> or Result<bool> */
|
||||||
/** Custom constructor from integer type to Result<ns> */
|
|
||||||
template <typename V, typename = typename std::enable_if<
|
template <typename V, typename = typename std::enable_if<
|
||||||
std::is_integral<V>::value &&
|
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) {
|
Result(const std::vector<V> &from) {
|
||||||
|
|
||||||
vec.reserve(from.size());
|
vec.reserve(from.size());
|
||||||
for (const auto &item : from)
|
for (const auto &item : from)
|
||||||
vec.push_back(T(item));
|
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<
|
template <typename V, typename = typename std::enable_if<
|
||||||
std::is_integral<V>::value &&
|
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) {
|
Result(std::vector<V> &from) {
|
||||||
vec.reserve(from.size());
|
vec.reserve(from.size());
|
||||||
for (const auto &item : from)
|
for (const auto &item : from)
|
||||||
vec.push_back(T(item));
|
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<
|
template <typename V, typename = typename std::enable_if<
|
||||||
std::is_integral<V>::value &&
|
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) {
|
Result(std::vector<V> &&from) {
|
||||||
vec.reserve(from.size());
|
vec.reserve(from.size());
|
||||||
for (const auto &item : from)
|
for (const auto &item : from)
|
||||||
|
@ -117,9 +117,7 @@ Result<bool> Detector::getFileOverWrite(Positions pos) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// dhanya
|
// dhanya
|
||||||
int Detector::getMultiId() const {
|
int Detector::getMultiId() const { return pimpl->getMultiId(); }
|
||||||
return pimpl->getMultiId();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Detector::checkDetectorVersionCompatibility(Positions pos) const {
|
void Detector::checkDetectorVersionCompatibility(Positions pos) const {
|
||||||
pimpl->Parallel(&slsDetector::checkDetectorVersionCompatibility, pos);
|
pimpl->Parallel(&slsDetector::checkDetectorVersionCompatibility, pos);
|
||||||
@ -130,15 +128,18 @@ void Detector::checkReceiverVersionCompatibility(Positions pos) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Result<int64_t> Detector::getDetectorFirmwareVersion(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 {
|
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 {
|
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 {
|
Result<int64_t> Detector::getClientSoftwareVersion() const {
|
||||||
@ -149,9 +150,7 @@ Result<int64_t> Detector::getReceiverSoftwareVersion(Positions pos) const {
|
|||||||
return pimpl->Parallel(&slsDetector::getReceiverSoftwareVersion, pos);
|
return pimpl->Parallel(&slsDetector::getReceiverSoftwareVersion, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Detector::getUserDetails() const {
|
std::string Detector::getUserDetails() const { return pimpl->getUserDetails(); }
|
||||||
return pimpl->getUserDetails();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Detector::setHostname(const std::vector<std::string> &name) {
|
void Detector::setHostname(const std::vector<std::string> &name) {
|
||||||
pimpl->setHostname(name);
|
pimpl->setHostname(name);
|
||||||
@ -161,7 +160,8 @@ defs::detectorType Detector::getDetectorTypeAsEnum() const {
|
|||||||
return pimpl->getDetectorTypeAsEnum();
|
return pimpl->getDetectorTypeAsEnum();
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<defs::detectorType> Detector::getDetectorTypeAsEnum(Positions pos) const {
|
Result<defs::detectorType>
|
||||||
|
Detector::getDetectorTypeAsEnum(Positions pos) const {
|
||||||
return pimpl->Parallel(&slsDetector::getDetectorTypeAsEnum, pos);
|
return pimpl->Parallel(&slsDetector::getDetectorTypeAsEnum, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,4 +169,18 @@ 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
|
} // namespace sls
|
Loading…
x
Reference in New Issue
Block a user