Commit 2929f008 authored by Gus Grubba's avatar Gus Grubba

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

# Conflicts:
#	src/Vehicle/Vehicle.cc
#	src/api/QGCCorePlugin.cc
parents 587c42a7 70f899c6
# QGroundControl Change Log
Note: This file only contains high level features or important fixes.
## 3.5
### 3.5.0 - Not yet released
* Add ESTIMATOR_STATUS values to new estimatorStatus Vehicle FactGroup. These are now available to display in instrument panel.
## 3.4
### 3.4.1 - Not yet released
* Fix crash when Survery with terrain follow is moved quickly
* Fix terrain follow climb/descent rate fields swapped in ui
......@@ -2,6 +2,7 @@
!include LogicLib.nsh
!include Win\COM.nsh
!include Win\Propkey.nsh
!include "FileFunc.nsh"
!macro DemoteShortCut target
!insertmacro ComHlpr_CreateInProcInstance ${CLSID_ShellLink} ${IID_IShellLink} r0 ""
......@@ -61,7 +62,7 @@ Section
ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString"
StrCmp $R0 "" doinstall
ExecWait "$R0 /S _?=$INSTDIR"
ExecWait "$R0 /S _?=$INSTDIR -LEAVE_DATA=1"
IntCmp $0 0 doinstall
MessageBox MB_OK|MB_ICONEXCLAMATION \
......@@ -104,12 +105,16 @@ done:
SectionEnd
Section "Uninstall"
${GetParameters} $R0
${GetOptions} $R0 "-LEAVE_DATA=" $R1
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
SetShellVarContext all
RMDir /r /REBOOTOK $INSTDIR
RMDir /r /REBOOTOK "$SMPROGRAMS\$StartMenuFolder\"
SetShellVarContext current
RMDir /r /REBOOTOK "$APPDATA\${ORGNAME}\"
${If} $R1 != 1
RMDir /r /REBOOTOK "$APPDATA\${ORGNAME}\"
${Endif}
DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\${EXENAME}.exe"
SectionEnd
......
......@@ -44,29 +44,6 @@ MacBuild {
}
}
iOSBuild {
LIBS += -framework AVFoundation
#-- Info.plist (need an "official" one for the App Store)
ForAppStore {
message(App Store Build)
#-- Create official, versioned Info.plist
APP_STORE = $$system(cd $${BASEDIR} && $${BASEDIR}/tools/update_ios_version.sh $${BASEDIR}/ios/iOSForAppStore-Info-Source.plist $${BASEDIR}/ios/iOSForAppStore-Info.plist)
APP_ERROR = $$find(APP_STORE, "Error")
count(APP_ERROR, 1) {
error("Error building .plist file. 'ForAppStore' builds are only possible through the official build system.")
}
QT += qml-private
QMAKE_INFO_PLIST = $${BASEDIR}/ios/iOSForAppStore-Info.plist
OTHER_FILES += $${BASEDIR}/ios/iOSForAppStore-Info.plist
} else {
QMAKE_INFO_PLIST = $${BASEDIR}/ios/iOS-Info.plist
OTHER_FILES += $${BASEDIR}/ios/iOS-Info.plist
}
QMAKE_ASSET_CATALOGS += ios/Images.xcassets
BUNDLE.files = ios/QGCLaunchScreen.xib $$QMAKE_INFO_PLIST
QMAKE_BUNDLE_DATA += BUNDLE
}
LinuxBuild {
CONFIG += qesp_linux_udev
}
......@@ -132,6 +109,36 @@ WindowsBuild {
QMAKE_TARGET_PRODUCT = "$${QGC_APP_NAME}"
}
#-------------------------------------------------------------------------------------
# iOS
iOSBuild {
contains (CONFIG, DISABLE_BUILTIN_IOS) {
message("Skipping builtin support for iOS")
} else {
LIBS += -framework AVFoundation
#-- Info.plist (need an "official" one for the App Store)
ForAppStore {
message(App Store Build)
#-- Create official, versioned Info.plist
APP_STORE = $$system(cd $${BASEDIR} && $${BASEDIR}/tools/update_ios_version.sh $${BASEDIR}/ios/iOSForAppStore-Info-Source.plist $${BASEDIR}/ios/iOSForAppStore-Info.plist)
APP_ERROR = $$find(APP_STORE, "Error")
count(APP_ERROR, 1) {
error("Error building .plist file. 'ForAppStore' builds are only possible through the official build system.")
}
QT += qml-private
QMAKE_INFO_PLIST = $${BASEDIR}/ios/iOSForAppStore-Info.plist
OTHER_FILES += $${BASEDIR}/ios/iOSForAppStore-Info.plist
} else {
QMAKE_INFO_PLIST = $${BASEDIR}/ios/iOS-Info.plist
OTHER_FILES += $${BASEDIR}/ios/iOS-Info.plist
}
QMAKE_ASSET_CATALOGS += ios/Images.xcassets
BUNDLE.files = ios/QGCLaunchScreen.xib $$QMAKE_INFO_PLIST
QMAKE_BUNDLE_DATA += BUNDLE
}
}
#
# Plugin configuration
#
......
......@@ -237,6 +237,7 @@
<file alias="Vehicle/BatteryFact.json">src/Vehicle/BatteryFact.json</file>
<file alias="Vehicle/ClockFact.json">src/Vehicle/ClockFact.json</file>
<file alias="Vehicle/DistanceSensorFact.json">src/Vehicle/DistanceSensorFact.json</file>
<file alias="Vehicle/EstimatorStatusFactGroup.json">src/Vehicle/EstimatorStatusFactGroup.json</file>
<file alias="Vehicle/GPSFact.json">src/Vehicle/GPSFact.json</file>
<file alias="Vehicle/GPSRTKFact.json">src/Vehicle/GPSRTKFact.json</file>
<file alias="Vehicle/SetpointFact.json">src/Vehicle/SetpointFact.json</file>
......
......@@ -159,8 +159,8 @@ bool ExifParser::write(QByteArray& buf, GeoTagWorker::cameraFeedbackPacket& geot
gpsData.readable.fields.gpsLon.content = gpsDataExtInd + 6 * 4;
gpsData.readable.fields.gpsAltRef.tagID = 5;
gpsData.readable.fields.gpsAltRef.type = 2;
gpsData.readable.fields.gpsAltRef.size = 2;
gpsData.readable.fields.gpsAltRef.type = 1;
gpsData.readable.fields.gpsAltRef.size = 1;
gpsData.readable.fields.gpsAltRef.content = 0x00;
gpsData.readable.fields.gpsAlt.tagID = 6;
......
......@@ -132,10 +132,8 @@ Item {
onResetStatusTextArea: statusLog.text = statusTextAreaDefaultText
onMagCalComplete: {
//if (!_sensorsHaveFixedOrientation && (showCompass0Rot || showCompass1Rot || showCompass2Rot)) {
setOrientationsDialogShowBoardOrientation = false
showDialog(setOrientationsDialogComponent, qsTr("Compass Calibration Complete"), qgcView.showDialogDefaultWidth, StandardButton.Ok)
//}
setOrientationsDialogShowBoardOrientation = false
showDialog(setOrientationsDialogComponent, qsTr("Compass Calibration Complete"), qgcView.showDialogDefaultWidth, StandardButton.Ok)
}
onWaitingForCancelChanged: {
......@@ -255,7 +253,9 @@ Item {
QGCLabel {
width: parent.width
wrapMode: Text.WordWrap
text: qsTr("Set your compass orientations below and the make sure to reboot the vehicle prior to flight.")
text: _sensorsHaveFixedOrientation ?
qsTr("Make sure to reboot the vehicle prior to flight.") :
qsTr("Set your compass orientations below and the make sure to reboot the vehicle prior to flight.")
}
QGCButton {
......@@ -270,6 +270,7 @@ Item {
width: parent.width
wrapMode: Text.WordWrap
text: boardRotationText
visible: !_sensorsHaveFixedOrientation
}
Column {
......@@ -287,8 +288,10 @@ Item {
}
}
// Compass 0 rotation
Column {
// Compass 0 rotation
visible: !_sensorsHaveFixedOrientation
Component {
id: compass0ComponentLabel2
......@@ -312,8 +315,10 @@ Item {
Loader { sourceComponent: showCompass0Rot ? compass0ComponentCombo2 : null }
}
// Compass 1 rotation
Column {
// Compass 1 rotation
visible: !_sensorsHaveFixedOrientation
Component {
id: compass1ComponentLabel2
......@@ -337,10 +342,11 @@ Item {
Loader { sourceComponent: showCompass1Rot ? compass1ComponentCombo2 : null }
}
// Compass 2 rotation
Column {
visible: !_sensorsHaveFixedOrientation
spacing: ScreenTools.defaultFontPixelWidth
// Compass 2 rotation
Component {
id: compass2ComponentLabel2
......
......@@ -310,6 +310,9 @@ QString Fact::_variantToString(const QVariant& variant, int decimalPlaces) const
}
}
break;
case FactMetaData::valueTypeBool:
valueString = variant.toBool() ? tr("true") : tr("false");
break;
case FactMetaData::valueTypeElapsedTimeInSeconds:
{
double dValue = variant.toDouble();
......
......@@ -1207,7 +1207,7 @@ QMap<QString, FactMetaData*> FactMetaData::createMapFromJsonFile(const QString&
QJsonParseError jsonParseError;
QJsonDocument doc = QJsonDocument::fromJson(bytes, &jsonParseError);
if (jsonParseError.error != QJsonParseError::NoError) {
qWarning() << "Unable to parse json document" << jsonFilename << jsonParseError.errorString();
qWarning() << "Unable to parse json document filename:error:offset" << jsonFilename << jsonParseError.errorString() << jsonParseError.offset;
return metaDataMap;
}
......
......@@ -285,7 +285,7 @@ QList<MAV_CMD> PX4FirmwarePlugin::supportedMissionCommands(void)
list << MAV_CMD_NAV_WAYPOINT
<< MAV_CMD_NAV_LOITER_UNLIM << MAV_CMD_NAV_LOITER_TIME << MAV_CMD_NAV_LOITER_TO_ALT
<< MAV_CMD_NAV_LAND << MAV_CMD_NAV_TAKEOFF
<< MAV_CMD_NAV_LAND << MAV_CMD_NAV_TAKEOFF << MAV_CMD_NAV_RETURN_TO_LAUNCH
<< MAV_CMD_DO_JUMP
<< MAV_CMD_DO_VTOL_TRANSITION << MAV_CMD_NAV_VTOL_TAKEOFF << MAV_CMD_NAV_VTOL_LAND
<< MAV_CMD_DO_DIGICAM_CONTROL
......
......@@ -43,12 +43,10 @@ Item {
QGCPalette { id: qgcPal }
function getPreferredInstrumentWidth() {
if(ScreenTools.isMobile) {
return mainWindow.width * 0.25
} else if(ScreenTools.isHugeScreen) {
return mainWindow.width * 0.11
}
return ScreenTools.defaultFontPixelWidth * 30
// Don't allow instrument panel to chew more than 1/4 of full window
var defaultWidth = ScreenTools.defaultFontPixelWidth * 30
var maxWidth = mainWindow.width * 0.25
return Math.min(maxWidth, defaultWidth)
}
function _setInstrumentWidget() {
......
......@@ -58,8 +58,8 @@ const int MissionController::_missionFileVersion = 2;
MissionController::MissionController(PlanMasterController* masterController, QObject *parent)
: PlanElementController (masterController, parent)
, _missionManager (_managerVehicle->missionManager())
, _visualItems (NULL)
, _settingsItem (NULL)
, _visualItems (nullptr)
, _settingsItem (nullptr)
, _firstItemsFromVehicle (false)
, _itemsRequested (false)
, _inRecalcSequence (false)
......@@ -70,7 +70,7 @@ MissionController::MissionController(PlanMasterController* masterController, QOb
, _appSettings (qgcApp()->toolbox()->settingsManager()->appSettings())
, _progressPct (0)
, _currentPlanViewIndex (-1)
, _currentPlanViewItem (NULL)
, _currentPlanViewItem (nullptr)
{
_resetMissionFlightStatus();
managerVehicleChanged(_managerVehicle);
......@@ -113,7 +113,7 @@ void MissionController::_resetMissionFlightStatus(void)
_controllerVehicle->firmwarePlugin()->batteryConsumptionData(_controllerVehicle, _missionFlightStatus.mAhBattery, _missionFlightStatus.hoverAmps, _missionFlightStatus.cruiseAmps);
if (_missionFlightStatus.mAhBattery != 0) {
double batteryPercentRemainingAnnounce = qgcApp()->toolbox()->settingsManager()->appSettings()->batteryPercentRemainingAnnounce()->rawValue().toDouble();
_missionFlightStatus.ampMinutesAvailable = (double)_missionFlightStatus.mAhBattery / 1000.0 * 60.0 * ((100.0 - batteryPercentRemainingAnnounce) / 100.0);
_missionFlightStatus.ampMinutesAvailable = static_cast<double>(_missionFlightStatus.mAhBattery) / 1000.0 * 60.0 * ((100.0 - batteryPercentRemainingAnnounce) / 100.0);
}
emit missionDistanceChanged(_missionFlightStatus.totalDistance);
......@@ -186,8 +186,8 @@ void MissionController::_newMissionItemsAvailableFromVehicle(bool removeAllReque
_deinitAllVisualItems();
_visualItems->deleteLater();
_settingsItem = NULL;
_visualItems = NULL;
_settingsItem = nullptr;
_visualItems = nullptr;
_updateContainsItems(); // This will clear containsItems which will be set again below. This will re-pop Start Mission confirmation.
_visualItems = newControllerMissionItems;
......@@ -353,20 +353,19 @@ int MissionController::insertSimpleMissionItem(QGeoCoordinate coordinate, int i)
newItem->setCoordinate(coordinate);
newItem->setCommand(MAV_CMD_NAV_WAYPOINT);
_initVisualItem(newItem);
if (_visualItems->count() == 1) {
if (_visualItems->count() == 1 && (_controllerVehicle->fixedWing() || _controllerVehicle->vtol() || _controllerVehicle->multiRotor())) {
MAV_CMD takeoffCmd = _controllerVehicle->vtol() ? MAV_CMD_NAV_VTOL_TAKEOFF : MAV_CMD_NAV_TAKEOFF;
if (_controllerVehicle->firmwarePlugin()->supportedMissionCommands().contains((MAV_CMD)takeoffCmd)) {
if (_controllerVehicle->firmwarePlugin()->supportedMissionCommands().contains(takeoffCmd)) {
newItem->setCommand(takeoffCmd);
}
}
newItem->setDefaultsForCommand();
if (newItem->specifiesAltitude()) {
double prevAltitude;
int prevAltitudeMode;
if (_findPreviousAltitude(i, &prevAltitude, &prevAltitudeMode)) {
newItem->altitude()->setRawValue(prevAltitude);
newItem->setAltitudeMode((SimpleMissionItem::AltitudeMode)prevAltitudeMode);
newItem->setAltitudeMode(static_cast<SimpleMissionItem::AltitudeMode>(prevAltitudeMode));
}
}
newItem->setMissionFlightStatus(_missionFlightStatus);
......@@ -381,11 +380,10 @@ int MissionController::insertROIMissionItem(QGeoCoordinate coordinate, int i)
int sequenceNumber = _nextSequenceNumber();
SimpleMissionItem * newItem = new SimpleMissionItem(_controllerVehicle, _flyView, this);
newItem->setSequenceNumber(sequenceNumber);
newItem->setCommand((MAV_CMD)(_controllerVehicle->firmwarePlugin()->supportedMissionCommands().contains((MAV_CMD)MAV_CMD_DO_SET_ROI_LOCATION) ?
newItem->setCommand((_controllerVehicle->firmwarePlugin()->supportedMissionCommands().contains(MAV_CMD_DO_SET_ROI_LOCATION) ?
MAV_CMD_DO_SET_ROI_LOCATION :
MAV_CMD_DO_SET_ROI));
_initVisualItem(newItem);
newItem->setDefaultsForCommand();
newItem->setCoordinate(coordinate);
double prevAltitude;
......@@ -393,7 +391,7 @@ int MissionController::insertROIMissionItem(QGeoCoordinate coordinate, int i)
if (_findPreviousAltitude(i, &prevAltitude, &prevAltitudeMode)) {
newItem->altitude()->setRawValue(prevAltitude);
newItem->setAltitudeMode((SimpleMissionItem::AltitudeMode)prevAltitudeMode);
newItem->setAltitudeMode(static_cast<SimpleMissionItem::AltitudeMode>(prevAltitudeMode));
}
_visualItems->insert(i, newItem);
......@@ -542,7 +540,7 @@ void MissionController::removeAll(void)
_deinitAllVisualItems();
_visualItems->clearAndDeleteContents();
_visualItems->deleteLater();
_settingsItem = NULL;
_settingsItem = nullptr;
_visualItems = new QmlObjectListModel(this);
_addMissionSettings(_visualItems, false /* addToCenter */);
_initAllVisualItems();
......@@ -670,9 +668,9 @@ bool MissionController::_loadJsonMissionFileV2(const QJsonObject& json, QmlObjec
if (_masterController->offline()) {
// We only update if offline since if we are online we use the online vehicle settings
appSettings->offlineEditingFirmwareType()->setRawValue(AppSettings::offlineEditingFirmwareTypeFromFirmwareType((MAV_AUTOPILOT)json[_jsonFirmwareTypeKey].toInt()));
appSettings->offlineEditingFirmwareType()->setRawValue(AppSettings::offlineEditingFirmwareTypeFromFirmwareType(static_cast<MAV_AUTOPILOT>(json[_jsonFirmwareTypeKey].toInt())));
if (json.contains(_jsonVehicleTypeKey)) {
appSettings->offlineEditingVehicleType()->setRawValue(AppSettings::offlineEditingVehicleTypeFromVehicleType((MAV_TYPE)json[_jsonVehicleTypeKey].toInt()));
appSettings->offlineEditingVehicleType()->setRawValue(AppSettings::offlineEditingVehicleTypeFromVehicleType(static_cast<MAV_TYPE>(json[_jsonVehicleTypeKey].toInt())));
}
}
if (json.contains(_jsonCruiseSpeedKey)) {
......@@ -790,9 +788,9 @@ bool MissionController::_loadJsonMissionFileV2(const QJsonObject& json, QmlObjec
for (int i=0; i<visualItems->count(); i++) {
if (visualItems->value<VisualMissionItem*>(i)->isSimpleItem()) {
SimpleMissionItem* doJumpItem = visualItems->value<SimpleMissionItem*>(i);
if ((MAV_CMD)doJumpItem->command() == MAV_CMD_DO_JUMP) {
if (doJumpItem->command() == MAV_CMD_DO_JUMP) {
bool found = false;
int findDoJumpId = doJumpItem->missionItem().param1();
int findDoJumpId = static_cast<int>(doJumpItem->missionItem().param1());
for (int j=0; j<visualItems->count(); j++) {
if (visualItems->value<VisualMissionItem*>(j)->isSimpleItem()) {
SimpleMissionItem* targetItem = visualItems->value<SimpleMissionItem*>(j);
......@@ -887,7 +885,7 @@ bool MissionController::_loadTextMissionFile(QTextStream& stream, QmlObjectListM
for (int i=1; i<visualItems->count(); i++) {
SimpleMissionItem* item = qobject_cast<SimpleMissionItem*>(visualItems->get(i));
if (item && item->command() == MAV_CMD_DO_JUMP) {
item->missionItem().setParam1((int)item->missionItem().param1() + 1);
item->missionItem().setParam1(static_cast<int>(item->missionItem().param1()) + 1);
}
}
}
......@@ -900,7 +898,7 @@ void MissionController::_initLoadedVisualItems(QmlObjectListModel* loadedVisualI
if (_visualItems) {
_deinitAllVisualItems();
_visualItems->deleteLater();
_settingsItem = NULL;
_settingsItem = nullptr;
}
_visualItems = loadedVisualItems;
......@@ -996,11 +994,11 @@ void MissionController::save(QJsonObject& json)
}
QJsonValue coordinateValue;
JsonHelper::saveGeoCoordinate(settingsItem->coordinate(), true /* writeAltitude */, coordinateValue);
json[_jsonPlannedHomePositionKey] = coordinateValue;
json[_jsonFirmwareTypeKey] = _controllerVehicle->firmwareType();
json[_jsonVehicleTypeKey] = _controllerVehicle->vehicleType();
json[_jsonCruiseSpeedKey] = _controllerVehicle->defaultCruiseSpeed();
json[_jsonHoverSpeedKey] = _controllerVehicle->defaultHoverSpeed();
json[_jsonPlannedHomePositionKey] = coordinateValue;
json[_jsonFirmwareTypeKey] = _controllerVehicle->firmwareType();
json[_jsonVehicleTypeKey] = _controllerVehicle->vehicleType();
json[_jsonCruiseSpeedKey] = _controllerVehicle->defaultCruiseSpeed();
json[_jsonHoverSpeedKey] = _controllerVehicle->defaultHoverSpeed();
// Save the visual items
......
......@@ -9,6 +9,7 @@
#include "PlanMasterController.h"
#include "QGCApplication.h"
#include "QGCCorePlugin.h"
#include "MultiVehicleManager.h"
#include "SettingsManager.h"
#include "AppSettings.h"
......@@ -25,16 +26,19 @@
QGC_LOGGING_CATEGORY(PlanMasterControllerLog, "PlanMasterControllerLog")
const int PlanMasterController::_planFileVersion = 1;
const char* PlanMasterController::_planFileType = "Plan";
const char* PlanMasterController::_jsonMissionObjectKey = "mission";
const char* PlanMasterController::_jsonGeoFenceObjectKey = "geoFence";
const char* PlanMasterController::_jsonRallyPointsObjectKey = "rallyPoints";
const int PlanMasterController::kPlanFileVersion = 1;
const char* PlanMasterController::kPlanFileType = "Plan";
const char* PlanMasterController::kJsonMissionObjectKey = "mission";
const char* PlanMasterController::kJsonGeoFenceObjectKey = "geoFence";
const char* PlanMasterController::kJsonRallyPointsObjectKey = "rallyPoints";
PlanMasterController::PlanMasterController(QObject* parent)
: QObject (parent)
, _multiVehicleMgr (qgcApp()->toolbox()->multiVehicleManager())
, _controllerVehicle (new Vehicle((MAV_AUTOPILOT)qgcApp()->toolbox()->settingsManager()->appSettings()->offlineEditingFirmwareType()->rawValue().toInt(), (MAV_TYPE)qgcApp()->toolbox()->settingsManager()->appSettings()->offlineEditingVehicleType()->rawValue().toInt(), qgcApp()->toolbox()->firmwarePluginManager()))
, _controllerVehicle (new Vehicle(
static_cast<MAV_AUTOPILOT>(qgcApp()->toolbox()->settingsManager()->appSettings()->offlineEditingFirmwareType()->rawValue().toInt()),
static_cast<MAV_TYPE>(qgcApp()->toolbox()->settingsManager()->appSettings()->offlineEditingVehicleType()->rawValue().toInt()),
qgcApp()->toolbox()->firmwarePluginManager()))
, _managerVehicle (_controllerVehicle)
, _flyView (true)
, _offline (true)
......@@ -111,7 +115,7 @@ void PlanMasterController::_activeVehicleChanged(Vehicle* activeVehicle)
}
bool newOffline = false;
if (activeVehicle == NULL) {
if (activeVehicle == nullptr) {
// Since there is no longer an active vehicle we use the offline controller vehicle as the manager vehicle
_managerVehicle = _controllerVehicle;
newOffline = true;
......@@ -309,28 +313,33 @@ void PlanMasterController::loadFromFile(const QString& filename)
return;
}
int version;
QJsonObject json = jsonDoc.object();
if (!JsonHelper::validateQGCJsonFile(json, _planFileType, _planFileVersion, _planFileVersion, version, errorString)) {
//-- Allow plugins to pre process the load
qgcApp()->toolbox()->corePlugin()->preLoadFromJson(this, json);
int version;
if (!JsonHelper::validateQGCJsonFile(json, kPlanFileType, kPlanFileVersion, kPlanFileVersion, version, errorString)) {
qgcApp()->showMessage(errorMessage.arg(errorString));
return;
}
QList<JsonHelper::KeyValidateInfo> rgKeyInfo = {
{ _jsonMissionObjectKey, QJsonValue::Object, true },
{ _jsonGeoFenceObjectKey, QJsonValue::Object, true },
{ _jsonRallyPointsObjectKey, QJsonValue::Object, true },
{ kJsonMissionObjectKey, QJsonValue::Object, true },
{ kJsonGeoFenceObjectKey, QJsonValue::Object, true },
{ kJsonRallyPointsObjectKey, QJsonValue::Object, true },
};
if (!JsonHelper::validateKeys(json, rgKeyInfo, errorString)) {
qgcApp()->showMessage(errorMessage.arg(errorString));
return;
}
if (!_missionController.load(json[_jsonMissionObjectKey].toObject(), errorString) ||
!_geoFenceController.load(json[_jsonGeoFenceObjectKey].toObject(), errorString) ||
!_rallyPointController.load(json[_jsonRallyPointsObjectKey].toObject(), errorString)) {
if (!_missionController.load(json[kJsonMissionObjectKey].toObject(), errorString) ||
!_geoFenceController.load(json[kJsonGeoFenceObjectKey].toObject(), errorString) ||
!_rallyPointController.load(json[kJsonRallyPointsObjectKey].toObject(), errorString)) {
qgcApp()->showMessage(errorMessage.arg(errorString));
} else {
//-- Allow plugins to post process the load
qgcApp()->toolbox()->corePlugin()->postLoadFromJson(this, json);
success = true;
}
} else if (fileInfo.suffix() == AppSettings::missionFileExtension) {
......@@ -364,16 +373,22 @@ void PlanMasterController::loadFromFile(const QString& filename)
QJsonDocument PlanMasterController::saveToJson()
{
QJsonObject planJson;
qgcApp()->toolbox()->corePlugin()->preSaveToJson(this, planJson);
QJsonObject missionJson;
QJsonObject fenceJson;
QJsonObject rallyJson;
JsonHelper::saveQGCJsonFileHeader(planJson, _planFileType, _planFileVersion);
JsonHelper::saveQGCJsonFileHeader(planJson, kPlanFileType, kPlanFileVersion);
//-- Allow plugin to preemptly add its own keys to mission
qgcApp()->toolbox()->corePlugin()->preSaveToMissionJson(this, missionJson);
_missionController.save(missionJson);
//-- Allow plugin to add its own keys to mission
qgcApp()->toolbox()->corePlugin()->postSaveToMissionJson(this, missionJson);
_geoFenceController.save(fenceJson);
_rallyPointController.save(rallyJson);
planJson[_jsonMissionObjectKey] = missionJson;
planJson[_jsonGeoFenceObjectKey] = fenceJson;
planJson[_jsonRallyPointsObjectKey] = rallyJson;
planJson[kJsonMissionObjectKey] = missionJson;
planJson[kJsonGeoFenceObjectKey] = fenceJson;
planJson[kJsonRallyPointsObjectKey] = rallyJson;
qgcApp()->toolbox()->corePlugin()->postSaveToJson(this, planJson);
return QJsonDocument(planJson);
}
......
......@@ -91,6 +91,12 @@ public:
Vehicle* controllerVehicle(void) { return _controllerVehicle; }
Vehicle* managerVehicle(void) { return _managerVehicle; }
static const int kPlanFileVersion;
static const char* kPlanFileType;
static const char* kJsonMissionObjectKey;
static const char* kJsonGeoFenceObjectKey;
static const char* kJsonRallyPointsObjectKey;
signals:
void containsItemsChanged (bool containsItems);
void syncInProgressChanged (void);
......@@ -124,9 +130,4 @@ private:
bool _sendRallyPoints;
QString _currentPlanFile;
static const int _planFileVersion;
static const char* _planFileType;
static const char* _jsonMissionObjectKey;
static const char* _jsonGeoFenceObjectKey;
static const char* _jsonRallyPointsObjectKey;
};
......@@ -78,7 +78,7 @@ SimpleMissionItem::SimpleMissionItem(Vehicle* vehicle, bool flyView, QObject* pa
_connectSignals();
_updateOptionalSections();
setDefaultsForCommand();
_setDefaultsForCommand();
_rebuildFacts();
setDirty(false);
......@@ -213,7 +213,7 @@ void SimpleMissionItem::_connectSignals(void)
connect(&_missionItem._frameFact, &Fact::valueChanged, this, &SimpleMissionItem::_sendFriendlyEditAllowedChanged);
// A command change triggers a number of other changes as well.
connect(&_missionItem._commandFact, &Fact::valueChanged, this, &SimpleMissionItem::setDefaultsForCommand);
connect(&_missionItem._commandFact, &Fact::valueChanged, this, &SimpleMissionItem::_setDefaultsForCommand);
connect(&_missionItem._commandFact, &Fact::valueChanged, this, &SimpleMissionItem::commandNameChanged);
connect(&_missionItem._commandFact, &Fact::valueChanged, this, &SimpleMissionItem::commandDescriptionChanged);
connect(&_missionItem._commandFact, &Fact::valueChanged, this, &SimpleMissionItem::abbreviationChanged);
......@@ -729,15 +729,32 @@ bool SimpleMissionItem::readyForSave(void) const
return !specifiesAltitude() || !qIsNaN(_missionItem._param7Fact.rawValue().toDouble());
}
void SimpleMissionItem::setDefaultsForCommand(void)
void SimpleMissionItem::_setDefaultsForCommand(void)
{
// We set these global defaults first, then if there are param defaults they will get reset
// First reset params 1-4 to 0, we leave 5-7 alone to preserve any previous location information on command change
_missionItem._param1Fact.setRawValue(0);
_missionItem._param2Fact.setRawValue(0);
_missionItem._param3Fact.setRawValue(0);
_missionItem._param4Fact.setRawValue(0);
if (!specifiesCoordinate() && !isStandaloneCoordinate()) {
// No need to carry across previous lat/lon
_missionItem._param5Fact.setRawValue(0);
_missionItem._param6Fact.setRawValue(0);
}
// Set global defaults first, then if there are param defaults they will get reset
_altitudeMode = AltitudeRelative;
emit altitudeModeChanged();
double defaultAlt = qgcApp()->toolbox()->settingsManager()->appSettings()->defaultMissionItemAltitude()->rawValue().toDouble();
_altitudeFact.setRawValue(defaultAlt);
_missionItem._param7Fact.setRawValue(defaultAlt);
_amslAltAboveTerrainFact.setRawValue(qQNaN());
if (specifiesCoordinate() || isStandaloneCoordinate() || specifiesAltitudeOnly()) {
double defaultAlt = qgcApp()->toolbox()->settingsManager()->appSettings()->defaultMissionItemAltitude()->rawValue().toDouble();
_altitudeFact.setRawValue(defaultAlt);
_missionItem._param7Fact.setRawValue(defaultAlt);
} else {
_altitudeFact.setRawValue(0);
_missionItem._param7Fact.setRawValue(0);
}
MAV_CMD command = (MAV_CMD)this->command();
const MissionCommandUIInfo* uiInfo = _commandTree->getUIInfo(_vehicle, command);
......
......@@ -134,9 +134,6 @@ public:
int lastSequenceNumber (void) const final;
void save (QJsonArray& missionItems) final;
public slots:
void setDefaultsForCommand(void);
signals:
void commandChanged (int command);
void friendlyEditAllowedChanged (bool friendlyEditAllowed);
......@@ -160,6 +157,7 @@ private slots:
void _rebuildFacts (void);
void _rebuildTextFieldFacts (void);
void _possibleAdditionalTimeDelayChanged(void);
void _setDefaultsForCommand (void);
private:
void _connectSignals (void);
......
......@@ -412,11 +412,6 @@ void TransectStyleComplexItem::_setBoundingCube(QGCGeoBoundingCube bc)
void TransectStyleComplexItem::_queryTransectsPathHeightInfo(void)
{
_transectsPathHeightInfo.clear();
if (_terrainPolyPathQuery) {
// Toss previous query
_terrainPolyPathQuery->deleteLater();
_terrainPolyPathQuery = NULL;
}
if (_transects.count()) {
// We don't actually send the query until this timer times out. This way we only send
......@@ -427,6 +422,20 @@ void TransectStyleComplexItem::_queryTransectsPathHeightInfo(void)
void TransectStyleComplexItem::_reallyQueryTransectsPathHeightInfo(void)
{
// Clear any previous query
if (_terrainPolyPathQuery) {
// FIXME: We should really be blowing away any previous query here. But internally that is difficult to implement so instead we let
// it complete and drop the results.
#if 0
// Toss previous query
_terrainPolyPathQuery->deleteLater();
#else
// Let the signal fall on the floor
disconnect(_terrainPolyPathQuery, &TerrainPolyPathQuery::terrainDataReceived, this, &TransectStyleComplexItem::_polyPathTerrainData);
#endif
_terrainPolyPathQuery = NULL;
}
// Append all transects into a single PolyPath query
QList<QGeoCoordinate> transectPoints;
......@@ -463,6 +472,12 @@ void TransectStyleComplexItem::_polyPathTerrainData(bool success, const QList<Te
// Now that we have terrain data we can adjust
_adjustTransectsForTerrain();
}
if (_terrainPolyPathQuery != sender()) {
qWarning() << "TransectStyleComplexItem::_polyPathTerrainData _terrainPolyPathQuery != sender()";
}
disconnect(_terrainPolyPathQuery, &TerrainPolyPathQuery::terrainDataReceived, this, &TransectStyleComplexItem::_polyPathTerrainData);
_terrainPolyPathQuery = NULL;
}
bool TransectStyleComplexItem::readyForSave(void) const
......
......@@ -54,8 +54,8 @@ public:
Fact* hoverAndCapture (void) { return &_hoverAndCaptureFact; }
Fact* refly90Degrees (void) { return &_refly90DegreesFact; }
Fact* terrainAdjustTolerance (void) { return &_terrainAdjustToleranceFact; }
Fact* terrainAdjustMaxDescentRate (void) { return &_terrainAdjustMaxClimbRateFact; }
Fact* terrainAdjustMaxClimbRate (void) { return &_terrainAdjustMaxDescentRateFact; }
Fact* terrainAdjustMaxDescentRate (void) { return &_terrainAdjustMaxDescentRateFact; }
Fact* terrainAdjustMaxClimbRate (void) { return &_terrainAdjustMaxClimbRateFact; }
const Fact* hoverAndCapture (void) const { return &_hoverAndCaptureFact; }
......
......@@ -36,8 +36,9 @@ 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
property bool _showCameraSection: (!_waypointsOnlyMode || QGroundControl.corePlugin.showAdvancedUI) && !_missionVehicle.apmFirmware
property bool _simpleMissionStart: QGroundControl.corePlugin.options.showSimpleMissionStart
property bool _showFlightSpeed: !_missionVehicle.vtol && !_simpleMissionStart && !_missionVehicle.apmFirmware
readonly property string _firmwareLabel: qsTr("Firmware")
readonly property string _vehicleLabel: qsTr("Vehicle")
......@@ -72,14 +73,14 @@ Rectangle {
QGCCheckBox {
id: flightSpeedCheckBox
text: qsTr("Flight speed")
visible: !_missionVehicle.vtol && !_simpleMissionStart
visible: _showFlightSpeed
checked: missionItem.speedSection.specifyFlightSpeed
onClicked: missionItem.speedSection.specifyFlightSpeed = checked
}
FactTextField {
Layout.fillWidth: true
fact: missionItem.speedSection.flightSpeed
visible: flightSpeedCheckBox.visible
visible: _showFlightSpeed
enabled: flightSpeedCheckBox.checked
}
}
......
......@@ -53,20 +53,20 @@ Item {
readonly property real mediumFontPointRatio: 1.25
readonly property real largeFontPointRatio: 1.5
property real realPixelDensity: QGroundControl.corePlugin.options.devicePixelDensity != 0 ? QGroundControl.corePlugin.options.devicePixelDensity : Screen.pixelDensity
property real realPixelRatio: {
property real realPixelDensity: {
//-- If a plugin defines it, just use what it tells us
if (QGroundControl.corePlugin.options.devicePixelRatio != 0)
return QGroundControl.corePlugin.options.devicePixelRatio
//-- Mobile is rather unreliable. They all return 1 for Screen.devicePixelRatio.
if(isMobile) {
// Lets assume it's unlikely you have a tablet over 300mm wide
if((Screen.width / Screen.pixelDensity * Screen.devicePixelRatio) > 300)
return 2
if(QGroundControl.corePlugin.options.devicePixelDensity != 0) {
return QGroundControl.corePlugin.options.devicePixelDensity
}
//-- Android is rather unreliable
if(isAndroid) {
// Lets assume it's unlikely you have a tablet over 300mm wide
if((Screen.width / Screen.pixelDensity) > 300) {
return Screen.pixelDensity * 2
}
}
//-- Use whatever the system tells us
return Screen.devicePixelRatio
//-- Let's use what the system tells us
return Screen.pixelDensity
}
property bool isAndroid: ScreenToolsController.isAndroid
......@@ -74,9 +74,10 @@ Item {
property bool isMobile: ScreenToolsController.isMobile
property bool isWindows: ScreenToolsController.isWindows
property bool isDebug: ScreenToolsController.isDebug
property bool isMac: ScreenToolsController.isMacOS
property bool isTinyScreen: (Screen.width / realPixelDensity) < 120 // 120mm
property bool isShortScreen: ScreenToolsController.isMobile && ((Screen.height / Screen.width) < 0.6) // Nexus 7 for example
property bool isHugeScreen: Screen.width >= 1920*2
property bool isHugeScreen: (Screen.width / realPixelDensity) >= (23.5 * 25.4) // 27" monitor
readonly property real minTouchMillimeters: 10 ///< Minimum touch size in millimeters
property real minTouchPixels: 0 ///< Minimum touch size in pixels
......@@ -111,10 +112,6 @@ Item {
_setBasePointSize(defaultFontPointSize)
}
onRealPixelRatioChanged: {
_setBasePointSize(defaultFontPointSize)
}
function printScreenStats() {
console.log('ScreenTools: Screen.width: ' + Screen.width + ' Screen.height: ' + Screen.height + ' Screen.pixelDensity: ' + Screen.pixelDensity)
}
......@@ -138,7 +135,7 @@ Item {
smallFontPointSize = defaultFontPointSize * _screenTools.smallFontPointRatio
mediumFontPointSize = defaultFontPointSize * _screenTools.mediumFontPointRatio
largeFontPointSize = defaultFontPointSize * _screenTools.largeFontPointRatio
minTouchPixels = Math.round(minTouchMillimeters * realPixelDensity * realPixelRatio)
minTouchPixels = Math.round(minTouchMillimeters * realPixelDensity)
if (minTouchPixels / Screen.height > 0.15) {
// If using physical sizing takes up too much of the vertical real estate fall back to font based sizing
minTouchPixels = defaultFontPixelHeight * 3
......
......@@ -416,7 +416,7 @@ bool TerrainTileManager::_getAltitudesForCoordinates(const QList<QGeoCoordinate>
error = true;
qCWarning(TerrainQueryLog) << "TerrainTileManager::_getAltitudesForCoordinates Internal Error: negative elevation in tile cache";
} else {
qCWarning(TerrainQueryLog) << "TerrainTileManager::_getAltitudesForCoordinates returning elevation from tile cache" << elevation;
qCDebug(TerrainQueryLog) << "TerrainTileManager::_getAltitudesForCoordinates returning elevation from tile cache" << elevation;
}
altitudes.push_back(elevation);
} else {
......
[
{
"name": "goodAttitudeEsimate",
"shortDescription": "Good Attitude Esimate",
"type": "bool",
"default": false
},
{
"name": "goodHorizVelEstimate",
"shortDescription": "Good Horiz Vel Estimate",
"type": "bool",
"default": false
},
{
"name": "goodVertVelEstimate",
"shortDescription": "Good Vert Vel Estimate",
"type": "bool",
"default": false
},
{
"name": "goodHorizPosRelEstimate",
"shortDescription": "Good Horiz Pos Rel Estimate",
"type": "bool",
"default": false
},
{
"name": "goodHorizPosAbsEstimate",
"shortDescription": "Good Horiz Pos Abs Estimate",
"type": "bool",
"default": false
},
{
"name": "goodVertPosAbsEstimate",
"shortDescription": "Good Vert Pos Abs Estimate",
"type": "bool",
"default": false
},
{
"name": "goodVertPosAGLEstimate",
"shortDescription": "Good Vert Pos AGL Estimate",
"type": "bool",
"default": false
},
{
"name": "goodConstPosModeEstimate",
"shortDescription": "Good Const Pos Mode Estimate",
"type": "bool",
"default": false
},
{
"name": "goodPredHorizPosRelEstimate",
"shortDescription": "Good Pred Horiz Pos Rel Estimate",
"type": "bool",
"default": false
},
{
"name": "goodPredHorizPosAbsEstimate",
"shortDescription": "Good Pred Horiz Pos Abs Estimate",
"type": "bool",
"default": false
},
{
"name": "gpsGlitch",
"shortDescription": "Gps Glitch",
"type": "bool",
"default": false
},
{
"name": "accelError",
"shortDescription": "Accel Error",
"type": "bool",
"default": false
},
{
"name": "velRatio",
"shortDescription": "Vel Ratio",
"type": "float",
"decimalPlaces": 2,
"default": null
},
{
"name": "horizPosRatio",
"shortDescription": "Horiz Pos Ratio",
"type": "float",
"decimalPlaces": 2,
"default": null
},
{
"name": "vertPosRatio",
"shortDescription": "Vert Pos Ratio",
"type": "float",
"decimalPlaces": 2,
"default": null
},
{
"name": "magRatio",
"shortDescription": "Mag Ratio",
"type": "float",
"decimalPlaces": 2,
"default": null
},
{
"name": "haglRatio",
"shortDescription": "HAGL Ratio",
"type": "float",
"decimalPlaces": 2,
"default": null
},
{
"name": "tasRatio",
"shortDescription": "TAS Ratio",
"type": "float",
"decimalPlaces": 2,
"default": null
},
{
"name": "horizPosAccuracy",
"shortDescription": "Horiz Pos Accuracy",
"type": "float",
"decimalPlaces": 2,
"default": null
},
{
"name": "vertPosAccuracy",
"shortDescription": "Vert Pos Accuracy",
"type": "float",
"decimalPlaces": 2,
"default": null
}
]
This diff is collapsed.
This diff is collapsed.
......@@ -28,25 +28,25 @@ class QGCCorePlugin_p
{
public:
QGCCorePlugin_p()
: pGeneral (NULL)
, pCommLinks (NULL)
, pOfflineMaps (NULL)
: pGeneral (nullptr)
, pCommLinks (nullptr)
, pOfflineMaps (nullptr)
#if defined(QGC_AIRMAP_ENABLED)
, pAirmap (NULL)
, pAirmap (nullptr)
#endif
, pMAVLink (NULL)
, pConsole (NULL)
, pHelp (NULL)
, pMAVLink (nullptr)
, pConsole (nullptr)
, pHelp (nullptr)
#if defined(QT_DEBUG)
, pMockLink (NULL)
, pDebug (NULL)
, pMockLink (nullptr)
, pDebug (nullptr)
#endif
, defaultOptions (NULL)
, valuesPageWidgetInfo (NULL)
, cameraPageWidgetInfo (NULL)
, videoPageWidgetInfo (NULL)
, healthPageWidgetInfo (NULL)
, vibrationPageWidgetInfo (NULL)
, defaultOptions (nullptr)
, valuesPageWidgetInfo (nullptr)
, cameraPageWidgetInfo (nullptr)
, videoPageWidgetInfo (nullptr)
, healthPageWidgetInfo (nullptr)
, vibrationPageWidgetInfo (nullptr)
{
}
......@@ -129,41 +129,41 @@ QVariantList &QGCCorePlugin::settingsPages()
{
if(!_p->pGeneral) {
_p->pGeneral = new QmlComponentInfo(tr("General"),
QUrl::fromUserInput("qrc:/qml/GeneralSettings.qml"),
QUrl::fromUserInput("qrc:/res/gear-white.svg"));
_p->settingsList.append(QVariant::fromValue((QmlComponentInfo*)_p->pGeneral));
QUrl::fromUserInput("qrc:/qml/GeneralSettings.qml"),
QUrl::fromUserInput("qrc:/res/gear-white.svg"));
_p->settingsList.append(QVariant::fromValue(reinterpret_cast<QmlComponentInfo*>(_p->pGeneral)));
_p->pCommLinks = new QmlComponentInfo(tr("Comm Links"),
QUrl::fromUserInput("qrc:/qml/LinkSettings.qml"),
QUrl::fromUserInput("qrc:/res/waves.svg"));
_p->settingsList.append(QVariant::fromValue((QmlComponentInfo*)_p->pCommLinks));
QUrl::fromUserInput("qrc:/qml/LinkSettings.qml"),
QUrl::fromUserInput("qrc:/res/waves.svg"));
_p->settingsList.append(QVariant::fromValue(reinterpret_cast<QmlComponentInfo*>(_p->pCommLinks)));
_p->pOfflineMaps = new QmlComponentInfo(tr("Offline Maps"),
QUrl::fromUserInput("qrc:/qml/OfflineMap.qml"),
QUrl::fromUserInput("qrc:/res/waves.svg"));
_p->settingsList.append(QVariant::fromValue((QmlComponentInfo*)_p->pOfflineMaps));
QUrl::fromUserInput("qrc:/qml/OfflineMap.qml"),
QUrl::fromUserInput("qrc:/res/waves.svg"));
_p->settingsList.append(QVariant::fromValue(reinterpret_cast<QmlComponentInfo*>(_p->pOfflineMaps)));
#if defined(QGC_AIRMAP_ENABLED)
_p->pAirmap = new QmlComponentInfo(tr("AirMap"),
QUrl::fromUserInput("qrc:/qml/AirmapSettings.qml"),
QUrl::fromUserInput(""));
_p->settingsList.append(QVariant::fromValue((QmlComponentInfo*)_p->pAirmap));
QUrl::fromUserInput("qrc:/qml/AirmapSettings.qml"),
QUrl::fromUserInput(""));
_p->settingsList.append(QVariant::fromValue(reinterpret_cast<QmlComponentInfo*>(_p->pAirmap)));
#endif
_p->pMAVLink = new QmlComponentInfo(tr("MAVLink"),
QUrl::fromUserInput("qrc:/qml/MavlinkSettings.qml"),
QUrl::fromUserInput("qrc:/res/waves.svg"));
_p->settingsList.append(QVariant::fromValue((QmlComponentInfo*)_p->pMAVLink));
QUrl::fromUserInput("qrc:/qml/MavlinkSettings.qml"),
QUrl::fromUserInput("qrc:/res/waves.svg"));
_p->settingsList.append(QVariant::fromValue(reinterpret_cast<QmlComponentInfo*>(_p->pMAVLink)));
_p->pConsole = new QmlComponentInfo(tr("Console"),
QUrl::fromUserInput("qrc:/qml/QGroundControl/Controls/AppMessages.qml"));
_p->settingsList.append(QVariant::fromValue((QmlComponentInfo*)_p->pConsole));
QUrl::fromUserInput("qrc:/qml/QGroundControl/Controls/AppMessages.qml"));
_p->settingsList.append(QVariant::fromValue(reinterpret_cast<QmlComponentInfo*>(_p->pConsole)));
_p->pHelp = new QmlComponentInfo(tr("Help"),
QUrl::fromUserInput("qrc:/qml/HelpSettings.qml"));
_p->settingsList.append(QVariant::fromValue((QmlComponentInfo*)_p->pHelp));
QUrl::fromUserInput("qrc:/qml/HelpSettings.qml"));
_p->settingsList.append(QVariant::fromValue(reinterpret_cast<QmlComponentInfo*>(_p->pHelp)));
#if defined(QT_DEBUG)
//-- These are always present on Debug builds
_p->pMockLink = new QmlComponentInfo(tr("Mock Link"),
QUrl::fromUserInput("qrc:/qml/MockLink.qml"));
_p->settingsList.append(QVariant::fromValue((QmlComponentInfo*)_p->pMockLink));
QUrl::fromUserInput("qrc:/qml/MockLink.qml"));
_p->settingsList.append(QVariant::fromValue(reinterpret_cast<QmlComponentInfo*>(_p->pMockLink)));
_p->pDebug = new QmlComponentInfo(tr("Debug"),
QUrl::fromUserInput("qrc:/qml/DebugWindow.qml"));
_p->settingsList.append(QVariant::fromValue((QmlComponentInfo*)_p->pDebug));
QUrl::fromUserInput("qrc:/qml/DebugWindow.qml"));
_p->settingsList.append(QVariant::fromValue(reinterpret_cast<QmlComponentInfo*>(_p->pDebug)));
#endif
}
return _p->settingsList;
......
......@@ -32,6 +32,7 @@ class Vehicle;
class LinkInterface;
class QmlObjectListModel;
class VideoReceiver;
class PlanMasterController;
class QGCCorePlugin : public QGCTool
{
......@@ -88,7 +89,7 @@ public:
virtual QString showAdvancedUIMessage(void) const;
/// @return An instance of an alternate position source (or NULL if not available)
virtual QGeoPositionInfoSource* createPositionSource(QObject* parent) { Q_UNUSED(parent); return NULL; }
virtual QGeoPositionInfoSource* createPositionSource(QObject* parent) { Q_UNUSED(parent); return nullptr; }
/// Allows a plugin to override the specified color name from the palette
virtual void paletteOverride(QString colorName, QGCPalette::PaletteColorInfo_t& colorInfo);
......@@ -110,6 +111,20 @@ public:
/// should derive from QmlComponentInfo and set the url property.
virtual QmlObjectListModel* customMapItems(void);
/// Allows custom builds to add custom items to the plan file. Either before the document is
/// created or after.
virtual void preSaveToJson (PlanMasterController* pController, QJsonObject& json) { Q_UNUSED(pController); Q_UNUSED(json); }
virtual void postSaveToJson (PlanMasterController* pController, QJsonObject& json) { Q_UNUSED(pController); Q_UNUSED(json); }
/// Same for the specific "mission" portion
virtual void preSaveToMissionJson (PlanMasterController* pController, QJsonObject& missionJson) { Q_UNUSED(pController); Q_UNUSED(missionJson); }
virtual void postSaveToMissionJson (PlanMasterController* pController, QJsonObject& missionJson) { Q_UNUSED(pController); Q_UNUSED(missionJson); }
/// Allows custom builds to load custom items from the plan file. Either before the document is
/// parsed or after.
virtual void preLoadFromJson (PlanMasterController* pController, QJsonObject& json) { Q_UNUSED(pController); Q_UNUSED(json); }
virtual void postLoadFromJson (PlanMasterController* pController, QJsonObject& json) { Q_UNUSED(pController); Q_UNUSED(json); }
bool showTouchAreas(void) const { return _showTouchAreas; }
bool showAdvancedUI(void) const { return _showAdvancedUI; }
void setShowTouchAreas(bool show);
......
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