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
0f66f2f2
Commit
0f66f2f2
authored
Jan 02, 2020
by
Gus Grubba
Committed by
Lorenz Meier
Jan 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add time since boot
parent
f35b2631
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
QGC.cc
src/QGC.cc
+12
-0
QGC.h
src/QGC.h
+5
-0
main.cc
src/main.cc
+4
-0
No files found.
src/QGC.cc
View file @
0f66f2f2
...
...
@@ -15,6 +15,18 @@
namespace
QGC
{
static
quint64
gBootTime
=
0
;
void
initTimer
()
{
gBootTime
=
groundTimeMilliseconds
();
}
quint64
bootTimeMilliseconds
()
{
return
groundTimeMilliseconds
()
-
gBootTime
;
}
quint64
groundTimeUsecs
()
{
return
groundTimeMilliseconds
()
*
1000
;
...
...
src/QGC.h
View file @
0f66f2f2
...
...
@@ -37,6 +37,11 @@ float limitAngleToPMPIf(double angle);
/** @brief Returns the angle limited to -pi - pi */
double
limitAngleToPMPId
(
double
angle
);
/** @brief Records boot time (called from main) */
void
initTimer
();
/** @brief Get the ground time since boot in milliseconds */
quint64
bootTimeMilliseconds
();
const
static
int
MAX_FLIGHT_TIME
=
60
*
60
*
24
*
21
;
class
SLEEP
:
public
QThread
...
...
src/main.cc
View file @
0f66f2f2
...
...
@@ -15,6 +15,7 @@
*
*/
#include "QGC.h"
#include <QtGlobal>
#include <QApplication>
#include <QIcon>
...
...
@@ -238,6 +239,9 @@ int main(int argc, char *argv[])
}
#endif
//-- Record boot time
QGC
::
initTimer
();
#ifdef Q_OS_UNIX
//Force writing to the console on UNIX/BSD devices
if
(
!
qEnvironmentVariableIsSet
(
"QT_LOGGING_TO_CONSOLE"
))
...
...
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