Skip to content

Commit

Permalink
pyFps.hpp more generic add_entry
Browse files Browse the repository at this point in the history
  • Loading branch information
DasVinch committed Nov 8, 2024
1 parent a8385f3 commit d5c5f6f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

# ADD SOURCE DIRECTORIES
# recursively add libraries to be compiled
execute_process(COMMAND bash -c "find ${PROJECT_SOURCE_DIR}/plugins -mindepth 2 -maxdepth 2 -type d| grep -v .git| grep -v .vscode"
execute_process(COMMAND bash -c "find ${PROJECT_SOURCE_DIR}/plugins -mindepth 2 -maxdepth 2 -type d | grep -v .git | grep -v .vscode"
OUTPUT_VARIABLE libextradir)
string(REGEX REPLACE "\n" "; " libextradir "${libextradir}")

Expand Down
28 changes: 28 additions & 0 deletions python_module/pyFps.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ enum FPS_type : uint32_t
FPSNAME = FPTYPE_FPSNAME,
};

enum FPS_flags : uint64_t
{
// There are many more
DEFAULT_INPUT = FPFLAG_DEFAULT_INPUT,
DEFAULT_OUTPUT = FPFLAG_DEFAULT_OUTPUT,
DEFAULT_INPUT_STREAM = FPFLAG_DEFAULT_INPUT_STREAM,
DEFAULT_OUTPUT_STREAM = FPFLAG_DEFAULT_OUTPUT_STREAM,
}

class pyFps
{
std::string name_;
Expand Down Expand Up @@ -217,6 +226,25 @@ class pyFps
FPFLAG_DEFAULT_INPUT, nullptr, nullptr);
}

/**
* @brief Add parameter to database with generic settings
*
* If entry already exists, do not modify it
*
* @param entry_name : entry name
* @param entry_desc : entry description
* @param fptype : entry type ("int","double","float","string")
* @return int
*/
int add_entry(std::string entry_name, std::string entry_desc,
uint32_t fptype, uint64_t fpflag)
{
keys_[entry_name] = static_cast<FPS_type>(fptype);
return function_parameter_add_entry(&fps_, entry_name.c_str(),
entry_desc.c_str(), fptype,
fpflag, nullptr, nullptr);
}

/**
* @brief Get the status object
*
Expand Down

0 comments on commit d5c5f6f

Please sign in to comment.