Commit 54004e24 authored by Gus Grubba's avatar Gus Grubba

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

parents 1d7cf605 bb40dd6c
......@@ -15,7 +15,7 @@ environment:
install:
- git submodule update --init --recursive
- call "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
- set PATH=C:\Qt\Tools\QtCreator\bin;C:\Qt\5.9.5\msvc2015\bin;%PATH%
- set PATH=C:\Qt\Tools\QtCreator\bin;C:\Qt\5.11.0\msvc2015\bin;%PATH%
- mkdir %LOCALAPPDATA%\QtProject && copy test\qtlogging.ini %LOCALAPPDATA%\QtProject\
- ps: |
Write-Host "Installing GStreamer..." -ForegroundColor Cyan
......@@ -35,7 +35,7 @@ install:
Write-Host "Installed" -ForegroundColor Green
build_script:
- mkdir %SHADOW_BUILD_DIR% && cd %SHADOW_BUILD_DIR% && C:\Qt\5.9.5\msvc2015\bin\qmake -r CONFIG-=debug_and_release CONFIG+=%CONFIG% CONFIG+=WarningsAsErrorsOn %APPVEYOR_BUILD_FOLDER%\qgroundcontrol.pro
- mkdir %SHADOW_BUILD_DIR% && cd %SHADOW_BUILD_DIR% && C:\Qt\5.11.0\msvc2015\bin\qmake -r CONFIG-=debug_and_release CONFIG+=%CONFIG% CONFIG+=WarningsAsErrorsOn %APPVEYOR_BUILD_FOLDER%\qgroundcontrol.pro
- cd %SHADOW_BUILD_DIR% && jom
- if "%CONFIG%" EQU "installer" ( copy %SHADOW_BUILD_DIR%\release\QGroundControl-installer.exe %APPVEYOR_BUILD_FOLDER%\QGroundControl-installer.exe )
# Generate the source server information to embed in the PDB
......
......@@ -9,11 +9,11 @@ pipeline {
environment {
CCACHE_BASEDIR = "${env.WORKSPACE}"
QGC_CONFIG = 'release'
QMAKE_VER = "5.9.2/android_armv7/bin/qmake"
QMAKE_VER = "5.11.0/android_armv7/bin/qmake"
}
agent {
docker {
image 'mavlink/qgc-build-android:2018-04-14'
image 'mavlink/qgc-build-android:2018-06-08'
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
......@@ -38,11 +38,11 @@ pipeline {
environment {
CCACHE_BASEDIR = "${env.WORKSPACE}"
QGC_CONFIG = 'debug'
QMAKE_VER = "5.9.2/gcc_64/bin/qmake"
QMAKE_VER = "5.11.0/gcc_64/bin/qmake"
}
agent {
docker {
image 'mavlink/qgc-build-linux:2018-04-14'
image 'mavlink/qgc-build-linux:2018-06-08'
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
......@@ -67,11 +67,11 @@ pipeline {
environment {
CCACHE_BASEDIR = "${env.WORKSPACE}"
QGC_CONFIG = 'release'
QMAKE_VER = "5.9.2/gcc_64/bin/qmake"
QMAKE_VER = "5.11.0/gcc_64/bin/qmake"
}
agent {
docker {
image 'mavlink/qgc-build-linux:2018-04-14'
image 'mavlink/qgc-build-linux:2018-06-08'
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
......@@ -101,7 +101,7 @@ pipeline {
environment {
CCACHE_BASEDIR = "${env.WORKSPACE}"
QGC_CONFIG = 'debug'
QMAKE_VER = "5.9.3/clang_64/bin/qmake"
QMAKE_VER = "5.11.0/clang_64/bin/qmake"
}
steps {
sh 'export'
......@@ -129,7 +129,7 @@ pipeline {
environment {
CCACHE_BASEDIR = "${env.WORKSPACE}"
QGC_CONFIG = 'installer'
QMAKE_VER = "5.9.3/clang_64/bin/qmake"
QMAKE_VER = "5.11.0/clang_64/bin/qmake"
}
steps {
sh 'export'
......@@ -150,6 +150,7 @@ pipeline {
}
}
}
} // parallel
} // stage('build')
} // stages
......
......@@ -951,6 +951,7 @@ APMFirmwarePlugin {
src/AutoPilotPlugins/APM/APMCompassCal.h \
src/AutoPilotPlugins/APM/APMFlightModesComponent.h \
src/AutoPilotPlugins/APM/APMFlightModesComponentController.h \
src/AutoPilotPlugins/APM/APMHeliComponent.h \
src/AutoPilotPlugins/APM/APMLightsComponent.h \
src/AutoPilotPlugins/APM/APMSubFrameComponent.h \
src/AutoPilotPlugins/APM/APMPowerComponent.h \
......@@ -976,6 +977,7 @@ APMFirmwarePlugin {
src/AutoPilotPlugins/APM/APMCompassCal.cc \
src/AutoPilotPlugins/APM/APMFlightModesComponent.cc \
src/AutoPilotPlugins/APM/APMFlightModesComponentController.cc \
src/AutoPilotPlugins/APM/APMHeliComponent.cc \
src/AutoPilotPlugins/APM/APMLightsComponent.cc \
src/AutoPilotPlugins/APM/APMSubFrameComponent.cc \
src/AutoPilotPlugins/APM/APMPowerComponent.cc \
......
......@@ -91,6 +91,7 @@
<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/PreFlightCheckList.qml">src/QmlControls/PreFlightCheckList.qml</file>
<file alias="QGroundControl/Controls/PreFlightCheckModel.qml">src/QmlControls/PreFlightCheckModel.qml</file>
<file alias="QGroundControl/Controls/QGCButton.qml">src/QmlControls/QGCButton.qml</file>
<file alias="QGroundControl/Controls/QGCCheckBox.qml">src/QmlControls/QGCCheckBox.qml</file>
<file alias="QGroundControl/Controls/QGCColoredImage.qml">src/QmlControls/QGCColoredImage.qml</file>
......@@ -154,11 +155,11 @@
<file alias="QGroundControl/FlightDisplay/GuidedActionsController.qml">src/FlightDisplay/GuidedActionsController.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedAltitudeSlider.qml">src/FlightDisplay/GuidedAltitudeSlider.qml</file>
<file alias="QGroundControl/FlightDisplay/MultiVehicleList.qml">src/FlightDisplay/MultiVehicleList.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightAHRSCheck.qml">src/FlightDisplay/PreFlightAHRSCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightBatteryCheck.qml">src/FlightDisplay/PreFlightBatteryCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightCheckModel.qml">src/FlightDisplay/PreFlightCheckModel.qml</file>
<file alias="QGroundControl/FlightDisplay/BuiltInPreFlightCheckModel.qml">src/FlightDisplay/BuiltInPreFlightCheckModel.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightGPSCheck.qml">src/FlightDisplay/PreFlightGPSCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightRCCheck.qml">src/FlightDisplay/PreFlightRCCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightSensorsCheck.qml">src/FlightDisplay/PreFlightSensorsCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightSensorsHealthCheck.qml">src/FlightDisplay/PreFlightSensorsHealthCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightSoundCheck.qml">src/FlightDisplay/PreFlightSoundCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/qmldir">src/FlightDisplay/qmldir</file>
<file alias="QGroundControl/FlightMap/CameraTriggerIndicator.qml">src/FlightMap/MapItems/CameraTriggerIndicator.qml</file>
......
......@@ -28,27 +28,29 @@
#include "APMLightsComponent.h"
#include "APMSubFrameComponent.h"
#include "ESP8266Component.h"
#include "APMHeliComponent.h"
/// This is the AutoPilotPlugin implementatin for the MAV_AUTOPILOT_ARDUPILOT type.
APMAutoPilotPlugin::APMAutoPilotPlugin(Vehicle* vehicle, QObject* parent)
: AutoPilotPlugin(vehicle, parent)
: AutoPilotPlugin (vehicle, parent)
, _incorrectParameterVersion(false)
, _airframeComponent(NULL)
, _cameraComponent(NULL)
, _lightsComponent(NULL)
, _subFrameComponent(NULL)
, _flightModesComponent(NULL)
, _powerComponent(NULL)
, _airframeComponent (NULL)
, _cameraComponent (NULL)
, _lightsComponent (NULL)
, _subFrameComponent (NULL)
, _flightModesComponent (NULL)
, _powerComponent (NULL)
#if 0
// Temporarily removed, waiting for new command implementation
, _motorComponent(NULL)
, _motorComponent (NULL)
#endif
, _radioComponent(NULL)
, _safetyComponent(NULL)
, _sensorsComponent(NULL)
, _tuningComponent(NULL)
, _airframeFacts(new APMAirframeLoader(this, vehicle->uas(), this))
, _esp8266Component(NULL)
, _radioComponent (NULL)
, _safetyComponent (NULL)
, _sensorsComponent (NULL)
, _tuningComponent (NULL)
, _airframeFacts (new APMAirframeLoader(this, vehicle->uas(), this))
, _esp8266Component (NULL)
, _heliComponent (NULL)
{
APMAirframeLoader::loadAirframeFactMetaData();
}
......@@ -101,6 +103,12 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void)
_safetyComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_safetyComponent));
if (_vehicle->vehicleType() == MAV_TYPE_HELICOPTER) {
_heliComponent = new APMHeliComponent(_vehicle, this);
_heliComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_heliComponent));
}
_tuningComponent = new APMTuningComponent(_vehicle, this);
_tuningComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_tuningComponent));
......
......@@ -27,6 +27,7 @@ class APMCameraComponent;
class APMLightsComponent;
class APMSubFrameComponent;
class ESP8266Component;
class APMHeliComponent;
/// This is the APM specific implementation of the AutoPilot class.
class APMAutoPilotPlugin : public AutoPilotPlugin
......@@ -59,6 +60,7 @@ protected:
APMTuningComponent* _tuningComponent;
APMAirframeLoader* _airframeFacts;
ESP8266Component* _esp8266Component;
APMHeliComponent* _heliComponent;
private:
QVariantList _components;
......
/****************************************************************************
*
* (c) 2009-2016 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 "APMHeliComponent.h"
#include "APMAutoPilotPlugin.h"
APMHeliComponent::APMHeliComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent)
: VehicleComponent(vehicle, autopilot, parent)
, _name(tr("Heli"))
{
}
QString APMHeliComponent::name(void) const
{
return _name;
}
QString APMHeliComponent::description(void) const
{
return tr("Heli Setup is used to setup parameters which are specific to a helicopter.");
}
QString APMHeliComponent::iconResource(void) const
{
return QString();
}
bool APMHeliComponent::requiresSetup(void) const
{
return false;
}
bool APMHeliComponent::setupComplete(void) const
{
return true;
}
QStringList APMHeliComponent::setupCompleteChangedTriggerList(void) const
{
return QStringList();
}
QUrl APMHeliComponent::setupSource(void) const
{
return QStringLiteral("qrc:/qml/APMHeliComponent.qml");
}
QUrl APMHeliComponent::summaryQmlSource(void) const
{
return QUrl();
}
/****************************************************************************
*
* (c) 2009-2016 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 APMHeliComponent : public VehicleComponent
{
Q_OBJECT
public:
APMHeliComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
// Virtuals from VehicleComponent
QStringList setupCompleteChangedTriggerList(void) const override;
// Virtuals from VehicleComponent
QString name(void) const override;
QString description(void) const override;
QString iconResource(void) const override;
bool requiresSetup(void) const override;
bool setupComplete(void) const override;
QUrl setupSource(void) const override;
QUrl summaryQmlSource(void) const override;
bool allowSetupWhileArmed(void) const override { return true; }
private:
const QString _name;
QVariantList _summaryItems;
};
This diff is collapsed.
......@@ -32,13 +32,6 @@ SetupPage {
QGCPalette { id: palette; colorGroupEnabled: true }
// Older firmwares use THR_MODE, newer use MOT_THST_HOVER
property bool _throttleMidExists: controller.parameterExists(-1, "THR_MID")
property Fact _hoverTuneParam: controller.getParameterFact(-1, _throttleMidExists ? "THR_MID" : "MOT_THST_HOVER")
property real _hoverTuneMin: _throttleMidExists ? 200 : 0
property real _hoverTuneMax: _throttleMidExists ? 800 : 1
property real _hoverTuneStep: _throttleMidExists ? 10 : 0.01
property bool _rcFeelAvailable: controller.parameterExists(-1, "RC_FEEL")
property bool _atcInputTCAvailable: controller.parameterExists(-1, "ATC_INPUT_TC")
property Fact _rcFeel: controller.getParameterFact(-1, "RC_FEEL", false)
......@@ -78,7 +71,6 @@ SetupPage {
// handler which updates your property with the new value, this first value change will trash
// your bound values. In order to work around this we don't set the values into the Sliders until
// after Qml load is done. We also don't track value changes until Qml load completes.
throttleHover.value = _hoverTuneParam.value
rollPitch.value = _rateRollP.value
climb.value = _rateClimbP.value
if (_rcFeelAvailable) {
......@@ -150,36 +142,6 @@ SetupPage {
anchors.top: parent.top
spacing: _margins
Column {
anchors.left: parent.left
anchors.right: parent.right
QGCLabel {
text: qsTr("Throttle Hover")
font.family: ScreenTools.demiboldFontFamily
}
QGCLabel {
text: qsTr("How much throttle is needed to maintain a steady hover")
}
Slider {
id: throttleHover
anchors.left: parent.left
anchors.right: parent.right
minimumValue: _hoverTuneMin
maximumValue: _hoverTuneMax
stepSize: _hoverTuneStep
tickmarksEnabled: true
onValueChanged: {
if (_loadComplete) {
_hoverTuneParam.value = value
}
}
}
}
Column {
anchors.left: parent.left
anchors.right: parent.right
......
......@@ -311,7 +311,7 @@ QGCCameraControl::takePhoto()
}
if(capturesPhotos()) {
_vehicle->sendMavCommand(
MAV_COMP_ID_CAMERA, // Target component
_compID, // Target component
MAV_CMD_IMAGE_START_CAPTURE, // Command id
false, // ShowError
0, // Reserved (Set to 0)
......@@ -339,7 +339,7 @@ QGCCameraControl::stopTakePhoto()
}
if(capturesPhotos()) {
_vehicle->sendMavCommand(
MAV_COMP_ID_CAMERA, // Target component
_compID, // Target component
MAV_CMD_IMAGE_STOP_CAPTURE, // Command id
false, // ShowError
0); // Reserved (Set to 0)
......@@ -361,7 +361,7 @@ QGCCameraControl::startVideo()
}
if(videoStatus() != VIDEO_CAPTURE_STATUS_RUNNING) {
_vehicle->sendMavCommand(
MAV_COMP_ID_CAMERA, // Target component
_compID, // Target component
MAV_CMD_VIDEO_START_CAPTURE, // Command id
true, // ShowError
0, // Reserved (Set to 0)
......@@ -378,7 +378,7 @@ QGCCameraControl::stopVideo()
qCDebug(CameraControlLog) << "stopVideo()";
if(videoStatus() == VIDEO_CAPTURE_STATUS_RUNNING) {
_vehicle->sendMavCommand(
MAV_COMP_ID_CAMERA, // Target component
_compID, // Target component
MAV_CMD_VIDEO_STOP_CAPTURE, // Command id
true, // ShowError
0); // Reserved (Set to 0)
......@@ -399,7 +399,7 @@ QGCCameraControl::setVideoMode()
MAV_CMD_SET_CAMERA_MODE, // Command id
true, // ShowError
0, // Reserved (Set to 0)
CAM_MODE_VIDEO); // Camera mode (0: photo, 1: video)
CAM_MODE_VIDEO); // Camera mode (0: photo, 1: video)
_setCameraMode(CAM_MODE_VIDEO);
}
}
......
......@@ -15,6 +15,7 @@ QGCCameraManager::QGCCameraManager(Vehicle *vehicle)
: _vehicle(vehicle)
, _vehicleReadyState(false)
, _currentTask(0)
, _currentCamera(0)
{
QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
qCDebug(CameraManagerLog) << "QGCCameraManager Created";
......@@ -27,6 +28,16 @@ QGCCameraManager::~QGCCameraManager()
{
}
//-----------------------------------------------------------------------------
void
QGCCameraManager::setCurrentCamera(int sel)
{
if(sel != _currentCamera && sel >= 0 && sel < _cameras.count()) {
_currentCamera = sel;
emit currentCameraChanged();
}
}
//-----------------------------------------------------------------------------
void
QGCCameraManager::_vehicleReady(bool ready)
......@@ -121,7 +132,9 @@ QGCCameraManager::_handleCameraInfo(const mavlink_message_t& message)
if(pCamera) {
QQmlEngine::setObjectOwnership(pCamera, QQmlEngine::CppOwnership);
_cameras.append(pCamera);
_cameraLabels << pCamera->modelName();
emit camerasChanged();
emit cameraLabelsChanged();
}
}
}
......
......@@ -25,13 +25,23 @@ public:
QGCCameraManager(Vehicle* vehicle);
virtual ~QGCCameraManager();
Q_PROPERTY(QmlObjectListModel* cameras READ cameras NOTIFY camerasChanged)
Q_PROPERTY(QmlObjectListModel* cameras READ cameras NOTIFY camerasChanged)
Q_PROPERTY(QStringList cameraLabels READ cameraLabels NOTIFY cameraLabelsChanged)
Q_PROPERTY(int currentCamera READ currentCamera WRITE setCurrentCamera NOTIFY currentCameraChanged)
//-- Return a list of cameras provided by this vehicle
virtual QmlObjectListModel* cameras () { return &_cameras; }
virtual QmlObjectListModel* cameras () { return &_cameras; }
//-- Camera names to show the user (for selection)
virtual QStringList cameraLabels () { return _cameraLabels; }
//-- Current selected camera
virtual int currentCamera () { return _currentCamera; }
//-- Set current camera
virtual void setCurrentCamera (int sel);
signals:
void camerasChanged ();
void camerasChanged ();
void cameraLabelsChanged ();
void currentCameraChanged ();
protected slots:
virtual void _vehicleReady (bool ready);
......@@ -53,5 +63,7 @@ protected:
bool _vehicleReadyState;
int _currentTask;
QmlObjectListModel _cameras;
QStringList _cameraLabels;
QMap<int, bool> _cameraInfoRequested;
int _currentCamera;
};
......@@ -16,7 +16,5 @@ QGCCheckBox {
(fact.value === 0 ? Qt.Unchecked : Qt.Checked)) :
Qt.Unchecked
text: qsTr("Label")
onClicked: fact.value = (checked ? checkedValue : uncheckedValue)
}
......@@ -6,6 +6,7 @@
<file alias="APMCameraComponentSummary.qml">../../AutoPilotPlugins/APM/APMCameraComponentSummary.qml</file>
<file alias="APMFlightModesComponent.qml">../../AutoPilotPlugins/APM/APMFlightModesComponent.qml</file>
<file alias="APMFlightModesComponentSummary.qml">../../AutoPilotPlugins/APM/APMFlightModesComponentSummary.qml</file>
<file alias="APMHeliComponent.qml">../../AutoPilotPlugins/APM/APMHeliComponent.qml</file>
<file alias="APMLightsComponent.qml">../../AutoPilotPlugins/APM/APMLightsComponent.qml</file>
<file alias="APMLightsComponentSummary.qml">../../AutoPilotPlugins/APM/APMLightsComponentSummary.qml</file>
<file alias="APMSubFrameComponent.qml">../../AutoPilotPlugins/APM/APMSubFrameComponent.qml</file>
......
......@@ -5007,6 +5007,17 @@ the setpoint will be capped to MPC_XY_VEL_MAX</short_desc>
</parameter>
</group>
<group name="PWM Outputs">
<parameter default="0" name="MOT_ORDERING" type="INT32">
<short_desc>Motor Ordering</short_desc>
<long_desc>Determines the motor ordering. This can be used for example in combination with a 4-in-1 ESC that assumes a motor ordering which is different from PX4. ONLY supported for Quads. ONLY supported for fmu output (Pixracer or Omnibus F4). When changing this, make sure to test the motor response without props first.</long_desc>
<min>0</min>
<max>1</max>
<scope>drivers/px4fmu</scope>
<values>
<value code="0">PX4</value>
<value code="1">Betaflight / Cleanflight</value>
</values>
</parameter>
<parameter default="0.0" name="MOT_SLEW_MAX" type="FLOAT">
<short_desc>Minimum motor rise time (slew rate limit)</short_desc>
<long_desc>Minimum time allowed for the motor input signal to pass through a range of 1000 PWM units. A value x means that the motor signal can only go from 1000 to 2000 PWM in maximum x seconds. Zero means that slew rate limiting is disabled.</long_desc>
......@@ -7498,13 +7509,14 @@ the setpoint will be capped to MPC_XY_VEL_MAX</short_desc>
</parameter>
</group>
<group name="Return To Land">
<parameter default="0" name="RTL_LAND_TYPE" type="INT32">
<short_desc>RTL land location</short_desc>
<long_desc>Land at the home location or planned mission landing</long_desc>
<parameter default="0" name="RTL_TYPE" type="INT32">
<short_desc>Return type</short_desc>
<long_desc>Fly straight to the home location or planned mission landing and land there or use the planned mission to get to those points.</long_desc>
<scope>modules/navigator</scope>
<values>
<value code="0">Home Position</value>
<value code="1">Planned Landing (Mission)</value>
<value code="0">Return home via direct path</value>
<value code="1">Return to a planned mission landing, if available, via direct path, else return to home via direct path</value>
<value code="2">Return to a planned mission landing, if available, using the mission path, else return to home via the reverse mission path</value>
</values>
</parameter>
</group>
......
......@@ -17,28 +17,30 @@ import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Vehicle 1.0
ObjectModel {
PreFlightCheckModel {
PreFlightCheckGroup {
name: qsTr("Initial checks")
// Standard check list items (group 0) - Available from the start
PreFlightCheckButton {
id: buttonHardware
name: qsTr("Hardware")
manualText: qsTr("Props mounted? Wings secured? Tail secured?")
}
PreFlightBatteryCheck {
id: buttonBattery
failureVoltage: 40
failurePercent: 40
allowFailurePercentOverride: false
}
PreFlightSensorsCheck {
id: buttonSensors
PreFlightSensorsHealthCheck {
}
PreFlightRCCheck {
id: buttonRC
PreFlightGPSCheck {
failureSatCount: 9
allowOverrideSatCount: true
}
PreFlightAHRSCheck {
id: buttonEstimator
PreFlightRCCheck {
}
}
......@@ -46,26 +48,21 @@ ObjectModel {
name: qsTr("Please arm the vehicle here")
PreFlightCheckButton {
id: buttonActuators
name: qsTr("Actuators")
group: 1
manualText: qsTr("Move all control surfaces. Did they work properly?")
}
PreFlightCheckButton {
id: buttonMotors
name: qsTr("Motors")
group: 1
manualText: qsTr("Propellers free? Then throttle up gently. Working properly?")
}
PreFlightCheckButton {
id: buttonMission
name: qsTr("Mission")
group: 1
manualText: qsTr("Please confirm mission is valid (waypoints valid, no terrain collision).")
}
PreFlightSoundCheck {
id: buttonSoundOutput
group: 1
}
}
......@@ -74,21 +71,17 @@ ObjectModel {
// Check list item group 2 - Final checks before launch
PreFlightCheckButton {
id: buttonPayload
name: qsTr("Payload")
group: 2
manualText: qsTr("Configured and started? Payload lid closed?")
}
PreFlightCheckButton {
id: buttonWeather
name: "Wind & weather"
group: 2
manualText: qsTr("OK for your platform? Lauching into the wind?")
}
PreFlightCheckButton {
id: buttonFlightAreaFree
name: qsTr("Flight area")
group: 2
manualText: qsTr("Launch area and path free of obstacles/people?")
}
}
......
......@@ -113,7 +113,7 @@ QGCView {
Component.onCompleted: start(true /* flyView */)
}
PreFlightCheckModel {
BuiltInPreFlightCheckModel {
id: preFlightCheckModel
}
......
......@@ -119,7 +119,13 @@ FlightMap {
function recenterNeeded() {
var vehiclePoint = flightMap.fromCoordinate(_activeVehicleCoordinate, false /* clipToViewport */)
var centerViewport = Qt.rect(0, 0, width, height)
var toolStripRightEdge = mapFromItem(toolStrip, toolStrip.x, 0).x + toolStrip.width
var instrumentsWidth = 0
if (QGroundControl.corePlugin.options.instrumentWidget.widgetPosition === CustomInstrumentWidget.POS_TOP_RIGHT) {
// Assume standard instruments
instrumentsWidth = flightDisplayViewWidgets.getPreferredInstrumentWidth()
}
var centerViewport = Qt.rect(toolStripRightEdge, 0, width - toolStripRightEdge - instrumentsWidth, height)
return !pointInRect(vehiclePoint, centerViewport)
}
......
......@@ -18,13 +18,12 @@ import QGroundControl.Palette 1.0
/// Guided actions confirmation dialog
Rectangle {
id: _root
border.color: qgcPal.alertBorder
border.width: 1
width: confirmColumn.width + (_margins * 4)
height: confirmColumn.height + (_margins * 4)
radius: ScreenTools.defaultFontPixelHeight / 2
color: qgcPal.alertBackground
opacity: 0.9
color: qgcPal.window
border.color: _emergencyAction ? "red" : qgcPal.windowShade
border.width: _emergencyAction ? 4 : 1
z: guidedController.z
visible: false
......@@ -36,7 +35,8 @@ Rectangle {
property var actionData
property bool hideTrigger: false
property real _margins: ScreenTools.defaultFontPixelWidth
property real _margins: ScreenTools.defaultFontPixelWidth
property bool _emergencyAction: action === guidedController.actionEmergencyStop
onHideTriggerChanged: {
if (hideTrigger) {
......@@ -78,7 +78,6 @@ Rectangle {
QGCLabel {
id: titleText
color: qgcPal.alertText
anchors.left: slider.left
anchors.right: slider.right
horizontalAlignment: Text.AlignHCenter
......@@ -87,7 +86,6 @@ Rectangle {
QGCLabel {
id: messageText
color: qgcPal.alertText
anchors.left: slider.left
anchors.right: slider.right
horizontalAlignment: Text.AlignHCenter
......@@ -127,7 +125,7 @@ Rectangle {
sourceSize.height: width
source: "/res/XDelete.svg"
fillMode: Image.PreserveAspectFit
color: qgcPal.alertText
color: qgcPal.text
QGCMouseArea {
fillItem: parent
onClicked: {
......
......@@ -85,9 +85,9 @@ Rectangle {
}
QGCButton {
id: actionButton
anchors.horizontalCenter: parent.horizontalCenter
text: modelData.title
id: actionButton
text: modelData.title
Layout.alignment: Qt.AlignCenter
onClicked: {
_root.visible = false
......
......@@ -32,7 +32,7 @@ Item {
property var actionList
property var altitudeSlider
readonly property string emergencyStopTitle: qsTr("Emergency Stop")
readonly property string emergencyStopTitle: qsTr("EMERGENCY STOP")
readonly property string armTitle: qsTr("Arm")
readonly property string disarmTitle: qsTr("Disarm")
readonly property string rtlTitle: qsTr("RTL")
......@@ -52,7 +52,7 @@ Item {
readonly property string armMessage: qsTr("Arm the vehicle.")
readonly property string disarmMessage: qsTr("Disarm the vehicle")
readonly property string emergencyStopMessage: qsTr("WARNING: This will stop all motors. If vehicle is currently in air it will crash.")
readonly property string emergencyStopMessage: qsTr("WARNING: THIS WILL STOP ALL MOTORS. IF VEHICLE IS CURRENTLY IN THE AIR IT WILL CRASH.")
readonly property string takeoffMessage: qsTr("Takeoff from ground and hold position.")
readonly property string startMissionMessage: qsTr("Takeoff from ground and start the current mission.")
readonly property string continueMissionMessage: qsTr("Continue the mission from the current waypoint.")
......
......@@ -15,17 +15,18 @@ import QGroundControl.Vehicle 1.0
// This class stores the data and functions of the check list but NOT the GUI (which is handled somewhere else).
PreFlightCheckButton {
name: qsTr("Battery")
manualText: qsTr("Healthy & charged > %1. Battery connector firmly plugged?").arg(failureVoltage)
telemetryTextFailure: _batUnHealthy ?
qsTr("Not healthy. Check console.") :
("Low (below %1). Please recharge.").arg(failureVoltage)
name: qsTr("Battery")
manualText: qsTr("Battery connector firmly plugged?")
telemetryFailure: _batLow
telemetryTextFailure: allowTelemetryFailureOverride ?
qsTr("Warning - Battery charge below %1%.").arg(failurePercent) :
qsTr("Battery charge below %1%. Please recharge.").arg(failurePercent)
allowTelemetryFailureOverride: allowFailurePercentOverride
property int failureVoltage: 40
property int failurePercent: 40
property bool allowFailurePercentOverride: false
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property int _unhealthySensors: _activeVehicle ? _activeVehicle.sensorsUnhealthyBits : 0
property var _batPercentRemaining: _activeVehicle ? _activeVehicle.battery.percentRemaining.value : 0
property bool _batUnHealthy: _unhealthySensors & Vehicle.SysStatusSensorBattery
property bool _batLow: _batPercentRemaining < failureVoltage
property bool _batLow: _batPercentRemaining < failurePercent
}
/****************************************************************************
*
* (c) 2009-2016 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 QGroundControl 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Vehicle 1.0
PreFlightCheckButton {
name: qsTr("GPS")
telemetryFailure: _3dLockFailure || _satCountFailure
telemetryTextFailure: _3dLockFailure ?
qsTr("Waiting for 3D lock.") :
(_satCountFailure ? _satCountFailureText : "")
allowTelemetryFailureOverride: !_3dLockFailure && _satCountFailure && allowOverrideSatCount
property bool allowOverrideSatCount: false ///< true: sat count above failureSatCount reguired to pass, false: user can click past satCount <= failureSetCount
property int failureSatCount: -1 ///< -1 indicates no sat count check
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _3dLock: _activeVehicle ? _activeVehicle.gps.lock.rawValue >= 3 : false
property int _satCount: _activeVehicle ? _activeVehicle.gps.count.rawValue : 0
property bool _3dLockFailure: !_3dLock
property bool _satCountFailure: failureSatCount !== -1 && _satCount <= failureSatCount
property string _satCountFailureText: allowOverrideSatCount ? qsTr("Warning - Sat count below %1.").arg(failureSatCount + 1) : qsTr("Waiting for sat count above %1.").arg(failureSatCount)
}
......@@ -15,24 +15,18 @@ import QGroundControl.Vehicle 1.0
PreFlightCheckButton {
name: qsTr("Sensors")
telemetryFailure: (_unhealthySensors & _allCheckedSensors) || !_gpsLock || _satCountFailure
property int failureSatCount: -1 ///< -1 indicates no sat count check
telemetryFailure: _unhealthySensors & _allCheckedSensors
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property int _unhealthySensors: _activeVehicle ? _activeVehicle.sensorsUnhealthyBits : 0
property bool _gpsLock: _activeVehicle ? _activeVehicle.gps.lock.rawValue >= 3 : 0
property int _satCount: _activeVehicle ? _activeVehicle.gps.count.rawValue : 0
property bool _satCountFailure: failureSatCount !== -1 && _satCount <= failureSatCount
property int _allCheckedSensors: Vehicle.SysStatusSensor3dMag |
Vehicle.SysStatusSensor3dAccel |
Vehicle.SysStatusSensor3dGyro |
Vehicle.SysStatusSensorAbsolutePressure |
Vehicle.SysStatusSensorDifferentialPressure |
Vehicle.SysStatusSensorGPS
Vehicle.SysStatusSensorGPS |
Vehicle.SysStatusSensorAHRS
on_GpsLockChanged: updateTelemetryTextFailure()
on_SatCountFailureChanged: updateTelemetryTextFailure()
on_UnhealthySensorsChanged: updateTelemetryTextFailure()
Component.onCompleted: updateTelemetryTextFailure()
......@@ -44,11 +38,8 @@ PreFlightCheckButton {
else if(_unhealthySensors & Vehicle.SysStatusSensor3dGyro) telemetryTextFailure = qsTr("Failure. Gyroscope issues. Check console.")
else if(_unhealthySensors & Vehicle.SysStatusSensorAbsolutePressure) telemetryTextFailure = qsTr("Failure. Barometer issues. Check console.")
else if(_unhealthySensors & Vehicle.SysStatusSensorDifferentialPressure) telemetryTextFailure = qsTr("Failure. Airspeed sensor issues. Check console.")
else if(_unhealthySensors & Vehicle.SysStatusSensorGPS) telemetryTextFailure = qsTr("Failure. No valid or low quality GPS signal. Check console.")
} else if (!_gpsLock) {
telemetryTextFailure = qsTr("Pending. Waiting for GPS lock.")
} else if (_satCountFailure) {
telemetryTextFailure = qsTr("Pending. Waiting for Sat Count > %1.").arg(failureSatCount)
else if(_unhealthySensors & Vehicle.SysStatusSensorAHRS) telemetryTextFailure = qsTr("Failure. AHRS issues. Check console.")
else if(_unhealthySensors & Vehicle.SysStatusSensorGPS) telemetryTextFailure = qsTr("Failure. GPS issues. Check console.")
}
}
}
......@@ -78,7 +78,7 @@ VideoManager::setToolbox(QGCToolbox *toolbox)
emit isGStreamerChanged();
qCDebug(VideoManagerLog) << "New Video Source:" << videoSource;
_videoReceiver = new VideoReceiver(this);
_videoReceiver = toolbox->corePlugin()->createVideoReceiver(this);
_updateSettings();
if(isGStreamer()) {
_videoReceiver->start();
......
......@@ -10,9 +10,9 @@ GuidedActionList 1.0 GuidedActionList.qml
GuidedAltitudeSlider 1.0 GuidedAltitudeSlider.qml
MultiVehicleList 1.0 MultiVehicleList.qml
PreFlightBatteryCheck 1.0 PreFlightBatteryCheck.qml
PreFlightAHRSCheck 1.0 PreFlightAHRSCheck.qml
PreFlightCheckModel 1.0 PreFlightCheckModel.qml
BuiltInPreFlightCheckModel 1.0 BuiltInPreFlightCheckModel.qml
PreFlightGPSCheck 1.0 PreFlightGPSCheck.qml
PreFlightRCCheck 1.0 PreFlightRCCheck.qml
PreFlightSensorsCheck 1.0 PreFlightSensorsCheck.qml
PreFlightSensorsHealthCheck 1.0 PreFlightSensorsHealthCheck.qml
PreFlightSoundCheck 1.0 PreFlightSoundCheck.qml
......@@ -11,6 +11,7 @@ import QtQuick 2.3
import QtQuick.Controls 1.2
import QtLocation 5.3
import QtPositioning 5.3
import QtQuick.Dialogs 1.2
import QGroundControl 1.0
import QGroundControl.FactSystem 1.0
......@@ -40,6 +41,7 @@ Map {
property bool firstGCSPositionReceived: false ///< true: first gcs position update was responded to
property bool firstVehiclePositionReceived: false ///< true: first vehicle position update was responded to
property bool planView: false ///< true: map being using for Plan view, items should be draggable
property var qgcView
readonly property real maxZoomLevel: 20
......@@ -62,6 +64,20 @@ Map {
}
}
function centerToSpecifiedLocation() {
qgcView.showDialog(specifyMapPositionDialog, qsTr("Specify Position"), qgcView.showDialogDefaultWidth, StandardButton.Cancel)
}
Component {
id: specifyMapPositionDialog
EditPositionDialog {
coordinate: center
onCoordinateChanged: center = coordinate
}
}
ExclusiveGroup { id: mapTypeGroup }
// Update ground station position
......
......@@ -33,10 +33,10 @@ Column {
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property var _dynamicCameras: _activeVehicle ? _activeVehicle.dynamicCameras : null
property bool _isCamera: _dynamicCameras ? _dynamicCameras.cameras.count > 0 : false
property var _camera: _isCamera ? _dynamicCameras.cameras.get(0) : null // Single camera support for the time being
property bool _cameraModeUndefined: _isCamera ? _dynamicCameras.cameras.get(0).cameraMode === QGCCameraControl.CAMERA_MODE_UNDEFINED : true
property bool _cameraVideoMode: _isCamera ? _dynamicCameras.cameras.get(0).cameraMode === 1 : false
property bool _cameraPhotoMode: _isCamera ? _dynamicCameras.cameras.get(0).cameraMode === 0 : false
property var _camera: _isCamera ? _dynamicCameras.cameras.get(_curCameraIndex) : null
property bool _cameraModeUndefined: _isCamera ? _dynamicCameras.cameras.get(_curCameraIndex).cameraMode === QGCCameraControl.CAMERA_MODE_UNDEFINED : true
property bool _cameraVideoMode: _isCamera ? _dynamicCameras.cameras.get(_curCameraIndex).cameraMode === 1 : false
property bool _cameraPhotoMode: _isCamera ? _dynamicCameras.cameras.get(_curCameraIndex).cameraMode === 0 : false
property bool _cameraPhotoIdle: _isCamera && _camera.photoStatus === QGCCameraControl.PHOTO_CAPTURE_IDLE
property bool _cameraElapsedMode: _isCamera && _camera.cameraMode === QGCCameraControl.CAM_MODE_PHOTO && _camera.photoMode === QGCCameraControl.PHOTO_CAPTURE_TIMELAPSE
property real _spacers: ScreenTools.defaultFontPixelHeight * 0.5
......@@ -46,6 +46,7 @@ Column {
property bool _hasModes: _isCamera && _camera && _camera.hasModes
property bool _videoRecording: _camera && _camera.videoStatus === QGCCameraControl.VIDEO_CAPTURE_STATUS_RUNNING
property bool _noStorage: _camera && _camera.storageTotal === 0
property int _curCameraIndex: _dynamicCameras ? _dynamicCameras.currentCamera : 0
function showSettings() {
qgcView.showDialog(cameraSettings, _cameraVideoMode ? qsTr("Video Settings") : qsTr("Camera Settings"), 70, StandardButton.Ok)
......@@ -202,6 +203,23 @@ Column {
anchors.left: parent.left
anchors.right: parent.right
spacing: _margins
Row {
visible: _isCamera
spacing: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
QGCLabel {
text: qsTr("Camera Selector:")
width: _labelFieldWidth
anchors.verticalCenter: parent.verticalCenter
}
QGCComboBox {
id: cameraSelector
model: _isCamera ? _dynamicCameras.cameraLabels : []
width: _editFieldWidth
onActivated: _dynamicCameras.currentCamera = index
currentIndex: _dynamicCameras.currentCamera
}
}
//-------------------------------------------
//-- Camera Settings
Repeater {
......
......@@ -209,6 +209,17 @@ DropButton {
}
}
QGCButton {
text: qsTr("Specified Location")
Layout.fillWidth: true
onClicked: {
dropButton.hideDropDown()
map.centerToSpecifiedLocation()
}
}
QGCButton {
text: qsTr("Vehicle")
Layout.fillWidth: true
......
......@@ -62,6 +62,17 @@ ColumnLayout {
}
}
QGCButton {
text: qsTr("Vehicle")
Layout.fillWidth: true
enabled: _activeVehicle && _activeVehicle.coordinate.isValid
onClicked: {
dropPanel.hide()
map.center = activeVehicle.coordinate
}
}
QGCButton {
text: qsTr("Current Location")
Layout.fillWidth: true
......@@ -74,13 +85,12 @@ ColumnLayout {
}
QGCButton {
text: qsTr("Vehicle")
text: qsTr("Specified Location")
Layout.fillWidth: true
enabled: _activeVehicle && _activeVehicle.coordinate.isValid
onClicked: {
dropPanel.hide()
map.center = activeVehicle.coordinate
map.centerToSpecifiedLocation()
}
}
} // Column
......@@ -174,7 +174,7 @@ Column {
sourceComponent: factGroupList
property var factGroup: _activeVehicle
property string factGroupName: qsTr("Vehicle")
property string factGroupName: "Vehicle"
}
Repeater {
......
......@@ -445,6 +445,7 @@ QGCView {
allowGCSLocationCenter: true
allowVehicleLocationCenter: true
planView: true
qgcView: _qgcView
// This is the center rectangle of the map which is not obscured by tools
property rect centerViewport: Qt.rect(_leftToolWidth, _toolbarHeight, editorMap.width - _leftToolWidth - _rightPanelWidth, editorMap.height - _statusHeight - _toolbarHeight)
......
......@@ -132,7 +132,7 @@ Rectangle {
text: qsTr("TerrF")
exclusiveGroup: altRadios
checked: missionItem.altitudeMode === altModeValue
visible: missionItem.supportsTerrainFrame || missionItem.altitudeMode === altModeValue
visible: missionItem.altitudeMode === altModeValue
readonly property int altModeValue: _altModeTerrainFrame
readonly property string helpText: qsTr("Using terrain reference frame")
......
......@@ -35,8 +35,8 @@ Item {
readonly property int dropUp: 3
readonly property int dropDown: 4
readonly property real _arrowBaseWidth: radius // Width of long side of arrow
readonly property real _arrowPointHeight: radius * 0.666 // Height is long side to point
readonly property real _arrowBaseHeight: radius // Height of vertical side of arrow
readonly property real _arrowPointWidth: radius * 0.666 // Distance from vertical side to point
readonly property real _dropCornerRadius: ScreenTools.defaultFontPixelWidth * 0.5
readonly property real _dropCornerRadiusX2: _dropCornerRadius * 2
readonly property real _dropMargin: _dropCornerRadius
......@@ -44,9 +44,10 @@ Item {
property var _dropEdgeTopPoint
property real _dropEdgeHeight
property alias _dropDownComponent: dropDownLoader.sourceComponent
property alias _dropDownComponent: panelLoader.sourceComponent
property real _viewportMaxTop: 0
property real _viewportMaxBottom: parent.parent.height - parent.y
property real _viewportMaxHeight: _viewportMaxBottom - _viewportMaxTop
property var _dropPanelCancel
function show(panelEdgeTopPoint, panelEdgeHeight, panelComponent) {
......@@ -70,37 +71,29 @@ Item {
}
function _calcPositions() {
var dropComponentWidth = dropDownLoader.item.width
var dropComponentHeight = dropDownLoader.item.height
var dropRectWidth = dropComponentWidth + _dropMarginX2
var dropRectHeight = dropComponentHeight + _dropMarginX2
var panelComponentWidth = panelLoader.item.width
var panelComponentHeight = panelLoader.item.height
dropItemHolderRect.width = dropRectWidth
dropItemHolderRect.height = dropRectHeight
dropDownItem.width = dropComponentWidth + _dropMarginX2
dropDownItem.height = dropComponentHeight + _dropMarginX2
dropDownItem.width += _arrowPointHeight
dropDownItem.y = _dropEdgeTopPoint.y -(dropDownItem.height / 2) + radius
dropItemHolderRect.y = 0
dropDownItem.width = panelComponentWidth + _dropMarginX2 + _arrowPointWidth
dropDownItem.height = panelComponentHeight + _dropMarginX2
dropDownItem.x = _dropEdgeTopPoint.x + _dropMargin
dropItemHolderRect.x = _arrowPointHeight
dropDownItem.y = _dropEdgeTopPoint.y -(dropDownItem.height / 2) + radius
// Validate that dropdown is within viewport
dropDownItem.y = Math.min(dropDownItem.y + dropDownItem.height, _viewportMaxBottom) - dropDownItem.height
dropDownItem.y = Math.max(dropDownItem.y, _viewportMaxTop)
// Adjust height to not exceed viewport bounds
dropDownItem.height = Math.min(dropDownItem.height, _viewportMaxHeight - dropDownItem.y)
// Arrow points
arrowCanvas.arrowPoint.y = (_dropEdgeTopPoint.y + radius) - dropDownItem.y
arrowCanvas.arrowPoint.x = 0
arrowCanvas.arrowBase1.x = _arrowPointHeight
arrowCanvas.arrowBase1.y = arrowCanvas.arrowPoint.y - (_arrowBaseWidth / 2)
arrowCanvas.arrowBase1.x = _arrowPointWidth
arrowCanvas.arrowBase1.y = arrowCanvas.arrowPoint.y - (_arrowBaseHeight / 2)
arrowCanvas.arrowBase2.x = arrowCanvas.arrowBase1.x
arrowCanvas.arrowBase2.y = arrowCanvas.arrowBase1.y + _arrowBaseWidth
arrowCanvas.arrowBase2.y = arrowCanvas.arrowBase1.y + _arrowBaseHeight
arrowCanvas.requestPaint()
} // function - _calcPositions
......@@ -117,6 +110,7 @@ Item {
}
}
// This item is sized to hold the entirety of the drop panel including the arrow point
Item {
id: dropDownItem
......@@ -133,29 +127,41 @@ Item {
property point arrowBase2: Qt.point(0, 0)
onPaint: {
var panelX = _arrowPointWidth
var panelY = 0
var panelWidth = parent.width - _arrowPointWidth
var panelHeight = parent.height
var context = getContext("2d")
context.reset()
context.beginPath()
context.moveTo(dropItemHolderRect.x, dropItemHolderRect.y)
context.lineTo(dropItemHolderRect.x + dropItemHolderRect.width, dropItemHolderRect.y)
context.lineTo(dropItemHolderRect.x + dropItemHolderRect.width, dropItemHolderRect.y + dropItemHolderRect.height)
context.lineTo(dropItemHolderRect.x, dropItemHolderRect.y + dropItemHolderRect.height)
context.moveTo(panelX, panelY) // top left
context.lineTo(panelX + panelWidth, panelY) // top right
context.lineTo(panelX + panelWidth, panelX + panelHeight) // bottom right
context.lineTo(panelX, panelY + panelHeight) // bottom left
context.lineTo(arrowBase2.x, arrowBase2.y)
context.lineTo(arrowPoint.x, arrowPoint.y)
context.lineTo(arrowBase1.x, arrowBase1.y)
context.lineTo(dropItemHolderRect.x, dropItemHolderRect.y)
context.lineTo(panelX, panelY) // top left
context.closePath()
context.fillStyle = qgcPal.windowShade
context.fill()
}
} // Canvas - arrowCanvas
Item {
id: dropItemHolderRect
QGCFlickable {
id: panelItemFlickable
anchors.margins: _dropMargin
anchors.leftMargin: _dropMargin + _arrowPointWidth
anchors.fill: parent
flickableDirection: Flickable.VerticalFlick
contentWidth: panelLoader.width
contentHeight: panelLoader.height
Loader {
id: dropDownLoader
id: panelLoader
x: _dropMargin
y: _dropMargin
......@@ -165,6 +171,5 @@ Item {
property var dropPanel: _root
}
}
} // Item - dropDownItem
}
......@@ -23,16 +23,15 @@ import QGroundControl.ScreenTools 1.0
/// Manual - This is simply a check which the user must verify and confirm. It is not based on any system state.
/// Telemetry - This type of check can fail due to some state within the system. A telemetry check failure can be
/// a hard stop in that there is no way to pass the checklist until the system state resolves itself.
/// Or it can also optionall be override by the user.
/// Or it can also optionally be override by the user.
/// If a button uses both manual and telemetry checks, the telemetry check takes precendence and must be passed first.
QGCButton {
property string name: ""
property int group: 0
property string manualText: "" ///< text to show for a manual check, "" signals no manual check
property string telemetryTextOverride: "" ///< text to show if telemetry check failed and override is allowed
property string telemetryTextFailure ///< text to show if telemetry check failed (override not allowed)
property bool telemetryFailure: false ///< true: telemetry check failing, false: telemetry check passing
property bool passed: _manualState === _statePassed && _telemetryState === _statePassed
property string name: ""
property string manualText: "" ///< text to show for a manual check, "" signals no manual check
property string telemetryTextFailure ///< text to show if telemetry check failed (override not allowed)
property bool telemetryFailure: false ///< true: telemetry check failing, false: telemetry check passing
property bool allowTelemetryFailureOverride: false ///< true: user can click past telemetry failure
property bool passed: _manualState === _statePassed && _telemetryState === _statePassed
property int _manualState: manualText === "" ? _statePassed : _statePending
property int _telemetryState: _statePassed
......@@ -40,8 +39,8 @@ QGCButton {
property int _verticalPadding: Math.round(ScreenTools.defaultFontPixelHeight / 2)
property real _stateFlagWidth: ScreenTools.defaultFontPixelWidth * 4
readonly property int _statePending: 0 ///< Telemetry check has failed or manual check not yet verified, user can click to make it pass
readonly property int _stateFailed: 1 ///< Telemetry check has failed, user cannot click to make it pass
readonly property int _statePending: 0 ///< Telemetry check is failing or manual check not yet verified, user can click to make it pass
readonly property int _stateFailed: 1 ///< Telemetry check is failing, user cannot click to make it pass
readonly property int _statePassed: 2 ///< Check has passed
readonly property color _passedColor: Qt.rgba(0.27,0.67,0.42,1)
......@@ -50,8 +49,8 @@ QGCButton {
property string _text: "<b>" + name +"</b>: " +
((_telemetryState !== _statePassed) ?
(_telemetryState === _statePending ? telemetryTextOverride : telemetryTextFailure) :
(_manualState !== _statePassed ? manualText : qsTr("OK")))
telemetryTextFailure :
(_manualState !== _statePassed ? manualText : qsTr("Passed")))
property color _color: _telemetryState === _statePassed && _manualState === _statePassed ?
_passedColor :
(_telemetryState == _stateFailed ?
......@@ -61,7 +60,6 @@ QGCButton {
_failedColor))
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _allowTelemetryFailureOverride: telemetryTextOverride !== ""
width: 40 * ScreenTools.defaultFontPixelWidth
......@@ -94,21 +92,24 @@ QGCButton {
}
}
onTelemetryFailureChanged: {
function _updateTelemetryState() {
if (telemetryFailure) {
// We have a new telemetry failure, reset user pass
_telemetryState = _allowTelemetryFailureOverride ? _statePending : _stateFailed
_telemetryState = allowTelemetryFailureOverride ? _statePending : _stateFailed
} else {
_telemetryState = _statePassed
}
}
onTelemetryFailureChanged: _updateTelemetryState()
onAllowTelemetryFailureOverrideChanged: _updateTelemetryState()
onClicked: {
if (telemetryFailure && !_allowTelemetryFailureOverride) {
if (telemetryFailure && !allowTelemetryFailureOverride) {
// No way to proceed past this failure
return
}
if (telemetryFailure && _allowTelemetryFailureOverride && _telemetryState !== _statePassed) {
if (telemetryFailure && allowTelemetryFailureOverride && _telemetryState !== _statePassed) {
// User is allowed to proceed past this failure
_telemetryState = _statePassed
return
......@@ -131,7 +132,7 @@ QGCButton {
function reset() {
_manualState = manualText === "" ? _statePassed : _statePending
if (telemetryFailure) {
_telemetryState = _allowTelemetryFailureOverride ? _statePending : _stateFailed
_telemetryState = allowTelemetryFailureOverride ? _statePending : _stateFailed
} else {
_telemetryState = _statePassed
}
......
......@@ -22,12 +22,7 @@ Column {
property alias _checked: header.checked
onPassedChanged: {
parent.groupPassedChanged(ObjectModel.index)
if (passed) {
header.checked = false
}
}
onPassedChanged: parent.groupPassedChanged(ObjectModel.index)
Component.onCompleted: {
enabled = _checked
......
......@@ -25,29 +25,18 @@ Rectangle {
property bool _passed: false
function reset() {
for (var i=0; i<model.count; i++) {
var group = model.get(i)
group.reset()
group.enabled = i === 0
group._checked = i === 0
}
}
// We delay the updates when a group passes so the user can see all items green for a moment prior to hiding
Timer {
id: delayedGroupPassed
interval: 750
Component.onCompleted: reset()
property int index
Column {
id: mainColumn
width: 40*ScreenTools.defaultFontPixelWidth
spacing: 0.8*ScreenTools.defaultFontPixelWidth
anchors.left: parent.left
anchors.top: parent.top
anchors.topMargin: 0.6*ScreenTools.defaultFontPixelWidth
anchors.leftMargin: 1.5*ScreenTools.defaultFontPixelWidth
function groupPassedChanged(index) {
onTriggered: {
var group = checkListRepeater.itemAt(index)
group._checked = false
if (index + 1 < checkListRepeater.count) {
var group = checkListRepeater.itemAt(index + 1)
group = checkListRepeater.itemAt(index + 1)
group.enabled = true
group._checked = true
}
......@@ -59,6 +48,21 @@ Rectangle {
}
_passed = true
}
}
Column {
id: mainColumn
width: 40*ScreenTools.defaultFontPixelWidth
spacing: 0.8*ScreenTools.defaultFontPixelWidth
anchors.left: parent.left
anchors.top: parent.top
anchors.topMargin: 0.6*ScreenTools.defaultFontPixelWidth
anchors.leftMargin: 1.5*ScreenTools.defaultFontPixelWidth
function groupPassedChanged(index) {
delayedGroupPassed.index = index
delayedGroupPassed.restart()
}
// Header/title of checklist
Item {
......@@ -79,7 +83,7 @@ Rectangle {
opacity : 0.2+0.8*(QGroundControl.multiVehicleManager.vehicles.count > 0)
tooltip: qsTr("Reset the checklist (e.g. after a vehicle reboot)")
onClicked: reset()
onClicked: model.reset()
Image { source:"/qmlimages/MapSyncBlack.svg" ; anchors.fill: parent }
}
......
......@@ -7,17 +7,21 @@
*
****************************************************************************/
import QtQuick 2.3
import QtQuick 2.3
import QtQml.Models 2.1
import QGroundControl 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Vehicle 1.0
ObjectModel {
id: _root
PreFlightCheckButton {
name: qsTr("Global position estimate")
telemetryTextFailure: qsTr("AHRS Unhealthy. Check console.")
telemetryFailure: _unhealthySensors & Vehicle.SysStatusSensorAHRS
function reset() {
for (var i=0; i<_root.count; i++) {
var group = _root.get(i)
group.reset()
group.enabled = i === 0
group._checked = i === 0
}
}
Component.onCompleted: reset()
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property int _unhealthySensors: _activeVehicle ? _activeVehicle.sensorsUnhealthyBits : 0
}
......@@ -15,7 +15,7 @@ Item {
visible: false
property var qgcView
property string folder
property string folder // Due to Qt bug with file url parsing this must be an absolute path
property var nameFilters
property string fileExtension // Primary file extension to search for
property string fileExtension2: "" // Secondary file extension to search for
......@@ -75,7 +75,7 @@ Item {
// the FileDialog fallback mechanism on android 5.9 builds.
HackFileDialog {
id: fullFileDialog
folder: "file://" + _root.folder
folder: "file:///" + _root.folder
nameFilters: _root.nameFilters ? _root.nameFilters : []
title: _root.title
selectExisting: _root.selectExisting
......
......@@ -37,6 +37,7 @@ PlanToolBar 1.0 PlanToolBar.qml
PreFlightCheckButton 1.0 PreFlightCheckButton.qml
PreFlightCheckGroup 1.0 PreFlightCheckGroup.qml
PreFlightCheckList 1.0 PreFlightCheckList.qml
PreFlightCheckModel 1.0 PreFlightCheckModel.qml
QGCButton 1.0 QGCButton.qml
QGCCheckBox 1.0 QGCCheckBox.qml
QGCColoredImage 1.0 QGCColoredImage.qml
......
......@@ -45,7 +45,7 @@ QVariant QmlObjectListModel::data(const QModelIndex &index, int role) const
return QVariant();
}
if (index.row() >= _objectList.count()) {
if (index.row() < 0 || index.row() >= _objectList.count()) {
return QVariant();
}
......@@ -118,11 +118,17 @@ bool QmlObjectListModel::removeRows(int position, int rows, const QModelIndex& p
QObject* QmlObjectListModel::operator[](int index)
{
if (index < 0 || index >= _objectList.count()) {
return NULL;
}
return _objectList[index];
}
const QObject* QmlObjectListModel::operator[](int index) const
{
if (index < 0 || index >= _objectList.count()) {
return NULL;
}
return _objectList[index];
}
......
......@@ -11,7 +11,7 @@ Rectangle {
implicitWidth: label.contentWidth + (_diameter * 2.5) + (_border * 4)
implicitHeight: label.height * 2.5
radius: height /2
color: qgcPal.text
color: qgcPal.windowShade
signal accept ///< Action confirmed
signal reject ///< Action rejected
......@@ -29,7 +29,7 @@ Rectangle {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
text: confirmText
color: qgcPal.window
color: qgcPal.buttonText
}
Rectangle {
......@@ -39,8 +39,7 @@ Rectangle {
height: _diameter
width: _diameter
radius: _diameter / 2
color: qgcPal.windowShade
opacity: 0.8
color: qgcPal.primaryButton
QGCColoredImage {
anchors.centerIn: parent
......@@ -50,7 +49,7 @@ Rectangle {
fillMode: Image.PreserveAspectFit
smooth: false
mipmap: false
color: qgcPal.text
color: qgcPal.buttonText
cache: false
source: "/res/ArrowRight.svg"
}
......
......@@ -364,6 +364,7 @@ QGCView {
allowVehicleLocationCenter: false
gesture.flickDeceleration: 3000
mapName: "OfflineMap"
qgcView: offlineMapView
property bool isSatelliteMap: activeMapType.name.indexOf("Satellite") > -1 || activeMapType.name.indexOf("Hybrid") > -1
......
......@@ -63,6 +63,7 @@ VideoReceiver::VideoReceiver(QObject* parent)
, _videoSink(NULL)
, _socket(NULL)
, _serverPresent(false)
, _rtspTestInterval_ms(5000)
#endif
, _videoSurface(NULL)
, _videoRunning(false)
......@@ -164,9 +165,9 @@ VideoReceiver::_socketError(QAbstractSocket::SocketError socketError)
Q_UNUSED(socketError);
_socket->deleteLater();
_socket = NULL;
//-- Try again in 5 seconds
//-- Try again in a while
if(_videoSettings->streamEnabled()->rawValue().toBool()) {
_timer.start(5000);
_timer.start(_rtspTestInterval_ms);
}
}
#endif
......@@ -194,7 +195,7 @@ VideoReceiver::_timeout()
connect(_socket, static_cast<void (QTcpSocket::*)(QAbstractSocket::SocketError)>(&QTcpSocket::error), this, &VideoReceiver::_socketError);
connect(_socket, &QTcpSocket::connected, this, &VideoReceiver::_connected);
_socket->connectToHost(url.host(), url.port());
_timer.start(5000);
_timer.start(_rtspTestInterval_ms);
}
}
#endif
......
......@@ -49,54 +49,54 @@ public:
~VideoReceiver();
#if defined(QGC_GST_STREAMING)
bool running () { return _running; }
bool recording () { return _recording; }
bool streaming () { return _streaming; }
bool starting () { return _starting; }
bool stopping () { return _stopping; }
virtual bool running () { return _running; }
virtual bool recording () { return _recording; }
virtual bool streaming () { return _streaming; }
virtual bool starting () { return _starting; }
virtual bool stopping () { return _stopping; }
#endif
VideoSurface* videoSurface () { return _videoSurface; }
bool videoRunning () { return _videoRunning; }
QString imageFile () { return _imageFile; }
QString videoFile () { return _videoFile; }
bool showFullScreen () { return _showFullScreen; }
virtual VideoSurface* videoSurface () { return _videoSurface; }
virtual bool videoRunning () { return _videoRunning; }
virtual QString imageFile () { return _imageFile; }
virtual QString videoFile () { return _videoFile; }
virtual bool showFullScreen () { return _showFullScreen; }
void grabImage (QString imageFile);
virtual void grabImage (QString imageFile);
void setShowFullScreen (bool show) { _showFullScreen = show; emit showFullScreenChanged(); }
virtual void setShowFullScreen (bool show) { _showFullScreen = show; emit showFullScreenChanged(); }
signals:
void videoRunningChanged ();
void imageFileChanged ();
void videoFileChanged ();
void showFullScreenChanged ();
void videoRunningChanged ();
void imageFileChanged ();
void videoFileChanged ();
void showFullScreenChanged ();
#if defined(QGC_GST_STREAMING)
void recordingChanged ();
void msgErrorReceived ();
void msgEOSReceived ();
void msgStateChangedReceived ();
void recordingChanged ();
void msgErrorReceived ();
void msgEOSReceived ();
void msgStateChangedReceived ();
#endif
public slots:
void start ();
void stop ();
void setUri (const QString& uri);
void stopRecording ();
void startRecording (const QString& videoFile = QString());
private slots:
void _updateTimer ();
virtual void start ();
virtual void stop ();
virtual void setUri (const QString& uri);
virtual void stopRecording ();
virtual void startRecording (const QString& videoFile = QString());
protected slots:
virtual void _updateTimer ();
#if defined(QGC_GST_STREAMING)
void _timeout ();
void _connected ();
void _socketError (QAbstractSocket::SocketError socketError);
void _handleError ();
void _handleEOS ();
void _handleStateChanged ();
virtual void _timeout ();
virtual void _connected ();
virtual void _socketError (QAbstractSocket::SocketError socketError);
virtual void _handleError ();
virtual void _handleEOS ();
virtual void _handleStateChanged ();
#endif
private:
protected:
#if defined(QGC_GST_STREAMING)
typedef struct
......@@ -121,11 +121,12 @@ private:
static gboolean _onBusMessage (GstBus* bus, GstMessage* message, gpointer user_data);
static GstPadProbeReturn _unlinkCallBack (GstPad* pad, GstPadProbeInfo* info, gpointer user_data);
static GstPadProbeReturn _keyframeWatch (GstPad* pad, GstPadProbeInfo* info, gpointer user_data);
void _detachRecordingBranch (GstPadProbeInfo* info);
void _shutdownRecordingBranch();
void _shutdownPipeline ();
void _cleanupOldVideos ();
void _setVideoSink (GstElement* sink);
virtual void _detachRecordingBranch (GstPadProbeInfo* info);
virtual void _shutdownRecordingBranch();
virtual void _shutdownPipeline ();
virtual void _cleanupOldVideos ();
virtual void _setVideoSink (GstElement* sink);
GstElement* _pipeline;
GstElement* _pipelineStopRec;
......@@ -136,6 +137,7 @@ private:
QTimer _timer;
QTcpSocket* _socket;
bool _serverPresent;
int _rtspTestInterval_ms;
#endif
......
......@@ -15,6 +15,7 @@
#include "SettingsManager.h"
#include "AppMessages.h"
#include "QmlObjectListModel.h"
#include "VideoReceiver.h"
#include <QtQml>
#include <QQmlEngine>
......@@ -302,3 +303,8 @@ QmlObjectListModel* QGCCorePlugin::customMapItems(void)
{
return &_p->_emptyCustomMapItems;
}
VideoReceiver* QGCCorePlugin::createVideoReceiver(QObject* parent)
{
return new VideoReceiver(parent);
}
......@@ -31,6 +31,7 @@ class QQmlApplicationEngine;
class Vehicle;
class LinkInterface;
class QmlObjectListModel;
class VideoReceiver;
class QGCCorePlugin : public QGCTool
{
......@@ -98,6 +99,9 @@ public:
/// Allows the plugin to override the creation of the root (native) window.
virtual QQmlApplicationEngine* createRootWindow(QObject* parent);
/// Allows the plugin to override the creation of VideoReceiver.
virtual VideoReceiver* createVideoReceiver(QObject* parent);
/// Allows the plugin to see all mavlink traffic to a vehicle
/// @return true: Allow vehicle to continue processing, false: Vehicle should not process message
virtual bool mavlinkMessage(Vehicle* vehicle, LinkInterface* link, mavlink_message_t message);
......
......@@ -121,6 +121,8 @@ LinkInterface* LinkManager::createConnectedLink(SharedLinkConfigurationPointer&
}
}
break;
#else
Q_UNUSED(isPX4Flow)
#endif
case LinkConfiguration::TypeUdp:
pLink = new UDPLink(config);
......
......@@ -175,7 +175,7 @@ Item {
MessageDialog {
id: activeConnectionsCloseDialog
title: qsTr("%1 close").arg(QGroundControl.appName)
text: qsTr("There are still active connections to vehicles. Do you want to disconnect these before closing?")
text: qsTr("There are still active connections to vehicles. Are you sure you want to exit?")
standardButtons: StandardButton.Yes | StandardButton.Cancel
modality: Qt.ApplicationModal
visible: false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment