summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorasanoaozora <fifitaneki@hotmail.com>2017-08-17 16:48:37 +0200
committerasanoaozora <fifitaneki@hotmail.com>2017-08-17 16:48:37 +0200
commitfaed34d71ab44536cc077a6a6edf9e6903e40c1f (patch)
tree2f1c731d93e5b256748b9bb37212a53519ed9a71 /src
parent14e7e553b2391915b50b2b990bf0d5a959fd5d01 (diff)
downloadpoi-service-faed34d71ab44536cc077a6a6edf9e6903e40c1f.tar.gz
improve test scripts and align to latest navit version
Diffstat (limited to 'src')
-rw-r--r--src/navigation/README.md19
-rwxr-xr-xsrc/navigation/build.sh22
-rwxr-xr-xsrc/navigation/clone_and_build.sh54
-rw-r--r--src/navigation/map-viewer/mapviewercontrol-plugin/genivi_mapviewer_mapviewercontrol.cxx24
-rw-r--r--src/navigation/navigation-core/routing-plugin/genivi_navigationcore_routing.cxx2
-rwxr-xr-xsrc/navigation/run5
-rwxr-xr-xsrc/navigation/update_positioning.sh23
-rwxr-xr-xsrc/navigation/update_third_party.sh27
8 files changed, 95 insertions, 81 deletions
diff --git a/src/navigation/README.md b/src/navigation/README.md
index 47270a0..1a2f4fe 100644
--- a/src/navigation/README.md
+++ b/src/navigation/README.md
@@ -23,8 +23,8 @@ sudo apt-get install xsltproc libdbus-cpp-dev libdbus-c++-dev libglib2.0-dev gtk
## How to build
### From scratch
-A script allows to clone the third parties code (i.e. positioning and navit) and rebuild all
-./clone_and_build.sh
+A script allows to clone the third parties code (i.e. positioning and navit)
+./update_third_party.sh
### Build
A script allows either:
to clean and rebuild all (including invoking cmake)
@@ -32,21 +32,30 @@ to clean and rebuild all (including invoking cmake)
or to build updated parts
./build.sh
+There are other options available, please enter ./build.sh -h to display it
+
## How to test
Some python scripts can be used for test.
-Go to ../../test/navigation
+Go to ../../test/navigation/script
For Python, you need to install some modules
sudo apt-get install python-pip python-dbus python-gobject python-pil
sudo pip install --upgrade pip
To test, launch the navigation middleware by entering:
-../../src/navigation/run -r
+../../src/navigation/run -r -p
and the test batch:
./test-all
If everything is OK, you must see:
-Test PASSED
+Test poi search PASSED
+Test location input PASSED
+Test route calculation PASSED
+Test address input PASSED
+Test guidance PASSED
+Test map viewer PASSED
+Batch test PASSED
+
### How to test for Tokyo area (draft)
It's also possible to launch test for Japan.
diff --git a/src/navigation/build.sh b/src/navigation/build.sh
index 5277477..952cbe2 100755
--- a/src/navigation/build.sh
+++ b/src/navigation/build.sh
@@ -102,24 +102,24 @@ done
if [ "$clean" = 1 ] && [ -d "./build" ]
then
echo 'clean up navigation and positioning'
- rm ./build/CMakeCache.txt
- rm ./build/cmake_install.cmake
- rm ./build/Makefile
- rm ./build/positioning/cmake_install.cmake
- rm ./build/positioning/Makefile
+ rm -f ./build/CMakeCache.txt
+ rm -f ./build/cmake_install.cmake
+ rm -f ./build/Makefile
+ rm -f ./build/positioning/cmake_install.cmake
+ rm -f ./build/positioning/Makefile
if [ "$navit" = 1 ]
then
echo 'clean up navit'
- rm ./build/navit/CMakeCache.txt
- rm ./build/navit/cmake_install.cmake
- rm ./build/navit/Makefile
+ rm -f ./build/navit/CMakeCache.txt
+ rm -f ./build/navit/cmake_install.cmake
+ rm -f ./build/navit/Makefile
fi
if [ "$poi" = 1 ] && [ -d "../poi-service/build" ]
then
echo 'clean up poi'
- rm ../poi-service/build/CMakeCache.txt
- rm ../poi-service/build/cmake_install.cmake
- rm ../poi-service/build/Makefile
+ rm -f ../poi-service/build/CMakeCache.txt
+ rm -f ../poi-service/build/cmake_install.cmake
+ rm -f ../poi-service/build/Makefile
fi
fi
diff --git a/src/navigation/clone_and_build.sh b/src/navigation/clone_and_build.sh
deleted file mode 100755
index 49ed34e..0000000
--- a/src/navigation/clone_and_build.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/bash
-
-build_option=""
-positioning_version='9725fe1f553197042d6445997690d452a73490c0'
-navit_version='1e71b5fd4c0bf5ac96e5207c51db7d17057ed798'
-
-echo "version of positioning is: $positioning_version"
-echo "version of navit is: $navit_version"
-
-echo -n "This script deletes, reloads and builds everything, are you sure ? (y or n) "
-read input
-
-if [ ! "$input" = 'y' ]
-then
- exit 1
-fi
-
-while getopts m opt
-do
- case $opt in
- m)
- build_option="-m"
- ;;
- \?)
- echo "Usage:"
- echo "$0 [-m]"
- echo "-m: build with commonAPI plugins "
- exit 1
- esac
-done
-
-
-if [ -d "./build" ]
-then
- find ./build ! -name '*.cbp' -type f -exec rm -f {} +
-fi
-rm -rf navit
-rm -rf positioning
-
-git clone https://github.com/GENIVI/positioning.git ./positioning
-cd positioning
-git checkout $positioning_version
-cd ..
-git clone https://github.com/navit-gps/navit.git
-cd navit
-git checkout $navit_version
-patch -p0 -i ../patches/search_list_get_unique.diff
-patch -p0 -i ../patches/fsa_issue_padding.diff
-cd ..
-
-./build.sh -c $build_option
-
-
-
diff --git a/src/navigation/map-viewer/mapviewercontrol-plugin/genivi_mapviewer_mapviewercontrol.cxx b/src/navigation/map-viewer/mapviewercontrol-plugin/genivi_mapviewer_mapviewercontrol.cxx
index 56c2bd1..a26583a 100644
--- a/src/navigation/map-viewer/mapviewercontrol-plugin/genivi_mapviewer_mapviewercontrol.cxx
+++ b/src/navigation/map-viewer/mapviewercontrol-plugin/genivi_mapviewer_mapviewercontrol.cxx
@@ -612,9 +612,12 @@ class MapViewerControl
SetCameraTiltAngle(const uint32_t& sessionHandle, const uint32_t& mapViewInstanceHandle, const int32_t& tilt)
{
MapViewerControlObj *obj=handles[mapViewInstanceHandle];
- if (!obj)
+ if (!obj){
throw DBus::ErrorInvalidArgs("Invalid mapviewinstance handle");
- else obj->SetCameraTiltAngle(sessionHandle, tilt);
+ }else{
+ obj->SetCameraTiltAngle(sessionHandle, tilt);
+ CameraTiltAngleChanged(mapViewInstanceHandle,tilt);
+ }
}
int32_t
@@ -652,9 +655,12 @@ class MapViewerControl
SetCameraDistanceFromTargetPoint(const uint32_t& sessionHandle, const uint32_t& mapViewInstanceHandle, const uint32_t& distance)
{
MapViewerControlObj *obj=handles[mapViewInstanceHandle];
- if (!obj)
- throw DBus::ErrorInvalidArgs("Invalid mapviewinstance handle");
- else obj->SetCameraDistanceFromTargetPoint(sessionHandle, distance);
+ if (!obj){
+ throw DBus::ErrorInvalidArgs("Invalid mapviewinstance handle");
+ }else{
+ obj->SetCameraDistanceFromTargetPoint(sessionHandle, distance);
+ CameraDistanceFromTargetPointChanged(mapViewInstanceHandle,distance);
+ }
}
@@ -691,9 +697,11 @@ class MapViewerControl
SetCameraHeight(const uint32_t& sessionHandle, const uint32_t& mapViewInstanceHandle, const uint32_t& height)
{
MapViewerControlObj *obj=handles[mapViewInstanceHandle];
- if (!obj)
- throw DBus::ErrorInvalidArgs("Invalid mapviewinstance handle");
- else obj->SetCameraHeight(sessionHandle, height);
+ if (!obj){
+ throw DBus::ErrorInvalidArgs("Invalid mapviewinstance handle");
+ }else{
+ obj->SetCameraHeight(sessionHandle, height);
+ }
}
uint32_t
diff --git a/src/navigation/navigation-core/routing-plugin/genivi_navigationcore_routing.cxx b/src/navigation/navigation-core/routing-plugin/genivi_navigationcore_routing.cxx
index 390f6a7..d2cc16f 100644
--- a/src/navigation/navigation-core/routing-plugin/genivi_navigationcore_routing.cxx
+++ b/src/navigation/navigation-core/routing-plugin/genivi_navigationcore_routing.cxx
@@ -146,7 +146,6 @@ class Routing
void
CreateRoute(const uint32_t& sessionHandle, int32_t& error, uint32_t& routeHandle)
{
- LOG_INFO_MSG(gCtx,"Create route");
routeHandle=1;
while (handles[routeHandle]) {
routeHandle++;
@@ -154,6 +153,7 @@ class Routing
throw DBus::ErrorLimitsExceeded("Out of route handles");
}
handles[routeHandle]=new RoutingObj(this, sessionHandle, routeHandle);
+ LOG_INFO_MSG(gCtx,"Route created");
error=0; //not implemented yet
}
diff --git a/src/navigation/run b/src/navigation/run
index 1c7c19f..7495691 100755
--- a/src/navigation/run
+++ b/src/navigation/run
@@ -104,7 +104,7 @@ POI_SERVER_RESOURCE_DIR=$CUR_DIR/../../src/poi-service/resource
poidatabase=$POI_SERVER_RESOURCE_DIR/empty.db # empty poi database by default
-while getopts c:gnoprvx opt
+while getopts c:ghnoprvx opt
do
case $opt in
c)
@@ -145,11 +145,12 @@ do
x)
xterm=1
;;
- \?)
+ h)
echo "Usage:"
echo "$0 [-c center][-gnoprvx]"
echo "-c: Set center (supported values: paris,tokyo,longitude,latitude). Default is geneve"
echo "-g: Run subprocesses within gdb (only with -x)"
+ echo "-h: This help"
echo "-n: Don't start enhanced-position-service"
echo "-r: Don't start replayer"
echo "-o: Create log file of subprocess output"
diff --git a/src/navigation/update_positioning.sh b/src/navigation/update_positioning.sh
new file mode 100755
index 0000000..9fab24b
--- /dev/null
+++ b/src/navigation/update_positioning.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+if [ $# -eq 0 ]
+ then
+ echo "Need positioning commit version"
+ exit
+fi
+
+positioning_version=$1
+
+if [ -d "./build" ]
+then
+ find ./build/positioning ! -name '*.cbp' -type f -exec rm -f {} +
+fi
+
+rm -rf positioning
+
+git clone https://github.com/GENIVI/positioning.git ./positioning
+cd positioning
+git checkout $positioning_version
+cd ..
+
+
diff --git a/src/navigation/update_third_party.sh b/src/navigation/update_third_party.sh
new file mode 100755
index 0000000..a8b0dab
--- /dev/null
+++ b/src/navigation/update_third_party.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+build_option=""
+positioning_version='9725fe1f553197042d6445997690d452a73490c0'
+navit_version='28478e7f26c1a0eedc06fb4765e2f736079c6f0c'
+
+echo "version of positioning is: $positioning_version"
+echo "version of navit is: $navit_version"
+
+echo "This script deletes and reloads all the third party software"
+read -r -p "Are you sure ? [y/N] " input
+
+case "$input" in
+ [y/Y])
+ ./update_navit $navit_version
+ ./update_positioning $positioning_version
+ echo "Please rebuild with at least -c option"
+ ;;
+ *)
+ exit 1
+ ;;
+esac
+
+
+
+
+