7 changed files with 172 additions and 0 deletions
@ -0,0 +1,58 @@
@@ -0,0 +1,58 @@
|
||||
/****************************************************************************
|
||||
* |
||||
* (c) 2009-2023 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 "APMRemoteSupportComponent.h" |
||||
|
||||
APMRemoteSupportComponent::APMRemoteSupportComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent) |
||||
: VehicleComponent(vehicle, autopilot, parent) |
||||
, _name(tr("Remote Support")) |
||||
{ |
||||
} |
||||
|
||||
QString APMRemoteSupportComponent::name(void) const |
||||
{ |
||||
return _name; |
||||
} |
||||
|
||||
QString APMRemoteSupportComponent::description(void) const |
||||
{ |
||||
return tr("On this menu you can forward mavlink telemetry to an ardupilot support engineer."); |
||||
} |
||||
|
||||
QString APMRemoteSupportComponent::iconResource(void) const |
||||
{ |
||||
return QStringLiteral("/qmlimages/ForwardingSupportIcon.svg"); |
||||
} |
||||
|
||||
bool APMRemoteSupportComponent::requiresSetup(void) const |
||||
{ |
||||
return false; |
||||
} |
||||
|
||||
bool APMRemoteSupportComponent::setupComplete(void) const |
||||
{ |
||||
return true; |
||||
} |
||||
|
||||
QStringList APMRemoteSupportComponent::setupCompleteChangedTriggerList(void) const |
||||
{ |
||||
return QStringList(); |
||||
} |
||||
|
||||
QUrl APMRemoteSupportComponent::setupSource(void) const |
||||
{ |
||||
return QUrl::fromUserInput(QStringLiteral("qrc:/qml/APMRemoteSupportComponent.qml")); |
||||
|
||||
} |
||||
|
||||
QUrl APMRemoteSupportComponent::summaryQmlSource(void) const |
||||
{ |
||||
return QUrl(); |
||||
} |
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
/****************************************************************************
|
||||
* |
||||
* (c) 2009-2023 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 "VehicleComponent.h" |
||||
|
||||
class APMRemoteSupportComponent : public VehicleComponent |
||||
{ |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
APMRemoteSupportComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); |
||||
|
||||
// Virtuals from VehicleComponent
|
||||
QStringList setupCompleteChangedTriggerList(void) const final; |
||||
|
||||
// Virtuals from VehicleComponent
|
||||
QString name(void) const final; |
||||
QString description(void) const final; |
||||
QString iconResource(void) const final; |
||||
bool requiresSetup(void) const final; |
||||
bool setupComplete(void) const final; |
||||
QUrl setupSource(void) const final; |
||||
QUrl summaryQmlSource(void) const final; |
||||
|
||||
private: |
||||
const QString _name; |
||||
}; |
@ -0,0 +1,68 @@
@@ -0,0 +1,68 @@
|
||||
/**************************************************************************** |
||||
* |
||||
* (c) 2009-2023 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 |
||||
import QGroundControl.FactControls 1.0 |
||||
import QGroundControl.FactSystem 1.0 |
||||
|
||||
SetupPage { |
||||
pageComponent: pageComponent |
||||
|
||||
Component { |
||||
id: pageComponent |
||||
|
||||
Rectangle { |
||||
id: backgroundRectangle |
||||
width: availableWidth |
||||
height: elementsRow.height * 1.5 |
||||
color: qgcPal.windowShade |
||||
|
||||
GridLayout { |
||||
id: elementsRow |
||||
columns: 2 |
||||
|
||||
anchors.left: parent.left |
||||
anchors.verticalCenter: parent.verticalCenter |
||||
anchors.margins: ScreenTools.defaultFontPixelWidth |
||||
|
||||
columnSpacing: ScreenTools.defaultFontPixelWidth |
||||
rowSpacing: ScreenTools.defaultFontPixelWidth |
||||
|
||||
QGCLabel { |
||||
visible: QGroundControl.settingsManager.appSettings.forwardMavlinkAPMSupportHostName.visible |
||||
text: qsTr("Host name:") |
||||
} |
||||
FactTextField { |
||||
id: mavlinkForwardingHostNameField |
||||
fact: QGroundControl.settingsManager.appSettings.forwardMavlinkAPMSupportHostName |
||||
Layout.preferredWidth: ScreenTools.defaultFontPixelWidth * 40 |
||||
} |
||||
QGCButton { |
||||
text: qsTr("Connect") |
||||
enabled: !QGroundControl.linkManager.mavlinkSupportForwardingEnabled |
||||
|
||||
onPressed: { |
||||
QGroundControl.linkManager.createMavlinkForwardingSupportLink() |
||||
} |
||||
} |
||||
QGCLabel { |
||||
visible: QGroundControl.linkManager.mavlinkSupportForwardingEnabled |
||||
text: qsTr("Forwarding traffic: Mavlink traffic will keep being forwarded until application restarts") |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue