diff --git a/include/mynteye/types.h b/include/mynteye/types.h index 444c80c..1f3aa98 100644 --- a/include/mynteye/types.h +++ b/include/mynteye/types.h @@ -165,6 +165,19 @@ enum class Source : std::uint8_t { LAST }; +/** + * @ingroup enumerations + * @brief Add-Ons are peripheral modules of our hardware. + */ +enum class AddOns : std::uint8_t { + /** Infrared */ + INFRARED, + /** Second infrared */ + INFRARED2, + /** Last guard */ + LAST +}; + #define MYNTEYE_ENUM_HELPERS(TYPE) \ MYNTEYE_API const char *to_string(const TYPE &value); \ inline bool is_valid(const TYPE &value) { \ @@ -187,6 +200,7 @@ MYNTEYE_ENUM_HELPERS(Capabilities) MYNTEYE_ENUM_HELPERS(Info) MYNTEYE_ENUM_HELPERS(Option) MYNTEYE_ENUM_HELPERS(Source) +MYNTEYE_ENUM_HELPERS(AddOns) #undef MYNTEYE_ENUM_HELPERS diff --git a/src/public/types.cc b/src/public/types.cc index ec352b0..4914705 100644 --- a/src/public/types.cc +++ b/src/public/types.cc @@ -122,6 +122,19 @@ const char *to_string(const Source &value) { #undef CASE } +const char *to_string(const AddOns &value) { +#define CASE(X) \ + case AddOns::X: \ + return "AddOns::" #X; + switch (value) { + CASE(INFRARED) + CASE(INFRARED2) + default: + return "AddOns::UNKNOWN"; + } +#undef CASE +} + const char *to_string(const Format &value) { #define CASE(X) \ case Format::X: \ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7e5e684..8862576 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -52,6 +52,9 @@ message(STATUS "Found mynteye: ${mynteye_VERSION}") LIST(APPEND CMAKE_MODULE_PATH ${PRO_DIR}/cmake) +find_package(OpenCV REQUIRED) +message(STATUS "Found OpenCV: ${OpenCV_VERSION}") + ## gtest set(TEST_DIR ${PROJECT_SOURCE_DIR}) @@ -93,9 +96,10 @@ add_executable(${PROJECT_NAME} ${TEST_INTERNAL_SRC} ${TEST_PUBLIC_SRC} ) -target_link_libraries(${PROJECT_NAME} ${GTEST_LIBS} mynteye) +target_link_libraries(${PROJECT_NAME} mynteye ${GTEST_LIBS} ${OpenCV_LIBS}) target_create_scripts(${PROJECT_NAME} DLL_SEARCH_PATHS ${PRO_DIR}/_install/bin + ${OpenCV_LIB_SEARCH_PATH} ) if(OS_WIN) diff --git a/test/public/types_test.cc b/test/public/types_test.cc index bf55b0e..e5a8f6e 100644 --- a/test/public/types_test.cc +++ b/test/public/types_test.cc @@ -68,6 +68,11 @@ TEST(Source, VerifyToString) { EXPECT_STREQ("Source::ALL", to_string(Source::ALL)); } +TEST(AddOns, VerifyToString) { + EXPECT_STREQ("AddOns::INFRARED", to_string(AddOns::INFRARED)); + EXPECT_STREQ("AddOns::INFRARED2", to_string(AddOns::INFRARED2)); +} + TEST(Format, VerifyToString) { EXPECT_STREQ("Format::GREY", to_string(Format::GREY)); EXPECT_STREQ("Format::YUYV", to_string(Format::YUYV));