diff --git a/python/src/experimental.cpp b/python/src/experimental.cpp index b8ae33d4f..c7cb0db91 100644 --- a/python/src/experimental.cpp +++ b/python/src/experimental.cpp @@ -35,7 +35,7 @@ void init_experimental(py::module &m) { py::arg() = Positions{}) .def("clearBit", &Detector::clearBit, py::arg(), py::arg(), py::arg() = Positions{}) - .def("getRegister", &Detector::getRegister, py::arg(), + .def("readRegister", &Detector::readRegister, py::arg(), py::arg() = Positions{}) .def("getStartingFrameNumber", &Detector::getStartingFrameNumber, diff --git a/slsDetectorSoftware/include/Detector.h b/slsDetectorSoftware/include/Detector.h index 1c2b92da9..928e8214d 100644 --- a/slsDetectorSoftware/include/Detector.h +++ b/slsDetectorSoftware/include/Detector.h @@ -81,12 +81,9 @@ class Detector { */ void setBit(uint32_t addr, int bitnr, Positions pos = {}); - /** - * Reads 32 bit register from detector - * @param addr address of the register - * @returns value read from register - */ - Result getRegister(uint32_t addr, Positions pos = {}); + + Result readRegister(uint32_t addr, Positions pos = {}) const; + void writeRegister(uint32_t addr, uint32_t val, Positions pos = {}); /************************************************** * * @@ -1324,9 +1321,11 @@ class Detector { void setDetectorIP2(const std::string &detectorIP, Positions pos = {}); Result getDetectorIP(Positions pos = {}) const; + void setDetectorIP(const std::string &detectorIP, Positions pos = {}); Result getDetectorMAC(Positions pos = {}) const; + void setDetectorMAC(const std::string &detectorMAC, Positions pos = {}); /** [Jungfrau] */ @@ -1334,6 +1333,12 @@ class Detector { /** [Jungfrau] */ void setDetectorMAC2(const std::string &detectorMAC, Positions pos = {}); + + /** [Eiger] */ + Result getInterruptSubframe(Positions pos = {}) const; + + /** [Eiger] when set the last subframe is interrupted at end of acq*/ + void setInterruptSubframe(const bool enable, Positions pos = {}); }; } // namespace sls \ No newline at end of file diff --git a/slsDetectorSoftware/include/multiSlsDetector.h b/slsDetectorSoftware/include/multiSlsDetector.h index 14cd4b1f8..4a33a3a34 100755 --- a/slsDetectorSoftware/include/multiSlsDetector.h +++ b/slsDetectorSoftware/include/multiSlsDetector.h @@ -942,7 +942,7 @@ class multiSlsDetector : public virtual slsDetectorDefs { * @param detPos -1 for all detectors in list or specific detector position * @returns value read after writing */ - uint32_t writeRegister(uint32_t addr, uint32_t val, int detPos = -1); + uint32_t writeRegister(uint32_t addr, uint32_t val, int detPos = -1); // /** * Read from a register. For Advanced users diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index ceea070c4..b0ccdbf7c 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -47,7 +47,11 @@ void Detector::clearBit(uint32_t addr, int bitnr, Positions pos) { void Detector::setBit(uint32_t addr, int bitnr, Positions pos) { pimpl->Parallel(&slsDetector::setBit, pos, addr, bitnr); } -Result Detector::getRegister(uint32_t addr, Positions pos) { +void Detector::writeRegister(uint32_t addr, uint32_t val, Positions pos) { + pimpl->Parallel(&slsDetector::writeRegister, pos, addr, val); +} + +Result Detector::readRegister(uint32_t addr, Positions pos) const { return pimpl->Parallel(&slsDetector::readRegister, pos, addr); } @@ -1153,34 +1157,42 @@ void Detector::setReceiverHostname(const std::string &receiver, Positions pos) { pimpl->Parallel(&slsDetector::setReceiverHostname, pos, receiver); } -Result Detector::getDetectorIP2(Positions pos) const{ +Result Detector::getDetectorIP2(Positions pos) const { return pimpl->Parallel(&slsDetector::getDetectorIP2, pos); } -void Detector::setDetectorIP2(const std::string &detectorIP, Positions pos){ +void Detector::setDetectorIP2(const std::string &detectorIP, Positions pos) { pimpl->Parallel(&slsDetector::setDetectorIP2, pos, detectorIP); } -Result Detector::getDetectorIP(Positions pos) const{ +Result Detector::getDetectorIP(Positions pos) const { return pimpl->Parallel(&slsDetector::getDetectorIP, pos); } -void Detector::setDetectorIP(const std::string &detectorIP, Positions pos){ +void Detector::setDetectorIP(const std::string &detectorIP, Positions pos) { pimpl->Parallel(&slsDetector::setDetectorIP, pos, detectorIP); } -Result Detector::getDetectorMAC(Positions pos) const{ +Result Detector::getDetectorMAC(Positions pos) const { return pimpl->Parallel(&slsDetector::getDetectorMAC, pos); } -void Detector::setDetectorMAC(const std::string &detectorMAC, Positions pos){ +void Detector::setDetectorMAC(const std::string &detectorMAC, Positions pos) { pimpl->Parallel(&slsDetector::setDetectorMAC, pos, detectorMAC); } -Result Detector::getDetectorMAC2(Positions pos) const{ +Result Detector::getDetectorMAC2(Positions pos) const { return pimpl->Parallel(&slsDetector::getDetectorMAC2, pos); } -void Detector::setDetectorMAC2(const std::string &detectorMAC, Positions pos){ +void Detector::setDetectorMAC2(const std::string &detectorMAC, Positions pos) { pimpl->Parallel(&slsDetector::setDetectorMAC2, pos, detectorMAC); } +Result Detector::getInterruptSubframe(Positions pos) const { + return pimpl->Parallel(&slsDetector::getInterruptSubframe, pos); +} + +void Detector::setInterruptSubframe(const bool enable, Positions pos){ + pimpl->Parallel(&slsDetector::setInterruptSubframe, pos, enable); +} + } // namespace sls \ No newline at end of file