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
cade16c1
Commit
cade16c1
authored
Aug 08, 2013
by
tstellanova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Debug parameter list receive; remove cruft
parent
3090fcf2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
157 deletions
+15
-157
UASParameterCommsMgr.cc
src/uas/UASParameterCommsMgr.cc
+15
-7
QGCParamWidget.cc
src/ui/QGCParamWidget.cc
+0
-150
No files found.
src/uas/UASParameterCommsMgr.cc
View file @
cade16c1
...
...
@@ -99,13 +99,15 @@ void UASParameterCommsMgr::requestParameterList()
void
UASParameterCommsMgr
::
retransmissionGuardTick
()
{
if
(
transmissionActive
)
{
if
(
transmissionListMode
&&
transmissionListSizeKnown
.
isEmpty
()
)
{
//we are still waitin for the first parameter list response
if
(
QGC
::
groundTimeMilliseconds
()
>
this
->
listRecvTimeout
)
{
//re-request parameters
setParameterStatusMsg
(
tr
(
"TIMEOUT: Re-requesting param list"
),
ParamCommsStatusLevel_Warning
);
listRecvTimeout
=
QGC
::
groundTimeMilliseconds
()
+
10000
;
mav
->
requestParameters
();
if
(
transmissionListMode
)
{
if
(
transmissionListSizeKnown
.
isEmpty
()
)
{
//we are still waitin for the first parameter list response
if
(
QGC
::
groundTimeMilliseconds
()
>
this
->
listRecvTimeout
)
{
//re-request parameters
setParameterStatusMsg
(
tr
(
"TIMEOUT: Re-requesting param list"
),
ParamCommsStatusLevel_Warning
);
listRecvTimeout
=
QGC
::
groundTimeMilliseconds
()
+
10000
;
mav
->
requestParameters
();
}
}
return
;
}
...
...
@@ -486,6 +488,12 @@ void UASParameterCommsMgr::receivedParameterUpdate(int uas, int compId, int para
//all parameters have been received, broadcast to UI
emit
parameterListUpToDate
();
}
else
{
qDebug
()
<<
"missCount:"
<<
missCount
<<
"missWriteCount:"
<<
missWriteCount
;
foreach
(
int
key
,
transmissionMissingPackets
.
keys
())
{
qDebug
()
<<
"Missing:"
<<
key
;
}
}
}
...
...
src/ui/QGCParamWidget.cc
View file @
cade16c1
...
...
@@ -194,156 +194,6 @@ void QGCParamWidget::addComponentItem( int compId, QString compName)
}
/**
* @param uas System which has the component
* @param component id of the component
* @param parameterName human friendly name of the parameter
*/
//void QGCParamWidget::receivedParameterUpdate(int uas, int component, int paramCount, int paramId, QString parameterName, QVariant value)
//{
// updateParameterDisplay(component, parameterName, value);
// // Missing packets list has to be instantiated for all components
// if (!transmissionMissingPackets.contains(component)) {
// transmissionMissingPackets.insert(component, new QList<int>());
// }
// // List mode is different from single parameter transfers
// if (transmissionListMode) {
// // Only accept the list size once on the first packet from
// // each component
// if (!transmissionListSizeKnown.contains(component))
// {
// // Mark list size as known
// transmissionListSizeKnown.insert(component, true);
// // Mark all parameters as missing
// for (int i = 0; i < paramCount; ++i)
// {
// if (!transmissionMissingPackets.value(component)->contains(i))
// {
// transmissionMissingPackets.value(component)->append(i);
// }
// }
// // There is only one transmission timeout for all components
// // since components do not manage their transmission,
// // the longest timeout is safe for all components.
// quint64 thisTransmissionTimeout = QGC::groundTimeMilliseconds() + ((paramCount)*retransmissionTimeout);
// if (thisTransmissionTimeout > transmissionTimeout)
// {
// transmissionTimeout = thisTransmissionTimeout;
// }
// }
// // Start retransmission guard
// // or reset timer
// paramCommsMgr->setRetransmissionGuardEnabled(true); //TODO
// }
// // Mark this parameter as received in read list
// int index = transmissionMissingPackets.value(component)->indexOf(paramId);
// // If the MAV sent the parameter without request, it wont be in missing list
// if (index != -1) transmissionMissingPackets.value(component)->removeAt(index);
// bool justWritten = false;
// bool writeMismatch = false;
// //bool lastWritten = false;
// // Mark this parameter as received in write ACK list
// QMap<QString, QVariant>* map = transmissionMissingWriteAckPackets.value(component);
// if (map && map->contains(parameterName))
// {
// justWritten = true;
// QVariant newval = map->value(parameterName);
// if (map->value(parameterName) != value)
// {
// writeMismatch = true;
// }
// map->remove(parameterName);
// }
// int missCount = 0;
// foreach (int key, transmissionMissingPackets.keys())
// {
// missCount += transmissionMissingPackets.value(key)->count();
// }
// int missWriteCount = 0;
// foreach (int key, transmissionMissingWriteAckPackets.keys())
// {
// missWriteCount += transmissionMissingWriteAckPackets.value(key)->count();
// }
// if (justWritten && !writeMismatch && missWriteCount == 0)
// {
// // Just wrote one and count went to 0 - this was the last missing write parameter
// statusLabel->setText(tr("SUCCESS: WROTE ALL PARAMETERS"));
// QPalette pal = statusLabel->palette();
// pal.setColor(backgroundRole(), QGC::colorGreen);
// statusLabel->setPalette(pal);
// } else if (justWritten && !writeMismatch)
// {
// statusLabel->setText(tr("SUCCESS: Wrote %2 (#%1/%4): %3").arg(paramId+1).arg(parameterName).arg(value.toDouble()).arg(paramCount));
// QPalette pal = statusLabel->palette();
// pal.setColor(backgroundRole(), QGC::colorGreen);
// statusLabel->setPalette(pal);
// } else if (justWritten && writeMismatch)
// {
// // Mismatch, tell user
// QPalette pal = statusLabel->palette();
// pal.setColor(backgroundRole(), QGC::colorRed);
// statusLabel->setPalette(pal);
// statusLabel->setText(tr("FAILURE: Wrote %1: sent %2 != onboard %3").arg(parameterName).arg(map->value(parameterName).toDouble()).arg(value.toDouble()));
// }
// else
// {
// if (missCount > 0)
// {
// QPalette pal = statusLabel->palette();
// pal.setColor(backgroundRole(), QGC::colorOrange);
// statusLabel->setPalette(pal);
// }
// else
// {
// QPalette pal = statusLabel->palette();
// pal.setColor(backgroundRole(), QGC::colorGreen);
// statusLabel->setPalette(pal);
// }
// QString val = QString("%1").arg(value.toFloat(), 5, 'f', 1, QChar(' '));
// //statusLabel->setText(tr("OK: %1 %2 #%3/%4, %5 miss").arg(parameterName).arg(val).arg(paramId+1).arg(paramCount).arg(missCount));
// if (missCount == 0)
// {
// // Transmission done
// QTime time = QTime::currentTime();
// QString timeString = time.toString();
// statusLabel->setText(tr("All received. (updated at %1)").arg(timeString));
// }
// else
// {
// // Transmission in progress
// statusLabel->setText(tr("OK: %1 %2 (%3/%4)").arg(parameterName).arg(val).arg(paramCount-missCount).arg(paramCount));
// }
// }
// // 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();
// }
// // Expand visual tree
// tree->expandItem(tree->topLevelItem(0));
// }
//}
void
QGCParamWidget
::
handleParameterUpdate
(
int
componentId
,
const
QString
&
paramName
,
QVariant
value
)
{
updateParameterDisplay
(
componentId
,
paramName
,
value
);
...
...
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