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
5f00489f
Commit
5f00489f
authored
Aug 09, 2013
by
tstellanova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clear guard timer when list mode done
parent
7037ca90
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
45 deletions
+99
-45
UASParameterCommsMgr.cc
src/uas/UASParameterCommsMgr.cc
+26
-16
UASParameterCommsMgr.h
src/uas/UASParameterCommsMgr.h
+1
-0
QGCParamWidget.cc
src/ui/QGCParamWidget.cc
+72
-29
No files found.
src/uas/UASParameterCommsMgr.cc
View file @
5f00489f
...
...
@@ -106,16 +106,16 @@ void UASParameterCommsMgr::clearRetransmissionLists(int& missingReadCount, int&
missingReadCount
=
0
;
QList
<
int
>
readKeys
=
transmissionMissingPackets
.
keys
();
foreach
(
int
comp
onent
,
readKeys
)
{
missingReadCount
+=
transmissionMissingPackets
.
value
(
comp
onent
)
->
count
();
transmissionMissingPackets
.
value
(
comp
onent
)
->
clear
();
foreach
(
int
comp
Id
,
readKeys
)
{
missingReadCount
+=
transmissionMissingPackets
.
value
(
comp
Id
)
->
count
();
transmissionMissingPackets
.
value
(
comp
Id
)
->
clear
();
}
missingWriteCount
=
0
;
QList
<
int
>
writeKeys
=
transmissionMissingWriteAckPackets
.
keys
();
foreach
(
int
comp
onent
,
writeKeys
)
{
missingWriteCount
+=
transmissionMissingWriteAckPackets
.
value
(
comp
onent
)
->
count
();
transmissionMissingWriteAckPackets
.
value
(
comp
onent
)
->
clear
();
foreach
(
int
comp
Id
,
writeKeys
)
{
missingWriteCount
+=
transmissionMissingWriteAckPackets
.
value
(
comp
Id
)
->
count
();
transmissionMissingWriteAckPackets
.
value
(
comp
Id
)
->
clear
();
}
}
...
...
@@ -209,10 +209,26 @@ void UASParameterCommsMgr::resendReadWriteRequests()
if
((
0
==
requestedWriteCount
)
&&
(
0
==
requestedReadCount
)
)
{
qDebug
()
<<
__FILE__
<<
__LINE__
<<
"NO re-read or rewrite requests??"
;
//setRetransmissionGuardEnabled(false);
if
(
!
transmissionListMode
)
{
setRetransmissionGuardEnabled
(
false
);
transmissionActive
=
false
;
}
}
}
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();
// }
}
void
UASParameterCommsMgr
::
retransmissionGuardTick
()
{
if
(
transmissionActive
)
{
...
...
@@ -233,8 +249,8 @@ void UASParameterCommsMgr::retransmissionGuardTick()
// stop retransmission attempts on timeout
if
(
QGC
::
groundTimeMilliseconds
()
>
transmissionTimeout
)
{
setRetransmissionGuardEnabled
(
false
);
transmissionActive
=
false
;
transmissionListMode
=
false
;
resetAfterListReceive
()
;
int
missingReadCount
,
missingWriteCount
;
clearRetransmissionLists
(
missingReadCount
,
missingWriteCount
);
if
((
missingReadCount
>
0
)
||
(
missingWriteCount
>
0
))
{
...
...
@@ -491,13 +507,7 @@ void UASParameterCommsMgr::receivedParameterUpdate(int uas, int compId, int para
// Check if last parameter was received
if
(
missCount
==
0
&&
missWriteCount
==
0
)
{
this
->
transmissionActive
=
false
;
this
->
transmissionListMode
=
false
;
transmissionListSizeKnown
.
clear
();
foreach
(
int
key
,
transmissionMissingPackets
.
keys
())
{
transmissionMissingPackets
.
value
(
key
)
->
clear
();
}
resetAfterListReceive
();
setRetransmissionGuardEnabled
(
false
);
//all parameters have been received, broadcast to UI
emit
parameterListUpToDate
();
...
...
src/uas/UASParameterCommsMgr.h
View file @
5f00489f
...
...
@@ -42,6 +42,7 @@ protected:
void
clearRetransmissionLists
(
int
&
missingReadCount
,
int
&
missingWriteCount
);
void
resendReadWriteRequests
();
void
resetAfterListReceive
();
void
emitParameterChanged
(
int
compId
,
const
QString
&
key
,
QVariant
&
value
);
...
...
src/ui/QGCParamWidget.cc
View file @
5f00489f
...
...
@@ -245,6 +245,9 @@ void QGCParamWidget::updateParameterDisplay(int compId, QString parameterName, Q
addComponentItem
(
compId
,
componentName
);
}
//default parent item for this parameter widget item will be the top level component item
QTreeWidgetItem
*
parentItem
=
componentItems
->
value
(
compId
);
QString
splitToken
=
"_"
;
// Check if auto-grouping can work
if
(
parameterName
.
contains
(
splitToken
))
{
...
...
@@ -265,8 +268,75 @@ void QGCParamWidget::updateParameterDisplay(int compId, QString parameterName, Q
}
// Append child to group
//bool found = false;
//parent item for this tree widget item will be a group widget item
parentItem
=
compParamGroups
->
value
(
parentStr
);
// 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;
// if (value.type() == QVariant::Char) {
// parameterItem->setData(1, Qt::DisplayRole, value.toUInt());
// }
// else {
// parameterItem->setData(1, Qt::DisplayRole, value);
// }
// found = true;
// }
// }
// if (!found) {
// // Insert parameter into map
// QStringList plist;
// plist.append(parameterName);
// // CREATE PARAMETER ITEM
// parameterItem = new QTreeWidgetItem(plist);
// // CONFIGURE PARAMETER ITEM
// if (value.type() == QVariant::Char) {
// parameterItem->setData(1, Qt::DisplayRole, value.toUInt());
// }
// else {
// parameterItem->setData(1, Qt::DisplayRole, value);
// }
// parameterItem->setFlags(parameterItem->flags() | Qt::ItemIsEditable);
// parentItem->addChild(parameterItem);
// }
}
else
{
//bool found = false;
parentItem
=
componentItems
->
value
(
compId
);
// for (int i = 0; i < parent->childCount(); i++) {
// QTreeWidgetItem* child = parent->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);
// // CREATE PARAMETER ITEM
// parameterItem = new QTreeWidgetItem(plist);
// // CONFIGURE PARAMETER ITEM
// parameterItem->setData(1, Qt::DisplayRole, value);
// componentItems->value(compId)->addChild(parameterItem);
// parameterItem->setFlags(parameterItem->flags() | Qt::ItemIsEditable);
// }
}
if
(
parentItem
)
{
bool
found
=
false
;
QTreeWidgetItem
*
parentItem
=
compParamGroups
->
value
(
parentStr
);
for
(
int
i
=
0
;
i
<
parentItem
->
childCount
();
i
++
)
{
QTreeWidgetItem
*
child
=
parentItem
->
child
(
i
);
QString
key
=
child
->
data
(
0
,
Qt
::
DisplayRole
).
toString
();
...
...
@@ -296,36 +366,9 @@ void QGCParamWidget::updateParameterDisplay(int compId, QString parameterName, Q
else
{
parameterItem
->
setData
(
1
,
Qt
::
DisplayRole
,
value
);
}
compParamGroups
->
value
(
parentStr
)
->
addChild
(
parameterItem
);
parameterItem
->
setFlags
(
parameterItem
->
flags
()
|
Qt
::
ItemIsEditable
);
}
}
else
{
bool
found
=
false
;
QTreeWidgetItem
*
parent
=
componentItems
->
value
(
compId
);
for
(
int
i
=
0
;
i
<
parent
->
childCount
();
i
++
)
{
QTreeWidgetItem
*
child
=
parent
->
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
);
// CREATE PARAMETER ITEM
parameterItem
=
new
QTreeWidgetItem
(
plist
);
// CONFIGURE PARAMETER ITEM
parameterItem
->
setData
(
1
,
Qt
::
DisplayRole
,
value
);
componentItems
->
value
(
compId
)
->
addChild
(
parameterItem
);
parameterItem
->
setFlags
(
parameterItem
->
flags
()
|
Qt
::
ItemIsEditable
);
parentItem
->
addChild
(
parameterItem
);
}
}
...
...
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