Utility functions.
More...
#include <ctime>
#include <sys/time.h>
#include <QDebug>
#include <QSerialPort>
#include <QSerialPortInfo>
#include <QString>
Go to the source code of this file.
Utility functions.
- Author
- Joshua Harris
- Copyright
- Copyright © 2016-2017 Vehicle Systems & Control Laboratory, Department of Aerospace Engineering, Texas A&M University
- License
- ISC License
quint64 dfti::getTimeUsec |
( |
void |
| ) |
|
Get timestamp in microseconds.
- Returns
- Unix time, microseconds since Jan 1, 1970.
quint64 dfti::gpsToUnixSec |
( |
quint64 |
gpsTime | ) |
|
Convert GPS timestamp in nanoseconds to Unix timestamp in seconds.
- Parameters
-
gpsTime | Timestamp from GPS epoch (0000 6 JAN 1980) in nanoseconds. |
quint64 dfti::gpsToUnixUsec |
( |
quint64 |
gpsTime | ) |
|
Convert GPS timestamp in nanoseconds to Unix timestamp in microseconds.
- Parameters
-
gpsTime | Timestamp from GPS epoch (0000 6 JAN 1980) in nanoseconds. |
float dfti::hzToMsec |
( |
quint8 |
rate | ) |
|
Convert Hertz rate to millisecond sampling time.
- Parameters
-
- Returns
- Sampling period in milliseconds.
float dfti::hzToUsec |
( |
quint8 |
rate | ) |
|
Convert Hertz rate to microsecond sampling time.
- Parameters
-
- Returns
- Sampling period in microseconds.
float dfti::secToMsec |
( |
quint8 |
period | ) |
|
Convert seconds to microseconds.
- Parameters
-
- Returns
- Period in microseconds.
QString dfti::validateSerialPort |
( |
QString |
_port | ) |
|
Validates a proposed serial port.
Checks to see if the given serial port name is a valid serial port.
- Parameters
-
_port | Proposed serial port. |
- Returns
- True if the port name corresponds to a valid system serial port.