13 changed files with 309 additions and 0 deletions
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
[ |
||||
{ |
||||
"name": "connected", |
||||
"shortDescription": "Connected", |
||||
"type": "bool" |
||||
}, |
||||
{ |
||||
"name": "currentAccuracy", |
||||
"shortDescription": "Current Accuracy", |
||||
"type": "double", |
||||
"decimalPlaces": 0, |
||||
"units": "mm" |
||||
}, |
||||
{ |
||||
"name": "currentDuration", |
||||
"shortDescription": "Current Duration", |
||||
"type": "double", |
||||
"decimalPlaces": 0, |
||||
"units": "s" |
||||
}, |
||||
{ |
||||
"name": "valid", |
||||
"shortDescription": "Survey-in Valid", |
||||
"type": "bool" |
||||
}, |
||||
{ |
||||
"name": "active", |
||||
"shortDescription": "Survey-in Active", |
||||
"type": "bool" |
||||
}, |
||||
{ |
||||
"name": "numSatellites", |
||||
"shortDescription": "Number of Satellites", |
||||
"type": "int32" |
||||
} |
||||
] |
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
/****************************************************************************
|
||||
* |
||||
* (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"; |
||||
const char* GPSRTKFactGroup::_validFactName = "valid"; |
||||
const char* GPSRTKFactGroup::_activeFactName = "active"; |
||||
const char* GPSRTKFactGroup::_numSatellitesFactName = "numSatellites"; |
||||
|
||||
GPSRTKFactGroup::GPSRTKFactGroup(QObject* parent) |
||||
: FactGroup(1000, ":/json/Vehicle/GPSRTKFact.json", parent) |
||||
, _connected (false, _connectedFactName, FactMetaData::valueTypeBool) |
||||
, _currentDuration (0, _currentDurationFactName, FactMetaData::valueTypeDouble) |
||||
, _currentAccuracy (0, _currentAccuracyFactName, FactMetaData::valueTypeDouble) |
||||
, _valid (false, _validFactName, FactMetaData::valueTypeBool) |
||||
, _active (false, _activeFactName, FactMetaData::valueTypeBool) |
||||
, _numSatellites (false, _numSatellitesFactName, FactMetaData::valueTypeInt32) |
||||
{ |
||||
_addFact(&_connected, _connectedFactName); |
||||
_addFact(&_currentDuration, _currentDurationFactName); |
||||
_addFact(&_currentAccuracy, _currentAccuracyFactName); |
||||
_addFact(&_valid, _validFactName); |
||||
_addFact(&_active, _activeFactName); |
||||
_addFact(&_numSatellites, _numSatellitesFactName); |
||||
} |
||||
|
@ -0,0 +1,50 @@
@@ -0,0 +1,50 @@
|
||||
/****************************************************************************
|
||||
* |
||||
* (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. |
||||
* |
||||
****************************************************************************/ |
||||
|
||||
|
||||
#pragma once |
||||
|
||||
#include "Vehicle.h" |
||||
|
||||
class GPSRTKFactGroup : public FactGroup |
||||
{ |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
GPSRTKFactGroup(QObject* parent = NULL); |
||||
|
||||
Q_PROPERTY(Fact* connected READ connected CONSTANT) |
||||
Q_PROPERTY(Fact* currentDuration READ currentDuration CONSTANT) |
||||
Q_PROPERTY(Fact* currentAccuracy READ currentAccuracy CONSTANT) |
||||
Q_PROPERTY(Fact* valid READ valid CONSTANT) |
||||
Q_PROPERTY(Fact* active READ active CONSTANT) |
||||
Q_PROPERTY(Fact* numSatellites READ numSatellites CONSTANT) |
||||
|
||||
Fact* connected (void) { return &_connected; } |
||||
Fact* currentDuration (void) { return &_currentDuration; } |
||||
Fact* currentAccuracy (void) { return &_currentAccuracy; } |
||||
Fact* valid (void) { return &_valid; } |
||||
Fact* active (void) { return &_active; } |
||||
Fact* numSatellites (void) { return &_numSatellites; } |
||||
|
||||
static const char* _connectedFactName; |
||||
static const char* _currentDurationFactName; |
||||
static const char* _currentAccuracyFactName; |
||||
static const char* _validFactName; |
||||
static const char* _activeFactName; |
||||
static const char* _numSatellitesFactName; |
||||
|
||||
private: |
||||
Fact _connected; ///< is an RTK gps connected?
|
||||
Fact _currentDuration; ///< survey-in status in [s]
|
||||
Fact _currentAccuracy; ///< survey-in accuracy in [mm]
|
||||
Fact _valid; ///< survey-in valid?
|
||||
Fact _active; ///< survey-in active?
|
||||
Fact _numSatellites; ///< number of satellites
|
||||
}; |
@ -0,0 +1,127 @@
@@ -0,0 +1,127 @@
|
||||
/**************************************************************************** |
||||
* |
||||
* (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. |
||||
* |
||||
****************************************************************************/ |
||||
|
||||
|
||||
import QtQuick 2.3 |
||||
import QtQuick.Controls 1.2 |
||||
import QtQuick.Layouts 1.2 |
||||
|
||||
import QGroundControl 1.0 |
||||
import QGroundControl.Controls 1.0 |
||||
import QGroundControl.ScreenTools 1.0 |
||||
import QGroundControl.Palette 1.0 |
||||
|
||||
//------------------------------------------------------------------------- |
||||
//-- GPS Indicator |
||||
Item { |
||||
id: satelitte |
||||
width: (gpsValuesColumn.x + gpsValuesColumn.width) * 1.1 |
||||
anchors.top: parent.top |
||||
anchors.bottom: parent.bottom |
||||
visible: QGroundControl.gpsRtk.connected.value |
||||
|
||||
Component { |
||||
id: gpsInfo |
||||
|
||||
Rectangle { |
||||
width: gpsCol.width + ScreenTools.defaultFontPixelWidth * 3 |
||||
height: gpsCol.height + ScreenTools.defaultFontPixelHeight * 2 |
||||
radius: ScreenTools.defaultFontPixelHeight * 0.5 |
||||
color: qgcPal.window |
||||
border.color: qgcPal.text |
||||
|
||||
Column { |
||||
id: gpsCol |
||||
spacing: ScreenTools.defaultFontPixelHeight * 0.5 |
||||
width: Math.max(gpsGrid.width, gpsLabel.width) |
||||
anchors.margins: ScreenTools.defaultFontPixelHeight |
||||
anchors.centerIn: parent |
||||
|
||||
QGCLabel { |
||||
id: gpsLabel |
||||
text: (QGroundControl.gpsRtk.active.value) ? qsTr("Survey-in Active") : qsTr("RTK Streaming") |
||||
font.family: ScreenTools.demiboldFontFamily |
||||
anchors.horizontalCenter: parent.horizontalCenter |
||||
} |
||||
|
||||
GridLayout { |
||||
id: gpsGrid |
||||
visible: true |
||||
anchors.margins: ScreenTools.defaultFontPixelHeight |
||||
columnSpacing: ScreenTools.defaultFontPixelWidth |
||||
anchors.horizontalCenter: parent.horizontalCenter |
||||
columns: 2 |
||||
|
||||
QGCLabel { |
||||
text: qsTr("Duration:") |
||||
visible: QGroundControl.gpsRtk.active.value |
||||
} |
||||
QGCLabel { |
||||
text: QGroundControl.gpsRtk.currentDuration.value + ' s' |
||||
visible: QGroundControl.gpsRtk.active.value |
||||
} |
||||
QGCLabel { |
||||
// during survey-in show the current accuracy, after that show the final accuracy |
||||
text: QGroundControl.gpsRtk.valid.value ? qsTr("Accuracy:") : qsTr("Current Accuracy:") |
||||
} |
||||
QGCLabel { |
||||
text: (QGroundControl.gpsRtk.currentAccuracy.value/1000).toFixed(1) + ' m' |
||||
} |
||||
QGCLabel { text: qsTr("Satellites:") } |
||||
QGCLabel { text: QGroundControl.gpsRtk.numSatellites.value } |
||||
} |
||||
} |
||||
|
||||
Component.onCompleted: { |
||||
var pos = mapFromItem(toolBar, centerX - (width / 2), toolBar.height) |
||||
x = pos.x |
||||
y = pos.y + ScreenTools.defaultFontPixelHeight |
||||
} |
||||
} |
||||
} |
||||
|
||||
QGCColoredImage { |
||||
id: gpsIcon |
||||
width: height |
||||
anchors.top: parent.top |
||||
anchors.bottom: parent.bottom |
||||
source: "/qmlimages/Gps.svg" |
||||
fillMode: Image.PreserveAspectFit |
||||
sourceSize.height: height |
||||
opacity: 1 |
||||
color: QGroundControl.gpsRtk.active.value ? qgcPal.colorRed : qgcPal.buttonText |
||||
} |
||||
|
||||
Column { |
||||
id: gpsValuesColumn |
||||
anchors.verticalCenter: parent.verticalCenter |
||||
anchors.leftMargin: ScreenTools.defaultFontPixelWidth / 2 |
||||
anchors.left: gpsIcon.right |
||||
|
||||
QGCLabel { |
||||
anchors.horizontalCenter: numSatValue.horizontalCenter |
||||
color: qgcPal.buttonText |
||||
text: QGroundControl.gpsRtk.numSatellites.value |
||||
} |
||||
|
||||
QGCLabel { |
||||
id: numSatValue |
||||
color: qgcPal.buttonText |
||||
text: qsTr("RTK") |
||||
} |
||||
} |
||||
|
||||
MouseArea { |
||||
anchors.fill: parent |
||||
onClicked: { |
||||
var centerX = mapToItem(toolBar, x, y).x + (width / 2) |
||||
mainWindow.showPopUp(gpsInfo, centerX) |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue