Skip to content
Snippets Groups Projects
Commit 9b47c909 authored by Emily Anne Thompson's avatar Emily Anne Thompson
Browse files

Add critical argument to PS python.cpp

parent 0999b450
No related branches found
No related tags found
1 merge request!303[WIP] Interlock update
Pipeline #6463719 failed
......@@ -21,11 +21,11 @@ class PyICom : public ICom {
void setConfiguration(const nl::json &config) override {
PYBIND11_OVERLOAD_PURE(void, ICom, setConfiguration, config);
}
void send(char *buf, size_t length) override {
PYBIND11_OVERLOAD_PURE(void, ICom, send, buf, length);
void send(char *buf, size_t length, bool critical) override {
PYBIND11_OVERLOAD_PURE(void, ICom, send, buf, length, critical);
}
void send(const std::string &buf) override {
PYBIND11_OVERLOAD_PURE(void, ICom, send, buf);
void send(const std::string &buf, bool critical) override {
PYBIND11_OVERLOAD_PURE(void, ICom, send, buf, critical);
}
std::string receive() override {
PYBIND11_OVERLOAD_PURE(std::string, ICom, receive, );
......@@ -33,13 +33,13 @@ class PyICom : public ICom {
uint32_t receive(char *buf, size_t length) override {
PYBIND11_OVERLOAD_PURE(uint32_t, ICom, receive, buf, length);
}
std::string sendreceive(const std::string &cmd) override {
PYBIND11_OVERLOAD_PURE(std::string, ICom, sendreceive, cmd);
std::string sendreceive(const std::string &cmd, bool critical) override {
PYBIND11_OVERLOAD_PURE(std::string, ICom, sendreceive, cmd, critical);
}
void sendreceive(char *wbuf, size_t wlength, char *rbuf,
size_t rlength) override {
size_t rlength, bool critical) override {
PYBIND11_OVERLOAD_PURE(void, ICom, sendreceive, wbuf, wlength, rbuf,
rlength);
rlength, critical);
}
void lock() override { PYBIND11_OVERLOAD_PURE(void, ICom, lock, ); }
void unlock() override { PYBIND11_OVERLOAD_PURE(void, ICom, unlock, ); }
......@@ -56,11 +56,11 @@ class PyCom : public ComBase {
void setConfiguration(const nl::json &config) override {
PYBIND11_OVERLOAD(void, ComBase, setConfiguration, config);
}
void send(char *buf, size_t length) override {
PYBIND11_OVERLOAD(void, ComBase, send, buf, length);
void send(char *buf, size_t length, bool critical) override {
PYBIND11_OVERLOAD(void, ComBase, send, buf, length, critical);
}
void send(const std::string &buf) override {
PYBIND11_OVERLOAD(void, ComBase, send, buf);
void send(const std::string &buf, bool critical) override {
PYBIND11_OVERLOAD(void, ComBase, send, buf, critical);
}
std::string receive() override {
PYBIND11_OVERLOAD(std::string, ComBase, receive, );
......@@ -68,13 +68,13 @@ class PyCom : public ComBase {
uint32_t receive(char *buf, size_t length) override {
PYBIND11_OVERLOAD(uint32_t, ComBase, receive, buf, length);
}
std::string sendreceive(const std::string &cmd) override {
PYBIND11_OVERLOAD(std::string, ComBase, sendreceive, cmd);
std::string sendreceive(const std::string &cmd, bool critical) override {
PYBIND11_OVERLOAD(std::string, ComBase, sendreceive, cmd, critical);
}
void sendreceive(char *wbuf, size_t wlength, char *rbuf,
size_t rlength) override {
size_t rlength, bool critical) override {
PYBIND11_OVERLOAD(void, ComBase, sendreceive, wbuf, wlength, rbuf,
rlength);
rlength, critical);
}
void lock() override { PYBIND11_OVERLOAD(void, ComBase, lock, ); }
void unlock() override { PYBIND11_OVERLOAD(void, ComBase, unlock, ); }
......@@ -88,11 +88,11 @@ class PyTextSerialCom : public TextSerialCom {
void setConfiguration(const nl::json &config) override {
PYBIND11_OVERLOAD(void, TextSerialCom, setConfiguration, config);
}
void send(char *buf, size_t length) override {
PYBIND11_OVERLOAD(void, TextSerialCom, send, buf, length);
void send(char *buf, size_t length, bool critical) override {
PYBIND11_OVERLOAD(void, TextSerialCom, send, buf, length, critical);
}
void send(const std::string &buf) override {
PYBIND11_OVERLOAD(void, TextSerialCom, send, buf);
void send(const std::string &buf, bool critical) override {
PYBIND11_OVERLOAD(void, TextSerialCom, send, buf, critical);
}
std::string receive() override {
PYBIND11_OVERLOAD(std::string, TextSerialCom, receive, );
......@@ -111,11 +111,11 @@ class PyGPIBSerialCom : public GPIBSerialCom {
void setConfiguration(const nl::json &config) override {
PYBIND11_OVERLOAD(void, GPIBSerialCom, setConfiguration, config);
}
void send(char *buf, size_t length) override {
PYBIND11_OVERLOAD(void, GPIBSerialCom, send, buf, length);
void send(char *buf, size_t length, bool critical) override {
PYBIND11_OVERLOAD(void, GPIBSerialCom, send, buf, length, critical);
}
void send(const std::string &buf) override {
PYBIND11_OVERLOAD(void, GPIBSerialCom, send, buf);
void send(const std::string &buf, bool critical) override {
PYBIND11_OVERLOAD(void, GPIBSerialCom, send, buf, critical);
}
std::string receive() override {
PYBIND11_OVERLOAD(std::string, GPIBSerialCom, receive, );
......@@ -131,13 +131,13 @@ void register_com(py::module &m) {
.def("init", &ICom::init)
.def("is_open", &ICom::is_open)
.def("setConfiguration", &ICom::setConfiguration)
.def("send", (void (ICom::*)(char *, size_t)) & ICom::send)
.def("send", (void (ICom::*)(const std::string &)) & ICom::send)
.def("send", (void (ICom::*)(char *, size_t, bool)) & ICom::send)
.def("send", (void (ICom::*)(const std::string &, bool)) & ICom::send)
.def("receive", (std::string(ICom::*)()) & ICom::receive)
.def("receive", (uint32_t(ICom::*)(char *, size_t)) & ICom::receive)
.def("sendreceive",
(std::string(ICom::*)(const std::string &)) & ICom::sendreceive)
.def("sendreceive", (void (ICom::*)(char *, size_t, char *, size_t)) &
(std::string(ICom::*)(const std::string &, bool)) & ICom::sendreceive)
.def("sendreceive", (void (ICom::*)(char *, size_t, char *, size_t, bool)) &
ICom::sendreceive)
.def("lock", &ICom::lock)
.def("unlock", &ICom::unlock);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment