From 45056a5479332d9246d1a2a5af07105eb3c3acb8 Mon Sep 17 00:00:00 2001 From: DonLakeFlyer Date: Sat, 29 Jul 2017 11:29:30 -0700 Subject: [PATCH 1/4] Add new map indicator colors --- src/QGCPalette.cc | 4 +++- src/QGCPalette.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/QGCPalette.cc b/src/QGCPalette.cc index dd55443472e..ec5ac8fa79e 100644 --- a/src/QGCPalette.cc +++ b/src/QGCPalette.cc @@ -60,9 +60,11 @@ void QGCPalette::_buildMap(void) DECLARE_QGC_COLOR(primaryButton, "#585858", "#8cb3be", "#585858", "#8cb3be") DECLARE_QGC_COLOR(primaryButtonText, "#2c2c2c", "#000000", "#2c2c2c", "#000000") DECLARE_QGC_COLOR(textField, "#ffffff", "#ffffff", "#585858", "#ffffff") - DECLARE_QGC_COLOR(textFieldText, "#dedede", "#000000", "#2c2c2c", "#000000") + DECLARE_QGC_COLOR(textFieldText, "#808080", "#000000", "#bfbfbf", "#000000") DECLARE_QGC_COLOR(mapButton, "#585858", "#000000", "#585858", "#000000") DECLARE_QGC_COLOR(mapButtonHighlight, "#585858", "#be781c", "#585858", "#be781c") + DECLARE_QGC_COLOR(mapIndicator, "#585858", "#be781c", "#585858", "#be781c") + DECLARE_QGC_COLOR(mapIndicatorChild, "#585858", "#766043", "#585858", "#766043") DECLARE_QGC_COLOR(colorGreen, "#009431", "#009431", "#00e04b", "#00e04b") DECLARE_QGC_COLOR(colorOrange, "#b95604", "#b95604", "#de8500", "#de8500") DECLARE_QGC_COLOR(colorRed, "#ed3939", "#ed3939", "#f32836", "#f32836") diff --git a/src/QGCPalette.h b/src/QGCPalette.h index 1c47116b8db..03a9f04b301 100644 --- a/src/QGCPalette.h +++ b/src/QGCPalette.h @@ -89,6 +89,8 @@ class QGCPalette : public QObject DEFINE_QGC_COLOR(textFieldText, setTextFieldText) DEFINE_QGC_COLOR(mapButton, setMapButton) DEFINE_QGC_COLOR(mapButtonHighlight, setMapButtonHighlight) + DEFINE_QGC_COLOR(mapIndicator, setMapIndicator) + DEFINE_QGC_COLOR(mapIndicatorChild, setMapIndicatorChild) DEFINE_QGC_COLOR(mapWidgetBorderLight, setMapWidgetBorderLight) DEFINE_QGC_COLOR(mapWidgetBorderDark, setMapWidgetBorderDark) DEFINE_QGC_COLOR(brandingPurple, setBrandingPurple) From 37bcff0d7da5cfe05e12cacd85e9c2e28b4d38ef Mon Sep 17 00:00:00 2001 From: DonLakeFlyer Date: Sat, 29 Jul 2017 11:29:46 -0700 Subject: [PATCH 2/4] New coloring for child indicators --- src/PlanView/SimpleItemMapVisual.qml | 1 + src/QmlControls/MissionItemIndexLabel.qml | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/PlanView/SimpleItemMapVisual.qml b/src/PlanView/SimpleItemMapVisual.qml index f78bcb46e92..2677f6504bf 100644 --- a/src/PlanView/SimpleItemMapVisual.qml +++ b/src/PlanView/SimpleItemMapVisual.qml @@ -121,6 +121,7 @@ Item { z: 2 label: object.abbreviation.length === 0 ? object.sequenceNumber : object.abbreviation.charAt(0) checked: object.isCurrentItem + child: true specifiesCoordinate: false onClicked: _root.clicked(object.sequenceNumber) diff --git a/src/QmlControls/MissionItemIndexLabel.qml b/src/QmlControls/MissionItemIndexLabel.qml index 2b226e4be58..1393a35994a 100644 --- a/src/QmlControls/MissionItemIndexLabel.qml +++ b/src/QmlControls/MissionItemIndexLabel.qml @@ -12,11 +12,12 @@ Canvas { signal clicked - property string label ///< Label to show to the side of the index indicator - property int index: 0 ///< Index to show in the indicator, 0 will show single char label instead, -1 first char of label in indicator full label to the side + property string label ///< Label to show to the side of the index indicator + property int index: 0 ///< Index to show in the indicator, 0 will show single char label instead, -1 first char of label in indicator full label to the side property bool checked: false property bool small: false - property var color: checked ? "green" : qgcPal.mapButtonHighlight + property bool child: false + property var color: checked ? "green" : (child ? qgcPal.mapIndicatorChild : qgcPal.mapIndicator) property real anchorPointX: _height / 2 property real anchorPointY: _height / 2 property bool specifiesCoordinate: true From 3aadceca15b0a5e3cfc6f132ec168c6b2511c672 Mon Sep 17 00:00:00 2001 From: DonLakeFlyer Date: Sat, 29 Jul 2017 11:30:23 -0700 Subject: [PATCH 3/4] Change to fixed value is altitude when switching to Manual grid This way if the user switches away from manual the altitude is preserved --- src/PlanView/SurveyItemEditor.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PlanView/SurveyItemEditor.qml b/src/PlanView/SurveyItemEditor.qml index 7c49b509bd2..5f68e3dccdc 100644 --- a/src/PlanView/SurveyItemEditor.qml +++ b/src/PlanView/SurveyItemEditor.qml @@ -214,6 +214,7 @@ Rectangle { onActivated: { if (index == _gridTypeManual) { missionItem.manualGrid.value = true + missionItem.fixedValueIsAltitude.value = true } else if (index == _gridTypeCustomCamera) { missionItem.manualGrid.value = false missionItem.camera.value = gridTypeCombo.textAt(index) From 579b7b0707d1105b5e787d43bdb6b88aeb41f967 Mon Sep 17 00:00:00 2001 From: DonLakeFlyer Date: Sat, 29 Jul 2017 11:31:17 -0700 Subject: [PATCH 4/4] Better handling a mission altitude default * If new Survey is set to altitude fixed value then use mission default altitude * If the user applies a new altitude to the entire mission change surveys to fixed altitude and apply altitude --- src/MissionManager/SurveyMissionItem.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/MissionManager/SurveyMissionItem.cc b/src/MissionManager/SurveyMissionItem.cc index e9d63b832bc..eb28e7ec78f 100644 --- a/src/MissionManager/SurveyMissionItem.cc +++ b/src/MissionManager/SurveyMissionItem.cc @@ -14,6 +14,8 @@ #include "QGCGeo.h" #include "QGroundControlQmlGlobal.h" #include "QGCQGeoCoordinate.h" +#include "SettingsManager.h" +#include "AppSettings.h" #include @@ -117,6 +119,11 @@ SurveyMissionItem::SurveyMissionItem(Vehicle* vehicle, QObject* parent) _turnaroundDistFact.setRawValue(5); } + // We override the grid altitude to the mission default + if (_manualGridFact.rawValue().toBool() || _fixedValueIsAltitudeFact.rawValue().toBool()) { + _gridAltitudeFact.setRawValue(qgcApp()->toolbox()->settingsManager()->appSettings()->defaultMissionItemAltitude()->rawValue()); + } + connect(&_gridSpacingFact, &Fact::valueChanged, this, &SurveyMissionItem::_generateGrid); connect(&_gridAngleFact, &Fact::valueChanged, this, &SurveyMissionItem::_generateGrid); connect(&_gridEntryLocationFact, &Fact::valueChanged, this, &SurveyMissionItem::_generateGrid); @@ -1361,6 +1368,7 @@ double SurveyMissionItem::_turnaroundDistance(void) const void SurveyMissionItem::applyNewAltitude(double newAltitude) { + _fixedValueIsAltitudeFact.setRawValue(true); _gridAltitudeFact.setRawValue(newAltitude); }