Browse Source

APM support forwarding: Add APMRemoteSupportComponent to APM conf submenus

QGC4.4
davidsastresas 2 years ago committed by David Sastre
parent
commit
e74147f4c7
  1. 2
      qgroundcontrol.pro
  2. 6
      src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc
  3. 2
      src/AutoPilotPlugins/APM/APMAutoPilotPlugin.h
  4. 58
      src/AutoPilotPlugins/APM/APMRemoteSupportComponent.cc
  5. 35
      src/AutoPilotPlugins/APM/APMRemoteSupportComponent.h
  6. 68
      src/AutoPilotPlugins/APM/APMRemoteSupportComponent.qml
  7. 1
      src/FirmwarePlugin/APM/APMResources.qrc

2
qgroundcontrol.pro

@ -1157,6 +1157,7 @@ APMFirmwarePlugin { @@ -1157,6 +1157,7 @@ APMFirmwarePlugin {
src/AutoPilotPlugins/APM/APMSensorsComponentController.h \
src/AutoPilotPlugins/APM/APMSubMotorComponentController.h \
src/AutoPilotPlugins/APM/APMTuningComponent.h \
src/AutoPilotPlugins/APM/APMRemoteSupportComponent.h \
src/FirmwarePlugin/APM/APMFirmwarePlugin.h \
src/FirmwarePlugin/APM/APMParameterMetaData.h \
src/FirmwarePlugin/APM/ArduCopterFirmwarePlugin.h \
@ -1185,6 +1186,7 @@ APMFirmwarePlugin { @@ -1185,6 +1186,7 @@ APMFirmwarePlugin {
src/AutoPilotPlugins/APM/APMSensorsComponentController.cc \
src/AutoPilotPlugins/APM/APMSubMotorComponentController.cc \
src/AutoPilotPlugins/APM/APMTuningComponent.cc \
src/AutoPilotPlugins/APM/APMRemoteSupportComponent.cc \
src/FirmwarePlugin/APM/APMFirmwarePlugin.cc \
src/FirmwarePlugin/APM/APMParameterMetaData.cc \
src/FirmwarePlugin/APM/ArduCopterFirmwarePlugin.cc \

6
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc

@ -29,6 +29,7 @@ @@ -29,6 +29,7 @@
#include "APMFollowComponent.h"
#include "ESP8266Component.h"
#include "APMHeliComponent.h"
#include "APMRemoteSupportComponent.h"
#include "QGCApplication.h"
#include "ParameterManager.h"
@ -53,6 +54,7 @@ APMAutoPilotPlugin::APMAutoPilotPlugin(Vehicle* vehicle, QObject* parent) @@ -53,6 +54,7 @@ APMAutoPilotPlugin::APMAutoPilotPlugin(Vehicle* vehicle, QObject* parent)
, _tuningComponent (nullptr)
, _esp8266Component (nullptr)
, _heliComponent (nullptr)
, _apmRemoteSupportComponent(nullptr)
#if 0
// Follow me not ready for Stable
, _followComponent (nullptr)
@ -152,6 +154,10 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void) @@ -152,6 +154,10 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void)
_esp8266Component->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_esp8266Component));
}
_apmRemoteSupportComponent = new APMRemoteSupportComponent(_vehicle, this);
_apmRemoteSupportComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_apmRemoteSupportComponent));
} else {
qWarning() << "Call to vehicleCompenents prior to parametersReady";
}

2
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.h

@ -27,6 +27,7 @@ class APMLightsComponent; @@ -27,6 +27,7 @@ class APMLightsComponent;
class APMSubFrameComponent;
class ESP8266Component;
class APMHeliComponent;
class APMRemoteSupportComponent;
class APMFollowComponent;
/// This is the APM specific implementation of the AutoPilot class.
@ -57,6 +58,7 @@ protected: @@ -57,6 +58,7 @@ protected:
APMTuningComponent* _tuningComponent;
ESP8266Component* _esp8266Component;
APMHeliComponent* _heliComponent;
APMRemoteSupportComponent* _apmRemoteSupportComponent;
#if 0
// Follow me not ready for Stable
APMFollowComponent* _followComponent;

58
src/AutoPilotPlugins/APM/APMRemoteSupportComponent.cc

@ -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();
}

35
src/AutoPilotPlugins/APM/APMRemoteSupportComponent.h

@ -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;
};

68
src/AutoPilotPlugins/APM/APMRemoteSupportComponent.qml

@ -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")
}
}
}
}
}

1
src/FirmwarePlugin/APM/APMResources.qrc

@ -29,6 +29,7 @@ @@ -29,6 +29,7 @@
<file alias="APMSensorsComponentSummary.qml">../../AutoPilotPlugins/APM/APMSensorsComponentSummary.qml</file>
<file alias="APMTuningComponentCopter.qml">../../AutoPilotPlugins/APM/APMTuningComponentCopter.qml</file>
<file alias="APMTuningComponentSub.qml">../../AutoPilotPlugins/APM/APMTuningComponentSub.qml</file>
<file alias="APMRemoteSupportComponent.qml">../../AutoPilotPlugins/APM/APMRemoteSupportComponent.qml</file>
<file alias="QGroundControl/ArduPilot/APMSensorParams.qml">APMSensorParams.qml</file>
<file alias="QGroundControl/ArduPilot/APMSensorIdDecoder.qml">APMSensorIdDecoder.qml</file>
<file alias="QGroundControl/ArduPilot/qmldir">QGroundControl.ArduPilot.qmldir</file>

Loading…
Cancel
Save