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
d8e54be4
Commit
d8e54be4
authored
Aug 08, 2013
by
tstellanova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix statusMsgUpdate wiring; remove cruft
parent
055ad29f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
136 deletions
+16
-136
QGCUASParamManager.cc
src/uas/QGCUASParamManager.cc
+0
-122
UASParameterCommsMgr.cc
src/uas/UASParameterCommsMgr.cc
+7
-12
UASParameterCommsMgr.h
src/uas/UASParameterCommsMgr.h
+3
-1
UASWaypointManager.cc
src/uas/UASWaypointManager.cc
+3
-1
QGCParamWidget.cc
src/ui/QGCParamWidget.cc
+3
-0
No files found.
src/uas/QGCUASParamManager.cc
View file @
d8e54be4
...
@@ -70,128 +70,6 @@ void QGCUASParamManager::requestParameterList()
...
@@ -70,128 +70,6 @@ void QGCUASParamManager::requestParameterList()
paramCommsMgr
->
requestParameterList
();
paramCommsMgr
->
requestParameterList
();
}
}
//void QGCUASParamManager::retransmissionGuardTick()
//{
// if (transmissionActive) {
// //qDebug() << __FILE__ << __LINE__ << "RETRANSMISSION GUARD ACTIVE, CHECKING FOR DROPS..";
// // Check for timeout
// // stop retransmission attempts on timeout
// if (QGC::groundTimeMilliseconds() > transmissionTimeout) {
// setRetransmissionGuardEnabled(false);
// transmissionActive = false;
// // Empty read retransmission list
// // Empty write retransmission list
// int missingReadCount = 0;
// QList<int> readKeys = transmissionMissingPackets.keys();
// foreach (int component, readKeys) {
// missingReadCount += transmissionMissingPackets.value(component)->count();
// transmissionMissingPackets.value(component)->clear();
// }
// // Empty write retransmission list
// int missingWriteCount = 0;
// QList<int> writeKeys = transmissionMissingWriteAckPackets.keys();
// foreach (int component, writeKeys) {
// missingWriteCount += transmissionMissingWriteAckPackets.value(component)->count();
// transmissionMissingWriteAckPackets.value(component)->clear();
// }
// setParameterStatusMsg(tr("TIMEOUT! MISSING: %1 read, %2 write.").arg(missingReadCount).arg(missingWriteCount));
// }
// // Re-request at maximum retransmissionBurstRequestSize parameters at once
// // to prevent link flooding
// QMap<int, QMap<QString, QVariant>*>::iterator i;
// QMap<int, QMap<QString, QVariant>*> onboardParams = paramDataModel->getOnboardParameters();
// for (i = onboardParams.begin(); i != onboardParams.end(); ++i) {
// // Iterate through the parameters of the component
// int component = i.key();
// // Request n parameters from this component (at maximum)
// QList<int> * paramList = transmissionMissingPackets.value(component, NULL);
// if (paramList) {
// int count = 0;
// foreach (int id, *paramList) {
// if (count < retransmissionBurstRequestSize) {
// //qDebug() << __FILE__ << __LINE__ << "RETRANSMISSION GUARD REQUESTS RETRANSMISSION OF PARAM #" << id << "FROM COMPONENT #" << component;
// //TODO mavlink msg type for "request parameter set" ?
// emit parameterUpdateRequestedById(component, id);
// setParameterStatusMsg(tr("Requested retransmission of #%1").arg(id+1));
// count++;
// } else {
// break;
// }
// }
// }
// }
// // Re-request at maximum retransmissionBurstRequestSize parameters at once
// // to prevent write-request link flooding
// // Empty write retransmission list
// QList<int> writeKeys = transmissionMissingWriteAckPackets.keys();
// foreach (int component, writeKeys) {
// int count = 0;
// QMap <QString, QVariant>* missingParams = transmissionMissingWriteAckPackets.value(component);
// foreach (QString key, missingParams->keys()) {
// if (count < retransmissionBurstRequestSize) {
// // Re-request write operation
// QVariant value = missingParams->value(key);
// switch ((int)onboardParams.value(component)->value(key).type())
// {
// case QVariant::Int:
// {
// QVariant fixedValue(value.toInt());
// emit parameterChanged(component, key, fixedValue);
// }
// break;
// case QVariant::UInt:
// {
// QVariant fixedValue(value.toUInt());
// emit parameterChanged(component, key, fixedValue);
// }
// break;
// case QMetaType::Float:
// {
// QVariant fixedValue(value.toFloat());
// emit parameterChanged(component, key, fixedValue);
// }
// break;
// default:
// //qCritical() << "ABORTED PARAM RETRANSMISSION, NO VALID QVARIANT TYPE";
// return;
// }
// setParameterStatusMsg(tr("Requested rewrite of: %1: %2").arg(key).arg(missingParams->value(key).toDouble()));
// count++;
// } else {
// break;
// }
// }
// }
// } else {
// //qDebug() << __FILE__ << __LINE__ << "STOPPING RETRANSMISSION GUARD GRACEFULLY";
// setRetransmissionGuardEnabled(false);
// }
//}
//*
// * Enabling the retransmission guard enables the parameter widget to track
// * dropped parameters and to re-request them. This works for both individual
// * parameter reads as well for whole list requests.
// *
// * @param enabled True if retransmission checking should be enabled, false else
//void QGCUASParamManager::setRetransmissionGuardEnabled(bool enabled)
//{
// qDebug() << "setRetransmissionGuardEnabled: " << enabled;
//
// if (enabled) {
// retransmissionTimer.start(retransmissionTimeout);
// } else {
// retransmissionTimer.stop();
// }
//}
void
QGCUASParamManager
::
setParameterStatusMsg
(
const
QString
&
msg
)
void
QGCUASParamManager
::
setParameterStatusMsg
(
const
QString
&
msg
)
{
{
...
...
src/uas/UASParameterCommsMgr.cc
View file @
d8e54be4
...
@@ -94,7 +94,7 @@ void UASParameterCommsMgr::requestParameterList()
...
@@ -94,7 +94,7 @@ void UASParameterCommsMgr::requestParameterList()
void
UASParameterCommsMgr
::
retransmissionGuardTick
()
void
UASParameterCommsMgr
::
retransmissionGuardTick
()
{
{
if
(
transmissionActive
)
{
if
(
transmissionActive
)
{
//
qDebug() << __FILE__ << __LINE__ << "RETRANSMISSION GUARD ACTIVE, CHECKING FOR DROPS..";
qDebug
()
<<
__FILE__
<<
__LINE__
<<
"RETRANSMISSION GUARD ACTIVE, CHECKING FOR DROPS.."
;
// Check for timeout
// Check for timeout
// stop retransmission attempts on timeout
// stop retransmission attempts on timeout
...
@@ -189,7 +189,7 @@ void UASParameterCommsMgr::retransmissionGuardTick()
...
@@ -189,7 +189,7 @@ void UASParameterCommsMgr::retransmissionGuardTick()
}
}
}
}
}
else
{
}
else
{
//
qDebug() << __FILE__ << __LINE__ << "STOPPING RETRANSMISSION GUARD GRACEFULLY";
qDebug
()
<<
__FILE__
<<
__LINE__
<<
"STOPPING RETRANSMISSION GUARD GRACEFULLY"
;
setRetransmissionGuardEnabled
(
false
);
setRetransmissionGuardEnabled
(
false
);
}
}
}
}
...
@@ -353,16 +353,6 @@ void UASParameterCommsMgr::setParameterStatusMsg(const QString& msg, ParamCommsS
...
@@ -353,16 +353,6 @@ void UASParameterCommsMgr::setParameterStatusMsg(const QString& msg, ParamCommsS
parameterStatusMsg
=
msg
;
parameterStatusMsg
=
msg
;
emit
parameterStatusMsgUpdated
(
msg
,
level
);
emit
parameterStatusMsgUpdated
(
msg
,
level
);
//TODO indicate OK status somehow (eg color)
// QPalette pal = statusLabel->palette();
// pal.setColor(backgroundRole(), QGC::colorGreen);
// statusLabel->setPalette(pal);
// pal.setColor(backgroundRole(), QGC::colorRed);
// pal.setColor(backgroundRole(), QGC::colorOrange);
}
}
...
@@ -534,3 +524,8 @@ void UASParameterCommsMgr::sendPendingParameters()
...
@@ -534,3 +524,8 @@ void UASParameterCommsMgr::sendPendingParameters()
}
}
}
}
UASParameterCommsMgr
::~
UASParameterCommsMgr
()
{
setRetransmissionGuardEnabled
(
false
);
}
src/uas/UASParameterCommsMgr.h
View file @
d8e54be4
...
@@ -19,6 +19,8 @@ class UASParameterCommsMgr : public QObject
...
@@ -19,6 +19,8 @@ class UASParameterCommsMgr : public QObject
public:
public:
explicit
UASParameterCommsMgr
(
QObject
*
parent
=
0
,
UASInterface
*
uas
=
NULL
);
explicit
UASParameterCommsMgr
(
QObject
*
parent
=
0
,
UASInterface
*
uas
=
NULL
);
~
UASParameterCommsMgr
();
typedef
enum
ParamCommsStatusLevel
{
typedef
enum
ParamCommsStatusLevel
{
ParamCommsStatusLevel_OK
=
0
,
ParamCommsStatusLevel_OK
=
0
,
ParamCommsStatusLevel_Warning
=
2
,
ParamCommsStatusLevel_Warning
=
2
,
...
@@ -48,7 +50,7 @@ signals:
...
@@ -48,7 +50,7 @@ signals:
void
parameterUpdateRequestedById
(
int
componentId
,
int
paramId
);
void
parameterUpdateRequestedById
(
int
componentId
,
int
paramId
);
/** @brief We updated the parameter status message */
/** @brief We updated the parameter status message */
void
parameterStatusMsgUpdated
(
QString
msg
,
ParamCommsStatusLevel_
t
level
);
void
parameterStatusMsgUpdated
(
QString
msg
,
in
t
level
);
public
slots
:
public
slots
:
/** @brief Iterate through all components, through all pending parameters and send them to UAS */
/** @brief Iterate through all components, through all pending parameters and send them to UAS */
...
...
src/uas/UASWaypointManager.cc
View file @
d8e54be4
...
@@ -975,7 +975,9 @@ void UASWaypointManager::sendWaypointRequestList()
...
@@ -975,7 +975,9 @@ void UASWaypointManager::sendWaypointRequestList()
wprl
.
target_system
=
uasid
;
wprl
.
target_system
=
uasid
;
wprl
.
target_component
=
MAV_COMP_ID_MISSIONPLANNER
;
wprl
.
target_component
=
MAV_COMP_ID_MISSIONPLANNER
;
emit
updateStatusString
(
QString
(
"Requesting waypoint list..."
));
QString
statusMsg
(
tr
(
"Requesting waypoint list..."
));
qDebug
()
<<
__FILE__
<<
__LINE__
<<
statusMsg
;
emit
updateStatusString
(
statusMsg
);
mavlink_msg_mission_request_list_encode
(
uas
->
mavlink
->
getSystemId
(),
uas
->
mavlink
->
getComponentId
(),
&
message
,
&
wprl
);
mavlink_msg_mission_request_list_encode
(
uas
->
mavlink
->
getSystemId
(),
uas
->
mavlink
->
getComponentId
(),
&
message
,
&
wprl
);
uas
->
sendMessage
(
message
);
uas
->
sendMessage
(
message
);
...
...
src/ui/QGCParamWidget.cc
View file @
d8e54be4
...
@@ -154,6 +154,9 @@ QGCParamWidget::QGCParamWidget(UASInterface* uas, QWidget *parent) :
...
@@ -154,6 +154,9 @@ QGCParamWidget::QGCParamWidget(UASInterface* uas, QWidget *parent) :
connect
(
paramCommsMgr
,
SIGNAL
(
parameterListUpToDate
()),
connect
(
paramCommsMgr
,
SIGNAL
(
parameterListUpToDate
()),
this
,
SLOT
(
handleParameterListUpToDate
()));
this
,
SLOT
(
handleParameterListUpToDate
()));
connect
(
paramCommsMgr
,
SIGNAL
(
parameterStatusMsgUpdated
(
QString
,
int
)),
this
,
SLOT
(
handleParamStatusMsgUpdate
(
QString
,
int
)));
// Get parameters
// Get parameters
if
(
uas
)
{
if
(
uas
)
{
requestAllParamsUpdate
();
requestAllParamsUpdate
();
...
...
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