From e6e812d67df3c2c1c32e0246d8ec1eb73d0b814c Mon Sep 17 00:00:00 2001 From: DoinLakeFlyer Date: Thu, 23 Apr 2020 20:28:08 -0700 Subject: [PATCH] Small visual tweaks and fixups for patterns --- .../FactControls/AltitudeFactTextField.qml | 13 ++++++------ src/MissionManager/CameraCalc.cc | 2 +- src/MissionManager/CameraCalc.h | 7 +++++++ src/MissionManager/MissionSettingsItem.cc | 4 +++- .../TransectStyle.SettingsGroup.json | 2 +- src/PlanView/CameraCalcCamera.qml | 5 ----- src/PlanView/CameraCalcGrid.qml | 20 +++++++++++-------- src/PlanView/CorridorScanEditor.qml | 9 +-------- src/PlanView/StructureScanEditor.qml | 7 +------ src/PlanView/SurveyItemEditor.qml | 19 +----------------- 10 files changed, 34 insertions(+), 54 deletions(-) diff --git a/src/FactSystem/FactControls/AltitudeFactTextField.qml b/src/FactSystem/FactControls/AltitudeFactTextField.qml index 2775af2e8..5a22eca3a 100644 --- a/src/FactSystem/FactControls/AltitudeFactTextField.qml +++ b/src/FactSystem/FactControls/AltitudeFactTextField.qml @@ -16,12 +16,13 @@ import QGroundControl.Controls 1.0 import QGroundControl.ScreenTools 1.0 FactTextField { - unitsLabel: fact ? fact.units : "" - extraUnitsLabel: fact ? _altitudeModeExtraUnits : "" - showUnits: true - showHelp: true + unitsLabel: fact ? fact.units : "" + extraUnitsLabel: fact ? _altitudeModeExtraUnits : "" + showUnits: true + showHelp: true - property int altitudeMode: QGroundControl.AltitudeModeNone + property int altitudeMode: QGroundControl.AltitudeModeNone + property bool showAboveTerrainWarning: true readonly property string _altModeNoneExtraUnits: "" readonly property string _altModeRelativeExtraUnits: qsTr("(Rel)") @@ -44,7 +45,7 @@ FactTextField { _altitudeModeExtraUnits = _altModeAbsoluteExtraUnits } else if (altitudeMode === QGroundControl.AltitudeModeAboveTerrain) { _altitudeModeExtraUnits = _altModeAboveTerrainExtraUnits - if (!_aboveTerrainWarning.rawValue) { + if (!_aboveTerrainWarning.rawValue && showAboveTerrainWarning) { mainWindow.showComponentDialog(aboveTerrainWarning, qsTr("Warning"), mainWindow.showDialogDefaultWidth, StandardButton.Ok) } } else if (missionItem.altitudeMode === QGroundControl.AltitudeModeTerrainFrame) { diff --git a/src/MissionManager/CameraCalc.cc b/src/MissionManager/CameraCalc.cc index 06c8edca3..39a9719d9 100644 --- a/src/MissionManager/CameraCalc.cc +++ b/src/MissionManager/CameraCalc.cc @@ -29,7 +29,7 @@ const char* CameraCalc::_jsonCameraSpecTypeKey = "CameraSpecType"; CameraCalc::CameraCalc(PlanMasterController* masterController, const QString& settingsGroup, QObject* parent) : CameraSpec (settingsGroup, parent) - , _dirty (masterController) + , _dirty (false) , _disableRecalc (false) , _distanceToSurfaceRelative (true) , _metaDataMap (FactMetaData::createMapFromJsonFile(QStringLiteral(":/json/CameraCalc.FactMetaData.json"), this)) diff --git a/src/MissionManager/CameraCalc.h b/src/MissionManager/CameraCalc.h index 22cf4d797..054160cf7 100644 --- a/src/MissionManager/CameraCalc.h +++ b/src/MissionManager/CameraCalc.h @@ -33,6 +33,13 @@ public: Q_PROPERTY(Fact* sideOverlap READ sideOverlap CONSTANT) Q_PROPERTY(Fact* adjustedFootprintSide READ adjustedFootprintSide CONSTANT) ///< Side footprint adjusted down for overlap Q_PROPERTY(Fact* adjustedFootprintFrontal READ adjustedFootprintFrontal CONSTANT) ///< Frontal footprint adjusted down for overlap + + // When we are creating a manual grid we still use CameraCalc to store the manual grid information. It's a bastardization of what + // CameraCalc is meant for but it greatly simplifies code and persistance of manual grids. + // grid altitude - distanceToSurface + // grid altitude mode - distanceToSurfaceRelative + // trigger distance - adjustedFootprintFrontal + // transect spacing - adjustedFootprintSide Q_PROPERTY(bool distanceToSurfaceRelative READ distanceToSurfaceRelative WRITE setDistanceToSurfaceRelative NOTIFY distanceToSurfaceRelativeChanged) // The following values are calculated from the camera properties diff --git a/src/MissionManager/MissionSettingsItem.cc b/src/MissionManager/MissionSettingsItem.cc index 4302a21ea..7712faa18 100644 --- a/src/MissionManager/MissionSettingsItem.cc +++ b/src/MissionManager/MissionSettingsItem.cc @@ -190,7 +190,9 @@ void MissionSettingsItem::_setCoordinateWorker(const QGeoCoordinate& coordinate) _plannedHomePositionCoordinate = coordinate; emit coordinateChanged(coordinate); emit exitCoordinateChanged(coordinate); - _plannedHomePositionAltitudeFact.setRawValue(coordinate.altitude()); + if (_plannedHomePositionFromVehicle) { + _plannedHomePositionAltitudeFact.setRawValue(coordinate.altitude()); + } } } diff --git a/src/MissionManager/TransectStyle.SettingsGroup.json b/src/MissionManager/TransectStyle.SettingsGroup.json index fe86299ea..d65116894 100644 --- a/src/MissionManager/TransectStyle.SettingsGroup.json +++ b/src/MissionManager/TransectStyle.SettingsGroup.json @@ -37,7 +37,7 @@ }, { "name": "TerrainAdjustTolerance", - "shortDescription": "If adjacent terrain waypoints are within this tolerence they will be removed.", + "shortDescription": "Additional waypoints within the transect will be added if the terrain altitude difference grows larger than this tolerance.", "type": "double", "decimalPlaces": 2, "min": 0, diff --git a/src/PlanView/CameraCalcCamera.qml b/src/PlanView/CameraCalcCamera.qml index 089b00304..4f74ade24 100644 --- a/src/PlanView/CameraCalcCamera.qml +++ b/src/PlanView/CameraCalcCamera.qml @@ -15,11 +15,6 @@ Column { spacing: _margin property var cameraCalc - property bool vehicleFlightIsFrontal: true - property string distanceToSurfaceLabel - property int distanceToSurfaceAltitudeMode: QGroundControl.AltitudeModeNone - property string frontalDistanceLabel - property string sideDistanceLabel property real _margin: ScreenTools.defaultFontPixelWidth / 2 property string _cameraName: cameraCalc.cameraName.value diff --git a/src/PlanView/CameraCalcGrid.qml b/src/PlanView/CameraCalcGrid.qml index 04250e33a..f651208b1 100644 --- a/src/PlanView/CameraCalcGrid.qml +++ b/src/PlanView/CameraCalcGrid.qml @@ -87,21 +87,24 @@ Column { QGCRadioButton { id: fixedDistanceRadio + leftPadding: 0 text: distanceToSurfaceLabel checked: !!cameraCalc.valueSetIsDistance.value onClicked: cameraCalc.valueSetIsDistance.value = 1 } AltitudeFactTextField { - fact: cameraCalc.distanceToSurface - altitudeMode: distanceToSurfaceAltitudeMode - enabled: fixedDistanceRadio.checked - Layout.fillWidth: true + fact: cameraCalc.distanceToSurface + altitudeMode: distanceToSurfaceAltitudeMode + showAboveTerrainWarning: false + enabled: fixedDistanceRadio.checked + Layout.fillWidth: true } QGCRadioButton { id: fixedImageDensityRadio - text: qsTr("Ground Res") + leftPadding: 0 + text: qsTr("Grnd Res") checked: !cameraCalc.valueSetIsDistance.value onClicked: cameraCalc.valueSetIsDistance.value = 0 } @@ -125,9 +128,10 @@ Column { QGCLabel { text: distanceToSurfaceLabel } AltitudeFactTextField { - fact: cameraCalc.distanceToSurface - altitudeMode: distanceToSurfaceAltitudeMode - Layout.fillWidth: true + fact: cameraCalc.distanceToSurface + altitudeMode: distanceToSurfaceAltitudeMode + showAboveTerrainWarning: false + Layout.fillWidth: true } QGCLabel { text: frontalDistanceLabel } diff --git a/src/PlanView/CorridorScanEditor.qml b/src/PlanView/CorridorScanEditor.qml index d4cde246c..752e48408 100644 --- a/src/PlanView/CorridorScanEditor.qml +++ b/src/PlanView/CorridorScanEditor.qml @@ -252,14 +252,7 @@ Rectangle { visible: tabBar.currentIndex == 1 CameraCalcCamera { - cameraCalc: missionItem.cameraCalc - vehicleFlightIsFrontal: true - distanceToSurfaceLabel: qsTr("Altitude") - distanceToSurfaceAltitudeMode: missionItem.followTerrain ? - QGroundControl.AltitudeModeAboveTerrain : - missionItem.cameraCalc.distanceToSurfaceRelative - frontalDistanceLabel: qsTr("Trigger Dist") - sideDistanceLabel: qsTr("Spacing") + cameraCalc: missionItem.cameraCalc } } } diff --git a/src/PlanView/StructureScanEditor.qml b/src/PlanView/StructureScanEditor.qml index 60f222d65..621db0c50 100644 --- a/src/PlanView/StructureScanEditor.qml +++ b/src/PlanView/StructureScanEditor.qml @@ -247,12 +247,7 @@ Rectangle { visible: tabBar.currentIndex == 1 CameraCalcCamera { - cameraCalc: missionItem.cameraCalc - vehicleFlightIsFrontal: false - distanceToSurfaceLabel: qsTr("Scan Distance") - distanceToSurfaceAltitudeMode: QGroundControl.AltitudeModeNone - frontalDistanceLabel: qsTr("Layer Height") - sideDistanceLabel: qsTr("Trigger Distance") + cameraCalc: missionItem.cameraCalc } } } diff --git a/src/PlanView/SurveyItemEditor.qml b/src/PlanView/SurveyItemEditor.qml index 12b8c3d2f..805384714 100644 --- a/src/PlanView/SurveyItemEditor.qml +++ b/src/PlanView/SurveyItemEditor.qml @@ -280,16 +280,6 @@ Rectangle { spacing: _margin visible: transectsHeader.checked - /* - Temporarily removed due to bug https://github.com/mavlink/qgroundcontrol/issues/7005 - FactCheckBox { - text: qsTr("Split concave polygons") - fact: _splitConcave - visible: _splitConcave.visible - property Fact _splitConcave: missionItem.splitConcavePolygons - } - */ - QGCOptionsComboBox { Layout.fillWidth: true @@ -405,14 +395,7 @@ Rectangle { visible: tabBar.currentIndex == 1 CameraCalcCamera { - cameraCalc: missionItem.cameraCalc - vehicleFlightIsFrontal: true - distanceToSurfaceLabel: qsTr("Altitude") - distanceToSurfaceAltitudeMode: missionItem.followTerrain ? - QGroundControl.AltitudeModeAboveTerrain : - missionItem.cameraCalc.distanceToSurfaceRelative - frontalDistanceLabel: qsTr("Trigger Dist") - sideDistanceLabel: qsTr("Spacing") + cameraCalc: missionItem.cameraCalc } } // Camera Column -- 2.22.0