7import QGroundControl.Controls
8import QGroundControl.FactControls
12 title: qsTr("Edit Position")
15 property alias coordinate: controller.coordinate
16 property bool showSetPositionFromVehicle: true
18 property real _margin: ScreenTools.defaultFontPixelWidth / 2
19 property real _textFieldWidth: ScreenTools.defaultFontPixelWidth * 20
20 property bool _showGeographic: coordinateSystemCombo.comboBox.currentIndex === 0
21 property bool _showUTM: coordinateSystemCombo.comboBox.currentIndex === 1
22 property bool _showMGRS: coordinateSystemCombo.comboBox.currentIndex === 2
23 property bool _showVehicle: coordinateSystemCombo.comboBox.currentIndex === 3
25 EditPositionDialogController {
28 Component.onCompleted: initValues()
35 id: coordinateSystemCombo
36 Layout.fillWidth: true
37 label: qsTr("Coordinate System")
38 model: showSetPositionFromVehicle && globals.activeVehicle ?
39 [ qsTr("Geographic"), qsTr("Universal Transverse Mercator"), qsTr("Military Grid Reference"), qsTr("Vehicle Position") ] :
40 [ qsTr("Geographic"), qsTr("Universal Transverse Mercator"), qsTr("Military Grid Reference") ]
43 LabelledFactTextField {
44 label: qsTr("Latitude")
45 fact: controller.latitude
46 textFieldPreferredWidth: _textFieldWidth
47 Layout.fillWidth: true
48 visible: _showGeographic
51 LabelledFactTextField {
52 label: qsTr("Longitude")
53 fact: controller.longitude
54 textFieldPreferredWidth: _textFieldWidth
55 Layout.fillWidth: true
56 visible: _showGeographic
60 label: qsTr("Set position")
61 buttonText: qsTr("Move")
62 visible: _showGeographic
64 controller.setFromGeo()
69 LabelledFactTextField {
72 textFieldPreferredWidth: _textFieldWidth
73 Layout.fillWidth: true
77 LabelledFactComboBox {
78 label: qsTr("Hemisphere")
79 fact: controller.hemisphere
81 Layout.fillWidth: true
85 LabelledFactTextField {
86 label: qsTr("Easting")
87 fact: controller.easting
88 textFieldPreferredWidth: _textFieldWidth
89 Layout.fillWidth: true
93 LabelledFactTextField {
94 label: qsTr("Northing")
95 fact: controller.northing
96 textFieldPreferredWidth: _textFieldWidth
97 Layout.fillWidth: true
102 label: qsTr("Set position")
103 buttonText: qsTr("Move")
106 controller.setFromUTM()
111 LabelledFactTextField {
113 fact: controller.mgrs
115 textFieldPreferredWidth: _textFieldWidth
116 Layout.fillWidth: true
120 label: qsTr("Set position")
121 buttonText: qsTr("Move")
124 controller.setFromMGRS()
130 label: qsTr("Set position")
131 buttonText: qsTr("Move")
132 visible: _showVehicle
134 controller.setFromVehicle()