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
fb50a3cd
Commit
fb50a3cd
authored
Aug 09, 2013
by
tstellanova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix slot wiring; debounce echo from data model
parent
d907b934
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
17 deletions
+21
-17
UASParameterCommsMgr.cc
src/uas/UASParameterCommsMgr.cc
+1
-5
QGCParamWidget.cc
src/ui/QGCParamWidget.cc
+19
-12
QGCParamWidget.h
src/ui/QGCParamWidget.h
+1
-0
No files found.
src/uas/UASParameterCommsMgr.cc
View file @
fb50a3cd
...
...
@@ -224,11 +224,7 @@ void UASParameterCommsMgr::resetAfterListReceive()
transmissionListMode
=
false
;
transmissionListSizeKnown
.
clear
();
//TODO we shouldn't clear missingPackets because other transactions might be using them?
//for list reception we only clear receive packets?
// foreach (int key, transmissionMissingPackets.keys()) {
// transmissionMissingPackets.value(key)->clear();
// }
//We shouldn't clear missingPackets because other transactions might be using them?
}
...
...
src/ui/QGCParamWidget.cc
View file @
fb50a3cd
...
...
@@ -66,8 +66,8 @@ QGCParamWidget::QGCParamWidget(UASInterface* uas, QWidget *parent) :
connect
(
paramDataModel
,
SIGNAL
(
parameterUpdated
(
int
,
QString
,
QVariant
)),
this
,
SLOT
(
handleParameterUpdate
(
int
,
QString
,
QVariant
)));
connect
(
paramDataModel
,
SIGNAL
(
pendingParamUpdate
(
int
compId
,
const
QString
&
paramName
,
QVariant
value
,
bool
isPending
)),
this
,
SLOT
(
handlePendingParamUpdate
(
int
compId
,
const
QString
&
paramName
,
QVariant
value
,
bool
isPending
)));
connect
(
paramDataModel
,
SIGNAL
(
pendingParamUpdate
(
int
,
const
QString
&
,
QVariant
,
bool
)),
this
,
SLOT
(
handlePendingParamUpdate
(
int
,
const
QString
&
,
QVariant
,
bool
)));
// Listen for param list reload finished
connect
(
paramCommsMgr
,
SIGNAL
(
parameterListUpToDate
()),
...
...
@@ -348,6 +348,7 @@ QTreeWidgetItem* QGCParamWidget::updateParameterDisplay(int compId, QString para
}
//update the parameterItem's data
updatedLineItem_weak
=
parameterItem
;
//keep a temporary ref to the item that's being updated
if
(
value
.
type
()
==
QVariant
::
Char
)
{
parameterItem
->
setData
(
1
,
Qt
::
DisplayRole
,
value
.
toUInt
());
}
...
...
@@ -363,24 +364,30 @@ QTreeWidgetItem* QGCParamWidget::updateParameterDisplay(int compId, QString para
parameterItem
->
setTextColor
(
0
,
QGC
::
colorDarkWhite
);
parameterItem
->
setTextColor
(
1
,
QGC
::
colorDarkWhite
);
updatedLineItem_weak
=
NULL
;
return
parameterItem
;
}
void
QGCParamWidget
::
parameterItemChanged
(
QTreeWidgetItem
*
current
,
int
column
)
void
QGCParamWidget
::
parameterItemChanged
(
QTreeWidgetItem
*
paramItem
,
int
column
)
{
if
(
current
&&
column
>
0
)
{
QTreeWidgetItem
*
parent
=
current
->
parent
();
if
(
paramItem
&&
column
>
0
)
{
if
(
paramItem
==
updatedLineItem_weak
)
{
//ignore updates reflected back from the data model, to avoid infinite loop
return
;
}
QTreeWidgetItem
*
parent
=
paramItem
->
parent
();
while
(
parent
->
parent
()
!=
NULL
)
{
parent
=
parent
->
parent
();
}
// Parent is now top-level component
int
componentId
=
componentItems
->
key
(
parent
);
QString
key
=
current
->
data
(
0
,
Qt
::
DisplayRole
).
toString
();
QVariant
value
=
current
->
data
(
1
,
Qt
::
DisplayRole
);
QString
key
=
paramItem
->
data
(
0
,
Qt
::
DisplayRole
).
toString
();
QVariant
value
=
paramItem
->
data
(
1
,
Qt
::
DisplayRole
);
bool
pending
=
paramDataModel
->
updatePendingParamWithValue
(
componentId
,
key
,
value
);
...
...
@@ -389,19 +396,19 @@ void QGCParamWidget::parameterItemChanged(QTreeWidgetItem* current, int column)
// Set parameter on changed list to be transmitted to MAV
statusLabel
->
setText
(
tr
(
"Pending: %1:%2: %3"
).
arg
(
componentId
).
arg
(
key
).
arg
(
value
.
toFloat
(),
5
,
'f'
,
1
,
QChar
(
' '
)));
if
(
current
==
tree
->
currentItem
())
{
if
(
paramItem
==
tree
->
currentItem
())
{
//need to unset current item to clear highlighting (green by default)
tree
->
setCurrentItem
(
NULL
);
//clear the selected line
}
current
->
setBackground
(
0
,
QBrush
(
QColor
(
QGC
::
colorOrange
)));
current
->
setBackground
(
1
,
QBrush
(
QColor
(
QGC
::
colorOrange
)));
paramItem
->
setBackground
(
0
,
QBrush
(
QColor
(
QGC
::
colorOrange
)));
paramItem
->
setBackground
(
1
,
QBrush
(
QColor
(
QGC
::
colorOrange
)));
}
else
{
QMap
<
QString
,
QVariant
>*
pendingParams
=
paramDataModel
->
getPendingParamsForComponent
(
componentId
);
int
pendingCount
=
pendingParams
->
count
();
statusLabel
->
setText
(
tr
(
"Pending items: %1"
).
arg
(
pendingCount
));
current
->
setBackground
(
0
,
Qt
::
NoBrush
);
current
->
setBackground
(
1
,
Qt
::
NoBrush
);
paramItem
->
setBackground
(
0
,
Qt
::
NoBrush
);
paramItem
->
setBackground
(
1
,
Qt
::
NoBrush
);
}
}
...
...
src/ui/QGCParamWidget.h
View file @
fb50a3cd
...
...
@@ -100,6 +100,7 @@ protected:
QLabel
*
statusLabel
;
///< User-facing parameter status label
QMap
<
int
,
QTreeWidgetItem
*>*
componentItems
;
///< The tree of component items, stored by component ID
QMap
<
int
,
QMap
<
QString
,
QTreeWidgetItem
*>*
>
paramGroups
;
///< Parameter groups to organize component items
QTreeWidgetItem
*
updatedLineItem_weak
;
///< weak ref to user-edited line
};
...
...
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