Skip to content

Commit b1d6d30

Browse files
committed
Added getProductName and tweaked getDeviceName
1 parent d1c103e commit b1d6d30

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

src/CalibrationHandlerBindings.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ void CalibrationHandlerBindings::bind(pybind11::module& m, void* pCallstack){
6262

6363
.def("setBoardInfo", py::overload_cast<std::string, std::string>(&CalibrationHandler::setBoardInfo), py::arg("boardName"), py::arg("boardRev"), DOC(dai, CalibrationHandler, setBoardInfo))
6464
.def("setBoardInfo", py::overload_cast<std::string, std::string, std::string, std::string, std::string, std::string, uint64_t, uint32_t, std::string>(&CalibrationHandler::setBoardInfo), py::arg("productName"), py::arg("boardName"), py::arg("boardRev"), py::arg("boardConf"), py::arg("hardwareConf"), py::arg("batchName"), py::arg("batchTime"), py::arg("boardOptions"), py::arg("boardCustom") = "", DOC(dai, CalibrationHandler, setBoardInfo, 2))
65+
.def("setBoardInfo", py::overload_cast<std::string, std::string, std::string, std::string, std::string, std::string, std::string, uint64_t, uint32_t, std::string>(&CalibrationHandler::setBoardInfo), py::arg("deviceName"), py::arg("productName"), py::arg("boardName"), py::arg("boardRev"), py::arg("boardConf"), py::arg("hardwareConf"), py::arg("batchName"), py::arg("batchTime"), py::arg("boardOptions"), py::arg("boardCustom") = "", DOC(dai, CalibrationHandler, setBoardInfo, 3))
66+
67+
.def("setDeviceName", &CalibrationHandler::setDeviceName, py::arg("deviceName"), DOC(dai, CalibrationHandler, setDeviceName))
6568
.def("setProductName", &CalibrationHandler::setProductName, py::arg("productName"), DOC(dai, CalibrationHandler, setProductName))
6669

6770
.def("setCameraIntrinsics", py::overload_cast<CameraBoardSocket, std::vector<std::vector<float>>, Size2f>(&CalibrationHandler::setCameraIntrinsics), py::arg("cameraId"), py::arg("intrinsics"), py::arg("frameSize"), DOC(dai, CalibrationHandler, setCameraIntrinsics))

src/DeviceBindings.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,7 @@ void DeviceBindings::bind(pybind11::module& m, void* pCallstack){
653653
.def("setTimesync", [](DeviceBase& d, std::chrono::milliseconds p, int s, bool r) { py::gil_scoped_release release; return d.setTimesync(p,s,r); }, DOC(dai, DeviceBase, setTimesync))
654654
.def("setTimesync", [](DeviceBase& d, bool e) { py::gil_scoped_release release; return d.setTimesync(e); }, py::arg("enable"), DOC(dai, DeviceBase, setTimesync, 2))
655655
.def("getDeviceName", [](DeviceBase& d) { std::string name; { py::gil_scoped_release release; name = d.getDeviceName(); } return py::bytes(name).attr("decode")("utf-8", "replace"); }, DOC(dai, DeviceBase, getDeviceName))
656+
.def("getProductName", [](DeviceBase& d) { std::string name; { py::gil_scoped_release release; name = d.getProductName(); } return py::bytes(name).attr("decode")("utf-8", "replace"); }, DOC(dai, DeviceBase, getProductName))
656657
;
657658

658659

src/pipeline/CommonBindings.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void CommonBindings::bind(pybind11::module& m, void* pCallstack){
6464
py::enum_<FrameEvent> frameEvent(m, "FrameEvent", DOC(dai, FrameEvent));
6565
py::class_<ProfilingData> profilingData(m, "ProfilingData", DOC(dai, ProfilingData));
6666
py::enum_<Interpolation> interpolation(m, "Interpolation", DOC(dai, Interpolation));
67-
67+
6868
///////////////////////////////////////////////////////////////////////
6969
///////////////////////////////////////////////////////////////////////
7070
///////////////////////////////////////////////////////////////////////
@@ -295,7 +295,8 @@ void CommonBindings::bind(pybind11::module& m, void* pCallstack){
295295
.def_readwrite("boardConf", &EepromData::boardConf)
296296
.def_readwrite("hardwareConf", &EepromData::hardwareConf)
297297
.def_readwrite("productName", &EepromData::productName)
298-
.def_readwrite("batchName", &EepromData::batchName)
298+
// .def_readwrite("batchName", &EepromData::batchName)
299+
.def_readwrite("deviceName", &EepromData::deviceName)
299300
.def_readwrite("batchTime", &EepromData::batchTime)
300301
.def_readwrite("boardOptions", &EepromData::boardOptions)
301302
.def_readwrite("cameraData", &EepromData::cameraData)
@@ -379,7 +380,7 @@ void CommonBindings::bind(pybind11::module& m, void* pCallstack){
379380
.value("READOUT_START", FrameEvent::READOUT_START)
380381
.value("READOUT_END", FrameEvent::READOUT_END)
381382
;
382-
383+
383384
interpolation
384385
.value("BILINEAR", Interpolation::BILINEAR)
385386
.value("BICUBIC", Interpolation::BICUBIC)

0 commit comments

Comments
 (0)