Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mission/Survey related fixes #5508

Merged
merged 4 commits into from
Jul 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/MissionManager/SurveyMissionItem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include "QGCGeo.h"
#include "QGroundControlQmlGlobal.h"
#include "QGCQGeoCoordinate.h"
#include "SettingsManager.h"
#include "AppSettings.h"

#include <QPolygonF>

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -1361,6 +1368,7 @@ double SurveyMissionItem::_turnaroundDistance(void) const

void SurveyMissionItem::applyNewAltitude(double newAltitude)
{
_fixedValueIsAltitudeFact.setRawValue(true);
_gridAltitudeFact.setRawValue(newAltitude);
}

Expand Down
1 change: 1 addition & 0 deletions src/PlanView/SimpleItemMapVisual.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/PlanView/SurveyItemEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion src/QGCPalette.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 2 additions & 0 deletions src/QGCPalette.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 4 additions & 3 deletions src/QmlControls/MissionItemIndexLabel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down