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
2955d352
Commit
2955d352
authored
Dec 22, 2013
by
Bryant Mairs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't update the ConsoleDebug data rates UI if no link exists (like on startup).
parent
16e8aab2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
DebugConsole.cc
src/ui/DebugConsole.cc
+15
-12
No files found.
src/ui/DebugConsole.cc
View file @
2955d352
...
...
@@ -83,12 +83,10 @@ DebugConsole::DebugConsole(QWidget *parent) :
// Load settings for this widget
loadSettings
();
// Enable traffic measurements
// Enable traffic measurements. We only start/stop the timer as our links change, as
// these calculations are dependent on the specific link.
connect
(
&
snapShotTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
updateTrafficMeasurements
()));
snapShotTimer
.
setInterval
(
snapShotInterval
);
snapShotTimer
.
start
();
// Update measurements the first time
updateTrafficMeasurements
();
// First connect management slots, then make sure to add all existing objects
// Connect to link manager to get notified about new links
...
...
@@ -201,7 +199,14 @@ void DebugConsole::removeLink(LinkInterface* const linkInterface)
m_ui
->
linkComboBox
->
removeItem
(
linkIndex
);
}
if
(
linkInterface
==
currLink
)
currLink
=
NULL
;
// Now if this was the current link, clean up some stuff.
if
(
linkInterface
==
currLink
)
{
// Like disable the update time for the UI.
snapShotTimer
.
stop
();
currLink
=
NULL
;
}
}
void
DebugConsole
::
linkStatusUpdate
(
const
QString
&
name
,
const
QString
&
text
)
{
...
...
@@ -214,11 +219,14 @@ void DebugConsole::linkStatusUpdate(const QString& name,const QString& text)
void
DebugConsole
::
linkSelected
(
int
linkId
)
{
// Disconnect
if
(
currLink
)
{
if
(
currLink
)
{
disconnect
(
currLink
,
SIGNAL
(
bytesReceived
(
LinkInterface
*
,
QByteArray
)),
this
,
SLOT
(
receiveBytes
(
LinkInterface
*
,
QByteArray
)));
disconnect
(
currLink
,
SIGNAL
(
connected
(
bool
)),
this
,
SLOT
(
setConnectionState
(
bool
)));
disconnect
(
currLink
,
SIGNAL
(
communicationUpdate
(
QString
,
QString
)),
this
,
SLOT
(
linkStatusUpdate
(
QString
,
QString
)));
snapShotTimer
.
stop
();
}
// Clear data
m_ui
->
receiveText
->
clear
();
...
...
@@ -228,6 +236,7 @@ void DebugConsole::linkSelected(int linkId)
connect
(
currLink
,
SIGNAL
(
connected
(
bool
)),
this
,
SLOT
(
setConnectionState
(
bool
)));
connect
(
currLink
,
SIGNAL
(
communicationUpdate
(
QString
,
QString
)),
this
,
SLOT
(
linkStatusUpdate
(
QString
,
QString
)));
setConnectionState
(
currLink
->
isConnected
());
snapShotTimer
.
start
();
}
/**
...
...
@@ -318,12 +327,6 @@ void DebugConsole::receiveTextMessage(int id, int component, int severity, QStri
*/
void
DebugConsole
::
updateTrafficMeasurements
()
{
// We need a link to read its data rates from, so if there isn't one, don't do anything.
if
(
!
currLink
)
{
return
;
}
// Calculate the rate of incoming data, converting to
// kilobytes per second from the received bits per second.
qint64
inDataRate
=
currLink
->
getCurrentInDataRate
()
/
1000.0
f
;
...
...
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