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
9c6775fb
Commit
9c6775fb
authored
Feb 13, 2011
by
lm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added setting for action retransmission, implementation of actual retransmission pending
parent
e3fcf441
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
99 additions
and
7 deletions
+99
-7
MAVLinkProtocol.cc
src/comm/MAVLinkProtocol.cc
+20
-0
MAVLinkProtocol.h
src/comm/MAVLinkProtocol.h
+20
-4
MAVLinkSettingsWidget.cc
src/ui/MAVLinkSettingsWidget.cc
+15
-2
MAVLinkSettingsWidget.ui
src/ui/MAVLinkSettingsWidget.ui
+44
-1
No files found.
src/comm/MAVLinkProtocol.cc
View file @
9c6775fb
...
...
@@ -47,6 +47,8 @@ MAVLinkProtocol::MAVLinkProtocol() :
m_paramRetransmissionTimeout
(
350
),
m_paramRewriteTimeout
(
500
),
m_paramGuardEnabled
(
true
),
m_actionGuardEnabled
(
false
),
m_actionRetransmissionTimeout
(
100
),
versionMismatchIgnore
(
false
),
systemId
(
QGC
::
defaultSystemId
)
{
...
...
@@ -442,6 +444,15 @@ void MAVLinkProtocol::enableParamGuard(bool enabled)
}
}
void
MAVLinkProtocol
::
enableActionGuard
(
bool
enabled
)
{
if
(
enabled
!=
m_actionGuardEnabled
)
{
m_actionGuardEnabled
=
enabled
;
emit
actionGuardChanged
(
m_actionGuardEnabled
);
}
}
void
MAVLinkProtocol
::
setParamRetransmissionTimeout
(
int
ms
)
{
if
(
ms
!=
m_paramRetransmissionTimeout
)
...
...
@@ -460,6 +471,15 @@ void MAVLinkProtocol::setParamRewriteTimeout(int ms)
}
}
void
MAVLinkProtocol
::
setActionRetransmissionTimeout
(
int
ms
)
{
if
(
ms
!=
m_actionRetransmissionTimeout
)
{
m_actionRetransmissionTimeout
=
ms
;
emit
actionRetransmissionTimeoutChanged
(
m_actionRetransmissionTimeout
);
}
}
void
MAVLinkProtocol
::
enableLogging
(
bool
enabled
)
{
bool
changed
=
false
;
...
...
src/comm/MAVLinkProtocol.h
View file @
9c6775fb
...
...
@@ -77,12 +77,16 @@ public:
int
getVersion
()
{
return
MAVLINK_VERSION
;
}
/** @brief Get the name of the packet log file */
QString
getLogfileName
();
/** @brief
Enable / disable
parameter retransmission */
/** @brief
Get state of
parameter retransmission */
bool
paramGuardEnabled
()
{
return
m_paramGuardEnabled
;
}
/** @brief
S
et parameter read timeout */
/** @brief
G
et parameter read timeout */
int
getParamRetransmissionTimeout
()
{
return
m_paramRetransmissionTimeout
;
}
/** @brief
Set parameter wrti
e timeout */
/** @brief
Get parameter writ
e timeout */
int
getParamRewriteTimeout
()
{
return
m_paramRewriteTimeout
;
}
/** @brief Get state of action retransmission */
bool
actionGuardEnabled
()
{
return
m_actionGuardEnabled
;
}
/** @brief Get parameter read timeout */
int
getActionRetransmissionTimeout
()
{
return
m_actionRetransmissionTimeout
;
}
public
slots
:
/** @brief Receive bytes from a communication interface */
...
...
@@ -108,12 +112,18 @@ public slots:
/** @brief Enable / disable parameter retransmission */
void
enableParamGuard
(
bool
enabled
);
/** @brief Enable / disable action retransmission */
void
enableActionGuard
(
bool
enabled
);
/** @brief Set parameter read timeout */
void
setParamRetransmissionTimeout
(
int
ms
);
/** @brief Set parameter write timeout */
void
setParamRewriteTimeout
(
int
ms
);
/** @brief Set parameter read timeout */
void
setActionRetransmissionTimeout
(
int
ms
);
/** @brief Set log file name */
void
setLogfileName
(
const
QString
&
filename
);
...
...
@@ -138,7 +148,9 @@ protected:
bool
m_enable_version_check
;
///< Enable checking of version match of MAV and QGC
int
m_paramRetransmissionTimeout
;
///< Timeout for parameter retransmission
int
m_paramRewriteTimeout
;
///< Timeout for sending re-write request
bool
m_paramGuardEnabled
;
///< Retransmission/rewrite enabled
bool
m_paramGuardEnabled
;
///< Parameter retransmission/rewrite enabled
bool
m_actionGuardEnabled
;
///< Action request retransmission enabled
int
m_actionRetransmissionTimeout
;
///< Timeout for parameter retransmission
QMutex
receiveMutex
;
///< Mutex to protect receiveBytes function
int
lastIndex
[
256
][
256
];
int
totalReceiveCounter
;
...
...
@@ -169,6 +181,10 @@ signals:
void
paramRetransmissionTimeoutChanged
(
int
ms
);
/** @brief Emitted if param write timeout changed */
void
paramRewriteTimeoutChanged
(
int
ms
);
/** @brief Emitted if action guard status changed */
void
actionGuardChanged
(
bool
enabled
);
/** @brief Emitted if actiion request timeout changed */
void
actionRetransmissionTimeoutChanged
(
int
ms
);
};
#endif // MAVLINKPROTOCOL_H_
src/ui/MAVLinkSettingsWidget.cc
View file @
9c6775fb
...
...
@@ -50,10 +50,14 @@ MAVLinkSettingsWidget::MAVLinkSettingsWidget(MAVLinkProtocol* protocol, QWidget
m_ui
->
versionCheckBox
->
setChecked
(
protocol
->
versionCheckEnabled
());
m_ui
->
multiplexingCheckBox
->
setChecked
(
protocol
->
multiplexingEnabled
());
m_ui
->
systemIdSpinBox
->
setValue
(
protocol
->
getSystemId
());
m_ui
->
paramGuardCheckBox
->
setChecked
(
protocol
->
paramGuardEnabled
());
m_ui
->
paramRetransmissionSpinBox
->
setValue
(
protocol
->
getParamRetransmissionTimeout
());
m_ui
->
paramRewriteSpinBox
->
setValue
(
protocol
->
getParamRewriteTimeout
());
m_ui
->
actionGuardCheckBox
->
setChecked
(
protocol
->
actionGuardEnabled
());
m_ui
->
actionRetransmissionSpinBox
->
setValue
(
protocol
->
getActionRetransmissionTimeout
());
// Connect actions
// Heartbeat
connect
(
protocol
,
SIGNAL
(
heartbeatChanged
(
bool
)),
m_ui
->
heartbeatCheckBox
,
SLOT
(
setChecked
(
bool
)));
...
...
@@ -79,6 +83,12 @@ MAVLinkSettingsWidget::MAVLinkSettingsWidget(MAVLinkProtocol* protocol, QWidget
connect
(
m_ui
->
paramRetransmissionSpinBox
,
SIGNAL
(
valueChanged
(
int
)),
protocol
,
SLOT
(
setParamRetransmissionTimeout
(
int
)));
connect
(
protocol
,
SIGNAL
(
paramRewriteTimeoutChanged
(
int
)),
m_ui
->
paramRewriteSpinBox
,
SLOT
(
setValue
(
int
)));
connect
(
m_ui
->
paramRewriteSpinBox
,
SIGNAL
(
valueChanged
(
int
)),
protocol
,
SLOT
(
setParamRewriteTimeout
(
int
)));
// Action guard
connect
(
protocol
,
SIGNAL
(
actionGuardChanged
(
bool
)),
m_ui
->
actionGuardCheckBox
,
SLOT
(
setChecked
(
bool
)));
connect
(
m_ui
->
actionGuardCheckBox
,
SIGNAL
(
toggled
(
bool
)),
protocol
,
SLOT
(
enableActionGuard
(
bool
)));
connect
(
protocol
,
SIGNAL
(
actionRetransmissionTimeoutChanged
(
int
)),
m_ui
->
actionRetransmissionSpinBox
,
SLOT
(
setValue
(
int
)));
connect
(
m_ui
->
actionRetransmissionSpinBox
,
SIGNAL
(
valueChanged
(
int
)),
protocol
,
SLOT
(
setActionRetransmissionTimeout
(
int
)));
// Update values
m_ui
->
versionLabel
->
setText
(
tr
(
"MAVLINK_VERSION: %1"
).
arg
(
protocol
->
getVersion
()));
...
...
@@ -87,8 +97,6 @@ MAVLinkSettingsWidget::MAVLinkSettingsWidget(MAVLinkProtocol* protocol, QWidget
// Connect visibility updates
connect
(
protocol
,
SIGNAL
(
versionCheckChanged
(
bool
)),
m_ui
->
versionLabel
,
SLOT
(
setVisible
(
bool
)));
m_ui
->
versionLabel
->
setVisible
(
protocol
->
versionCheckEnabled
());
//connect(m_ui->versionCheckBox, SIGNAL(toggled(bool)), m_ui->versionSpacer, SLOT(setVisible(bool)));
//connect(m_ui->loggingCheckBox, SIGNAL(toggled(bool)), m_ui->logFileSpacer, SLOT(setVisible(bool)));
// Logging visibility
connect
(
protocol
,
SIGNAL
(
loggingChanged
(
bool
)),
m_ui
->
logFileLabel
,
SLOT
(
setVisible
(
bool
)));
m_ui
->
logFileLabel
->
setVisible
(
protocol
->
loggingEnabled
());
...
...
@@ -108,6 +116,11 @@ MAVLinkSettingsWidget::MAVLinkSettingsWidget(MAVLinkProtocol* protocol, QWidget
m_ui
->
paramRewriteSpinBox
->
setVisible
(
protocol
->
paramGuardEnabled
());
connect
(
protocol
,
SIGNAL
(
paramGuardChanged
(
bool
)),
m_ui
->
paramRewriteLabel
,
SLOT
(
setVisible
(
bool
)));
m_ui
->
paramRewriteLabel
->
setVisible
(
protocol
->
paramGuardEnabled
());
// Action guard visibility
connect
(
protocol
,
SIGNAL
(
actionGuardChanged
(
bool
)),
m_ui
->
actionRetransmissionSpinBox
,
SLOT
(
setVisible
(
bool
)));
m_ui
->
actionRetransmissionSpinBox
->
setVisible
(
protocol
->
actionGuardEnabled
());
connect
(
protocol
,
SIGNAL
(
actionGuardChanged
(
bool
)),
m_ui
->
actionRetransmissionLabel
,
SLOT
(
setVisible
(
bool
)));
m_ui
->
actionRetransmissionLabel
->
setVisible
(
protocol
->
actionGuardEnabled
());
// TODO implement filtering
// and then remove these two lines
...
...
src/ui/MAVLinkSettingsWidget.ui
View file @
9c6775fb
...
...
@@ -7,7 +7,7 @@
<x>
0
</x>
<y>
0
</y>
<width>
431
</width>
<height>
3
49
</height>
<height>
3
87
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
...
...
@@ -245,6 +245,49 @@
</property>
</widget>
</item>
<item
row=
"14"
column=
"0"
colspan=
"3"
>
<widget
class=
"QCheckBox"
name=
"actionGuardCheckBox"
>
<property
name=
"text"
>
<string>
Enable retransmission of actions / commands
</string>
</property>
</widget>
</item>
<item
row=
"15"
column=
"0"
>
<spacer
name=
"horizontalSpacer_3"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
8
</width>
<height>
0
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"15"
column=
"1"
>
<widget
class=
"QLabel"
name=
"actionRetransmissionLabel"
>
<property
name=
"text"
>
<string>
Action request retransmission timeout
</string>
</property>
</widget>
</item>
<item
row=
"15"
column=
"2"
>
<widget
class=
"QSpinBox"
name=
"actionRetransmissionSpinBox"
>
<property
name=
"suffix"
>
<string>
ms
</string>
</property>
<property
name=
"minimum"
>
<number>
20
</number>
</property>
<property
name=
"maximum"
>
<number>
1000
</number>
</property>
<property
name=
"singleStep"
>
<number>
10
</number>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
...
...
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