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
0114a391
Commit
0114a391
authored
May 03, 2018
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Slightly better Log Replay
parent
1d10b2ad
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
34 deletions
+52
-34
ParameterManager.cc
src/FactSystem/ParameterManager.cc
+6
-2
ParameterManager.h
src/FactSystem/ParameterManager.h
+9
-21
LogReplayLink.cc
src/comm/LogReplayLink.cc
+6
-0
LogReplayLink.h
src/comm/LogReplayLink.h
+1
-0
QGCMAVLinkLogPlayer.cc
src/ui/QGCMAVLinkLogPlayer.cc
+20
-10
QGCMAVLinkLogPlayer.h
src/ui/QGCMAVLinkLogPlayer.h
+2
-0
QGCMAVLinkLogPlayer.ui
src/ui/QGCMAVLinkLogPlayer.ui
+8
-1
No files found.
src/FactSystem/ParameterManager.cc
View file @
0114a391
...
@@ -86,7 +86,7 @@ ParameterManager::ParameterManager(Vehicle* vehicle)
...
@@ -86,7 +86,7 @@ ParameterManager::ParameterManager(Vehicle* vehicle)
_waitingForDefaultComponent
=
false
;
_waitingForDefaultComponent
=
false
;
emit
parametersReadyChanged
(
_parametersReady
);
emit
parametersReadyChanged
(
_parametersReady
);
emit
missingParametersChanged
(
_missingParameters
);
emit
missingParametersChanged
(
_missingParameters
);
}
else
{
}
else
if
(
!
_logReplay
)
{
refreshAllParameters
();
refreshAllParameters
();
}
}
}
}
...
@@ -358,7 +358,7 @@ void ParameterManager::_parameterUpdate(int vehicleId, int componentId, QString
...
@@ -358,7 +358,7 @@ void ParameterManager::_parameterUpdate(int vehicleId, int componentId, QString
// Update param cache. The param cache is only used on PX4 Firmware since ArduPilot and Solo have volatile params
// Update param cache. The param cache is only used on PX4 Firmware since ArduPilot and Solo have volatile params
// which invalidate the cache. The Solo also streams param updates in flight for things like gimbal values
// which invalidate the cache. The Solo also streams param updates in flight for things like gimbal values
// which in turn causes a perf problem with all the param cache updates.
// which in turn causes a perf problem with all the param cache updates.
if
(
_vehicle
->
px4Firmware
())
{
if
(
!
_logReplay
&&
_vehicle
->
px4Firmware
())
{
if
(
_prevWaitingReadParamIndexCount
+
_prevWaitingReadParamNameCount
!=
0
&&
readWaitingParamCount
==
0
)
{
if
(
_prevWaitingReadParamIndexCount
+
_prevWaitingReadParamNameCount
!=
0
&&
readWaitingParamCount
==
0
)
{
// All reads just finished, update the cache
// All reads just finished, update the cache
_writeLocalParamCache
(
vehicleId
,
componentId
);
_writeLocalParamCache
(
vehicleId
,
componentId
);
...
@@ -604,6 +604,10 @@ bool ParameterManager::_fillIndexBatchQueue(bool waitingParamTimeout)
...
@@ -604,6 +604,10 @@ bool ParameterManager::_fillIndexBatchQueue(bool waitingParamTimeout)
void
ParameterManager
::
_waitingParamTimeout
(
void
)
void
ParameterManager
::
_waitingParamTimeout
(
void
)
{
{
if
(
_logReplay
)
{
return
;
}
bool
paramsRequested
=
false
;
bool
paramsRequested
=
false
;
const
int
maxBatchSize
=
10
;
const
int
maxBatchSize
=
10
;
int
batchCount
=
0
;
int
batchCount
=
0
;
...
...
src/FactSystem/ParameterManager.h
View file @
0114a391
...
@@ -7,9 +7,7 @@
...
@@ -7,9 +7,7 @@
*
*
****************************************************************************/
****************************************************************************/
#pragma once
#ifndef ParameterManager_H
#define ParameterManager_H
#include <QObject>
#include <QObject>
#include <QMap>
#include <QMap>
...
@@ -25,33 +23,26 @@
...
@@ -25,33 +23,26 @@
#include "QGCMAVLink.h"
#include "QGCMAVLink.h"
#include "Vehicle.h"
#include "Vehicle.h"
/// @file
/// @author Don Gagne <don@thegagnes.com>
Q_DECLARE_LOGGING_CATEGORY
(
ParameterManagerVerbose1Log
)
Q_DECLARE_LOGGING_CATEGORY
(
ParameterManagerVerbose1Log
)
Q_DECLARE_LOGGING_CATEGORY
(
ParameterManagerVerbose2Log
)
Q_DECLARE_LOGGING_CATEGORY
(
ParameterManagerVerbose2Log
)
Q_DECLARE_LOGGING_CATEGORY
(
ParameterManagerDebugCacheFailureLog
)
Q_DECLARE_LOGGING_CATEGORY
(
ParameterManagerDebugCacheFailureLog
)
/// Connects to Parameter Manager to load/update Facts
class
ParameterManager
:
public
QObject
class
ParameterManager
:
public
QObject
{
{
Q_OBJECT
Q_OBJECT
public:
public:
/// @param uas Uas which this set of facts is associated with
/// @param uas Uas which this set of facts is associated with
ParameterManager
(
Vehicle
*
vehicle
);
ParameterManager
(
Vehicle
*
vehicle
);
~
ParameterManager
();
~
ParameterManager
();
/// true: Parameters are ready for use
Q_PROPERTY
(
bool
parametersReady
READ
parametersReady
NOTIFY
parametersReadyChanged
)
bool
parametersReady
(
void
)
{
return
_parametersReady
;
}
/// true: Parameters are missing from firmware response, false: all parameters received from firmwar
e
Q_PROPERTY
(
bool
parametersReady
READ
parametersReady
NOTIFY
parametersReadyChanged
)
///< true: Parameters are ready for us
e
Q_PROPERTY
(
bool
missingParameters
READ
missingParameters
NOTIFY
missingParametersChanged
)
Q_PROPERTY
(
bool
missingParameters
READ
missingParameters
NOTIFY
missingParametersChanged
)
///< true: Parameters are missing from firmware response, false: all parameters received from firmware
bool
missingParameters
(
void
)
{
return
_missingParameters
;
}
Q_PROPERTY
(
double
loadProgress
READ
loadProgress
NOTIFY
loadProgressChanged
)
Q_PROPERTY
(
double
loadProgress
READ
loadProgress
NOTIFY
loadProgressChanged
)
bool
parametersReady
(
void
)
const
{
return
_parametersReady
;
}
double
loadProgress
(
void
)
const
{
return
_loadProgress
;
}
bool
missingParameters
(
void
)
const
{
return
_missingParameters
;
}
double
loadProgress
(
void
)
const
{
return
_loadProgress
;
}
/// @return Directory of parameter caches
/// @return Directory of parameter caches
static
QDir
parameterCacheDir
();
static
QDir
parameterCacheDir
();
...
@@ -59,7 +50,6 @@ public:
...
@@ -59,7 +50,6 @@ public:
/// @return Location of parameter cache file
/// @return Location of parameter cache file
static
QString
parameterCacheFile
(
int
vehicleId
,
int
componentId
);
static
QString
parameterCacheFile
(
int
vehicleId
,
int
componentId
);
/// Re-request the full set of parameters from the autopilot
/// Re-request the full set of parameters from the autopilot
void
refreshAllParameters
(
uint8_t
componentID
=
MAV_COMP_ID_ALL
);
void
refreshAllParameters
(
uint8_t
componentID
=
MAV_COMP_ID_ALL
);
...
@@ -217,5 +207,3 @@ private:
...
@@ -217,5 +207,3 @@ private:
static
const
char
*
_jsonParamNameKey
;
static
const
char
*
_jsonParamNameKey
;
static
const
char
*
_jsonParamValueKey
;
static
const
char
*
_jsonParamValueKey
;
};
};
#endif
src/comm/LogReplayLink.cc
View file @
0114a391
...
@@ -367,6 +367,12 @@ void LogReplayLink::_readNextLogEntry(void)
...
@@ -367,6 +367,12 @@ void LogReplayLink::_readNextLogEntry(void)
quint64
currentTimeMSecs
=
(
quint64
)
QDateTime
::
currentMSecsSinceEpoch
();
quint64
currentTimeMSecs
=
(
quint64
)
QDateTime
::
currentMSecsSinceEpoch
();
timeToNextExecutionMSecs
=
desiredPacedTimeMSecs
-
currentTimeMSecs
;
timeToNextExecutionMSecs
=
desiredPacedTimeMSecs
-
currentTimeMSecs
;
}
}
emit
currentLogTimeSecs
((
_logCurrentTimeUSecs
-
_logStartTimeUSecs
)
/
1000000
);
if
(
timeToNextExecutionMSecs
==
0
||
timeToNextExecutionMSecs
>
100
)
{
qDebug
()
<<
timeToNextExecutionMSecs
<<
_logCurrentTimeUSecs
;
}
// And schedule the next execution of this function.
// And schedule the next execution of this function.
_readTickTimer
.
start
(
timeToNextExecutionMSecs
);
_readTickTimer
.
start
(
timeToNextExecutionMSecs
);
...
...
src/comm/LogReplayLink.h
View file @
0114a391
...
@@ -94,6 +94,7 @@ signals:
...
@@ -94,6 +94,7 @@ signals:
void
playbackAtEnd
(
void
);
void
playbackAtEnd
(
void
);
void
playbackError
(
void
);
void
playbackError
(
void
);
void
playbackPercentCompleteChanged
(
int
percentComplete
);
void
playbackPercentCompleteChanged
(
int
percentComplete
);
void
currentLogTimeSecs
(
int
secs
);
// Internal signals
// Internal signals
void
_playOnThread
(
void
);
void
_playOnThread
(
void
);
...
...
src/ui/QGCMAVLinkLogPlayer.cc
View file @
0114a391
...
@@ -15,10 +15,11 @@
...
@@ -15,10 +15,11 @@
#include "QGCQFileDialog.h"
#include "QGCQFileDialog.h"
#include "QGCMessageBox.h"
#include "QGCMessageBox.h"
QGCMAVLinkLogPlayer
::
QGCMAVLinkLogPlayer
(
QWidget
*
parent
)
:
QGCMAVLinkLogPlayer
::
QGCMAVLinkLogPlayer
(
QWidget
*
parent
)
QWidget
(
parent
),
:
QWidget
(
parent
)
_replayLink
(
NULL
),
,
_replayLink
(
NULL
)
_ui
(
new
Ui
::
QGCMAVLinkLogPlayer
)
,
_lastCurrentTime
(
0
)
,
_ui
(
new
Ui
::
QGCMAVLinkLogPlayer
)
{
{
_ui
->
setupUi
(
this
);
_ui
->
setupUi
(
this
);
_ui
->
horizontalLayout
->
setAlignment
(
Qt
::
AlignTop
);
_ui
->
horizontalLayout
->
setAlignment
(
Qt
::
AlignTop
);
...
@@ -92,11 +93,12 @@ void QGCMAVLinkLogPlayer::_selectLogFileForPlayback(void)
...
@@ -92,11 +93,12 @@ void QGCMAVLinkLogPlayer::_selectLogFileForPlayback(void)
SharedLinkConfigurationPointer
sharedConfig
=
linkMgr
->
addConfiguration
(
linkConfig
);
SharedLinkConfigurationPointer
sharedConfig
=
linkMgr
->
addConfiguration
(
linkConfig
);
_replayLink
=
(
LogReplayLink
*
)
qgcApp
()
->
toolbox
()
->
linkManager
()
->
createConnectedLink
(
sharedConfig
);
_replayLink
=
(
LogReplayLink
*
)
qgcApp
()
->
toolbox
()
->
linkManager
()
->
createConnectedLink
(
sharedConfig
);
connect
(
_replayLink
,
&
LogReplayLink
::
logFileStats
,
this
,
&
QGCMAVLinkLogPlayer
::
_logFileStats
);
connect
(
_replayLink
,
&
LogReplayLink
::
logFileStats
,
this
,
&
QGCMAVLinkLogPlayer
::
_logFileStats
);
connect
(
_replayLink
,
&
LogReplayLink
::
playbackStarted
,
this
,
&
QGCMAVLinkLogPlayer
::
_playbackStarted
);
connect
(
_replayLink
,
&
LogReplayLink
::
playbackStarted
,
this
,
&
QGCMAVLinkLogPlayer
::
_playbackStarted
);
connect
(
_replayLink
,
&
LogReplayLink
::
playbackPaused
,
this
,
&
QGCMAVLinkLogPlayer
::
_playbackPaused
);
connect
(
_replayLink
,
&
LogReplayLink
::
playbackPaused
,
this
,
&
QGCMAVLinkLogPlayer
::
_playbackPaused
);
connect
(
_replayLink
,
&
LogReplayLink
::
playbackPercentCompleteChanged
,
this
,
&
QGCMAVLinkLogPlayer
::
_playbackPercentCompleteChanged
);
connect
(
_replayLink
,
&
LogReplayLink
::
playbackPercentCompleteChanged
,
this
,
&
QGCMAVLinkLogPlayer
::
_playbackPercentCompleteChanged
);
connect
(
_replayLink
,
&
LogReplayLink
::
disconnected
,
this
,
&
QGCMAVLinkLogPlayer
::
_replayLinkDisconnected
);
connect
(
_replayLink
,
&
LogReplayLink
::
currentLogTimeSecs
,
this
,
&
QGCMAVLinkLogPlayer
::
_setCurrentLogTime
);
connect
(
_replayLink
,
&
LogReplayLink
::
disconnected
,
this
,
&
QGCMAVLinkLogPlayer
::
_replayLinkDisconnected
);
_ui
->
positionSlider
->
setValue
(
0
);
_ui
->
positionSlider
->
setValue
(
0
);
#if 0
#if 0
...
@@ -133,7 +135,7 @@ void QGCMAVLinkLogPlayer::_logFileStats(bool logTimestamped, ///< tru
...
@@ -133,7 +135,7 @@ void QGCMAVLinkLogPlayer::_logFileStats(bool logTimestamped, ///< tru
_logDurationSeconds
=
logDurationSeconds
;
_logDurationSeconds
=
logDurationSeconds
;
_ui
->
log
StatsLabel
->
setText
(
_secondsToHMS
(
logDurationSeconds
));
_ui
->
log
LengthTime
->
setText
(
_secondsToHMS
(
logDurationSeconds
));
}
}
/// Signalled from LogReplayLink when replay starts
/// Signalled from LogReplayLink when replay starts
...
@@ -208,3 +210,11 @@ void QGCMAVLinkLogPlayer::_replayLinkDisconnected(void)
...
@@ -208,3 +210,11 @@ void QGCMAVLinkLogPlayer::_replayLinkDisconnected(void)
_enablePlaybackControls
(
false
);
_enablePlaybackControls
(
false
);
_replayLink
=
NULL
;
_replayLink
=
NULL
;
}
}
void
QGCMAVLinkLogPlayer
::
_setCurrentLogTime
(
int
secs
)
{
if
(
secs
!=
_lastCurrentTime
)
{
_lastCurrentTime
=
secs
;
_ui
->
logCurrentTime
->
setText
(
_secondsToHMS
(
secs
));
}
}
src/ui/QGCMAVLinkLogPlayer.h
View file @
0114a391
...
@@ -42,6 +42,7 @@ private slots:
...
@@ -42,6 +42,7 @@ private slots:
void
_playbackPercentCompleteChanged
(
int
percentComplete
);
void
_playbackPercentCompleteChanged
(
int
percentComplete
);
void
_playbackError
(
void
);
void
_playbackError
(
void
);
void
_replayLinkDisconnected
(
void
);
void
_replayLinkDisconnected
(
void
);
void
_setCurrentLogTime
(
int
secs
);
private:
private:
void
_finishPlayback
(
void
);
void
_finishPlayback
(
void
);
...
@@ -50,6 +51,7 @@ private:
...
@@ -50,6 +51,7 @@ private:
LogReplayLink
*
_replayLink
;
LogReplayLink
*
_replayLink
;
int
_logDurationSeconds
;
int
_logDurationSeconds
;
int
_lastCurrentTime
;
Ui
::
QGCMAVLinkLogPlayer
*
_ui
;
Ui
::
QGCMAVLinkLogPlayer
*
_ui
;
};
};
...
...
src/ui/QGCMAVLinkLogPlayer.ui
View file @
0114a391
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
<number>
0
</number>
<number>
0
</number>
</property>
</property>
<item>
<item>
<widget
class=
"QLabel"
name=
"log
StatsLabel
"
>
<widget
class=
"QLabel"
name=
"log
CurrentTime
"
>
<property
name=
"text"
>
<property
name=
"text"
>
<string/>
<string/>
</property>
</property>
...
@@ -89,6 +89,13 @@
...
@@ -89,6 +89,13 @@
</property>
</property>
</widget>
</widget>
</item>
</item>
<item>
<widget
class=
"QLabel"
name=
"logLengthTime"
>
<property
name=
"text"
>
<string/>
</property>
</widget>
</item>
<item>
<item>
<widget
class=
"QPushButton"
name=
"selectFileButton"
>
<widget
class=
"QPushButton"
name=
"selectFileButton"
>
<property
name=
"toolTip"
>
<property
name=
"toolTip"
>
...
...
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