summaryrefslogtreecommitdiff
path: root/gr-trellis/python/trellis/bindings/fsm_python.cc
blob: 03f6d7b3acbef1a92fb9ab004f0eac530f417858 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
 * 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 */

#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))

        ;
}