GPSRTKFactGroup.cc 2.53 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/****************************************************************************
 *
 *   (c) 2017 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/

#include "GPSRTKFactGroup.h"

const char* GPSRTKFactGroup::_connectedFactName =                "connected";
const char* GPSRTKFactGroup::_currentAccuracyFactName =          "currentAccuracy";
const char* GPSRTKFactGroup::_currentDurationFactName =          "currentDuration";
15 16 17
const char* GPSRTKFactGroup::_currentLatitudeFactName =          "currentLatitude";
const char* GPSRTKFactGroup::_currentLongitudeFactName =         "currentLongitude";
const char* GPSRTKFactGroup::_currentAltitudeFactName =          "currentAltitude";
18 19 20 21 22
const char* GPSRTKFactGroup::_validFactName =                    "valid";
const char* GPSRTKFactGroup::_activeFactName =                   "active";
const char* GPSRTKFactGroup::_numSatellitesFactName =            "numSatellites";

GPSRTKFactGroup::GPSRTKFactGroup(QObject* parent)
23 24 25 26 27 28 29 30 31 32
    : FactGroup             (1000, ":/json/Vehicle/GPSRTKFact.json", parent)
    , _connected            (0, _connectedFactName,         FactMetaData::valueTypeBool)
    , _currentDuration      (0, _currentDurationFactName,   FactMetaData::valueTypeDouble)
    , _currentAccuracy      (0, _currentAccuracyFactName,   FactMetaData::valueTypeDouble)
    , _currentLatitude      (0, _currentLatitudeFactName,   FactMetaData::valueTypeDouble)
    , _currentLongitude     (0, _currentLongitudeFactName,  FactMetaData::valueTypeDouble)
    , _currentAltitude      (0, _currentAltitudeFactName,   FactMetaData::valueTypeFloat)
    , _valid                (0, _validFactName,             FactMetaData::valueTypeBool)
    , _active               (0, _activeFactName,            FactMetaData::valueTypeBool)
    , _numSatellites        (0, _numSatellitesFactName,     FactMetaData::valueTypeInt32)
33 34 35 36
{
    _addFact(&_connected,          _connectedFactName);
    _addFact(&_currentDuration,    _currentDurationFactName);
    _addFact(&_currentAccuracy,    _currentAccuracyFactName);
37 38 39
    _addFact(&_currentLatitude,    _currentLatitudeFactName);
    _addFact(&_currentLongitude,   _currentLongitudeFactName);
    _addFact(&_currentAltitude,    _currentAltitudeFactName);
40 41 42 43 44
    _addFact(&_valid,              _validFactName);
    _addFact(&_active,             _activeFactName);
    _addFact(&_numSatellites,      _numSatellitesFactName);
}