Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
7a7e98cf
Commit
7a7e98cf
authored
Feb 18, 2016
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2845 from DonLakeFlyer/AltitudeLarge
Altitude properties are visually distinct
parents
7d75c230
d04518d5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
13 deletions
+20
-13
ValuesWidget.qml
src/FlightMap/Widgets/ValuesWidget.qml
+14
-13
ValuesWidgetController.cc
src/FlightMap/Widgets/ValuesWidgetController.cc
+2
-0
ValuesWidgetController.h
src/FlightMap/Widgets/ValuesWidgetController.h
+4
-0
No files found.
src/FlightMap/Widgets/ValuesWidget.qml
View file @
7a7e98cf
...
...
@@ -56,6 +56,15 @@ QGCFlickable {
qgcView
.
showDialog
(
propertyPicker
,
"
Value Widget Setup
"
,
qgcView
.
showDialogDefaultWidth
,
StandardButton
.
Ok
)
}
function
listContains
(
list
,
value
)
{
for
(
var
i
=
0
;
i
<
list
.
length
;
i
++
)
{
if
(
list
[
i
]
===
value
)
{
return
true
}
}
return
false
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
showPicker
()
...
...
@@ -74,6 +83,7 @@ QGCFlickable {
width
:
_largeColumn
.
width
property
Fact
fact
:
_activeVehicle
.
getFact
(
modelData
.
replace
(
"
Vehicle.
"
,
""
))
property
bool
largeValue
:
_root
.
listContains
(
controller
.
altitudeProperties
,
fact
.
name
)
QGCLabel
{
width
:
parent
.
width
...
...
@@ -84,8 +94,8 @@ QGCFlickable {
QGCLabel
{
width
:
parent
.
width
horizontalAlignment
:
Text
.
AlignHCenter
font.pixelSize
:
ScreenTools
.
largeFontPixelSize
font.weight
:
Font
.
DemiBold
font.pixelSize
:
ScreenTools
.
largeFontPixelSize
*
(
largeValue
?
1.3
:
1.0
)
font.weight
:
largeValue
?
Font
.
ExtraBold
:
Font
.
Normal
color
:
textColor
text
:
fact
.
valueString
}
...
...
@@ -185,15 +195,6 @@ QGCFlickable {
property
string
propertyName
:
factGroupName
+
"
.
"
+
modelData
function
contains
(
list
,
value
)
{
for
(
var
i
=
0
;
i
<
list
.
length
;
i
++
)
{
if
(
list
[
i
]
===
value
)
{
return
true
}
}
return
false
}
function
removeFromList
(
list
,
value
)
{
var
newList
=
[]
for
(
var
i
=
0
;
i
<
list
.
length
;
i
++
)
{
...
...
@@ -236,14 +237,14 @@ QGCFlickable {
QGCCheckBox
{
id
:
_addCheckBox
text
:
factGroup
.
getFact
(
modelData
).
shortDescription
checked
:
_largeCheckBox
.
checked
||
parent
.
c
ontains
(
controller
.
smallValues
,
propertyName
)
checked
:
_largeCheckBox
.
checked
||
listC
ontains
(
controller
.
smallValues
,
propertyName
)
onClicked
:
updateValues
()
}
QGCCheckBox
{
id
:
_largeCheckBox
text
:
"
large
"
checked
:
parent
.
c
ontains
(
controller
.
largeValues
,
propertyName
)
checked
:
listC
ontains
(
controller
.
largeValues
,
propertyName
)
enabled
:
_addCheckBox
.
checked
onClicked
:
updateValues
()
}
...
...
src/FlightMap/Widgets/ValuesWidgetController.cc
View file @
7a7e98cf
...
...
@@ -40,6 +40,8 @@ ValuesWidgetController::ValuesWidgetController(void)
_largeValues
=
settings
.
value
(
_largeValuesKey
,
largeDefaults
).
toStringList
();
_smallValues
=
settings
.
value
(
_smallValuesKey
,
QStringList
()).
toStringList
();
_altitudeProperties
<<
"altitudeRelative"
<<
"altitudeAMSL"
;
// Keep back compat for removed WGS84 value
if
(
_largeValues
.
contains
(
"Vehicle.altitudeWGS84"
))
{
setLargeValues
(
_largeValues
.
replaceInStrings
(
"Vehicle.altitudeWGS84"
,
"Vehicle.altitudeRelative"
));
...
...
src/FlightMap/Widgets/ValuesWidgetController.h
View file @
7a7e98cf
...
...
@@ -36,10 +36,13 @@ public:
Q_PROPERTY
(
QStringList
largeValues
READ
largeValues
WRITE
setLargeValues
NOTIFY
largeValuesChanged
)
Q_PROPERTY
(
QStringList
smallValues
READ
smallValues
WRITE
setSmallValues
NOTIFY
smallValuesChanged
)
Q_PROPERTY
(
QStringList
altitudeProperties
READ
altitudeProperties
CONSTANT
)
QStringList
largeValues
(
void
)
const
{
return
_largeValues
;
}
QStringList
smallValues
(
void
)
const
{
return
_smallValues
;
}
void
setLargeValues
(
const
QStringList
&
values
);
void
setSmallValues
(
const
QStringList
&
values
);
QStringList
altitudeProperties
(
void
)
const
{
return
_altitudeProperties
;
}
signals:
void
largeValuesChanged
(
QStringList
values
);
...
...
@@ -48,6 +51,7 @@ signals:
private:
QStringList
_largeValues
;
QStringList
_smallValues
;
QStringList
_altitudeProperties
;
static
const
char
*
_groupKey
;
static
const
char
*
_largeValuesKey
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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