|
|
@ -195,20 +195,29 @@ QGCView { |
|
|
|
id: itemDragger |
|
|
|
id: itemDragger |
|
|
|
x: missionItemIndicator ? (missionItemIndicator.x + missionItemIndicator.anchorPoint.x - (itemDragger.width / 2)) : 100 |
|
|
|
x: missionItemIndicator ? (missionItemIndicator.x + missionItemIndicator.anchorPoint.x - (itemDragger.width / 2)) : 100 |
|
|
|
y: missionItemIndicator ? (missionItemIndicator.y + missionItemIndicator.anchorPoint.y - (itemDragger.height / 2)) : 100 |
|
|
|
y: missionItemIndicator ? (missionItemIndicator.y + missionItemIndicator.anchorPoint.y - (itemDragger.height / 2)) : 100 |
|
|
|
width: _radius * 2 |
|
|
|
width: ScreenTools.defaultFontPixelHeight * 2 |
|
|
|
height: _radius * 2 |
|
|
|
height: ScreenTools.defaultFontPixelHeight * 2 |
|
|
|
//radius: _radius |
|
|
|
|
|
|
|
//border.width: 2 |
|
|
|
|
|
|
|
//border.color: "white" |
|
|
|
|
|
|
|
color: "transparent" |
|
|
|
color: "transparent" |
|
|
|
visible: false |
|
|
|
visible: false |
|
|
|
z: QGroundControl.zOrderMapItems + 1 // Above item icons |
|
|
|
z: QGroundControl.zOrderMapItems + 1 // Above item icons |
|
|
|
|
|
|
|
|
|
|
|
property var missionItem |
|
|
|
property var missionItem |
|
|
|
property var missionItemIndicator |
|
|
|
property var missionItemIndicator |
|
|
|
|
|
|
|
property bool preventCoordinateBindingLoop: false |
|
|
|
|
|
|
|
|
|
|
|
readonly property real _radius: ScreenTools.defaultFontPixelHeight * 4 |
|
|
|
onXChanged: liveDrag() |
|
|
|
readonly property real _arrowHeight: ScreenTools.defaultFontPixelHeight |
|
|
|
onYChanged: liveDrag() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function liveDrag() { |
|
|
|
|
|
|
|
if (!itemDragger.preventCoordinateBindingLoop && Drag.active) { |
|
|
|
|
|
|
|
var point = Qt.point(itemDragger.x + (itemDragger.width / 2), itemDragger.y + (itemDragger.height / 2)) |
|
|
|
|
|
|
|
var coordinate = editorMap.toCoordinate(point) |
|
|
|
|
|
|
|
coordinate.altitude = itemDragger.missionItem.coordinate.altitude |
|
|
|
|
|
|
|
itemDragger.preventCoordinateBindingLoop = true |
|
|
|
|
|
|
|
itemDragger.missionItem.coordinate = coordinate |
|
|
|
|
|
|
|
itemDragger.preventCoordinateBindingLoop = false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function clearItem() { |
|
|
|
function clearItem() { |
|
|
|
itemDragger.visible = false |
|
|
|
itemDragger.visible = false |
|
|
@ -216,64 +225,6 @@ QGCView { |
|
|
|
itemDragger.missionItemIndicator = undefined |
|
|
|
itemDragger.missionItemIndicator = undefined |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Image { |
|
|
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter |
|
|
|
|
|
|
|
anchors.top: parent.top |
|
|
|
|
|
|
|
height: parent._arrowHeight |
|
|
|
|
|
|
|
fillMode: Image.PreserveAspectFit |
|
|
|
|
|
|
|
mipmap: true |
|
|
|
|
|
|
|
smooth: true |
|
|
|
|
|
|
|
source: "/qmlimages/ArrowHead.svg" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Image { |
|
|
|
|
|
|
|
id: arrowUp |
|
|
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
|
|
|
|
anchors.right: parent.right |
|
|
|
|
|
|
|
height: parent._arrowHeight |
|
|
|
|
|
|
|
fillMode: Image.PreserveAspectFit |
|
|
|
|
|
|
|
mipmap: true |
|
|
|
|
|
|
|
smooth: true |
|
|
|
|
|
|
|
source: "/qmlimages/ArrowHead.svg" |
|
|
|
|
|
|
|
transform: Rotation { origin.x: arrowUp.width / 2; origin.y: arrowUp.height / 2; angle: 90} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Image { |
|
|
|
|
|
|
|
id: arrowDown |
|
|
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter |
|
|
|
|
|
|
|
anchors.bottom: parent.bottom |
|
|
|
|
|
|
|
height: parent._arrowHeight |
|
|
|
|
|
|
|
fillMode: Image.PreserveAspectFit |
|
|
|
|
|
|
|
mipmap: true |
|
|
|
|
|
|
|
smooth: true |
|
|
|
|
|
|
|
source: "/qmlimages/ArrowHead.svg" |
|
|
|
|
|
|
|
transform: Rotation { origin.x: arrowDown.width / 2; origin.y: arrowDown.height / 2; angle: 180} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Image { |
|
|
|
|
|
|
|
id: arrowLeft |
|
|
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
|
|
|
|
anchors.left: parent.left |
|
|
|
|
|
|
|
height: parent._arrowHeight |
|
|
|
|
|
|
|
fillMode: Image.PreserveAspectFit |
|
|
|
|
|
|
|
mipmap: true |
|
|
|
|
|
|
|
smooth: true |
|
|
|
|
|
|
|
source: "/qmlimages/ArrowHead.svg" |
|
|
|
|
|
|
|
transform: Rotation { origin.x: arrowLeft.width / 2; origin.y: arrowLeft.height / 2; angle: -90} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rectangle { |
|
|
|
|
|
|
|
width: _radius * 2 |
|
|
|
|
|
|
|
height: _radius * 2 |
|
|
|
|
|
|
|
radius: _radius |
|
|
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter |
|
|
|
|
|
|
|
border.width: 1 |
|
|
|
|
|
|
|
border.color: "white" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readonly property real _radius: ScreenTools.defaultFontPixelWidth / 4 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Drag.active: itemDrag.drag.active |
|
|
|
Drag.active: itemDrag.drag.active |
|
|
|
Drag.hotSpot.x: width / 2 |
|
|
|
Drag.hotSpot.x: width / 2 |
|
|
|
Drag.hotSpot.y: height / 2 |
|
|
|
Drag.hotSpot.y: height / 2 |
|
|
@ -286,19 +237,6 @@ QGCView { |
|
|
|
drag.minimumY: 0 |
|
|
|
drag.minimumY: 0 |
|
|
|
drag.maximumX: itemDragger.parent.width - parent.width |
|
|
|
drag.maximumX: itemDragger.parent.width - parent.width |
|
|
|
drag.maximumY: itemDragger.parent.height - parent.height |
|
|
|
drag.maximumY: itemDragger.parent.height - parent.height |
|
|
|
|
|
|
|
|
|
|
|
property bool dragActive: drag.active |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onDragActiveChanged: { |
|
|
|
|
|
|
|
if (!drag.active) { |
|
|
|
|
|
|
|
var point = Qt.point(itemDragger.x + (itemDragger.width / 2), itemDragger.y + (itemDragger.height / 2)) |
|
|
|
|
|
|
|
var coordinate = editorMap.toCoordinate(point) |
|
|
|
|
|
|
|
coordinate.altitude = itemDragger.missionItem.coordinate.altitude |
|
|
|
|
|
|
|
itemDragger.missionItem.coordinate = coordinate |
|
|
|
|
|
|
|
editorMap.latitude = itemDragger.missionItem.coordinate.latitude |
|
|
|
|
|
|
|
editorMap.longitude = itemDragger.missionItem.coordinate.longitude |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|