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
85be7c6a
Commit
85be7c6a
authored
Apr 30, 2010
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Parameter view works with components now
parent
06244548
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
6 deletions
+25
-6
ParameterInterface.cc
src/ui/ParameterInterface.cc
+22
-5
ParameterInterface.h
src/ui/ParameterInterface.h
+3
-1
No files found.
src/ui/ParameterInterface.cc
View file @
85be7c6a
...
@@ -14,6 +14,7 @@ ParameterInterface::ParameterInterface(QWidget *parent) :
...
@@ -14,6 +14,7 @@ ParameterInterface::ParameterInterface(QWidget *parent) :
m_ui
->
setupUi
(
this
);
m_ui
->
setupUi
(
this
);
connect
(
UASManager
::
instance
(),
SIGNAL
(
UASCreated
(
UASInterface
*
)),
this
,
SLOT
(
addUAS
(
UASInterface
*
)));
connect
(
UASManager
::
instance
(),
SIGNAL
(
UASCreated
(
UASInterface
*
)),
this
,
SLOT
(
addUAS
(
UASInterface
*
)));
components
=
new
QMap
<
int
,
QTreeWidgetItem
*>
();
tree
=
new
ParamTreeModel
();
tree
=
new
ParamTreeModel
();
//treeView = new QTreeView(this);
//treeView = new QTreeView(this);
...
@@ -74,9 +75,17 @@ void ParameterInterface::requestParameterList()
...
@@ -74,9 +75,17 @@ void ParameterInterface::requestParameterList()
* @param component id of the component
* @param component id of the component
* @param componentName human friendly name 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
);
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
)
void
ParameterInterface
::
receiveParameter
(
int
uas
,
int
component
,
QString
parameterName
,
float
value
)
...
@@ -84,10 +93,18 @@ void ParameterInterface::receiveParameter(int uas, int component, QString parame
...
@@ -84,10 +93,18 @@ void ParameterInterface::receiveParameter(int uas, int component, QString parame
Q_UNUSED
(
uas
);
Q_UNUSED
(
uas
);
// Insert parameter into map
// Insert parameter into map
//tree->appendParam(component, parameterName, value);
//tree->appendParam(component, parameterName, value);
QStringList
list
;
QStringList
plist
;
list
.
append
(
parameterName
);
plist
.
append
(
parameterName
);
list
.
append
(
QString
::
number
(
value
));
plist
.
append
(
QString
::
number
(
value
));
treeWidget
->
addTopLevelItem
(
new
QTreeWidgetItem
(
list
));
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));
}
}
/**
/**
...
...
src/ui/ParameterInterface.h
View file @
85be7c6a
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
#include <QtGui/QWidget>
#include <QtGui/QWidget>
#include <QtGui/QTreeView>
#include <QtGui/QTreeView>
#include <QtGui/QTreeWidget>
#include <QtGui/QTreeWidget>
#include <QtGui/QTreeWidgetItem>
#include "ui_ParameterInterface.h"
#include "ui_ParameterInterface.h"
#include "UASInterface.h"
#include "UASInterface.h"
#include "ParamTreeModel.h"
#include "ParamTreeModel.h"
...
@@ -20,7 +21,7 @@ public:
...
@@ -20,7 +21,7 @@ public:
public
slots
:
public
slots
:
void
addUAS
(
UASInterface
*
uas
);
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
receiveParameter
(
int
uas
,
int
component
,
QString
parameterName
,
float
value
);
void
requestParameterList
();
void
requestParameterList
();
void
setParameter
(
UASInterface
*
uas
,
int
component
,
QString
parameterName
,
float
value
);
void
setParameter
(
UASInterface
*
uas
,
int
component
,
QString
parameterName
,
float
value
);
...
@@ -33,6 +34,7 @@ protected:
...
@@ -33,6 +34,7 @@ protected:
ParamTreeModel
*
tree
;
ParamTreeModel
*
tree
;
QTreeView
*
treeView
;
QTreeView
*
treeView
;
QTreeWidget
*
treeWidget
;
QTreeWidget
*
treeWidget
;
QMap
<
int
,
QTreeWidgetItem
*>*
components
;
private:
private:
Ui
::
parameterWidget
*
m_ui
;
Ui
::
parameterWidget
*
m_ui
;
...
...
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