Unverified Commit 981e09ce authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #6801 from DonLakeFlyer/StableMasterMerge

Bring master up to date with Stable 3.4
parents 0ed5e50f c6ade1a0
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -349,13 +349,12 @@ 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)) {
newItem->setCommand(takeoffCmd);
}
}
newItem->setDefaultsForCommand();
if (newItem->specifiesAltitude()) {
double prevAltitude;
int prevAltitudeMode;
......@@ -382,7 +381,6 @@ int MissionController::insertROIMissionItem(QGeoCoordinate coordinate, int i)
MAV_CMD_DO_SET_ROI_LOCATION :
MAV_CMD_DO_SET_ROI));
_initVisualItem(newItem);
newItem->setDefaultsForCommand();
newItem->setCoordinate(coordinate);
double prevAltitude;
......
......@@ -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);
......
......@@ -385,11 +385,6 @@ void TransectStyleComplexItem::_rebuildTransects(void)
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
......@@ -400,6 +395,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;
......@@ -436,6 +445,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
}
}
......
......@@ -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 {
......
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