From e88f23b2bb8b63aaf7fd8bd90c39250f53fbc6cf Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 20 Mar 2019 11:30:04 -0700 Subject: python: Add operators and get_full_secs() to time_spec_t This exposes existing operators and API calls from C++ into Python. --- host/lib/types/time_spec_python.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'host/lib') diff --git a/host/lib/types/time_spec_python.hpp b/host/lib/types/time_spec_python.hpp index 12489fd44..3f87e9885 100644 --- a/host/lib/types/time_spec_python.hpp +++ b/host/lib/types/time_spec_python.hpp @@ -27,13 +27,17 @@ void export_time_spec(py::module& m) .def("get_tick_count" , &time_spec_t::get_tick_count ) .def("to_ticks" , &time_spec_t::to_ticks ) .def("get_real_secs" , &time_spec_t::get_real_secs ) + .def("get_full_secs" , &time_spec_t::get_full_secs ) .def("get_frac_secs" , &time_spec_t::get_frac_secs ) .def(py::self += time_spec_t()) + .def(py::self -= time_spec_t()) + .def(py::self + time_spec_t()) + .def(py::self - time_spec_t()) .def(py::self += double()) + .def(py::self -= double()) .def(py::self + double()) - .def(py::self + time_spec_t()) - .def(py::self -= time_spec_t()) + .def(py::self - double()) ; } -- cgit v1.2.3