Skip to content

Commit

Permalink
Update custom example to latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DonLakeFlyer committed Aug 9, 2020
1 parent f62c864 commit c5511e0
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 31 deletions.
8 changes: 0 additions & 8 deletions custom-example/custom.pri
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@ RESOURCES += \
QML_IMPORT_PATH += \
$$PWD/res

LinuxBuild {

# Our QT_INSTALL_LIBS
QT_LIB_LIST += \
libQt5VirtualKeyboard.so.5 \

}

# Our own, custom sources
SOURCES += \
$$PWD/src/CustomPlugin.cc \
Expand Down
1 change: 1 addition & 0 deletions custom-example/qgcresources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<file alias="gear-black.svg">../resources/gear-black.svg</file>
<file alias="gear-white.svg">../resources/gear-white.svg</file>
<file alias="helicoptericon.svg">../resources/helicoptericon.svg</file>
<file alias="BingNoTileBytes.dat">../resources/BingNoTileBytes.dat</file>
<file alias="JoystickBezel.png">../resources/JoystickBezel.png</file>
<file alias="JoystickBezelLight.png">../resources/JoystickBezelLight.png</file>
<file alias="land.svg">../resources/land.svg</file>
Expand Down
13 changes: 9 additions & 4 deletions custom-example/qgroundcontrol.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<file alias="GPSRTKIndicator.qml">../src/ui/toolbar/GPSRTKIndicator.qml</file>
<file alias="JoystickIndicator.qml">../src/ui/toolbar/JoystickIndicator.qml</file>
<file alias="LinkIndicator.qml">../src/ui/toolbar/LinkIndicator.qml</file>
<file alias="MainToolBar.qml">../src/ui/toolbar/MainToolBar.qml</file>
<file alias="MainToolBarIndicators.qml">../src/ui/toolbar/MainToolBarIndicators.qml</file>
<file alias="MessageIndicator.qml">../src/ui/toolbar/MessageIndicator.qml</file>
<file alias="ModeIndicator.qml">../src/ui/toolbar/ModeIndicator.qml</file>
Expand Down Expand Up @@ -50,7 +49,6 @@
<file alias="FWLandingPatternEditor.qml">../src/PlanView/FWLandingPatternEditor.qml</file>
<file alias="GeneralSettings.qml">../src/ui/preferences/GeneralSettings.qml</file>
<file alias="GeoTagPage.qml">../src/AnalyzeView/GeoTagPage.qml</file>
<file alias="HealthPageWidget.qml">../src/FlightMap/Widgets/HealthPageWidget.qml</file>
<file alias="HelpSettings.qml">../src/ui/preferences/HelpSettings.qml</file>
<file alias="JoystickConfig.qml">../src/VehicleSetup/JoystickConfig.qml</file>
<file alias="JoystickConfigAdvanced.qml">../src/VehicleSetup/JoystickConfigAdvanced.qml</file>
Expand All @@ -65,6 +63,7 @@
<file alias="MAVLinkInspectorPage.qml">../src/AnalyzeView/MAVLinkInspectorPage.qml</file>
<file alias="MavlinkSettings.qml">../src/ui/preferences/MavlinkSettings.qml</file>
<file alias="MicrohardSettings.qml">../src/Microhard/MicrohardSettings.qml</file>
<file alias="MissionCommandTreeEditorTestWindow.qml">../src/MissionManager/MissionCommandTreeEditorTestWindow.qml</file>
<file alias="MissionSettingsEditor.qml">../src/PlanView/MissionSettingsEditor.qml</file>
<file alias="MockLink.qml">../src/ui/preferences/MockLink.qml</file>
<file alias="MockLinkSettings.qml">../src/ui/preferences/MockLinkSettings.qml</file>
Expand All @@ -77,7 +76,6 @@
<file alias="PX4FlowSensor.qml">../src/VehicleSetup/PX4FlowSensor.qml</file>
<file alias="QGCInstrumentWidget.qml">../src/FlightMap/Widgets/QGCInstrumentWidget.qml</file>
<file alias="QGCInstrumentWidgetAlternate.qml">../src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml</file>
<file alias="QGCViewDialogContainer.qml">../src/QmlControls/QGCViewDialogContainer.qml</file>
<file alias="QGroundControl/Controls/AnalyzePage.qml">../src/AnalyzeView/AnalyzePage.qml</file>
<file alias="QGroundControl/Controls/AppMessages.qml">../src/QmlControls/AppMessages.qml</file>
<file alias="QGroundControl/Controls/AxisMonitor.qml">../src/QmlControls/AxisMonitor.qml</file>
Expand Down Expand Up @@ -107,6 +105,8 @@
<file alias="QGroundControl/Controls/JoystickThumbPad.qml">../src/QmlControls/JoystickThumbPad.qml</file>
<file alias="QGroundControl/Controls/KMLOrSHPFileDialog.qml">../src/QmlControls/KMLOrSHPFileDialog.qml</file>
<file alias="QGroundControl/Controls/LogReplayStatusBar.qml">../src/QmlControls/LogReplayStatusBar.qml</file>
<file alias="QGroundControl/Controls/MainStatusIndicator.qml">../src/ui/toolbar/MainStatusIndicator.qml</file>
<file alias="QGroundControl/Controls/MainToolBar.qml">../src/ui/toolbar/MainToolBar.qml</file>
<file alias="QGroundControl/Controls/MainWindowSavedState.qml">../src/QmlControls/MainWindowSavedState.qml</file>
<file alias="QGroundControl/Controls/MAVLinkChart.qml">../src/QmlControls/MAVLinkChart.qml</file>
<file alias="QGroundControl/Controls/MAVLinkMessageButton.qml">../src/QmlControls/MAVLinkMessageButton.qml</file>
Expand Down Expand Up @@ -161,6 +161,7 @@
<file alias="QGroundControl/Controls/QGCToolBarButton.qml">../src/QmlControls/QGCToolBarButton.qml</file>
<file alias="QGroundControl/Controls/QGCToolInsets.qml">../src/QmlControls/QGCToolInsets.qml</file>
<file alias="QGroundControl/Controls/QGCViewDialog.qml">../src/QmlControls/QGCViewDialog.qml</file>
<file alias="QGroundControl/Controls/QGCViewDialogContainer.qml">../src/QmlControls/QGCViewDialogContainer.qml</file>
<file alias="QGroundControl/Controls/QGCViewMessage.qml">../src/QmlControls/QGCViewMessage.qml</file>
<file alias="QGroundControl/Controls/qmldir">../src/QmlControls/QGroundControl/Controls/qmldir</file>
<file alias="QGroundControl/Controls/RallyPointEditorHeader.qml">../src/PlanView/RallyPointEditorHeader.qml</file>
Expand All @@ -179,9 +180,10 @@
<file alias="QGroundControl/Controls/SurveyMapVisual.qml">../src/PlanView/SurveyMapVisual.qml</file>
<file alias="QGroundControl/Controls/TerrainStatus.qml">../src/PlanView/TerrainStatus.qml</file>
<file alias="QGroundControl/Controls/TakeoffItemMapVisual.qml">../src/PlanView/TakeoffItemMapVisual.qml</file>
<file alias="QGroundControl/Controls/ToolBarBase.qml">../src/ui/toolbar/ToolBarBase.qml</file>
<file alias="QGroundControl/Controls/ToolStrip.qml">../src/QmlControls/ToolStrip.qml</file>
<file alias="QGroundControl/Controls/TransectStyleComplexItemStats.qml">../src/PlanView/TransectStyleComplexItemStats.qml</file>
<file alias="QGroundControl/Controls/TransectStyleComplexItemTabBar.qml">../src/PlanView/TransectStyleComplexItemTabBar.qml</file>
<file alias="QGroundControl/Controls/TransectStyleComplexItemTerrainFollow.qml">../src/PlanView/TransectStyleComplexItemTerrainFollow.qml</file>
<file alias="QGroundControl/Controls/VehicleRotationCal.qml">../src/QmlControls/VehicleRotationCal.qml</file>
<file alias="QGroundControl/Controls/VehicleSummaryRow.qml">../src/QmlControls/VehicleSummaryRow.qml</file>
<file alias="QGroundControl/Controls/VerticalFactValueGrid.qml">../src/QmlControls/VerticalFactValueGrid.qml</file>
Expand Down Expand Up @@ -335,5 +337,8 @@
<qresource prefix="/MockLink">
<file alias="APMArduSubMockLink.params">../src/comm/APMArduSubMockLink.params</file>
<file alias="PX4MockLink.params">../src/comm/PX4MockLink.params</file>
<file alias="Version.MetaData.json">../src/comm/MockLink.Version.MetaData.json</file>
<file alias="Version.MetaData.json.gz">../src/comm/MockLink.Version.MetaData.json.gz</file>
<file alias="Parameter.MetaData.json">../src/comm/MockLink.Parameter.MetaData.json</file>
</qresource>
</RCC>
8 changes: 4 additions & 4 deletions custom-example/src/CustomPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ bool CustomPlugin::adjustSettingMetaData(const QString& settingsGroup, FactMetaD
if (settingsGroup == AppSettings::settingsGroup) {
// This tells QGC than when you are creating Plans while not connected to a vehicle
// the specific firmware/vehicle the plan is for.
if (metaData.name() == AppSettings::offlineEditingFirmwareTypeName) {
metaData.setRawDefaultValue(MAV_AUTOPILOT_PX4);
if (metaData.name() == AppSettings::offlineEditingFirmwareClassName) {
metaData.setRawDefaultValue(QGCMAVLink::FirmwareClassPX4);
return false;
} else if (metaData.name() == AppSettings::offlineEditingVehicleTypeName) {
metaData.setRawDefaultValue(MAV_TYPE_QUADROTOR);
} else if (metaData.name() == AppSettings::offlineEditingVehicleClassName) {
metaData.setRawDefaultValue(QGCMAVLink::VehicleClassMultiRotor);
return false;
}
}
Expand Down
23 changes: 11 additions & 12 deletions custom-example/src/FirmwarePlugin/CustomFirmwarePluginFactory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,18 @@ CustomFirmwarePluginFactory::CustomFirmwarePluginFactory()

}

QList<MAV_AUTOPILOT> CustomFirmwarePluginFactory::supportedFirmwareTypes() const
QList<QGCMAVLink::FirmwareClass_t> CustomFirmwarePluginFactory::supportedFirmwareClasses() const
{
QList<MAV_AUTOPILOT> list;
list.append(MAV_AUTOPILOT_PX4);
return list;
QList<QGCMAVLink::FirmwareClass_t> firmwareClasses;
firmwareClasses.append(QGCMAVLink::FirmwareClassPX4);
return firmwareClasses;
}

QList<QGCMAVLink::VehicleClass_t> CustomFirmwarePluginFactory::supportedVehicleClasses(void) const
{
QList<QGCMAVLink::VehicleClass_t> vehicleClasses;
vehicleClasses.append(QGCMAVLink::VehicleClassMultiRotor);
return vehicleClasses;
}

FirmwarePlugin* CustomFirmwarePluginFactory::firmwarePluginForAutopilot(MAV_AUTOPILOT autopilotType, MAV_TYPE /*vehicleType*/)
Expand All @@ -39,11 +46,3 @@ FirmwarePlugin* CustomFirmwarePluginFactory::firmwarePluginForAutopilot(MAV_AUTO
}
return nullptr;
}


QList<MAV_TYPE> CustomFirmwarePluginFactory::supportedVehicleTypes(void) const
{
QList<MAV_TYPE> mavTypes;
mavTypes.append(MAV_TYPE_QUADROTOR);
return mavTypes;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class CustomFirmwarePluginFactory : public FirmwarePluginFactory
Q_OBJECT
public:
CustomFirmwarePluginFactory();
QList<MAV_AUTOPILOT> supportedFirmwareTypes () const final;
FirmwarePlugin* firmwarePluginForAutopilot (MAV_AUTOPILOT autopilotType, MAV_TYPE vehicleType) final;
QList<MAV_TYPE> supportedVehicleTypes (void) const final;
QList<QGCMAVLink::FirmwareClass_t> supportedFirmwareClasses(void) const final;
QList<QGCMAVLink::VehicleClass_t> supportedVehicleClasses(void) const final;
FirmwarePlugin* firmwarePluginForAutopilot (MAV_AUTOPILOT autopilotType, MAV_TYPE vehicleType) final;

private:
CustomFirmwarePlugin* _pluginInstance;
Expand Down

0 comments on commit c5511e0

Please sign in to comment.