diff options
author | asanoaozora <fifitaneki@hotmail.com> | 2017-03-03 17:01:59 +0100 |
---|---|---|
committer | asanoaozora <fifitaneki@hotmail.com> | 2017-03-03 17:01:59 +0100 |
commit | 8bd9324e5e9ad4b97ea26f066ec8aea20729a95c (patch) | |
tree | 79afdd212d422c4feb62dc28a114bf2921239e25 | |
parent | 92ddc33a64a70b3f8a4c29f4b23e1edd8a97fac5 (diff) | |
download | navigation-8bd9324e5e9ad4b97ea26f066ec8aea20729a95c.tar.gz |
allow some default runtime settings by qml
-rw-r--r-- | src/README.md | 11 | ||||
-rw-r--r-- | src/hmi/qml/Core/genivi-capi.js | 16 | ||||
-rw-r--r-- | src/hmi/qml/Core/genivi-origin.js | 16 | ||||
-rw-r--r-- | src/hmi/qml/Core/gimp/gdp-theme/800x480/NavigationAppSearch.xcf | bin | 312245 -> 317239 bytes | |||
-rw-r--r-- | src/hmi/qml/Core/referenceHMI.tar.gz | bin | 1199770 -> 1199863 bytes | |||
-rw-r--r-- | src/hmi/qml/NavigationApp.qml | 11 | ||||
-rw-r--r-- | src/hmi/qml/NavigationAppSearch.qml | 6 | ||||
-rw-r--r-- | src/hmi/qml/NavigationAppSettings.qml | 4 | ||||
-rw-r--r-- | src/hmi/qml/NavigationAppTokyo.qml | 66 |
9 files changed, 109 insertions, 21 deletions
diff --git a/src/README.md b/src/README.md index acbcb73..84290c1 100644 --- a/src/README.md +++ b/src/README.md @@ -83,4 +83,13 @@ cd script ./prepare.sh -i ../hmi/qml/Core/gimp/gdp-theme/800x480 cd ../ - +##How to launch it in another area +It's possible to test it (experimental) in another area. +For instance, to locate the demo in Japan: +Get the map of Tokyo and suburbs by picking it from this site: +http://maps9.navit-project.org/api/map/?bbox=139.1,35.5,140.4,36.0×tamp=170217 +Rename the file to tokyo.bin, copy it to ./navigation/src/navigation/map +do ./build.sh -c +Launch the demo +./run -r -c tokyo -a hmi/qml/NavigationAppTokyo.qml +For sure, there's some hack to do :-) diff --git a/src/hmi/qml/Core/genivi-capi.js b/src/hmi/qml/Core/genivi-capi.js index bec5e0d..487961a 100644 --- a/src/hmi/qml/Core/genivi-capi.js +++ b/src/hmi/qml/Core/genivi-capi.js @@ -38,7 +38,7 @@ var g_mapviewer_session=["uint32",0]; var g_mapviewer_handle=["uint32",0]; var g_mapviewer_handle2=["uint32",0]; var g_poisearch_handle=["uint32",0]; -var g_lang; +var g_language,g_country,g_script; var data=new Array; data['destination']=new Array; //the destination @@ -54,7 +54,7 @@ var categoriesIdNameList; var translations=new Array; -var simulationMode=true;// simulation mode on by default +var simulationMode=false;// simulation mode off by default var showroom=false; //showroom off by default var guidance_activated=false; @@ -210,11 +210,13 @@ function time(seconds) } // Language and text -function setlang(lang) +function setlang(language,country,script) { - g_lang=lang; + g_language=language; + g_country=country; + g_script=script; translations = new Array; - Qt.include("translations/"+lang+".js"); + Qt.include("translations/"+g_language + "_" + g_country+".js"); } // Default position (for showroom mode) @@ -237,8 +239,8 @@ function setDefaultAddress(country,city,street,number) function gettext(arg) { if (!translations[arg]) { - if (g_lang) { - console.log("Translation for '" + arg + "' missing for " + g_lang); + if (g_language) { + console.log("Translation for '" + arg + "' missing for " + g_language); } return arg; } else { diff --git a/src/hmi/qml/Core/genivi-origin.js b/src/hmi/qml/Core/genivi-origin.js index 29d7cff..ea897b1 100644 --- a/src/hmi/qml/Core/genivi-origin.js +++ b/src/hmi/qml/Core/genivi-origin.js @@ -38,7 +38,7 @@ var g_mapviewer_session=["uint32",0]; var g_mapviewer_handle=["uint32",0]; var g_mapviewer_handle2=["uint32",0]; var g_poisearch_handle=["uint32",0]; -var g_lang; +var g_language,g_country,g_script; var data=new Array; data['destination']=new Array; //the destination @@ -54,7 +54,7 @@ var categoriesIdNameList; var translations=new Array; -var simulationMode=true;// simulation mode on by default +var simulationMode=false;// simulation mode off by default var showroom=false; //showroom off by default var guidance_activated=false; @@ -210,11 +210,13 @@ function time(seconds) } // Language and text -function setlang(lang) +function setlang(language,country,script) { - g_lang=lang; + g_language=language; + g_country=country; + g_script=script; translations = new Array; - Qt.include("translations/"+lang+".js"); + Qt.include("translations/"+g_language + "_" + g_country+".js"); } // Default position (for showroom mode) @@ -237,8 +239,8 @@ function setDefaultAddress(country,city,street,number) function gettext(arg) { if (!translations[arg]) { - if (g_lang) { - console.log("Translation for '" + arg + "' missing for " + g_lang); + if (g_language) { + console.log("Translation for '" + arg + "' missing for " + g_language); } return arg; } else { diff --git a/src/hmi/qml/Core/gimp/gdp-theme/800x480/NavigationAppSearch.xcf b/src/hmi/qml/Core/gimp/gdp-theme/800x480/NavigationAppSearch.xcf Binary files differindex f41129c..1a9f346 100644 --- a/src/hmi/qml/Core/gimp/gdp-theme/800x480/NavigationAppSearch.xcf +++ b/src/hmi/qml/Core/gimp/gdp-theme/800x480/NavigationAppSearch.xcf diff --git a/src/hmi/qml/Core/referenceHMI.tar.gz b/src/hmi/qml/Core/referenceHMI.tar.gz Binary files differindex abf4b53..6ba5255 100644 --- a/src/hmi/qml/Core/referenceHMI.tar.gz +++ b/src/hmi/qml/Core/referenceHMI.tar.gz diff --git a/src/hmi/qml/NavigationApp.qml b/src/hmi/qml/NavigationApp.qml index cdc986d..96eee67 100644 --- a/src/hmi/qml/NavigationApp.qml +++ b/src/hmi/qml/NavigationApp.qml @@ -31,6 +31,7 @@ import QtQuick.Dialogs 1.0 import "Core/style-sheets/style-constants.js" as Constants; import "Core/style-sheets/NavigationAppBrowseMap-css.js" as StyleSheetMap; import "Core/genivi.js" as Genivi; +import lbs.plugin.dbusif 1.0 ApplicationWindow { id: container @@ -48,10 +49,18 @@ ApplicationWindow { component = Qt.createQmlObject(page+"{}",container,"dynamic"); } + //------------------------------------------// + // Management of the DBus exchanges + //------------------------------------------// + DBusIf { + id:dbusIf; + } + Component.onCompleted: { - Genivi.setlang("eng_USA"); //set to english US + Genivi.setlang("eng","USA","Latn"); //set to english US Genivi.setDefaultPosition(46.202038,6.146845,19); // (rue Jean Calvin Genève) Genivi.setDefaultAddress("Switzerland","Lausanne","Rue de Midi","8"); // preferred address + Genivi.navigationcore_configuration_SetLocale(dbusIf,Genivi.g_language,Genivi.g_country,Genivi.g_script); load("NavigationAppMain"); } } diff --git a/src/hmi/qml/NavigationAppSearch.qml b/src/hmi/qml/NavigationAppSearch.qml index 3b1f5a5..69d9247 100644 --- a/src/hmi/qml/NavigationAppSearch.qml +++ b/src/hmi/qml/NavigationAppSearch.qml @@ -621,7 +621,7 @@ NavigationAppHMIMenu { routeArea.model.clear(); routeArea.visible=true; routeArea.forceActiveFocus(); - crossroadZoom.visible=true; + crossroadZoom.visible=false; prev_maneuver.visible=true; prev_maneuver.disabled=false; next_maneuver.visible=true; @@ -644,7 +644,7 @@ NavigationAppHMIMenu { guidance_start.disabled=false; guidance_stop.disabled=true; routeArea.visible=false; - crossroadZoom.visible=false; + crossroadZoom.visible=true; prev_maneuver.visible=false; prev_maneuver.disabled=true; next_maneuver.visible=false; @@ -923,7 +923,7 @@ NavigationAppHMIMenu { source:StyleSheet.crossroadZoom[Constants.SOURCE]; x:StyleSheet.crossroadZoom[Constants.X]; y:StyleSheet.crossroadZoom[Constants.Y]; width:StyleSheet.crossroadZoom[Constants.WIDTH]; height:StyleSheet.crossroadZoom[Constants.HEIGHT]; border.left: 0; border.top: 0 border.right: 0; border.bottom: 0 - visible: false; + visible: true; } StdButton { source:StyleSheet.prev_maneuver[Constants.SOURCE]; x:StyleSheet.prev_maneuver[Constants.X]; y:StyleSheet.prev_maneuver[Constants.Y]; width:StyleSheet.prev_maneuver[Constants.WIDTH]; height:StyleSheet.prev_maneuver[Constants.HEIGHT]; diff --git a/src/hmi/qml/NavigationAppSettings.qml b/src/hmi/qml/NavigationAppSettings.qml index 3c5c894..a070c45 100644 --- a/src/hmi/qml/NavigationAppSettings.qml +++ b/src/hmi/qml/NavigationAppSettings.qml @@ -113,7 +113,7 @@ NavigationAppHMIMenu { } } - Genivi.setlang(current_lang_nav); + Genivi.setlang(current_nav[1],current_nav[3],current_nav[5]); var units1,units2; var res=Genivi.navigationcore_configuration_GetUnitsOfMeasurement(dbusIf); @@ -135,7 +135,7 @@ NavigationAppHMIMenu { { Genivi.navigationcore_configuration_SetLocale(dbusIf,language,country,script); Genivi.mapviewer_configuration_SetLocale(dbusIf,language,country,script); - Genivi.setlang(language + "_" + country); + Genivi.setlang(language,country,script); pageOpen(menu.pagefile); //reload page because of texts... } diff --git a/src/hmi/qml/NavigationAppTokyo.qml b/src/hmi/qml/NavigationAppTokyo.qml new file mode 100644 index 0000000..5bae13c --- /dev/null +++ b/src/hmi/qml/NavigationAppTokyo.qml @@ -0,0 +1,66 @@ +/** +* @licence app begin@ +* SPDX-License-Identifier: MPL-2.0 +* +* \copyright Copyright (C) 2013-2017, PSA GROUPE +* +* \file NavigationApp.qml +* +* \brief This file is part of the navigation hmi. +* +* \author Philippe Colliot <philippe.colliot@mpsa.com> +* +* \version 1.0 +* +* This Source Code Form is subject to the terms of the +* Mozilla Public License (MPL), v. 2.0. +* If a copy of the MPL was not distributed with this file, +* You can obtain one at http://mozilla.org/MPL/2.0/. +* +* For further information see http://www.genivi.org/. +* +* List of changes: +* <date>, <name>, <description of change> +* +* @licence end@ +*/ +import QtQuick 2.1 +import QtQuick.Controls 1.0 +import QtQuick.Layouts 1.0 +import QtQuick.Dialogs 1.0 +import "Core/style-sheets/style-constants.js" as Constants; +import "Core/style-sheets/NavigationAppBrowseMap-css.js" as StyleSheetMap; +import "Core/genivi.js" as Genivi; +import lbs.plugin.dbusif 1.0 + +ApplicationWindow { + id: container + flags: Qt.FramelessWindowHint + color: "transparent" + visible: true + width: StyleSheetMap.menu[Constants.WIDTH]; + height: StyleSheetMap.menu[Constants.HEIGHT]; + property Item component; + function load(page) + { + if (component) { + component.destroy(); + } + component = Qt.createQmlObject(page+"{}",container,"dynamic"); + } + + //------------------------------------------// + // Management of the DBus exchanges + //------------------------------------------// + DBusIf { + id:dbusIf; + } + + Component.onCompleted: { + Genivi.setlang("jpn","JPN","Hrkt"); //set to japanese + Genivi.setDefaultPosition(35.758795,139.316533,19); // (1 Chome-1-5 Gonokami Hamura-shi, Tōkyō-to) + Genivi.setDefaultAddress("Japan","東京","井ノ頭通り","17"); // preferred address + Genivi.navigationcore_configuration_SetLocale(dbusIf,Genivi.g_language,Genivi.g_country,Genivi.g_script); + load("NavigationAppMain"); + } +} |