Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
127a8b2f
Commit
127a8b2f
authored
May 01, 2020
by
Remek Zajac
Browse files
more catches
parent
988fb700
Changes
5
Hide whitespace changes
Inline
Side-by-side
custom-example/res/CustomFlyViewOverlay.qml
View file @
127a8b2f
...
...
@@ -66,7 +66,7 @@ Item {
if
(
activeVehicle
&&
gcsPosition
.
latitude
&&
Math
.
abs
(
gcsPosition
.
latitude
)
>
0.001
&&
gcsPosition
.
longitude
&&
Math
.
abs
(
gcsPosition
.
longitude
)
>
0.001
)
{
var
gcs
=
QtPositioning
.
coordinate
(
gcsPosition
.
latitude
,
gcsPosition
.
longitude
)
var
veh
=
activeVehicle
.
coordinate
;
_distance
=
QGroundControl
.
metersToAppSettingsDistanceUnits
(
gcs
.
distanceTo
(
veh
));
_distance
=
QGroundControl
.
unitsConversion
.
metersToAppSettings
Horizontal
DistanceUnits
(
gcs
.
distanceTo
(
veh
));
//-- Ignore absurd values
if
(
_distance
>
99999
)
_distance
=
0
;
...
...
src/FlightMap/MapScale.qml
View file @
127a8b2f
...
...
@@ -121,7 +121,7 @@ Item {
var
leftCoord
=
mapControl
.
toCoordinate
(
Qt
.
point
(
0
,
scale
.
y
),
false
/* clipToViewPort */
)
var
rightCoord
=
mapControl
.
toCoordinate
(
Qt
.
point
(
scaleLinePixelLength
,
scale
.
y
),
false
/* clipToViewPort */
)
var
scaleLineMeters
=
Math
.
round
(
leftCoord
.
distanceTo
(
rightCoord
))
if
(
QGroundControl
.
settingsManager
.
unitsSettings
.
d
istanceUnits
.
value
===
UnitsSettings
.
DistanceUnitsFeet
)
{
if
(
QGroundControl
.
settingsManager
.
unitsSettings
.
horizontalD
istanceUnits
.
value
===
UnitsSettings
.
Horizontal
DistanceUnitsFeet
)
{
calculateFeetRatio
(
scaleLineMeters
,
scaleLinePixelLength
)
}
else
{
calculateMetersRatio
(
scaleLineMeters
,
scaleLinePixelLength
)
...
...
src/PlanView/TerrainStatus.qml
View file @
127a8b2f
...
...
@@ -48,7 +48,9 @@ Rectangle {
anchors.top
:
parent
.
bottom
width
:
parent
.
height
font.pointSize
:
ScreenTools
.
smallFontPointSize
text
:
qsTr
(
"
Height AMSL (%1)
"
).
arg
(
QGroundControl
.
appSettingsDistanceUnitsString
)
text
:
qsTr
(
"
Height AMSL (%1)
"
).
arg
(
QGroundControl
.
unitsConversion
.
appSettingsHorizontalDistanceUnitsString
)
horizontalAlignment
:
Text
.
AlignHCenter
rotation
:
-
90
transformOrigin
:
Item
.
TopLeft
...
...
src/QmlControls/QGroundControl/Specific/UnitsWizardPage.qml
View file @
127a8b2f
...
...
@@ -57,18 +57,18 @@ BaseStartupWizardPage {
model
:
[
qsTr
(
"
Metric System
"
),
qsTr
(
"
Imperial System
"
)]
Layout.preferredWidth
:
_comboFieldWidth
currentIndex
:
QGroundControl
.
settingsManager
.
unitsSettings
.
d
istanceUnits
.
value
===
UnitsSettings
.
DistanceUnitsMeters
?
0
:
1
currentIndex
:
QGroundControl
.
settingsManager
.
unitsSettings
.
horizontalD
istanceUnits
.
value
===
UnitsSettings
.
Horizontal
DistanceUnitsMeters
?
0
:
1
onActivated
:
{
var
metric
=
(
currentIndex
===
0
);
QGroundControl
.
settingsManager
.
unitsSettings
.
d
istanceUnits
.
value
=
metric
?
UnitsSettings
.
DistanceUnitsMeters
:
UnitsSettings
.
DistanceUnitsFeet
QGroundControl
.
settingsManager
.
unitsSettings
.
horizontalD
istanceUnits
.
value
=
metric
?
UnitsSettings
.
Horizontal
DistanceUnitsMeters
:
UnitsSettings
.
Horizontal
DistanceUnitsFeet
QGroundControl
.
settingsManager
.
unitsSettings
.
areaUnits
.
value
=
metric
?
UnitsSettings
.
AreaUnitsSquareMeters
:
UnitsSettings
.
AreaUnitsSquareFeet
QGroundControl
.
settingsManager
.
unitsSettings
.
speedUnits
.
value
=
metric
?
UnitsSettings
.
SpeedUnitsMetersPerSecond
:
UnitsSettings
.
SpeedUnitsFeetPerSecond
QGroundControl
.
settingsManager
.
unitsSettings
.
temperatureUnits
.
value
=
metric
?
UnitsSettings
.
TemperatureUnitsCelsius
:
UnitsSettings
.
TemperatureUnitsFarenheit
}
}
Repeater
{
model
:
[
QGroundControl
.
settingsManager
.
unitsSettings
.
d
istanceUnits
,
QGroundControl
.
settingsManager
.
unitsSettings
.
areaUnits
,
QGroundControl
.
settingsManager
.
unitsSettings
.
speedUnits
,
QGroundControl
.
settingsManager
.
unitsSettings
.
temperatureUnits
]
model
:
[
QGroundControl
.
settingsManager
.
unitsSettings
.
horizontalD
istanceUnits
,
QGroundControl
.
settingsManager
.
unitsSettings
.
areaUnits
,
QGroundControl
.
settingsManager
.
unitsSettings
.
speedUnits
,
QGroundControl
.
settingsManager
.
unitsSettings
.
temperatureUnits
]
FactComboBox
{
Layout.preferredWidth
:
_comboFieldWidth
fact
:
modelData
...
...
src/ui/preferences/GeneralSettings.qml
View file @
127a8b2f
...
...
@@ -99,7 +99,7 @@ Rectangle {
QGCLabel
{
text
:
modelData
}
}
Repeater
{
model
:
[
QGroundControl
.
settingsManager
.
unitsSettings
.
d
istanceUnits
,
QGroundControl
.
settingsManager
.
unitsSettings
.
areaUnits
,
QGroundControl
.
settingsManager
.
unitsSettings
.
speedUnits
,
QGroundControl
.
settingsManager
.
unitsSettings
.
temperatureUnits
]
model
:
[
QGroundControl
.
settingsManager
.
unitsSettings
.
horizontalD
istanceUnits
,
QGroundControl
.
settingsManager
.
unitsSettings
.
areaUnits
,
QGroundControl
.
settingsManager
.
unitsSettings
.
speedUnits
,
QGroundControl
.
settingsManager
.
unitsSettings
.
temperatureUnits
]
FactComboBox
{
Layout.preferredWidth
:
_comboFieldWidth
fact
:
modelData
...
...
@@ -162,7 +162,7 @@ Rectangle {
text
:
qsTr
(
"
Map Provider
"
)
width
:
_labelWidth
}
QGCComboBox
{
id
:
mapCombo
model
:
QGroundControl
.
mapEngineManager
.
mapProviderList
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment