diff --git a/.gitignore b/.gitignore index 11c9c013..b7b2e79c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,15 @@ .DS_Store CMakeFiles/ __/ + +# Ignoring autogenerated files +*.cmake +Makefile +qrc_*.cpp +*.qrc.depends +moc_*.cpp +moc_*.cpp_parameters +CMakeCache.txt +*.log +/HyperionConfig.h +/lib diff --git a/.travis/travis_build.sh b/.travis/travis_build.sh index d274d8ff..0c84cf20 100755 --- a/.travis/travis_build.sh +++ b/.travis/travis_build.sh @@ -1,32 +1,32 @@ #!/bin/bash # for executing in non travis environment -[ -z "$TRAVIS_OS_NAME" ] && TRAVIS_OS_NAME="$( uname -s | tr '[:upper:]' '[:lower:]' )" +[ -z "$TRAVIS_OS_NAME" ] && TRAVIS_OS_NAME="$(uname -s | tr 'A-Z' 'a-z')" -###################################### -## COMPILE HYPERION +# Detect number of processor cores -# compile hyperion on osx -if [[ $TRAVIS_OS_NAME == 'osx' ]] -then +if [[ $TRAVIS_OS_NAME == 'osx' || $TRAVIS_OS_NAME == 'darwin' ]]; then procs=$(sysctl -n hw.ncpu | xargs) - echo "Processes: $procs" - - mkdir build || exit 1 - cd build - cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_TESTS=ON -Wno-dev .. || exit 2 - make -j$procs || exit 3 - # make -j$(nproc) package || exit 4 # currently osx(dmg) package creation not implemented +elif [[ $TRAVIS_OS_NAME == 'linux' ]]; then + procs=$(nproc) +else + # For most modern systems, including the pi, this is a sane default + procs=4 fi -# compile hyperion on linux -if [[ $TRAVIS_OS_NAME == 'linux' ]] -then - mkdir build || exit 1 - cd build - cmake -DPLATFORM=x86-dev -DCMAKE_BUILD_TYPE=Debug .. || exit 2 - make -j$(nproc) || exit 3 - make -j$(nproc) package || exit 4 + +# Compile hyperion + +mkdir build || exit 1 +cd build +cmake -DPLATFORM=x86-dev -DCMAKE_BUILD_TYPE=Debug .. || exit 2 +make -j$(nproc) || exit 3 + + +# Build the package on Linux + +if [[ $TRAVIS_OS_NAME == 'linux' ]]; then + make -j$(nproc) package || exit 4 fi diff --git a/.travis/travis_install.sh b/.travis/travis_install.sh index cb013543..af198a6e 100755 --- a/.travis/travis_install.sh +++ b/.travis/travis_install.sh @@ -1,7 +1,10 @@ #!/bin/bash +# for executing in non travis environment +[ -z "$TRAVIS_OS_NAME" ] && TRAVIS_OS_NAME="$( uname -s | tr '[:upper:]' '[:lower:]' )" + # install osx deps for hyperion compile -if [[ $TRAVIS_OS_NAME == 'osx' ]] +if [[ $TRAVIS_OS_NAME == 'osx' || $TRAVIS_OS_NAME == 'darwin' ]] then echo "Install OSX deps" time brew update @@ -9,13 +12,15 @@ then time brew install libusb || true time brew install cmake || true time brew install doxygen || true -fi # install linux deps for hyperion compile -if [[ $TRAVIS_OS_NAME == 'linux' ]] +elif [[ $TRAVIS_OS_NAME == 'linux' ]] then echo "Install linux deps" sudo apt-get -qq update sudo apt-get install -qq -y qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev doxygen +else + echo "Unsupported platform: $TRAVIS_OS_NAME" + exit 5 fi diff --git a/CMakeLists.txt b/CMakeLists.txt index 956c91a0..46e35bf2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,55 +30,58 @@ SET ( DEFAULT_USE_SHARED_AVAHI_LIBS OFF ) SET ( DEFAULT_USE_AVAHI_LIBS ON ) SET ( DEFAULT_TESTS OFF ) +if ( NOT DEFINED PLATFORM ) + if ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86" ) + SET( PLATFORM "x86") + elseif ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm" ) + SET( PLATFORM "rpi") + EXEC_PROGRAM( "nproc" OUTPUT_VARIABLE SYSTEM_CPU_CORES ) + FILE( READ /proc/cpuinfo SYSTEM_CPUINFO ) + STRING ( TOLOWER "${SYSTEM_CPUINFO}" SYSTEM_CPUINFO ) + if ( "${SYSTEM_CPUINFO}" MATCHES "amlogic" ) + SET( PLATFORM "wetek" ) + elseif( SYSTEM_CPU_CORES GREATER 1 AND "${SYSTEM_CPUINFO}" MATCHES "bcm" ) + SET( PLATFORM "rpi-pwm" ) + endif() + endif() + if ( PLATFORM ) + message( STATUS "PLATFORM is not defined, evaluated platform: ${PLATFORM}") + else() + message( FATAL_ERROR "PLATFORM is not defined and could not be evaluated. Set -DPLATFORM=") + endif() +endif() + +if ( "${PLATFORM}" STREQUAL "rpi" ) + SET ( DEFAULT_DISPMANX ON ) +elseif ( "${PLATFORM}" STREQUAL "rpi-pwm" ) + SET ( DEFAULT_DISPMANX ON ) + SET ( DEFAULT_WS2812BPWM ON ) + SET ( DEFAULT_WS281XPWM ON ) +elseif ( "${PLATFORM}" STREQUAL "wetek" ) + SET ( DEFAULT_AMLOGIC ON ) +elseif ( "${PLATFORM}" STREQUAL "x86" ) + SET ( DEFAULT_X11 ON ) + SET ( DEFAULT_USE_SHARED_AVAHI_LIBS ON ) +elseif ( "${PLATFORM}" STREQUAL "x86-dev" ) + SET ( DEFAULT_X11 ON ) + SET ( DEFAULT_AMLOGIC ON) + SET ( DEFAULT_WS281XPWM ON ) + SET ( DEFAULT_USE_SHARED_AVAHI_LIBS ON ) + SET ( DEFAULT_TESTS ON ) +elseif ( "${PLATFORM}" STREQUAL "imx6" ) + SET ( DEFAULT_FB ON ) +endif() + if (APPLE) - set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "/usr/local/opt/qt5") + set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "/usr/local/opt/qt5") + include_directories("/opt/X11/include/") SET ( DEFAULT_OSX ON ) - SET ( DEFAULT_V4L2 OFF ) + SET ( DEFAULT_V4L2 OFF ) SET ( DEFAULT_SPIDEV OFF ) SET ( DEFAULT_FB OFF ) - SET ( DEFAULT_USE_AVAHI_LIBS OFF ) -else () - if ( NOT DEFINED PLATFORM ) - if ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86" ) - SET( PLATFORM "x86") - elseif ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm" ) - SET( PLATFORM "rpi") - EXEC_PROGRAM( "nproc" OUTPUT_VARIABLE SYSTEM_CPU_CORES ) - FILE( READ /proc/cpuinfo SYSTEM_CPUINFO ) - STRING ( TOLOWER "${SYSTEM_CPUINFO}" SYSTEM_CPUINFO ) - if ( "${SYSTEM_CPUINFO}" MATCHES "amlogic" ) - SET( PLATFORM "wetek" ) - elseif( SYSTEM_CPU_CORES GREATER 1 AND "${SYSTEM_CPUINFO}" MATCHES "bcm" ) - SET( PLATFORM "rpi-pwm" ) - endif() - endif() - if ( PLATFORM ) - message( STATUS "PLATFORM is not defined, evaluated platform: ${PLATFORM}") - else() - message( FATAL_ERROR "PLATFORM is not defined and could not be evaluated. Set -DPLATFORM=") - endif() - endif() - - if ( "${PLATFORM}" STREQUAL "rpi" ) - SET ( DEFAULT_DISPMANX ON ) - elseif ( "${PLATFORM}" STREQUAL "rpi-pwm" ) - SET ( DEFAULT_DISPMANX ON ) - SET ( DEFAULT_WS2812BPWM ON ) - SET ( DEFAULT_WS281XPWM ON ) - elseif ( "${PLATFORM}" STREQUAL "wetek" ) - SET ( DEFAULT_AMLOGIC ON ) - elseif ( "${PLATFORM}" STREQUAL "x86" ) - SET ( DEFAULT_X11 ON ) - SET ( DEFAULT_USE_SHARED_AVAHI_LIBS ON ) - elseif ( "${PLATFORM}" STREQUAL "x86-dev" ) - SET ( DEFAULT_X11 ON ) - SET ( DEFAULT_AMLOGIC ON) - SET ( DEFAULT_WS281XPWM ON ) - SET ( DEFAULT_USE_SHARED_AVAHI_LIBS ON ) - SET ( DEFAULT_TESTS ON ) - elseif ( "${PLATFORM}" STREQUAL "imx6" ) - SET ( DEFAULT_FB ON ) - endif() + SET ( DEFAULT_WS281XPWM OFF ) + SET ( DEFAULT_USE_AVAHI_LIBS OFF ) + SET ( DEFAULT_USE_SHARED_AVAHI_LIBS OFF ) endif () # set the build options @@ -124,10 +127,6 @@ message(STATUS "ENABLE_PROFILER = " ${ENABLE_PROFILER}) SET ( PROTOBUF_INSTALL_BIN_DIR ${CMAKE_BINARY_DIR}/proto ) SET ( PROTOBUF_INSTALL_LIB_DIR ${CMAKE_BINARY_DIR}/proto ) -#if(ENABLE_QT5) -# TODO vs ENABLE_QT4? -#endif(ENABLE_QT5) - # Createt the configuration file # Add project specific cmake modules (find, etc) @@ -156,8 +155,18 @@ include_directories(${CMAKE_SOURCE_DIR}/include) #set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so") # enable C++11 -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall") -#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++11 -Wall") +include(CheckCXXCompilerFlag) +CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) +CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") +if(COMPILER_SUPPORTS_CXX11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +elseif(COMPILER_SUPPORTS_CXX0X) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") +else() + message(STATUS "No support for C++11 detected. Compilation will most likely fail on your compiler") +endif() SET(QT_MIN_VERSION "5.2.0") find_package(Qt5 COMPONENTS Core Gui Network REQUIRED) diff --git a/dependencies/LightberryHDUSBAPA1021.1/LightberryHDUSBAPA1021.1.ino b/assets/firmware/arduino/adalightapa102/LightberryHDUSBAPA1021.1.ino similarity index 100% rename from dependencies/LightberryHDUSBAPA1021.1/LightberryHDUSBAPA1021.1.ino rename to assets/firmware/arduino/adalightapa102/LightberryHDUSBAPA1021.1.ino diff --git a/assets/webconfig/index.html b/assets/webconfig/index.html index 555f9470..6274caa6 100644 --- a/assets/webconfig/index.html +++ b/assets/webconfig/index.html @@ -290,43 +290,45 @@
  • Dashboard
  • -
  • - Configuration - -
  • -
  • - Remote Control - -
  • -
  • - Support -
  • -
  • - System - -
  • - +
  • + Configuration + +
  • +
  • + Remote Control + +
  • +
  • + Support +
  • +
  • + System + +
  • @@ -449,6 +451,10 @@ $("#load_effects").on("click", function() { $("#page-wrapper").load("effects.html"); }); + + $("#load_components").on("click", function() { + $("#page-wrapper").load("remote_components.html"); + }); $("#load_huebridge").on("click", function() { $("#page-wrapper").load("huebridge.html"); diff --git a/assets/webconfig/lang/de.json b/assets/webconfig/lang/de.json index e115d379..f7286ecf 100644 --- a/assets/webconfig/lang/de.json +++ b/assets/webconfig/lang/de.json @@ -25,6 +25,7 @@ "main_menu_remotecontrol_token" : "Fernbedienung", "main_menu_colors_token" : "Farben", "main_menu_effects_token" : "Effekte", + "main_menu_component_token" : "Komponenten", "main_menu_support_token" : "Hilfe", "main_menu_update_token" : "Update", "main_menu_system_token" : "System", @@ -34,6 +35,7 @@ "remote_effects_intro" : "Die Effekt-Fernbedienung ermöglicht es dir Effekte zu starten für Demonstrations- oder Testzwecke. Vergessse nicht den Effekt wieder zu stoppen, wenn du fertig bist.", "remote_effects_label_effects":"Effekte", "remote_effects_label_stopeffect":"Stoppe Effekte", + "remote_components_intro" : "Die Komponenten-Fenbedienung ermöglicht es dir Komponenten von Hyperion zu starten und stoppen. Beachte: Dies ist nur temporär und geht nach einem Neustart verloren. Möchtest du dauerhaft Komponenten aktivieren/deaktivieren benutze die Konfigurationsseiten.", "hue_button_create_user_token":"Benutzer anlegen", "hue_press_link_modal":"Link Taste auf der Hue Bridge drücken und mit Button bestätigen.", "hue_press_link_modal_failure":"Bitte drücke die Link Taste auf deiner Hue Bridge.", diff --git a/assets/webconfig/remote_components.html b/assets/webconfig/remote_components.html new file mode 100644 index 00000000..f362e550 --- /dev/null +++ b/assets/webconfig/remote_components.html @@ -0,0 +1,42 @@ +
    +
    +
    +

    Effects

    +
    +

    The components remote enables you to disable and enable certain components of Hyperion during runtime. Keep in mind this persist just until the next reboot! To enable/disable components permament, use the configuration section.

    +
    +
    +
    +
    +
    +
    +
    + + \ No newline at end of file diff --git a/bin/.gitignore b/bin/.gitignore new file mode 100644 index 00000000..7a132693 --- /dev/null +++ b/bin/.gitignore @@ -0,0 +1 @@ +protoc diff --git a/config/.gitignore b/config/.gitignore new file mode 100644 index 00000000..6830205c --- /dev/null +++ b/config/.gitignore @@ -0,0 +1 @@ +/*.json diff --git a/dependencies/CMakeLists.txt b/dependencies/CMakeLists.txt index 07dc7af4..dce78257 100644 --- a/dependencies/CMakeLists.txt +++ b/dependencies/CMakeLists.txt @@ -1,4 +1,3 @@ -add_subdirectory(build/getoptPlusPlus) add_subdirectory(build/hidapi) add_subdirectory(build/jsoncpp) add_subdirectory(build/tinkerforge) diff --git a/dependencies/LightberryHDUSBAPA1021.1.zip b/dependencies/LightberryHDUSBAPA1021.1.zip deleted file mode 100644 index af1527ae..00000000 Binary files a/dependencies/LightberryHDUSBAPA1021.1.zip and /dev/null differ diff --git a/dependencies/build/getoptPlusPlus/CMakeLists.txt b/dependencies/build/getoptPlusPlus/CMakeLists.txt deleted file mode 100644 index e19880da..00000000 --- a/dependencies/build/getoptPlusPlus/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -project(getoptPlusPlus) - -include_directories( - ../../include/getoptPlusPlus) - -add_library(getoptPlusPlus - ../../include/getoptPlusPlus/getoptpp.h - ../../include/getoptPlusPlus/parameter.include.cc - getoptpp.cc) diff --git a/dependencies/build/getoptPlusPlus/COPYING b/dependencies/build/getoptPlusPlus/COPYING deleted file mode 100644 index 641905ac..00000000 --- a/dependencies/build/getoptPlusPlus/COPYING +++ /dev/null @@ -1,66 +0,0 @@ -GNU LESSER GENERAL PUBLIC LICENSE - -Version 3, 29 June 2007 - -Copyright © 2007 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - -This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. -0. Additional Definitions. - -As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. - -“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. - -An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. - -A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. - -The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. - -The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. -1. Exception to Section 3 of the GNU GPL. - -You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. -2. Conveying Modified Versions. - -If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: - - * a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or - * b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. - -3. Object Code Incorporating Material from Library Header Files. - -The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: - - * a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. - * b) Accompany the object code with a copy of the GNU GPL and this license document. - -4. Combined Works. - -You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: - - * a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. - * b) Accompany the Combined Work with a copy of the GNU GPL and this license document. - * c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. - * d) Do one of the following: - o 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. - o 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. - * e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) - -5. Combined Libraries. - -You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: - - * a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. - * b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. - -6. Revised Versions of the GNU Lesser General Public License. - -The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. - -If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. - diff --git a/dependencies/build/getoptPlusPlus/Makefile b/dependencies/build/getoptPlusPlus/Makefile deleted file mode 100644 index d6be12e2..00000000 --- a/dependencies/build/getoptPlusPlus/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -SOURCES=getoptpp.cc test.cc -HEADERS=getoptpp.h -OBJECTS=$(SOURCES:.cc=.o) -LDFLAGS= -CXXFLAGS=-O0 -ggdb -Wall -CFLAGS=$(CXXFLAGS) -CC=g++ -TARGET=getopt-test - -all: $(TARGET) -$(TARGET): $(OBJECTS) - $(CXX) $(LDFLAGS) -o $(TARGET) $(OBJECTS) -$(SOURCES): $(HEADERS) - -clean: - rm -rf $(TARGET) $(OBJECTS) *~ diff --git a/dependencies/build/getoptPlusPlus/README b/dependencies/build/getoptPlusPlus/README deleted file mode 100644 index 0ef16591..00000000 --- a/dependencies/build/getoptPlusPlus/README +++ /dev/null @@ -1,8 +0,0 @@ -A very small class library that replaces getopt() and -getopt_long()-functionality with a more C++-friendly approach. - -Additionally, it does not rely on UNIX-specific code. - -See test.cc for a sample application and COPYING for license information. - - diff --git a/dependencies/build/getoptPlusPlus/config.doxygen b/dependencies/build/getoptPlusPlus/config.doxygen deleted file mode 100644 index 9ac6e568..00000000 --- a/dependencies/build/getoptPlusPlus/config.doxygen +++ /dev/null @@ -1,1630 +0,0 @@ -# Doxyfile 1.7.1 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this -# tag. The format is ext=language, where ext is a file extension, and language -# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, -# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions -# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen to replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penality. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will rougly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols - -SYMBOL_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespace are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. -# This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. The create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. -# You can optionally specify a file name after the option, if omitted -# DoxygenLayout.xml will be used as the name of the layout file. - -LAYOUT_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = NO - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. -# If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. -# Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. -# The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. -# Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. -# Doxygen will adjust the colors in the stylesheet and background images -# according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. -# For instance the value 0 represents red, 60 is yellow, 120 is green, -# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. -# The allowed range is 0 to 359. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of -# the colors in the HTML output. For a value of 0 the output will use -# grayscales only. A value of 255 will produce the most vivid colors. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to -# the luminance component of the colors in the HTML output. Values below -# 100 gradually make the output lighter, whereas values above 100 make -# the output darker. The value divided by 100 is the actual gamma applied, -# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, -# and 100 does not change the gamma. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = YES - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated -# that can be used as input for Qt's qhelpgenerator to generate a -# Qt Compressed Help (.qch) of the generated HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to -# add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see -# -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's -# filter section matches. -# -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list. - -USE_INLINE_TREES = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open -# links to external symbols imported via tag files in a separate window. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are -# not supported properly for IE 6.0, but are supported on all modern browsers. -# Note that when changing this option you need to delete any form_*.png files -# in the HTML output before the changes have effect. - -FORMULA_TRANSPARENT = YES - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = YES - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a PHP enabled web server instead of at the web client -# using Javascript. Doxygen will generate the search PHP script and index -# file to put on the web server. The advantage of the server -# based approach is that it scales better to large projects and allows -# full text search. The disadvances is that it is more difficult to setup -# and does not have live searching capabilities. - -SERVER_BASED_SEARCH = NO - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. -# This is useful -# if you want to understand what is going on. -# On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = NO - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is -# allowed to run in parallel. When set to 0 (the default) doxygen will -# base this on the number of processors available in the system. You can set it -# explicitly to a value larger than 0 to get control over the balance -# between CPU load and processing speed. - -DOT_NUM_THREADS = 0 - -# By default doxygen will write a font called FreeSans.ttf to the output -# directory and reference it in all dot files that doxygen generates. This -# font does not include all possible unicode characters however, so when you need -# these (or just want a differently looking font) you can specify the font name -# using DOT_FONTNAME. You need need to make sure dot is able to find the font, -# which can be done by putting it in a standard location or by setting the -# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory -# containing the font. - -DOT_FONTNAME = FreeSans.ttf - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the output directory to look for the -# FreeSans.ttf font (which doxygen will put there itself). If you specify a -# different font using DOT_FONTNAME you can set the path where dot -# can find it using this tag. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = YES - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/dependencies/build/getoptPlusPlus/getoptpp.cc b/dependencies/build/getoptPlusPlus/getoptpp.cc deleted file mode 100644 index 37212901..00000000 --- a/dependencies/build/getoptPlusPlus/getoptpp.cc +++ /dev/null @@ -1,357 +0,0 @@ -/* (C) 2011 Viktor Lofgren - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "getoptpp.h" -#include -#include -#include -#include -#include - -using namespace std; - -namespace vlofgren { - -/* -* -* Class OptionsParser -* -* -*/ - - -OptionsParser::OptionsParser(const char* programDesc) : fprogramDesc(programDesc) {} -OptionsParser::~OptionsParser() {} - -ParameterSet& OptionsParser::getParameters() { - return parameters; -} - -void OptionsParser::parse(int argc, const char* argv[]) throw(runtime_error) -{ - argv0 = argv[0]; - - if(argc == 1) return; - - vector v(&argv[1], &argv[argc]); - - ParserState state(/* *this,*/ v); - - for(; !state.end(); state.advance()) { - - std::list::iterator i; - - for(i = parameters.parameters.begin(); - i != parameters.parameters.end(); i++) - { - int n = 0; - try - { - n = (*i)->receive(state); - } - catch(Parameter::ExpectedArgument &) - { - throw Parameter::ExpectedArgument(state.get() + ": expected an argument"); - } - catch(Parameter::UnexpectedArgument &) - { - throw Parameter::UnexpectedArgument(state.get() + ": did not expect an argument"); - } - catch(Switchable::SwitchingError &) - { - throw Parameter::ParameterRejected(state.get() + ": parameter already set"); - } - catch(Parameter::ParameterRejected & pr) { - std::string what = pr.what(); - if(what.length()) - { - throw Parameter::ParameterRejected(state.get() + ": " + what); - } - throw Parameter::ParameterRejected(state.get() + " (unspecified error)"); - } - - for (int j = 1; j < n; ++j) - { - state.advance(); - } - - if(n != 0) - { - break; - } - } - - if(i == parameters.parameters.end()) { - std::string file = state.get(); - if(file == "--") { - state.advance(); - break; - } - else if(file.at(0) == '-') - throw Parameter::ParameterRejected(string("Bad parameter: ") + file); - else files.push_back(state.get()); - } - } - - if(!state.end()) for(; !state.end(); state.advance()) { - files.push_back(state.get()); - } - -} - -void OptionsParser::usage() const { - cerr << fprogramDesc << endl; - cerr << "Build time: " << __DATE__ << " " << __TIME__ << endl << endl; - cerr << "Usage: " << programName() << " [OPTIONS]" << endl << endl; - - cerr << "Parameters: " << endl; - - int totalWidth = 80; - int usageWidth = 33; - - // read total width from the terminal - struct winsize w; - if (ioctl(0, TIOCGWINSZ, &w) == 0) - { - if (w.ws_col > totalWidth) - totalWidth = w.ws_col; - } - - std::list::const_iterator i; - for(i = parameters.parameters.begin(); - i != parameters.parameters.end(); i++) - { - cerr.width(usageWidth); - cerr << std::left << " " + (*i)->usageLine(); - - std::string description = (*i)->description(); - while (int(description.length()) > (totalWidth - usageWidth)) - { - size_t pos = description.find_last_of(' ', totalWidth - usageWidth); - cerr << description.substr(0, pos) << std::endl << std::string(usageWidth - 1, ' '); - description = description.substr(pos); - } - cerr << description << endl; - - } -} - -const vector& OptionsParser::getFiles() const { - return files; -} - -const string& OptionsParser::programName() const { - return argv0; -} - -/* -* Parameter set -* -* -*/ - -ParameterSet::ParameterSet(const ParameterSet& ps) { - throw new runtime_error("ParameterSet not copyable"); -} - -ParameterSet::~ParameterSet() { - for(std::list::iterator i = parameters.begin(); - i != parameters.end(); i++) - { - delete *i; - } - -} - -/* The typical use case for command line arguments makes linear searching completely -* acceptable here. -*/ - -Parameter& ParameterSet::operator[](char c) const { - for(std::list::const_iterator i = parameters.begin(); i!= parameters.end(); i++) { - if((*i)->shortOption() == c) return *(*i); - } - throw out_of_range("ParameterSet["+string(&c)+string("]")); -} - - -Parameter& ParameterSet::operator[](const string& param) const { - for(std::list::const_iterator i = parameters.begin(); i!= parameters.end(); i++) { - if((*i)->longOption() == param) return *(*i); - } - throw out_of_range("ParameterSet["+param+"]"); -} - - - -/* -* -* Class ParserState -* -* -*/ - - -ParserState::ParserState(/*OptionsParser &opts, */vector& args) : - /*opts(opts),*/ arguments(args), iterator(args.begin()) -{ - -} - -const string ParserState::peek() const { - vector::const_iterator next = iterator+1; - if(next != arguments.end()) return *next; - else return ""; - -} - -const string ParserState::get() const { - if(!end()) return *iterator; - else return ""; -} - -void ParserState::advance() { - iterator++; -} - -bool ParserState::end() const { - return iterator == arguments.end(); -} - - -/* -* -* Class Parameter -* -* -*/ - - - -Parameter::Parameter(char shortOption, const std::string & longOption, const std::string & description) : - fshortOption(shortOption), flongOption(longOption), fdescription(description) -{ - -} - -Parameter::~Parameter() {} - -const string& Parameter::description() const { return fdescription; } -const string& Parameter::longOption() const { return flongOption; } -bool Parameter::hasShortOption() const { return fshortOption != 0x0; } -char Parameter::shortOption() const { assert(hasShortOption()); return fshortOption; } - -/* -* -* Class Switchable -* -* -*/ - -bool Switchable::isSet() const { return fset; } -Switchable::~Switchable() {}; -Switchable::Switchable() : fset(false) {} - -void MultiSwitchable::set() throw (Switchable::SwitchingError) { fset = true; } -MultiSwitchable::~MultiSwitchable() {} - - -void UniquelySwitchable::set() throw (Switchable::SwitchingError) { - if(UniquelySwitchable::isSet()) throw Switchable::SwitchingError(); - fset = true; -} -UniquelySwitchable::~UniquelySwitchable() {} - - -PresettableUniquelySwitchable::~PresettableUniquelySwitchable() {} -bool PresettableUniquelySwitchable::isSet() const { - return UniquelySwitchable::isSet() || fpreset.isSet(); -} -void PresettableUniquelySwitchable::set() throw (Switchable::SwitchingError) -{ - UniquelySwitchable::set(); -} -void PresettableUniquelySwitchable::preset() { - fpreset.set(); -} - -/* -* -* PODParameter specializations -* -* -* -*/ - - -template<> -PODParameter::PODParameter(char shortOption, const char *longOption, - const char* description) : CommonParameter(shortOption, longOption, description) { -} - - -template<> -int PODParameter::validate(const string &s) throw(Parameter::ParameterRejected) -{ - // This is sadly necessary for strto*-functions to operate on - // const char*. The function doesn't write to the memory, though, - // so it's quite safe. - - char* cstr = const_cast(s.c_str()); - if(*cstr == '\0') throw ParameterRejected("No argument given"); - - long l = strtol(cstr, &cstr, 10); - if(*cstr != '\0') throw ParameterRejected("Expected int"); - - if(l > INT_MAX || l < INT_MIN) { - throw ParameterRejected("Expected int"); - } - - return l; -} - -template<> -long PODParameter::validate(const string &s) throw(Parameter::ParameterRejected) -{ - char* cstr = const_cast(s.c_str()); - if(*cstr == '\0') throw ParameterRejected("No argument given"); - - long l = strtol(cstr, &cstr, 10); - if(*cstr != '\0') throw ParameterRejected("Expected long"); - - return l; -} - -template<> -double PODParameter::validate(const string &s) throw(Parameter::ParameterRejected) -{ - char* cstr = const_cast(s.c_str()); - if(*cstr == '\0') throw ParameterRejected("No argument given"); - - double d = strtod(cstr, &cstr); - if(*cstr != '\0') throw ParameterRejected("Expected double"); - - return d; -} - -template<> -string PODParameter::validate(const string &s) throw(Parameter::ParameterRejected) -{ - return s; -} - - -} //namespace diff --git a/dependencies/build/getoptPlusPlus/test.cc b/dependencies/build/getoptPlusPlus/test.cc deleted file mode 100644 index adb34ff8..00000000 --- a/dependencies/build/getoptPlusPlus/test.cc +++ /dev/null @@ -1,196 +0,0 @@ - /* (C) 2011 Viktor Lofgren - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - - -#include "getoptpp.h" -#include -#include -#include -#include - -using namespace std; -using namespace vlofgren; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - -/* - * - * This is one way of adding new parameter types, - * inheriting existing types and adding new validation. - * - * In this case, StringParameter (which is a typedef of PODParameter gets - * a new validator that only accepts strings with only letters. - * - */ - - -class AlphabeticParameter : public StringParameter { -public: - AlphabeticParameter(char shortName, const char* longName, const char* description) : - StringParameter(shortName, longName, description) {} - virtual ~AlphabeticParameter() {} - - void receiveSwitch() throw(Parameter::ParameterRejected) { - throw Parameter::ParameterRejected(); - } - - - /* isalpha may be a macro */ - static bool isNotAlpha(char c) { return !isalpha(c); } - - virtual string validate(const string& arg) throw(Parameter::ParameterRejected) { - int nonalpha = count_if(arg.begin(), arg.end(), isNotAlpha); - - - if(nonalpha) throw Parameter::ParameterRejected("I only want numbers"); - else return arg; - } - -}; - -/* - * - * The other way is to specialize the PODParameter class - * - */ - -enum RockPaperScissor { ROCK, PAPER, SCISSOR } ; - -namespace vlofgren { - // needs to live in the vlofgren namespace for whatever reason - template<> enum RockPaperScissor - PODParameter::validate(const string &s) throw(Parameter::ParameterRejected) - { - if(s == "rock") - return ROCK; - else if(s == "paper") - return PAPER; - else if(s == "scissor") - return SCISSOR; - else { - throw ParameterRejected("Invalid argument"); - } - - } -} -typedef PODParameter RockPaperScissorParameter; - - -/* - * - * Dummy program - * - */ - - -int main(int argc, const char* argv[]) { - - // Create a parser - - OptionsParser optp("An example program (that also runs some tests)"); - ParameterSet& ps = optp.getParameters(); - - /* An alternative option is to simply extend the options parser and set all this up - * in the constructor. - */ - - ps.add('f', "foo", "Enable the foo system (no argument)"); - ps.add('b', "bar", "Enable the bar system (string argument)"); - ps.add >('z', "baz", "Enable the baz system (floating point argument"); - - PODParameter& i = ps.add >('i', "foobar", "Enable the foobar system (integer argument"); - i.setDefault(15); - - ps.add('a', "alpha", "Custom parameter that requires a string of letters"); - ps.add('r', "rps", "Takes the values rock, paper or scissor"); - ps.add('h', "help", "Display help screen"); - - - // Register the parameters with the parser - - try { - // Parse argv - optp.parse(argc, argv); - - // Test for the help flag - if(ps['h'].isSet()) { - optp.usage(); - return EXIT_SUCCESS; - } - - // Print out what values the parameters were given - - cout << "The following parameters were set:" << endl; - - cout << "foo: " << (ps['f'].isSet() ? "true" : "false") << endl; - cout << "bar: \"" << ps['b'].get() << "\""<< endl; - cout << "baz: "; - - if(ps['z'].isSet()) { - cout << ps['z'].get() << endl; - } else { - cout << "not set" << endl; - } - - /* You can also save the return value from ParserSet::add() if - * you feel the operator[].get() stuff is a bit much */ - cout << "foobar: "; - if(i.isSet()) { - cout << i.get() << endl; - } else { - cout << "not set" << endl; - } - cout << "alpha: "; - if(ps["alpha"].isSet()) { - cout << ps["alpha"].get() << endl; - } else { - cout << "not set" << endl; - } - - cout << "rps: "; - if(ps["rps"].isSet()) { - cout << ps["rps"].get() << endl; - } else { - cout << "not set" << endl; - } - - } catch(Parameter::ParameterRejected &p){ - // This will happen if the user has fed some malformed parameter to the program - cerr << p.what() << endl; - optp.usage(); - return EXIT_FAILURE; - } catch(runtime_error &e) { - // This will happen if you try to access a parameter that hasn't been set - cerr << e.what() << endl; - - return EXIT_FAILURE; - } - - - // List what non-parameter options were given (typically files) - cout << "The following file arguments were given:" << endl; - - vector files = optp.getFiles(); - for(vector::iterator i = files.begin(); i != files.end(); i++) { - cout << "\t" << *i << endl; - } - - - return EXIT_SUCCESS; -} - -#endif diff --git a/dependencies/getoptPlusPlus-master-20130810.zip b/dependencies/getoptPlusPlus-master-20130810.zip deleted file mode 100644 index fe332429..00000000 Binary files a/dependencies/getoptPlusPlus-master-20130810.zip and /dev/null differ diff --git a/dependencies/include/getoptPlusPlus/getoptpp.h b/dependencies/include/getoptPlusPlus/getoptpp.h deleted file mode 100644 index cfa9102f..00000000 --- a/dependencies/include/getoptPlusPlus/getoptpp.h +++ /dev/null @@ -1,398 +0,0 @@ - /* (C) 2011 Viktor Lofgren - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - /* - * Modifications: - * - * - Removed using namespace std from header - * - Changed Parameter container type from std::set to std::list to presume order - * - Changed arguments of Parameters to be a seperated arguments on the command line - * - Make the choice of receiving arguments or not in subclasses of CommonParameter - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef GETOPTPP_H -#define GETOPTPP_H - -namespace vlofgren { - -class Parameter; -class ParserState; - -class OptionsParser; - -/** Container for a set of parameters */ - -class ParameterSet { -public: - - /** Find a parameter by short option form */ - Parameter& operator[](char c) const; - - /** Find a parameter by long option form. */ - Parameter& operator[](const std::string &s) const; - - /** Factory method that adds a new parameter of - * type T to the set. - * - * This is just for convenience. It allows ParameterSet - * to manage the pointers, as well as (usually) making the - * code slightly easier to read. - * - * Do not try to add non-Parameter types lest you will invoke - * the wrath of gcc's template error messages. - * - * @returns The created parameter. The reference is valid - * as long as ParameterSet exists. - */ - template - T &add(char shortName, const char* longName, const char* description); - - ParameterSet() {} - ~ParameterSet(); -protected: - friend class OptionsParser; - std::list parameters; - -private: - ParameterSet(const ParameterSet& ps); -}; - -/** getopt()-style parser for command line arguments - * - * Matches each element in argv against given - * parameters, and collects non-parameter arguments - * (typically files) in a vector. - * - */ - -class OptionsParser { -public: - OptionsParser(const char *programDesc); - virtual ~OptionsParser(); - - ParameterSet& getParameters(); - - /** Parse command line arguments */ - void parse(int argc, const char* argv[]) throw(std::runtime_error); - - /** Generate a usage screen */ - void usage() const; - - /** Return the name of the program, as - * given by argv[0] - */ - const std::string& programName() const; - - /** Return a vector of each non-parameter */ - const std::vector& getFiles() const; -protected: - std::string argv0; - std::string fprogramDesc; - - ParameterSet parameters; - std::vector files; - - friend class ParserState; -}; - -/** - * Corresponds to the state of the parsing, basically just a wrapper - * for a const_iterator that handles nicer. - */ - -class ParserState { -public: - const std::string peek() const; - const std::string get() const; - void advance(); - bool end() const; -protected: - ParserState(/*OptionsParser &opts,*/ std::vector& args); -private: - friend class OptionsParser; - -// OptionsParser &opts; - const std::vector &arguments; - std::vector::const_iterator iterator; -}; - -/** - * - * Abstract base class of all parameters - * - */ - -class Parameter { -public: - - /** Generic exception thrown when a parameter is malformed - */ - class ParameterRejected : public std::runtime_error { - public: - ParameterRejected(const std::string& s) : std::runtime_error(s) {} - ParameterRejected() : runtime_error("") {} - }; - - /** Exception thrown when a parameter did not expect an argument */ - class UnexpectedArgument : public ParameterRejected { - public: - UnexpectedArgument(const std::string &s) : ParameterRejected(s) {} - UnexpectedArgument() {} - }; - - /** Exception thrown when a parameter expected an argument */ - class ExpectedArgument : public ParameterRejected { - public: - ExpectedArgument(const std::string &s) : ParameterRejected(s) {} - ExpectedArgument() {} - }; - - Parameter(char shortOption, const std::string & longOption, const std::string & description); - - virtual ~Parameter(); - - /** Test whether the parameter has been set */ - virtual bool isSet() const = 0; - - /** This parameter's line in OptionsParser::usage() */ - virtual std::string usageLine() const = 0; - - /** Description of the parameter (rightmost field in OptionsParser::usage()) */ - const std::string& description() const; - - /** The long name of this parameter (e.g. "--option"), without the dash. */ - const std::string& longOption() const; - - /** Check if this parameters has a short option */ - bool hasShortOption() const; - - /** The short name of this parameter (e.g. "-o"), without the dash. */ - char shortOption() const; - -protected: - - /** Receive a potential parameter from the parser (and determien if it's ours) - * - * The parser will pass each potential parameter through it's registered parameters' - * receive function. - * - * @throw ParameterRejected if the parameter belongs to us, but is malformed somehow. - * - * @param state Allows access to the current argument. This is a fairly powerful - * iterator that technically allows for more complex grammar than what is - * presently used. - */ - virtual int receive(ParserState& state) throw(ParameterRejected) = 0; - - friend class OptionsParser; - - char fshortOption; - const std::string flongOption; - const std::string fdescription; -private: - -}; - -/* - * - * Abstract base class of all parameters - * - */ - -class Switchable; - -/** Base class for most parameter implementations. - * - * It parses the argument in receive() and if it matches, - * calls receiveSwitch() or receiveArgument() which are implemented - * in child classes. - * - * The SwitchingBehavior mixin determines what happens if the argument - * is set multiple times. - */ - -template -class CommonParameter : public Parameter, protected SwitchingBehavior { -public: - - /** Test whether the parameter has been set */ - virtual bool isSet() const; - - CommonParameter(char shortOption, const char *longOption, - const char* description); - virtual ~CommonParameter(); - - virtual std::string usageLine() const; - -protected: - /** Parse the argument given by state, and dispatch either - * receiveSwitch() or receiveArgument() accordingly. - * - * @param state The current argument being parsed. - * @return The number of parameters taken from the input - */ - virtual int receive(ParserState& state) throw(ParameterRejected) = 0; -}; - -/** This class (used as a mixin) defines how a parameter - * behaves when switched on, specifically when switched on multiple times. - * - */ -class Switchable { -public: - class SwitchingError : public Parameter::ParameterRejected {}; - - /** Test whether the parameter has been set */ - virtual bool isSet() const; - - /** Set the parameter - * - */ - virtual void set() throw (SwitchingError) = 0; - - virtual ~Switchable(); - Switchable(); -protected: - bool fset; -}; - -/** Switching behavior that does not complain when set multiple times. */ -class MultiSwitchable : public Switchable { -public: - virtual ~MultiSwitchable(); - virtual void set() throw(SwitchingError); - -}; - -/** Switching behavior that allows switching only once. - * - * This is typically what you want if your parameter has an argument. - * - */ -class UniquelySwitchable : public Switchable { -public: - - virtual ~UniquelySwitchable(); - - /** Set the parameter - * - * @throw SwitchingError Thrown if the parameter is already set. - */ - virtual void set() throw (SwitchingError); -}; - -/** Switching behavior that makes possible allows presettable parameters, - * that is, it can either be set by the program, or by a command line argument, - * and the command-line part is UniquelySwitchable, but the program part - * is MultiSwitchable (and is set by preset()) - * - * - */ -class PresettableUniquelySwitchable : public UniquelySwitchable { -public: - - /** Test whether the parameter has been set OR preset */ - virtual bool isSet() const; - - /** Call if the parameter has been set. - * - * @throw SwitchingError thrown if the parameter is already set - * (doesn't care if it's been pre-set) - */ - virtual void set() throw (Switchable::SwitchingError); - - /** Call if the parameter has been preset */ - virtual void preset(); - - virtual ~PresettableUniquelySwitchable(); -private: - MultiSwitchable fpreset; -}; - -/* Parameter that does not take an argument, and throws an exception - * if an argument is given */ - -template -class SwitchParameter : public CommonParameter { -public: - SwitchParameter(char shortOption, const char *longOption, - const char* description); - virtual ~SwitchParameter(); - -protected: - virtual int receive(ParserState& state) throw(Parameter::ParameterRejected); -}; - -/** Plain-Old-Data parameter. Performs input validation. - * - * Currently only supports int, long and double, but extending - * it to other types (even non-POD) is as easy as partial template specialization. - * - * Specifically, you need to specialize validate(). - */ - -template -class PODParameter : public CommonParameter { -public: - PODParameter(char shortOption, const char *longOption, - const char* description); - virtual ~PODParameter(); - - /* Retreive the value of the argument. Throws an exception if - * the value hasn't been set (test with isSet()) - */ - T getValue() const; - - /** Type-casting operator, for convenience. */ - operator T() const; - - /** Set a default value for this parameter */ - virtual void setDefault(T value); - - std::string usageLine() const; -protected: - virtual int receive(ParserState& state) throw(Parameter::ParameterRejected); - - /** Validation function for the data type. - * - * @throw ParameterRejected if the argument does not conform to this data type. - * @return the value corresponding to the argument. - */ - virtual T validate(const std::string& s) throw (Parameter::ParameterRejected); - - T value; -}; - - -typedef PODParameter IntParameter; -typedef PODParameter LongParameter; -typedef PODParameter DoubleParameter; -typedef PODParameter StringParameter; - -#include "parameter.include.cc" - -} //namespace - -#endif diff --git a/dependencies/include/getoptPlusPlus/parameter.include.cc b/dependencies/include/getoptPlusPlus/parameter.include.cc deleted file mode 100644 index a1daf516..00000000 --- a/dependencies/include/getoptPlusPlus/parameter.include.cc +++ /dev/null @@ -1,177 +0,0 @@ - /* (C) 2011 Viktor Lofgren - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -#ifdef GETOPTPP_H - - -/* This file contains template voodoo, and due to the unique way GCC handles - * templates, it needs to be included as a header (and it -is-). Do not attempt to - * compile this file directly! - */ - -template -T &ParameterSet::add(char shortName, const char* longName, const char* description) { - T* p = new T(shortName, longName, description); - parameters.push_back(p); - return *p; -} - -/* - * - * Class CommonParameter implementation - * - * - */ - -template -CommonParameter::~CommonParameter() {} - -template -CommonParameter::CommonParameter(char shortOption, const char *longOption, - const char* description) : Parameter(shortOption, longOption, description) {} - -template -bool CommonParameter::isSet() const{ - return SwitchingBehavior::isSet(); -} - -template -std::string CommonParameter::usageLine() const { - std::stringstream strstr; - - if (hasShortOption()) - { - strstr << "-" << shortOption() << ", "; - } - else - { - strstr << " "; - } - strstr.width(20); - strstr << std::left << "--" + longOption(); - - return strstr.str(); -} - -/* - * - * Class SwitchParameter - * - * - */ - -template -SwitchParameter::SwitchParameter(char shortOption, const char *longOption, - const char* description) : CommonParameter(shortOption, longOption, description) {} -template -SwitchParameter::~SwitchParameter() {} - -template -int SwitchParameter::receive(ParserState& state) throw(Parameter::ParameterRejected) { - - const std::string arg = state.get(); - - if(arg.at(0) != '-') return false; - - if ((arg.at(1) == '-' && arg.substr(2) == this->longOption()) || - (this->hasShortOption() && arg.at(1) == this->shortOption() && arg.length() == 2)) - { - this->set(); - return 1; - } - - return 0; -} - -/* - * PODParameter stuff - * - */ - - -template -PODParameter::PODParameter(char shortOption, const char *longOption, - const char* description) : CommonParameter(shortOption, longOption, description) {} - -template -PODParameter::~PODParameter() {} - -template -PODParameter::operator T() const { return getValue(); } - -template -void PODParameter::setDefault(T value) { - PresettableUniquelySwitchable::preset(); - this->value = value; -} - -template -T PODParameter::getValue() const { - if(!this->isSet()) { - throw std::runtime_error( - std::string("Attempting to retreive the argument of parameter") + this->longOption() + " but it hasn't been set!"); - } - return value; - -} - -template -std::string PODParameter::usageLine() const { - std::stringstream strstr; - - if (this->hasShortOption()) - { - strstr << "-" << this->shortOption() << ", "; - } - else - { - strstr << " "; - } - strstr.width(20); - strstr << std::left << "--" + this->longOption() + " "; - - return strstr.str(); -} - -template -int PODParameter::receive(ParserState& state) throw(Parameter::ParameterRejected) { - - const std::string arg = state.get(); - - if(arg.at(0) != '-') return false; - - if((arg.at(1) == '-' && arg.substr(2) == this->longOption()) || - (this->hasShortOption() && arg.at(1) == this->shortOption() && arg.length() == 2)) - { - // retrieve the argument - std::string arg1 = state.peek(); - if (arg1.length() == 0) - { - throw Parameter::ExpectedArgument(arg + ": expected an argument"); - return 1; - } - - this->set(); - value = this->validate(arg1); - - return 2; - } - - return 0; -} - -#endif diff --git a/dependencies/wjwwood-serial-master-20131105.zip b/dependencies/wjwwood-serial-master-20131105.zip deleted file mode 100644 index 098d7f9c..00000000 Binary files a/dependencies/wjwwood-serial-master-20131105.zip and /dev/null differ diff --git a/doc/.gitignore b/doc/.gitignore new file mode 100644 index 00000000..0149c29b --- /dev/null +++ b/doc/.gitignore @@ -0,0 +1,3 @@ +/hyperion-build-doc.sh +/hyperion.doxygen +/html/ diff --git a/include/commandline/BooleanOption.h b/include/commandline/BooleanOption.h new file mode 100644 index 00000000..72e35eee --- /dev/null +++ b/include/commandline/BooleanOption.h @@ -0,0 +1,35 @@ +#ifndef HYPERION_BOOLEANOPTION_H +#define HYPERION_BOOLEANOPTION_H + + +#include +#include "Option.h" + +namespace commandline +{ + +class BooleanOption: public Option +{ +public: + BooleanOption(const QString &name, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString() + ) + : Option(name, description, QString(), QString()) + {} + BooleanOption(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString() + ) + : Option(names, description, QString(), QString()) + {} + BooleanOption(const QCommandLineOption &other) + : Option(other) + {} +}; + +} + +#endif //HYPERION_BOOLEANOPTION_H diff --git a/include/commandline/ColorOption.h b/include/commandline/ColorOption.h new file mode 100644 index 00000000..1814143c --- /dev/null +++ b/include/commandline/ColorOption.h @@ -0,0 +1,41 @@ +#ifndef HYPERION_COLOROPTION_H +#define HYPERION_COLOROPTION_H + +#include "Option.h" +#include +#include + +namespace commandline +{ + +class ColorOption: public Option +{ +protected: + QColor _color; +public: + ColorOption(const QString &name, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString() + ) + : Option(name, description, valueName, defaultValue) + {} + ColorOption(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString() + ) + : Option(names, description, valueName, defaultValue) + {} + ColorOption(const QCommandLineOption &other) + : Option(other) + {} + + virtual bool validate(Parser & parser, QString & value) override; + QColor getColor(Parser &parser) + { return _color; } +}; + +} + +#endif //HYPERION_COLOROPTION_H diff --git a/include/commandline/ColorsOption.h b/include/commandline/ColorsOption.h new file mode 100644 index 00000000..eafe1b07 --- /dev/null +++ b/include/commandline/ColorsOption.h @@ -0,0 +1,41 @@ +#ifndef HYPERION_COLORSOPTION_H +#define HYPERION_COLORSOPTION_H + +#include "Option.h" +#include +#include + +namespace commandline +{ + +class ColorsOption: public Option +{ +protected: + QList _colors; +public: + ColorsOption(const QString &name, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString() + ) + : Option(name, description, valueName, defaultValue) + {} + ColorsOption(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString() + ) + : Option(names, description, valueName, defaultValue) + {} + ColorsOption(const QCommandLineOption &other) + : Option(other) + {} + + virtual bool validate(Parser & parser, QString & value) override; + QList &getColors(Parser &parser) + { return _colors; } +}; + +} + +#endif //HYPERION_COLOROPTION_H diff --git a/include/commandline/DoubleOption.h b/include/commandline/DoubleOption.h new file mode 100644 index 00000000..9eb3f924 --- /dev/null +++ b/include/commandline/DoubleOption.h @@ -0,0 +1,40 @@ +#ifndef HYPERION_DOUBLECOMMANDLINEOPTION_H +#define HYPERION_DOUBLECOMMANDLINEOPTION_H + +#include +#include "ValidatorOption.h" + +namespace commandline +{ + +class DoubleOption: public ValidatorOption +{ +protected: + double _double; +public: + DoubleOption(const QString &name, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + double minimum = -INFINITY, double maximum = INFINITY, int decimals = 1000) + : ValidatorOption(name, description, valueName, defaultValue) + { setValidator(new QDoubleValidator(minimum, maximum, decimals)); } + DoubleOption(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + double minimum = -INFINITY, double maximum = INFINITY, int decimals = 1000) + : ValidatorOption(names, description, valueName, defaultValue) + { setValidator(new QDoubleValidator(minimum, maximum, decimals)); } + DoubleOption(const QCommandLineOption &other, + double minimum = -INFINITY, double maximum = INFINITY, int decimals = 1000) + : ValidatorOption(other) + { setValidator(new QDoubleValidator(minimum, maximum, decimals)); } + + double getDouble(Parser &parser, bool *ok = 0); + double *getDoublePtr(Parser &parser, bool *ok = 0); +}; + +} + +#endif //HYPERION_DOUBLECOMMANDLINEOPTION_H diff --git a/include/commandline/ImageOption.h b/include/commandline/ImageOption.h new file mode 100644 index 00000000..535d501e --- /dev/null +++ b/include/commandline/ImageOption.h @@ -0,0 +1,41 @@ +#ifndef HYPERION_IMAGEOPTION_H +#define HYPERION_IMAGEOPTION_H + +#include "Option.h" +#include +#include + +namespace commandline +{ + +class ImageOption: public Option +{ +protected: + QImage _image; +public: + ImageOption(const QString &name, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString() + ) + : Option(name, description, valueName, defaultValue) + {} + ImageOption(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString() + ) + : Option(names, description, valueName, defaultValue) + {} + ImageOption(const QCommandLineOption &other) + : Option(other) + {} + + virtual bool validate(Parser & parser, QString & value) override; + QImage &getImage(Parser &parser) + { return _image; } +}; + +} + +#endif //HYPERION_IMAGEOPTION_H diff --git a/include/commandline/IntOption.h b/include/commandline/IntOption.h new file mode 100644 index 00000000..2f59fae3 --- /dev/null +++ b/include/commandline/IntOption.h @@ -0,0 +1,41 @@ +#ifndef HYPERION_INTCOMMANDLINEOPTION_H +#define HYPERION_INTCOMMANDLINEOPTION_H + +#include +#include +#include "ValidatorOption.h" + +namespace commandline +{ + +class IntOption: public ValidatorOption +{ +protected: + int _int; +public: + IntOption(const QString &name, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + int minimum = std::numeric_limits::min(), int maximum = std::numeric_limits::max()) + : ValidatorOption(name, description, valueName, defaultValue) + { setValidator(new QIntValidator(minimum, maximum)); } + IntOption(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + int minimum = std::numeric_limits::min(), int maximum = std::numeric_limits::max()) + : ValidatorOption(names, description, valueName, defaultValue) + { setValidator(new QIntValidator(minimum, maximum)); } + IntOption(const QCommandLineOption &other, + int minimum = std::numeric_limits::min(), int maximum = std::numeric_limits::max()) + : ValidatorOption(other) + { setValidator(new QIntValidator(minimum, maximum)); } + + int getInt(Parser &parser, bool *ok = 0, int base = 10); + int *getIntPtr(Parser &parser, bool *ok = 0, int base = 10); +}; + +} + +#endif //HYPERION_INTCOMMANDLINEOPTION_H diff --git a/include/commandline/Option.h b/include/commandline/Option.h new file mode 100644 index 00000000..d58bc4fe --- /dev/null +++ b/include/commandline/Option.h @@ -0,0 +1,49 @@ +#ifndef HYPERION_OPTION_H +#define HYPERION_OPTION_H + +#include +#include + +namespace commandline +{ + +class Parser; + +/* Note, this class and all it's derivatives store the validated results for caching. This means that unlike the + * regular QCommandLineOption it is _not_ idempotent! */ +class Option: public QCommandLineOption +{ +protected: + QString _error; +public: + Option(const QString &name, + const QString &description = QString(), + const QString &valueName = QString::null, + const QString &defaultValue = QString() + ) + : QCommandLineOption(name, description, valueName, defaultValue) + {} + Option(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString::null, + const QString &defaultValue = QString() + ) + : QCommandLineOption(names, description, valueName, defaultValue) + {} + Option(const QCommandLineOption &other) + : QCommandLineOption(other) + {} + + virtual bool validate(Parser &parser, QString &value); + QString name() + { return this->names().last();} + QString getError() + { return this->_error; } + QString value(Parser &parser); + std::string getStdString(Parser &parser); + std::wstring getStdWString(Parser &parser); +}; + +} + +#endif //HYPERION_OPTION_H diff --git a/include/commandline/Parser.h b/include/commandline/Parser.h new file mode 100644 index 00000000..a9876e87 --- /dev/null +++ b/include/commandline/Parser.h @@ -0,0 +1,120 @@ +#ifndef HYPERION_COMMANDLINEPARSER_H +#define HYPERION_COMMANDLINEPARSER_H + +#include +#include +#include "ColorOption.h" +#include "ColorsOption.h" +#include "DoubleOption.h" +#include "ImageOption.h" +#include "IntOption.h" +#include "Option.h" +#include "RegularExpressionOption.h" +#include "SwitchOption.h" +#include "ValidatorOption.h" +#include "BooleanOption.h" + +namespace commandline +{ + +class Parser : public QObject +{ +protected: + QHash _options; + QString _errorText; + /* No public inheritance because we need to modify a few methods */ + QCommandLineParser _parser; + + QStringList _getNames(const char shortOption, const QString longOption); + QString _getDescription(const QString description, const QString default_=QString()); + +public: + bool parse(const QStringList &arguments); + void process(const QStringList &arguments); + void process(const QCoreApplication &app); + QString errorText() const; + + template + OptionT &add( + const char shortOption, + const QString longOption, + const QString description, + const QString default_, + Args ... args) + { + OptionT * option = new OptionT( + _getNames(shortOption, longOption), + _getDescription(description, default_), + longOption, + default_, + args...); + addOption(option); + return *option; + } + + /* gcc does not support default arguments for variadic templates which + * makes this method necessary */ + template + OptionT &add( + const char shortOption, + const QString longOption, + const QString description, + const QString default_ = QString()) + { + OptionT * option = new OptionT( + _getNames(shortOption, longOption), + _getDescription(description, default_), + longOption, + default_); + addOption(option); + return *option; + } + + Parser(QString description=QString()) + {if(description.size())setApplicationDescription(description);}; + QCommandLineOption addHelpOption() + { return _parser.addHelpOption(); } + bool addOption(Option &option); + bool addOption(Option *option); + void addPositionalArgument(const QString &name, const QString &description, const QString &syntax = QString()) + { _parser.addPositionalArgument(name, description, syntax); } + QCommandLineOption addVersionOption() + { return _parser.addVersionOption(); } + QString applicationDescription() const + { return _parser.applicationDescription(); } + void clearPositionalArguments() + { _parser.clearPositionalArguments(); } + QString helpText() const + { return _parser.helpText(); } + bool isSet(const QString &name) const + { return _parser.isSet(name); } + bool isSet(const Option &option) const + { return _parser.isSet(option); } + bool isSet(const Option *option) const + { return _parser.isSet(*option); } + QStringList optionNames() const + { return _parser.optionNames(); } + QStringList positionalArguments() const + { return _parser.positionalArguments(); } + void setApplicationDescription(const QString &description) + { _parser.setApplicationDescription(description); } + void setSingleDashWordOptionMode(QCommandLineParser::SingleDashWordOptionMode singleDashWordOptionMode) + { _parser.setSingleDashWordOptionMode(singleDashWordOptionMode); } + void showHelp(int exitCode = 0) + { _parser.showHelp(exitCode); } + QStringList unknownOptionNames() const + { return _parser.unknownOptionNames(); } + QString value(const QString &optionName) const + { return _parser.value(optionName); } + QString value(const Option &option) const + { return _parser.value(option); } + QStringList values(const QString &optionName) const + { return _parser.values(optionName); } + QStringList values(const Option &option) const + { return _parser.values(option); } + +}; + +} + +#endif //HYPERION_COMMANDLINEPARSER_H diff --git a/include/commandline/RegularExpressionOption.h b/include/commandline/RegularExpressionOption.h new file mode 100644 index 00000000..36094754 --- /dev/null +++ b/include/commandline/RegularExpressionOption.h @@ -0,0 +1,71 @@ +#ifndef HYPERION_REGULAREXPRESSIONCOMMANDLINEOPTION_H +#define HYPERION_REGULAREXPRESSIONCOMMANDLINEOPTION_H + +#include +#include +#include "ValidatorOption.h" + +namespace commandline +{ + +class RegularExpressionOption: public ValidatorOption +{ +public: + RegularExpressionOption(const QString &name, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString()) + : ValidatorOption(name, description, valueName, defaultValue) + {} + RegularExpressionOption(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString()) + : ValidatorOption(names, description, valueName, defaultValue) + {} + RegularExpressionOption(const QCommandLineOption &other) + : ValidatorOption(other) + {} + + RegularExpressionOption(const QString &name, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + const QRegularExpression &expression = QRegularExpression()) + : ValidatorOption(name, description, valueName, defaultValue) + { setValidator(new QRegularExpressionValidator(expression)); } + RegularExpressionOption(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + const QRegularExpression &expression = QRegularExpression()) + : ValidatorOption(names, description, valueName, defaultValue) + { setValidator(new QRegularExpressionValidator(expression)); } + RegularExpressionOption(const QCommandLineOption &other, + const QRegularExpression &expression = QRegularExpression()) + : ValidatorOption(other) + { setValidator(new QRegularExpressionValidator(expression)); } + + RegularExpressionOption(const QString &name, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + const QString &expression = QString()) + : ValidatorOption(name, description, valueName, defaultValue) + { setValidator(new QRegularExpressionValidator(QRegularExpression(expression))); } + RegularExpressionOption(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + const QString &expression = QString()) + : ValidatorOption(names, description, valueName, defaultValue) + { setValidator(new QRegularExpressionValidator(QRegularExpression(expression))); } + RegularExpressionOption(const QCommandLineOption &other, + const QString &expression = QString()) + : ValidatorOption(other) + { setValidator(new QRegularExpressionValidator(QRegularExpression(expression))); } +}; + +} + +#endif //HYPERION_REGULAREXPRESSIONCOMMANDLINEOPTION_H diff --git a/include/commandline/SwitchOption.h b/include/commandline/SwitchOption.h new file mode 100644 index 00000000..06763661 --- /dev/null +++ b/include/commandline/SwitchOption.h @@ -0,0 +1,45 @@ +#ifndef HYPERION_SWITCHCOMMANDLINEOPTION_H +#define HYPERION_SWITCHCOMMANDLINEOPTION_H + +#include +#include "Option.h" + +namespace commandline +{ + +template +class SwitchOption: public Option +{ +protected: + QMap _switches; +public: + SwitchOption(const QString &name, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + const QMap &switches=QMap()) + : Option(name, description, valueName, defaultValue), _switches(switches) + {} + SwitchOption(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + const QMap &switches=QMap()) + : Option(names, description, valueName, defaultValue), _switches(switches) + {} + SwitchOption(const QCommandLineOption &other, const QMap &switches) + : Option(other), _switches(switches) + {} + + const QMap &getSwitches() const{return _switches;}; + virtual bool validate(Parser &parser, QString &switch_) override{return hasSwitch(switch_);} + bool hasSwitch(const QString &switch_){return _switches.contains(switch_.toLower());} + void setSwitches(const QMap &_switches){this->_switches = _switches;} + void addSwitch(const QString &switch_, T value=T()){_switches[switch_.toLower()] = value;} + void removeSwitch(const QString &switch_){_switches.remove(switch_.toLower());} + T & switchValue(Parser & parser){return _switches[value(parser).toLower()];} +}; + +} + +#endif //HYPERION_SWITCHCOMMANDLINEOPTION_H diff --git a/include/commandline/ValidatorOption.h b/include/commandline/ValidatorOption.h new file mode 100644 index 00000000..c7349ccf --- /dev/null +++ b/include/commandline/ValidatorOption.h @@ -0,0 +1,42 @@ +#ifndef HYPERION_COMMANDLINEOPTION_H +#define HYPERION_COMMANDLINEOPTION_H + +#include +#include +#include + +namespace commandline +{ + +class ValidatorOption: public Option +{ +protected: + const QValidator *validator; + virtual void setValidator(const QValidator *validator); +public: + ValidatorOption(const QString &name, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + const QValidator *validator = nullptr) + : Option(name, description, valueName, defaultValue), validator(validator) + {} + ValidatorOption(const QStringList &names, + const QString &description = QString(), + const QString &valueName = QString(), + const QString &defaultValue = QString(), + const QValidator *validator = nullptr) + : Option(names, description, valueName, defaultValue), validator(validator) + {} + ValidatorOption(const QCommandLineOption &other, + const QValidator *validator = nullptr) + : Option(other), validator(validator) + {} + + virtual const QValidator *getValidator() const; + virtual bool validate(Parser & parser, QString &value) override; +}; + +} + +#endif //HYPERION_COMMANDLINEOPTION_H diff --git a/include/protoserver/ProtoConnectionWrapper.h b/include/protoserver/ProtoConnectionWrapper.h index 2f423291..1f4e1bb5 100644 --- a/include/protoserver/ProtoConnectionWrapper.h +++ b/include/protoserver/ProtoConnectionWrapper.h @@ -16,7 +16,7 @@ class ProtoConnectionWrapper : public QObject Q_OBJECT public: - ProtoConnectionWrapper(const std::string & address, int priority, int duration_ms, bool skipProtoReply); + ProtoConnectionWrapper(const QString &address, int priority, int duration_ms, bool skipProtoReply); virtual ~ProtoConnectionWrapper(); signals: diff --git a/libsrc/CMakeLists.txt b/libsrc/CMakeLists.txt index a40681f6..f6b0d9a7 100644 --- a/libsrc/CMakeLists.txt +++ b/libsrc/CMakeLists.txt @@ -4,6 +4,7 @@ SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include) SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc) add_subdirectory(hyperion) +add_subdirectory(commandline) add_subdirectory(blackborder) add_subdirectory(jsonserver) add_subdirectory(protoserver) diff --git a/libsrc/commandline/BooleanOption.cpp b/libsrc/commandline/BooleanOption.cpp new file mode 100644 index 00000000..d92c5192 --- /dev/null +++ b/libsrc/commandline/BooleanOption.cpp @@ -0,0 +1,3 @@ +#include "commandline/BooleanOption.h" + +using namespace commandline; diff --git a/libsrc/commandline/CMakeLists.txt b/libsrc/commandline/CMakeLists.txt new file mode 100644 index 00000000..51fa4161 --- /dev/null +++ b/libsrc/commandline/CMakeLists.txt @@ -0,0 +1,42 @@ +# Define the current source locations +set(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/commandline) +set(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/commandline) + +set(Parser_HEADERS + ${CURRENT_HEADER_DIR}/ColorOption.h + ${CURRENT_HEADER_DIR}/ColorsOption.h + ${CURRENT_HEADER_DIR}/DoubleOption.h + ${CURRENT_HEADER_DIR}/ImageOption.h + ${CURRENT_HEADER_DIR}/IntOption.h + ${CURRENT_HEADER_DIR}/Option.h + ${CURRENT_HEADER_DIR}/Parser.h + ${CURRENT_HEADER_DIR}/RegularExpressionOption.h + ${CURRENT_HEADER_DIR}/SwitchOption.h + ${CURRENT_HEADER_DIR}/ValidatorOption.h + ${CURRENT_HEADER_DIR}/BooleanOption.h +) + +set(Parser_SOURCES + ${CURRENT_SOURCE_DIR}/ColorOption.cpp + ${CURRENT_SOURCE_DIR}/ColorsOption.cpp + ${CURRENT_SOURCE_DIR}/DoubleOption.cpp + ${CURRENT_SOURCE_DIR}/ImageOption.cpp + ${CURRENT_SOURCE_DIR}/IntOption.cpp + ${CURRENT_SOURCE_DIR}/Option.cpp + ${CURRENT_SOURCE_DIR}/Parser.cpp + ${CURRENT_SOURCE_DIR}/RegularExpressionOption.cpp + ${CURRENT_SOURCE_DIR}/SwitchOption.cpp + ${CURRENT_SOURCE_DIR}/ValidatorOption.cpp + ${CURRENT_SOURCE_DIR}/BooleanOption.cpp +) + +add_library(commandline + ${Parser_HEADERS} + ${Parser_SOURCES} +) + +qt5_use_modules(commandline Gui) + +target_link_libraries(commandline + hyperion +) diff --git a/libsrc/commandline/ColorOption.cpp b/libsrc/commandline/ColorOption.cpp new file mode 100644 index 00000000..32863fad --- /dev/null +++ b/libsrc/commandline/ColorOption.cpp @@ -0,0 +1,30 @@ +#include +#include "commandline/ColorOption.h" +#include "commandline/Parser.h" + +using namespace commandline; + +bool ColorOption::validate(Parser & parser, QString & value) +{ + // Check if we can create the color by name + _color = QColor(value); + if (_color.isValid()) { + return true; + } + + // check if we can create the color by hex RRGGBB getColors + _color = QColor(QString("#%1").arg(value)); + if (_color.isValid()) { + return true; + } + + if(!parser.isSet(*this)){ + // Return true if no value is available + return true; + } + + QStringList error; + _error = QString("Invalid color. A color is specified by a six lettered RRGGBB hex getColors or one of the following names:\n\t- %1").arg(QColor::colorNames().join("\n\t- ")); + + return false; +} diff --git a/libsrc/commandline/ColorsOption.cpp b/libsrc/commandline/ColorsOption.cpp new file mode 100644 index 00000000..b7f81bd7 --- /dev/null +++ b/libsrc/commandline/ColorsOption.cpp @@ -0,0 +1,37 @@ +#include +#include "commandline/ColorsOption.h" +#include "commandline/Parser.h" + +using namespace commandline; + +bool ColorsOption::validate(Parser & parser, QString & value) +{ + // Clear any old results + _colors.clear(); + + // Check if we can create the color by name + QColor color(value); + if (color.isValid()) { + _colors.push_back(color); + return true; + } + + // check if we can create the color by hex RRGGBB getColors + QRegularExpression hexRe("^([0-9A-F]{6})+$", QRegularExpression::CaseInsensitiveOption); + QRegularExpressionMatch match = hexRe.match(value); + if(match.hasMatch()) { + Q_FOREACH(const QString m, match.capturedTexts()){ + _colors.push_back(QColor(QString("#%1").arg(m))); + } + return true; + } + + if(!parser.isSet(*this)){ + // Return true if no value is available + return true; + } + + _error = QString("Invalid color. A color is specified by a six lettered RRGGBB hex getColors or one of the following names:\n\t- %1").arg(QColor::colorNames().join("\n\t- ")); + + return false; +} diff --git a/libsrc/commandline/DoubleOption.cpp b/libsrc/commandline/DoubleOption.cpp new file mode 100644 index 00000000..532df096 --- /dev/null +++ b/libsrc/commandline/DoubleOption.cpp @@ -0,0 +1,20 @@ +#include "commandline/DoubleOption.h" +#include "commandline/Parser.h" + +using namespace commandline; + +double DoubleOption::getDouble(Parser &parser, bool *ok) +{ + _double = value(parser).toDouble(ok); + return _double; +} + +double *DoubleOption::getDoublePtr(Parser &parser, bool *ok) +{ + if (parser.isSet(this)) { + getDouble(parser, ok); + return &_double; + } else { + return nullptr; + } +} diff --git a/libsrc/commandline/ImageOption.cpp b/libsrc/commandline/ImageOption.cpp new file mode 100644 index 00000000..77933176 --- /dev/null +++ b/libsrc/commandline/ImageOption.cpp @@ -0,0 +1,18 @@ +#include "commandline/ImageOption.h" + +using namespace commandline; + +bool ImageOption::validate(Parser & parser, QString & value) +{ + if(value.size()){ + _image = QImage(value); + + if (_image.isNull()) + { + _error = QString("File %1 could not be opened as image").arg(value); + return false; + } + } + + return true; +} diff --git a/libsrc/commandline/IntOption.cpp b/libsrc/commandline/IntOption.cpp new file mode 100644 index 00000000..e034fb0c --- /dev/null +++ b/libsrc/commandline/IntOption.cpp @@ -0,0 +1,20 @@ +#include "commandline/IntOption.h" +#include "commandline/Parser.h" + +using namespace commandline; + +int IntOption::getInt(Parser &parser, bool *ok, int base) +{ + _int = value(parser).toInt(ok, base); + return _int; +} + +int *IntOption::getIntPtr(Parser &parser, bool *ok, int base) +{ + if (parser.isSet(this)) { + getInt(parser, ok, base); + return &_int; + } else { + return nullptr; + } +} diff --git a/libsrc/commandline/Option.cpp b/libsrc/commandline/Option.cpp new file mode 100644 index 00000000..d8e733e8 --- /dev/null +++ b/libsrc/commandline/Option.cpp @@ -0,0 +1,26 @@ +#include "commandline/Option.h" +#include "commandline/Parser.h" + +using namespace commandline; + +bool Option::validate(Parser & parser, QString &value) +{ + /* By default everything is accepted */ + return true; +} + +QString Option::value(Parser &parser) +{ + return parser.value(*this); +} + +std::string Option::getStdString(Parser &parser) +{ + return value(parser).toStdString(); +} + +std::wstring Option::getStdWString(Parser &parser) +{ + return value(parser).toStdWString(); +} + diff --git a/libsrc/commandline/Parser.cpp b/libsrc/commandline/Parser.cpp new file mode 100644 index 00000000..c09c3449 --- /dev/null +++ b/libsrc/commandline/Parser.cpp @@ -0,0 +1,90 @@ +#include +#include +#include "commandline/Parser.h" + +using namespace commandline; + +bool Parser::parse(const QStringList &arguments) +{ + if (!_parser.parse(arguments)) { + return false; + } + + Q_FOREACH(Option * option, _options) { + QString value = this->value(*option); + if (!option->validate(*this, value)) { + const QString error = option->getError(); + if (error.size()) { + _errorText = tr("%1 is not a valid option for %2\n%3").arg(value, option->name(), error); + } + else { + _errorText = tr("%1 is not a valid option for %2").arg(value, option->name()); + } + return false; + } + } + return true; +} + +void Parser::process(const QStringList &arguments) +{ + _parser.process(arguments); + if (!parse(arguments)) { + + fprintf(stdout, "%s", qPrintable(tr("Error: %1").arg(_errorText))); + showHelp(EXIT_FAILURE); + } +} + +void Parser::process(const QCoreApplication &app) +{ + Q_UNUSED(app); + process(QCoreApplication::arguments()); +} + +QString Parser::errorText() const +{ + if (_errorText.size()) { + return _errorText; + } + else { + return _parser.errorText(); + } +} + +bool Parser::addOption(Option &option) +{ + return addOption(&option); +} + +bool Parser::addOption(Option * const option) +{ + _options[option->name()] = option; + return _parser.addOption(*option); +} +QStringList Parser::_getNames(const char shortOption, const QString longOption) +{ + QStringList names; + if (shortOption != 0x0) { + names << QString(shortOption); + } + if (longOption.size()) { + names << longOption; + } + return names; +} +QString Parser::_getDescription(const QString description, const QString default_) +{ + /* Add the translations if available */ + QString formattedDescription(tr(qPrintable(description))); + + /* Fill in the default if needed */ + if (default_.size()) { + if(!formattedDescription.contains("%1")){ + formattedDescription += " [default: %1]"; + } + formattedDescription = formattedDescription.arg(default_); + } + return formattedDescription; +} + diff --git a/libsrc/commandline/RegularExpressionOption.cpp b/libsrc/commandline/RegularExpressionOption.cpp new file mode 100644 index 00000000..7b16f264 --- /dev/null +++ b/libsrc/commandline/RegularExpressionOption.cpp @@ -0,0 +1,4 @@ +#include "commandline/RegularExpressionOption.h" + +using namespace commandline; + diff --git a/libsrc/commandline/SwitchOption.cpp b/libsrc/commandline/SwitchOption.cpp new file mode 100644 index 00000000..05d5bc1c --- /dev/null +++ b/libsrc/commandline/SwitchOption.cpp @@ -0,0 +1,5 @@ +#include "commandline/SwitchOption.h" + +using namespace commandline; + + diff --git a/libsrc/commandline/ValidatorOption.cpp b/libsrc/commandline/ValidatorOption.cpp new file mode 100644 index 00000000..9dfc9fca --- /dev/null +++ b/libsrc/commandline/ValidatorOption.cpp @@ -0,0 +1,25 @@ +#include "commandline/ValidatorOption.h" +#include "commandline/Parser.h" + +using namespace commandline; + +bool ValidatorOption::validate(Parser & parser, QString & value) +{ + if (parser.isSet(*this) || !defaultValues().empty()) { + int pos = 0; + validator->fixup(value); + return validator->validate(value, pos) == QValidator::Acceptable; + } else { + return true; + } +} + +const QValidator *ValidatorOption::getValidator() const +{ + return validator; +} +void ValidatorOption::setValidator(const QValidator *validator) +{ + ValidatorOption::validator = validator; +} + diff --git a/libsrc/jsonserver/JsonClientConnection.cpp b/libsrc/jsonserver/JsonClientConnection.cpp index 605b0c6e..527aaa34 100644 --- a/libsrc/jsonserver/JsonClientConnection.cpp +++ b/libsrc/jsonserver/JsonClientConnection.cpp @@ -562,13 +562,16 @@ void JsonClientConnection::handleServerInfoCommand(const Json::Value &, const st const std::list & activeEffectsDefinitions = _hyperion->getActiveEffects(); for (const ActiveEffectDefinition & activeEffectDefinition : activeEffectsDefinitions) { - Json::Value activeEffect; - activeEffect["script"] = activeEffectDefinition.script; - activeEffect["priority"] = activeEffectDefinition.priority; - activeEffect["timeout"] = activeEffectDefinition.timeout; - activeEffect["args"] = activeEffectDefinition.args; - - activeEffects.append(activeEffect); + if (activeEffectDefinition.priority != PriorityMuxer::LOWEST_PRIORITY -1) + { + Json::Value activeEffect; + activeEffect["script"] = activeEffectDefinition.script; + activeEffect["priority"] = activeEffectDefinition.priority; + activeEffect["timeout"] = activeEffectDefinition.timeout; + activeEffect["args"] = activeEffectDefinition.args; + + activeEffects.append(activeEffect); + } } //////////////////////////////////// diff --git a/libsrc/leddevice/CMakeLists.txt b/libsrc/leddevice/CMakeLists.txt index 2061f34f..4816ccd7 100755 --- a/libsrc/leddevice/CMakeLists.txt +++ b/libsrc/leddevice/CMakeLists.txt @@ -15,12 +15,12 @@ include_directories( # Group the headers that go through the MOC compiler SET(Leddevice_QT_HEADERS ${CURRENT_HEADER_DIR}/LedDevice.h - ${CURRENT_SOURCE_DIR}/LedRs232Device.h + ${CURRENT_SOURCE_DIR}/ProviderRs232.h ${CURRENT_SOURCE_DIR}/LedDeviceAdalight.h ${CURRENT_SOURCE_DIR}/LedDeviceAdalightApa102.h ${CURRENT_SOURCE_DIR}/LedDeviceAtmoOrb.h ${CURRENT_SOURCE_DIR}/LedDevicePhilipsHue.h - ${CURRENT_SOURCE_DIR}/LedHIDDevice.h + ${CURRENT_SOURCE_DIR}/ProviderHID.h ${CURRENT_SOURCE_DIR}/LedDeviceRawHID.h ${CURRENT_SOURCE_DIR}/LedDeviceFadeCandy.h ) @@ -36,7 +36,7 @@ SET(Leddevice_HEADERS ${CURRENT_SOURCE_DIR}/LedDeviceFile.h ${CURRENT_SOURCE_DIR}/LedDeviceUdpRaw.h ${CURRENT_SOURCE_DIR}/LedDeviceUdpE131.h - ${CURRENT_SOURCE_DIR}/LedUdpDevice.h + ${CURRENT_SOURCE_DIR}/ProviderUdp.h ${CURRENT_SOURCE_DIR}/LedDeviceHyperionUsbasp.h ${CURRENT_SOURCE_DIR}/LedDeviceTpm2.h ${CURRENT_SOURCE_DIR}/LedDeviceTpm2net.h @@ -47,8 +47,8 @@ SET(Leddevice_SOURCES ${CURRENT_SOURCE_DIR}/LedDevice.cpp ${CURRENT_SOURCE_DIR}/LedDeviceFactory.cpp - ${CURRENT_SOURCE_DIR}/LedRs232Device.cpp - ${CURRENT_SOURCE_DIR}/LedHIDDevice.cpp + ${CURRENT_SOURCE_DIR}/ProviderRs232.cpp + ${CURRENT_SOURCE_DIR}/ProviderHID.cpp ${CURRENT_SOURCE_DIR}/LedDeviceAdalight.cpp ${CURRENT_SOURCE_DIR}/LedDeviceAdalightApa102.cpp @@ -63,7 +63,7 @@ SET(Leddevice_SOURCES ${CURRENT_SOURCE_DIR}/LedDeviceFadeCandy.cpp ${CURRENT_SOURCE_DIR}/LedDeviceUdpRaw.cpp ${CURRENT_SOURCE_DIR}/LedDeviceUdpE131.cpp - ${CURRENT_SOURCE_DIR}/LedUdpDevice.cpp + ${CURRENT_SOURCE_DIR}/ProviderUdp.cpp ${CURRENT_SOURCE_DIR}/LedDeviceHyperionUsbasp.cpp ${CURRENT_SOURCE_DIR}/LedDevicePhilipsHue.cpp ${CURRENT_SOURCE_DIR}/LedDeviceTpm2.cpp @@ -74,7 +74,7 @@ SET(Leddevice_SOURCES if(ENABLE_SPIDEV) SET(Leddevice_HEADERS ${Leddevice_HEADERS} - ${CURRENT_SOURCE_DIR}/LedSpiDevice.h + ${CURRENT_SOURCE_DIR}/ProviderSpi.h ${CURRENT_SOURCE_DIR}/LedDeviceLpd6803.h ${CURRENT_SOURCE_DIR}/LedDeviceLpd8806.h ${CURRENT_SOURCE_DIR}/LedDeviceP9813.h @@ -85,7 +85,7 @@ if(ENABLE_SPIDEV) ) SET(Leddevice_SOURCES ${Leddevice_SOURCES} - ${CURRENT_SOURCE_DIR}/LedSpiDevice.cpp + ${CURRENT_SOURCE_DIR}/ProviderSpi.cpp ${CURRENT_SOURCE_DIR}/LedDeviceLpd6803.cpp ${CURRENT_SOURCE_DIR}/LedDeviceLpd8806.cpp ${CURRENT_SOURCE_DIR}/LedDeviceP9813.cpp diff --git a/libsrc/leddevice/LedDeviceAPA102.cpp b/libsrc/leddevice/LedDeviceAPA102.cpp index 3f2ff87e..b2314b85 100644 --- a/libsrc/leddevice/LedDeviceAPA102.cpp +++ b/libsrc/leddevice/LedDeviceAPA102.cpp @@ -13,7 +13,7 @@ #include "LedDeviceAPA102.h" LedDeviceAPA102::LedDeviceAPA102(const Json::Value &deviceConfig) - : LedSpiDevice(deviceConfig) + : ProviderSpi(deviceConfig) { _latchTime_ns = 500000; } diff --git a/libsrc/leddevice/LedDeviceAPA102.h b/libsrc/leddevice/LedDeviceAPA102.h index 07271696..d7411429 100644 --- a/libsrc/leddevice/LedDeviceAPA102.h +++ b/libsrc/leddevice/LedDeviceAPA102.h @@ -4,13 +4,13 @@ #include // hyperion incluse -#include "LedSpiDevice.h" +#include "ProviderSpi.h" #include /// /// Implementation of the LedDevice interface for writing to APA102 led device. /// -class LedDeviceAPA102 : public LedSpiDevice +class LedDeviceAPA102 : public ProviderSpi { public: /// diff --git a/libsrc/leddevice/LedDeviceAdalight.cpp b/libsrc/leddevice/LedDeviceAdalight.cpp index 880417cc..a2c6ad71 100644 --- a/libsrc/leddevice/LedDeviceAdalight.cpp +++ b/libsrc/leddevice/LedDeviceAdalight.cpp @@ -13,7 +13,7 @@ #include LedDeviceAdalight::LedDeviceAdalight(const Json::Value &deviceConfig) - : LedRs232Device(deviceConfig) + : ProviderRs232(deviceConfig) , _timer() { // setup the timer diff --git a/libsrc/leddevice/LedDeviceAdalight.h b/libsrc/leddevice/LedDeviceAdalight.h index e3f647a5..35a9f4af 100644 --- a/libsrc/leddevice/LedDeviceAdalight.h +++ b/libsrc/leddevice/LedDeviceAdalight.h @@ -7,12 +7,12 @@ #include // hyperion include -#include "LedRs232Device.h" +#include "ProviderRs232.h" /// /// Implementation of the LedDevice interface for writing to an Adalight led device. /// -class LedDeviceAdalight : public LedRs232Device +class LedDeviceAdalight : public ProviderRs232 { Q_OBJECT diff --git a/libsrc/leddevice/LedDeviceAtmo.cpp b/libsrc/leddevice/LedDeviceAtmo.cpp index d4878aff..b4467a8d 100644 --- a/libsrc/leddevice/LedDeviceAtmo.cpp +++ b/libsrc/leddevice/LedDeviceAtmo.cpp @@ -2,7 +2,7 @@ #include "LedDeviceAtmo.h" LedDeviceAtmo::LedDeviceAtmo(const Json::Value &deviceConfig) - : LedRs232Device(deviceConfig) + : ProviderRs232(deviceConfig) { _ledBuffer.resize(4 + 5*3); // 4-byte header, 5 RGB values _ledBuffer[0] = 0xFF; // Startbyte diff --git a/libsrc/leddevice/LedDeviceAtmo.h b/libsrc/leddevice/LedDeviceAtmo.h index 18ccfd5d..8bb54cdf 100644 --- a/libsrc/leddevice/LedDeviceAtmo.h +++ b/libsrc/leddevice/LedDeviceAtmo.h @@ -4,12 +4,12 @@ #include // hyperion incluse -#include "LedRs232Device.h" +#include "ProviderRs232.h" /// /// Implementation of the LedDevice interface for writing to serial device using tpm2 protocol. /// -class LedDeviceAtmo : public LedRs232Device +class LedDeviceAtmo : public ProviderRs232 { public: /// diff --git a/libsrc/leddevice/LedDeviceLpd6803.cpp b/libsrc/leddevice/LedDeviceLpd6803.cpp index 13ca4d93..37559ef7 100644 --- a/libsrc/leddevice/LedDeviceLpd6803.cpp +++ b/libsrc/leddevice/LedDeviceLpd6803.cpp @@ -11,7 +11,7 @@ #include "LedDeviceLpd6803.h" LedDeviceLpd6803::LedDeviceLpd6803(const Json::Value &deviceConfig) - : LedSpiDevice(deviceConfig) + : ProviderSpi(deviceConfig) { } diff --git a/libsrc/leddevice/LedDeviceLpd6803.h b/libsrc/leddevice/LedDeviceLpd6803.h index 9ed64125..ff228912 100644 --- a/libsrc/leddevice/LedDeviceLpd6803.h +++ b/libsrc/leddevice/LedDeviceLpd6803.h @@ -1,7 +1,7 @@ #pragma once // Local hyperion incluse -#include "LedSpiDevice.h" +#include "ProviderSpi.h" /// /// Implementation of the LedDevice interface for writing to LDP6803 led device. @@ -14,7 +14,7 @@ /// (R, G and B in the above illustration) making 16 bits per led. Total bytes = 4 + (2 x number of /// leds) /// -class LedDeviceLpd6803 : public LedSpiDevice +class LedDeviceLpd6803 : public ProviderSpi { public: /// diff --git a/libsrc/leddevice/LedDeviceLpd8806.cpp b/libsrc/leddevice/LedDeviceLpd8806.cpp index ba096c98..1c95d752 100644 --- a/libsrc/leddevice/LedDeviceLpd8806.cpp +++ b/libsrc/leddevice/LedDeviceLpd8806.cpp @@ -11,7 +11,7 @@ #include "LedDeviceLpd8806.h" LedDeviceLpd8806::LedDeviceLpd8806(const Json::Value &deviceConfig) - : LedSpiDevice(deviceConfig) + : ProviderSpi(deviceConfig) { } diff --git a/libsrc/leddevice/LedDeviceLpd8806.h b/libsrc/leddevice/LedDeviceLpd8806.h index ca87f3e2..e4b7803a 100644 --- a/libsrc/leddevice/LedDeviceLpd8806.h +++ b/libsrc/leddevice/LedDeviceLpd8806.h @@ -1,7 +1,7 @@ #pragma once // Local hyperion incluse -#include "LedSpiDevice.h" +#include "ProviderSpi.h" /// /// Implementation of the LedDevice interface for writing to LPD8806 led device. @@ -75,7 +75,7 @@ /// /// The number of zeroes in the 'clear data' is (#led/32 + 1)bytes (or *8 for bits) /// -class LedDeviceLpd8806 : public LedSpiDevice +class LedDeviceLpd8806 : public ProviderSpi { public: /// diff --git a/libsrc/leddevice/LedDeviceP9813.cpp b/libsrc/leddevice/LedDeviceP9813.cpp index 9e3e5a40..1305aa09 100644 --- a/libsrc/leddevice/LedDeviceP9813.cpp +++ b/libsrc/leddevice/LedDeviceP9813.cpp @@ -12,7 +12,7 @@ #include "LedDeviceP9813.h" LedDeviceP9813::LedDeviceP9813(const Json::Value &deviceConfig) - : LedSpiDevice(deviceConfig) + : ProviderSpi(deviceConfig) { } diff --git a/libsrc/leddevice/LedDeviceP9813.h b/libsrc/leddevice/LedDeviceP9813.h index 54236d2e..06b01b4d 100644 --- a/libsrc/leddevice/LedDeviceP9813.h +++ b/libsrc/leddevice/LedDeviceP9813.h @@ -4,12 +4,12 @@ #include // hyperion include -#include "LedSpiDevice.h" +#include "ProviderSpi.h" /// /// Implementation of the LedDevice interface for writing to P9813 led device. /// -class LedDeviceP9813 : public LedSpiDevice +class LedDeviceP9813 : public ProviderSpi { public: /// diff --git a/libsrc/leddevice/LedDevicePaintpack.cpp b/libsrc/leddevice/LedDevicePaintpack.cpp index b27126f5..15ed5c05 100644 --- a/libsrc/leddevice/LedDevicePaintpack.cpp +++ b/libsrc/leddevice/LedDevicePaintpack.cpp @@ -4,7 +4,7 @@ // Use out report HID device LedDevicePaintpack::LedDevicePaintpack(const Json::Value &deviceConfig) - : LedHIDDevice(deviceConfig) + : ProviderHID(deviceConfig) { _useFeature = false; } diff --git a/libsrc/leddevice/LedDevicePaintpack.h b/libsrc/leddevice/LedDevicePaintpack.h index cdfaac83..8a0c54fa 100644 --- a/libsrc/leddevice/LedDevicePaintpack.h +++ b/libsrc/leddevice/LedDevicePaintpack.h @@ -4,12 +4,12 @@ #include // Hyperion includes -#include "LedHIDDevice.h" +#include "ProviderHID.h" /// /// LedDevice implementation for a paintpack device () /// -class LedDevicePaintpack : public LedHIDDevice +class LedDevicePaintpack : public ProviderHID { public: /// diff --git a/libsrc/leddevice/LedDeviceRawHID.cpp b/libsrc/leddevice/LedDeviceRawHID.cpp index 13a4b10d..3ea3cc37 100644 --- a/libsrc/leddevice/LedDeviceRawHID.cpp +++ b/libsrc/leddevice/LedDeviceRawHID.cpp @@ -13,7 +13,7 @@ // Use feature report HID device LedDeviceRawHID::LedDeviceRawHID(const Json::Value &deviceConfig) - : LedHIDDevice(deviceConfig) + : ProviderHID(deviceConfig) , _timer() { _useFeature = true; diff --git a/libsrc/leddevice/LedDeviceRawHID.h b/libsrc/leddevice/LedDeviceRawHID.h index 6e2d63ae..53a3569f 100644 --- a/libsrc/leddevice/LedDeviceRawHID.h +++ b/libsrc/leddevice/LedDeviceRawHID.h @@ -7,12 +7,12 @@ #include // hyperion include -#include "LedHIDDevice.h" +#include "ProviderHID.h" /// /// Implementation of the LedDevice interface for writing to an RawHID led device. /// -class LedDeviceRawHID : public LedHIDDevice +class LedDeviceRawHID : public ProviderHID { Q_OBJECT diff --git a/libsrc/leddevice/LedDeviceSedu.cpp b/libsrc/leddevice/LedDeviceSedu.cpp index 54a4e216..6bdc70c4 100644 --- a/libsrc/leddevice/LedDeviceSedu.cpp +++ b/libsrc/leddevice/LedDeviceSedu.cpp @@ -18,7 +18,7 @@ struct FrameSpec }; LedDeviceSedu::LedDeviceSedu(const Json::Value &deviceConfig) - : LedRs232Device(deviceConfig) + : ProviderRs232(deviceConfig) { // empty } diff --git a/libsrc/leddevice/LedDeviceSedu.h b/libsrc/leddevice/LedDeviceSedu.h index e83ccceb..9a67f1de 100644 --- a/libsrc/leddevice/LedDeviceSedu.h +++ b/libsrc/leddevice/LedDeviceSedu.h @@ -4,12 +4,12 @@ #include // hyperion incluse -#include "LedRs232Device.h" +#include "ProviderRs232.h" /// /// Implementation of the LedDevice interface for writing to SEDU led device. /// -class LedDeviceSedu : public LedRs232Device +class LedDeviceSedu : public ProviderRs232 { public: /// diff --git a/libsrc/leddevice/LedDeviceSk6812SPI.cpp b/libsrc/leddevice/LedDeviceSk6812SPI.cpp index 6e25a69d..cb6cf412 100644 --- a/libsrc/leddevice/LedDeviceSk6812SPI.cpp +++ b/libsrc/leddevice/LedDeviceSk6812SPI.cpp @@ -12,7 +12,7 @@ #include "LedDeviceSk6812SPI.h" LedDeviceSk6812SPI::LedDeviceSk6812SPI(const Json::Value &deviceConfig) - : LedSpiDevice(deviceConfig) + : ProviderSpi(deviceConfig) , bitpair_to_byte { 0b10001000, 0b10001100, @@ -32,7 +32,7 @@ LedDevice* LedDeviceSk6812SPI::construct(const Json::Value &deviceConfig) bool LedDeviceSk6812SPI::setConfig(const Json::Value &deviceConfig) { - LedSpiDevice::setConfig(deviceConfig); + ProviderSpi::setConfig(deviceConfig); _whiteAlgorithm = deviceConfig.get("white_algorithm","").asString(); return true; diff --git a/libsrc/leddevice/LedDeviceSk6812SPI.h b/libsrc/leddevice/LedDeviceSk6812SPI.h index 2f79d26d..29ab4772 100644 --- a/libsrc/leddevice/LedDeviceSk6812SPI.h +++ b/libsrc/leddevice/LedDeviceSk6812SPI.h @@ -4,12 +4,12 @@ #include // hyperion incluse -#include "LedSpiDevice.h" +#include "ProviderSpi.h" /// /// Implementation of the LedDevice interface for writing to Sk6801 led device. /// -class LedDeviceSk6812SPI : public LedSpiDevice +class LedDeviceSk6812SPI : public ProviderSpi { public: /// diff --git a/libsrc/leddevice/LedDeviceTpm2.cpp b/libsrc/leddevice/LedDeviceTpm2.cpp index ab5d9c80..e15045c4 100644 --- a/libsrc/leddevice/LedDeviceTpm2.cpp +++ b/libsrc/leddevice/LedDeviceTpm2.cpp @@ -9,7 +9,7 @@ #include LedDeviceTpm2::LedDeviceTpm2(const Json::Value &deviceConfig) - : LedRs232Device(deviceConfig) + : ProviderRs232(deviceConfig) { } diff --git a/libsrc/leddevice/LedDeviceTpm2.h b/libsrc/leddevice/LedDeviceTpm2.h index dab57be9..39e0a3ae 100644 --- a/libsrc/leddevice/LedDeviceTpm2.h +++ b/libsrc/leddevice/LedDeviceTpm2.h @@ -4,12 +4,12 @@ #include // hyperion incluse -#include "LedRs232Device.h" +#include "ProviderRs232.h" /// /// Implementation of the LedDevice interface for writing to serial device using tpm2 protocol. /// -class LedDeviceTpm2 : public LedRs232Device +class LedDeviceTpm2 : public ProviderRs232 { public: /// diff --git a/libsrc/leddevice/LedDeviceUdpE131.cpp b/libsrc/leddevice/LedDeviceUdpE131.cpp index 043a5bb4..1e93b732 100644 --- a/libsrc/leddevice/LedDeviceUdpE131.cpp +++ b/libsrc/leddevice/LedDeviceUdpE131.cpp @@ -9,11 +9,14 @@ #include #include +#include +#include + // hyperion local includes #include "LedDeviceUdpE131.h" LedDeviceUdpE131::LedDeviceUdpE131(const Json::Value &deviceConfig) - : LedUdpDevice(deviceConfig) + : ProviderUdp(deviceConfig) { setConfig(deviceConfig); @@ -21,9 +24,20 @@ LedDeviceUdpE131::LedDeviceUdpE131(const Json::Value &deviceConfig) bool LedDeviceUdpE131::setConfig(const Json::Value &deviceConfig) { - LedUdpDevice::setConfig(deviceConfig); + ProviderUdp::setConfig(deviceConfig); _LatchTime_ns = deviceConfig.get("latchtime",104000).asInt(); _e131_universe = deviceConfig.get("universe",1).asInt(); + _e131_source_name = deviceConfig.get("source-name","hyperion on "+QHostInfo::localHostName().toStdString()).asString(); + QString _json_cid = QString::fromStdString(deviceConfig.get("cid","").asString()); + + if (_json_cid.isEmpty()) + { + _e131_cid = QUuid::createUuid(); + Debug( _log, "e131 no cid found, generated %s", _e131_cid.toString().toStdString().c_str()); + } else { + _e131_cid = QUuid(_json_cid); + Debug( _log, "e131 cid found, using %s", _e131_cid.toString().toStdString().c_str()); + } return true; } @@ -33,8 +47,6 @@ LedDevice* LedDeviceUdpE131::construct(const Json::Value &deviceConfig) return new LedDeviceUdpE131(deviceConfig); } -#define CID "hyperion!\0" -#define SOURCE_NAME "hyperion on hostname\0" // populates the headers void LedDeviceUdpE131::prepare(const unsigned this_universe, const unsigned this_dmxChannelCount) @@ -47,12 +59,12 @@ void LedDeviceUdpE131::prepare(const unsigned this_universe, const unsigned this memcpy (e131_packet.acn_id, _acn_id, 12); e131_packet.root_flength = htons(0x7000 | (110+this_dmxChannelCount) ); e131_packet.root_vector = htonl(VECTOR_ROOT_E131_DATA); - memcpy (e131_packet.cid, CID, sizeof(CID) ); + memcpy (e131_packet.cid, _e131_cid.toRfc4122().constData() , sizeof(e131_packet.cid) ); /* Frame Layer */ e131_packet.frame_flength = htons(0x7000 | (88+this_dmxChannelCount)); e131_packet.frame_vector = htonl(VECTOR_E131_DATA_PACKET); - memcpy (e131_packet.source_name, SOURCE_NAME, sizeof(SOURCE_NAME)); + snprintf (e131_packet.source_name, sizeof(e131_packet.source_name), "%s", _e131_source_name.c_str() ); e131_packet.priority = 100; e131_packet.reserved = htons(0); e131_packet.options = 0; // Bit 7 = Preview_Data diff --git a/libsrc/leddevice/LedDeviceUdpE131.h b/libsrc/leddevice/LedDeviceUdpE131.h index 700adf29..5fc62bff 100644 --- a/libsrc/leddevice/LedDeviceUdpE131.h +++ b/libsrc/leddevice/LedDeviceUdpE131.h @@ -4,7 +4,9 @@ #include // hyperion includes -#include "LedUdpDevice.h" +#include "ProviderUdp.h" + +#include /* * @@ -55,12 +57,12 @@ typedef union { uint8_t acn_id[12]; uint16_t root_flength; uint32_t root_vector; - uint8_t cid[16]; + char cid[16]; /* Frame Layer */ uint16_t frame_flength; uint32_t frame_vector; - uint8_t source_name[64]; + char source_name[64]; uint8_t priority; uint16_t reserved; uint8_t sequence_number; @@ -96,7 +98,7 @@ typedef union { /// /// Implementation of the LedDevice interface for sending led colors via udp/E1.31 packets /// -class LedDeviceUdpE131 : public LedUdpDevice +class LedDeviceUdpE131 : public ProviderUdp { public: /// @@ -135,4 +137,6 @@ private: uint8_t _e131_seq = 0; uint8_t _e131_universe = 1; uint8_t _acn_id[12] = {0x41, 0x53, 0x43, 0x2d, 0x45, 0x31, 0x2e, 0x31, 0x37, 0x00, 0x00, 0x00 }; + std::string _e131_source_name; + QUuid _e131_cid; }; diff --git a/libsrc/leddevice/LedDeviceUdpRaw.cpp b/libsrc/leddevice/LedDeviceUdpRaw.cpp index cbc75bd1..81cf892f 100644 --- a/libsrc/leddevice/LedDeviceUdpRaw.cpp +++ b/libsrc/leddevice/LedDeviceUdpRaw.cpp @@ -12,14 +12,14 @@ #include "LedDeviceUdpRaw.h" LedDeviceUdpRaw::LedDeviceUdpRaw(const Json::Value &deviceConfig) - : LedUdpDevice(deviceConfig) + : ProviderUdp(deviceConfig) { setConfig(deviceConfig); } bool LedDeviceUdpRaw::setConfig(const Json::Value &deviceConfig) { - LedUdpDevice::setConfig(deviceConfig); + ProviderUdp::setConfig(deviceConfig); _LatchTime_ns = deviceConfig.get("latchtime",500000).asInt(); return true; diff --git a/libsrc/leddevice/LedDeviceUdpRaw.h b/libsrc/leddevice/LedDeviceUdpRaw.h index 81f8439b..980c414c 100644 --- a/libsrc/leddevice/LedDeviceUdpRaw.h +++ b/libsrc/leddevice/LedDeviceUdpRaw.h @@ -4,12 +4,12 @@ #include // hyperion incluse -#include "LedUdpDevice.h" +#include "ProviderUdp.h" /// /// Implementation of the LedDevice interface for sending led colors via udp. /// -class LedDeviceUdpRaw : public LedUdpDevice +class LedDeviceUdpRaw : public ProviderUdp { public: /// diff --git a/libsrc/leddevice/LedDeviceWs2801.cpp b/libsrc/leddevice/LedDeviceWs2801.cpp index f34e113d..b3d5e81a 100644 --- a/libsrc/leddevice/LedDeviceWs2801.cpp +++ b/libsrc/leddevice/LedDeviceWs2801.cpp @@ -12,7 +12,7 @@ #include "LedDeviceWs2801.h" LedDeviceWs2801::LedDeviceWs2801(const Json::Value &deviceConfig) - : LedSpiDevice(deviceConfig) + : ProviderSpi(deviceConfig) { } diff --git a/libsrc/leddevice/LedDeviceWs2801.h b/libsrc/leddevice/LedDeviceWs2801.h index a7afee5f..7961fea3 100644 --- a/libsrc/leddevice/LedDeviceWs2801.h +++ b/libsrc/leddevice/LedDeviceWs2801.h @@ -4,12 +4,12 @@ #include // hyperion incluse -#include "LedSpiDevice.h" +#include "ProviderSpi.h" /// /// Implementation of the LedDevice interface for writing to Ws2801 led device. /// -class LedDeviceWs2801 : public LedSpiDevice +class LedDeviceWs2801 : public ProviderSpi { public: /// diff --git a/libsrc/leddevice/LedDeviceWs2812SPI.cpp b/libsrc/leddevice/LedDeviceWs2812SPI.cpp index 5fbd2134..abef4d0e 100644 --- a/libsrc/leddevice/LedDeviceWs2812SPI.cpp +++ b/libsrc/leddevice/LedDeviceWs2812SPI.cpp @@ -12,7 +12,7 @@ #include "LedDeviceWs2812SPI.h" LedDeviceWs2812SPI::LedDeviceWs2812SPI(const Json::Value &deviceConfig) - : LedSpiDevice(deviceConfig) + : ProviderSpi(deviceConfig) , bitpair_to_byte { 0b10001000, 0b10001100, diff --git a/libsrc/leddevice/LedDeviceWs2812SPI.h b/libsrc/leddevice/LedDeviceWs2812SPI.h index bc1f01b1..aaeb18b3 100644 --- a/libsrc/leddevice/LedDeviceWs2812SPI.h +++ b/libsrc/leddevice/LedDeviceWs2812SPI.h @@ -4,12 +4,12 @@ #include // hyperion incluse -#include "LedSpiDevice.h" +#include "ProviderSpi.h" /// /// Implementation of the LedDevice interface for writing to Ws2801 led device. /// -class LedDeviceWs2812SPI : public LedSpiDevice +class LedDeviceWs2812SPI : public ProviderSpi { public: /// diff --git a/libsrc/leddevice/LedUdpDevice.cpp b/libsrc/leddevice/LedUdpDevice.cpp deleted file mode 100644 index 25e6d79b..00000000 --- a/libsrc/leddevice/LedUdpDevice.cpp +++ /dev/null @@ -1,75 +0,0 @@ - -// STL includes -#include -#include -#include -#include -// Linux includes -#include -#include - -#include -#include -#include - -// Local Hyperion includes -#include "LedUdpDevice.h" - -LedUdpDevice::LedUdpDevice(const Json::Value &deviceConfig) - : LedDevice() - , _LatchTime_ns(-1) -{ - setConfig(deviceConfig); - _udpSocket = new QUdpSocket(); -} - -LedUdpDevice::~LedUdpDevice() -{ - _udpSocket->close(); -} - -bool LedUdpDevice::setConfig(const Json::Value &deviceConfig) -{ - QHostInfo info = QHostInfo::fromName( QString::fromStdString(deviceConfig["output"].asString()) ); - if (info.addresses().isEmpty()) - { - throw("invalid target address"); - } - _address = info.addresses().first(); - _port = deviceConfig["port"].asUInt(); - - return true; -} - -int LedUdpDevice::open() -{ - QHostAddress localAddress = QHostAddress::Any; - quint16 localPort = 0; - - WarningIf( !_udpSocket->bind(localAddress, localPort), _log, "Couldnt bind local address: %s", strerror(errno)); - - return 0; -} - -int LedUdpDevice::writeBytes(const unsigned size, const uint8_t * data) -{ - - qint64 retVal = _udpSocket->writeDatagram((const char *)data,size,_address,_port); - - if (retVal >= 0 && _LatchTime_ns > 0) - { - // The 'latch' time for latching the shifted-value into the leds - timespec latchTime; - latchTime.tv_sec = 0; - latchTime.tv_nsec = _LatchTime_ns; - - // Sleep to latch the leds (only if write succesfull) - nanosleep(&latchTime, NULL); - } - else - { - Warning( _log, "Error sending: %s", strerror(errno)); - } - - return retVal; -} diff --git a/libsrc/leddevice/LedHIDDevice.cpp b/libsrc/leddevice/ProviderHID.cpp similarity index 91% rename from libsrc/leddevice/LedHIDDevice.cpp rename to libsrc/leddevice/ProviderHID.cpp index f3672e2f..2149f165 100644 --- a/libsrc/leddevice/LedHIDDevice.cpp +++ b/libsrc/leddevice/ProviderHID.cpp @@ -7,9 +7,9 @@ #include // Local Hyperion includes -#include "LedHIDDevice.h" +#include "ProviderHID.h" -LedHIDDevice::LedHIDDevice(const Json::Value &deviceConfig) +ProviderHID::ProviderHID(const Json::Value &deviceConfig) : _useFeature(false) , _deviceHandle(nullptr) , _blockedForDelay(false) @@ -17,7 +17,7 @@ LedHIDDevice::LedHIDDevice(const Json::Value &deviceConfig) setConfig(deviceConfig); } -LedHIDDevice::~LedHIDDevice() +ProviderHID::~ProviderHID() { if (_deviceHandle != nullptr) { @@ -28,7 +28,7 @@ LedHIDDevice::~LedHIDDevice() hid_exit(); } -bool LedHIDDevice::setConfig(const Json::Value &deviceConfig) +bool ProviderHID::setConfig(const Json::Value &deviceConfig) { _delayAfterConnect_ms = deviceConfig.get("delayAfterConnect", 0 ).asInt(); auto VendorIdString = deviceConfig.get("VID", "0x2341").asString(); @@ -41,7 +41,7 @@ bool LedHIDDevice::setConfig(const Json::Value &deviceConfig) return true; } -int LedHIDDevice::open() +int ProviderHID::open() { // Initialize the usb context int error = hid_init(); @@ -97,7 +97,7 @@ int LedHIDDevice::open() } -int LedHIDDevice::writeBytes(const unsigned size, const uint8_t * data) +int ProviderHID::writeBytes(const unsigned size, const uint8_t * data) { if (_blockedForDelay) { return 0; @@ -156,7 +156,7 @@ int LedHIDDevice::writeBytes(const unsigned size, const uint8_t * data) return ret; } -void LedHIDDevice::unblockAfterDelay() +void ProviderHID::unblockAfterDelay() { Debug(_log,"Device unblocked"); _blockedForDelay = false; diff --git a/libsrc/leddevice/LedHIDDevice.h b/libsrc/leddevice/ProviderHID.h similarity index 85% rename from libsrc/leddevice/LedHIDDevice.h rename to libsrc/leddevice/ProviderHID.h index 6db51ac0..4dbb9255 100644 --- a/libsrc/leddevice/LedHIDDevice.h +++ b/libsrc/leddevice/ProviderHID.h @@ -9,9 +9,9 @@ #include /// -/// The LedHIDDevice implements an abstract base-class for LedDevices using an HID-device. +/// The ProviderHID implements an abstract base-class for LedDevices using an HID-device. /// -class LedHIDDevice : public LedDevice +class ProviderHID : public LedDevice { Q_OBJECT @@ -21,12 +21,12 @@ public: /// /// @param deviceConfig json device config /// - LedHIDDevice(const Json::Value &deviceConfig); + ProviderHID(const Json::Value &deviceConfig); /// /// Destructor of the LedDevice; closes the output device if it is open /// - virtual ~LedHIDDevice(); + virtual ~ProviderHID(); /// /// Sets configuration diff --git a/libsrc/leddevice/LedRs232Device.cpp b/libsrc/leddevice/ProviderRs232.cpp similarity index 89% rename from libsrc/leddevice/LedRs232Device.cpp rename to libsrc/leddevice/ProviderRs232.cpp index fea6541f..819d6953 100644 --- a/libsrc/leddevice/LedRs232Device.cpp +++ b/libsrc/leddevice/ProviderRs232.cpp @@ -7,9 +7,9 @@ #include // Local Hyperion includes -#include "LedRs232Device.h" +#include "ProviderRs232.h" -LedRs232Device::LedRs232Device(const Json::Value &deviceConfig) +ProviderRs232::ProviderRs232(const Json::Value &deviceConfig) : _rs232Port(this) , _blockedForDelay(false) , _stateChanged(true) @@ -18,7 +18,7 @@ LedRs232Device::LedRs232Device(const Json::Value &deviceConfig) connect(&_rs232Port, SIGNAL(error(QSerialPort::SerialPortError)), this, SLOT(error(QSerialPort::SerialPortError))); } -bool LedRs232Device::setConfig(const Json::Value &deviceConfig) +bool ProviderRs232::setConfig(const Json::Value &deviceConfig) { closeDevice(); _deviceName = deviceConfig["output"].asString(); @@ -28,7 +28,7 @@ bool LedRs232Device::setConfig(const Json::Value &deviceConfig) return true; } -void LedRs232Device::error(QSerialPort::SerialPortError error) +void ProviderRs232::error(QSerialPort::SerialPortError error) { if ( error != QSerialPort::NoError ) { @@ -64,13 +64,13 @@ void LedRs232Device::error(QSerialPort::SerialPortError error) } } -LedRs232Device::~LedRs232Device() +ProviderRs232::~ProviderRs232() { disconnect(&_rs232Port, SIGNAL(error(QSerialPort::SerialPortError)), this, SLOT(error(QSerialPort::SerialPortError))); closeDevice(); } -void LedRs232Device::closeDevice() +void ProviderRs232::closeDevice() { if (_rs232Port.isOpen()) { @@ -79,7 +79,7 @@ void LedRs232Device::closeDevice() } } -int LedRs232Device::open() +int ProviderRs232::open() { Info(_log, "Opening UART: %s", _deviceName.c_str()); _rs232Port.setPortName(_deviceName.c_str()); @@ -88,7 +88,7 @@ int LedRs232Device::open() } -bool LedRs232Device::tryOpen() +bool ProviderRs232::tryOpen() { if ( ! _rs232Port.isOpen() ) { @@ -116,7 +116,7 @@ bool LedRs232Device::tryOpen() } -int LedRs232Device::writeBytes(const unsigned size, const uint8_t * data) +int ProviderRs232::writeBytes(const unsigned size, const uint8_t * data) { if (_blockedForDelay) { @@ -143,7 +143,7 @@ int LedRs232Device::writeBytes(const unsigned size, const uint8_t * data) } -void LedRs232Device::unblockAfterDelay() +void ProviderRs232::unblockAfterDelay() { Debug(_log, "Device unblocked"); _blockedForDelay = false; diff --git a/libsrc/leddevice/LedRs232Device.h b/libsrc/leddevice/ProviderRs232.h similarity index 86% rename from libsrc/leddevice/LedRs232Device.h rename to libsrc/leddevice/ProviderRs232.h index d321835d..4287aed9 100644 --- a/libsrc/leddevice/LedRs232Device.h +++ b/libsrc/leddevice/ProviderRs232.h @@ -7,9 +7,9 @@ #include /// -/// The LedRs232Device implements an abstract base-class for LedDevices using a RS232-device. +/// The ProviderRs232 implements an abstract base-class for LedDevices using a RS232-device. /// -class LedRs232Device : public LedDevice +class ProviderRs232 : public LedDevice { Q_OBJECT @@ -19,7 +19,7 @@ public: /// /// @param deviceConfig json device config /// - LedRs232Device(const Json::Value &deviceConfig); + ProviderRs232(const Json::Value &deviceConfig); /// /// Sets configuration @@ -31,7 +31,7 @@ public: /// /// Destructor of the LedDevice; closes the output device if it is open /// - virtual ~LedRs232Device(); + virtual ~ProviderRs232(); /// /// Opens and configures the output device diff --git a/libsrc/leddevice/LedSpiDevice.cpp b/libsrc/leddevice/ProviderSpi.cpp similarity index 84% rename from libsrc/leddevice/LedSpiDevice.cpp rename to libsrc/leddevice/ProviderSpi.cpp index 7ff12a62..754f7b0a 100644 --- a/libsrc/leddevice/LedSpiDevice.cpp +++ b/libsrc/leddevice/ProviderSpi.cpp @@ -10,11 +10,11 @@ #include // Local Hyperion includes -#include "LedSpiDevice.h" +#include "ProviderSpi.h" #include -LedSpiDevice::LedSpiDevice(const Json::Value &deviceConfig) +ProviderSpi::ProviderSpi(const Json::Value &deviceConfig) : LedDevice() , _fid(-1) { @@ -23,14 +23,14 @@ LedSpiDevice::LedSpiDevice(const Json::Value &deviceConfig) Debug(_log, "_spiDataInvert %d, _spiMode %d", _spiDataInvert, _spiMode); } -LedSpiDevice::~LedSpiDevice() +ProviderSpi::~ProviderSpi() { // close(_fid); } -bool LedSpiDevice::setConfig(const Json::Value &deviceConfig) +bool ProviderSpi::setConfig(const Json::Value &deviceConfig) { - _deviceName = deviceConfig.get("output","/dev/spidev.0.0").asString(); + _deviceName = deviceConfig.get("output","/dev/spidev0.0").asString(); _baudRate_Hz = deviceConfig.get("rate",1000000).asInt(); _latchTime_ns = deviceConfig.get("latchtime",0).asInt(); _spiMode = deviceConfig.get("spimode",SPI_MODE_0).asInt(); @@ -39,7 +39,7 @@ bool LedSpiDevice::setConfig(const Json::Value &deviceConfig) return true; } -int LedSpiDevice::open() +int ProviderSpi::open() { const int bitsPerWord = 8; @@ -69,7 +69,7 @@ int LedSpiDevice::open() return 0; } -int LedSpiDevice::writeBytes(const unsigned size, const uint8_t * data) +int ProviderSpi::writeBytes(const unsigned size, const uint8_t * data) { if (_fid < 0) { diff --git a/libsrc/leddevice/LedSpiDevice.h b/libsrc/leddevice/ProviderSpi.h similarity index 87% rename from libsrc/leddevice/LedSpiDevice.h rename to libsrc/leddevice/ProviderSpi.h index 8bc920c3..9425b621 100644 --- a/libsrc/leddevice/LedSpiDevice.h +++ b/libsrc/leddevice/ProviderSpi.h @@ -7,9 +7,9 @@ #include /// -/// The LedSpiDevice implements an abstract base-class for LedDevices using the SPI-device. +/// The ProviderSpi implements an abstract base-class for LedDevices using the SPI-device. /// -class LedSpiDevice : public LedDevice +class ProviderSpi : public LedDevice { public: /// @@ -17,7 +17,7 @@ public: /// /// @param deviceConfig json device config /// - LedSpiDevice(const Json::Value &deviceConfig); + ProviderSpi(const Json::Value &deviceConfig); /// /// Sets configuration @@ -29,7 +29,7 @@ public: /// /// Destructor of the LedDevice; closes the output device if it is open /// - virtual ~LedSpiDevice(); + virtual ~ProviderSpi(); /// /// Opens and configures the output device diff --git a/libsrc/leddevice/ProviderUdp.cpp b/libsrc/leddevice/ProviderUdp.cpp new file mode 100644 index 00000000..03ac61f0 --- /dev/null +++ b/libsrc/leddevice/ProviderUdp.cpp @@ -0,0 +1,86 @@ + +// STL includes +#include +#include +#include +#include +// Linux includes +#include +#include + +#include +#include +#include + +// Local Hyperion includes +#include "ProviderUdp.h" + +ProviderUdp::ProviderUdp(const Json::Value &deviceConfig) + : LedDevice() + , _LatchTime_ns(-1) +{ + setConfig(deviceConfig); + _udpSocket = new QUdpSocket(); +} + +ProviderUdp::~ProviderUdp() +{ + _udpSocket->close(); +} + +bool ProviderUdp::setConfig(const Json::Value &deviceConfig) +{ + if (_address.setAddress( QString::fromStdString(deviceConfig["host"].asString()) ) ) + { + Debug( _log, "Successfully parsed %s as an ip address.", deviceConfig["host"].asString().c_str()); + } + else + { + Debug( _log, "Failed to parse %s as an ip address.", deviceConfig["host"].asString().c_str()); + QHostInfo info = QHostInfo::fromName( QString::fromStdString(deviceConfig["host"].asString()) ); + if (info.addresses().isEmpty()) + { + Debug( _log, "Failed to parse %s as a hostname.", deviceConfig["host"].asString().c_str()); + throw std::runtime_error("invalid target address"); + } + Debug( _log, "Successfully parsed %s as a hostname.", deviceConfig["host"].asString().c_str()); + _address = info.addresses().first(); + } + _port = deviceConfig["port"].asUInt(); + Debug( _log, "UDP using %s:%d", _address.toString().toStdString().c_str() , _port ); + + return true; +} + +int ProviderUdp::open() +{ + QHostAddress localAddress = QHostAddress::Any; + quint16 localPort = 0; + + WarningIf( !_udpSocket->bind(localAddress, localPort), _log, "Could not bind local address: %s", strerror(errno)); + + return 0; +} + +int ProviderUdp::writeBytes(const unsigned size, const uint8_t * data) +{ + + qint64 retVal = _udpSocket->writeDatagram((const char *)data,size,_address,_port); + + if (retVal >= 0 && _LatchTime_ns > 0) + { + // The 'latch' time for latching the shifted-value into the leds + timespec latchTime; + latchTime.tv_sec = 0; + latchTime.tv_nsec = _LatchTime_ns; + + // Sleep to latch the leds (only if write succesfull) + nanosleep(&latchTime, NULL); + } + else + { + Warning( _log, "Error sending: %s", strerror(errno)); + } + + return retVal; +} diff --git a/libsrc/leddevice/LedUdpDevice.h b/libsrc/leddevice/ProviderUdp.h similarity index 84% rename from libsrc/leddevice/LedUdpDevice.h rename to libsrc/leddevice/ProviderUdp.h index d1faa366..b5f9ec37 100644 --- a/libsrc/leddevice/LedUdpDevice.h +++ b/libsrc/leddevice/ProviderUdp.h @@ -7,9 +7,9 @@ #include /// -/// The LedUdpDevice implements an abstract base-class for LedDevices using the SPI-device. +/// The ProviderUdp implements an abstract base-class for LedDevices using the SPI-device. /// -class LedUdpDevice : public LedDevice +class ProviderUdp : public LedDevice { public: /// @@ -17,12 +17,12 @@ public: /// /// @param deviceConfig json device config /// - LedUdpDevice(const Json::Value &deviceConfig); + ProviderUdp(const Json::Value &deviceConfig); /// /// Destructor of the LedDevice; closes the output device if it is open /// - virtual ~LedUdpDevice(); + virtual ~ProviderUdp(); /// /// Sets configuration diff --git a/libsrc/protoserver/ProtoConnectionWrapper.cpp b/libsrc/protoserver/ProtoConnectionWrapper.cpp index e236e223..bc38e735 100644 --- a/libsrc/protoserver/ProtoConnectionWrapper.cpp +++ b/libsrc/protoserver/ProtoConnectionWrapper.cpp @@ -1,10 +1,13 @@ // protoserver includes #include "protoserver/ProtoConnectionWrapper.h" -ProtoConnectionWrapper::ProtoConnectionWrapper(const std::string & address, int priority, int duration_ms, bool skipProtoReply) +ProtoConnectionWrapper::ProtoConnectionWrapper(const QString &address, + int priority, + int duration_ms, + bool skipProtoReply) : _priority(priority) , _duration_ms(duration_ms) - , _connection(address) + , _connection(address.toStdString()) { _connection.setSkipReply(skipProtoReply); connect(&_connection, SIGNAL(setGrabbingMode(GrabbingMode)), this, SIGNAL(setGrabbingMode(GrabbingMode))); diff --git a/src/hyperion-aml/CMakeLists.txt b/src/hyperion-aml/CMakeLists.txt index 3493d3f3..0ee29a3d 100644 --- a/src/hyperion-aml/CMakeLists.txt +++ b/src/hyperion-aml/CMakeLists.txt @@ -30,7 +30,7 @@ add_executable(${PROJECT_NAME} ) target_link_libraries(${PROJECT_NAME} - getoptPlusPlus + commandline blackborder hyperion-utils protoserver diff --git a/src/hyperion-aml/hyperion-aml.cpp b/src/hyperion-aml/hyperion-aml.cpp index 191b871e..cc91a63e 100644 --- a/src/hyperion-aml/hyperion-aml.cpp +++ b/src/hyperion-aml/hyperion-aml.cpp @@ -4,20 +4,16 @@ #include #include -// getoptPlusPLus includes -#include - #include #include "AmlogicWrapper.h" #include "HyperionConfig.h" -#include +#include - -using namespace vlofgren; +using namespace commandline; // save the image as screenshot -void saveScreenshot(const char * filename, const Image & image) +void saveScreenshot(QString filename, const Image & image) { // store as PNG QImage pngImage((const uint8_t *) image.memptr(), image.width(), image.height(), 3*image.width(), QImage::Format_RGB888); @@ -35,50 +31,30 @@ int main(int argc, char ** argv) try { - // create the option parser and initialize all parameters - OptionsParser optionParser("AmLogic capture application for Hyperion"); - ParameterSet & parameters = optionParser.getParameters(); + // create the option parser and initialize all parser + Parser parser("AmLogic capture application for Hyperion"); - IntParameter & argFps = parameters.add ('f', "framerate", "Capture frame rate [default: 10]"); - IntParameter & argWidth = parameters.add (0x0, "width", "Width of the captured image [default: 128]"); - IntParameter & argHeight = parameters.add (0x0, "height", "Height of the captured image [default: 128]"); - SwitchParameter<> & argScreenshot = parameters.add> (0x0, "screenshot", "Take a single screenshot, save it to file and quit"); - StringParameter & argAddress = parameters.add ('a', "address", "Set the address of the hyperion server [default: 127.0.0.1:19445]"); - IntParameter & argPriority = parameters.add ('p', "priority", "Use the provided priority channel (the lower the number, the higher the priority) [default: 800]"); - SwitchParameter<> & argSkipReply = parameters.add> (0x0, "skip-reply", "Do not receive and check reply messages from Hyperion"); - SwitchParameter<> & argHelp = parameters.add> ('h', "help", "Show this help message and exit"); - - // set defaults - argFps.setDefault(10); - argWidth.setDefault(160); - argHeight.setDefault(160); - argAddress.setDefault("127.0.0.1:19445"); - argPriority.setDefault(800); + IntOption & argFps = parser.add ('f', "framerate", "Capture frame rate [default: %1]", "10"); + IntOption & argWidth = parser.add (0x0, "width", "Width of the captured image [default: %1]", "160", 160, 4096); + IntOption & argHeight = parser.add (0x0, "height", "Height of the captured image [default: %1]", "160", 160, 4096); + BooleanOption & argScreenshot = parser.add (0x0, "screenshot", "Take a single screenshot, save it to file and quit"); + Option & argAddress = parser.add