logic: IDE Communication
Network code and controller added to communicate with IDE plugins. Does not include GUI integration though.
This commit is contained in:
@@ -146,6 +146,7 @@ set(Qt5PrintSupport_DIR "$ENV{QT_DIR}/cmake/Qt5PrintSupport/")
|
||||
|
||||
find_package(Qt5Widgets)
|
||||
find_package(Qt5PrintSupport)
|
||||
find_package(Qt5Network)
|
||||
|
||||
if(Qt5Widgets_FOUND)
|
||||
MESSAGE(STATUS "Found Qt ${Qt5Widgets_VERSION_STRING}")
|
||||
@@ -203,6 +204,7 @@ target_include_directories(${APP_PROJECT_NAME} SYSTEM
|
||||
|
||||
# Use the Widgets module from Qt 5.
|
||||
qt5_use_modules(${APP_PROJECT_NAME} Widgets)
|
||||
qt5_use_modules(${APP_PROJECT_NAME} Network)
|
||||
|
||||
# configure platform specific include file
|
||||
configure_file(
|
||||
@@ -245,6 +247,9 @@ if (APPLE)
|
||||
|
||||
get_property(QT_PRINT_PATH TARGET ${Qt5PrintSupport_LIBRARIES} PROPERTY LOCATION)
|
||||
get_filename_component(QT_PRINT_PATH ${QT_PRINT_PATH} REALPATH)
|
||||
|
||||
#get_property(QT_NETWORK_PATH TARGET ${Qt5Network_LIBRARIES} PROPERTY LOCATION)
|
||||
#get_filename_component(QT_NETWORK_PATH ${QT_NETWORK_PATH} REALPATH)
|
||||
|
||||
list(APPEND MACOSX_QT_FRAMEWORKS ${QT_CORE_PATH} ${QT_GUI_PATH} ${QT_WIDGETS_PATH} ${QT_PRINT_PATH})
|
||||
string(REPLACE ";" " " MACOSX_QT_FRAMEWORKS "${MACOSX_QT_FRAMEWORKS}")
|
||||
|
||||
@@ -48,3 +48,7 @@ $ ninja -j4 check-all
|
||||
$ cd ../release_build
|
||||
$ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ../llvm
|
||||
$ ninja -j4 check-all
|
||||
|
||||
##### Remarks
|
||||
|
||||
* Boost lib dir: rename library directory for your system (e.g.: 'lib32-msvc-12.0') to 'lib'
|
||||
@@ -1,4 +1,310 @@
|
||||
ConfigManager.cpp WARNING: value path/to/nowhere is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
ConfigManager.cpp WARNING: value source/HeaderSearchPaths/HeaderSearchPath is not present in config.
|
||||
Token.cpp ERROR: Location Id was not referenced by this Token.
|
||||
Edge.cpp ERROR: Edge type_of can't go from Node undefined to Node undefined
|
||||
Node.cpp WARNING: Cannot change NodeType after it was already set from namespace to class
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -39,6 +39,13 @@ add_files(
|
||||
qt/graphics/QtRoundedRectItem.h
|
||||
qt/graphics/QtStraightLineItem.cpp
|
||||
qt/graphics/QtStraightLineItem.h
|
||||
|
||||
qt/network/QtIDECommunicationController.cpp
|
||||
qt/network/QtIDECommunicationController.h
|
||||
qt/network/QtNetworkFactory.cpp
|
||||
qt/network/QtNetworkFactory.h
|
||||
qt/network/QtTcpWrapper.cpp
|
||||
qt/network/QtTcpWrapper.h
|
||||
|
||||
qt/utility/QtDeviceScaledPixmap.cpp
|
||||
qt/utility/QtDeviceScaledPixmap.h
|
||||
|
||||
+6
-1
@@ -9,10 +9,13 @@
|
||||
#include "Application.h"
|
||||
#include "includes.h" // defines 'void setup(int argc, char *argv[])'
|
||||
#include "qt/window/QtSplashScreen.h"
|
||||
#include "qt/network/QtNetworkFactory.h"
|
||||
#include "qt/utility/utilityQt.h"
|
||||
#include "qt/view/QtViewFactory.h"
|
||||
#include "version.h"
|
||||
|
||||
#include "component/controller/helper/NetworkProtocolHelper.h" // remove when done
|
||||
|
||||
void init()
|
||||
{
|
||||
std::shared_ptr<ConsoleLogger> consoleLogger = std::make_shared<ConsoleLogger>();
|
||||
@@ -44,7 +47,9 @@ int main(int argc, char *argv[])
|
||||
init();
|
||||
|
||||
QtViewFactory viewFactory;
|
||||
std::shared_ptr<Application> app = Application::create(&viewFactory);
|
||||
QtNetworkFactory networkFactory;
|
||||
|
||||
std::shared_ptr<Application> app = Application::create(&viewFactory, &networkFactory);
|
||||
|
||||
if (splash)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#include "QtIDECommunicationController.h"
|
||||
|
||||
#include <functional>
|
||||
|
||||
QtIDECommunicationController::QtIDECommunicationController(QObject* parent)
|
||||
: m_tcpWrapper(parent)
|
||||
{
|
||||
m_tcpWrapper.setReadCallback(std::bind(&QtIDECommunicationController::handleIncomingMessage, this, std::placeholders::_1));
|
||||
}
|
||||
|
||||
QtIDECommunicationController::~QtIDECommunicationController()
|
||||
{}
|
||||
|
||||
void QtIDECommunicationController::sendMessage(const std::string& message) const
|
||||
{
|
||||
m_tcpWrapper.sendMessage(message);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef QT_IDE_COMMUNICATION_CONTROLLER
|
||||
#define QT_IDE_COMMUNICATION_CONTROLLER
|
||||
|
||||
#include <qobject.h>
|
||||
|
||||
#include "QtTcpWrapper.h"
|
||||
|
||||
#include "component/controller/IDECommunicationController.h"
|
||||
|
||||
class QtIDECommunicationController
|
||||
: public IDECommunicationController
|
||||
{
|
||||
public:
|
||||
QtIDECommunicationController(QObject* parent);
|
||||
~QtIDECommunicationController();
|
||||
|
||||
private:
|
||||
virtual void sendMessage(const std::string& message) const;
|
||||
|
||||
QtTcpWrapper m_tcpWrapper;
|
||||
};
|
||||
|
||||
#endif // QT_IDE_COMMUNICATION_CONTROLLER
|
||||
@@ -0,0 +1,16 @@
|
||||
#include "QtNetworkFactory.h"
|
||||
|
||||
#include "QtIDECommunicationController.h"
|
||||
|
||||
QtNetworkFactory::QtNetworkFactory()
|
||||
{
|
||||
}
|
||||
|
||||
QtNetworkFactory::~QtNetworkFactory()
|
||||
{
|
||||
}
|
||||
|
||||
std::shared_ptr<IDECommunicationController> QtNetworkFactory::createIDECommunicationController() const
|
||||
{
|
||||
return std::make_shared<QtIDECommunicationController>(nullptr);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef QT_NETWORK_FACTORY_H
|
||||
#define QT_NETWORK_FACTORY_H
|
||||
|
||||
#include "component/controller/NetworkFactory.h"
|
||||
|
||||
class QtNetworkFactory : public NetworkFactory
|
||||
{
|
||||
public:
|
||||
QtNetworkFactory();
|
||||
virtual ~QtNetworkFactory();
|
||||
|
||||
virtual std::shared_ptr<IDECommunicationController> createIDECommunicationController() const;
|
||||
};
|
||||
|
||||
#endif // QT_NETWORK_FACTORY_H
|
||||
@@ -0,0 +1,91 @@
|
||||
#include "QtTcpWrapper.h"
|
||||
|
||||
#include "utility/logging/logging.h"
|
||||
|
||||
QtTcpWrapper::QtTcpWrapper(QObject* parent)
|
||||
: QObject(parent)
|
||||
, m_port(6667)
|
||||
, m_ip("127.0.0.1")
|
||||
{
|
||||
QHostAddress address(m_ip.c_str());
|
||||
|
||||
m_tcpServer = new QTcpServer(this);
|
||||
|
||||
connect(m_tcpServer, SIGNAL(newConnection()), this, SLOT(acceptConnection()));
|
||||
|
||||
if (!m_tcpServer->listen(QHostAddress::LocalHost, m_port))
|
||||
{
|
||||
LOG_ERROR_STREAM(<< "TCP server failed to start. Unable to listen for IDE plugin messages.");
|
||||
}
|
||||
}
|
||||
|
||||
QtTcpWrapper::QtTcpWrapper(QObject* parent, const std::string& ip, const quint16 port)
|
||||
: QObject(parent)
|
||||
, m_port(port)
|
||||
, m_ip(ip)
|
||||
{
|
||||
QHostAddress address(m_ip.c_str());
|
||||
|
||||
m_tcpServer = new QTcpServer(this);
|
||||
|
||||
connect(m_tcpServer, SIGNAL(newConnection()), this, SLOT(acceptConnection()));
|
||||
|
||||
if (!m_tcpServer->listen(QHostAddress::LocalHost, m_port))
|
||||
{
|
||||
LOG_ERROR_STREAM(<< "TCP server failed to start. Unable to listen for IDE plugin messages.");
|
||||
}
|
||||
}
|
||||
|
||||
QtTcpWrapper::~QtTcpWrapper()
|
||||
{
|
||||
if (m_tcpServer != NULL)
|
||||
{
|
||||
if (m_tcpServer->isListening())
|
||||
{
|
||||
m_tcpServer->close();
|
||||
}
|
||||
|
||||
delete m_tcpServer;
|
||||
}
|
||||
}
|
||||
|
||||
void QtTcpWrapper::sendMessage(const std::string& message) const
|
||||
{
|
||||
QByteArray data;
|
||||
data.append(message.c_str());
|
||||
|
||||
QTcpSocket socket;
|
||||
socket.connectToHost(QHostAddress::LocalHost, 6666);
|
||||
|
||||
if (socket.waitForConnected())
|
||||
{
|
||||
socket.write(data);
|
||||
socket.flush();
|
||||
socket.waitForBytesWritten();
|
||||
socket.close();
|
||||
}
|
||||
}
|
||||
|
||||
void QtTcpWrapper::setReadCallback(const std::function<void(const std::string&)>& callback)
|
||||
{
|
||||
m_readCallback = callback;
|
||||
}
|
||||
|
||||
void QtTcpWrapper::acceptConnection()
|
||||
{
|
||||
m_tcpClient = m_tcpServer->nextPendingConnection();
|
||||
|
||||
connect(m_tcpClient, SIGNAL(readyRead()), this, SLOT(startRead()));
|
||||
}
|
||||
|
||||
void QtTcpWrapper::startRead()
|
||||
{
|
||||
char buffer[1024] = { 0 };
|
||||
m_tcpClient->read(buffer, m_tcpClient->bytesAvailable());
|
||||
m_tcpClient->close();
|
||||
|
||||
if (m_readCallback != NULL)
|
||||
{
|
||||
m_readCallback(buffer);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
#ifndef QT_SOCKET_WRAPPER_H
|
||||
#define QT_SOCKET_WRAPPER_H
|
||||
|
||||
#include <functional>
|
||||
#include <qobject.h>
|
||||
#include <qudpsocket.h>
|
||||
|
||||
#include <qtcpserver.h>
|
||||
#include <qtcpsocket.h>
|
||||
|
||||
class QtTcpWrapper : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QtTcpWrapper(QObject* parent);
|
||||
QtTcpWrapper(QObject* parent, const std::string& ip, const quint16 port);
|
||||
~QtTcpWrapper();
|
||||
|
||||
void sendMessage(const std::string& message) const;
|
||||
|
||||
void setReadCallback(const std::function<void(const std::string&)>& callback);
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
void acceptConnection();
|
||||
void startRead();
|
||||
|
||||
private:
|
||||
quint16 m_port;
|
||||
std::string m_ip;
|
||||
|
||||
std::function<void(const std::string&)> m_readCallback;
|
||||
|
||||
QTcpServer* m_tcpServer;
|
||||
QTcpSocket* m_tcpClient;
|
||||
};
|
||||
|
||||
#endif // QT_SOCKET_WRAPPER_H
|
||||
@@ -0,0 +1,49 @@
|
||||
#include "SocketTest.h"
|
||||
|
||||
#include "utility/logging/logging.h"
|
||||
|
||||
SocketTest::SocketTest(QObject* parent)
|
||||
: QObject(parent)
|
||||
, m_socket(NULL)
|
||||
{
|
||||
m_socket = new QUdpSocket(this);
|
||||
QHostAddress address("127.0.0.1");
|
||||
m_socket->bind(address, 6666);
|
||||
|
||||
connect(m_socket, SIGNAL(readyRead()), this, SLOT(readyRead()));
|
||||
}
|
||||
|
||||
SocketTest::~SocketTest()
|
||||
{
|
||||
if(m_socket != NULL)
|
||||
{
|
||||
delete m_socket;
|
||||
}
|
||||
}
|
||||
|
||||
void SocketTest::sendTestMessage()
|
||||
{
|
||||
LOG_WARNING("SocketTest::sendTestMessage");
|
||||
|
||||
QByteArray Data;
|
||||
Data.append("qt foo");
|
||||
|
||||
m_socket->writeDatagram(Data, QHostAddress::Any, 6666);
|
||||
}
|
||||
|
||||
void SocketTest::readyRead()
|
||||
{
|
||||
LOG_WARNING("SocketTest::readyRead");
|
||||
|
||||
QByteArray buffer;
|
||||
buffer.resize(m_socket->pendingDatagramSize());
|
||||
|
||||
QHostAddress sender;
|
||||
quint16 senderPort;
|
||||
|
||||
m_socket->readDatagram(buffer.data(), buffer.size(), &sender, &senderPort);
|
||||
|
||||
std::string message = buffer.data();
|
||||
|
||||
LOG_WARNING(message);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef SOCKET_TEST_H
|
||||
#define SOCKET_TEST_H
|
||||
|
||||
#include <qobject.h>
|
||||
#include <qudpsocket.h>
|
||||
|
||||
class SocketTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SocketTest(QObject* parent);
|
||||
~SocketTest();
|
||||
|
||||
void sendTestMessage();
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
void readyRead();
|
||||
|
||||
private:
|
||||
QUdpSocket* m_socket;
|
||||
};
|
||||
|
||||
#endif // SOCKET_TEST_H
|
||||
@@ -7,13 +7,14 @@
|
||||
#include "utility/scheduling/TaskScheduler.h"
|
||||
|
||||
#include "component/view/GraphViewStyle.h"
|
||||
#include "component/controller/NetworkFactory.h"
|
||||
#include "component/view/MainView.h"
|
||||
#include "component/view/ViewFactory.h"
|
||||
#include "data/StorageCache.h"
|
||||
#include "settings/ApplicationSettings.h"
|
||||
#include "settings/ColorScheme.h"
|
||||
|
||||
std::shared_ptr<Application> Application::create(ViewFactory* viewFactory)
|
||||
std::shared_ptr<Application> Application::create(ViewFactory* viewFactory, NetworkFactory* networkFactory)
|
||||
{
|
||||
loadSettings();
|
||||
|
||||
@@ -41,6 +42,8 @@ std::shared_ptr<Application> Application::create(ViewFactory* viewFactory)
|
||||
ptr->m_mainView->showStartScreen();
|
||||
}
|
||||
|
||||
ptr->m_ideCommunicationController = networkFactory->createIDECommunicationController();
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#include "utility/messaging/type/MessageRefresh.h"
|
||||
#include "utility/messaging/type/MessageSaveProject.h"
|
||||
|
||||
class IDECommunicationController;
|
||||
class NetworkFactory;
|
||||
class ViewFactory;
|
||||
class MainView;
|
||||
class StorageCache;
|
||||
@@ -22,7 +24,7 @@ class Application
|
||||
, public MessageListener<MessageSaveProject>
|
||||
{
|
||||
public:
|
||||
static std::shared_ptr<Application> create(ViewFactory* viewFactory);
|
||||
static std::shared_ptr<Application> create(ViewFactory* viewFactory, NetworkFactory* networkFactory);
|
||||
static void loadSettings();
|
||||
|
||||
~Application();
|
||||
@@ -46,6 +48,10 @@ private:
|
||||
|
||||
std::shared_ptr<MainView> m_mainView;
|
||||
std::shared_ptr<ComponentManager> m_componentManager;
|
||||
|
||||
std::shared_ptr<IDECommunicationController> m_ideCommunicationController;
|
||||
|
||||
bool m_isInitialParse;
|
||||
};
|
||||
|
||||
#endif // APPLICATION_H
|
||||
|
||||
@@ -45,6 +45,8 @@ add_files(
|
||||
component/controller/helper/GraphLayouter.h
|
||||
component/controller/helper/GraphPostprocessor.cpp
|
||||
component/controller/helper/GraphPostprocessor.h
|
||||
component/controller/helper/NetworkProtocolHelper.cpp
|
||||
component/controller/helper/NetworkProtocolHelper.h
|
||||
component/controller/helper/SnippetMerger.cpp
|
||||
component/controller/helper/SnippetMerger.h
|
||||
|
||||
@@ -56,6 +58,11 @@ add_files(
|
||||
component/controller/FeatureController.h
|
||||
component/controller/GraphController.cpp
|
||||
component/controller/GraphController.h
|
||||
|
||||
component/controller/IDECommunicationController.cpp
|
||||
component/controller/IDECommunicationController.h
|
||||
component/controller/NetworkFactory.cpp
|
||||
component/controller/NetworkFactory.h
|
||||
component/controller/RefreshController.cpp
|
||||
component/controller/RefreshController.h
|
||||
component/controller/SearchController.cpp
|
||||
@@ -252,6 +259,7 @@ add_files(
|
||||
utility/messaging/type/MessageGraphNodeMove.h
|
||||
utility/messaging/type/MessageInterruptTasks.h
|
||||
utility/messaging/type/MessageLoadProject.h
|
||||
utility/messaging/type/MessageMoveIDECursor.h
|
||||
utility/messaging/type/MessageRedo.h
|
||||
utility/messaging/type/MessageRefresh.h
|
||||
utility/messaging/type/MessageSaveProject.h
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "component/ComponentManager.h"
|
||||
|
||||
#include "component/controller/NetworkFactory.h"
|
||||
|
||||
#include "component/view/CodeView.h"
|
||||
#include "component/view/CompositeView.h"
|
||||
#include "component/view/GraphView.h"
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "component/ComponentFactory.h"
|
||||
|
||||
class CompositeView;
|
||||
class NetworkFactory;
|
||||
class StorageAccess;
|
||||
class View;
|
||||
class ViewFactory;
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#include "IDECommunicationController.h"
|
||||
|
||||
#include "utility/messaging/type/MessageActivateTokens.h"
|
||||
#include "utility/logging/logging.h"
|
||||
|
||||
#include "component/controller/helper/NetworkProtocolHelper.h"
|
||||
|
||||
IDECommunicationController::IDECommunicationController()
|
||||
{
|
||||
}
|
||||
|
||||
IDECommunicationController::~IDECommunicationController()
|
||||
{
|
||||
}
|
||||
|
||||
void IDECommunicationController::handleIncomingMessage(const std::string& message)
|
||||
{
|
||||
LOG_WARNING_STREAM(<< message);
|
||||
|
||||
NetworkProtocolHelper::NetworkMessage parsedMessage = NetworkProtocolHelper::parseMessage(message);
|
||||
|
||||
if (parsedMessage.valid)
|
||||
{
|
||||
// TODO: set active token
|
||||
}
|
||||
}
|
||||
|
||||
void IDECommunicationController::handleMessage(MessageMoveIDECursor* message)
|
||||
{
|
||||
std::string networkMessage = NetworkProtocolHelper::buildMessage(message->FilePosition, message->Row, message->Column);
|
||||
|
||||
sendMessage(networkMessage);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef IDE_COMMUNICATION_CONTROLLER_H
|
||||
#define IDE_COMMUNICATION_CONTROLLER_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "utility/messaging/MessageListener.h"
|
||||
#include "utility/messaging/type/MessageMoveIDECursor.h"
|
||||
|
||||
#include "component/controller/Controller.h"
|
||||
|
||||
class IDECommunicationController
|
||||
: public Controller
|
||||
, public MessageListener<MessageMoveIDECursor>
|
||||
{
|
||||
public:
|
||||
IDECommunicationController();
|
||||
virtual ~IDECommunicationController();
|
||||
|
||||
void handleIncomingMessage(const std::string& message);
|
||||
|
||||
private:
|
||||
virtual void handleMessage(MessageMoveIDECursor* message);
|
||||
virtual void sendMessage(const std::string& message) const = 0;
|
||||
};
|
||||
|
||||
#endif // IDE_COMMUNICATION_CONTROLLER_H
|
||||
@@ -0,0 +1,9 @@
|
||||
#include "component/controller/NetworkFactory.h"
|
||||
|
||||
NetworkFactory::NetworkFactory()
|
||||
{
|
||||
}
|
||||
|
||||
NetworkFactory::~NetworkFactory()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef NETWORK_FACTORY_H
|
||||
#define NETWORK_FACTORY_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
class IDECommunicationController;
|
||||
|
||||
class NetworkFactory
|
||||
{
|
||||
public:
|
||||
NetworkFactory();
|
||||
virtual ~NetworkFactory();
|
||||
|
||||
virtual std::shared_ptr<IDECommunicationController> createIDECommunicationController() const = 0;
|
||||
};
|
||||
|
||||
#endif // NETWORK_FACTORY_H
|
||||
@@ -2,12 +2,14 @@
|
||||
|
||||
#include "component/view/GraphViewStyle.h"
|
||||
|
||||
unsigned int GraphPostprocessor::s_cellSize = GraphViewStyle::s_gridCellSize;
|
||||
unsigned int GraphPostprocessor::s_cellWidth = GraphViewStyle::s_gridCellSize;
|
||||
unsigned int GraphPostprocessor::s_cellHeight = GraphViewStyle::s_gridCellSize;
|
||||
unsigned int GraphPostprocessor::s_cellPadding = GraphViewStyle::s_gridCellPadding;
|
||||
|
||||
void GraphPostprocessor::doPostprocessing(std::vector<DummyNode>& nodes)
|
||||
{
|
||||
unsigned int atomarGridSize = s_cellSize;
|
||||
unsigned int atomarGridWidth = s_cellWidth;
|
||||
unsigned int atomarGridHeight = s_cellHeight;
|
||||
|
||||
if (nodes.size() < 2)
|
||||
{
|
||||
@@ -16,42 +18,43 @@ void GraphPostprocessor::doPostprocessing(std::vector<DummyNode>& nodes)
|
||||
}
|
||||
|
||||
// determine center of mass (CoD) which is used to get outliers closer to the rest of the graph
|
||||
int divisor = 999999;
|
||||
int maxNodeSize = 0;
|
||||
int divisorWidth = 999999;
|
||||
int divisorHeight = 999999;
|
||||
int maxNodeWidth = 0;
|
||||
int maxNodeHeight = 0;
|
||||
Vec2i centerOfMass(0, 0);
|
||||
float totalMass = 0.0f;
|
||||
|
||||
for (const DummyNode& node : nodes)
|
||||
{
|
||||
const Vec2i& size = node.size;
|
||||
|
||||
if (size.x < divisor)
|
||||
if (node.size.x < divisorWidth)
|
||||
{
|
||||
divisor = size.x;
|
||||
divisorWidth = node.size.x;
|
||||
}
|
||||
|
||||
if (size.y < divisor)
|
||||
if (node.size.y < divisorHeight)
|
||||
{
|
||||
divisor = size.y;
|
||||
divisorHeight = node.size.y;
|
||||
}
|
||||
|
||||
if (size.x > maxNodeSize)
|
||||
if (node.size.x > maxNodeWidth)
|
||||
{
|
||||
maxNodeSize = size.x;
|
||||
maxNodeWidth = node.size.x;
|
||||
}
|
||||
else if (size.y > maxNodeSize)
|
||||
else if (node.size.y > maxNodeHeight)
|
||||
{
|
||||
maxNodeSize = size.y;
|
||||
maxNodeHeight = node.size.y;
|
||||
}
|
||||
|
||||
float nodeMass = size.getLengthSquared();
|
||||
float nodeMass = node.size.x * node.size.y;
|
||||
centerOfMass += node.position * nodeMass;
|
||||
totalMass += nodeMass;
|
||||
}
|
||||
|
||||
centerOfMass /= totalMass;
|
||||
|
||||
divisor = (int)atomarGridSize + s_cellPadding; //std::min(divisor, (int)atomarGridSize);
|
||||
divisorWidth = (int)atomarGridWidth + s_cellPadding; //std::min(divisor, (int)atomarGridSize);
|
||||
divisorHeight = (int)atomarGridHeight + s_cellPadding;
|
||||
|
||||
resolveOutliers(nodes, centerOfMass);
|
||||
|
||||
@@ -62,9 +65,9 @@ void GraphPostprocessor::doPostprocessing(std::vector<DummyNode>& nodes)
|
||||
alignNodeOnRaster(node);
|
||||
}
|
||||
|
||||
MatrixDynamicBase<unsigned int> heatMap = buildHeatMap(nodes, divisor, maxNodeSize);
|
||||
MatrixDynamicBase<unsigned int> heatMap = buildHeatMap(nodes, divisorWidth, divisorHeight, maxNodeWidth, maxNodeHeight);
|
||||
|
||||
resolveOverlap(nodes, heatMap, divisor);
|
||||
resolveOverlap(nodes, heatMap, divisorWidth, divisorHeight);
|
||||
}
|
||||
|
||||
void GraphPostprocessor::alignNodeOnRaster(DummyNode& node)
|
||||
@@ -74,7 +77,7 @@ void GraphPostprocessor::alignNodeOnRaster(DummyNode& node)
|
||||
|
||||
Vec2i GraphPostprocessor::alignOnRaster(Vec2i position)
|
||||
{
|
||||
int rasterPosDivisor = s_cellSize + s_cellPadding;
|
||||
int rasterPosDivisor = s_cellWidth + s_cellPadding;
|
||||
|
||||
if (position.x % rasterPosDivisor != 0)
|
||||
{
|
||||
@@ -148,20 +151,17 @@ void GraphPostprocessor::resolveOutliers(std::vector<DummyNode>& nodes, const Ve
|
||||
}
|
||||
|
||||
MatrixDynamicBase<unsigned int> GraphPostprocessor::buildHeatMap(
|
||||
const std::vector<DummyNode>& nodes, const int atomarNodeSize, const int maxNodeSize
|
||||
){
|
||||
// theoretically the nodes could horizontally or vertically far from the center, therefore '*5' (it's kinda arbitrary,
|
||||
// generally *2 should suffice, I use *5 to prevent problems in extrem cases)
|
||||
int heatMapWidth = (maxNodeSize * nodes.size() / atomarNodeSize) * 5;
|
||||
int heatMapHeight = heatMapWidth;
|
||||
const std::vector<DummyNode>& nodes, const int atomarNodeWidth, const int atomarNodeHeight, const int maxNodeWidth, const int maxNodeHeight)
|
||||
{
|
||||
int heatMapWidth = (maxNodeWidth * nodes.size() / atomarNodeWidth) * 5; // theoretically the nodes could horizontally or vertically far from the center, therefore '*5' (it's kinda arbitrary, generally *2 should suffice, I use *5 to prevent problems in extrem cases)
|
||||
int heatMapHeight = (maxNodeHeight * nodes.size() / atomarNodeHeight) * 5;
|
||||
|
||||
MatrixDynamicBase<unsigned int> heatMap(heatMapWidth, heatMapHeight);
|
||||
|
||||
for (const DummyNode& node : nodes)
|
||||
{
|
||||
int left = node.position.x / atomarNodeSize + heatMapWidth / 2;
|
||||
int up = node.position.y / atomarNodeSize + heatMapHeight / 2;
|
||||
|
||||
int left = node.position.x / atomarNodeWidth + heatMapWidth/2;
|
||||
int up = node.position.y / atomarNodeHeight + heatMapHeight/2;
|
||||
Vec2i size = calculateRasterNodeSize(node);
|
||||
int width = size.x;
|
||||
int height = size.y;
|
||||
@@ -193,8 +193,8 @@ MatrixDynamicBase<unsigned int> GraphPostprocessor::buildHeatMap(
|
||||
}
|
||||
|
||||
void GraphPostprocessor::resolveOverlap(
|
||||
std::vector<DummyNode>& nodes, MatrixDynamicBase<unsigned int>& heatMap, const int divisor
|
||||
){
|
||||
std::vector<DummyNode>& nodes, MatrixDynamicBase<unsigned int>& heatMap, const int divisorWidth, const int divisorHeight)
|
||||
{
|
||||
int heatMapWidth = heatMap.getColumnsCount();
|
||||
int heatMapHeight = heatMap.getRowsCount();
|
||||
|
||||
@@ -211,9 +211,9 @@ void GraphPostprocessor::resolveOverlap(
|
||||
|
||||
for (DummyNode& node : nodes)
|
||||
{
|
||||
Vec2i nodePos;
|
||||
nodePos.x = node.position.x / divisor + heatMapWidth / 2;
|
||||
nodePos.y = node.position.y / divisor + heatMapHeight / 2;
|
||||
Vec2i nodePos(0, 0);
|
||||
nodePos.x = node.position.x / divisorWidth + heatMapWidth/2;
|
||||
nodePos.y = node.position.y / divisorHeight + heatMapHeight/2;
|
||||
Vec2i nodeSize = calculateRasterNodeSize(node);
|
||||
|
||||
if (nodePos.x + nodeSize.x > heatMapWidth || nodePos.x < 0)
|
||||
@@ -254,28 +254,29 @@ void GraphPostprocessor::resolveOverlap(
|
||||
modifyHeatmapArea(heatMap, nodePos, nodeSize, -1);
|
||||
|
||||
// move node to new position
|
||||
int xOffset = grad.x * divisor;
|
||||
int yOffset = grad.y * divisor;
|
||||
int xOffset = grad.x * divisorWidth;
|
||||
int yOffset = grad.y * divisorHeight;
|
||||
|
||||
|
||||
int maxOffset = 2 * divisor;
|
||||
int maxXOffset = 2*divisorWidth;
|
||||
int maxYOffset = 2*divisorHeight;
|
||||
|
||||
// prevent the graph from "exploding" again...
|
||||
if (xOffset > maxOffset)
|
||||
if (xOffset > maxXOffset)
|
||||
{
|
||||
xOffset = maxOffset;
|
||||
xOffset = maxXOffset;
|
||||
}
|
||||
else if (xOffset < -maxOffset)
|
||||
else if (xOffset < -maxXOffset)
|
||||
{
|
||||
xOffset = -maxOffset;
|
||||
xOffset = -maxXOffset;
|
||||
}
|
||||
|
||||
if (yOffset > maxOffset)
|
||||
if (yOffset > maxYOffset)
|
||||
{
|
||||
yOffset = maxOffset;
|
||||
yOffset = maxYOffset;
|
||||
}
|
||||
else if (yOffset < -maxOffset)
|
||||
else if (yOffset < -maxYOffset)
|
||||
{
|
||||
yOffset = -maxOffset;
|
||||
yOffset = -maxYOffset;
|
||||
}
|
||||
|
||||
node.position += Vec2i(xOffset, yOffset);
|
||||
@@ -283,8 +284,8 @@ void GraphPostprocessor::resolveOverlap(
|
||||
alignNodeOnRaster(node);
|
||||
|
||||
// re-add node to heat map at new position
|
||||
nodePos.x = node.position.x / divisor + heatMapWidth / 2;
|
||||
nodePos.y = node.position.y / divisor + heatMapHeight / 2;
|
||||
nodePos.x = node.position.x / divisorWidth + heatMapWidth/2;
|
||||
nodePos.y = node.position.y / divisorHeight + heatMapHeight/2;
|
||||
|
||||
modifyHeatmapArea(heatMap, nodePos, nodeSize, 1);
|
||||
|
||||
@@ -442,8 +443,8 @@ Vec2i GraphPostprocessor::calculateRasterNodeSize(const DummyNode& node)
|
||||
|
||||
while (size.x > 0)
|
||||
{
|
||||
size.x = size.x - s_cellSize;
|
||||
if (size.x > 0)
|
||||
size.x = size.x - s_cellWidth;
|
||||
if(size.x > 0)
|
||||
{
|
||||
size.x = size.x - s_cellPadding;
|
||||
}
|
||||
@@ -453,8 +454,8 @@ Vec2i GraphPostprocessor::calculateRasterNodeSize(const DummyNode& node)
|
||||
|
||||
while (size.y > 0)
|
||||
{
|
||||
size.y = size.y - s_cellSize;
|
||||
if (size.y > 0)
|
||||
size.y = size.y - s_cellHeight;
|
||||
if(size.y > 0)
|
||||
{
|
||||
size.y = size.y - s_cellPadding;
|
||||
}
|
||||
|
||||
@@ -17,12 +17,14 @@ public:
|
||||
static Vec2i alignOnRaster(Vec2i position);
|
||||
|
||||
private:
|
||||
static unsigned int s_cellSize;
|
||||
static unsigned int s_cellWidth;
|
||||
static unsigned int s_cellHeight;
|
||||
static unsigned int s_cellPadding;
|
||||
|
||||
static MatrixDynamicBase<unsigned int> buildHeatMap(const std::vector<DummyNode>& nodes, const int atomarNodeSize, const int maxNodeSize);
|
||||
static MatrixDynamicBase<unsigned int> buildHeatMap(const std::vector<DummyNode>& nodes, const int atomarNodeWidth, const int atomarNodeHeight, const int maxNodeWidth, const int maxNodeHeight);
|
||||
static void resolveOutliers(std::vector<DummyNode>& nodes, const Vec2i& centerPoint);
|
||||
static void resolveOverlap(std::vector<DummyNode>& nodes, MatrixDynamicBase<unsigned int>& heatMap, const int divisor);
|
||||
static void resolveOverlap(std::vector<DummyNode>& nodes, MatrixDynamicBase<unsigned int>& heatMap, const int divisorWidth, const int divisorHeight);
|
||||
|
||||
static void modifyHeatmapArea(MatrixDynamicBase<unsigned int>& heatMap, const Vec2i& leftUpperCorner, const Vec2i& size, const int modifier);
|
||||
static bool getHeatmapGradient(Vec2f& outGradient, const MatrixDynamicBase<unsigned int>& heatMap, const Vec2i& leftUpperCorner, const Vec2i& size);
|
||||
static Vec2f heatMapRayCast(const MatrixDynamicBase<unsigned int>& heatMap, const Vec2f& startPosition, const Vec2f& direction, unsigned int minValue);
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
#include "NetworkProtocolHelper.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
std::string NetworkProtocolHelper::m_divider = ">>";
|
||||
std::string NetworkProtocolHelper::m_setActiveTokenPrefix = "setActiveToken";
|
||||
std::string NetworkProtocolHelper::m_moveCursorPrefix = "moveCursor";
|
||||
std::string NetworkProtocolHelper::m_endOfMessageToken = "<EOM>";
|
||||
|
||||
NetworkProtocolHelper::NetworkMessage NetworkProtocolHelper::parseMessage(const std::string& message)
|
||||
{
|
||||
NetworkMessage networkMessage;
|
||||
|
||||
std::string tmpMessage = removeEndOfMessageToken(message);
|
||||
|
||||
size_t pos = tmpMessage.find(m_setActiveTokenPrefix);
|
||||
|
||||
if(pos != std::string::npos)
|
||||
{
|
||||
tmpMessage = "";
|
||||
getSubstringAfterString(message, m_divider, tmpMessage); // just get rid of message type
|
||||
|
||||
std::string fileLocation = getSubstringAfterString(tmpMessage, m_divider, tmpMessage);
|
||||
std::string row = getSubstringAfterString(tmpMessage, m_divider, tmpMessage);
|
||||
std::string column = tmpMessage; // getSubstringAfterString(tmpMessage, "", tmpMessage); // there should be nothing left in the message but the column number
|
||||
|
||||
if(fileLocation.length() <= 0
|
||||
|| row.length() <= 0
|
||||
|| column.length() <= 0
|
||||
|| isDigits(row) == false
|
||||
|| isDigits(column) == false)
|
||||
{
|
||||
return networkMessage;
|
||||
}
|
||||
else
|
||||
{
|
||||
networkMessage.fileLocation = fileLocation;
|
||||
networkMessage.row = std::stoi(row);
|
||||
networkMessage.column = std::stoi(column);
|
||||
networkMessage.valid = true;
|
||||
}
|
||||
}
|
||||
|
||||
return networkMessage;
|
||||
}
|
||||
|
||||
std::string NetworkProtocolHelper::buildMessage(const std::string& fileLocation, const unsigned int row, const unsigned int column)
|
||||
{
|
||||
std::stringstream messageStream;
|
||||
|
||||
messageStream << m_moveCursorPrefix;
|
||||
messageStream << m_divider;
|
||||
messageStream << fileLocation;
|
||||
messageStream << m_divider;
|
||||
messageStream << row;
|
||||
messageStream << m_divider;
|
||||
messageStream << column;
|
||||
messageStream << m_endOfMessageToken;
|
||||
|
||||
return messageStream.str();
|
||||
}
|
||||
|
||||
std::string NetworkProtocolHelper::removeEndOfMessageToken(const std::string& message)
|
||||
{
|
||||
size_t pos = message.find(m_endOfMessageToken);
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
return message.substr(0, pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
return message;
|
||||
}
|
||||
}
|
||||
|
||||
std::string NetworkProtocolHelper::getSubstringAfterString(const std::string& message, const std::string& searchString, std::string& subMessage)
|
||||
{
|
||||
std::string result = "";
|
||||
|
||||
size_t pos = message.find(searchString);
|
||||
|
||||
if(pos != std::string::npos)
|
||||
{
|
||||
result = message.substr(0, pos);
|
||||
subMessage = message.substr(pos + searchString.length());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool NetworkProtocolHelper::isDigits(const std::string& text)
|
||||
{
|
||||
return (text.find_first_not_of("0123456789") == std::string::npos);
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
#ifndef NETWORK_PROTOCOL_HELPER_H
|
||||
#define NETWORK_PROTOCOL_HELPER_H
|
||||
|
||||
#include <string>
|
||||
|
||||
class NetworkProtocolHelper
|
||||
{
|
||||
public:
|
||||
struct NetworkMessage
|
||||
{
|
||||
public:
|
||||
NetworkMessage()
|
||||
: fileLocation("")
|
||||
, row(0)
|
||||
, column(0)
|
||||
, valid(false)
|
||||
{}
|
||||
|
||||
std::string fileLocation;
|
||||
unsigned int row;
|
||||
unsigned int column;
|
||||
bool valid;
|
||||
};
|
||||
|
||||
static NetworkMessage parseMessage(const std::string& message);
|
||||
static std::string buildMessage(const std::string& fileLocation, const unsigned int row, const unsigned int column);
|
||||
|
||||
private:
|
||||
static std::string removeEndOfMessageToken(const std::string& message);
|
||||
|
||||
static std::string getSubstringAfterString(const std::string& message, const std::string& searchString, std::string& subMessage);
|
||||
static bool isDigits(const std::string& text);
|
||||
|
||||
static std::string m_divider;
|
||||
static std::string m_setActiveTokenPrefix;
|
||||
static std::string m_moveCursorPrefix;
|
||||
static std::string m_endOfMessageToken;
|
||||
};
|
||||
|
||||
#endif // NETWORK_PROTOCOL_HELPER_H
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef MESSAGE_MOVE_IDE_CURSOR_H
|
||||
#define MESSAGE_MOVE_IDE_CURSOR_H
|
||||
|
||||
#include "utility/messaging/Message.h"
|
||||
|
||||
class MessageMoveIDECursor : public Message<MessageMoveIDECursor>
|
||||
{
|
||||
public:
|
||||
MessageMoveIDECursor(const std::string& FilePos, const unsigned int Row, const unsigned int Column)
|
||||
: FilePosition(FilePos)
|
||||
, Row(Row)
|
||||
, Column(Column)
|
||||
{
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
{
|
||||
return "MessageMoveIDECursor";
|
||||
}
|
||||
|
||||
const std::string FilePosition;
|
||||
const unsigned int Row;
|
||||
const unsigned int Column;
|
||||
};
|
||||
|
||||
#endif // MESSAGE_MOVE_IDE_CURSOR_H
|
||||
@@ -20,6 +20,7 @@ add_files(
|
||||
LogManagerTestSuite.h
|
||||
MatrixBaseTestSuite.h
|
||||
MessageQueueTestSuite.h
|
||||
NetworkProtocolHelperTestSuite.h
|
||||
SettingsTestSuite.h
|
||||
SearchIndexTestSuite.h
|
||||
SqliteStorageTestSuite.h
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
#include <cxxtest/TestSuite.h>
|
||||
|
||||
#include "component/controller/helper/NetworkProtocolHelper.h"
|
||||
|
||||
class NetworkProtocolHelperTestSuite : public CxxTest::TestSuite
|
||||
{
|
||||
public:
|
||||
void test_parse_message(void)
|
||||
{
|
||||
std::string type = "setActiveToken";
|
||||
std::string divider = ">>";
|
||||
std::string filePath = "C:\\Users\\Manuel\\imporant\\file\\location\\fileName.cpp";
|
||||
int row = 1;
|
||||
int column = 2;
|
||||
|
||||
// valid message
|
||||
std::stringstream message;
|
||||
message << type << divider << filePath << divider << row << divider << column;
|
||||
|
||||
NetworkProtocolHelper::NetworkMessage networkMessage = NetworkProtocolHelper::parseMessage(message.str());
|
||||
|
||||
TS_ASSERT_EQUALS(networkMessage.fileLocation, filePath);
|
||||
TS_ASSERT_EQUALS(networkMessage.row, row);
|
||||
TS_ASSERT_EQUALS(networkMessage.column, column);
|
||||
|
||||
// invalid type
|
||||
message.str("");
|
||||
message << "foo" << divider << filePath << divider << row << divider << column;
|
||||
networkMessage = NetworkProtocolHelper::parseMessage(message.str());
|
||||
|
||||
TS_ASSERT_EQUALS(networkMessage.fileLocation, "");
|
||||
TS_ASSERT_EQUALS(networkMessage.row, 0);
|
||||
TS_ASSERT_EQUALS(networkMessage.column, 0);
|
||||
|
||||
// missing divider
|
||||
message.str("");
|
||||
message << type << divider << filePath << row << divider << column;
|
||||
networkMessage = NetworkProtocolHelper::parseMessage(message.str());
|
||||
|
||||
TS_ASSERT_EQUALS(networkMessage.fileLocation, "");
|
||||
TS_ASSERT_EQUALS(networkMessage.row, 0);
|
||||
TS_ASSERT_EQUALS(networkMessage.column, 0);
|
||||
|
||||
// invalid row
|
||||
message.str("");
|
||||
message << type << divider << filePath << divider << "potato" << divider << column;
|
||||
networkMessage = NetworkProtocolHelper::parseMessage(message.str());
|
||||
|
||||
TS_ASSERT_EQUALS(networkMessage.fileLocation, "");
|
||||
TS_ASSERT_EQUALS(networkMessage.row, 0);
|
||||
TS_ASSERT_EQUALS(networkMessage.column, 0);
|
||||
|
||||
// invalid column
|
||||
message.str("");
|
||||
message << type << divider << filePath << divider << row << divider << "laz0r";
|
||||
networkMessage = NetworkProtocolHelper::parseMessage(message.str());
|
||||
|
||||
TS_ASSERT_EQUALS(networkMessage.fileLocation, "");
|
||||
TS_ASSERT_EQUALS(networkMessage.row, 0);
|
||||
TS_ASSERT_EQUALS(networkMessage.column, 0);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user