LocationPage.qml Example File
locationdiagnostics/assets/LocationPage.qml
import bb.cascades 1.0
import bb.cascades.maps 1.0
Page {
property variant session
Container {
layout: DockLayout {
}
ImageView {
imageSource: "asset:///images/background.png"
}
Container {
topPadding: 150
ScrollView {
scrollViewProperties {
scrollMode: ScrollMode.Vertical
}
visible: (pageSelector.selectedIndex == 0)
Container {
topPadding: 50
leftPadding: 50
rightPadding: 50
LabelLabel {
label: qsTr("timestamp")
text: session ? session.time : ""
}
LabelLabel {
label: qsTr("method")
text: session ? session.method : ""
}
Divider {
}
LabelLabel {
label: qsTr("latitude")
text: session ? session.latitude : ""
}
LabelLabel {
label: qsTr("longitude")
text: session ? session.longitude : ""
}
LabelLabel {
label: qsTr("altitude")
text: session ? session.altitude : ""
}
Divider {
}
LabelLabel {
label: qsTr("direction")
text: session ? session.direction : ""
}
LabelLabel {
label: qsTr("ground speed")
text: session ? session.groundSpeed : ""
}
LabelLabel {
label: qsTr("vertical speed")
text: session ? session.verticalSpeed : ""
}
Divider {
}
LabelLabel {
label: qsTr("magnetic variation")
text: session ? session.magneticVariation : ""
}
LabelLabel {
label: qsTr("horizontal accuracy")
text: session ? session.horizontalAccuracy : ""
}
LabelLabel {
label: qsTr("vertical accuracy")
text: session ? session.verticalAccuracy : ""
}
LabelLabel {
label: qsTr("horizontal dilution")
text: session ? session.horizontalDilution : ""
}
LabelLabel {
label: qsTr("vertical dilution")
text: session ? session.verticalDilution : ""
}
LabelLabel {
label: qsTr("position dilution")
text: session ? session.positionDilution : ""
}
Divider {
}
LabelLabel {
label: qsTr("ttff")
text: session ? session.ttff : ""
}
LabelLabel {
label: qsTr("gps week")
text: session ? session.gpsWeek : ""
}
LabelLabel {
label: qsTr("gps time of week")
text: session ? session.gpsTimeOfWeek : ""
}
LabelLabel {
label: qsTr("is propagated")
text: session ? session.isPropagated : ""
}
DropDown {
id: resetModeSelector
title: qsTr("Reset Mode")
Option {
text: qsTr("Cold")
value: "cold"
selected: true
}
Option {
text: qsTr("Warm")
value: "warm"
}
Option {
text: qsTr("Hot")
value: "hot"
}
}
Button {
horizontalAlignment: HorizontalAlignment.Center
text: qsTr("Reset")
onClicked: session.resetSession(resetModeSelector.selectedValue)
}
}
}
ScrollView {
scrollViewProperties {
scrollMode: ScrollMode.Vertical
}
visible: (pageSelector.selectedIndex == 1)
Container {
topPadding: 30
leftPadding: 30
rightPadding: 30
TextArea {
textStyle {
base: SystemDefaults.TextStyles.SmallText
color: Color.White
fontFamily: "courier"
}
editable: false
backgroundVisible: true
text: session.satellitesInView
hintText: qsTr("Satellite Information")
}
TextArea {
textStyle {
base: SystemDefaults.TextStyles.SmallText
color: Color.White
fontFamily: "courier"
}
editable: false
backgroundVisible: true
text: session.satellitesInUse
hintText: qsTr("Satellite Information")
}
}
}
Container {
leftPadding: 30
topPadding: 30
rightPadding: 30
bottomPadding: 30
preferredWidth: maxWidth
preferredHeight: maxHeight
layout: DockLayout {
}
visible: (pageSelector.selectedIndex == 2)
onVisibleChanged: {
if (visible)
session.mapView = myMap
}
MapView {
id: myMap
altitude: 5000
latitude: 0
longitude: 0
verticalAlignment: VerticalAlignment.Center
horizontalAlignment: HorizontalAlignment.Center
}
}
}
Container {
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Top
leftPadding: 30
topPadding: 30
rightPadding: 30
SegmentedControl {
id: pageSelector
Option {
text: qsTr("Location")
selected: true
}
Option {
text: qsTr("Satellites")
}
Option {
text: qsTr("Map")
}
}
}
}
paneProperties: NavigationPaneProperties {
backButton: ActionItem {
title: qsTr("Back")
onTriggered: {
navigationPane.pop()
}
}
}
}