summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorasanoaozora <fifitaneki@hotmail.com>2017-03-10 17:01:22 +0100
committerasanoaozora <fifitaneki@hotmail.com>2017-03-10 17:01:22 +0100
commit0ebe19a50c918eefe0b45185e873042b84a8b9c9 (patch)
tree4a5f80f4d9a7b99afdfdddb84bb88d56ffd151b1
parent8fa73988638ce6b8859f548637665dcb74639250 (diff)
downloadnavigation-0ebe19a50c918eefe0b45185e873042b84a8b9c9.tar.gz
add scale to map view (draft)
-rw-r--r--src/hmi/qml/Core/genivi-capi.js5
-rw-r--r--src/hmi/qml/Core/genivi-origin.js4
-rw-r--r--src/hmi/qml/Core/gimp/gdp-theme/800x480/NavigationAppBrowseMap.xcfbin1010456 -> 1010727 bytes
-rw-r--r--src/hmi/qml/Core/gimp/gdp-theme/800x480/NavigationAppBrowseMapScale.xcfbin0 -> 2495 bytes
-rw-r--r--src/hmi/qml/Core/referenceHMI.tar.gzbin1208289 -> 1210335 bytes
-rw-r--r--src/hmi/qml/NavigationAppBrowseMap.qml57
6 files changed, 66 insertions, 0 deletions
diff --git a/src/hmi/qml/Core/genivi-capi.js b/src/hmi/qml/Core/genivi-capi.js
index a75e413..d8b5c66 100644
--- a/src/hmi/qml/Core/genivi-capi.js
+++ b/src/hmi/qml/Core/genivi-capi.js
@@ -882,6 +882,11 @@ function mapviewer_SetMapViewPan(dbusIf,panningAction,x,y)
mapviewercontrol_message(dbusIf, "setMapViewPan", ["int32",panningAction,"array",["structure",["uint16",x,"uint16",y]]]);
}
+function mapviewer_ConvertPixelCoordsToGeoCoords(dbusIf,x,y)
+{
+ return mapviewercontrol_message(dbusIf, "convertPixelCoordsToGeoCoords",["array",["structure",["uint16",x,"uint16",y]]]);
+}
+
//---------------- MapViewer messages (handle 2) ----------------
// Create a new map handle or get the current handle
diff --git a/src/hmi/qml/Core/genivi-origin.js b/src/hmi/qml/Core/genivi-origin.js
index 5c0bbe7..bdcc7db 100644
--- a/src/hmi/qml/Core/genivi-origin.js
+++ b/src/hmi/qml/Core/genivi-origin.js
@@ -880,6 +880,10 @@ function mapviewer_SetMapViewPan(dbusIf,panningAction,x,y)
mapviewercontrol_message(dbusIf, "SetMapViewPan", ["int32",panningAction,"array",["structure",["uint16",x,"uint16",y]]]);
}
+function mapviewer_ConvertPixelCoordsToGeoCoords(dbusIf,x,y)
+{
+ return mapviewercontrol_message(dbusIf, "ConvertPixelCoordsToGeoCoords",["array",["structure",["uint16",x,"uint16",y]]]);
+}
//---------------- MapViewer messages (handle 2) ----------------
diff --git a/src/hmi/qml/Core/gimp/gdp-theme/800x480/NavigationAppBrowseMap.xcf b/src/hmi/qml/Core/gimp/gdp-theme/800x480/NavigationAppBrowseMap.xcf
index 3e85a28..550d56b 100644
--- a/src/hmi/qml/Core/gimp/gdp-theme/800x480/NavigationAppBrowseMap.xcf
+++ b/src/hmi/qml/Core/gimp/gdp-theme/800x480/NavigationAppBrowseMap.xcf
Binary files differ
diff --git a/src/hmi/qml/Core/gimp/gdp-theme/800x480/NavigationAppBrowseMapScale.xcf b/src/hmi/qml/Core/gimp/gdp-theme/800x480/NavigationAppBrowseMapScale.xcf
new file mode 100644
index 0000000..2e70727
--- /dev/null
+++ b/src/hmi/qml/Core/gimp/gdp-theme/800x480/NavigationAppBrowseMapScale.xcf
Binary files differ
diff --git a/src/hmi/qml/Core/referenceHMI.tar.gz b/src/hmi/qml/Core/referenceHMI.tar.gz
index 1663e39..f95e011 100644
--- a/src/hmi/qml/Core/referenceHMI.tar.gz
+++ b/src/hmi/qml/Core/referenceHMI.tar.gz
Binary files differ
diff --git a/src/hmi/qml/NavigationAppBrowseMap.qml b/src/hmi/qml/NavigationAppBrowseMap.qml
index 7e528ea..0ae8762 100644
--- a/src/hmi/qml/NavigationAppBrowseMap.qml
+++ b/src/hmi/qml/NavigationAppBrowseMap.qml
@@ -37,6 +37,7 @@ import "Core/style-sheets/NavigationAppBrowseMapSimulation-css.js" as StyleSheet
import "Core/style-sheets/NavigationAppBrowseMapTop-css.js" as StyleSheetTop
import "Core/style-sheets/NavigationAppBrowseMapManeuver-css.js" as StyleSheetManeuver
import "Core/style-sheets/NavigationAppBrowseMapSettings-css.js" as StyleSheetSettings;
+import "Core/style-sheets/NavigationAppBrowseMapScale-css.js" as StyleSheetScale;
import lbs.plugin.dbusif 1.0
@@ -48,6 +49,7 @@ NavigationAppHMIMenu {
property bool north:false;
property int speedValueSent: 0;
property bool displayManeuvers:false;
+ property double earthRadius: 6371009;
//------------------------------------------//
// Management of the DBus exchanges
@@ -250,6 +252,7 @@ NavigationAppHMIMenu {
text="*"+text;
}
zoomlevel.text=text;
+ setScale();
}
function connectSignals()
@@ -770,6 +773,17 @@ NavigationAppHMIMenu {
Genivi.mapmatchedposition_StartSimulation(dbusIf);
}
+ function setScale()
+ {
+ var res=Genivi.mapviewer_ConvertPixelCoordsToGeoCoords(dbusIf,width/2,height/2);
+ var latitude=res[3][1][1];
+ res=Genivi.mapviewer_ConvertPixelCoordsToGeoCoords(dbusIf,width/2+1,height/2+1);
+ var deltaLatitude=latitude-res[3][1][1];
+ var kilometerPerPixel=earthRadius*Math.sin((deltaLatitude*Math.PI)/360);
+ //StyleSheetScale.scale_bar[Constants.WIDTH]
+ console.log(kilometerPerPixel)
+ }
+
function showManeuversList()
{
displayManeuvers=true;
@@ -1424,6 +1438,49 @@ NavigationAppHMIMenu {
}
}
+ Rectangle {
+ color:"transparent"
+ width: StyleSheetScale.navigation_app_browse_map_scale_background[Constants.WIDTH]
+ height: StyleSheetScale.navigation_app_browse_map_scale_background[Constants.HEIGHT]
+ x: StyleSheetMap.scale_area[Constants.X]
+ y: StyleSheetMap.scale_area[Constants.Y]
+ NavigationAppHMIBgImage {
+ id: scale
+ opacity: 1
+ image:StyleSheetScale.navigation_app_browse_map_scale_background[Constants.SOURCE]
+ anchors { fill: parent; topMargin: parent.headlineHeight}
+ Text {
+ x:StyleSheetScale.scaleValue[Constants.X]; y:StyleSheetScale.scaleValue[Constants.Y]; width:StyleSheetScale.scaleValue[Constants.WIDTH]; height:StyleSheetScale.scaleValue[Constants.HEIGHT];color:StyleSheetScale.scaleValue[Constants.TEXTCOLOR];styleColor:StyleSheetScale.scaleValue[Constants.STYLECOLOR]; font.pixelSize:StyleSheetScale.scaleValue[Constants.PIXELSIZE];
+ visible: true
+ style: Text.Sunken;
+ smooth: true
+ id:scaleValue
+ text: "-------"
+ }
+ BorderImage {
+ id: left
+ source: StyleSheetScale.left[Constants.SOURCE];x:StyleSheetScale.left[Constants.X]; y:StyleSheetScale.left[Constants.Y]; width:StyleSheetScale.left[Constants.WIDTH]; height:StyleSheetScale.left[Constants.HEIGHT];
+ border.left: 0; border.top: 0
+ border.right: 0; border.bottom: 0
+ visible: true;
+ }
+ BorderImage {
+ id: scale_bar
+ source: StyleSheetScale.scale_bar[Constants.SOURCE];x:StyleSheetScale.scale_bar[Constants.X]; y:StyleSheetScale.scale_bar[Constants.Y]; width:StyleSheetScale.scale_bar[Constants.WIDTH]; height:StyleSheetScale.scale_bar[Constants.HEIGHT];
+ border.left: 0; border.top: 0
+ border.right: 0; border.bottom: 0
+ visible: true;
+ }
+ BorderImage {
+ id: right
+ source: StyleSheetScale.right[Constants.SOURCE];x:StyleSheetScale.right[Constants.X]; y:StyleSheetScale.right[Constants.Y]; width:StyleSheetScale.right[Constants.WIDTH]; height:StyleSheetScale.right[Constants.HEIGHT];
+ border.left: 0; border.top: 0
+ border.right: 0; border.bottom: 0
+ visible: true;
+ }
+ }
+ }
+
}
Component.onCompleted: {