Commit 00384b83 authored by Gus Grubba's avatar Gus Grubba

Merge remote-tracking branch 'mavlink/master'

* mavlink/master: (23 commits)
  Work around FlightMap weirdness
  Set default video streaming to Disabled.
  Deal with macdeployqt relocation issues
  Put back correct app name
  Overlap should not be negative
  Allow telemetry logging on mobile
  Fix shutdown signaling on android
  emit loadComplete even when fence/rally not supported
  Better logging
  ExternalLibs: Fix compiling on windows 64bit
  Camera: added RX100II
  Fix up MockLink and unit tests for correct component id
  Create vehicles only for autopilot component
  GeoTagController : Handle logging dropouts correctly
  Better param logging for mission default component case
  Allow RADIO_STATUS message to pass through to vehicle
  Support for custom build installers for Windows/OSX
  Support Win 7/10 for #3210
  Keep Android screen from sleeping while QGC is running.
  RTK Indicator updates
  ...
parents a804bb36 b682031e
......@@ -80,11 +80,14 @@ MacBuild {
} else:LinuxBuild {
PKGCONFIG = sdl2
} else:WindowsBuild {
INCLUDEPATH += \
$$BASEDIR/libs/lib/sdl2/msvc/include \
INCLUDEPATH += $$BASEDIR/libs/lib/sdl2/msvc/include
contains(QT_ARCH, i386) {
LIBS += -L$$BASEDIR/libs/lib/sdl2/msvc/lib/x86
} else {
LIBS += -L$$BASEDIR/libs/lib/sdl2/msvc/lib/x64
}
LIBS += \
-L$$BASEDIR/libs/lib/sdl2/msvc/lib/x86 \
-lSDL2main \
-lSDL2
}
......
......@@ -27,18 +27,15 @@ installer {
# qgroundcontrol.app file. If you specify a path to the .app file the symbolic
# links to plugins will not be created correctly.
QMAKE_POST_LINK += && mkdir -p $${DESTDIR}/package
QMAKE_POST_LINK += && cd $${DESTDIR} && $$dirname(QMAKE_QMAKE)/macdeployqt QGroundControl.app -appstore-compliant -verbose=2 -qmldir=$${BASEDIR}/src
QMAKE_POST_LINK += && cd $${DESTDIR} && $$dirname(QMAKE_QMAKE)/macdeployqt $${TARGET}.app -appstore-compliant -verbose=2 -qmldir=$${BASEDIR}/src
# macdeploy is missing some relocations once in a while. "Fix" it:
QMAKE_POST_LINK += && python $$BASEDIR/tools/osxrelocator.py $${TARGET}.app/Contents @rpath @executable_path/../Frameworks -r > /dev/null 2>&1
# Create package
QMAKE_POST_LINK += && cd $${OUT_PWD}
QMAKE_POST_LINK += && hdiutil create -verbose -stretch 4g -layout SPUD -srcfolder $${DESTDIR}/QGroundControl.app -volname QGroundControl $${DESTDIR}/package/QGroundControl.dmg
QMAKE_POST_LINK += && hdiutil create -verbose -stretch 4g -layout SPUD -srcfolder $${DESTDIR}/$${TARGET}.app -volname $${TARGET} $${DESTDIR}/package/$${TARGET}.dmg
}
WindowsBuild {
# The pdb moving command are commented out for now since we are including the .pdb in the installer. This makes it much
# easier to debug user crashes.
#QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY $${DESTDIR_WIN}\\qgroundcontrol.pdb
#QMAKE_POST_LINK += $$escape_expand(\\n) del $${DESTDIR_WIN}\\qgroundcontrol.pdb
QMAKE_POST_LINK += $$escape_expand(\\n) cd $$BASEDIR_WIN && $$quote("\"C:\\Program Files \(x86\)\\NSIS\\makensis.exe\"" /NOCD "\"/XOutFile $${DESTDIR_WIN}\\QGroundControl-installer.exe\"" "$$BASEDIR_WIN\\deploy\\qgroundcontrol_installer.nsi")
#QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY qgroundcontrol.pdb $${DESTDIR_WIN}
#QMAKE_POST_LINK += $$escape_expand(\\n) del qgroundcontrol.pdb
QMAKE_POST_LINK += $$escape_expand(\\n) cd $$BASEDIR_WIN && $$quote("\"C:\\Program Files \(x86\)\\NSIS\\makensis.exe\"" /DAPPNAME="\"$${QGC_APP_NAME}\"" /DEXENAME="\"$${TARGET}\"" /DORGNAME="\"$${QGC_ORG_NAME}\"" /DDESTDIR=$${DESTDIR} /NOCD "\"/XOutFile $${DESTDIR_WIN}\\$${TARGET}-installer.exe\"" "$$BASEDIR_WIN\\deploy\\qgroundcontrol_installer.nsi")
OTHER_FILES += deploy/qgroundcontrol_installer.nsi
}
LinuxBuild {
......
......@@ -44,6 +44,7 @@ import android.hardware.usb.*;
import android.widget.Toast;
import android.util.Log;
import android.os.PowerManager;
import android.view.WindowManager;
//-- Text To Speech
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
......@@ -123,12 +124,27 @@ public class QGCActivity extends QtActivity implements TextToSpeech.OnInitListen
m_tts = new TextToSpeech(this,this);
PowerManager pm = (PowerManager)m_instance.getSystemService(Context.POWER_SERVICE);
m_wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "QGroundControl");
if(m_wl != null) {
m_wl.acquire();
Log.i(TAG, "SCREEN_BRIGHT_WAKE_LOCK acquired.");
} else {
Log.i(TAG, "SCREEN_BRIGHT_WAKE_LOCK not acquired!!!");
}
m_instance.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
@Override
protected void onDestroy() {
try {
if(m_wl != null) {
m_wl.release();
Log.i(TAG, "SCREEN_BRIGHT_WAKE_LOCK released.");
}
m_tts.shutdown();
} catch(Exception e) {
Log.e(TAG, "Exception onDestroy()");
}
super.onDestroy();
m_tts.shutdown();
}
public void onInit(int status) {
......@@ -140,24 +156,6 @@ public class QGCActivity extends QtActivity implements TextToSpeech.OnInitListen
m_tts.speak(msg, TextToSpeech.QUEUE_FLUSH, null);
}
public static void keepScreenOn()
{
if(m_wl != null) {
m_wl.acquire();
Log.i(TAG, "SCREEN_BRIGHT_WAKE_LOCK acquired.");
} else {
Log.i(TAG, "SCREEN_BRIGHT_WAKE_LOCK not acquired!!!");
}
}
public static void restoreScreenOn()
{
if(m_wl != null) {
m_wl.release();
Log.i(TAG, "SCREEN_BRIGHT_WAKE_LOCK released.");
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Find all current devices that match the device filter described in the androidmanifest.xml and the
......
......@@ -36,10 +36,10 @@
${EndIf}
!macroend
Name "QGroundcontrol"
Name "${APPNAME}"
Var StartMenuFolder
InstallDir $PROGRAMFILES\qgroundcontrol
InstallDir "$PROGRAMFILES\${APPNAME}"
SetCompressor /SOLID /FINAL lzma
......@@ -58,43 +58,35 @@ SetCompressor /SOLID /FINAL lzma
!insertmacro MUI_LANGUAGE "English"
Section
ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QGroundControl" "UninstallString"
ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString"
StrCmp $R0 "" doinstall
ExecWait "$R0 /S _?=$INSTDIR"
IntCmp $0 0 doinstall
MessageBox MB_OK|MB_ICONEXCLAMATION \
"Could not remove a previously installed QGroundControl version.$\n$\nPlease remove it before continuing."
"Could not remove a previously installed ${APPNAME} version.$\n$\nPlease remove it before continuing."
Abort
doinstall:
SetOutPath $INSTDIR
File /r /x qgroundcontrol.pdb /x qgroundcontrol.lib /x qgroundcontrol.exp build_windows_install\release\*.*
File /r /x ${EXENAME}.pdb /x ${EXENAME}.lib /x ${EXENAME}.exp ${DESTDIR}\*.*
File deploy\px4driver.msi
WriteUninstaller $INSTDIR\QGroundControl_uninstall.exe
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QGroundControl" "DisplayName" "QGroundControl"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QGroundControl" "UninstallString" "$\"$INSTDIR\QGroundControl_uninstall.exe$\""
WriteUninstaller $INSTDIR\${EXENAME}-Uninstall.exe
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$\"$INSTDIR\${EXENAME}-Uninstall.exe$\""
; Only attempt to install the PX4 driver if the version isn't present
!define ROOTKEY "SYSTEM\CurrentControlSet\Control\Class\{4D36E978-E325-11CE-BFC1-08002BE10318}"
StrCpy $0 0
loop:
EnumRegKey $1 HKLM ${ROOTKEY} $0
StrCmp $1 "" notfound cont1
cont1:
StrCpy $2 "${ROOTKEY}\$1"
ReadRegStr $3 HKLM $2 "ProviderName"
StrCmp $3 "3D Robotics" found_provider
mismatch:
IntOp $0 $0 + 1
goto loop
!define ROOTKEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\434608CF2B6E31F0DDBA5C511053F957B55F098E"
SetRegView 64
ReadRegStr $0 HKLM "${ROOTKEY}" "Publisher"
StrCmp $0 "3D Robotics" found_provider notfound
found_provider:
ReadRegStr $3 HKLM $2 "DriverVersion"
StrCmp $3 "2.0.0.4" skip_driver
goto mismatch
ReadRegStr $0 HKLM "${ROOTKEY}" "DisplayVersion"
DetailPrint "Checking USB driver version... $0"
StrCmp $0 "04/11/2013 2.0.0.4" skip_driver notfound
notfound:
DetailPrint "USB Driver not found... installing"
......@@ -104,6 +96,7 @@ notfound:
skip_driver:
DetailPrint "USB Driver found... skipping install"
done:
SetRegView lastused
SectionEnd
Section "Uninstall"
......@@ -112,17 +105,17 @@ Section "Uninstall"
RMDir /r /REBOOTOK $INSTDIR
RMDir /r /REBOOTOK "$SMPROGRAMS\$StartMenuFolder\"
SetShellVarContext current
RMDir /r /REBOOTOK "$APPDATA\QGROUNDCONTROL.ORG\"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QGroundControl"
RMDir /r /REBOOTOK "$APPDATA\${ORGNAME}\"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
SectionEnd
Section "create Start Menu Shortcuts"
SetShellVarContext all
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\QGroundControl.lnk" "$INSTDIR\qgroundcontrol.exe" "" "$INSTDIR\qgroundcontrol.exe" 0
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\QGroundControl (GPU Compatibility Mode).lnk" "$INSTDIR\qgroundcontrol.exe" "-angle" "$INSTDIR\qgroundcontrol.exe" 0
!insertmacro DemoteShortCut "$SMPROGRAMS\$StartMenuFolder\QGroundControl (GPU Compatibility Mode).lnk"
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\QGroundControl (GPU Safe Mode).lnk" "$INSTDIR\qgroundcontrol.exe" "-swrast" "$INSTDIR\qgroundcontrol.exe" 0
!insertmacro DemoteShortCut "$SMPROGRAMS\$StartMenuFolder\QGroundControl (GPU Safe Mode).lnk"
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\${APPNAME}.lnk" "$INSTDIR\${EXENAME}.exe" "" "$INSTDIR\${EXENAME}.exe" 0
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\${APPNAME} (GPU Compatibility Mode).lnk" "$INSTDIR\${EXENAME}.exe" "-angle" "$INSTDIR\${EXENAME}.exe" 0
!insertmacro DemoteShortCut "$SMPROGRAMS\$StartMenuFolder\${APPNAME} (GPU Compatibility Mode).lnk"
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\${APPNAME} (GPU Safe Mode).lnk" "$INSTDIR\${EXENAME}.exe" "-swrast" "$INSTDIR\${EXENAME}.exe" 0
!insertmacro DemoteShortCut "$SMPROGRAMS\$StartMenuFolder\${APPNAME} (GPU Safe Mode).lnk"
SectionEnd
......@@ -139,6 +139,7 @@
<file alias="Gears.svg">src/ui/toolbar/Images/Gears.svg</file>
<file alias="Analyze.svg">src/ui/toolbar/Images/Analyze.svg</file>
<file alias="Gps.svg">src/ui/toolbar/Images/Gps.svg</file>
<file alias="RTK.svg">src/ui/toolbar/Images/RTK.svg</file>
<file alias="Hamburger.svg">src/ui/toolbar/Images/Hamburger.svg</file>
<file alias="Megaphone.svg">src/ui/toolbar/Images/Megaphone.svg</file>
<file alias="PaperPlane.svg">src/ui/toolbar/Images/PaperPlane.svg</file>
......
......@@ -72,6 +72,17 @@ WindowsBuild {
RC_ICONS = resources/icons/qgroundcontrol.ico
}
#
# Branding
#
QGC_APP_NAME = "QGroundControl"
QGC_ORG_NAME = "QGroundControl.org"
QGC_ORG_DOMAIN = "org.qgroundcontrol"
QGC_APP_DESCRIPTION = "Open source ground control app provided by QGroundControl dev team"
QGC_APP_COPYRIGHT = "Copyright (C) 2017 QGroundControl Development Team. All rights reserved."
# Load additional config flags from user_config.pri
exists(user_config.pri):infile(user_config.pri, CONFIG) {
CONFIG += $$fromfile(user_config.pri, CONFIG)
......@@ -106,6 +117,14 @@ contains (CONFIG, QGC_DISABLE_CUSTOM_BUILD) {
}
}
WindowsBuild {
# Sets up application properties
QMAKE_TARGET_COMPANY = "$${QGC_ORG_NAME}"
QMAKE_TARGET_DESCRIPTION = "$${QGC_APP_DESCRIPTION}"
QMAKE_TARGET_COPYRIGHT = "$${QGC_APP_COPYRIGHT}"
QMAKE_TARGET_PRODUCT = "$${QGC_APP_NAME}"
}
#
# Plugin configuration
#
......@@ -225,15 +244,6 @@ ReleaseBuild {
QT.testlib.CONFIG -= console
}
#
# Branding
#
QMAKE_TARGET_COMPANY = "qgroundcontrol.org"
QMAKE_TARGET_DESCRIPTION = "Open source ground control app provided by QGroundControl dev team"
QMAKE_TARGET_COPYRIGHT = "Copyright (C) 2016 QGroundControl Development Team. All rights reserved."
QMAKE_TARGET_PRODUCT = "QGroundControl"
#
# Build-specific settings
#
......
......@@ -306,8 +306,15 @@ bool GeoTagWorker::triggerFiltering()
{
_imageIndices.clear();
_triggerIndices.clear();
for(int i = 0; i < _imageTime.count() && i < _triggerList.count(); i++) {
_imageIndices.append(i);
if(_imageList.count() > _triggerList.count()) { // Logging dropouts
qCDebug(GeotaggingLog) << "Detected missing feedback packets.";
} else if (_imageList.count() < _triggerList.count()) { // Camera skipped frames
qCDebug(GeotaggingLog) << "Detected missing image frames.";
}
for(int i = 0; i < _imageList.count() && i < _triggerList.count(); i++) {
_imageIndices.append(_triggerList[i].imageSequence);
_triggerIndices.append(i);
}
......
......@@ -596,9 +596,9 @@ LogDownloadController::_prepareLogDownload()
_downloadData = new LogDownloadData(entry);
_downloadData->filename = QString("log_") + QString::number(entry->id()) + "_" + ftime;
if (_vehicle->firmwareType() == MAV_AUTOPILOT_PX4) {
// This is a stopgap and should be removed once log file types are properly supported by the log download protocol
if (_vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, "SYS_LOGGER")->rawValue().toInt() == 0) {
QString loggerParam("SYS_LOGGER");
if (_vehicle->parameterManager()->parameterExists(FactSystem::defaultComponentId, loggerParam) &&
_vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, loggerParam)->rawValue().toInt() == 0) {
_downloadData->filename += ".px4log";
} else {
_downloadData->filename += ".ulg";
......
......@@ -32,7 +32,7 @@ FactPanel {
TextInput {
text: fact2.value
property Fact fact2: controller.getParameterFact(200, "RC_MAP_THROTTLE")
property Fact fact2: controller.getParameterFact(1, "RC_MAP_THROTTLE")
onAccepted: fact2.value = text
}
......
......@@ -58,8 +58,8 @@ void FactSystemTestBase::_parameter_default_component_id_test(void)
void FactSystemTestBase::_parameter_specific_component_id_test(void)
{
QVERIFY(_vehicle->parameterManager()->parameterExists(200, "RC_MAP_THROTTLE"));
Fact* fact = _vehicle->parameterManager()->getParameter(200, "RC_MAP_THROTTLE");
QVERIFY(_vehicle->parameterManager()->parameterExists(MAV_COMP_ID_AUTOPILOT1, "RC_MAP_THROTTLE"));
Fact* fact = _vehicle->parameterManager()->getParameter(MAV_COMP_ID_AUTOPILOT1, "RC_MAP_THROTTLE");
QVERIFY(fact != NULL);
QVariant factValue = fact->rawValue();
QCOMPARE(factValue.isValid(), true);
......
......@@ -599,7 +599,7 @@ void ParameterManager::_waitingParamTimeout(void)
if (!paramsRequested && !_waitingForDefaultComponent && !_mapParameterName2Variant.contains(_vehicle->defaultComponentId())) {
// Initial load is complete but we still don't have any default component params. Wait one more cycle to see if the
// any show up.
qCDebug(ParameterManagerLog) << _logVehiclePrefix() << "Restarting _waitingParamTimeoutTimer - still don't have default component params";
qCDebug(ParameterManagerLog) << _logVehiclePrefix() << "Restarting _waitingParamTimeoutTimer - still don't have default component params" << _vehicle->defaultComponentId() << _mapParameterName2Variant.keys();
_waitingParamTimeoutTimer.start();
_waitingForDefaultComponent = true;
return;
......
......@@ -103,6 +103,7 @@ void APMGeoFenceManager::loadFromVehicle(void)
_polygon.clear();
if (!_fenceSupported) {
emit loadComplete(_breachReturnPoint, _polygon);
return;
}
......
......@@ -53,12 +53,17 @@ void APMRallyPointManager::sendToVehicle(const QList<QGeoCoordinate>& rgPoints)
void APMRallyPointManager::loadFromVehicle(void)
{
if (_vehicle->isOfflineEditingVehicle() || !rallyPointsSupported() || _readTransactionInProgress) {
if (_vehicle->isOfflineEditingVehicle() || _readTransactionInProgress) {
return;
}
_rgPoints.clear();
if (!rallyPointsSupported()) {
emit loadComplete(QList<QGeoCoordinate>());
return;
}
_cReadRallyPoints = _vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, _rallyTotalParam)->rawValue().toInt();
qCDebug(RallyPointManagerLog) << "APMRallyPointManager::loadFromVehicle - point count" << _cReadRallyPoints;
if (_cReadRallyPoints == 0) {
......
......@@ -410,6 +410,17 @@ const QVariantList& FirmwarePlugin::cameraList(const Vehicle* vehicle)
false,
this);
_cameraList.append(QVariant::fromValue(metaData));
metaData = new CameraMetaData(tr("Sony RX100 II 28mm"),
13.2,
8.8,
5472,
3648,
10.4,
true,
false,
this);
_cameraList.append(QVariant::fromValue(metaData));
}
return _cameraList;
......
......@@ -114,11 +114,8 @@ VideoManager::_rtspUrlChanged()
bool
VideoManager::hasVideo()
{
#if defined(QGC_GST_STREAMING)
return true;
#endif
QString videoSource = _videoSettings->videoSource()->rawValue().toString();
return !videoSource.isEmpty() && videoSource != VideoSettings::videoSourceNoVideo;
return !videoSource.isEmpty() && videoSource != VideoSettings::videoSourceNoVideo && videoSource != VideoSettings::videoDisabled;
}
//-----------------------------------------------------------------------------
......@@ -150,7 +147,7 @@ VideoManager::_updateSettings()
return;
if (_videoSettings->videoSource()->rawValue().toString() == VideoSettings::videoSourceUDP)
_videoReceiver->setUri(QStringLiteral("udp://0.0.0.0:%1").arg(_videoSettings->udpPort()->rawValue().toInt()));
else
else if (_videoSettings->videoSource()->rawValue().toString() == VideoSettings::videoSourceRTSP)
_videoReceiver->setUri(_videoSettings->rtspUrl()->rawValue().toString());
}
......
......@@ -155,6 +155,7 @@ void PlanMasterController::loadFromVehicle(void)
_loadGeoFence = true;
_syncInProgress = true;
emit syncInProgressChanged(true);
qCDebug(PlanMasterControllerLog) << "PlanMasterController::loadFromVehicle _missionController.loadFromVehicle";
_missionController.loadFromVehicle();
setDirty(false);
}
......@@ -166,6 +167,7 @@ void PlanMasterController::_loadMissionComplete(void)
if (_editMode && _loadGeoFence) {
_loadGeoFence = false;
_loadRallyPoints = true;
qCDebug(PlanMasterControllerLog) << "PlanMasterController::_loadMissionComplete _geoFenceController.loadFromVehicle";
_geoFenceController.loadFromVehicle();
setDirty(false);
}
......@@ -175,6 +177,7 @@ void PlanMasterController::_loadGeoFenceComplete(void)
{
if (_editMode && _loadRallyPoints) {
_loadRallyPoints = false;
qCDebug(PlanMasterControllerLog) << "PlanMasterController::_loadGeoFenceComplete _rallyPointController.loadFromVehicle";
_rallyPointController.loadFromVehicle();
setDirty(false);
}
......
......@@ -61,6 +61,7 @@
"shortDescription": "Amount of overlap between images in the forward facing direction.",
"type": "double",
"decimalPlaces": 0,
"min": 0,
"max": 85,
"units": "%",
"defaultValue": 10
......@@ -70,6 +71,7 @@
"shortDescription": "Amount of overlap between images in the side facing direction.",
"type": "double",
"decimalPlaces": 0,
"min": 0,
"max": 85,
"units": "%",
"defaultValue": 10
......
......@@ -13,13 +13,9 @@
#include <QtAndroidExtras/QtAndroidExtras>
#include <QtAndroidExtras/QAndroidJniObject>
static const char* kJniClassName = "org/mavlink/qgroundcontrol/QGCActivity";
//static const char* kJniClassName = "org/mavlink/qgroundcontrol/QGCActivity";
void MobileScreenMgr::setKeepScreenOn(bool keepScreenOn)
void MobileScreenMgr::setKeepScreenOn(bool /*keepScreenOn*/)
{
if (keepScreenOn) {
QAndroidJniObject::callStaticMethod<void>(kJniClassName, "keepScreenOn", "()V");
} else {
QAndroidJniObject::callStaticMethod<void>(kJniClassName, "restoreScreenOn", "()V");
}
//-- Screen is locked on while QGC is running on Android
}
......@@ -252,7 +252,7 @@ void QGroundControlQmlGlobal::_onGPSDisconnect()
void QGroundControlQmlGlobal::_GPSSurveyInStatus(float duration, float accuracyMM, bool valid, bool active)
{
_gpsRtkFactGroup.currentDuration()->setRawValue(duration);
_gpsRtkFactGroup.currentAccuracy()->setRawValue(accuracyMM);
_gpsRtkFactGroup.currentAccuracy()->setRawValue(accuracyMM/1000.0);
_gpsRtkFactGroup.valid()->setRawValue(valid);
_gpsRtkFactGroup.active()->setRawValue(active);
}
......
......@@ -109,6 +109,12 @@ Item {
mediumFontPointSize = defaultFontPointSize * _screenTools.mediumFontPointRatio
largeFontPointSize = defaultFontPointSize * _screenTools.largeFontPointRatio
minTouchPixels = Math.round(minTouchMillimeters * Screen.pixelDensity)
if (minTouchPixels / Screen.height > 0.15) {
// If using physical sizing takes up too much o fthe vertical real estate fall back to font based sizing
minTouchPixels = defaultFontPixelHeight * 3
}
console.log(minTouchPixels / Screen.height)
toolbarHeight = isMobile ? minTouchPixels : defaultFontPixelHeight * 3
}
......
......@@ -54,7 +54,7 @@ stQGeoTileCacheQGCMapTypes kMapTypes[] = {
{"Bing Street Map", UrlFactory::BingMap},
{"Bing Satellite Map", UrlFactory::BingSatellite},
{"Bing Hybrid Map", UrlFactory::BingHybrid},
{"Statkart Topo2", UrlFactory::StatkartTopo},
{"Statkart Terrain Map", UrlFactory::StatkartTopo},
/*
{"MapQuest Street Map", UrlFactory::MapQuestMap},
{"MapQuest Satellite Map", UrlFactory::MapQuestSat}
......
......@@ -120,7 +120,7 @@ QGeoTiledMappingManagerEngineQGC::QGeoTiledMappingManagerEngineQGC(const QVarian
mapTypes << QGCGEOMAPTYPE(QGeoMapType::HybridMap, "Bing Hybrid Map", "Bing hybrid map", false, false, UrlFactory::BingHybrid);
// Statkart
mapTypes << QGCGEOMAPTYPE(QGeoMapType::TerrainMap, "Statkart Topo2", "Statkart Topo2", false, false, UrlFactory::StatkartTopo);
mapTypes << QGCGEOMAPTYPE(QGeoMapType::TerrainMap, "Statkart Terrain Map", "Statkart Terrain Map", false, false, UrlFactory::StatkartTopo);
// Esri
mapTypes << QGCGEOMAPTYPE(QGeoMapType::StreetMap, "Esri Street Map", "ArcGIS Online World Street Map", true, false, UrlFactory::EsriWorldStreet);
......
......@@ -29,6 +29,7 @@ const char* VideoSettings::recordingFormatName = "RecordingFormat";
const char* VideoSettings::maxVideoSizeName = "MaxVideoSize";
const char* VideoSettings::videoSourceNoVideo = "No Video Available";
const char* VideoSettings::videoDisabled = "Video Stream Disabled";
const char* VideoSettings::videoSourceUDP = "UDP Video Stream";
const char* VideoSettings::videoSourceRTSP = "RTSP Video Stream";
......@@ -47,6 +48,7 @@ VideoSettings::VideoSettings(QObject* parent)
qmlRegisterUncreatableType<VideoSettings>("QGroundControl.SettingsManager", 1, 0, "VideoSettings", "Reference only");
// Setup enum values for videoSource settings into meta data
bool noVideo = false;
QStringList videoSourceList;
#ifdef QGC_GST_STREAMING
#ifndef NO_UDP_VIDEO
......@@ -61,7 +63,10 @@ VideoSettings::VideoSettings(QObject* parent)
}
#endif
if (videoSourceList.count() == 0) {
noVideo = true;
videoSourceList.append(videoSourceNoVideo);
} else {
videoSourceList.insert(0, videoDisabled);
}
QVariantList videoSourceVarList;
foreach (const QString& videoSource, videoSourceList) {
......@@ -70,11 +75,11 @@ VideoSettings::VideoSettings(QObject* parent)
_nameToMetaDataMap[videoSourceName]->setEnumInfo(videoSourceList, videoSourceVarList);
// Set default value for videoSource
#if defined(NO_UDP_VIDEO)
_nameToMetaDataMap[videoSourceName]->setRawDefaultValue(videoSourceRTSP);
#else
_nameToMetaDataMap[videoSourceName]->setRawDefaultValue(videoSourceUDP);
#endif
if (noVideo) {
_nameToMetaDataMap[videoSourceName]->setRawDefaultValue(videoSourceNoVideo);
} else {
_nameToMetaDataMap[videoSourceName]->setRawDefaultValue(videoDisabled);
}
}
Fact* VideoSettings::videoSource(void)
......
......@@ -49,6 +49,7 @@ public:
static const char* maxVideoSizeName;
static const char* videoSourceNoVideo;
static const char* videoDisabled;
static const char* videoSourceUDP;
static const char* videoSourceRTSP;
......
......@@ -8,8 +8,8 @@
"name": "currentAccuracy",
"shortDescription": "Current Accuracy",
"type": "double",
"decimalPlaces": 0,
"units": "mm"
"decimalPlaces": 1,
"units": "m"
},
{
"name": "currentDuration",
......
......@@ -74,6 +74,20 @@ void MultiVehicleManager::setToolbox(QGCToolbox *toolbox)
void MultiVehicleManager::_vehicleHeartbeatInfo(LinkInterface* link, int vehicleId, int componentId, int vehicleMavlinkVersion, int vehicleFirmwareType, int vehicleType)
{
if (componentId != MAV_COMP_ID_AUTOPILOT1) {
// Don't create vehicles for components other than the autopilot
if (!getVehicleById(vehicleId)) {
qCDebug(MultiVehicleManagerLog()) << "Ignoring heartbeat from unknown component "
<< link->getName()
<< vehicleId
<< componentId
<< vehicleMavlinkVersion
<< vehicleFirmwareType
<< vehicleType;
}
return;
}
if (_vehicles.count() > 0 && !qgcApp()->toolbox()->corePlugin()->options()->multiVehicleEnabled()) {
return;
}
......
......@@ -464,9 +464,11 @@ void Vehicle::resetCounters()
void Vehicle::_mavlinkMessageReceived(LinkInterface* link, mavlink_message_t message)
{
if (message.sysid != _id && message.sysid != 0) {
return;
// We allow RADIO_STATUS messages which come from a link the vehicle is using to pass through and be handled
if (!(message.msgid == MAVLINK_MSG_ID_RADIO_STATUS && _containsLink(link))) {
return;
}
}
if (!_containsLink(link)) {
......@@ -1802,6 +1804,7 @@ void Vehicle::_missionLoadComplete(void)
// After the initial mission request completes we ask for the geofence
if (!_geoFenceManagerInitialRequestSent) {
_geoFenceManagerInitialRequestSent = true;
qCDebug(VehicleLog) << "_missionLoadComplete requesting geoFence";
_geoFenceManager->loadFromVehicle();
}
}
......@@ -1811,13 +1814,14 @@ void Vehicle::_geoFenceLoadComplete(void)
// After geofence request completes we ask for the rally points
if (!_rallyPointManagerInitialRequestSent) {
_rallyPointManagerInitialRequestSent = true;
qCDebug(VehicleLog) << "_missionLoadComplete requesting rally points";
_rallyPointManager->loadFromVehicle();
}
}
void Vehicle::_rallyPointLoadComplete(void)
{
qCDebug(VehicleLog) << "_missionLoadComplete _initialPlanRequestComplete = true";
_initialPlanRequestComplete = true;
}
......
......@@ -220,10 +220,11 @@ VideoReceiver::start()
_starting = true;
bool isUdp = _uri.contains("udp://");
bool isUdp = _uri.contains("udp://");
bool isRtsp = _uri.contains("rtsp://");
//-- For RTSP, check to see if server is there first
if(!_serverPresent && !isUdp) {
if(!_serverPresent && isRtsp) {
_timer.start(100);
return;
}
......@@ -776,7 +777,7 @@ VideoReceiver::_updateTimer()
stop();
}
} else {
if(!running()) {
if(!running() && !_uri.isEmpty()) {
start();
}
}
......
......@@ -102,7 +102,8 @@ void MAVLinkProtocol::setToolbox(QGCToolbox *toolbox)
connect(this, &MAVLinkProtocol::saveTelemetryLog, _app, &QGCApplication::saveTelemetryLogOnMainThread);
connect(this, &MAVLinkProtocol::checkTelemetrySavePath, _app, &QGCApplication::checkTelemetrySavePathOnMainThread);
connect(_multiVehicleManager->vehicles(), &QmlObjectListModel::countChanged, this, &MAVLinkProtocol::_vehicleCountChanged);
connect(_multiVehicleManager, &MultiVehicleManager::vehicleAdded, this, &MAVLinkProtocol::_vehicleCountChanged);
connect(_multiVehicleManager, &MultiVehicleManager::vehicleRemoved, this, &MAVLinkProtocol::_vehicleCountChanged);
emit versionCheckChanged(m_enable_version_check);
}
......@@ -327,8 +328,9 @@ void MAVLinkProtocol::enableVersionCheck(bool enabled)
emit versionCheckChanged(enabled);
}
void MAVLinkProtocol::_vehicleCountChanged(int count)
void MAVLinkProtocol::_vehicleCountChanged(void)
{
int count = _multiVehicleManager->vehicles()->count();
if (count == 0) {
// Last vehicle is gone, close out logging
_stopLogging();
......
......@@ -163,7 +163,7 @@ signals:
void checkTelemetrySavePath(void);
private slots:
void _vehicleCountChanged(int count);
void _vehicleCountChanged(void);
private:
bool _closeLogFile(void);
......
......@@ -51,7 +51,7 @@ MockLink::MockLink(SharedLinkConfigurationPointer& config)
, _connected(false)
, _mavlinkChannel(0)
, _vehicleSystemId(_nextVehicleSystemId++)
, _vehicleComponentId(200)
, _vehicleComponentId(MAV_COMP_ID_AUTOPILOT1)
, _inNSH(false)
, _mavlinkStarted(true)
, _mavBaseMode(MAV_MODE_FLAG_MANUAL_INPUT_ENABLED | MAV_MODE_FLAG_CUSTOM_MODE_ENABLED)
......
......@@ -261,7 +261,7 @@ QGCView {
FactCheckBox {
text: qsTr("Save telemetry log even if vehicle was not armed")
fact: _telemetrySaveNotArmed
visible: !ScreenTools.isMobile && _telemetrySaveNotArmed.visible
visible: _telemetrySaveNotArmed.visible
enabled: promptSaveLog.checked
property Fact _telemetrySaveNotArmed: QGroundControl.settingsManager.appSettings.telemetrySaveNotArmed
}
......@@ -529,7 +529,7 @@ QGCView {
}
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: QGroundControl.settingsManager.videoSettings.udpPort.visible && QGroundControl.videoManager.isGStreamer && videoSource.currentIndex === 0
visible: QGroundControl.settingsManager.videoSettings.udpPort.visible && QGroundControl.videoManager.isGStreamer && videoSource.currentIndex === 1
QGCLabel {
text: qsTr("UDP Port:")
width: _labelWidth
......@@ -543,7 +543,7 @@ QGCView {
}
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: QGroundControl.settingsManager.videoSettings.rtspUrl.visible && QGroundControl.videoManager.isGStreamer && videoSource.currentIndex === 1
visible: QGroundControl.settingsManager.videoSettings.rtspUrl.visible && QGroundControl.videoManager.isGStreamer && videoSource.currentIndex === 2
QGCLabel {
anchors.verticalCenter: parent.verticalCenter
text: qsTr("RTSP URL:")
......@@ -557,7 +557,7 @@ QGCView {
}
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: QGroundControl.videoManager.isGStreamer && videoSource.currentIndex < 2 && QGroundControl.settingsManager.videoSettings.aspectRatio.visible
visible: QGroundControl.videoManager.isGStreamer && videoSource.currentIndex && videoSource.currentIndex < 3 && QGroundControl.settingsManager.videoSettings.aspectRatio.visible
QGCLabel {
text: qsTr("Aspect Ratio:")
width: _labelWidth
......@@ -571,7 +571,7 @@ QGCView {
}
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: QGroundControl.videoManager.isGStreamer && videoSource.currentIndex < 2 && QGroundControl.settingsManager.videoSettings.gridLines.visible
visible: QGroundControl.videoManager.isGStreamer && videoSource.currentIndex && videoSource.currentIndex < 3 && QGroundControl.settingsManager.videoSettings.gridLines.visible
QGCLabel {
text: qsTr("Grid Lines:")
width: _labelWidth
......@@ -613,7 +613,7 @@ QGCView {
anchors.centerIn: parent
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: QGroundControl.videoManager.isGStreamer && videoSource.currentIndex < 2 && QGroundControl.settingsManager.videoSettings.maxVideoSize.visible
visible: QGroundControl.videoManager.isGStreamer && videoSource.currentIndex && videoSource.currentIndex < 3 && QGroundControl.settingsManager.videoSettings.maxVideoSize.visible
QGCLabel {
text: qsTr("Max Storage Usage:")
width: _labelWidth
......@@ -627,7 +627,7 @@ QGCView {
}
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: QGroundControl.videoManager.isGStreamer && videoSource.currentIndex < 2 && QGroundControl.settingsManager.videoSettings.recordingFormat.visible
visible: QGroundControl.videoManager.isGStreamer && videoSource.currentIndex && videoSource.currentIndex < 3 && QGroundControl.settingsManager.videoSettings.recordingFormat.visible
QGCLabel {
text: qsTr("Video File Format:")
width: _labelWidth
......
......@@ -71,7 +71,7 @@ Item {
text: QGroundControl.gpsRtk.valid.value ? qsTr("Accuracy:") : qsTr("Current Accuracy:")
}
QGCLabel {
text: (QGroundControl.gpsRtk.currentAccuracy.value/1000).toFixed(1) + ' m'
text: QGroundControl.gpsRtk.currentAccuracy.valueString + " " + QGroundControl.appSettingsDistanceUnitsString
}
QGCLabel { text: qsTr("Satellites:") }
QGCLabel { text: QGroundControl.gpsRtk.numSatellites.value }
......@@ -91,7 +91,7 @@ Item {
width: height
anchors.top: parent.top
anchors.bottom: parent.bottom
source: "/qmlimages/Gps.svg"
source: "/qmlimages/RTK.svg"
fillMode: Image.PreserveAspectFit
sourceSize.height: height
opacity: 1
......@@ -109,12 +109,6 @@ Item {
color: qgcPal.buttonText
text: QGroundControl.gpsRtk.numSatellites.value
}
QGCLabel {
id: numSatValue
color: qgcPal.buttonText
text: qsTr("RTK")
}
}
MouseArea {
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1"
id="svg3852" inkscape:version="0.91 r13725" sodipodi:docname="gps.svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="72px" height="72px"
viewBox="-250 452 72 72" style="enable-background:new -250 452 72 72;" xml:space="preserve">
<style type="text/css">
.st0{display:none;}
.st1{display:inline;}
.st2{fill:none;stroke:#EB008B;stroke-width:0.25;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st3{display:inline;fill:none;stroke:#224A80;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st4{fill:#FFFFFF;}
</style>
<title id="title4758">GPS</title>
<sodipodi:namedview bordercolor="#666666" borderopacity="1" gridtolerance="10" guidetolerance="10" id="namedview3929" inkscape:current-layer="svg3852" inkscape:cx="55" inkscape:cy="55" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-height="480" inkscape:window-width="640" inkscape:zoom="11.136364" objecttolerance="10" pagecolor="#808080" showgrid="false">
</sodipodi:namedview>
<g id="Layer_2" class="st0">
</g>
<g id="ex_thick" transform="matrix(-1,0,0,-1,111.82126,108.29692)">
</g>
<g id="Layer_2_copy_3" class="st0">
</g>
<g id="ex_thin" transform="matrix(-1,0,0,-1,111.82126,108.29692)">
</g>
<g id="Layer_2_copy" class="st0">
</g>
<g id="em_thick" transform="matrix(-1,0,0,-1,111.82126,108.29692)">
</g>
<g id="Layer_2_copy_4" class="st0">
<g id="g3861" class="st1">
<rect id="rect3863" x="-286.1" y="320.7" class="st2" width="56.3" height="56.3"/>
<circle id="circle3865" class="st2" cx="-258" cy="348.8" r="28.2"/>
</g>
<g id="g3867" class="st1">
<rect id="rect3869" x="-221.7" y="320.7" class="st2" width="56.3" height="56.3"/>
<circle id="circle3871" class="st2" cx="-193.5" cy="348.8" r="28.2"/>
</g>
<g id="g3873" class="st1">
<rect id="rect3875" x="-158.5" y="320.7" class="st2" width="56.3" height="56.3"/>
<circle id="circle3877" class="st2" cx="-130.3" cy="348.8" r="28.2"/>
</g>
</g>
<g id="Layer_2_copy_2" class="st0">
<g id="g3905" class="st1">
<rect id="rect3907" x="-286.1" y="425.3" class="st2" width="56.3" height="56.3"/>
<circle id="circle3909" class="st2" cx="-258" cy="453.5" r="28.2"/>
</g>
<g id="g3911" class="st1">
<rect id="rect3913" x="-221.7" y="425.3" class="st2" width="56.3" height="56.3"/>
<circle id="circle3915" class="st2" cx="-193.5" cy="453.5" r="28.2"/>
</g>
<g id="g3917" class="st1">
<rect id="rect3919" x="-158.5" y="425.3" class="st2" width="56.3" height="56.3"/>
<circle id="circle3921" class="st2" cx="-130.3" cy="453.5" r="28.2"/>
</g>
</g>
<g id="hornet" transform="matrix(-1,0,0,-1,111.82126,108.29692)">
</g>
<g id="Layer_2_copy_5" class="st0">
</g>
<g id="hornet_THIN" transform="matrix(-1,0,0,-1,111.82126,108.29692)">
</g>
<g id="Layer_6" class="st0">
<polygon id="polygon3927" class="st3" points="-264.6,453.2 -269.5,453.2 -269.5,494.2 -246.6,494.2 -246.6,453.2 -251.5,453.2
-251.5,446.7 -264.6,446.7 "/>
</g>
<g>
<path class="st4" d="M-191.329,453.029h-45.342c-6.367,0-11.529,5.162-11.529,11.529v27.036c0,6.367,5.162,11.529,11.529,11.529
h8.873l10.29,17.822c1.559,2.701,5.458,2.701,7.017,0l10.29-17.822h8.873c6.367,0,11.529-5.162,11.529-11.529v-27.036
C-179.8,458.191-184.962,453.029-191.329,453.029z M-230.905,487.959l-2.984-5.521c-0.378-0.715-0.715-1.179-1.011-1.392
c-0.402-0.279-0.858-0.419-1.368-0.419h-0.493v7.332h-5.607v-18.066h9.304c1.725,0,3.044,0.148,3.956,0.444
c0.912,0.295,1.647,0.844,2.206,1.645c0.559,0.8,0.838,1.776,0.838,2.926c0,1.002-0.214,1.866-0.641,2.594
c-0.427,0.727-1.015,1.317-1.763,1.768c-0.477,0.288-1.13,0.526-1.961,0.715c0.665,0.222,1.15,0.444,1.453,0.666
c0.205,0.148,0.503,0.465,0.893,0.95c0.39,0.486,0.65,0.859,0.782,1.123l2.704,5.234H-230.905z M-207.333,474.355h-5.694v13.605
h-5.582v-13.605h-5.693v-4.461h16.969V474.355z M-192.508,487.959l-3.808-7.429l-2.885,3.021v4.408h-5.582v-18.066h5.582v6.827
l5.847-6.827h7.424l-6.592,6.82l6.889,11.247H-192.508z"/>
<path class="st4" d="M-234.308,473.542h-2.452v3.672h2.354c0.255,0,0.747-0.082,1.479-0.246c0.37-0.075,0.672-0.264,0.906-0.567
s0.351-0.653,0.351-1.047c0-0.583-0.185-1.031-0.555-1.343C-232.596,473.698-233.29,473.542-234.308,473.542z"/>
</g>
</svg>
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