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
4f1df9b3
Commit
4f1df9b3
authored
Aug 18, 2013
by
tstellanova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pass along important data model signals via param mgr
parent
fb33f69e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
9 deletions
+30
-9
QGCUASParamManager.cc
src/uas/QGCUASParamManager.cc
+9
-0
QGCUASParamManager.h
src/uas/QGCUASParamManager.h
+6
-0
QGCBaseParamWidget.cc
src/ui/QGCBaseParamWidget.cc
+4
-4
QGCPendingParamWidget.cc
src/ui/QGCPendingParamWidget.cc
+11
-5
No files found.
src/uas/QGCUASParamManager.cc
View file @
4f1df9b3
...
...
@@ -40,6 +40,15 @@ void QGCUASParamManager::connectToModelAndComms()
connect
(
paramCommsMgr
,
SIGNAL
(
parameterListUpToDate
()),
this
,
SIGNAL
(
parameterListUpToDate
()));
// Pass along data model updates
connect
(
&
paramDataModel
,
SIGNAL
(
parameterUpdated
(
int
,
QString
,
QVariant
)),
this
,
SIGNAL
(
parameterUpdated
(
int
,
QString
,
QVariant
)));
connect
(
&
paramDataModel
,
SIGNAL
(
pendingParamUpdate
(
int
,
const
QString
&
,
QVariant
,
bool
)),
this
,
SIGNAL
(
pendingParamUpdate
(
int
,
const
QString
&
,
QVariant
,
bool
)));
}
...
...
src/uas/QGCUASParamManager.h
View file @
4f1df9b3
...
...
@@ -72,6 +72,12 @@ signals:
/** @brief We have received a complete list of all parameters onboard the MAV */
void
parameterListUpToDate
();
/** @brief We've received an update of a parameter's value */
void
parameterUpdated
(
int
compId
,
QString
paramName
,
QVariant
value
);
/** @brief Notifies listeners that a param was added to or removed from the pending list */
void
pendingParamUpdate
(
int
compId
,
const
QString
&
paramName
,
QVariant
value
,
bool
isPending
);
public
slots
:
...
...
src/ui/QGCBaseParamWidget.cc
View file @
4f1df9b3
...
...
@@ -53,10 +53,10 @@ void QGCBaseParamWidget::connectToParamManager()
paramMgr
=
mav
->
getParamManager
();
//TODO route via paramManager instead?
// Listen to updated param signals from the data model
connect
(
paramMgr
->
dataModel
()
,
SIGNAL
(
parameterUpdated
(
int
,
QString
,
QVariant
)),
connect
(
paramMgr
,
SIGNAL
(
parameterUpdated
(
int
,
QString
,
QVariant
)),
this
,
SLOT
(
handleOnboardParamUpdate
(
int
,
QString
,
QVariant
)));
connect
(
paramMgr
->
dataModel
()
,
SIGNAL
(
pendingParamUpdate
(
int
,
const
QString
&
,
QVariant
,
bool
)),
connect
(
paramMgr
,
SIGNAL
(
pendingParamUpdate
(
int
,
const
QString
&
,
QVariant
,
bool
)),
this
,
SLOT
(
handlePendingParamUpdate
(
int
,
const
QString
&
,
QVariant
,
bool
)));
// Listen for param list reload finished
...
...
@@ -71,10 +71,10 @@ void QGCBaseParamWidget::connectToParamManager()
void
QGCBaseParamWidget
::
disconnectFromParamManager
()
{
disconnect
(
paramMgr
->
dataModel
()
,
SIGNAL
(
parameterUpdated
(
int
,
QString
,
QVariant
)),
disconnect
(
paramMgr
,
SIGNAL
(
parameterUpdated
(
int
,
QString
,
QVariant
)),
this
,
SLOT
(
handleOnboardParamUpdate
(
int
,
QString
,
QVariant
)));
disconnect
(
paramMgr
->
dataModel
()
,
SIGNAL
(
pendingParamUpdate
(
int
,
const
QString
&
,
QVariant
,
bool
)),
disconnect
(
paramMgr
,
SIGNAL
(
pendingParamUpdate
(
int
,
const
QString
&
,
QVariant
,
bool
)),
this
,
SLOT
(
handlePendingParamUpdate
(
int
,
const
QString
&
,
QVariant
,
bool
)));
disconnect
(
paramMgr
,
SIGNAL
(
parameterListUpToDate
()),
...
...
src/ui/QGCPendingParamWidget.cc
View file @
4f1df9b3
...
...
@@ -16,9 +16,9 @@ QGCPendingParamWidget::QGCPendingParamWidget(QObject *parent) :
void
QGCPendingParamWidget
::
connectToParamManager
()
{
paramMgr
=
mav
->
getParamManager
();
//TODO route via paramManager instead?
// Listen to updated param signals from the data model
connect
(
paramMgr
->
dataModel
()
,
SIGNAL
(
pendingParamUpdate
(
int
,
const
QString
&
,
QVariant
,
bool
)),
connect
(
paramMgr
,
SIGNAL
(
pendingParamUpdate
(
int
,
const
QString
&
,
QVariant
,
bool
)),
this
,
SLOT
(
handlePendingParamUpdate
(
int
,
const
QString
&
,
QVariant
,
bool
)));
// Listen to communications status messages so we can display them
...
...
@@ -29,9 +29,8 @@ void QGCPendingParamWidget::connectToParamManager()
void
QGCPendingParamWidget
::
disconnectFromParamManager
()
{
//TODO route via paramManager instead?
// Listen to updated param signals from the data model
disconnect
(
paramMgr
->
dataModel
()
,
SIGNAL
(
pendingParamUpdate
(
int
,
const
QString
&
,
QVariant
,
bool
)),
disconnect
(
paramMgr
,
SIGNAL
(
pendingParamUpdate
(
int
,
const
QString
&
,
QVariant
,
bool
)),
this
,
SLOT
(
handlePendingParamUpdate
(
int
,
const
QString
&
,
QVariant
,
bool
)));
// Listen to communications status messages so we can display them
...
...
@@ -76,7 +75,14 @@ void QGCPendingParamWidget::handlePendingParamUpdate(int compId, const QString&
}
else
{
//we don't display non-pending items
paramItem
->
parent
()
->
removeChild
(
paramItem
);
QTreeWidgetItem
*
parentItem
=
paramItem
->
parent
();
if
(
NULL
!=
parentItem
&&
1
==
parentItem
->
childCount
())
{
parentItem
->
parent
()
->
removeChild
(
parentItem
);
}
else
{
paramItem
->
parent
()
->
removeChild
(
paramItem
);
}
}
updatingParamNameLock
.
clear
();
...
...
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