diff --git a/FlippR-Driver/CMakeLists.txt b/FlippR-Driver/CMakeLists.txt index 9608a45..a7b3b92 100644 --- a/FlippR-Driver/CMakeLists.txt +++ b/FlippR-Driver/CMakeLists.txt @@ -46,6 +46,8 @@ ENDIF(CROSS_COMPILE) cmake_minimum_required(VERSION 3.0.1) project(FlippR-Driver VERSION 0.1.0)# LANGUAGES CXX) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") + #set easylogging flags add_definitions(-DELPP_NO_DEFAULT_LOG_FILE) diff --git a/FlippR-Driver/cmake/PocoConfig.cmake.in b/FlippR-Driver/cmake/PocoConfig.cmake.in new file mode 100644 index 0000000..173eacd --- /dev/null +++ b/FlippR-Driver/cmake/PocoConfig.cmake.in @@ -0,0 +1,53 @@ +if (CMAKE_VERSION VERSION_LESS 2.8.9) + message(FATAL_ERROR "Poco requires at least CMake version 2.8.9") +endif() + +if (NOT Poco_FIND_COMPONENTS) + set(Poco_NOT_FOUND_MESSAGE "The Poco package requires at least one component") + set(Poco_FOUND False) + return() +endif() + +set(_Poco_FIND_PARTS_REQUIRED) +if (Poco_FIND_REQUIRED) + set(_Poco_FIND_PARTS_REQUIRED REQUIRED) +endif() +set(_Poco_FIND_PARTS_QUIET) +if (Poco_FIND_QUIETLY) + set(_Poco_FIND_PARTS_QUIET QUIET) +endif() + +get_filename_component(_Poco_install_prefix "${CMAKE_CURRENT_LIST_DIR}" ABSOLUTE) + +set(_Poco_NOTFOUND_MESSAGE) + +# Let components find each other, but don't overwrite CMAKE_PREFIX_PATH +set(_Poco_CMAKE_PREFIX_PATH_old ${CMAKE_PREFIX_PATH}) +set(CMAKE_PREFIX_PATH ${_Poco_install_prefix}) + +foreach(module ${Poco_FIND_COMPONENTS}) + find_package(Poco${module} + ${_Poco_FIND_PARTS_QUIET} + ${_Poco_FIND_PARTS_REQUIRED} + PATHS "${_Poco_install_prefix}" NO_DEFAULT_PATH + ) + if (NOT Poco${module}_FOUND) + if (Poco_FIND_REQUIRED_${module}) + set(_Poco_NOTFOUND_MESSAGE "${_Poco_NOTFOUND_MESSAGE}Failed to find Poco component \"${module}\" config file at \"${_Poco_install_prefix}/Poco${module}/Poco${module}Config.cmake\"\n") + elseif(NOT Poco_FIND_QUIETLY) + message(WARNING "Failed to find Poco component \"${module}\" config file at \"${_Poco_install_prefix}/Poco${module}/Poco${module}Config.cmake\"") + endif() + endif() + + # For backward compatibility set the LIBRARIES variable + list(APPEND Poco_LIBRARIES "Poco::${module}") +endforeach() + +# Restore the original CMAKE_PREFIX_PATH value +set(CMAKE_PREFIX_PATH ${_Poco_CMAKE_PREFIX_PATH_old}) + +if (_Poco_NOTFOUND_MESSAGE) + set(Poco_NOT_FOUND_MESSAGE "${_Poco_NOTFOUND_MESSAGE}") + set(Poco_FOUND False) +endif() + diff --git a/FlippR-Driver/cmake/PocoConfigVersion.cmake.in b/FlippR-Driver/cmake/PocoConfigVersion.cmake.in new file mode 100644 index 0000000..98f292c --- /dev/null +++ b/FlippR-Driver/cmake/PocoConfigVersion.cmake.in @@ -0,0 +1,11 @@ +set(PACKAGE_VERSION @APPLICATION_VERSION@) + +# Check whether the requested PACKAGE_FIND_VERSION is compatible +if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() diff --git a/FlippR-Driver/cmake/README b/FlippR-Driver/cmake/README new file mode 100644 index 0000000..fae4a15 --- /dev/null +++ b/FlippR-Driver/cmake/README @@ -0,0 +1,36 @@ +CMAKE Files contributed by Andrew J. P. Maclean + + +Put the following files in the directory where your source code is: + CMakeLists.txt + PocoConfig.cmake. + +Edit CMakeLists.txt to include your source and header files. The sections of interest are: +# Add any source files here. +SET( EXE_SRCS + "My File.cpp" +) +# Add any include files here. +SET( EXE_INCS + "My File.h" +) + +Then create a subdirectory called build. +In Linux: +cd build +ccmake .. +or +ccmake -GKDevelop3 .. +(This will set up everything so you can use KDevelop3). + +In Windows: +run CMakeSetup.exe and set the source code directory and where to build the libraries. + +If CMake cannot find Poco, you will see that the variable Poco_INCLUDE_DIR has the value Poco_INCLUDE_DIR-NOTFOUND. Just set this value to the top level direcotry of where the Poco includes are. + +If there is a different version of Poco, you may have to add edit the variables SUFFIX_FOR_INCLUDE_PATH, and SUFFIX_FOR_LIBRARY_PATH adding in the new Poco version in a similar manner to the existing ones in the file PocoConfig.cmake. + +Finally: +In Linux + Either type "make" or if you are using KDevelop, click on the .kdevelop file. +In Windows just use your IDE or nmake if you use nmake. diff --git a/FlippR-Driver/cmake/cmake_uninstall.cmake.in b/FlippR-Driver/cmake/cmake_uninstall.cmake.in new file mode 100644 index 0000000..03137d5 --- /dev/null +++ b/FlippR-Driver/cmake/cmake_uninstall.cmake.in @@ -0,0 +1,22 @@ +IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") +ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + +FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) +STRING(REGEX REPLACE "\n" ";" files "${files}") +FOREACH(file ${files}) + MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") + IF(EXISTS "$ENV{DESTDIR}${file}") + EXEC_PROGRAM( + "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval + ) + IF("${rm_retval}" STREQUAL 0) + ELSE("${rm_retval}" STREQUAL 0) + MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") + ENDIF("${rm_retval}" STREQUAL 0) + ELSE(EXISTS "$ENV{DESTDIR}${file}") + MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") + ENDIF(EXISTS "$ENV{DESTDIR}${file}") +ENDFOREACH(file) diff --git a/FlippR-Driver/cmake/test_compiler.cpp b/FlippR-Driver/cmake/test_compiler.cpp new file mode 100644 index 0000000..d9b7398 --- /dev/null +++ b/FlippR-Driver/cmake/test_compiler.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main() +{ + std::string str = "Try to compile"; + std::cout << str << '\n'; + return 0; +} diff --git a/FlippR-Driver/contrib/json_example/output/Sound_Config.json b/FlippR-Driver/contrib/json_example/output/Sound_Config.json index 6cd37bd..0955a3d 100644 --- a/FlippR-Driver/contrib/json_example/output/Sound_Config.json +++ b/FlippR-Driver/contrib/json_example/output/Sound_Config.json @@ -2,17 +2,11 @@ "deactivation_time_milliseconds" : 10, "port_extenders" : [ -<<<<<<< HEAD { "name" : "extender_0", "i2c_address" : 33, "pin_base" : 81 } -======= - "name" : "extender_0", - "i2c_address" : 33, - "pin_base" : 81 ->>>>>>> aa1d6409ea18cff1ad4b0ef06804fcf5a521dee9 ], "fire_pin" : { @@ -194,7 +188,162 @@ "address" : "50", "description" : "Speech 1: \"You're good! But I'm still the Champ!\"", "extender" : "extender_0" - } - + }, + { + "id" : 29, + "address" : "51", + "description" : "Speech 2: \"Twenty\"", + "extender" : "extender_0" + }, + { + "id" : 30, + "address" : "52", + "description" : "Speech 3: \"Seconds\"", + "extender" : "extender_0" + }, + { + "id" : 31, + "address" : "53", + "description" : "Speech 4: \"Five, Four, Three, Two, One.\"", + "extender" : "extender_0" + }, + { + "id" : 32, + "address" : "54", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, + { + "id" : 33, + "address" : "55", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, + { + "id" : 34, + "address" : "56", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, + { + "id" : 35, + "address" : "57", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, + { + "id" : 36, + "address" : "58", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, + { + "id" : 37, + "address" : "59", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, + { + "id" : 38, + "address" : "60", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, + { + "id" : 39, + "address" : "61", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, + { + "id" : 40, + "address" : "62", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, + { + "id" : 41, + "address" : "63", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, + { + "id" : 42, + "address" : "64", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, + { + "id" : 43, + "address" : "65", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, + { + "id" : 44, + "address" : "66", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, + { + "id" : 45, + "address" : "67", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, + { + "id" : 46, + "address" : "68", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, + { + "id" : 47, + "address" : "69", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, + { + "id" : 48, + "address" : "70", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, + { + "id" : 49, + "address" : "71", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, + { + "id" : 50, + "address" : "72", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, + { + "id" : 51, + "address" : "73", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, + { + "id" : 52, + "address" : "74", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, + { + "id" : 53, + "address" : "75", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, + { + "id" : 54, + "address" : "76", + "description" : "speech 1: \"you're good! but i'm still the champ!\"", + "extender" : "extender_0" + }, ] } diff --git a/FlippR-Driver/src/output/detail/DriverBoardPinController.cpp b/FlippR-Driver/src/output/detail/DriverBoardPinController.cpp index 2a9215d..1b03e6f 100644 --- a/FlippR-Driver/src/output/detail/DriverBoardPinController.cpp +++ b/FlippR-Driver/src/output/detail/DriverBoardPinController.cpp @@ -18,7 +18,6 @@ namespace detail DriverBoardPinController::DriverBoardPinController(std::shared_ptr output_item_mutex) : output_item_mutex(std::move(output_item_mutex)) { - CLOG(INFO, OUTPUT_LOGGER) << "Created DriverBoardPinController."; }