Commit 61b70232 authored by Pierre TILAK's avatar Pierre TILAK

Merge branch 'master' of https://github.com/mavlink/qgroundcontrol into MapProviders

parents dd5229fa 5c09454c
......@@ -162,7 +162,7 @@ before_script:
- if [ "${SPEC}" = "android-clang" ]; then
git remote set-branches origin 'master' &&
git fetch --tags origin master &&
./tools/update_android_version.sh ${BITNESS};
./tools/update_android_version.sh ${BITNESS} ${TRAVIS_BRANCH};
fi
script:
......
......@@ -6,6 +6,12 @@ Note: This file only contains high level features or important fixes.
### 3.6.0 - Daily Build
* Plan View: New create plan UI for initial plan creation
* New Corridor editing tools ui. Includes ability to trace polyline by clicking.
* New Polygon editing tools ui. Includes ability to trace polygon by clicking.
* ArduCopter/Rover: Follow Me setup page
* More performant flight path display algorithm. Mobile builds no longer show limited path length.
* ArduCopter/Rover: Add support for Follow Me
* ArduPilot: Add Motor Test vehicle setup page
* Compass Instrument: Add indicators for Home, COG and Next Waypoint headings.
* Log Replay: Support changing speed of playback
......
......@@ -61,7 +61,7 @@
<file alias="camera.svg">resources/camera.svg</file>
<file alias="camera_photo.svg">src/Camera/images/camera_photo.svg</file>
<file alias="camera_video.svg">src/Camera/images/camera_video.svg</file>
<file alias="CameraComponentIcon.png">src/AutoPilotPlugins/PX4/Images/CameraComponentIcon.png</file>
<file alias="CameraComponentIcon.png">src/AutoPilotPlugins/Common/Images/CameraComponentIcon.png</file>
<file alias="CameraIcon.svg">src/ui/toolbar/Images/CameraIcon.svg</file>
<file alias="CameraTrigger.svg">src/AutoPilotPlugins/PX4/Images/CameraTrigger.svg</file>
<file alias="check.svg">resources/check.svg</file>
......@@ -78,7 +78,8 @@
<file alias="Disarmed.svg">src/ui/toolbar/Images/Disarmed.svg</file>
<file alias="Disconnect.svg">src/ui/toolbar/Images/Disconnect.svg</file>
<file alias="FirmwareUpgradeIcon.png">src/VehicleSetup/FirmwareUpgradeIcon.png</file>
<file alias="FlightModesComponentIcon.png">src/AutoPilotPlugins/PX4/Images/FlightModesComponentIcon.png</file>
<file alias="FollowComponentIcon.png">src/AutoPilotPlugins/Common/Images/FlightModesComponentIcon.png</file>
<file alias="FlightModesComponentIcon.png">src/AutoPilotPlugins/Common/Images/FlightModesComponentIcon.png</file>
<file alias="Frames/BlueROV1.png">src/AutoPilotPlugins/APM/Images/bluerov-frame.png</file>
<file alias="Frames/SimpleROV-3.png">src/AutoPilotPlugins/APM/Images/simple3-frame.png</file>
<file alias="Frames/SimpleROV-4.png">src/AutoPilotPlugins/APM/Images/simple4-frame.png</file>
......@@ -126,16 +127,20 @@
<file alias="pipHide.svg">src/FlightMap/Images/pipHide.svg</file>
<file alias="pipResize.svg">src/FlightMap/Images/pipResize.svg</file>
<file alias="Plan.svg">src/ui/toolbar/Images/Plan.svg</file>
<file alias="PlanCreator/CustomPlanCreator.png">src/MissionManager/CustomPlanCreator.png</file>
<file alias="PlanCreator/CorridorScanPlanCreator.png">src/MissionManager/CorridorScanPlanCreator.png</file>
<file alias="PlanCreator/StructureScanPlanCreator.png">src/MissionManager/StructureScanPlanCreator.png</file>
<file alias="PlanCreator/SurveyPlanCreator.png">src/MissionManager/SurveyPlanCreator.png</file>
<file alias="PowerComponentBattery_01cell.svg">src/AutoPilotPlugins/PX4/Images/PowerComponentBattery_01cell.svg</file>
<file alias="PowerComponentBattery_02cell.svg">src/AutoPilotPlugins/PX4/Images/PowerComponentBattery_02cell.svg</file>
<file alias="PowerComponentBattery_03cell.svg">src/AutoPilotPlugins/PX4/Images/PowerComponentBattery_03cell.svg</file>
<file alias="PowerComponentBattery_04cell.svg">src/AutoPilotPlugins/PX4/Images/PowerComponentBattery_04cell.svg</file>
<file alias="PowerComponentBattery_05cell.svg">src/AutoPilotPlugins/PX4/Images/PowerComponentBattery_05cell.svg</file>
<file alias="PowerComponentBattery_06cell.svg">src/AutoPilotPlugins/PX4/Images/PowerComponentBattery_06cell.svg</file>
<file alias="PowerComponentIcon.png">src/AutoPilotPlugins/PX4/Images/PowerComponentIcon.png</file>
<file alias="PowerComponentIcon.png">src/AutoPilotPlugins/Common/Images/PowerComponentIcon.png</file>
<file alias="PX4/BrandImage">src/FirmwarePlugin/PX4/PX4BrandImage.png</file>
<file alias="Quad.svg">src/ui/toolbar/Images/Quad.svg</file>
<file alias="RadioComponentIcon.png">src/AutoPilotPlugins/PX4/Images/RadioComponentIcon.png</file>
<file alias="RadioComponentIcon.png">src/AutoPilotPlugins/Common/Images/RadioComponentIcon.png</file>
<file alias="RC.svg">src/ui/toolbar/Images/RC.svg</file>
<file alias="RCLoss.svg">src/AutoPilotPlugins/PX4/Images/RCLoss.svg</file>
<file alias="RCLossLight.svg">src/AutoPilotPlugins/PX4/Images/RCLossLight.svg</file>
......@@ -144,12 +149,12 @@
<file alias="rollDialWhite.svg">src/FlightMap/Images/rollDialWhite.svg</file>
<file alias="rollPointerWhite.svg">src/FlightMap/Images/rollPointerWhite.svg</file>
<file alias="RTK.svg">src/ui/toolbar/Images/RTK.svg</file>
<file alias="SafetyComponentIcon.png">src/AutoPilotPlugins/PX4/Images/SafetyComponentIcon.png</file>
<file alias="SafetyComponentIcon.png">src/AutoPilotPlugins/Common/Images/SafetyComponentIcon.png</file>
<file alias="scale.png">src/FlightMap/Images/scale.png</file>
<file alias="scale_end.png">src/FlightMap/Images/scale_end.png</file>
<file alias="scale_endLight.png">src/FlightMap/Images/scale_endLight.png</file>
<file alias="scaleLight.png">src/FlightMap/Images/scaleLight.png</file>
<file alias="SensorsComponentIcon.png">src/AutoPilotPlugins/PX4/Images/SensorsComponentIcon.png</file>
<file alias="SensorsComponentIcon.png">src/AutoPilotPlugins/Common/Images/SensorsComponentIcon.png</file>
<file alias="Signal0.svg">src/ui/toolbar/Images/Signal0.svg</file>
<file alias="Signal100.svg">src/ui/toolbar/Images/Signal100.svg</file>
<file alias="Signal20.svg">src/ui/toolbar/Images/Signal20.svg</file>
......@@ -161,7 +166,7 @@
<file alias="subMenuButtonImage.png">resources/CogWheels.png</file>
<file alias="subVehicleArrowOpaque.png">src/FlightMap/Images/sub.png</file>
<file alias="TelemRSSI.svg">src/ui/toolbar/Images/TelemRSSI.svg</file>
<file alias="TuningComponentIcon.png">src/AutoPilotPlugins/PX4/Images/TuningComponentIcon.png</file>
<file alias="TuningComponentIcon.png">src/AutoPilotPlugins/Common/Images/TuningComponentIcon.png</file>
<file alias="vehicleArrowOpaque.svg">src/FlightMap/Images/vehicleArrowOpaque.svg</file>
<file alias="vehicleArrowOutline.svg">src/FlightMap/Images/vehicleArrowOutline.svg</file>
<file alias="VehicleDown.png">src/AutoPilotPlugins/PX4/Images/VehicleDown.png</file>
......
......@@ -313,6 +313,9 @@ DebugBuild {
include(src/QtLocationPlugin/QGCLocationPlugin.pri)
# Until pairing can be made to work cleanly on all OS it is turned off
DEFINES+=QGC_DISABLE_PAIRING
# Pairing
contains (DEFINES, QGC_DISABLE_PAIRING) {
message("Skipping support for Pairing")
......@@ -413,7 +416,7 @@ INCLUDEPATH += \
src/QtLocationPlugin/QMLControl \
src/Settings \
src/Terrain \
src/VehicleSetup \
src/Vehicle \
src/ViewWidgets \
src/Audio \
src/comm \
......@@ -588,6 +591,8 @@ HEADERS += \
src/MissionManager/CameraSpec.h \
src/MissionManager/ComplexMissionItem.h \
src/MissionManager/CorridorScanComplexItem.h \
src/MissionManager/CorridorScanPlanCreator.h \
src/MissionManager/CustomPlanCreator.h \
src/MissionManager/FixedWingLandingComplexItem.h \
src/MissionManager/GeoFenceController.h \
src/MissionManager/GeoFenceManager.h \
......@@ -600,6 +605,7 @@ HEADERS += \
src/MissionManager/MissionManager.h \
src/MissionManager/MissionSettingsItem.h \
src/MissionManager/PlanElementController.h \
src/MissionManager/PlanCreator.h \
src/MissionManager/PlanManager.h \
src/MissionManager/PlanMasterController.h \
src/MissionManager/QGCFenceCircle.h \
......@@ -614,7 +620,9 @@ HEADERS += \
src/MissionManager/Section.h \
src/MissionManager/SpeedSection.h \
src/MissionManager/StructureScanComplexItem.h \
src/MissionManager/StructureScanPlanCreator.h \
src/MissionManager/SurveyComplexItem.h \
src/MissionManager/SurveyPlanCreator.h \
src/MissionManager/TransectStyleComplexItem.h \
src/MissionManager/VisualMissionItem.h \
src/PositionManager/PositionManager.h \
......@@ -660,7 +668,13 @@ HEADERS += \
src/SHPFileHelper.h \
src/Terrain/TerrainQuery.h \
src/TerrainTile.h \
src/Vehicle/ADSBVehicle.h \
src/Vehicle/GPSRTKFactGroup.h \
src/Vehicle/MAVLinkLogManager.h \
src/Vehicle/MultiVehicleManager.h \
src/Vehicle/TrajectoryPoints.h \
src/Vehicle/Vehicle.h \
src/Vehicle/VehicleObjectAvoidance.h \
src/VehicleSetup/JoystickConfigController.h \
src/comm/LinkConfiguration.h \
src/comm/LinkInterface.h \
......@@ -808,6 +822,8 @@ SOURCES += \
src/MissionManager/CameraSpec.cc \
src/MissionManager/ComplexMissionItem.cc \
src/MissionManager/CorridorScanComplexItem.cc \
src/MissionManager/CorridorScanPlanCreator.cc \
src/MissionManager/CustomPlanCreator.cc \
src/MissionManager/FixedWingLandingComplexItem.cc \
src/MissionManager/GeoFenceController.cc \
src/MissionManager/GeoFenceManager.cc \
......@@ -820,6 +836,7 @@ SOURCES += \
src/MissionManager/MissionManager.cc \
src/MissionManager/MissionSettingsItem.cc \
src/MissionManager/PlanElementController.cc \
src/MissionManager/PlanCreator.cc \
src/MissionManager/PlanManager.cc \
src/MissionManager/PlanMasterController.cc \
src/MissionManager/QGCFenceCircle.cc \
......@@ -833,7 +850,9 @@ SOURCES += \
src/MissionManager/SimpleMissionItem.cc \
src/MissionManager/SpeedSection.cc \
src/MissionManager/StructureScanComplexItem.cc \
src/MissionManager/StructureScanPlanCreator.cc \
src/MissionManager/SurveyComplexItem.cc \
src/MissionManager/SurveyPlanCreator.cc \
src/MissionManager/TransectStyleComplexItem.cc \
src/MissionManager/VisualMissionItem.cc \
src/PositionManager/PositionManager.cpp \
......@@ -878,7 +897,13 @@ SOURCES += \
src/SHPFileHelper.cc \
src/Terrain/TerrainQuery.cc \
src/TerrainTile.cc\
src/Vehicle/ADSBVehicle.cc \
src/Vehicle/GPSRTKFactGroup.cc \
src/Vehicle/MAVLinkLogManager.cc \
src/Vehicle/MultiVehicleManager.cc \
src/Vehicle/TrajectoryPoints.cc \
src/Vehicle/Vehicle.cc \
src/Vehicle/VehicleObjectAvoidance.cc \
src/VehicleSetup/JoystickConfigController.cc \
src/comm/LinkConfiguration.cc \
src/comm/LinkInterface.cc \
......@@ -980,7 +1005,6 @@ SOURCES += \
INCLUDEPATH += \
src/AutoPilotPlugins/Common \
src/FirmwarePlugin \
src/Vehicle \
src/VehicleSetup \
HEADERS+= \
......@@ -995,11 +1019,6 @@ HEADERS+= \
src/FirmwarePlugin/CameraMetaData.h \
src/FirmwarePlugin/FirmwarePlugin.h \
src/FirmwarePlugin/FirmwarePluginManager.h \
src/Vehicle/ADSBVehicle.h \
src/Vehicle/MultiVehicleManager.h \
src/Vehicle/GPSRTKFactGroup.h \
src/Vehicle/Vehicle.h \
src/Vehicle/VehicleObjectAvoidance.h \
src/VehicleSetup/VehicleComponent.h \
!MobileBuild { !NoSerialBuild {
......@@ -1022,11 +1041,6 @@ SOURCES += \
src/FirmwarePlugin/CameraMetaData.cc \
src/FirmwarePlugin/FirmwarePlugin.cc \
src/FirmwarePlugin/FirmwarePluginManager.cc \
src/Vehicle/ADSBVehicle.cc \
src/Vehicle/MultiVehicleManager.cc \
src/Vehicle/GPSRTKFactGroup.cc \
src/Vehicle/Vehicle.cc \
src/Vehicle/VehicleObjectAvoidance.cc \
src/VehicleSetup/VehicleComponent.cc \
!MobileBuild { !NoSerialBuild {
......@@ -1064,6 +1078,8 @@ APMFirmwarePlugin {
src/AutoPilotPlugins/APM/APMCompassCal.h \
src/AutoPilotPlugins/APM/APMFlightModesComponent.h \
src/AutoPilotPlugins/APM/APMFlightModesComponentController.h \
src/AutoPilotPlugins/APM/APMFollowComponent.h \
src/AutoPilotPlugins/APM/APMFollowComponentController.h \
src/AutoPilotPlugins/APM/APMHeliComponent.h \
src/AutoPilotPlugins/APM/APMLightsComponent.h \
src/AutoPilotPlugins/APM/APMSubFrameComponent.h \
......@@ -1089,6 +1105,8 @@ APMFirmwarePlugin {
src/AutoPilotPlugins/APM/APMCompassCal.cc \
src/AutoPilotPlugins/APM/APMFlightModesComponent.cc \
src/AutoPilotPlugins/APM/APMFlightModesComponentController.cc \
src/AutoPilotPlugins/APM/APMFollowComponent.cc \
src/AutoPilotPlugins/APM/APMFollowComponentController.cc \
src/AutoPilotPlugins/APM/APMHeliComponent.cc \
src/AutoPilotPlugins/APM/APMLightsComponent.cc \
src/AutoPilotPlugins/APM/APMSubFrameComponent.cc \
......
......@@ -65,7 +65,8 @@
<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>
<file alias="QGroundControl/Controls/CameraCalc.qml">src/PlanView/CameraCalc.qml</file>
<file alias="QGroundControl/Controls/CameraCalcCamera.qml">src/PlanView/CameraCalcCamera.qml</file>
<file alias="QGroundControl/Controls/CameraCalcGrid.qml">src/PlanView/CameraCalcGrid.qml</file>
<file alias="QGroundControl/Controls/CameraSection.qml">src/PlanView/CameraSection.qml</file>
<file alias="QGroundControl/Controls/ClickableColor.qml">src/QmlControls/ClickableColor.qml</file>
<file alias="QGroundControl/Controls/CorridorScanMapVisual.qml">src/PlanView/CorridorScanMapVisual.qml</file>
......@@ -84,7 +85,9 @@
<file alias="QGroundControl/Controls/HeightIndicator.qml">src/QmlControls/HeightIndicator.qml</file>
<file alias="QGroundControl/Controls/IndicatorButton.qml">src/QmlControls/IndicatorButton.qml</file>
<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/MainWindowSavedState.qml">src/QmlControls/MainWindowSavedState.qml</file>
<file alias="QGroundControl/Controls/MAVLinkMessageButton.qml">src/QmlControls/MAVLinkMessageButton.qml</file>
<file alias="QGroundControl/Controls/MissionCommandDialog.qml">src/QmlControls/MissionCommandDialog.qml</file>
<file alias="QGroundControl/Controls/MissionItemEditor.qml">src/PlanView/MissionItemEditor.qml</file>
......@@ -98,6 +101,8 @@
<file alias="QGroundControl/Controls/ParameterEditor.qml">src/QmlControls/ParameterEditor.qml</file>
<file alias="QGroundControl/Controls/ParameterEditorDialog.qml">src/QmlControls/ParameterEditorDialog.qml</file>
<file alias="QGroundControl/Controls/PIDTuning.qml">src/QmlControls/PIDTuning.qml</file>
<file alias="QGroundControl/Controls/PlanEditToolbar.qml">src/PlanView/PlanEditToolbar.qml</file>
<file alias="QGroundControl/Controls/PlanStartOverlay.qml">src/PlanView/PlanStartOverlay.qml</file>
<file alias="QGroundControl/Controls/PreFlightCheckButton.qml">src/QmlControls/PreFlightCheckButton.qml</file>
<file alias="QGroundControl/Controls/PreFlightCheckGroup.qml">src/QmlControls/PreFlightCheckGroup.qml</file>
<file alias="QGroundControl/Controls/PreFlightCheckModel.qml">src/QmlControls/PreFlightCheckModel.qml</file>
......
......@@ -106,8 +106,15 @@ SetupPage {
readonly property real innerMargin: ScreenTools.defaultFontPixelWidth
MouseArea {
anchors.fill: parent
onClicked: airframeCheckBox.checked = true
anchors.fill: parent
onClicked: {
if (!airframeCheckBox.checked || !combo.valid) {
if (_frameTypeAvailable && object.defaultFrameType != -1) {
_frameType.rawValue = object.defaultFrameType
}
airframeCheckBox.checked = true
}
}
}
QGCLabel {
......@@ -116,12 +123,14 @@ SetupPage {
}
Rectangle {
id: imageComboRect
anchors.topMargin: ScreenTools.defaultFontPixelHeight / 2
anchors.top: title.bottom
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
color: airframeCheckBox.checked ? qgcPal.buttonHighlight : qgcPal.windowShade
opacity: combo.valid ? 1.0 : 0.5
ColumnLayout {
anchors.margins: innerMargin
......@@ -136,7 +145,7 @@ SetupPage {
smooth: true
antialiasing: true
sourceSize.width: width
source: object.imageResource
source: airframeCheckBox.checked ? object.imageResource : object.imageResourceDefault
}
QGCCheckBox {
......@@ -160,15 +169,47 @@ SetupPage {
visible: airframeCheckBox.checked && object.frameTypeSupported
}
FactComboBox {
QGCComboBox {
id: combo
Layout.fillWidth: true
fact: _frameType
indexModel: false
model: object.frameTypeEnumStrings
visible: airframeCheckBox.checked && object.frameTypeSupported
onActivated: _frameType.rawValue = object.frameTypeEnumValues[index]
property bool valid: true
function checkFrameType(value) {
return value == _frameType.rawValue
}
function selectFrameType() {
var index = object.frameTypeEnumValues.findIndex(checkFrameType)
if (index == -1 && combo.visible) {
// Frame Class/Type is set to an invalid combination
combo.valid = false
} else {
combo.currentIndex = index
combo.valid = true
}
}
Component.onCompleted: selectFrameType()
Connections {
target: _frameTypeAvailable ? _frameType : null
ignoreUnknownSignals: true
onRawValueChanged: combo.selectFrameType()
}
}
}
}
QGCLabel {
anchors.fill: imageComboRect
text: qsTr("Invalid setting for FRAME_TYPE. Click to Reset.")
wrapMode: Text.WordWrap
visible: !combo.valid
}
}
} // Repeater - summary boxes
} // Flow - summary boxes
......
......@@ -70,23 +70,35 @@ typedef struct {
} FrameToImageInfo_t;
static const FrameToImageInfo_t s_rgFrameToImageCopter[] = {
{ FRAME_CLASS_QUAD, FRAME_TYPE_PLUS, "QuadRotorPlus" },
{ FRAME_CLASS_QUAD, FRAME_TYPE_X, "QuadRotorX" },
{ FRAME_CLASS_QUAD, FRAME_TYPE_V, "QuadRotorWide" },
{ FRAME_CLASS_QUAD, FRAME_TYPE_H, "QuadRotorH" },
{ FRAME_CLASS_QUAD, FRAME_TYPE_V_TAIL, "QuadRotorVTail" },
{ FRAME_CLASS_QUAD, FRAME_TYPE_A_TAIL, "QuadRotorATail" },
{ FRAME_CLASS_HEX, FRAME_TYPE_PLUS, "HexaRotorPlus" },
{ FRAME_CLASS_HEX, FRAME_TYPE_X, "HexaRotorX" },
{ FRAME_CLASS_OCTA, FRAME_TYPE_PLUS, "OctoRotorPlus" },
{ FRAME_CLASS_OCTA, FRAME_TYPE_X, "OctoRotorX" },
{ FRAME_CLASS_OCTAQUAD, FRAME_TYPE_PLUS, "OctoRotorPlusCoaxial" },
{ FRAME_CLASS_OCTAQUAD, FRAME_TYPE_X, "OctoRotorXCoaxial" },
{ FRAME_CLASS_Y6, FRAME_TYPE_Y6B, "Y6B" },
{ FRAME_CLASS_Y6, FRAME_TYPE_Y6F, "AirframeUnknown" },
{ FRAME_CLASS_Y6, -1, "Y6A" },
{ FRAME_CLASS_HELI, -1, "Helicopter" },
{ FRAME_CLASS_TRI, -1, "YPlus" },
{ FRAME_CLASS_QUAD, FRAME_TYPE_X, "QuadRotorX" }, // Default
{ FRAME_CLASS_QUAD, FRAME_TYPE_PLUS, "QuadRotorPlus" },
{ FRAME_CLASS_QUAD, FRAME_TYPE_V, "QuadRotorWide" },
{ FRAME_CLASS_QUAD, FRAME_TYPE_H, "QuadRotorH" },
{ FRAME_CLASS_QUAD, FRAME_TYPE_V_TAIL, "QuadRotorVTail" },
{ FRAME_CLASS_QUAD, FRAME_TYPE_A_TAIL, "QuadRotorATail" },
{ FRAME_CLASS_HEX, FRAME_TYPE_X, "HexaRotorX" }, // Default
{ FRAME_CLASS_HEX, FRAME_TYPE_PLUS, "HexaRotorPlus" },
{ FRAME_CLASS_OCTA, FRAME_TYPE_X, "OctoRotorX" }, // Default
{ FRAME_CLASS_OCTA, FRAME_TYPE_PLUS, "OctoRotorPlus" },
{ FRAME_CLASS_OCTA, FRAME_TYPE_V, "AirframeUnknown" },
{ FRAME_CLASS_OCTA, FRAME_TYPE_H, "AirframeUnknown" },
{ FRAME_CLASS_OCTAQUAD, FRAME_TYPE_X, "OctoRotorXCoaxial" }, // Default
{ FRAME_CLASS_OCTAQUAD, FRAME_TYPE_PLUS, "OctoRotorPlusCoaxial" },
{ FRAME_CLASS_OCTAQUAD, FRAME_TYPE_V, "AirframeUnknown" },
{ FRAME_CLASS_OCTAQUAD, FRAME_TYPE_H, "AirframeUnknown" },
{ FRAME_CLASS_Y6, FRAME_TYPE_Y6B, "Y6B" }, // Default
{ FRAME_CLASS_Y6, FRAME_TYPE_Y6F, "AirframeUnknown" },
{ FRAME_CLASS_Y6, -1, "Y6A" },
{ FRAME_CLASS_DODECAHEXA, FRAME_TYPE_X, "AirframeUnknown" }, // Default
{ FRAME_CLASS_DODECAHEXA, FRAME_TYPE_PLUS, "AirframeUnknown" },
{ FRAME_CLASS_HELI, -1, "Helicopter" },
{ FRAME_CLASS_TRI, -1, "YPlus" },
};
static const FrameToImageInfo_t s_rgFrameToImageRover[] = {
......@@ -94,14 +106,16 @@ static const FrameToImageInfo_t s_rgFrameToImageRover[] = {
{ FRAME_CLASS_BOAT, -1, "Boat" },
};
static QString s_findImageResourceCopter(int frameClass, int frameType)
/// Returns the image resource for the frameClass, frameType pair
/// @param[in,out] frameType Specified frame type, or -1 to match first item in list (frameType found will be returned)
static QString s_findImageResourceCopter(int frameClass, int& frameType)
{
for (size_t i=0; i<sizeof(s_rgFrameToImageCopter)/sizeof(s_rgFrameToImageCopter[0]); i++) {
const FrameToImageInfo_t* pFrameToImageInfo = &s_rgFrameToImageCopter[i];
if (pFrameToImageInfo->frameClass == frameClass && pFrameToImageInfo->frameType == frameType) {
return pFrameToImageInfo->imageResource;
} else if (pFrameToImageInfo->frameClass == frameClass && pFrameToImageInfo->frameType == -1) {
if ((pFrameToImageInfo->frameClass == frameClass && frameType == -1) ||
(pFrameToImageInfo->frameClass == frameClass && pFrameToImageInfo->frameType == frameType)) {
frameType = pFrameToImageInfo->frameType;
return pFrameToImageInfo->imageResource;
}
}
......@@ -154,32 +168,19 @@ void APMAirframeComponentController::_fillFrameClasses()
for (int i=1; i<_frameClassFact->enumStrings().count(); i++) {
QString frameClassName = _frameClassFact->enumStrings()[i];
int frameClass = _frameClassFact->enumValues()[i].toInt();
int defaultFrameType;
if (frameClass == FRAME_CLASS_HELI) {
// Heli requires it's own firmware variant. You can't switch to Heli from a Copter variant firmware.
continue;
}
if (frameTypeNotSupported.contains(frameClass)) {
defaultFrameType = -1;
} else {
defaultFrameType = FRAME_TYPE_X;
}
_frameClassModel->append(new APMFrameClass(frameClassName, true /* copter */, frameClass, _frameTypeFact, defaultFrameType, _frameClassModel));
_frameClassModel->append(new APMFrameClass(frameClassName, true /* copter */, frameClass, _frameTypeFact, _frameClassModel));
}
} else if (qobject_cast<ArduRoverFirmwarePlugin*>(fwPlugin)) {
for (int i=1; i<_frameClassFact->enumStrings().count(); i++) {
QString frameClassName = _frameClassFact->enumStrings()[i];
int frameClass = _frameClassFact->enumValues()[i].toInt();
int defaultFrameType;
if (_frameTypeFact) {
defaultFrameType = FRAME_TYPE_UNDEFINED;
} else {
defaultFrameType = -1;
}
_frameClassModel->append(new APMFrameClass(frameClassName, false /* copter */, frameClass, _frameTypeFact, defaultFrameType, _frameClassModel));
_frameClassModel->append(new APMFrameClass(frameClassName, false /* copter */, frameClass, _frameTypeFact, _frameClassModel));
}
}
}
......@@ -270,19 +271,55 @@ void APMAirframeComponentController::_paramFileDownloadError(QString errorMsg)
qgcApp()->restoreOverrideCursor();
}
APMFrameClass::APMFrameClass(const QString& name, bool copter, int frameClass, Fact* frameTypeFact, int defaultFrameType, QObject* parent)
APMFrameClass::APMFrameClass(const QString& name, bool copter, int frameClass, Fact* frameTypeFact, QObject* parent)
: QObject (parent)
, _name (name)
, _copter (copter)
, _frameClass (frameClass)
, _defaultFrameType (defaultFrameType)
, _frameTypeSupported (defaultFrameType != -1)
, _defaultFrameType (-1)
, _frameTypeSupported (false)
, _frameTypeFact (frameTypeFact)
{
if (frameTypeFact) {
connect(frameTypeFact, &Fact::rawValueChanged, this, &APMFrameClass::imageResourceChanged);
connect(frameTypeFact, &Fact::rawValueChanged, this, &APMFrameClass::frameTypeChanged);
}
if (copter) {
QList<int> rgSupportedFrameTypes;
for (size_t i=0; i<sizeof(s_rgFrameToImageCopter)/sizeof(s_rgFrameToImageCopter[0]); i++) {
const FrameToImageInfo_t* pFrameToImageInfo = &s_rgFrameToImageCopter[i];
if (pFrameToImageInfo->frameClass == frameClass) {
if (_defaultFrameType == -1) {
// Default frame type/icon is the first item found to match frameClass
_defaultFrameType = pFrameToImageInfo->frameType;
_imageResourceDefault = QStringLiteral("/qmlimages/Airframe/%1").arg(pFrameToImageInfo->imageResource);
}
if (pFrameToImageInfo->frameType != -1) {
// The list includes the supported frame types for the class
rgSupportedFrameTypes.append(pFrameToImageInfo->frameType);
}
}
}
if (_imageResourceDefault.isEmpty()) {
_imageResourceDefault = QStringLiteral("/qmlimages/Airframe/AirframeUnknown");
}
// Filter the enums
for (const int frameType: rgSupportedFrameTypes) {
int index = frameTypeFact->enumValues().indexOf(frameType);
if (index != -1) {
_frameTypeEnumValues.append(frameType);
_frameTypeEnumStrings.append(frameTypeFact->enumStrings()[index]);
}
}
}
// If the frameClass is not in the list then frame type is not supported
_frameTypeSupported = _defaultFrameType != -1;
}
APMFrameClass::~APMFrameClass()
......
......@@ -54,25 +54,31 @@ class APMFrameClass : public QObject
Q_OBJECT
public:
APMFrameClass(const QString& name, bool copter, int frameClass, Fact* frameTypeFact, int defaultFrameType, QObject* parent = nullptr);
APMFrameClass(const QString& name, bool copter, int frameClass, Fact* frameTypeFact, QObject* parent = nullptr);
~APMFrameClass();
Q_PROPERTY(QString name MEMBER _name CONSTANT)
Q_PROPERTY(int frameClass MEMBER _frameClass CONSTANT)
Q_PROPERTY(int frameType READ frameType NOTIFY frameTypeChanged)
Q_PROPERTY(int defaultFrameType MEMBER _defaultFrameType CONSTANT)
Q_PROPERTY(QString imageResource READ imageResource NOTIFY imageResourceChanged)
Q_PROPERTY(bool frameTypeSupported MEMBER _frameTypeSupported CONSTANT)
Q_PROPERTY(QString name MEMBER _name CONSTANT)
Q_PROPERTY(int frameClass MEMBER _frameClass CONSTANT)
Q_PROPERTY(int frameType READ frameType NOTIFY frameTypeChanged)
Q_PROPERTY(QStringList frameTypeEnumStrings MEMBER _frameTypeEnumStrings CONSTANT)
Q_PROPERTY(QVariantList frameTypeEnumValues MEMBER _frameTypeEnumValues CONSTANT)
Q_PROPERTY(int defaultFrameType MEMBER _defaultFrameType CONSTANT)
Q_PROPERTY(QString imageResource READ imageResource NOTIFY imageResourceChanged)
Q_PROPERTY(QString imageResourceDefault MEMBER _imageResourceDefault CONSTANT)
Q_PROPERTY(bool frameTypeSupported MEMBER _frameTypeSupported CONSTANT)
int frameType (void) { return _frameTypeFact->rawValue().toInt(); };
int frameType (void) { return _frameTypeFact->rawValue().toInt(); }
QString imageResource (void);
QString _name;
bool _copter;
QString _imageResource;
int _frameClass;
int _defaultFrameType;
bool _frameTypeSupported;
QString _name;
bool _copter;
QString _imageResource;
QString _imageResourceDefault;
int _frameClass;
QStringList _frameTypeEnumStrings;
QVariantList _frameTypeEnumValues;
int _defaultFrameType;
bool _frameTypeSupported;
signals:
void imageResourceChanged(void);
......
......@@ -10,9 +10,10 @@
#include "APMAutoPilotPlugin.h"
#include "UAS.h"
#include "FirmwarePlugin/APM/APMParameterMetaData.h" // FIXME: Hack
#include "FirmwarePlugin/APM/APMFirmwarePlugin.h" // FIXME: Hack
#include "FirmwarePlugin/APM/ArduCopterFirmwarePlugin.h"
#include "APMParameterMetaData.h"
#include "APMFirmwarePlugin.h"
#include "ArduCopterFirmwarePlugin.h"
#include "ArduRoverFirmwarePlugin.h"
#include "VehicleComponent.h"
#include "APMAirframeComponent.h"
#include "APMFlightModesComponent.h"
......@@ -25,6 +26,7 @@
#include "APMCameraComponent.h"
#include "APMLightsComponent.h"
#include "APMSubFrameComponent.h"
#include "APMFollowComponent.h"
#include "ESP8266Component.h"
#include "APMHeliComponent.h"
#include "QGCApplication.h"
......@@ -51,6 +53,7 @@ APMAutoPilotPlugin::APMAutoPilotPlugin(Vehicle* vehicle, QObject* parent)
, _tuningComponent (nullptr)
, _esp8266Component (nullptr)
, _heliComponent (nullptr)
, _followComponent (nullptr)
{
#if !defined(NO_SERIAL_LINK) && !defined(__android__)
connect(vehicle->parameterManager(), &ParameterManager::parametersReadyChanged, this, &APMAutoPilotPlugin::_checkForBadCubeBlack);
......@@ -101,6 +104,13 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void)
_safetyComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_safetyComponent));
if ((qobject_cast<ArduCopterFirmwarePlugin*>(_vehicle->firmwarePlugin()) || qobject_cast<ArduRoverFirmwarePlugin*>(_vehicle->firmwarePlugin())) &&
_vehicle->parameterManager()->parameterExists(-1, QStringLiteral("FOLL_ENABLE"))) {
_followComponent = new APMFollowComponent(_vehicle, this);
_followComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_followComponent));
}
if (_vehicle->vehicleType() == MAV_TYPE_HELICOPTER) {
_heliComponent = new APMHeliComponent(_vehicle, this);
_heliComponent->setupTriggerSignals();
......
......@@ -27,6 +27,7 @@ class APMLightsComponent;
class APMSubFrameComponent;
class ESP8266Component;
class APMHeliComponent;
class APMFollowComponent;
/// This is the APM specific implementation of the AutoPilot class.
class APMAutoPilotPlugin : public AutoPilotPlugin
......@@ -56,6 +57,7 @@ protected:
APMTuningComponent* _tuningComponent;
ESP8266Component* _esp8266Component;
APMHeliComponent* _heliComponent;
APMFollowComponent* _followComponent;
#if !defined(NO_SERIAL_LINK) && !defined(__android__)
private slots:
......
......@@ -272,6 +272,7 @@ SetupPage {
anchors.left: gimbalOutLabel.right
width: mountAngMinField.width
model: gimbalOutModel
textRole: "text"
currentIndex: gimbalOutIndex
onActivated: setRCFunction(gimbalOutModel.get(index).value, rcFunction)
......