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
dd455b95
Commit
dd455b95
authored
Aug 06, 2013
by
tstellanova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
start moving comms mgmt code to a separate class
parent
189135d4
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
386 additions
and
33 deletions
+386
-33
qgroundcontrol.pro
qgroundcontrol.pro
+4
-2
QGCUASParamManager.cc
src/uas/QGCUASParamManager.cc
+32
-31
UASParameterCommsMgr.cc
src/uas/UASParameterCommsMgr.cc
+278
-0
UASParameterCommsMgr.h
src/uas/UASParameterCommsMgr.h
+72
-0
No files found.
qgroundcontrol.pro
View file @
dd455b95
...
...
@@ -469,7 +469,8 @@ HEADERS += src/MG.h \
src
/
ui
/
configuration
/
terminalconsole
.
h
\
src
/
ui
/
configuration
/
ApmHighlighter
.
h
\
src
/
ui
/
configuration
/
ApmFirmwareConfig
.
h
\
src
/
uas
/
UASParameterDataModel
.
h
src
/
uas
/
UASParameterDataModel
.
h
\
src
/
uas
/
UASParameterCommsMgr
.
h
#
Google
Earth
is
only
supported
on
Mac
OS
and
Windows
with
Visual
Studio
Compiler
macx
|
macx
-
g
++
|
macx
-
g
++
42
|
win32
-
msvc2008
|
win32
-
msvc2010
|
win32
-
msvc2012
::
HEADERS
+=
src
/
ui
/
map3D
/
QGCGoogleEarthView
.
h
...
...
@@ -685,7 +686,8 @@ SOURCES += src/main.cc \
src
/
ui
/
configuration
/
SerialSettingsDialog
.
cc
\
src
/
ui
/
configuration
/
ApmHighlighter
.
cc
\
src
/
ui
/
configuration
/
ApmFirmwareConfig
.
cc
\
src
/
uas
/
UASParameterDataModel
.
cc
src
/
uas
/
UASParameterDataModel
.
cc
\
src
/
uas
/
UASParameterCommsMgr
.
cc
#
Enable
Google
Earth
only
on
Mac
OS
and
Windows
with
Visual
Studio
compiler
macx
|
macx
-
g
++
|
macx
-
g
++
42
|
win32
-
msvc2008
|
win32
-
msvc2010
|
win32
-
msvc2012
::
SOURCES
+=
src
/
ui
/
map3D
/
QGCGoogleEarthView
.
cc
...
...
src/uas/QGCUASParamManager.cc
View file @
dd455b95
...
...
@@ -66,37 +66,6 @@ void QGCUASParamManager::requestParameterList()
}
/**
* 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
)
{
qDebug
()
<<
"parameterStatusMsg: "
<<
msg
;
parameterStatusMsg
=
msg
;
}
void
QGCUASParamManager
::
setParamDescriptions
(
const
QMap
<
QString
,
QString
>&
paramInfo
)
{
paramDataModel
->
setParamDescriptions
(
paramInfo
);
}
void
QGCUASParamManager
::
retransmissionGuardTick
()
{
if
(
transmissionActive
)
{
...
...
@@ -199,3 +168,35 @@ void QGCUASParamManager::retransmissionGuardTick()
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
)
{
qDebug
()
<<
"parameterStatusMsg: "
<<
msg
;
parameterStatusMsg
=
msg
;
}
void
QGCUASParamManager
::
setParamDescriptions
(
const
QMap
<
QString
,
QString
>&
paramInfo
)
{
paramDataModel
->
setParamDescriptions
(
paramInfo
);
}
src/uas/UASParameterCommsMgr.cc
0 → 100644
View file @
dd455b95
This diff is collapsed.
Click to expand it.
src/uas/UASParameterCommsMgr.h
0 → 100644
View file @
dd455b95
#ifndef UASPARAMETERCOMMSMGR_H
#define UASPARAMETERCOMMSMGR_H
#include <QObject>
#include <QMap>
#include <QTimer>
#include <QVariant>
#include <QVector>
class
UASInterface
;
class
UASParameterDataModel
;
class
UASParameterCommsMgr
:
public
QObject
{
Q_OBJECT
public:
explicit
UASParameterCommsMgr
(
QObject
*
parent
=
0
,
UASInterface
*
uas
=
NULL
);
protected:
/** @brief Activate / deactivate parameter retransmission */
virtual
void
setRetransmissionGuardEnabled
(
bool
enabled
);
virtual
void
setParameterStatusMsg
(
const
QString
&
msg
);
signals:
void
parameterChanged
(
int
component
,
QString
parameter
,
QVariant
value
);
void
parameterChanged
(
int
component
,
int
parameterIndex
,
QVariant
value
);
void
parameterValueConfirmed
(
int
component
,
QString
parameter
,
QVariant
value
);
void
parameterListUpToDate
(
int
component
);
void
parameterUpdateRequested
(
int
component
,
const
QString
&
parameter
);
void
parameterUpdateRequestedById
(
int
componentId
,
int
paramId
);
public
slots
:
/** @brief Write one parameter to the MAV */
virtual
void
setParameter
(
int
component
,
QString
parameterName
,
QVariant
value
);
/** @brief Request list of parameters from MAV */
virtual
void
requestParameterList
();
/** @brief Check for missing parameters */
virtual
void
retransmissionGuardTick
();
/** @brief Request a single parameter update by name */
virtual
void
requestParameterUpdate
(
int
component
,
const
QString
&
parameter
);
protected:
UASInterface
*
mav
;
///< The MAV we're talking to
UASParameterDataModel
*
paramDataModel
;
// Communications management
QVector
<
bool
>
receivedParamsList
;
///< Successfully received parameters
QMap
<
int
,
QList
<
int
>*
>
transmissionMissingPackets
;
///< Missing packets
QMap
<
int
,
QMap
<
QString
,
QVariant
>*
>
transmissionMissingWriteAckPackets
;
///< Missing write ACK packets
bool
transmissionListMode
;
///< Currently requesting list
QMap
<
int
,
bool
>
transmissionListSizeKnown
;
///< List size initialized?
bool
transmissionActive
;
///< Missing packets, working on list?
quint64
transmissionTimeout
;
///< Timeout
QTimer
retransmissionTimer
;
///< Timer handling parameter retransmission
int
retransmissionTimeout
;
///< Retransmission request timeout, in milliseconds
int
rewriteTimeout
;
///< Write request timeout, in milliseconds
int
retransmissionBurstRequestSize
;
///< Number of packets requested for retransmission per burst
// Status
QString
parameterStatusMsg
;
};
#endif // UASPARAMETERCOMMSMGR_H
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