mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 12:27:14 +02:00
1. Dev/update python bindings for port pr (#813)
* updated python bindings for port update from int to uint16_t * user friendly error message for exception when python arg does not match uint16_t for ports
This commit is contained in:
@ -48,7 +48,7 @@ void init_det(py::module &m) {
|
||||
Detector::setHostname,
|
||||
py::arg());
|
||||
CppDetectorApi.def("setVirtualDetectorServers",
|
||||
(void (Detector::*)(int, int)) &
|
||||
(void (Detector::*)(int, uint16_t)) &
|
||||
Detector::setVirtualDetectorServers,
|
||||
py::arg(), py::arg());
|
||||
CppDetectorApi.def("getShmId",
|
||||
@ -751,19 +751,19 @@ void init_det(py::module &m) {
|
||||
Detector::setDestinationUDPMAC2,
|
||||
py::arg(), py::arg() = Positions{});
|
||||
CppDetectorApi.def("getDestinationUDPPort",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
(Result<uint16_t>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getDestinationUDPPort,
|
||||
py::arg() = Positions{});
|
||||
CppDetectorApi.def("setDestinationUDPPort",
|
||||
(void (Detector::*)(int, int)) &
|
||||
(void (Detector::*)(uint16_t, int)) &
|
||||
Detector::setDestinationUDPPort,
|
||||
py::arg(), py::arg() = -1);
|
||||
CppDetectorApi.def("getDestinationUDPPort2",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
(Result<uint16_t>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getDestinationUDPPort2,
|
||||
py::arg() = Positions{});
|
||||
CppDetectorApi.def("setDestinationUDPPort2",
|
||||
(void (Detector::*)(int, int)) &
|
||||
(void (Detector::*)(uint16_t, int)) &
|
||||
Detector::setDestinationUDPPort2,
|
||||
py::arg(), py::arg() = -1);
|
||||
CppDetectorApi.def("reconfigureUDPDestination",
|
||||
@ -844,12 +844,12 @@ void init_det(py::module &m) {
|
||||
Detector::setRxHostname,
|
||||
py::arg());
|
||||
CppDetectorApi.def("getRxPort",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
(Result<uint16_t>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getRxPort,
|
||||
py::arg() = Positions{});
|
||||
CppDetectorApi.def("setRxPort",
|
||||
(void (Detector::*)(int, int)) & Detector::setRxPort,
|
||||
py::arg(), py::arg() = -1);
|
||||
CppDetectorApi.def(
|
||||
"setRxPort", (void (Detector::*)(uint16_t, int)) & Detector::setRxPort,
|
||||
py::arg(), py::arg() = -1);
|
||||
CppDetectorApi.def("getRxFifoDepth",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getRxFifoDepth,
|
||||
@ -1032,11 +1032,12 @@ void init_det(py::module &m) {
|
||||
Detector::setRxZmqStartingFrame,
|
||||
py::arg(), py::arg() = Positions{});
|
||||
CppDetectorApi.def("getRxZmqPort",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
(Result<uint16_t>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getRxZmqPort,
|
||||
py::arg() = Positions{});
|
||||
CppDetectorApi.def("setRxZmqPort",
|
||||
(void (Detector::*)(int, int)) & Detector::setRxZmqPort,
|
||||
(void (Detector::*)(uint16_t, int)) &
|
||||
Detector::setRxZmqPort,
|
||||
py::arg(), py::arg() = -1);
|
||||
CppDetectorApi.def(
|
||||
"getRxZmqIP",
|
||||
@ -1048,11 +1049,11 @@ void init_det(py::module &m) {
|
||||
Detector::setRxZmqIP,
|
||||
py::arg(), py::arg() = Positions{});
|
||||
CppDetectorApi.def("getClientZmqPort",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
(Result<uint16_t>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getClientZmqPort,
|
||||
py::arg() = Positions{});
|
||||
CppDetectorApi.def("setClientZmqPort",
|
||||
(void (Detector::*)(int, int)) &
|
||||
(void (Detector::*)(uint16_t, int)) &
|
||||
Detector::setClientZmqPort,
|
||||
py::arg(), py::arg() = -1);
|
||||
CppDetectorApi.def(
|
||||
@ -1524,14 +1525,6 @@ void init_det(py::module &m) {
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getSYNCClock,
|
||||
py::arg() = Positions{});
|
||||
CppDetectorApi.def("getADCPipeline",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getADCPipeline,
|
||||
py::arg() = Positions{});
|
||||
CppDetectorApi.def("setADCPipeline",
|
||||
(void (Detector::*)(int, sls::Positions)) &
|
||||
Detector::setADCPipeline,
|
||||
py::arg(), py::arg() = Positions{});
|
||||
CppDetectorApi.def("getVoltageList",
|
||||
(std::vector<defs::dacIndex>(Detector::*)() const) &
|
||||
Detector::getVoltageList);
|
||||
@ -1891,6 +1884,14 @@ void init_det(py::module &m) {
|
||||
sls::Positions)) &
|
||||
Detector::setAdditionalJsonParameter,
|
||||
py::arg(), py::arg(), py::arg() = Positions{});
|
||||
CppDetectorApi.def("getADCPipeline",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getADCPipeline,
|
||||
py::arg() = Positions{});
|
||||
CppDetectorApi.def("setADCPipeline",
|
||||
(void (Detector::*)(int, sls::Positions)) &
|
||||
Detector::setADCPipeline,
|
||||
py::arg(), py::arg() = Positions{});
|
||||
CppDetectorApi.def(
|
||||
"programFPGA",
|
||||
(void (Detector::*)(const std::string &, const bool, sls::Positions)) &
|
||||
@ -1978,19 +1979,19 @@ void init_det(py::module &m) {
|
||||
Detector::setADCInvert,
|
||||
py::arg(), py::arg() = Positions{});
|
||||
CppDetectorApi.def("getControlPort",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
(Result<uint16_t>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getControlPort,
|
||||
py::arg() = Positions{});
|
||||
CppDetectorApi.def("setControlPort",
|
||||
(void (Detector::*)(int, sls::Positions)) &
|
||||
(void (Detector::*)(uint16_t, sls::Positions)) &
|
||||
Detector::setControlPort,
|
||||
py::arg(), py::arg() = Positions{});
|
||||
CppDetectorApi.def("getStopPort",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
(Result<uint16_t>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getStopPort,
|
||||
py::arg() = Positions{});
|
||||
CppDetectorApi.def("setStopPort",
|
||||
(void (Detector::*)(int, sls::Positions)) &
|
||||
(void (Detector::*)(uint16_t, sls::Positions)) &
|
||||
Detector::setStopPort,
|
||||
py::arg(), py::arg() = Positions{});
|
||||
CppDetectorApi.def("getDetectorLock",
|
||||
|
Reference in New Issue
Block a user