Skip to content

Commit

Permalink
[pyFps] typo fix; expose basic FPS flags through CPT; doc
Browse files Browse the repository at this point in the history
  • Loading branch information
DasVinch committed Nov 8, 2024
1 parent 7ed7e34 commit baec4ca
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
13 changes: 13 additions & 0 deletions python_module/CacaoProcessTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@ PYBIND11_MODULE(CacaoProcessTools, m)
.value("FPSNAME", FPS_type::FPSNAME)
.export_values();

py::enum_<FPS_flags>(m, "FPS_flags")
.value("DEFAULT_INPUT", FPS_flags::DEFAULT_INPUT)
.value("DEFAULT_OUTPUT", FPS_flags::DEFAULT_OUTPUT)
.value("DEFAULT_INPUT_STREAM", FPS_flags::DEFAULT_INPUT_STREAM)
.value("DEFAULT_OUTPUT_STREAM", FPS_flags::DEFAULT_OUTPUT_STREAM)
.export_values();


py::class_<timespec>(m, "timespec")
.def(py::init<time_t, long>())
.def_readwrite("tv_sec", &timespec::tv_sec)
Expand Down Expand Up @@ -410,6 +418,8 @@ If entry already exists, do not modify it
Parameters:
name [in]: the name of the shared memory file to connect
comment [in]: description
fptype [in]: datatype
)pbdoc",
py::arg("entry_name"),
py::arg("entry_desc"),
Expand All @@ -423,6 +433,9 @@ If entry already exists, do not modify it
Parameters:
name [in]: the name of the shared memory file to connect
comment [in]: description
fptype [in]: datatype
fpflag [in]: fps flags
)pbdoc",
py::arg("entry_name"),
py::arg("entry_desc"),
Expand Down
8 changes: 4 additions & 4 deletions python_module/pyFps.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ class pyFps
keys_[entry_name] = static_cast<FPS_type>(fptype);
// We need to prepend a . to entry to abide by FPS conventions
// See fps_add_entry.c
std::string preprended = "." + entry_name;
return function_parameter_add_entry(&fps_, preprended.c_str(),
std::string prepended = "." + entry_name;
return function_parameter_add_entry(&fps_, prepended.c_str(),
entry_desc.c_str(), fptype,
FPFLAG_DEFAULT_INPUT, nullptr, nullptr);
}
Expand All @@ -244,8 +244,8 @@ class pyFps
uint32_t fptype, uint64_t fpflag)
{
keys_[entry_name] = static_cast<FPS_type>(fptype);
std::string preprended = "." + entry_name;
return function_parameter_add_entry(&fps_, entry_name.c_str(),
std::string prepended = "." + entry_name;
return function_parameter_add_entry(&fps_, prepended.c_str(),
entry_desc.c_str(), fptype,
fpflag, nullptr, nullptr);
}
Expand Down

0 comments on commit baec4ca

Please sign in to comment.