Commit 56d4d813 authored by Valentin Platzgummer's avatar Valentin Platzgummer

gui edited

parent 470c9ab4
optimize circular survey
remove Reference artefacts
solve Dijkstra issue (no path found, for some geometries)
......@@ -222,6 +222,9 @@
<file alias="QGroundControl/Controls/WimaMeasurementAreaEditor.qml">src/WimaView/WimaMeasurementAreaEditor.qml</file>
<file alias="QGroundControl/Controls/SpericalSurveyMapVisual.qml">src/WimaView/SphericalSurveyMapVisual.qml</file>
<file alias="CircularSurveyItemEditor.qml">src/PlanView/CircularSurveyItemEditor.qml</file>
<file alias="QGroundControl/Controls/DragCoordinate.qml">src/WimaView/DragCoordinate.qml</file>
<file alias="QGroundControl/Controls/CoordinateIndicatorDrag.qml">src/WimaView/CoordinateIndicatorDrag.qml</file>
<file alias="QGroundControl/Controls/CoordinateIndicator.qml">src/WimaView/CoordinateIndicator.qml</file>
</qresource>
<qresource prefix="/json">
<file alias="APMMavlinkStreamRate.SettingsGroup.json">src/Settings/APMMavlinkStreamRate.SettingsGroup.json</file>
......
......@@ -82,7 +82,7 @@ Rectangle {
/*QGCSlider {
id: rSlider
minimumValue: 0.1
maximumValue: 20
maximumValue: 5
stepSize: 0.1
tickmarksEnabled: false
Layout.fillWidth: true
......@@ -102,8 +102,8 @@ Rectangle {
QGCSlider {
id: angleSlider
minimumValue: 0.1
maximumValue: 20
minimumValue: 0.3
maximumValue: 5
stepSize: 0.1
tickmarksEnabled: false
Layout.fillWidth: true
......
......@@ -96,5 +96,8 @@ WimaItemEditor 1.0 WimaItemEditor.qml
WimaMapPolygonVisuals 1.0 WimaMapPolygonVisuals.qml
WimaMapPolylineVisuals 1.0 WimaMapPolylineVisuals.qml
SphericalSurveyMapVisual 1.0 SphericalSurveyMapVisual.qml
DragCoordinate 1.0 DragCoordinate.qml
CoordinateIndicator 1.0 CoordinateIndicator.qml
CoordinateIndicatorDrag 1.0 CoordinateIndicatorDrag.qml
......@@ -15,6 +15,6 @@
"units": "Deg",
"min": 0.3,
"decimalPlaces": 1,
"defaultValue": 0.5
"defaultValue": 1
}
]
#include "CircularSurveyComplexItem.h"
const char* CircularSurveyComplexItem::settingsGroup = "Survey";
const char* CircularSurveyComplexItem::settingsGroup = "CircularSurvey";
const char* CircularSurveyComplexItem::deltaRName = "DeltaR";
const char* CircularSurveyComplexItem::deltaAlphaName = "DeltaAlpha";
CircularSurveyComplexItem::CircularSurveyComplexItem(Vehicle *vehicle, bool flyView, const QString &kmlOrShpFile, QObject *parent)
: TransectStyleComplexItem (vehicle, flyView, settingsGroup, parent)
, _referencePoint (QGeoCoordinate(47.770859, 16.531076,0))
, _referencePoint (QGeoCoordinate(0, 0,0))
, _metaDataMap (FactMetaData::createMapFromJsonFile(QStringLiteral(":/json/CircularSurvey.SettingsGroup.json"), this))
, _deltaR (settingsGroup, _metaDataMap[deltaRName])
, _deltaAlpha (settingsGroup, _metaDataMap[deltaAlphaName])
{
_editorQml = "qrc:/qml/CircularSurveyItemEditor.qml";
//connect(&_deltaR, &Fact::valueChanged, this, &CircularSurveyComplexItem::_setDirty);
//connect(&_deltaAlpha, &Fact::valueChanged, this, &CircularSurveyComplexItem::_setDirty);
connect(&_deltaR, &Fact::valueChanged, this, &CircularSurveyComplexItem::_setDirty);
connect(&_deltaAlpha, &Fact::valueChanged, this, &CircularSurveyComplexItem::_setDirty);
connect(this, &CircularSurveyComplexItem::refPointChanged, this, &CircularSurveyComplexItem::_setDirty);
_deltaR.setRawValue(_deltaR.rawDefaultValue());
_deltaAlpha.setRawValue(_deltaAlpha.rawDefaultValue());
qDebug() << _deltaAlpha.rawDefaultValue().toDouble();
qDebug() << _deltaAlpha.rawValue().toDouble();
connect(&_updateTimer, &QTimer::timeout, this, &CircularSurveyComplexItem::_updateItem);
_updateTimer.start(100);
......@@ -28,6 +33,7 @@ void CircularSurveyComplexItem::setRefPoint(const QGeoCoordinate &refPt)
_referencePoint = refPt;
emit refPointChanged();
//qDebug() << _referencePoint.toString();
}
}
......@@ -285,6 +291,7 @@ void CircularSurveyComplexItem::_updateItem()
{
if (_dirty) {
_rebuildTransects();
qDebug() << "CircularSurveyComplexItem::_updateItem()";
setDirty(false);
}
......
import QtQuick 2.3
import QtLocation 5.3
import QGroundControl.ScreenTools 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Vehicle 1.0
/// Marker for displaying a mission item on the map
MapQuickItem {
id: _item
property int sequenceNumber
property string label
//property bool visible
signal clicked
anchorPoint.x: sourceItem.anchorPointX
anchorPoint.y: sourceItem.anchorPointY
sourceItem:
MissionItemIndexLabel {
id: _label
checked: _item.visible
label: _item.label
index: _item.sequenceNumber
gimbalYaw: 0
vehicleYaw: 0
showGimbalYaw: false
onClicked: _item.clicked()
}
}
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.3
import QtLocation 5.3
import QGroundControl 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Controls 1.0
/// Use to drag a MissionItemIndicator
Rectangle {
id: itemDragger
x: _itemIndicatorX - _touchMarginHorizontal
y: _itemIndicatorY - _touchMarginVertical
width: _itemIndicatorWidth + (_touchMarginHorizontal * 2)
height: _itemIndicatorHeight + (_touchMarginVertical * 2)
color: "transparent"
z: QGroundControl.zOrderMapItems + 1 // Above item icons
// Properties which must be specific by consumer
property var mapControl ///< Map control which contains this item
property var itemIndicator ///< The mission item indicator to drag around
property var itemCoordinate ///< Coordinate we are updating during drag
signal clicked
signal dragStart
signal dragStop
property bool _preventCoordinateBindingLoop: false
property real _itemIndicatorX: itemIndicator ? itemIndicator.x : 0
property real _itemIndicatorY: itemIndicator ? itemIndicator.y : 0
property real _itemIndicatorWidth: itemIndicator ? itemIndicator.width : 0
property real _itemIndicatorHeight: itemIndicator ? itemIndicator.height : 0
property bool _mobile: ScreenTools.isMobile
property real _touchWidth: Math.max(_itemIndicatorWidth, ScreenTools.minTouchPixels)
property real _touchHeight: Math.max(_itemIndicatorHeight, ScreenTools.minTouchPixels)
property real _touchMarginHorizontal: _mobile ? (_touchWidth - _itemIndicatorWidth) / 2 : 0
property real _touchMarginVertical: _mobile ? (_touchHeight - _itemIndicatorHeight) / 2 : 0
property bool _dragStartSignalled: false
onXChanged: liveDrag()
onYChanged: liveDrag()
function liveDrag() {
if (!itemDragger._preventCoordinateBindingLoop && itemDrag.drag.active) {
var point = Qt.point(itemDragger.x + _touchMarginHorizontal + itemIndicator.anchorPoint.x, itemDragger.y + _touchMarginVertical + itemIndicator.anchorPoint.y)
var coordinate = mapControl.toCoordinate(point, false /* clipToViewPort */)
itemDragger._preventCoordinateBindingLoop = true
coordinate.altitude = itemCoordinate.altitude
itemCoordinate = coordinate
itemDragger._preventCoordinateBindingLoop = false
}
}
Drag.active: itemDrag.drag.active
QGCMouseArea {
id: itemDrag
anchors.fill: parent
drag.target: parent
drag.minimumX: 0
drag.minimumY: 0
drag.maximumX: itemDragger.parent.width - parent.width
drag.maximumY: itemDragger.parent.height - parent.height
preventStealing: true
onClicked: {
focus = true
itemDragger.clicked()
}
property bool dragActive: drag.active
onDragActiveChanged: {
if (dragActive) {
focus = true
if (!_dragStartSignalled) {
_dragStartSignalled = true
dragStart()
}
} else {
_dragStartSignalled = false
dragStop()
}
}
}
}
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtLocation 5.3
import QtPositioning 5.3
import QGroundControl 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0
import QGroundControl.FlightMap 1.0
/// Draggable Coordinate Item visuals
Item {
id: _root
property var map ///< Map control to place item in
property var qgcView ///< QGCView to use for popping dialogs
//property var visible
property var coordinate
property int sequenceNumber
property var _itemVisual
property bool _itemVisualShowing: false
property var _dragArea
property bool _dragAreaShowing: false
signal clicked(int sequenceNumber)
function hideItemVisuals() {
if (_itemVisualShowing) {
_itemVisual.destroy()
_itemVisualShowing = false
}
}
function showItemVisuals() {
if (!_itemVisualShowing) {
_itemVisual = indicatorComponent.createObject(map)
map.addMapItem(_itemVisual)
_itemVisualShowing = true
}
}
function hideDragArea() {
if (_dragAreaShowing) {
_dragArea.destroy()
_dragAreaShowing = false
}
}
function showDragArea() {
if (!_dragAreaShowing) {
_dragArea = dragAreaComponent.createObject(map)
_dragAreaShowing = true
}
}
Component.onCompleted: {
showItemVisuals()
if (visible && map.planView) {
showDragArea()
}
}
Component.onDestruction: {
hideDragArea()
hideItemVisuals()
}
onVisibleChanged: {
if (visible) {
showDragArea()
} else {
hideDragArea()
}
}
// Control which is used to drag items
Component {
id: dragAreaComponent
CoordinateIndicatorDrag {
mapControl: _root.map
itemIndicator: _itemVisual
Component.onCompleted: itemCoordinate = _root.coordinate
onItemCoordinateChanged: _root.coordinate = itemCoordinate
}
}
Component {
id: indicatorComponent
CoordinateIndicator {
label: "Reference"
visible: _root.visible
z: QGroundControl.zOrderMapItems
sequenceNumber: _root.sequenceNumber
coordinate: _root.coordinate
onClicked: _root.clicked(_missionItem.sequenceNumber)
}
}
}
......@@ -32,6 +32,7 @@ Item {
property var _visualTransectsComponent
property var _entryCoordinate
property var _exitCoordinate
property var _refPoint
signal clicked(int sequenceNumber)
......@@ -39,15 +40,18 @@ Item {
_visualTransectsComponent = visualTransectsComponent.createObject(map)
_entryCoordinate = entryPointComponent.createObject(map)
_exitCoordinate = exitPointComponent.createObject(map)
_refPoint = refPointComponent.createObject(map)
map.addMapItem(_visualTransectsComponent)
map.addMapItem(_entryCoordinate)
map.addMapItem(_exitCoordinate)
map.addMapItem(_refPoint)
}
function _destroyVisualElements() {
_visualTransectsComponent.destroy()
_entryCoordinate.destroy()
_exitCoordinate.destroy()
_refPoint.destroy()
}
/// Add an initial 4 sided polygon if there is none
......@@ -162,19 +166,14 @@ Item {
Component {
id: refPointComponent
MapQuickItem {
anchorPoint.x: sourceItem.anchorPointX
anchorPoint.y: sourceItem.anchorPointY
DragCoordinate {
map: _root.map
qgcView: _root.qgcView
z: QGroundControl.zOrderMapItems
coordinate: _missionItem.refPoint
visible: _missionItem.refPoint.isValid
visible: _missionItem.isCurrentItem
coordinate: _missionItem.refPoint
sourceItem: MissionItemIndexLabel {
index: _missionItem.sequenceNumber
label: "Ref."
checked: _missionItem.isCurrentItem
onClicked: _root.clicked(_missionItem.sequenceNumber)
}
onCoordinateChanged: _missionItem.refPoint = coordinate
}
}
}
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