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
c3cf5b7c
Commit
c3cf5b7c
authored
Jun 18, 2010
by
lm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added auto-grouping of parameters by first underscore
parent
d4b3d801
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
15 deletions
+53
-15
QGC.h
src/QGC.h
+3
-1
HSIDisplay.cc
src/ui/HSIDisplay.cc
+3
-3
QGCParamWidget.cc
src/ui/QGCParamWidget.cc
+47
-11
No files found.
src/QGC.h
View file @
c3cf5b7c
...
...
@@ -6,7 +6,9 @@
namespace
QGC
{
const
QColor
ColorCyan
(
55
,
154
,
195
);
const
QColor
colorCyan
(
55
,
154
,
195
);
const
QColor
colorRed
(
154
,
20
,
20
);
const
QColor
colorGreen
(
20
,
200
,
20
);
/** @brief Get the current ground time in microseconds */
quint64
groundTimeUsecs
();
...
...
src/ui/HSIDisplay.cc
View file @
c3cf5b7c
...
...
@@ -149,7 +149,7 @@ void HSIDisplay::paintDisplay()
lockStatusColor
=
QColor
(
255
,
20
,
20
);
}
paintText
(
tr
(
"POS"
),
QGC
::
C
olorCyan
,
1.8
f
,
2.0
f
,
2.5
f
,
&
painter
);
paintText
(
tr
(
"POS"
),
QGC
::
c
olorCyan
,
1.8
f
,
2.0
f
,
2.5
f
,
&
painter
);
painter
.
setBrush
(
lockStatusColor
);
painter
.
setPen
(
Qt
::
NoPen
);
painter
.
drawRect
(
QRect
(
refToScreenX
(
9.5
f
),
refToScreenY
(
2.0
f
),
refToScreenX
(
7.0
f
),
refToScreenY
(
4.0
f
)));
...
...
@@ -204,14 +204,14 @@ void HSIDisplay::paintDisplay()
if
(
bodyXSetCoordinate
!=
0
||
bodyYSetCoordinate
!=
0
)
{
// Draw setpoint
drawSetpointXY
(
bodyXSetCoordinate
,
bodyYSetCoordinate
,
bodyYawSet
,
QGC
::
C
olorCyan
,
painter
);
drawSetpointXY
(
bodyXSetCoordinate
,
bodyYSetCoordinate
,
bodyYawSet
,
QGC
::
c
olorCyan
,
painter
);
// Draw travel direction line
QPointF
m
(
bodyXSetCoordinate
,
bodyYSetCoordinate
);
// Transform from body to world coordinates
m
=
metricWorldToBody
(
m
);
// Scale from metric body to screen reference units
QPointF
s
=
metricBodyToRef
(
m
);
drawLine
(
s
.
x
(),
s
.
y
(),
xCenterPos
,
yCenterPos
,
1.5
f
,
QGC
::
C
olorCyan
,
&
painter
);
drawLine
(
s
.
x
(),
s
.
y
(),
xCenterPos
,
yCenterPos
,
1.5
f
,
QGC
::
c
olorCyan
,
&
painter
);
}
// Labels on outer part and bottom
...
...
src/ui/QGCParamWidget.cc
View file @
c3cf5b7c
...
...
@@ -35,6 +35,7 @@ This file is part of the QGROUNDCONTROL project
#include "QGCParamWidget.h"
#include "UASInterface.h"
#include <QDebug>
#include "QGC.h"
/**
* @param uas MAV to set the parameters on
...
...
@@ -137,11 +138,8 @@ void QGCParamWidget::addComponent(int uas, int component, QString componentName)
void
QGCParamWidget
::
addParameter
(
int
uas
,
int
component
,
QString
parameterName
,
float
value
)
{
Q_UNUSED
(
uas
);
// Insert parameter into map
QStringList
plist
;
plist
.
append
(
parameterName
);
plist
.
append
(
QString
::
number
(
value
));
QTreeWidgetItem
*
item
=
new
QTreeWidgetItem
(
plist
);
// Reference to item in tree
QTreeWidgetItem
*
parameterItem
;
// Get component
if
(
!
components
->
contains
(
component
))
...
...
@@ -164,6 +162,34 @@ void QGCParamWidget::addParameter(int uas, int component, QString parameterName,
compParamGroups
->
insert
(
parent
,
item
);
components
->
value
(
component
)
->
addChild
(
item
);
}
// Append child to group
bool
found
=
false
;
QTreeWidgetItem
*
parentItem
=
compParamGroups
->
value
(
parent
);
for
(
int
i
=
0
;
i
<
parentItem
->
childCount
();
i
++
)
{
QTreeWidgetItem
*
child
=
parentItem
->
child
(
i
);
QString
key
=
child
->
data
(
0
,
Qt
::
DisplayRole
).
toString
();
if
(
key
==
parameterName
)
{
//qDebug() << "UPDATED CHILD";
parameterItem
=
child
;
parameterItem
->
setData
(
1
,
Qt
::
DisplayRole
,
value
);
found
=
true
;
}
}
if
(
!
found
)
{
// Insert parameter into map
QStringList
plist
;
plist
.
append
(
parameterName
);
plist
.
append
(
QString
::
number
(
value
));
parameterItem
=
new
QTreeWidgetItem
(
plist
);
compParamGroups
->
value
(
parent
)
->
addChild
(
parameterItem
);
parameterItem
>
setFlags
(
item
->
flags
()
|
Qt
::
ItemIsEditable
);
}
}
else
{
...
...
@@ -176,19 +202,28 @@ void QGCParamWidget::addParameter(int uas, int component, QString parameterName,
if
(
key
==
parameterName
)
{
//qDebug() << "UPDATED CHILD";
child
->
setData
(
1
,
Qt
::
DisplayRole
,
value
);
parameterItem
=
child
;
parameterItem
->
setData
(
1
,
Qt
::
DisplayRole
,
value
);
found
=
true
;
}
}
if
(
!
found
)
{
components
->
value
(
component
)
->
addChild
(
item
);
item
->
setFlags
(
item
->
flags
()
|
Qt
::
ItemIsEditable
);
// Insert parameter into map
QStringList
plist
;
plist
.
append
(
parameterName
);
plist
.
append
(
QString
::
number
(
value
));
parameterItem
=
new
QTreeWidgetItem
(
plist
);
compParamGroups
->
value
(
parent
)
->
addChild
(
parameterItem
);
parameterItem
>
setFlags
(
item
->
flags
()
|
Qt
::
ItemIsEditable
);
}
//connect(item, SIGNAL())
tree
->
expandAll
();
//tree->expandAll();
}
// Reset background color
current
->
setBackground
(
0
,
QBrush
(
QColor
(
QGC
::
colorGreen
)));
current
->
setBackground
(
1
,
QBrush
(
QColor
(
QGC
::
colorGreen
)));
tree
->
update
();
}
...
...
@@ -231,7 +266,8 @@ void QGCParamWidget::parameterItemChanged(QTreeWidgetItem* current, int column)
{
qDebug
()
<<
"PARAM CHANGED: COMP:"
<<
key
<<
"KEY:"
<<
str
<<
"VALUE:"
<<
value
;
map
->
insert
(
str
,
value
);
// FIXME CHANGE COLOR OF CHANGED PARAM
current
->
setBackground
(
0
,
QBrush
(
QColor
(
QGC
::
colorGreen
)));
current
->
setBackground
(
1
,
QBrush
(
QColor
(
QGC
::
colorGreen
)));
}
}
}
...
...
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