Commit 15517ff3 authored by Gus Grubba's avatar Gus Grubba

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

# Conflicts:
#	src/FlightDisplay/FlightDisplayViewWidgets.qml
#	src/PlanView/MissionItemEditor.qml
#	src/PlanView/RallyPointItemEditor.qml
#	src/QmlControls/QGCButton.qml
#	src/api/QGCOptions.h
parents 7f89c8eb 5957f29e
......@@ -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.3\msvc2015\bin;%PATH%
- set PATH=C:\Qt\Tools\QtCreator\bin;C:\Qt\5.9.4\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.3\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.9.4\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
......
......@@ -21,14 +21,32 @@ WindowsBuild {
# In the mean time, it’s possible to define a completely different dialect by defining the
# location and name below.
# check for user defined settings in user_config.pri if not already set as qmake argument
isEmpty(MAVLINKPATH_REL) {
MAVLINKPATH_REL = libs/mavlink/include/mavlink/v2.0
exists(user_config.pri):infile(user_config.pri, MAVLINKPATH_REL) {
MAVLINKPATH_REL = $$fromfile(user_config.pri, MAVLINKPATH_REL)
message($$sprintf("Using user-supplied relativ mavlink path '%1' specified in user_config.pri", $$MAVLINKPATH_REL))
} else {
MAVLINKPATH_REL = libs/mavlink/include/mavlink/v2.0
}
}
isEmpty(MAVLINKPATH) {
MAVLINKPATH = $$BASEDIR/$$MAVLINKPATH_REL
exists(user_config.pri):infile(user_config.pri, MAVLINKPATH) {
MAVLINKPATH = $$fromfile(user_config.pri, MAVLINKPATH)
message($$sprintf("Using user-supplied mavlink path '%1' specified in user_config.pri", $$MAVLINKPATH))
} else {
MAVLINKPATH = $$BASEDIR/$$MAVLINKPATH_REL
}
}
isEmpty(MAVLINK_CONF) {
MAVLINK_CONF = ardupilotmega
exists(user_config.pri):infile(user_config.pri, MAVLINK_CONF) {
MAVLINK_CONF = $$fromfile(user_config.pri, MAVLINK_CONF)
message($$sprintf("Using user-supplied mavlink dialect '%1' specified in user_config.pri", $$MAVLINK_CONF))
} else {
MAVLINK_CONF = ardupilotmega
}
}
# If defined, all APM specific MAVLink messages are disabled
......
......@@ -41,7 +41,7 @@ You **need to install Qt as described below** instead of using pre-built package
* Windows: Make sure to install VS 2015 32 bit package.
###### Install additional packages:
* Ubuntu: sudo apt-get install speech-dispatcher libudev-dev libsdl2-dev
* Ubuntu: sudo apt-get install speech-dispatcher libudev-dev libsdl2-dev libgstreamer1.0-0 gstreamer1.0-plugins-base libgstreamer-plugins-base1.0-dev gstreamer1.0*
* Fedora: sudo dnf install speech-dispatcher SDL2-devel SDL2 systemd-devel
* Arch Linux: pacman -Sy speech-dispatcher
* Windows: [USB Driver](http://www.pixhawk.org/firmware/downloads) to connect to Pixhawk/PX4Flow/3DR Radio
......
Subproject commit f36b9c4c5c0c9b6d33621779469de0c1e7eea457
Subproject commit 3ddcbdfcd360c846246d8905d877add3488c8363
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -110,7 +110,7 @@ AnalyzePage {
}
QGCLabel {
text: geoController.saveDirectory != "" ? geoController.saveDirectory : "/TAGGED folder in your image folder"
text: geoController.saveDirectory !== "" ? geoController.saveDirectory : "/TAGGED folder in your image folder"
anchors.verticalCenter: parent.verticalCenter
}
}
......
......@@ -21,6 +21,7 @@
#include "QGCMapEngine.h"
#include "ParameterManager.h"
#include "Vehicle.h"
#include "SettingsManager.h"
#include <QDebug>
#include <QSettings>
......@@ -511,7 +512,7 @@ LogDownloadController::download(QString path)
QString dir = path;
#if defined(__mobile__)
if(dir.isEmpty()) {
dir = QDir::homePath();
dir = qgcApp()->toolbox()->settingsManager()->appSettings()->logSavePath();
}
#else
if(dir.isEmpty()) {
......
......@@ -55,7 +55,7 @@ SetupPage {
property real _lastValue: 0
onTriggered: {
if (_lastValue != slider.value) {
if (_lastValue !== slider.value) {
controller.vehicle.motorTest(index + 1, slider.value, 1)
}
}
......
......@@ -379,7 +379,7 @@ SetupPage {
text: qsTr("Calibrate")
onClicked: {
if (text == qsTr("Calibrate")) {
if (text === qsTr("Calibrate")) {
showDialog(zeroTrimsDialogComponent, dialogTitle, radioPage.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel)
} else {
controller.nextButtonClicked()
......
......@@ -202,12 +202,12 @@ Your vehicle will also be restarted in order to complete the process.")
QGCCheckBox {
// Although this item is invisible we still use it to manage state
id: airframeCheckBox
checked: modelData.name == controller.currentAirframeType
checked: modelData.name === controller.currentAirframeType
exclusiveGroup: airframeTypeExclusive
visible: false
onCheckedChanged: {
if (checked && combo.currentIndex != -1) {
if (checked && combo.currentIndex !== -1) {
console.log("check box change", combo.currentIndex)
controller.autostartId = modelData.airframes[combo.currentIndex].autostartId
}
......
......@@ -37,7 +37,7 @@ FactPanel {
VehicleSummaryRow {
labelText: qsTr("Firmware Version:")
valueText: activeVehicle.firmwareMajorVersion == -1 ? qsTr("Unknown") : activeVehicle.firmwareMajorVersion + "." + activeVehicle.firmwareMinorVersion + "." + activeVehicle.firmwarePatchVersion + activeVehicle.firmwareVersionTypeString
valueText: activeVehicle.firmwareMajorVersion === -1 ? qsTr("Unknown") : activeVehicle.firmwareMajorVersion + "." + activeVehicle.firmwareMinorVersion + "." + activeVehicle.firmwarePatchVersion + activeVehicle.firmwareVersionTypeString
}
}
}
......@@ -18,7 +18,7 @@ FactPanel {
property Fact _nullFact
property Fact _rcMapFltmode: controller.parameterExists(-1, "RC_MAP_FLTMODE") ? controller.getParameterFact(-1, "RC_MAP_FLTMODE") : _nullFact
property Fact _rcMapModeSw: controller.getParameterFact(-1, "RC_MAP_MODE_SW")
property bool _simpleMode: _rcMapFltmode.value > 0 || _rcMapModeSw.value == 0
property bool _simpleMode: _rcMapFltmode.value > 0 || _rcMapModeSw.value === 0
Loader {
anchors.fill: parent
......
......@@ -39,7 +39,7 @@ SetupPage {
property bool _rcMapFltmodeExists: controller.parameterExists(-1, "RC_MAP_FLTMODE")
property Fact _rcMapFltmode: _rcMapFltmodeExists ? controller.getParameterFact(-1, "RC_MAP_FLTMODE") : _nullFact
property Fact _rcMapModeSw: controller.getParameterFact(-1, "RC_MAP_MODE_SW")
property bool _simpleMode: _rcMapFltmodeExists ? _rcMapFltmode.value > 0 || _rcMapModeSw.value == 0 : false
property bool _simpleMode: _rcMapFltmodeExists ? _rcMapFltmode.value > 0 || _rcMapModeSw.value === 0 : false
FactPanelController {
id: controller
......
......@@ -145,7 +145,7 @@ Item {
QGCLabel {
anchors.baseline: returnCombo.baseline
text: qsTr("Return switch:")
color: parent.fact.value == 0 ? qgcPal.text : (controller.rcChannelValues[parent.fact.value - 1] >= 1500 ? "yellow" : qgcPal.text)
color: parent.fact.value === 0 ? qgcPal.text : (controller.rcChannelValues[parent.fact.value - 1] >= 1500 ? "yellow" : qgcPal.text)
}
FactComboBox {
......@@ -164,7 +164,7 @@ Item {
QGCLabel {
anchors.baseline: killCombo.baseline
text: qsTr("Kill switch:")
color: parent.fact.value == 0 ? qgcPal.text : (controller.rcChannelValues[parent.fact.value - 1] >= 1500 ? "yellow" : qgcPal.text)
color: parent.fact.value === 0 ? qgcPal.text : (controller.rcChannelValues[parent.fact.value - 1] >= 1500 ? "yellow" : qgcPal.text)
}
FactComboBox {
......@@ -183,7 +183,7 @@ Item {
QGCLabel {
anchors.baseline: offboardCombo.baseline
text: qsTr("Offboard switch:")
color: parent.fact.value == 0 ? qgcPal.text : (controller.rcChannelValues[parent.fact.value - 1] >= 1500 ? "yellow" : qgcPal.text)
color: parent.fact.value === 0 ? qgcPal.text : (controller.rcChannelValues[parent.fact.value - 1] >= 1500 ? "yellow" : qgcPal.text)
}
FactComboBox {
......@@ -203,7 +203,7 @@ Item {
QGCLabel {
anchors.baseline: vtolCombo.baseline
text: qsTr("VTOL mode switch:")
color: parent.fact.value == 0 ? qgcPal.text : (controller.rcChannelValues[parent.fact.value - 1] >= 1500 ? "yellow" : qgcPal.text)
color: parent.fact.value === 0 ? qgcPal.text : (controller.rcChannelValues[parent.fact.value - 1] >= 1500 ? "yellow" : qgcPal.text)
}
FactComboBox {
......
......@@ -143,7 +143,7 @@ SetupPage {
onClicked: {
var measuredVoltageValue = parseFloat(measuredVoltage.text)
if (measuredVoltageValue == 0 || isNaN(measuredVoltageValue)) {
if (measuredVoltageValue === 0 || isNaN(measuredVoltageValue)) {
return
}
var newVoltageDivider = (measuredVoltageValue * battVoltageDivider.value) / controller.vehicle.battery.voltage.value
......@@ -201,7 +201,7 @@ SetupPage {
onClicked: {
var measuredCurrentValue = parseFloat(measuredCurrent.text)
if (measuredCurrentValue == 0) {
if (measuredCurrentValue === 0) {
return
}
var newAmpsPerVolt = (measuredCurrentValue * battAmpsPerVolt.value) / controller.vehicle.battery.current.value
......@@ -379,7 +379,7 @@ SetupPage {
QGCCheckBox {
id: showUAVCAN
text: qsTr("Show UAVCAN Settings")
checked: uavcanEnable.rawValue != 0
checked: uavcanEnable ? uavcanEnable.rawValue !== 0 : false
}
QGCGroupBox {
......
......@@ -25,8 +25,8 @@ FactPanel {
property Fact airspeedDisabledFact: controller.getParameterFact(-1, "FW_ARSP_MODE")
property Fact airspeedBreakerFact: controller.getParameterFact(-1, "CBRK_AIRSPD_CHK")
property bool _airspeedVisible: airspeedDisabledFact.value == false && airspeedBreakerFact.value != 162128
property bool _airspeedCalRequired: _airspeedVisible && dpressOffFact.value == 0
property bool _airspeedVisible: airspeedDisabledFact.value === false && airspeedBreakerFact.value !== 162128
property bool _airspeedCalRequired: _airspeedVisible && dpressOffFact.value === 0
Column {
anchors.fill: parent
......
......@@ -352,7 +352,7 @@ Item {
id: compassButton
width: _buttonWidth
text: qsTr("Compass")
indicatorGreen: cal_mag0_id.value != 0
indicatorGreen: cal_mag0_id.value !== 0
visible: QGroundControl.corePlugin.options.showSensorCalibrationCompass && showSensorCalibrationCompass
onClicked: {
......@@ -366,7 +366,7 @@ Item {
id: gyroButton
width: _buttonWidth
text: qsTr("Gyroscope")
indicatorGreen: cal_gyro0_id.value != 0
indicatorGreen: cal_gyro0_id.value !== 0
visible: QGroundControl.corePlugin.options.showSensorCalibrationGyro && showSensorCalibrationGyro
onClicked: {
......@@ -380,7 +380,7 @@ Item {
id: accelButton
width: _buttonWidth
text: qsTr("Accelerometer")
indicatorGreen: cal_acc0_id.value != 0
indicatorGreen: cal_acc0_id.value !== 0
visible: QGroundControl.corePlugin.options.showSensorCalibrationAccel && showSensorCalibrationAccel
onClicked: {
......@@ -394,8 +394,8 @@ Item {
id: levelButton
width: _buttonWidth
text: qsTr("Level Horizon")
indicatorGreen: sens_board_x_off.value != 0 || sens_board_y_off.value != 0 | sens_board_z_off.value != 0
enabled: cal_acc0_id.value != 0 && cal_gyro0_id.value != 0
indicatorGreen: sens_board_x_off.value !== 0 || sens_board_y_off.value !== 0 | sens_board_z_off.value !== 0
enabled: cal_acc0_id.value !== 0 && cal_gyro0_id.value !== 0
visible: QGroundControl.corePlugin.options.showSensorCalibrationLevel && showSensorCalibrationLevel
onClicked: {
......@@ -410,11 +410,11 @@ Item {
width: _buttonWidth
text: qsTr("Airspeed")
visible: (controller.vehicle.fixedWing || controller.vehicle.vtol) &&
controller.getParameterFact(-1, "FW_ARSP_MODE").value == false &&
controller.getParameterFact(-1, "CBRK_AIRSPD_CHK").value != 162128 &&
controller.getParameterFact(-1, "FW_ARSP_MODE").value === false &&
controller.getParameterFact(-1, "CBRK_AIRSPD_CHK").value !== 162128 &&
QGroundControl.corePlugin.options.showSensorCalibrationAirspeed &&
showSensorCalibrationAirspeed
indicatorGreen: sens_dpres_off.value != 0
indicatorGreen: sens_dpres_off.value !== 0
onClicked: {
preCalibrationDialogType = "airspeed"
......
......@@ -202,16 +202,16 @@ protected:
virtual void _setCameraMode (CameraMode mode);
protected slots:
void _initWhenReady ();
void _requestCameraSettings ();
void _requestAllParameters ();
void _requestParamUpdates ();
void _requestCaptureStatus ();
void _requestStorageInfo ();
void _downloadFinished ();
void _mavCommandResult (int vehicleId, int component, int command, int result, bool noReponseFromVehicle);
void _dataReady (QByteArray data);
void _paramDone ();
virtual void _initWhenReady ();
virtual void _requestCameraSettings ();
virtual void _requestAllParameters ();
virtual void _requestParamUpdates ();
virtual void _requestCaptureStatus ();
virtual void _requestStorageInfo ();
virtual void _downloadFinished ();
virtual void _mavCommandResult (int vehicleId, int component, int command, int result, bool noReponseFromVehicle);
virtual void _dataReady (QByteArray data);
virtual void _paramDone ();
private:
bool _handleLocalization (QByteArray& bytes);
......
......@@ -57,9 +57,18 @@ QGCCameraParamIO::QGCCameraParamIO(QGCCameraControl *control, Fact* fact, Vehicl
case FactMetaData::valueTypeUint32:
_mavParamType = MAV_PARAM_EXT_TYPE_UINT32;
break;
case FactMetaData::valueTypeUint64:
_mavParamType = MAV_PARAM_EXT_TYPE_UINT64;
break;
case FactMetaData::valueTypeInt64:
_mavParamType = MAV_PARAM_EXT_TYPE_INT64;
break;
case FactMetaData::valueTypeFloat:
_mavParamType = MAV_PARAM_EXT_TYPE_REAL32;
break;
case FactMetaData::valueTypeDouble:
_mavParamType = MAV_PARAM_EXT_TYPE_REAL64;
break;
//-- String and custom are the same for now
case FactMetaData::valueTypeString:
case FactMetaData::valueTypeCustom:
......@@ -145,9 +154,18 @@ QGCCameraParamIO::_sendParameter()
case FactMetaData::valueTypeUint32:
union_value.param_uint32 = (uint32_t)_fact->rawValue().toUInt();
break;
case FactMetaData::valueTypeInt64:
union_value.param_int64 = (int64_t)_fact->rawValue().toLongLong();
break;
case FactMetaData::valueTypeUint64:
union_value.param_uint64 = (uint64_t)_fact->rawValue().toULongLong();
break;
case FactMetaData::valueTypeFloat:
union_value.param_float = _fact->rawValue().toFloat();
break;
case FactMetaData::valueTypeDouble:
union_value.param_double = _fact->rawValue().toDouble();
break;
//-- String and custom are the same for now
case FactMetaData::valueTypeString:
case FactMetaData::valueTypeCustom:
......@@ -282,6 +300,12 @@ QGCCameraParamIO::_valueFromMessage(const char* value, uint8_t param_type)
case MAV_PARAM_EXT_TYPE_INT32:
var = QVariant(u.param_int32);
break;
case MAV_PARAM_EXT_TYPE_UINT64:
var = QVariant((qulonglong)u.param_uint64);
break;
case MAV_PARAM_EXT_TYPE_INT64:
var = QVariant((qlonglong)u.param_int64);
break;
case MAV_PARAM_EXT_TYPE_CUSTOM:
var = QVariant(QByteArray(value, MAVLINK_MSG_PARAM_EXT_SET_FIELD_PARAM_VALUE_LEN));
break;
......
......@@ -19,6 +19,9 @@ MAVPACKED(
typedef struct {
union {
float param_float;
double param_double;
int64_t param_int64;
uint64_t param_uint64;
int32_t param_int32;
uint32_t param_uint32;
int16_t param_int16;
......
......@@ -25,28 +25,28 @@ public:
QGCCameraManager(Vehicle* vehicle);
virtual ~QGCCameraManager();
Q_PROPERTY(QmlObjectListModel* cameras READ cameras NOTIFY camerasChanged)
Q_PROPERTY(QmlObjectListModel* cameras READ cameras NOTIFY camerasChanged)
//-- Return a list of cameras provided by this vehicle
virtual QmlObjectListModel* cameras () { return &_cameras; }
virtual QmlObjectListModel* cameras () { return &_cameras; }
signals:
void camerasChanged ();
void camerasChanged ();
protected slots:
void _vehicleReady (bool ready);
void _mavlinkMessageReceived (const mavlink_message_t& message);
virtual void _vehicleReady (bool ready);
virtual void _mavlinkMessageReceived (const mavlink_message_t& message);
protected:
QGCCameraControl* _findCamera (int id);
void _requestCameraInfo (int compID);
void _handleHeartbeat (const mavlink_message_t& message);
void _handleCameraInfo (const mavlink_message_t& message);
void _handleStorageInfo (const mavlink_message_t& message);
void _handleCameraSettings (const mavlink_message_t& message);
void _handleParamAck (const mavlink_message_t& message);
void _handleParamValue (const mavlink_message_t& message);
void _handleCaptureStatus (const mavlink_message_t& message);
virtual QGCCameraControl* _findCamera (int id);
virtual void _requestCameraInfo (int compID);
virtual void _handleHeartbeat (const mavlink_message_t& message);
virtual void _handleCameraInfo (const mavlink_message_t& message);
virtual void _handleStorageInfo (const mavlink_message_t& message);
virtual void _handleCameraSettings (const mavlink_message_t& message);
virtual void _handleParamAck (const mavlink_message_t& message);
virtual void _handleParamValue (const mavlink_message_t& message);
virtual void _handleCaptureStatus (const mavlink_message_t& message);
protected:
Vehicle* _vehicle;
......
......@@ -33,10 +33,12 @@ Flow {
checked: fact.value & fact.bitmaskValues[index]
onClicked: {
var i;
var otherCheckbox;
if (checked) {
if (firstEntryIsAll && index == 0) {
for (var i=1; i<repeater.count; i++) {
var otherCheckbox = repeater.itemAt(i)
for (i = 1; i < repeater.count; i++) {
otherCheckbox = repeater.itemAt(i)
fact.value &= ~fact.bitmaskValues[i]
otherCheckbox.checked = false
otherCheckbox.enabled = false
......@@ -45,8 +47,8 @@ Flow {
fact.value |= fact.bitmaskValues[index]
} else {
if (firstEntryIsAll && index == 0) {
for (var i=1; i<repeater.count; i++) {
var otherCheckbox = repeater.itemAt(i)
for (i = 1; i < repeater.count; i++) {
otherCheckbox = repeater.itemAt(i)
otherCheckbox.enabled = true
}
}
......
......@@ -8,16 +8,14 @@ import QGroundControl.Controls 1.0
QGCCheckBox {
property Fact fact: Fact { }
property variant checkedValue: 1
property variant uncheckedValue: 0
checkedState: fact ?
(fact.typeIsBool ?
(fact.value === true ? Qt.Checked : Qt.Unchecked) :
(fact.value === checkedValue ? Qt.Checked : Qt.Unchecked)) :
(fact.value === false ? Qt.Unchecked : Qt.Checked) :
(fact.value === 0 ? Qt.Unchecked : Qt.Checked)) :
Qt.Unchecked
text: qsTr("Label")
onClicked: fact.value = checked ? checkedValue : uncheckedValue
onClicked: fact.value = checked ? 1 : 0
}
......@@ -12,7 +12,7 @@ QGCComboBox {
model: fact ? fact.enumStrings : null
currentIndex: indexModel ? fact.value : fact.enumIndex
currentIndex: fact ? (indexModel ? fact.value : fact.enumIndex) : 0
onActivated: {
if (indexModel) {
......
......@@ -254,9 +254,13 @@ QVariant FactMetaData::_minForType(void) const
case valueTypeInt16:
return QVariant(std::numeric_limits<short int>::min());
case valueTypeUint32:
return QVariant(std::numeric_limits<unsigned int>::min());
return QVariant(std::numeric_limits<uint32_t>::min());
case valueTypeInt32:
return QVariant(std::numeric_limits<int>::min());
return QVariant(std::numeric_limits<int32_t>::min());
case valueTypeUint64:
return QVariant((qulonglong)std::numeric_limits<uint64_t>::min());
case valueTypeInt64:
return QVariant((qlonglong)std::numeric_limits<int64_t>::min());
case valueTypeFloat:
return QVariant(-std::numeric_limits<float>::max());
case valueTypeDouble:
......@@ -287,9 +291,13 @@ QVariant FactMetaData::_maxForType(void) const
case valueTypeInt16:
return QVariant(std::numeric_limits<short int>::max());
case valueTypeUint32:
return QVariant(std::numeric_limits<unsigned int>::max());
return QVariant(std::numeric_limits<uint32_t>::max());
case valueTypeInt32:
return QVariant(std::numeric_limits<int>::max());
return QVariant(std::numeric_limits<int32_t>::max());
case valueTypeUint64:
return QVariant((qulonglong)std::numeric_limits<uint64_t>::max());
case valueTypeInt64:
return QVariant((qlonglong)std::numeric_limits<int64_t>::max());
case valueTypeFloat:
return QVariant(std::numeric_limits<float>::max());
case valueTypeElapsedTimeInSeconds:
......@@ -324,6 +332,14 @@ bool FactMetaData::convertAndValidateRaw(const QVariant& rawValue, bool convertO
}
}
break;
case FactMetaData::valueTypeInt64:
typedValue = QVariant(rawValue.toLongLong(&convertOk));
if (!convertOnly && convertOk) {
if (typedValue < rawMin() || typedValue > rawMax()) {
errorString = tr("Value must be within %1 and %2").arg(rawMin().toInt()).arg(rawMax().toInt());
}
}
break;
case FactMetaData::valueTypeUint8:
case FactMetaData::valueTypeUint16:
case FactMetaData::valueTypeUint32:
......@@ -334,6 +350,14 @@ bool FactMetaData::convertAndValidateRaw(const QVariant& rawValue, bool convertO
}
}
break;
case FactMetaData::valueTypeUint64:
typedValue = QVariant(rawValue.toULongLong(&convertOk));
if (!convertOnly && convertOk) {
if (typedValue < rawMin() || typedValue > rawMax()) {
errorString = tr("Value must be within %1 and %2").arg(rawMin().toUInt()).arg(rawMax().toUInt());
}
}
break;
case FactMetaData::valueTypeFloat:
typedValue = QVariant(rawValue.toFloat(&convertOk));
if (!convertOnly && convertOk) {
......@@ -389,6 +413,14 @@ bool FactMetaData::convertAndValidateCooked(const QVariant& cookedValue, bool co
}
}
break;
case FactMetaData::valueTypeInt64:
typedValue = QVariant(cookedValue.toLongLong(&convertOk));
if (!convertOnly && convertOk) {
if (cookedMin() > typedValue || typedValue > cookedMax()) {
errorString = tr("Value must be within %1 and %2").arg(cookedMin().toInt()).arg(cookedMax().toInt());
}
}
break;
case FactMetaData::valueTypeUint8:
case FactMetaData::valueTypeUint16:
case FactMetaData::valueTypeUint32:
......@@ -399,6 +431,14 @@ bool FactMetaData::convertAndValidateCooked(const QVariant& cookedValue, bool co
}
}
break;
case FactMetaData::valueTypeUint64:
typedValue = QVariant(cookedValue.toULongLong(&convertOk));
if (!convertOnly && convertOk) {
if (cookedMin() > typedValue || typedValue > cookedMax()) {
errorString = tr("Value must be within %1 and %2").arg(cookedMin().toUInt()).arg(cookedMax().toUInt());
}
}
break;
case FactMetaData::valueTypeFloat:
typedValue = QVariant(cookedValue.toFloat(&convertOk));
if (!convertOnly && convertOk) {
......@@ -453,6 +493,16 @@ bool FactMetaData::clampValue(const QVariant& cookedValue, QVariant& typedValue)
}
}
break;
case FactMetaData::valueTypeInt64:
typedValue = QVariant(cookedValue.toLongLong(&convertOk));
if (convertOk) {
if (cookedMin() > typedValue) {
typedValue = cookedMin();
} else if(typedValue > cookedMax()) {
typedValue = cookedMax();
}
}
break;
case FactMetaData::valueTypeUint8:
case FactMetaData::valueTypeUint16:
case FactMetaData::valueTypeUint32:
......@@ -465,6 +515,16 @@ bool FactMetaData::clampValue(const QVariant& cookedValue, QVariant& typedValue)
}
}
break;
case FactMetaData::valueTypeUint64:
typedValue = QVariant(cookedValue.toULongLong(&convertOk));
if (convertOk) {
if (cookedMin() > typedValue) {
typedValue = cookedMin();
} else if(typedValue > cookedMax()) {
typedValue = cookedMax();
}
}
break;
case FactMetaData::valueTypeFloat:
typedValue = QVariant(cookedValue.toFloat(&convertOk));
if (convertOk) {
......@@ -742,6 +802,8 @@ FactMetaData::ValueType_t FactMetaData::stringToType(const QString& typeString,
<< QStringLiteral("Int16")
<< QStringLiteral("Uint32")
<< QStringLiteral("Int32")
<< QStringLiteral("Uint64")
<< QStringLiteral("Int64")
<< QStringLiteral("Float")
<< QStringLiteral("Double")
<< QStringLiteral("String")
......@@ -755,6 +817,8 @@ FactMetaData::ValueType_t FactMetaData::stringToType(const QString& typeString,
<< valueTypeInt16
<< valueTypeUint32
<< valueTypeInt32
<< valueTypeUint64
<< valueTypeInt64
<< valueTypeFloat
<< valueTypeDouble
<< valueTypeString
......@@ -789,6 +853,8 @@ size_t FactMetaData::typeToSize(ValueType_t type)
case valueTypeFloat:
return 4;
case valueTypeUint64:
case valueTypeInt64:
case valueTypeDouble:
return 8;
......
......@@ -36,6 +36,8 @@ public:
valueTypeInt16,
valueTypeUint32,
valueTypeInt32,
valueTypeUint64,
valueTypeInt64,
valueTypeFloat,
valueTypeDouble,
valueTypeString,
......
......@@ -22,12 +22,9 @@
#include <QVariantAnimation>
#include <QJsonArray>
/* types for local parameter cache */
typedef QPair<int /* FactMetaData::ValueType_t */, QVariant /* Fact::rawValue */> ParamTypeVal;
typedef QMap<QString /* parameter name */, ParamTypeVal> CacheMapName2ParamTypeVal;
QGC_LOGGING_CATEGORY(ParameterManagerVerbose1Log, "ParameterManagerVerbose1Log")
QGC_LOGGING_CATEGORY(ParameterManagerVerbose2Log, "ParameterManagerVerbose2Log")
QGC_LOGGING_CATEGORY(ParameterManagerVerbose1Log, "ParameterManagerVerbose1Log")
QGC_LOGGING_CATEGORY(ParameterManagerVerbose2Log, "ParameterManagerVerbose2Log")
QGC_LOGGING_CATEGORY(ParameterManagerDebugCacheFailureLog, "ParameterManagerDebugCacheFailureLog") // Turn on to debug parameter cache crc misses
Fact ParameterManager::_defaultFact;
......@@ -151,6 +148,24 @@ void ParameterManager::_parameterUpdate(int vehicleId, int componentId, QString
return;
}
// Used to debug cache crc misses (turn on ParameterManagerDebugCacheFailureLog)
if (!_initialLoadComplete && !_logReplay && _debugCacheCRC.contains(componentId) && _debugCacheCRC[componentId]) {
if (_debugCacheMap[componentId].contains(parameterName)) {
const ParamTypeVal& cacheParamTypeVal = _debugCacheMap[componentId][parameterName];
size_t dataSize = FactMetaData::typeToSize(static_cast<FactMetaData::ValueType_t>(cacheParamTypeVal.first));
const void *cacheData = cacheParamTypeVal.second.constData();
const void *vehicleData = value.constData();
if (memcmp(cacheData, vehicleData, dataSize)) {
qDebug() << "Cache/Vehicle values differ for name:cache:actual" << parameterName << value << cacheParamTypeVal.second;
}
_debugCacheParamSeen[componentId][parameterName] = true;
} else {
qDebug() << "Parameter missing from cache" << parameterName;
}
}
_initialRequestTimeoutTimer.stop();
_waitingParamTimeoutTimer.stop();
......@@ -289,6 +304,12 @@ void ParameterManager::_parameterUpdate(int vehicleId, int componentId, QString
case MAV_PARAM_TYPE_INT32:
factType = FactMetaData::valueTypeInt32;
break;
case MAV_PARAM_TYPE_UINT64:
factType = FactMetaData::valueTypeUint64;
break;
case MAV_PARAM_TYPE_INT64:
factType = FactMetaData::valueTypeInt64;
break;
case MAV_PARAM_TYPE_REAL32:
factType = FactMetaData::valueTypeFloat;
break;
......@@ -334,11 +355,6 @@ void ParameterManager::_parameterUpdate(int vehicleId, int componentId, QString
_setupCategoryMap();
}
if (_prevWaitingWriteParamNameCount != 0 && waitingWriteParamNameCount == 0) {
// If all the writes just finished the vehicle is up to date, so persist.
_saveToEEPROM();
}
// Update param cache. The param cache is only used on PX4 Firmware since ArduPilot and Solo have volatile params
// which invalidate the cache. The Solo also streams param updates in flight for things like gimbal values
// which in turn causes a perf problem with all the param cache updates.
......@@ -869,22 +885,13 @@ void ParameterManager::_tryCacheHashLoad(int vehicleId, int componentId, QVarian
_parameterSetMajorVersion = -1;
_clearMetaData();
qCInfo(ParameterManagerLog) << "Parameters cache match failed" << qPrintable(QFileInfo(cacheFile).absoluteFilePath());
}
}
void ParameterManager::_saveToEEPROM(void)
{
if (_saveRequired) {
_saveRequired = false;
if (_vehicle->firmwarePlugin()->isCapable(_vehicle, FirmwarePlugin::MavCmdPreflightStorageCapability)) {
_vehicle->sendMavCommand(MAV_COMP_ID_ALL,
MAV_CMD_PREFLIGHT_STORAGE,
true, // showError
1, // Write parameters to EEPROM
-1); // Don't do anything with mission storage
qCDebug(ParameterManagerLog) << _logVehiclePrefix() << "_saveToEEPROM";
} else {
qCDebug(ParameterManagerLog) << _logVehiclePrefix() << "_saveToEEPROM skipped due to FirmwarePlugin::isCapable";
if (ParameterManagerDebugCacheFailureLog().isDebugEnabled()) {
_debugCacheCRC[componentId] = true;
_debugCacheMap[componentId] = cacheMap;
foreach (const QString& name, cacheMap.keys()) {
_debugCacheParamSeen[componentId][name] = false;
}
qgcApp()->showMessage(tr("Parameter cache CRC match failed"));
}
}
}
......@@ -983,9 +990,18 @@ MAV_PARAM_TYPE ParameterManager::_factTypeToMavType(FactMetaData::ValueType_t fa
case FactMetaData::valueTypeUint32:
return MAV_PARAM_TYPE_UINT32;
case FactMetaData::valueTypeUint64:
return MAV_PARAM_TYPE_UINT64;
case FactMetaData::valueTypeInt64:
return MAV_PARAM_TYPE_INT64;
case FactMetaData::valueTypeFloat:
return MAV_PARAM_TYPE_REAL32;
case FactMetaData::valueTypeDouble:
return MAV_PARAM_TYPE_REAL64;
default:
qWarning() << "Unsupported fact type" << factType;
// fall through
......@@ -1013,9 +1029,18 @@ FactMetaData::ValueType_t ParameterManager::_mavTypeToFactType(MAV_PARAM_TYPE ma
case MAV_PARAM_TYPE_UINT32:
return FactMetaData::valueTypeUint32;
case MAV_PARAM_TYPE_UINT64:
return FactMetaData::valueTypeUint64;
case MAV_PARAM_TYPE_INT64:
return FactMetaData::valueTypeInt64;
case MAV_PARAM_TYPE_REAL32:
return FactMetaData::valueTypeFloat;
case MAV_PARAM_TYPE_REAL64:
return FactMetaData::valueTypeDouble;
default:
qWarning() << "Unsupported mav param type" << mavType;
// fall through
......@@ -1086,6 +1111,18 @@ void ParameterManager::_checkInitialLoadComplete(void)
// We aren't waiting for any more initial parameter updates, initial parameter loading is complete
_initialLoadComplete = true;
// Parameter cache crc failure debugging
foreach (int componentId, _debugCacheParamSeen.keys()) {
if (!_logReplay && _debugCacheCRC.contains(componentId) && _debugCacheCRC[componentId]) {
foreach (const QString& paramName, _debugCacheParamSeen[componentId].keys()) {
if (!_debugCacheParamSeen[componentId][paramName]) {
qDebug() << "Parameter in cache but not on vehicle componentId:Name" << componentId << paramName;
}
}
}
}
_debugCacheCRC.clear();
qCDebug(ParameterManagerLog) << _logVehiclePrefix() << "Initial load complete";
// Check for index based load failures
......@@ -1399,6 +1436,7 @@ void ParameterManager::_loadOfflineEditingParams(void)
_setupCategoryMap();
_parametersReady = true;
_initialLoadComplete = true;
_debugCacheCRC.clear();
}
void ParameterManager::saveToJson(int componentId, const QStringList& paramsToSave, QJsonObject& saveObject)
......
......@@ -30,6 +30,7 @@
Q_DECLARE_LOGGING_CATEGORY(ParameterManagerVerbose1Log)
Q_DECLARE_LOGGING_CATEGORY(ParameterManagerVerbose2Log)
Q_DECLARE_LOGGING_CATEGORY(ParameterManagerDebugCacheFailureLog)
/// Connects to Parameter Manager to load/update Facts
class ParameterManager : public QObject
......@@ -153,7 +154,6 @@ private:
MAV_PARAM_TYPE _factTypeToMavType(FactMetaData::ValueType_t factType);
FactMetaData::ValueType_t _mavTypeToFactType(MAV_PARAM_TYPE mavType);
void _saveToEEPROM(void);
void _checkInitialLoadComplete(void);
/// First mapping is by component id
......@@ -175,6 +175,13 @@ private:
int _parameterSetMajorVersion; ///< Version for parameter set, -1 if not known
QObject* _parameterMetaData; ///< Opaque data from FirmwarePlugin::loadParameterMetaDataCall
typedef QPair<int /* FactMetaData::ValueType_t */, QVariant /* Fact::rawValue */> ParamTypeVal;
typedef QMap<QString /* parameter name */, ParamTypeVal> CacheMapName2ParamTypeVal;
QMap<int /* component id */, bool> _debugCacheCRC; ///< true: debug cache crc failure
QMap<int /* component id */, CacheMapName2ParamTypeVal> _debugCacheMap;
QMap<int /* component id */, QMap<QString /* param name */, bool /* seen */>> _debugCacheParamSeen;
// Wait counts from previous parameter update cycle
int _prevWaitingReadParamIndexCount;
int _prevWaitingReadParamNameCount;
......
......@@ -44,11 +44,13 @@ QVariant APMParameterMetaData::_stringToTypedVariant(const QString& string,
case FactMetaData::valueTypeUint8:
case FactMetaData::valueTypeUint16:
case FactMetaData::valueTypeUint32:
case FactMetaData::valueTypeUint64:
convertTo = QVariant::UInt;
break;
case FactMetaData::valueTypeInt8:
case FactMetaData::valueTypeInt16:
case FactMetaData::valueTypeInt32:
case FactMetaData::valueTypeInt64:
convertTo = QVariant::Int;
break;
case FactMetaData::valueTypeFloat:
......@@ -531,12 +533,14 @@ void APMParameterMetaData::addMetaDataToFact(Fact* fact, MAV_TYPE vehicleType)
break;
case FactMetaData::valueTypeInt32:
case FactMetaData::valueTypeInt64:
typedBitSet = QVariant((int)bitSet);
break;
case FactMetaData::valueTypeUint8:
case FactMetaData::valueTypeUint16:
case FactMetaData::valueTypeUint32:
case FactMetaData::valueTypeUint64:
typedBitSet = QVariant(bitSet);
break;
......
......@@ -492,6 +492,18 @@ const QVariantList& FirmwarePlugin::cameraList(const Vehicle* vehicle)
0.8, // minTriggerInterval
this);
_cameraList.append(QVariant::fromValue(metaData));
metaData = new CameraMetaData(tr("GoPro Hero 4"),
6.17, // sensorWidth
4.55, // sendsorHeight
4000, // imageWidth
3000, // imageHeight
2.98, // focalLength
true, // landscape
false, // fixedOrientation
0, // minTriggerInterval
this);
_cameraList.append(QVariant::fromValue(metaData));
}
return _cameraList;
......
......@@ -43,11 +43,10 @@ public:
/// Set of optional capabilites which firmware may support
typedef enum {
SetFlightModeCapability = 1 << 0, ///< FirmwarePlugin::setFlightMode method is supported
MavCmdPreflightStorageCapability = 1 << 1, ///< MAV_CMD_PREFLIGHT_STORAGE is supported
PauseVehicleCapability = 1 << 2, ///< Vehicle supports pausing at current location
GuidedModeCapability = 1 << 3, ///< Vehicle supports guided mode commands
OrbitModeCapability = 1 << 4, ///< Vehicle supports orbit mode
TakeoffVehicleCapability = 1 << 5, ///< Vehicle supports guided takeoff
PauseVehicleCapability = 1 << 1, ///< Vehicle supports pausing at current location
GuidedModeCapability = 1 << 2, ///< Vehicle supports guided mode commands
OrbitModeCapability = 1 << 3, ///< Vehicle supports orbit mode
TakeoffVehicleCapability = 1 << 4, ///< Vehicle supports guided takeoff
} FirmwareCapabilities;
/// Maps from on parameter name to another
......
......@@ -227,7 +227,7 @@ int PX4FirmwarePlugin::manualControlReservedButtonCount(void)
bool PX4FirmwarePlugin::isCapable(const Vehicle *vehicle, FirmwareCapabilities capabilities)
{
int available = MavCmdPreflightStorageCapability | SetFlightModeCapability | PauseVehicleCapability | GuidedModeCapability;
int available = SetFlightModeCapability | PauseVehicleCapability | GuidedModeCapability;
if (vehicle->multiRotor() || vehicle->vtol()) {
available |= TakeoffVehicleCapability;
}
......
......@@ -44,11 +44,13 @@ QVariant PX4ParameterMetaData::_stringToTypedVariant(const QString& string, Fact
case FactMetaData::valueTypeUint8:
case FactMetaData::valueTypeUint16:
case FactMetaData::valueTypeUint32:
case FactMetaData::valueTypeUint64:
convertTo = QVariant::UInt;
break;
case FactMetaData::valueTypeInt8:
case FactMetaData::valueTypeInt16:
case FactMetaData::valueTypeInt32:
case FactMetaData::valueTypeInt64:
convertTo = QVariant::Int;
break;
case FactMetaData::valueTypeFloat:
......
......@@ -94,6 +94,20 @@ QGCView {
QGroundControl.saveBoolGlobalSetting(_PIPVisibleKey, state)
}
function isInstrumentRight() {
if(QGroundControl.corePlugin.options.instrumentWidget) {
if(QGroundControl.corePlugin.options.instrumentWidget.source.toString().length) {
switch(QGroundControl.corePlugin.options.instrumentWidget.widgetPosition) {
case CustomInstrumentWidget.POS_TOP_LEFT:
case CustomInstrumentWidget.POS_BOTTOM_LEFT:
case CustomInstrumentWidget.POS_CENTER_LEFT:
return false;
}
}
}
return true;
}
PlanMasterController {
id: masterController
Component.onCompleted: start(false /* editMode */)
......@@ -447,8 +461,10 @@ QGCView {
ToolStrip {
visible: (_activeVehicle ? _activeVehicle.guidedModeSupported : true) && !QGroundControl.videoManager.fullScreen
id: toolStrip
anchors.leftMargin: ScreenTools.defaultFontPixelWidth
anchors.left: _panel.left
anchors.leftMargin: isInstrumentRight() ? ScreenTools.defaultFontPixelWidth : undefined
anchors.left: isInstrumentRight() ? _panel.left : undefined
anchors.rightMargin:isInstrumentRight() ? undefined : ScreenTools.defaultFontPixelWidth
anchors.right: isInstrumentRight() ? undefined : _panel.right
anchors.topMargin: ScreenTools.toolbarHeight + (_margins * 2)
anchors.top: _panel.top
z: _panel.z + 4
......
......@@ -162,7 +162,7 @@ FlightMap {
onNewItemsFromVehicle: {
var visualItems = _missionController.visualItems
if (visualItems && visualItems.count != 1) {
if (visualItems && visualItems.count !== 1) {
mapFitFunctions.fitMapViewportToMissionItems()
firstVehiclePositionReceived = true
}
......
......@@ -55,6 +55,27 @@ Item {
if(QGroundControl.corePlugin.options.instrumentWidget) {
if(QGroundControl.corePlugin.options.instrumentWidget.source.toString().length) {
instrumentsLoader.source = QGroundControl.corePlugin.options.instrumentWidget.source
switch(QGroundControl.corePlugin.options.instrumentWidget.widgetPosition) {
case CustomInstrumentWidget.POS_TOP_LEFT:
instrumentsLoader.state = "topLeftMode"
break;
case CustomInstrumentWidget.POS_BOTTOM_LEFT:
instrumentsLoader.state = "bottomLeftMode"
break;
case CustomInstrumentWidget.POS_CENTER_LEFT:
instrumentsLoader.state = "centerLeftMode"
break;
case CustomInstrumentWidget.POS_TOP_RIGHT:
instrumentsLoader.state = "topRightMode"
break;
case CustomInstrumentWidget.POS_BOTTOM_RIGHT:
instrumentsLoader.state = "bottomRightMode"
break;
case CustomInstrumentWidget.POS_CENTER_RIGHT:
default:
instrumentsLoader.state = "centerRightMode"
break;
}
} else {
// Note: We currently show alternate instruments all the time. This is a trial change for daily builds.
// Leaving non-alternate code in for now in case the trial fails.
......@@ -63,6 +84,7 @@ Item {
instrumentsLoader.source = "qrc:/qml/QGCInstrumentWidgetAlternate.qml"
} else {
instrumentsLoader.source = "qrc:/qml/QGCInstrumentWidget.qml"
instrumentsLoader.state = QGroundControl.settingsManager.appSettings.showLargeCompass.value === 1 ? "centerRightMode" : "topRightMode"
}
}
} else {
......@@ -133,6 +155,11 @@ Item {
anchors.top: parent.top
anchors.topMargin: QGroundControl.corePlugin.options.instrumentWidget.widgetTopMargin + (ScreenTools.defaultFontPixelHeight * 0.5)
anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5
//-- Instrument Panel
Loader {
id: instrumentsLoader
anchors.margins: ScreenTools.defaultFontPixelHeight / 2
anchors.right: parent.right
//-------------------------------------------------------
// Airmap Airspace Control
......@@ -151,5 +178,76 @@ Item {
property var qgcView: widgetRoot.qgcView
property real maxHeight: widgetRoot ? widgetRoot.height - instrumentsColumn.y - airspaceControl.height - (ScreenTools.defaultFontPixelHeight * 4) : 0
}
z: QGroundControl.zOrderWidgets
property var qgcView: _root.qgcView
property real maxHeight:parent.height - (anchors.margins * 2)
states: [
State {
name: "topRightMode"
AnchorChanges {
target: instrumentsLoader
anchors.verticalCenter: undefined
anchors.bottom: undefined
anchors.top: _root ? _root.top : undefined
anchors.right: _root ? _root.right : undefined
anchors.left: undefined
}
},
State {
name: "centerRightMode"
AnchorChanges {
target: instrumentsLoader
anchors.top: undefined
anchors.bottom: undefined
anchors.verticalCenter: _root ? _root.verticalCenter : undefined
anchors.right: _root ? _root.right : undefined
anchors.left: undefined
}
},
State {
name: "bottomRightMode"
AnchorChanges {
target: instrumentsLoader
anchors.top: undefined
anchors.verticalCenter: undefined
anchors.bottom: _root ? _root.bottom : undefined
anchors.right: _root ? _root.right : undefined
anchors.left: undefined
}
},
State {
name: "topLeftMode"
AnchorChanges {
target: instrumentsLoader
anchors.verticalCenter: undefined
anchors.bottom: undefined
anchors.top: _root ? _root.top : undefined
anchors.right: undefined
anchors.left: _root ? _root.left : undefined
}
},
State {
name: "centerLeftMode"
AnchorChanges {
target: instrumentsLoader
anchors.top: undefined
anchors.bottom: undefined
anchors.verticalCenter: _root ? _root.verticalCenter : undefined
anchors.right: undefined
anchors.left: _root ? _root.left : undefined
}
},
State {
name: "bottomLeftMode"
AnchorChanges {
target: instrumentsLoader
anchors.top: undefined
anchors.verticalCenter: undefined
anchors.bottom: _root ? _root.bottom : undefined
anchors.right: undefined
anchors.left: _root ? _root.left : undefined
}
}
]
}
}
......@@ -16,7 +16,7 @@ import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
/// Guided actions confirmation dialog
NoMouseThroughRectangle {
Rectangle {
id: _root
border.color: qgcPal.alertBorder
border.width: 1
......@@ -42,12 +42,34 @@ NoMouseThroughRectangle {
if (hideTrigger) {
hideTrigger = false
altitudeSlider.visible = false
visibleTimer.stop()
visible = false
}
}
function show(immediate) {
if (immediate) {
visible = true
} else {
// We delay showing the confirmation for a small amount in order to any other state
// changes to propogate through the system. This way only the final state shows up.
visibleTimer.restart()
}
}
Timer {
id: visibleTimer
interval: 1000
repeat: false
onTriggered: visible = true
}
QGCPalette { id: qgcPal }
DeadMouseArea {
anchors.fill: parent
}
Column {
id: confirmColumn
anchors.margins: _margins
......
......@@ -17,7 +17,7 @@ import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
/// Dialog showing list of available guided actions
NoMouseThroughRectangle {
Rectangle {
id: _root
width: actionColumn.width + (_margins * 4)
height: actionColumn.height + (_margins * 4)
......@@ -35,6 +35,10 @@ NoMouseThroughRectangle {
QGCPalette { id: qgcPal }
DeadMouseArea {
anchors.fill: parent
}
ColumnLayout {
id: actionColumn
anchors.margins: _root._margins
......
......@@ -185,9 +185,11 @@ Item {
// Called when an action is about to be executed in order to confirm
function confirmAction(actionCode, actionData) {
var showImmediate = true
closeAll()
confirmDialog.action = actionCode
confirmDialog.actionData = actionData
confirmDialog.hideTrigger = true
_actionData = actionData
switch (actionCode) {
case actionArm:
......@@ -219,6 +221,7 @@ Item {
altitudeSlider.visible = true
break;
case actionStartMission:
showImmediate = false
confirmDialog.title = startMissionTitle
confirmDialog.message = startMissionMessage
confirmDialog.hideTrigger = Qt.binding(function() { return !showStartMission })
......@@ -229,11 +232,13 @@ Item {
confirmDialog.hideTrigger = true
break;
case actionContinueMission:
showImmediate = false
confirmDialog.title = continueMissionTitle
confirmDialog.message = continueMissionMessage
confirmDialog.hideTrigger = Qt.binding(function() { return !showContinueMission })
break;
case actionResumeMission:
showImmediate = false
confirmDialog.title = resumeMissionTitle
confirmDialog.message = resumeMissionMessage
confirmDialog.hideTrigger = Qt.binding(function() { return !showResumeMission })
......@@ -308,11 +313,13 @@ Item {
console.warn("Unknown actionCode", actionCode)
return
}
confirmDialog.visible = true
confirmDialog.show(showImmediate)
}
// Executes the specified action
function executeAction(actionCode, actionData) {
var i;
var rgVehicle;
switch (actionCode) {
case actionRTL:
_activeVehicle.guidedModeRTL()
......@@ -336,10 +343,9 @@ Item {
_activeVehicle.startMission()
break
case actionMVStartMission:
var rgVehicle = QGroundControl.multiVehicleManager.vehicles
for (var i=0; i<rgVehicle.count; i++) {
var vehicle = rgVehicle.get(i)
vehicle.startMission()
rgVehicle = QGroundControl.multiVehicleManager.vehicles
for (i = 0; i < rgVehicle.count; i++) {
rgVehicle.get(i).startMission()
}
break
case actionArm:
......@@ -370,10 +376,9 @@ Item {
_activeVehicle.pauseVehicle()
break
case actionMVPause:
var rgVehicle = QGroundControl.multiVehicleManager.vehicles
for (var i=0; i<rgVehicle.count; i++) {
var vehicle = rgVehicle.get(i)
vehicle.pauseVehicle()
rgVehicle = QGroundControl.multiVehicleManager.vehicles
for (i = 0; i < rgVehicle.count; i++) {
rgVehicle.get(i).pauseVehicle()
}
break
case actionVtolTransitionToFwdFlight:
......
......@@ -28,7 +28,7 @@ Item {
QGCPalette { id: qgcPal }
NoMouseThroughRectangle {
Rectangle {
id: mvCommands
anchors.left: parent.left
anchors.right: parent.right
......@@ -37,6 +37,10 @@ Item {
opacity: _rectOpacity
radius: _margin
DeadMouseArea {
anchors.fill: parent
}
Column {
id: mvCommandsColumn
anchors.margins: _margin
......@@ -152,7 +156,7 @@ Item {
QGCButton {
text: "Start Mission"
visible: _vehicle.armed && _vehicle.flightMode != _vehicle.missionFlightMode
visible: _vehicle.armed && _vehicle.flightMode !== _vehicle.missionFlightMode
onClicked: _vehicle.startMission()
}
......@@ -164,13 +168,13 @@ Item {
QGCButton {
text: "RTL"
visible: _vehicle.armed && _vehicle.flightMode != _vehicle.rtlFlightMode
visible: _vehicle.armed && _vehicle.flightMode !== _vehicle.rtlFlightMode
onClicked: _vehicle.flightMode = _vehicle.rtlFlightMode
}
QGCButton {
text: "Take control"
visible: _vehicle.armed && _vehicle.flightMode != _vehicle.takeControlFlightMode
visible: _vehicle.armed && _vehicle.flightMode !== _vehicle.takeControlFlightMode
onClicked: _vehicle.flightMode = _vehicle.takeControlFlightMode
}
} // Row
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 288 288" enable-background="new 0 0 288 288" xml:space="preserve">
<line fill="none" stroke="#FFFFFF" stroke-width="4" x1="143.999" y1="36.793" x2="143.999" y2="18.793"/>
<line fill="none" stroke="#FFFFFF" stroke-width="4" x1="171.739" y1="40.458" x2="176.398" y2="23.072"/>
<line fill="none" stroke="#FFFFFF" stroke-width="4" x1="197.586" y1="51.179" x2="206.586" y2="35.591"/>
<line fill="none" stroke="#FFFFFF" stroke-width="4" x1="219.777" y1="68.224" x2="232.505" y2="55.496"/>
<line fill="none" stroke="#FFFFFF" stroke-width="4" x1="236.801" y1="90.432" x2="252.389" y2="81.432"/>
<line fill="none" stroke="#FFFFFF" stroke-width="4" x1="116.254" y1="40.431" x2="111.596" y2="23.045"/>
<line fill="none" stroke="#FFFFFF" stroke-width="4" x1="90.397" y1="51.127" x2="81.397" y2="35.539"/>
<line fill="none" stroke="#FFFFFF" stroke-width="4" x1="68.189" y1="68.151" x2="55.461" y2="55.423"/>
<line fill="none" stroke="#FFFFFF" stroke-width="4" x1="51.144" y1="90.342" x2="35.556" y2="81.342"/>
<rect x="135" y="270" fill="none" width="18" height="18"/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 288 288" style="enable-background:new 0 0 288 288;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;stroke:#FFFFFF;stroke-width:4;}
.st1{fill:none;stroke:#FFFFFF;stroke-miterlimit:10;}
</style>
<g id="Layer_2">
<line class="st0" x1="144" y1="45.8" x2="144" y2="18.8"/>
<line class="st0" x1="171.7" y1="40.5" x2="176.4" y2="23.1"/>
<line class="st0" x1="197.6" y1="51.2" x2="206.6" y2="35.6"/>
<line class="st0" x1="219.8" y1="68.2" x2="232.5" y2="55.5"/>
<line class="st0" x1="236.8" y1="90.4" x2="252.4" y2="81.4"/>
<line class="st0" x1="116.3" y1="40.4" x2="111.6" y2="23"/>
<line class="st0" x1="90.4" y1="51.1" x2="81.4" y2="35.5"/>
<line class="st0" x1="68.2" y1="68.2" x2="55.5" y2="55.4"/>
<line class="st0" x1="51.1" y1="90.3" x2="35.6" y2="81.3"/>
<rect x="135" y="270" class="st1" width="18" height="18"/>
</g>
<g id="Layer_3">
</g>
</svg>
......@@ -29,9 +29,9 @@ Item {
Component.onCompleted: {
var controlUrl = object.url
if (controlUrl != "") {
if (controlUrl !== "") {
var component = Qt.createComponent(controlUrl);
if (component.status == Component.Ready) {
if (component.status === Component.Ready) {
_customObject = component.createObject(map, { "customMapObject": object })
if (_customObject) {
map.addMapItem(_customObject)
......
......@@ -233,7 +233,7 @@ Item {
var clickCoordinate = map.toCoordinate(Qt.point(mouse.x, mouse.y), false /* clipToViewPort */)
var polygonPath = _newPolygon.path
if (polygonPath.length == 0) {
if (polygonPath.length === 0) {
// Add first coordinate
polygonPath.push(clickCoordinate)
} else {
......@@ -252,10 +252,10 @@ Item {
_currentPolygon.path = polygonPath
_newPolygon.path = polygonPath
if (_mobile && _currentPolygon.path.length == 1) {
if (_mobile && _currentPolygon.path.length === 1) {
_mobilePoint.coordinate = _currentPolygon.path[0]
_mobilePoint.visible = true
} else if (_mobile && _currentPolygon.path.length == 2) {
} else if (_mobile && _currentPolygon.path.length === 2) {
// Show initial line segment on mobile
_mobileSegment.path = [ _currentPolygon.path[0], _currentPolygon.path[1] ]
_mobileSegment.visible = true
......
......@@ -115,7 +115,7 @@ Item {
var rightCoord = mapControl.toCoordinate(Qt.point(scaleLinePixelLength, scale.y), false /* clipToViewPort */)
var scaleLineMeters = Math.round(leftCoord.distanceTo(rightCoord))
if (QGroundControl.settingsManager.unitsSettings.distanceUnits.value == UnitsSettings.DistanceUnitsFeet) {
if (QGroundControl.settingsManager.unitsSettings.distanceUnits.value === UnitsSettings.DistanceUnitsFeet) {
calculateFeetRatio(scaleLineMeters, scaleLinePixelLength)
} else {
calculateMetersRatio(scaleLineMeters, scaleLinePixelLength)
......
......@@ -61,7 +61,7 @@ DropButton {
/// Fits the visible region of the map to inclues all of the specified coordinates. If no coordinates
/// are specified the map will center to fitHomePosition()
function fitMapViewportToAllCoordinates(coordList) {
if (coordList.length == 0) {
if (coordList.length === 0) {
map.center = fitHomePosition()
return
}
......@@ -115,16 +115,17 @@ DropButton {
}
function addFenceItemCoordsForFit(coordList) {
var i
var homePosition = fitHomePosition()
if (homePosition.isValid && geoFenceController.circleEnabled) {
var azimuthList = [ 0, 180, 90, 270 ]
for (var i=0; i<azimuthList.length; i++) {
for (i = 0; i < azimuthList.length; i++) {
var edgeCoordinate = homePosition.atDistanceAndAzimuth(geoFenceController.circleRadius, azimuthList[i])
coordList.push(edgeCoordinate)
}
}
if (geoFenceController.polygonEnabled && geoFenceController.polygon.count() > 2) {
for (var i=0; i<geoFenceController.polygon.count(); i++) {
for (i = 0; i < geoFenceController.polygon.count(); i++) {
coordList.push(geoFenceController.polygon.path[i])
}
}
......
......@@ -49,7 +49,7 @@ Item {
/// are specified the map will center to fitHomePosition()
function fitMapViewportToAllCoordinates(coordList) {
var mapFitViewport = Qt.rect(0, 0, map.width, map.height)
if (coordList.length == 0) {
if (coordList.length === 0) {
var homeCoord = fitHomePosition()
if (homeCoord.isValid) {
map.center = homeCoord
......@@ -113,16 +113,17 @@ Item {
}
function addFenceItemCoordsForFit(coordList) {
var i
var homePosition = fitHomePosition()
if (homePosition.isValid && _geoFenceController.circleEnabled) {
var azimuthList = [ 0, 180, 90, 270 ]
for (var i=0; i<azimuthList.length; i++) {
for (i = 0; i < azimuthList.length; i++) {
var edgeCoordinate = homePosition.atDistanceAndAzimuth(_geoFenceController.circleRadius, azimuthList[i])
coordList.push(edgeCoordinate)
}
}
if (_geoFenceController.polygonEnabled && _geoFenceController.mapPolygon.path.count > 2) {
for (var i=0; i<_geoFenceController.mapPolygon.path.count; i++) {
for (i = 0; i < _geoFenceController.mapPolygon.path.count; i++) {
coordList.push(_geoFenceController.mapPolygon.path[i])
}
}
......
......@@ -174,8 +174,8 @@ Column {
anchors.right: parent.right
sourceComponent: factGroupList
property var factGroup: _activeVehicle
property var factGroupName: "Vehicle"
property var factGroup: _activeVehicle
property string factGroupName: "Vehicle"
}
}
}
......
......@@ -32,6 +32,11 @@ const char* Joystick::_roverTXModeSettingsKey = "TXMode_Rover";
const char* Joystick::_vtolTXModeSettingsKey = "TXMode_VTOL";
const char* Joystick::_submarineTXModeSettingsKey = "TXMode_Submarine";
const char* Joystick::_buttonActionArm = QT_TR_NOOP("Arm");
const char* Joystick::_buttonActionDisarm = QT_TR_NOOP("Disarm");
const char* Joystick::_buttonActionVTOLFixedWing = QT_TR_NOOP("VTOL: Fixed Wing");
const char* Joystick::_buttonActionVTOLMultiRotor = QT_TR_NOOP("VTOL: Multi-Rotor");
const char* Joystick::_rgFunctionSettingsKey[Joystick::maxFunction] = {
"RollAxis",
"PitchAxis",
......@@ -49,7 +54,7 @@ Joystick::Joystick(const QString& name, int axisCount, int buttonCount, int hatC
, _hatCount(hatCount)
, _hatButtonCount(4*hatCount)
, _totalButtonCount(_buttonCount+_hatButtonCount)
, _calibrationMode(CalibrationModeOff)
, _calibrationMode(false)
, _rgAxisValues(NULL)
, _rgCalibration(NULL)
, _rgButtonValues(NULL)
......@@ -84,6 +89,10 @@ Joystick::Joystick(const QString& name, int axisCount, int buttonCount, int hatC
Joystick::~Joystick()
{
// Crash out of the thread if it is still running
terminate();
wait();
delete[] _rgAxisValues;
delete[] _rgCalibration;
delete[] _rgButtonValues;
......@@ -431,7 +440,7 @@ void Joystick::run(void)
}
}
if (_calibrationMode != CalibrationModeCalibrating && _calibrated) {
if (_outputEnabled && _calibrated) {
int axis = _rgFunctionAxis[rollFunction];
float roll = _adjustRange(_rgAxisValues[axis], _rgCalibration[axis], _deadband);
......@@ -638,11 +647,12 @@ QStringList Joystick::actions(void)
{
QStringList list;
list << "Arm" << "Disarm";
list << _buttonActionArm << _buttonActionDisarm;
if (_activeVehicle) {
list << _activeVehicle->flightModes();
}
list << _buttonActionVTOLFixedWing << _buttonActionVTOLMultiRotor;
return list;
}
......@@ -757,48 +767,44 @@ void Joystick::setDeadband(bool deadband)
_saveSettings();
}
void Joystick::startCalibrationMode(CalibrationMode_t mode)
void Joystick::setCalibrationMode(bool calibrating)
{
if (mode == CalibrationModeOff) {
qWarning() << "Incorrect mode CalibrationModeOff";
return;
}
_calibrationMode = calibrating;
_calibrationMode = mode;
if (!isRunning()) {
if (calibrating && !isRunning()) {
_pollingStartedForCalibration = true;
startPolling(_multiVehicleManager->activeVehicle());
}
}
void Joystick::stopCalibrationMode(CalibrationMode_t mode)
{
if (mode == CalibrationModeOff) {
qWarning() << "Incorrect mode: CalibrationModeOff";
return;
else if (_pollingStartedForCalibration) {
stopPolling();
}
if (mode == CalibrationModeCalibrating) {
_calibrationMode = CalibrationModeMonitor;
} else {
_calibrationMode = CalibrationModeOff;
if (_pollingStartedForCalibration) {
stopPolling();
}
if (calibrating){
setOutputEnabled(false); //Disable the joystick output before calibrating
}
else if (!calibrating && _calibrated){
setOutputEnabled(true); //Enable joystick output after calibration
}
}
void Joystick::setOutputEnabled(bool enabled){
_outputEnabled = enabled;
emit outputEnabledChanged(_outputEnabled);
}
void Joystick::_buttonAction(const QString& action)
{
if (!_activeVehicle || !_activeVehicle->joystickEnabled()) {
return;
}
if (action == "Arm") {
if (action == _buttonActionArm) {
_activeVehicle->setArmed(true);
} else if (action == "Disarm") {
} else if (action == _buttonActionDisarm) {
_activeVehicle->setArmed(false);
} else if (action == _buttonActionVTOLFixedWing) {
_activeVehicle->setVtolInFwdFlight(true);
} else if (action == _buttonActionVTOLMultiRotor) {
_activeVehicle->setVtolInFwdFlight(false);
} else if (_activeVehicle->flightModes().contains(action)) {
_activeVehicle->setFlightMode(action);
} else {
......
......@@ -61,6 +61,7 @@ public:
Q_PROPERTY(QString name READ name CONSTANT)
Q_PROPERTY(bool calibrated MEMBER _calibrated NOTIFY calibratedChanged)
Q_PROPERTY(bool outputEnabled MEMBER _outputEnabled WRITE setOutputEnabled NOTIFY outputEnabledChanged)
Q_PROPERTY(int totalButtonCount READ totalButtonCount CONSTANT)
Q_PROPERTY(int axisCount READ axisCount CONSTANT)
......@@ -122,20 +123,13 @@ public:
void setTXMode(int mode);
int getTXMode(void) { return _transmitterMode; }
typedef enum {
CalibrationModeOff, // Not calibrating
CalibrationModeMonitor, // Monitors are active, continue to send to vehicle if already polling
CalibrationModeCalibrating, // Calibrating, stop sending joystick to vehicle
} CalibrationMode_t;
/// Set the current calibration mode
void startCalibrationMode(CalibrationMode_t mode);
/// Clear the current calibration mode
void stopCalibrationMode(CalibrationMode_t mode);
void setCalibrationMode(bool calibrating);
void setOutputEnabled(bool enabled);
signals:
void calibratedChanged(bool calibrated);
void outputEnabledChanged(bool enabled);
// The raw signals are only meant for use by calibration
void rawAxisValueChanged(int index, int value);
......@@ -201,7 +195,8 @@ protected:
int _totalButtonCount;
static int _transmitterMode;
CalibrationMode_t _calibrationMode;
bool _calibrationMode;
bool _outputEnabled;
int* _rgAxisValues;
Calibration_t* _rgCalibration;
......@@ -241,6 +236,11 @@ private:
static const char* _vtolTXModeSettingsKey;
static const char* _submarineTXModeSettingsKey;
static const char* _buttonActionArm;
static const char* _buttonActionDisarm;
static const char* _buttonActionVTOLFixedWing;
static const char* _buttonActionVTOLMultiRotor;
private slots:
void _activeVehicleChanged(Vehicle* activeVehicle);
};
......
......@@ -356,6 +356,22 @@ void PlanMasterController::loadFromFile(const QString& filename)
}
}
QJsonDocument PlanMasterController::saveToJson()
{
QJsonObject planJson;
QJsonObject missionJson;
QJsonObject fenceJson;
QJsonObject rallyJson;
JsonHelper::saveQGCJsonFileHeader(planJson, _planFileType, _planFileVersion);
_missionController.save(missionJson);
_geoFenceController.save(fenceJson);
_rallyPointController.save(rallyJson);
planJson[_jsonMissionObjectKey] = missionJson;
planJson[_jsonGeoFenceObjectKey] = fenceJson;
planJson[_jsonRallyPointsObjectKey] = rallyJson;
return QJsonDocument(planJson);
}
void PlanMasterController::saveToFile(const QString& filename)
{
if (filename.isEmpty()) {
......@@ -372,20 +388,7 @@ void PlanMasterController::saveToFile(const QString& filename)
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
qgcApp()->showMessage(tr("Plan save error %1 : %2").arg(filename).arg(file.errorString()));
} else {
QJsonObject planJson;
QJsonObject missionJson;
QJsonObject fenceJson;
QJsonObject rallyJson;
JsonHelper::saveQGCJsonFileHeader(planJson, _planFileType, _planFileVersion);
_missionController.save(missionJson);
_geoFenceController.save(fenceJson);
_rallyPointController.save(rallyJson);
planJson[_jsonMissionObjectKey] = missionJson;
planJson[_jsonGeoFenceObjectKey] = fenceJson;
planJson[_jsonRallyPointsObjectKey] = rallyJson;
QJsonDocument saveDoc(planJson);
QJsonDocument saveDoc = saveToJson();
file.write(saveDoc.toJson());
}
......
......@@ -80,6 +80,8 @@ public:
QStringList saveNameFilters (void) const;
QStringList saveKmlFilters (void) const;
QJsonDocument saveToJson ();
Vehicle* controllerVehicle(void) { return _controllerVehicle; }
Vehicle* managerVehicle(void) { return _managerVehicle; }
......
......@@ -177,8 +177,7 @@ Item {
title: qsTr("Select KML File")
selectExisting: true
nameFilters: [ qsTr("KML files (*.kml)") ]
fileExtension: "kml"
onAcceptedForLoad: {
mapPolygon.loadKMLFile(file)
close()
......
......@@ -300,7 +300,7 @@ private:
static const char* _jsonFixedValueIsAltitudeKey;
static const char* _jsonRefly90DegreesKey;
static const int _hoverAndCaptureDelaySeconds = 2;
static const int _hoverAndCaptureDelaySeconds = 4;
};
#endif
......@@ -39,7 +39,7 @@ Column {
}
gridTypeCombo.model = _cameraList
var knownCameraIndex = gridTypeCombo.find(cameraCalc.cameraName)
if (knownCameraIndex != -1) {
if (knownCameraIndex !== -1) {
gridTypeCombo.currentIndex = knownCameraIndex
} else {
console.log("Internal error: Known camera not found", cameraCalc.cameraName)
......
......@@ -46,7 +46,7 @@ Column {
anchors.left: parent.left
anchors.right: parent.right
spacing: ScreenTools.defaultFontPixelWidth
visible: _camera.cameraAction.rawValue == 1
visible: _camera.cameraAction.rawValue === 1
QGCLabel {
text: qsTr("Time")
......@@ -62,7 +62,7 @@ Column {
anchors.left: parent.left
anchors.right: parent.right
spacing: ScreenTools.defaultFontPixelWidth
visible: _camera.cameraAction.rawValue == 2
visible: _camera.cameraAction.rawValue === 2
QGCLabel {
text: qsTr("Distance")
......
......@@ -154,7 +154,7 @@ QGCFlickable {
QGCLabel {
text: qsTr("None")
visible: polygonSection.checked && myGeoFenceController.polygons.count == 0
visible: polygonSection.checked && myGeoFenceController.polygons.count === 0
}
GridLayout {
......@@ -239,7 +239,7 @@ QGCFlickable {
QGCLabel {
text: qsTr("None")
visible: circleSection.checked && myGeoFenceController.circles.count == 0
visible: circleSection.checked && myGeoFenceController.circles.count === 0
}
GridLayout {
......
This diff is collapsed.
......@@ -36,6 +36,7 @@ Rectangle {
property var _fileExtension: QGroundControl.settingsManager.appSettings.missionFileExtension
property var _appSettings: QGroundControl.settingsManager.appSettings
property bool _waypointsOnlyMode: QGroundControl.corePlugin.options.missionWaypointsOnly
property bool _showCameraSection: !_waypointsOnlyMode || QGroundControl.corePlugin.showAdvancedUI
readonly property string _firmwareLabel: qsTr("Firmware")
readonly property string _vehicleLabel: qsTr("Vehicle")
......@@ -91,6 +92,7 @@ Rectangle {
CameraSection {
id: cameraSection
checked: missionItem.cameraSection.settingsSpecified
visible: _showCameraSection
}
QGCLabel {
......@@ -100,7 +102,7 @@ Rectangle {
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
font.pointSize: ScreenTools.smallFontPointSize
visible: cameraSection.checked
visible: _showCameraSection && cameraSection.checked
}
SectionHeader {
......
......@@ -32,13 +32,13 @@ Rectangle {
property real missionMaxTelemetry: _controllerValid ? planMasterController.missionController.missionMaxTelemetry : NaN
property bool missionDirty: _controllerValid ? planMasterController.missionController.dirty : false
property bool _controllerValid: planMasterController != undefined
property bool _controllerValid: planMasterController !== undefined
property bool _controllerOffline: _controllerValid ? planMasterController.offline : true
property var _controllerDirty: _controllerValid ? planMasterController.dirty : false
property var _controllerSyncInProgress: _controllerValid ? planMasterController.syncInProgress : false
property bool _statusValid: currentMissionItem != undefined
property bool _missionValid: missionItems != undefined
property bool _statusValid: currentMissionItem !== undefined
property bool _missionValid: missionItems !== undefined
property real _dataFontSize: ScreenTools.defaultFontPointSize
property real _largeValueWidth: ScreenTools.defaultFontPixelWidth * 8
......@@ -84,11 +84,8 @@ Rectangle {
}
//-- Eat mouse events, preventing them from reaching toolbar, which is underneath us.
MouseArea {
anchors.fill: parent
onWheel: { wheel.accepted = true; }
onPressed: { mouse.accepted = true; }
onReleased: { mouse.accepted = true; }
DeadMouseArea {
anchors.fill: parent
}
//-- The reason for this Row to be here is so the Logo (Home) button is in the same
......
......@@ -272,7 +272,7 @@ QGCView {
QGCFileDialog {
id: fileDialog
qgcView: _qgcView
property var plan: true
property bool plan: true
folder: QGroundControl.settingsManager.appSettings.missionSavePath
fileExtension: QGroundControl.settingsManager.appSettings.planFileExtension
fileExtension2: QGroundControl.settingsManager.appSettings.missionFileExtension
......
......@@ -18,6 +18,7 @@ Rectangle {
property var controller ///< RallyPointController
property bool _currentItem: rallyPoint ? rallyPoint === controller.currentRallyPoint : false
property color _outerTextColor: _currentItem ? "black" : qgcPal.text
readonly property real _margin: ScreenTools.defaultFontPixelWidth / 2
readonly property real _radius: ScreenTools.defaultFontPixelWidth / 2
......@@ -46,9 +47,10 @@ Rectangle {
anchors.left: indicator.right
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Rally Point")
color: _outerTextColor
}
QGCColoredImage {
Image {
id: hamburger
anchors.rightMargin: _margin
anchors.right: parent.right
......@@ -57,12 +59,14 @@ Rectangle {
height: width
sourceSize.height: height
source: "qrc:/qmlimages/Hamburger.svg"
color: qgcPal.text
MouseArea {
anchors.fill: parent
onClicked: hamburgerMenu.popup()
Menu {
id: hamburgerMenu
MenuItem {
text: qsTr("Delete")
onTriggered: controller.removePoint(rallyPoint)
......@@ -70,7 +74,7 @@ Rectangle {
}
}
}
}
} // Item - titleBar
Rectangle {
id: valuesRect
......
......@@ -45,7 +45,7 @@ Item {
MissionItemIndicatorDrag {
itemCoordinate: rallyPointObject.coordinate
visible: rallyPointObject == myRallyPointController.currentRallyPoint
visible: rallyPointObject === myRallyPointController.currentRallyPoint
property var rallyPointObject
......@@ -67,7 +67,7 @@ Item {
sourceItem: MissionItemIndexLabel {
id: itemIndexLabel
label: qsTr("R", "rally point map item label")
checked: _editingLayer == _layerRallyPoints ? rallyPointObject == myRallyPointController.currentRallyPoint : false
checked: _editingLayer == _layerRallyPoints ? rallyPointObject === myRallyPointController.currentRallyPoint : false
onClicked: myRallyPointController.currentRallyPoint = rallyPointObject
}
......
......@@ -44,7 +44,7 @@ Rectangle {
QGCLabel {
text: object.name
visible: object.name != ""
visible: object.name !== ""
Layout.column: 0
Layout.row: index
}
......
......@@ -46,7 +46,7 @@ Rectangle {
} else {
var index = -1
for (index=0; index<_cameraList.length; index++) {
if (_cameraList[index] == missionItem.camera.value) {
if (_cameraList[index] === missionItem.camera.value) {
break;
}
}
......@@ -243,7 +243,7 @@ Rectangle {
anchors.left: parent.left
anchors.right: parent.right
spacing: _margin
visible: missionItem.manualGrid.value == true
visible: missionItem.manualGrid.value
QGCCheckBox {
id: cameraTriggerDistanceCheckBox
......@@ -273,7 +273,7 @@ Rectangle {
anchors.left: parent.left
anchors.right: parent.right
spacing: _margin
visible: gridTypeCombo.currentIndex != _gridTypeManual
visible: gridTypeCombo.currentIndex !== _gridTypeManual
Row {
spacing: _margin
......@@ -443,7 +443,7 @@ Rectangle {
id: windRoseButton
anchors.verticalCenter: angleText.verticalCenter
iconSource: qgcPal.globalTheme === QGCPalette.Light ? "/res/wind-roseBlack.svg" : "/res/wind-rose.svg"
visible: _vehicle.fixedWing
visible: _vehicle ? _vehicle.fixedWing : false
onClicked: {
windRosePie.angle = Number(gridAngleText.text)
......@@ -522,7 +522,7 @@ Rectangle {
SectionHeader {
id: manualGridHeader
text: qsTr("Grid")
visible: gridTypeCombo.currentIndex == _gridTypeManual
visible: gridTypeCombo.currentIndex === _gridTypeManual
}
GridLayout {
......@@ -547,7 +547,7 @@ Rectangle {
anchors.verticalCenter: manualAngleText.verticalCenter
Layout.columnSpan: 1
iconSource: qgcPal.globalTheme === QGCPalette.Light ? "/res/wind-roseBlack.svg" : "/res/wind-rose.svg"
visible: _vehicle.fixedWing
visible: _vehicle ? _vehicle.fixedWing : false
onClicked: {
var cords = manualWindRoseButton.mapToItem(_root, 0, 0)
......
......@@ -90,6 +90,7 @@ Item {
QGCMapPolygonVisuals {
id: mapPolygonVisuals
qgcView: _root.qgcView
mapControl: map
mapPolygon: _mapPolygon
interactive: _missionItem.isCurrentItem
......
import QtQuick 2.3
import QtQuick.Controls 1.2
MouseArea {
preventStealing:true
hoverEnabled: true
onWheel: { wheel.accepted = true; }
onPressed: { mouse.accepted = true; }
onReleased: { mouse.accepted = true; }
}
......@@ -175,9 +175,9 @@ Item {
id: arrowCanvas
anchors.fill: parent
property var arrowPoint: Qt.point(0, 0)
property var arrowBase1: Qt.point(0, 0)
property var arrowBase2: Qt.point(0, 0)
property point arrowPoint: Qt.point(0, 0)
property point arrowBase1: Qt.point(0, 0)
property point arrowBase2: Qt.point(0, 0)
onPaint: {
var context = getContext("2d")
......
......@@ -124,9 +124,9 @@ Item {
id: arrowCanvas
anchors.fill: parent
property var arrowPoint: Qt.point(0, 0)
property var arrowBase1: Qt.point(0, 0)
property var arrowBase2: Qt.point(0, 0)
property point arrowPoint: Qt.point(0, 0)
property point arrowBase1: Qt.point(0, 0)
property point arrowBase2: Qt.point(0, 0)
onPaint: {
var context = getContext("2d")
......
......@@ -37,13 +37,14 @@ QGCLabel {
function updateFlightModesMenu() {
if (activeVehicle && activeVehicle.flightModeSetAvailable) {
var i;
// Remove old menu items
for (var i = 0; i < flightModesMenuItems.length; i++) {
for (i = 0; i < flightModesMenuItems.length; i++) {
flightModesMenu.removeItem(flightModesMenuItems[i])
}
flightModesMenuItems.length = 0
// Add new items
for (var i = 0; i < activeVehicle.flightModes.length; i++) {
for (i = 0; i < activeVehicle.flightModes.length; i++) {
var menuItem = flightModeMenuItemComponent.createObject(null, { "text": activeVehicle.flightModes[i] })
flightModesMenuItems.push(menuItem)
flightModesMenu.insertItem(i, menuItem)
......
......@@ -68,7 +68,7 @@ QGCViewDialog {
color: qgcPal.button
property var mavCmdInfo: modelData
property var textColor: qgcPal.buttonText
property color textColor: qgcPal.buttonText
Column {
id: commandColumn
......
import QtQuick 2.3
import QtQuick.Controls 1.2
/// This control is used to create a Rectangle control which does not allow mouse events to bleed through to the control
/// which is beneath it.
Rectangle {
MouseArea {
anchors.fill: parent
preventStealing: true
onWheel: { wheel.accepted = true; }
onPressed: { mouse.accepted = true; }
onReleased: { mouse.accepted = true; }
}
}
......@@ -253,7 +253,7 @@ QGCView {
id: valueLabel
width: ScreenTools.defaultFontPixelWidth * 20
color: factRow.modelFact.defaultValueAvailable ? (factRow.modelFact.valueEqualsDefault ? __qgcPal.text : __qgcPal.warningText) : __qgcPal.text
text: factRow.modelFact.enumStrings.length == 0 ? factRow.modelFact.valueString + " " + factRow.modelFact.units : factRow.modelFact.enumStringValue
text: factRow.modelFact.enumStrings.length === 0 ? factRow.modelFact.valueString + " " + factRow.modelFact.units : factRow.modelFact.enumStringValue
clip: true
}
......
......@@ -116,7 +116,7 @@ QGCViewDialog {
QGCTextField {
id: valueField
text: validate ? validateValue : fact.valueString
visible: fact.enumStrings.length == 0 || validate || manualEntry.checked
visible: fact.enumStrings.length === 0 || validate || manualEntry.checked
unitsLabel: fact.units
showUnits: fact.units != ""
Layout.fillWidth: true
......@@ -145,7 +145,7 @@ QGCViewDialog {
visible: _showCombo
model: fact.enumStrings
property bool _showCombo: fact.enumStrings.length != 0 && fact.bitmaskStrings.length == 0 && !validate
property bool _showCombo: fact.enumStrings.length !== 0 && fact.bitmaskStrings.length === 0 && !validate
Component.onCompleted: {
// We can't bind directly to fact.enumIndex since that would add an unknown value
......
......@@ -6,15 +6,14 @@ import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0
Button {
property bool primary: false ///< primary button for a group of buttons
property real pointSize: ScreenTools.defaultFontPointSize ///< Point size for button text
property bool showBorder: _qgcPal.globalTheme === QGCPalette.Light
property bool iconLeft: false
property real backRadius: 0
property real heightFactor: 0.5
activeFocusOnPress: true
property bool primary: false ///< primary button for a group of buttons
property real pointSize: ScreenTools.defaultFontPointSize ///< Point size for button text
property var _qgcPal: QGCPalette { colorGroupEnabled: enabled }
property bool _showHighlight: (pressed | hovered | checked) && !__forceHoverOff
property bool _showBorder: _qgcPal.globalTheme === QGCPalette.Light
// This fixes the issue with button hover where if a Button is near the edge oa QQuickWidget you can
// move the mouse fast enough such that the MouseArea does not trigger an onExited. This is turn
......@@ -25,7 +24,7 @@ Button {
property int __lastGlobalMouseX: 0
property int __lastGlobalMouseY: 0
property int _horizontalPadding: ScreenTools.defaultFontPixelWidth
property int _verticalPadding: Math.round(ScreenTools.defaultFontPixelHeight * heightFactor)
property int _verticalPadding: Math.round(ScreenTools.defaultFontPixelHeight / 2)
Connections {
target: __behavior
......@@ -61,11 +60,9 @@ Button {
/*! This defines the background of the button. */
background: Rectangle {
id: backRect
implicitWidth: ScreenTools.implicitButtonWidth
implicitHeight: ScreenTools.implicitButtonHeight
radius: backRadius
border.width: showBorder ? 1 : 0
border.width: _showBorder ? 1: 0
border.color: _qgcPal.buttonText
color: _showHighlight ?
control._qgcPal.buttonHighlight :
......@@ -74,35 +71,31 @@ Button {
/*! This defines the label of the button. */
label: Item {
implicitWidth: text.implicitWidth + icon.width
implicitHeight: text.implicitHeight
baselineOffset: text.y + text.baselineOffset
implicitWidth: row.implicitWidth
implicitHeight: row.implicitHeight
baselineOffset: row.y + text.y + text.baselineOffset
QGCColoredImage {
id: icon
source: control.iconSource
height: source === "" ? 0 : text.height
width: height
color: text.color
fillMode: Image.PreserveAspectFit
sourceSize.height: height
anchors.left: control.iconLeft ? parent.left : undefined
anchors.leftMargin: control.iconLeft ? ScreenTools.defaultFontPixelWidth : undefined
anchors.right: !control.iconLeft ? parent.right : undefined
anchors.rightMargin: !control.iconLeft ? ScreenTools.defaultFontPixelWidth : undefined
anchors.verticalCenter: parent.verticalCenter
}
Row {
id: row
anchors.centerIn: parent
spacing: ScreenTools.defaultFontPixelWidth * 0.25
Image {
source: control.iconSource
anchors.verticalCenter: parent.verticalCenter
}
Text {
id: text
anchors.centerIn: parent
antialiasing: true
text: control.text
font.pointSize: pointSize
font.family: ScreenTools.normalFontFamily
color: _showHighlight ?
control._qgcPal.buttonHighlightText :
(primary ? control._qgcPal.primaryButtonText : control._qgcPal.buttonText)
Text {
id: text
anchors.verticalCenter: parent.verticalCenter
antialiasing: true
text: control.text
font.pointSize: pointSize
font.family: ScreenTools.normalFontFamily
color: _showHighlight ?
control._qgcPal.buttonHighlightText :
(primary ? control._qgcPal.primaryButtonText : control._qgcPal.buttonText)
}
}
}
}
......
......@@ -6,6 +6,8 @@ import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0
CheckBox {
activeFocusOnPress: true
property var __qgcPal: QGCPalette { colorGroupEnabled: enabled }
style: CheckBoxStyle {
......
......@@ -144,7 +144,7 @@ Item {
QGCLabel {
text: qsTr("No files")
visible: fileList.model.length == 0
visible: fileList.model.length === 0
}
}
}
......
......@@ -11,9 +11,9 @@ Rectangle {
color: parent.indicatorColor
visible: showIndicator
property bool showIndicator: (parent.flickableDirection == Flickable.AutoFlickDirection ||
parent.flickableDirection == Flickable.HorizontalFlick ||
parent.flickableDirection == Flickable.HorizontalAndVerticalFlick) &&
property bool showIndicator: (parent.flickableDirection === Flickable.AutoFlickDirection ||
parent.flickableDirection === Flickable.HorizontalFlick ||
parent.flickableDirection === Flickable.HorizontalAndVerticalFlick) &&
(parent.contentWidth > parent.width)
Component.onCompleted: animateOpacity.restart()
......
......@@ -11,9 +11,9 @@ Rectangle {
color: parent.indicatorColor
visible: showIndicator
property bool showIndicator: (parent.flickableDirection == Flickable.AutoFlickDirection ||
parent.flickableDirection == Flickable.VerticalFlick ||
parent.flickableDirection == Flickable.HorizontalAndVerticalFlick) &&
property bool showIndicator: (parent.flickableDirection === Flickable.AutoFlickDirection ||
parent.flickableDirection === Flickable.VerticalFlick ||
parent.flickableDirection === Flickable.HorizontalAndVerticalFlick) &&
(parent.contentHeight > parent.height)
Component.onCompleted: animateOpacity.restart()
......
......@@ -51,8 +51,8 @@ Item {
anchors.right: parent.right
height: ScreenTools.minTouchPixels
width: height
property var initialX: 0
property var initialWidth: 0
property real initialX: 0
property real initialWidth: 0
onClicked: {
// TODO propagate
......@@ -98,7 +98,7 @@ Item {
}
// Resize pip window if necessary when main window is resized
property var pipLock: 2
property int pipLock: 2
Connections {
target: pip.parent
......
......@@ -58,7 +58,7 @@ FactPanel {
console.log("Error loading QGCViewDialogContainer.qml: ", dialogComponent.errorString())
return
}
var dialogWidth = charWidth == showDialogFullWidth ? parent.width : ScreenTools.defaultFontPixelWidth * charWidth
var dialogWidth = charWidth === showDialogFullWidth ? parent.width : ScreenTools.defaultFontPixelWidth * charWidth
var dialog = dialogComponent.createObject(_rootItem,
{
"anchors.fill": _rootItem,
......
......@@ -27,10 +27,10 @@ FactPanel {
signal hideDialog
Keys.onReleased: {
if (event.key == Qt.Key_Escape) {
if (event.key === Qt.Key_Escape) {
reject()
event.accepted = true
} else if (event.key == Qt.Key_Return || event.key == Qt.Key_Enter) {
} else if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
accept()
event.accepted = true
}
......
......@@ -5,6 +5,7 @@ AppMessages 1.0 AppMessages.qml
CameraCalc 1.0 CameraCalc.qml
CameraSection 1.0 CameraSection.qml
ClickableColor 1.0 ClickableColor.qml
DeadMouseArea 1.0 DeadMouseArea.qml
DropButton 1.0 DropButton.qml
DropPanel 1.0 DropPanel.qml
EditPositionDialog 1.0 EditPositionDialog.qml
......@@ -27,15 +28,11 @@ MissionItemMapVisual 1.0 MissionItemMapVisual.qml
MissionItemStatus 1.0 MissionItemStatus.qml
ModeSwitchDisplay 1.0 ModeSwitchDisplay.qml
MultiRotorMotorDisplay 1.0 MultiRotorMotorDisplay.qml
NoMouseThroughRectangle 1.0 NoMouseThroughRectangle.qml
OfflineMapButton 1.0 OfflineMapButton.qml
PageView 1.0 PageView.qml
ParameterEditor 1.0 ParameterEditor.qml
ParameterEditorDialog 1.0 ParameterEditorDialog.qml
PlanToolBar 1.0 PlanToolBar.qml
RallyPointEditorHeader 1.0 RallyPointEditorHeader.qml
RallyPointItemEditor 1.0 RallyPointItemEditor.qml
RallyPointMapVisuals 1.0 RallyPointMapVisuals.qml
RCChannelMonitor 1.0 RCChannelMonitor.qml
QGCButton 1.0 QGCButton.qml
QGCCheckBox 1.0 QGCCheckBox.qml
QGCColoredImage 1.0 QGCColoredImage.qml
......@@ -45,8 +42,8 @@ QGCFlickable 1.0 QGCFlickable.qml
QGCGroupBox 1.0 QGCGroupBox.qml
QGCLabel 1.0 QGCLabel.qml
QGCListView 1.0 QGCListView.qml
QGCMapLabel 1.0 QGCMapLabel.qml
QGCMapCircleVisuals 1.0 QGCMapCircleVisuals.qml
QGCMapLabel 1.0 QGCMapLabel.qml
QGCMapPolygonVisuals 1.0 QGCMapPolygonVisuals.qml
QGCMapPolylineVisuals 1.0 QGCMapPolylineVisuals.qml
QGCMouseArea 1.0 QGCMouseArea.qml
......@@ -62,6 +59,10 @@ QGCViewDialog 1.0 QGCViewDialog.qml
QGCViewDialogContainer 1.0 QGCViewDialogContainer.qml
QGCViewMessage 1.0 QGCViewMessage.qml
QGCViewPanel 1.0 QGCViewPanel.qml
RallyPointEditorHeader 1.0 RallyPointEditorHeader.qml
RallyPointItemEditor 1.0 RallyPointItemEditor.qml
RallyPointMapVisuals 1.0 RallyPointMapVisuals.qml
RCChannelMonitor 1.0 RCChannelMonitor.qml
RoundButton 1.0 RoundButton.qml
SectionHeader 1.0 SectionHeader.qml
SetupPage 1.0 SetupPage.qml
......@@ -74,4 +75,3 @@ ToolStrip 1.0 ToolStrip.qml
VehicleRotationCal 1.0 VehicleRotationCal.qml
VehicleSummaryRow 1.0 VehicleSummaryRow.qml
ViewWidget 1.0 ViewWidget.qml
OfflineMapButton 1.0 OfflineMapButton.qml
This diff is collapsed.
......@@ -52,6 +52,10 @@ Rectangle {
}
}
DeadMouseArea {
anchors.fill: parent
}
Column {
id: buttonStripColumn
anchors.margins: ScreenTools.defaultFontPixelWidth / 2
......
......@@ -654,11 +654,9 @@ QGCView {
color: Qt.rgba(qgcPal.window.r, qgcPal.window.g, qgcPal.window.b, 0.85)
radius: ScreenTools.defaultFontPixelWidth * 0.5
MouseArea {
anchors.fill: parent
onWheel: { wheel.accepted = true; }
onPressed: { mouse.accepted = true; }
onReleased: { mouse.accepted = true; }
//-- Eat mouse events
DeadMouseArea {
anchors.fill: parent
}
QGCLabel {
......
......@@ -56,7 +56,7 @@ SetupPage {
readonly property int _defaultFimwareTypeAPM: 3
property var _defaultFirmwareFact: QGroundControl.settingsManager.appSettings.defaultFirmwareType
property bool _defaultFirmwareIsPX4: _defaultFirmwareFact.rawValue == _defaultFimwareTypePX4
property bool _defaultFirmwareIsPX4: _defaultFirmwareFact.rawValue === _defaultFimwareTypePX4
property string firmwareWarningMessage
property bool controllerCompleted: false
......@@ -168,7 +168,7 @@ SetupPage {
function accept() {
hideDialog()
if (_singleFirmwareMode) {
controller.flashSingleFirmwareMode()
controller.flashSingleFirmwareMode(controller.selectedFirmwareType)
} else {
var stack = apmFlightStack.checked ? FirmwareUpgradeController.AutoPilotStackAPM : FirmwareUpgradeController.AutoPilotStackPX4
if (px4Flow) {
......@@ -353,14 +353,14 @@ SetupPage {
currentIndex: controller.selectedFirmwareType
onActivated: {
controller.selectedFirmwareType = index
if (model.get(index).firmwareType == FirmwareUpgradeController.BetaFirmware) {
controller.selectedFirmwareType = model.get(index).firmwareType
if (model.get(index).firmwareType === FirmwareUpgradeController.BetaFirmware) {
firmwareVersionWarningLabel.visible = true
firmwareVersionWarningLabel.text = qsTr("WARNING: BETA FIRMWARE. ") +
qsTr("This firmware version is ONLY intended for beta testers. ") +
qsTr("Although it has received FLIGHT TESTING, it represents actively changed code. ") +
qsTr("Do NOT use for normal operation.")
} else if (model.get(index).firmwareType == FirmwareUpgradeController.DeveloperFirmware) {
} else if (model.get(index).firmwareType === FirmwareUpgradeController.DeveloperFirmware) {
firmwareVersionWarningLabel.visible = true
firmwareVersionWarningLabel.text = qsTr("WARNING: CONTINUOUS BUILD FIRMWARE. ") +
qsTr("This firmware has NOT BEEN FLIGHT TESTED. ") +
......
......@@ -114,9 +114,9 @@ void FirmwareUpgradeController::flash(const FirmwareIdentifier& firmwareId)
flash(firmwareId.autopilotStackType, firmwareId.firmwareType, firmwareId.firmwareVehicleType);
}
void FirmwareUpgradeController::flashSingleFirmwareMode(void)
void FirmwareUpgradeController::flashSingleFirmwareMode(FirmwareType_t firmwareType)
{
flash(SingleFirmwareMode, StableFirmware, DefaultVehicleFirmware);
flash(SingleFirmwareMode, firmwareType, DefaultVehicleFirmware);
}
void FirmwareUpgradeController::cancel(void)
......
......@@ -123,7 +123,7 @@ public:
FirmwareVehicleType_t vehicleType = DefaultVehicleFirmware );
/// Called to flash when upgrade is running in singleFirmwareMode
Q_INVOKABLE void flashSingleFirmwareMode(void);
Q_INVOKABLE void flashSingleFirmwareMode(FirmwareType_t firmwareType);
Q_INVOKABLE FirmwareVehicleType_t vehicleTypeFromVersionIndex(int index);
......
......@@ -366,9 +366,15 @@ SetupPage {
id: enabledCheckBox
enabled: _activeJoystick ? _activeJoystick.calibrated : false
text: _activeJoystick ? _activeJoystick.calibrated ? qsTr("Enable joystick input") : qsTr("Enable not allowed (Calibrate First)") : ""
checked: _activeVehicle.joystickEnabled
onClicked: _activeVehicle.joystickEnabled = checked
onClicked: _activeJoystick.outputEnabled = checked
Connections {
target: _activeJoystick
onOutputEnabledChanged: {
enabledCheckBox.checked=enabled
}
}
Connections {
target: joystickManager
......
......@@ -82,7 +82,7 @@ void JoystickConfigController::setDeadbandValue(int axis, int value)
JoystickConfigController::~JoystickConfigController()
{
if(_activeJoystick) {
_activeJoystick->stopCalibrationMode(Joystick::CalibrationModeMonitor);
_activeJoystick->setCalibrationMode(false);
}
}
......@@ -582,7 +582,7 @@ void JoystickConfigController::_writeCalibration(void)
/// @brief Starts the calibration process
void JoystickConfigController::_startCalibration(void)
{
_activeJoystick->startCalibrationMode(Joystick::CalibrationModeCalibrating);
_activeJoystick->setCalibrationMode(true);
_resetInternalCalibrationValues();
_nextButton->setProperty("text", "Next");
......@@ -598,7 +598,7 @@ void JoystickConfigController::_stopCalibration(void)
{
_currentStep = -1;
_activeJoystick->stopCalibrationMode(Joystick::CalibrationModeCalibrating);
_activeJoystick->setCalibrationMode(false);
_setInternalCalibrationValuesFromSettings();
_statusText->setProperty("text", "");
......@@ -763,7 +763,6 @@ void JoystickConfigController::_signalAllAttitudeValueChanges(void)
void JoystickConfigController::_activeJoystickChanged(Joystick* joystick)
{
bool joystickTransition = false;
if (_activeJoystick) {
joystickTransition = true;
disconnect(_activeJoystick, &Joystick::rawAxisValueChanged, this, &JoystickConfigController::_axisValueChanged);
......@@ -781,7 +780,7 @@ void JoystickConfigController::_activeJoystickChanged(Joystick* joystick)
if (joystickTransition) {
_stopCalibration();
}
_activeJoystick->startCalibrationMode(Joystick::CalibrationModeMonitor);
_activeJoystick->setCalibrationMode(false);
_axisCount = _activeJoystick->axisCount();
_rgAxisInfo = new struct AxisInfo[_axisCount];
_axisValueSave = new int[_axisCount];
......
......@@ -128,12 +128,12 @@ Rectangle {
height: width
radius: width / 2
color: modelData.setupComplete ? "#00d932" : "red"
visible: modelData.requiresSetup && modelData.setupSource != ""
visible: modelData.requiresSetup && modelData.setupSource !== ""
}
onClicked : {
console.log(modelData.setupSource)
if (modelData.setupSource != "") {
if (modelData.setupSource !== "") {
setupView.showVehicleComponentPanel(modelData)
}
}
......
......@@ -2,8 +2,10 @@ import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.4
import QGroundControl.Palette 1.0
import QGroundControl.Controllers 1.0
import QGroundControl 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Controllers 1.0
import QGroundControl.Palette 1.0
Rectangle {
property Component connectedComponent: __componentConnected
......
......@@ -121,11 +121,21 @@ class CustomInstrumentWidget : public QObject
{
Q_OBJECT
public:
//-- Widget Position
enum Pos {
POS_TOP_RIGHT,
POS_CENTER_RIGHT,
POS_BOTTOM_RIGHT,
POS_TOP_LEFT,
POS_CENTER_LEFT,
POS_BOTTOM_LEFT
};
Q_ENUMS(Pos)
CustomInstrumentWidget(QObject* parent = NULL);
Q_PROPERTY(QUrl source READ source CONSTANT)
Q_PROPERTY(double widgetTopMargin READ widgetTopMargin NOTIFY widgetTopMarginChanged)
Q_PROPERTY(Pos widgetPosition READ widgetPosition NOTIFY widgetPositionChanged)
virtual QUrl source () { return QUrl(); }
virtual double widgetTopMargin () { return 0.0; }
virtual Pos widgetPosition () { return POS_TOP_RIGHT; }
signals:
void widgetTopMarginChanged();
void widgetPositionChanged ();
};
......@@ -22,7 +22,12 @@ Item {
}
function attemptWindowClose() {
mainWindowInner.item.attemptWindowClose()
try {
mainWindowInner.item.attemptWindowClose()
}
finally {
controller.reallyClose()
}
}
function showMessage(message) {
......
......@@ -296,13 +296,10 @@ Item {
onVtolTransitionToMRFlight: flightView.guidedController.confirmAction(flightView.guidedController.actionVtolTransitionToMRFlight)
//-- Entire tool bar area disable on cammand
MouseArea {
DeadMouseArea {
id: toolbarBlocker
anchors.fill: parent
enabled: false
onWheel: { wheel.accepted = true; }
onPressed: { mouse.accepted = true; }
onReleased: { mouse.accepted = true; }
anchors.fill: parent
}
}
......
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