From f4996c391623825384dcb7e1345b354142ed3b9f Mon Sep 17 00:00:00 2001 From: Ramasamy Date: Thu, 12 Nov 2015 19:39:12 +0900 Subject: [PATCH] Fixing issues related to loading virtual sensors - fixing loader file for virtual sensors - cleanup Change-Id: Id290de293f8090a15790aaf94ee22e7aa6d93797 --- .gitignore | 2 ++ src/server/plugins/CMakeLists.txt | 28 +++++++++----------------- src/server/plugins/sensor_module_create.cpp.in | 5 ++++- 3 files changed, 15 insertions(+), 20 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..47bd4b3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.project +.cproject \ No newline at end of file diff --git a/src/server/plugins/CMakeLists.txt b/src/server/plugins/CMakeLists.txt index 8ce6ea5..839e40c 100755 --- a/src/server/plugins/CMakeLists.txt +++ b/src/server/plugins/CMakeLists.txt @@ -73,56 +73,37 @@ ENDIF() IF("${ORIENTATION}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(ORIENTATION_ENABLE "1") -add_definitions(-DENABLE_SENSOR_FUSION) -add_definitions(-DENABLE_ORIENTATION) ENDIF() IF("${RV}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(RV_ENABLE "1") -add_definitions(-DENABLE_SENSOR_FUSION) -add_definitions(-DENABLE_RV) ENDIF() IF("${GEOMAGNETIC_RV}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(GEOMAGNETIC_RV_ENABLE "1") -add_definitions(-DENABLE_SENSOR_FUSION) -add_definitions(-DENABLE_GEOMAGNETIC_RV) ENDIF() IF("${GAMING_RV}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(GAMING_RV_ENABLE "1") -add_definitions(-DENABLE_SENSOR_FUSION) -add_definitions(-DENABLE_GAMING_RV) ENDIF() IF("${TILT}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(TILT_ENABLE "1") -add_definitions(-DENABLE_SENSOR_FUSION) -add_definitions(-DENABLE_TILT) ENDIF() IF("${UNCAL_GYRO}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(UNCAL_GYRO_ENABLE "1") -add_definitions(-DENABLE_SENSOR_FUSION) -add_definitions(-DENABLE_UNCAL_GYRO) ENDIF() IF("${GRAVITY}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(ORIENTATION_ENABLE "1") set(GRAVITY_ENABLE "1") -add_definitions(-DENABLE_SENSOR_FUSION) -add_definitions(-DENABLE_ORIENTATION) -add_definitions(-DENABLE_GRAVITY) ENDIF() IF("${LINEAR_ACCEL}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(ORIENTATION_ENABLE "1") set(GRAVITY_ENABLE "1") set(LINEAR_ACCEL_ENABLE "1") -add_definitions(-DENABLE_SENSOR_FUSION) -add_definitions(-DENABLE_ORIENTATION) -add_definitions(-DENABLE_GRAVITY) -add_definitions(-DENABLE_LINEAR_ACCEL) ENDIF() IF("${SENSOR_FUSION_ENABLE}" STREQUAL "1") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/sensor_fusion) @@ -135,38 +116,47 @@ list (APPEND PLUGIN_SRCS "sensor_fusion/sensor_data.cpp") list (APPEND PLUGIN_SRCS "sensor_fusion/vector.cpp") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/fusion) list (APPEND PLUGIN_SRCS "fusion/fusion_sensor.cpp") +add_definitions(-DENABLE_SENSOR_FUSION) ENDIF() IF("${ORIENTATION_ENABLE}" STREQUAL "1") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/orientation) list (APPEND PLUGIN_SRCS "orientation/orientation_sensor.cpp") +add_definitions(-DENABLE_ORIENTATION) ENDIF() IF("${GRAVITY_ENABLE}" STREQUAL "1") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/gravity) list (APPEND PLUGIN_SRCS "gravity/gravity_sensor.cpp") +add_definitions(-DENABLE_GRAVITY) ENDIF() IF("${LINEAR_ACCEL_ENABLE}" STREQUAL "1") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/linear_accel) list (APPEND PLUGIN_SRCS "linear_accel/linear_accel_sensor.cpp") +add_definitions(-DENABLE_LINEAR_ACCEL) ENDIF() IF("${TILT_ENABLE}" STREQUAL "1") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/tilt) list (APPEND PLUGIN_SRCS "tilt/tilt_sensor.cpp") +add_definitions(-DENABLE_TILT) ENDIF() IF("${UNCAL_GYRO_ENABLE}" STREQUAL "1") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/uncal_gyro) list (APPEND PLUGIN_SRCS "uncal_gyro/uncal_gyro_sensor.cpp") +add_definitions(-DENABLE_UNCAL_GYRO) ENDIF() IF("${RV_ENABLE}" STREQUAL "1") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/rotation_vector/rv) list (APPEND PLUGIN_SRCS "rotation_vector/rv/rv_sensor.cpp") +add_definitions(-DENABLE_RV) ENDIF() IF("${GEOMAGNETIC_RV_ENABLE}" STREQUAL "1") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/rotation_vector/geomagnetic_rv) list (APPEND PLUGIN_SRCS "rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp") +add_definitions(-DENABLE_GEOMAGNETIC_RV) ENDIF() IF("${GAMING_RV_ENABLE}" STREQUAL "1") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/rotation_vector/gaming_rv) list (APPEND PLUGIN_SRCS "rotation_vector/gaming_rv/gaming_rv_sensor.cpp") +add_definitions(-DENABLE_GAMING_RV) ENDIF() IF("${RV_RAW}" STREQUAL "ON") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/rotation_vector/rv_raw) diff --git a/src/server/plugins/sensor_module_create.cpp.in b/src/server/plugins/sensor_module_create.cpp.in index 2008bb5..780461b 100644 --- a/src/server/plugins/sensor_module_create.cpp.in +++ b/src/server/plugins/sensor_module_create.cpp.in @@ -28,6 +28,9 @@ #ifdef ENABLE_BIO_LED_RED #include #endif +#ifdef ENABLE_SENSOR_FUSION +#include +#endif #ifdef ENABLE_ORIENTATION #include #endif @@ -163,7 +166,7 @@ extern "C" sensor_module* create(void) module->sensors.push_back(ultraviolet_sensor_ptr); #endif -#ifdef DENABLE_SENSOR_FUSION +#ifdef ENABLE_SENSOR_FUSION fusion_sensor *fusion_sensor_ptr = NULL; try { fusion_sensor_ptr = new(std::nothrow) fusion_sensor; -- 2.7.4