This commit is contained in:
Erik Frojdh 2019-08-09 16:35:26 +02:00
parent dea402a7e7
commit 6a89e3e1a5
4 changed files with 34 additions and 17 deletions

View File

@ -35,7 +35,7 @@ void init_experimental(py::module &m) {
py::arg() = Positions{}) py::arg() = Positions{})
.def("clearBit", &Detector::clearBit, py::arg(), py::arg(), .def("clearBit", &Detector::clearBit, py::arg(), py::arg(),
py::arg() = Positions{}) py::arg() = Positions{})
.def("getRegister", &Detector::getRegister, py::arg(), .def("readRegister", &Detector::readRegister, py::arg(),
py::arg() = Positions{}) py::arg() = Positions{})
.def("getStartingFrameNumber", &Detector::getStartingFrameNumber, .def("getStartingFrameNumber", &Detector::getStartingFrameNumber,

View File

@ -81,12 +81,9 @@ class Detector {
*/ */
void setBit(uint32_t addr, int bitnr, Positions pos = {}); void setBit(uint32_t addr, int bitnr, Positions pos = {});
/**
* Reads 32 bit register from detector Result<uint32_t> readRegister(uint32_t addr, Positions pos = {}) const;
* @param addr address of the register void writeRegister(uint32_t addr, uint32_t val, Positions pos = {});
* @returns value read from register
*/
Result<uint32_t> getRegister(uint32_t addr, Positions pos = {});
/************************************************** /**************************************************
* * * *
@ -1324,9 +1321,11 @@ class Detector {
void setDetectorIP2(const std::string &detectorIP, Positions pos = {}); void setDetectorIP2(const std::string &detectorIP, Positions pos = {});
Result<IpAddr> getDetectorIP(Positions pos = {}) const; Result<IpAddr> getDetectorIP(Positions pos = {}) const;
void setDetectorIP(const std::string &detectorIP, Positions pos = {}); void setDetectorIP(const std::string &detectorIP, Positions pos = {});
Result<MacAddr> getDetectorMAC(Positions pos = {}) const; Result<MacAddr> getDetectorMAC(Positions pos = {}) const;
void setDetectorMAC(const std::string &detectorMAC, Positions pos = {}); void setDetectorMAC(const std::string &detectorMAC, Positions pos = {});
/** [Jungfrau] */ /** [Jungfrau] */
@ -1334,6 +1333,12 @@ class Detector {
/** [Jungfrau] */ /** [Jungfrau] */
void setDetectorMAC2(const std::string &detectorMAC, Positions pos = {}); void setDetectorMAC2(const std::string &detectorMAC, Positions pos = {});
/** [Eiger] */
Result<bool> 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 } // namespace sls

View File

@ -942,7 +942,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @param detPos -1 for all detectors in list or specific detector position * @param detPos -1 for all detectors in list or specific detector position
* @returns value read after writing * @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 * Read from a register. For Advanced users

View File

@ -47,7 +47,11 @@ void Detector::clearBit(uint32_t addr, int bitnr, Positions pos) {
void Detector::setBit(uint32_t addr, int bitnr, Positions pos) { void Detector::setBit(uint32_t addr, int bitnr, Positions pos) {
pimpl->Parallel(&slsDetector::setBit, pos, addr, bitnr); pimpl->Parallel(&slsDetector::setBit, pos, addr, bitnr);
} }
Result<uint32_t> 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<uint32_t> Detector::readRegister(uint32_t addr, Positions pos) const {
return pimpl->Parallel(&slsDetector::readRegister, pos, addr); 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); pimpl->Parallel(&slsDetector::setReceiverHostname, pos, receiver);
} }
Result<IpAddr> Detector::getDetectorIP2(Positions pos) const{ Result<IpAddr> Detector::getDetectorIP2(Positions pos) const {
return pimpl->Parallel(&slsDetector::getDetectorIP2, pos); 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); pimpl->Parallel(&slsDetector::setDetectorIP2, pos, detectorIP);
} }
Result<IpAddr> Detector::getDetectorIP(Positions pos) const{ Result<IpAddr> Detector::getDetectorIP(Positions pos) const {
return pimpl->Parallel(&slsDetector::getDetectorIP, pos); 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); pimpl->Parallel(&slsDetector::setDetectorIP, pos, detectorIP);
} }
Result<MacAddr> Detector::getDetectorMAC(Positions pos) const{ Result<MacAddr> Detector::getDetectorMAC(Positions pos) const {
return pimpl->Parallel(&slsDetector::getDetectorMAC, pos); 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); pimpl->Parallel(&slsDetector::setDetectorMAC, pos, detectorMAC);
} }
Result<MacAddr> Detector::getDetectorMAC2(Positions pos) const{ Result<MacAddr> Detector::getDetectorMAC2(Positions pos) const {
return pimpl->Parallel(&slsDetector::getDetectorMAC2, pos); 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); pimpl->Parallel(&slsDetector::setDetectorMAC2, pos, detectorMAC);
} }
Result<bool> 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 } // namespace sls