Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qgroundcontrol
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Valentin Platzgummer
qgroundcontrol
Commits
85be7c6a
Commit
85be7c6a
authored
14 years ago
by
pixhawk
Browse files
Options
Downloads
Patches
Plain Diff
Parameter view works with components now
parent
06244548
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ui/ParameterInterface.cc
+22
-5
22 additions, 5 deletions
src/ui/ParameterInterface.cc
src/ui/ParameterInterface.h
+3
-1
3 additions, 1 deletion
src/ui/ParameterInterface.h
with
25 additions
and
6 deletions
src/ui/ParameterInterface.cc
+
22
−
5
View file @
85be7c6a
...
...
@@ -14,6 +14,7 @@ ParameterInterface::ParameterInterface(QWidget *parent) :
m_ui
->
setupUi
(
this
);
connect
(
UASManager
::
instance
(),
SIGNAL
(
UASCreated
(
UASInterface
*
)),
this
,
SLOT
(
addUAS
(
UASInterface
*
)));
components
=
new
QMap
<
int
,
QTreeWidgetItem
*>
();
tree
=
new
ParamTreeModel
();
//treeView = new QTreeView(this);
...
...
@@ -74,9 +75,17 @@ void ParameterInterface::requestParameterList()
* @param component id of the component
* @param componentName human friendly name of the component
*/
void
ParameterInterface
::
addComponent
(
UASInterface
*
uas
,
int
component
,
QString
componentName
)
void
ParameterInterface
::
addComponent
(
int
uas
,
int
component
,
QString
componentName
)
{
Q_UNUSED
(
uas
);
QStringList
list
;
list
.
append
(
componentName
);
list
.
append
(
QString
::
number
(
component
));
QTreeWidgetItem
*
comp
=
new
QTreeWidgetItem
(
list
);
bool
updated
=
false
;
if
(
components
->
contains
(
component
))
updated
=
true
;
components
->
insert
(
component
,
comp
);
if
(
!
updated
)
treeWidget
->
addTopLevelItem
(
comp
);
}
void
ParameterInterface
::
receiveParameter
(
int
uas
,
int
component
,
QString
parameterName
,
float
value
)
...
...
@@ -84,10 +93,18 @@ void ParameterInterface::receiveParameter(int uas, int component, QString parame
Q_UNUSED
(
uas
);
// Insert parameter into map
//tree->appendParam(component, parameterName, value);
QStringList
list
;
list
.
append
(
parameterName
);
list
.
append
(
QString
::
number
(
value
));
treeWidget
->
addTopLevelItem
(
new
QTreeWidgetItem
(
list
));
QStringList
plist
;
plist
.
append
(
parameterName
);
plist
.
append
(
QString
::
number
(
value
));
QTreeWidgetItem
*
item
=
new
QTreeWidgetItem
(
plist
);
// Get component
if
(
!
components
->
contains
(
component
))
{
addComponent
(
uas
,
component
,
"Component #"
+
QString
::
number
(
component
));
}
components
->
value
(
component
)
->
addChild
(
item
);
//treeWidget->addTopLevelItem(new QTreeWidgetItem(list));
}
/**
...
...
This diff is collapsed.
Click to expand it.
src/ui/ParameterInterface.h
+
3
−
1
View file @
85be7c6a
...
...
@@ -4,6 +4,7 @@
#include
<QtGui/QWidget>
#include
<QtGui/QTreeView>
#include
<QtGui/QTreeWidget>
#include
<QtGui/QTreeWidgetItem>
#include
"ui_ParameterInterface.h"
#include
"UASInterface.h"
#include
"ParamTreeModel.h"
...
...
@@ -20,7 +21,7 @@ public:
public
slots
:
void
addUAS
(
UASInterface
*
uas
);
void
addComponent
(
UASInterface
*
uas
,
int
component
,
QString
componentName
);
void
addComponent
(
int
uas
,
int
component
,
QString
componentName
);
void
receiveParameter
(
int
uas
,
int
component
,
QString
parameterName
,
float
value
);
void
requestParameterList
();
void
setParameter
(
UASInterface
*
uas
,
int
component
,
QString
parameterName
,
float
value
);
...
...
@@ -33,6 +34,7 @@ protected:
ParamTreeModel
*
tree
;
QTreeView
*
treeView
;
QTreeWidget
*
treeWidget
;
QMap
<
int
,
QTreeWidgetItem
*>*
components
;
private:
Ui
::
parameterWidget
*
m_ui
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment