summaryrefslogtreecommitdiff
path: root/gr-trellis/python/trellis/bindings/fsm_python.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gr-trellis/python/trellis/bindings/fsm_python.cc')
-rw-r--r--gr-trellis/python/trellis/bindings/fsm_python.cc121
1 files changed, 121 insertions, 0 deletions
diff --git a/gr-trellis/python/trellis/bindings/fsm_python.cc b/gr-trellis/python/trellis/bindings/fsm_python.cc
new file mode 100644
index 0000000000..d8441b08bb
--- /dev/null
+++ b/gr-trellis/python/trellis/bindings/fsm_python.cc
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2020 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *
+ */
+
+/***********************************************************************************/
+/* This file is automatically generated using bindtool and can be manually edited */
+/* The following lines can be configured to regenerate this file during cmake */
+/* If manual edits are made, the following tags should be modified accordingly. */
+/* BINDTOOL_GEN_AUTOMATIC(0) */
+/* BINDTOOL_USE_PYGCCXML(0) */
+/* BINDTOOL_HEADER_FILE(fsm.h) */
+/* BINDTOOL_HEADER_FILE_HASH(55ea410fe82d117d20ec1c63ac3df824) */
+/***********************************************************************************/
+
+#include <pybind11/complex.h>
+#include <pybind11/pybind11.h>
+#include <pybind11/stl.h>
+
+namespace py = pybind11;
+
+#include <gnuradio/trellis/fsm.h>
+// pydoc.h is automatically generated in the build directory
+#include <fsm_pydoc.h>
+
+void bind_fsm(py::module& m)
+{
+
+ using fsm = ::gr::trellis::fsm;
+
+
+ py::class_<fsm, std::shared_ptr<fsm>>(m, "fsm", D(fsm))
+
+ .def(py::init<>(), D(fsm, fsm, 0))
+ .def(py::init<gr::trellis::fsm const&>(), py::arg("FSM"), D(fsm, fsm, 1))
+ .def(py::init<int,
+ int,
+ int,
+ std::vector<int, std::allocator<int>> const&,
+ std::vector<int, std::allocator<int>> const&>(),
+ py::arg("I"),
+ py::arg("S"),
+ py::arg("O"),
+ py::arg("NS"),
+ py::arg("OS"),
+ D(fsm, fsm, 2))
+ .def(py::init<char const*>(), py::arg("name"), D(fsm, fsm, 3))
+ .def(py::init<int, int, std::vector<int, std::allocator<int>> const&>(),
+ py::arg("k"),
+ py::arg("n"),
+ py::arg("G"),
+ D(fsm, fsm, 4))
+ .def(py::init<int, int>(),
+ py::arg("mod_size"),
+ py::arg("ch_length"),
+ D(fsm, fsm, 5))
+ .def(py::init<int, int, int>(),
+ py::arg("P"),
+ py::arg("M"),
+ py::arg("L"),
+ D(fsm, fsm, 6))
+ .def(py::init<gr::trellis::fsm const&, gr::trellis::fsm const&>(),
+ py::arg("FSM1"),
+ py::arg("FSM2"),
+ D(fsm, fsm, 7))
+ .def(py::init<gr::trellis::fsm const&, gr::trellis::fsm const&, bool>(),
+ py::arg("FSMo"),
+ py::arg("FSMi"),
+ py::arg("serial"),
+ D(fsm, fsm, 8))
+ .def(py::init<gr::trellis::fsm const&, int>(),
+ py::arg("FSM"),
+ py::arg("n"),
+ D(fsm, fsm, 9))
+
+
+ .def("I", &fsm::I, D(fsm, I))
+
+
+ .def("S", &fsm::S, D(fsm, S))
+
+
+ .def("O", &fsm::O, D(fsm, O))
+
+
+ .def("NS", &fsm::NS, D(fsm, NS))
+
+
+ .def("OS", &fsm::OS, D(fsm, OS))
+
+
+ .def("PS", &fsm::PS, D(fsm, PS))
+
+
+ .def("PI", &fsm::PI, D(fsm, PI))
+
+
+ .def("TMi", &fsm::TMi, D(fsm, TMi))
+
+
+ .def("TMl", &fsm::TMl, D(fsm, TMl))
+
+
+ .def("write_trellis_svg",
+ &fsm::write_trellis_svg,
+ py::arg("filename"),
+ py::arg("number_stages"),
+ D(fsm, write_trellis_svg))
+
+
+ .def("write_fsm_txt",
+ &fsm::write_fsm_txt,
+ py::arg("filename"),
+ D(fsm, write_fsm_txt))
+
+ ;
+}