Commit 8a995243 authored by Valentin Platzgummer's avatar Valentin Platzgummer

FlyAreaItemEditor.qml edited

parent 3bc2c3a0
......@@ -48,9 +48,7 @@ void WimaFlyArea::setCurrentPolygon(int index)
{
if(index >= 0 && index < _polygons->count()) {
if(index == _currentPolygonIndex){
return;
}
for (int i = 0; i < _polygons->count(); i++) {
QGCMapPolygon* polygon = qobject_cast<QGCMapPolygon*>(_polygons->get(i));
......@@ -61,8 +59,11 @@ void WimaFlyArea::setCurrentPolygon(int index)
_currentPolygonItem = qobject_cast<QGCMapPolygon*>(_polygons->get(index));
_currentPolygonItem->setInteractive(true);
emit currentPolygonItemChanged(_currentPolygonItem);
emit currentPolygonIndexChanged(index);
if(index != _currentPolygonIndex){
emit currentPolygonItemChanged(_currentPolygonItem);
emit currentPolygonIndexChanged(index);
}
}
}
......@@ -28,7 +28,7 @@ Rectangle {
property real _margin: ScreenTools.defaultFontPixelWidth / 2
property real _fieldWidth: ScreenTools.defaultFontPixelWidth * 10.5
property var _vehicle: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle : QGroundControl.multiVehicleManager.offlineEditingVehicle
property real _cameraMinTriggerInterval: missionItem.cameraCalc.minTriggerInterval.rawValue
......
......@@ -12,7 +12,7 @@ import QGroundControl.FactControls 1.0
import QGroundControl.Palette 1.0
/// Fly Area edit control
/// Mission item edit control
Rectangle {
id: _root
height: editorLoader.visible ? (editorLoader.y + editorLoader.height + (_margin * 2)) : (commandPicker.y + commandPicker.height + _margin / 2)
......@@ -20,11 +20,11 @@ Rectangle {
radius: _radius
property var map ///< Map control
property var flyArea
property var masterController
property var missionItem ///< MissionItem associated with this editor
property var polygon ///< MissionItem associated with this editor
property bool readOnly ///< true: read only view, false: full editing view
property var rootQgcView
property var flyArea
signal clicked
signal remove
......@@ -39,7 +39,7 @@ Rectangle {
readonly property real _editFieldWidth: Math.min(width - _margin * 2, ScreenTools.defaultFontPixelWidth * 12)
readonly property real _margin: ScreenTools.defaultFontPixelWidth / 2
readonly property real _radius: ScreenTools.defaultFontPixelWidth / 2
readonly property real _hamburgerSize: commandPicker.height
readonly property real _hamburgerSize: commandPicker.height * 0.75
readonly property bool _waypointsOnlyMode: QGroundControl.corePlugin.options.missionWaypointsOnly
QGCPalette {
......@@ -61,13 +61,12 @@ Rectangle {
}
QGCLabel {
id: label
anchors.verticalCenter: commandPicker.verticalCenter
anchors.leftMargin: _margin
anchors.left: parent.left
text: index+1
text: index
color: _outerTextColor
}
......@@ -80,7 +79,7 @@ Rectangle {
height: _hamburgerSize
sourceSize.height: _hamburgerSize
source: "qrc:/qmlimages/Hamburger.svg"
visible: flyArea.currentPolygonIndex === index
visible: _currentItem
color: qgcPal.text
}
......@@ -99,10 +98,17 @@ Rectangle {
text: qsTr("Insert Fly Area")
onTriggered: flyArea.appendFlyAreaPolygon()
}
MenuItem {
text: qsTr("Delete")
onTriggered: remove()
}
}
}
......@@ -113,26 +119,18 @@ Rectangle {
anchors.rightMargin: ScreenTools.defaultFontPixelWidth
anchors.left: label.right
anchors.top: parent.top
visible: !commandPicker.visible
text: missionItem.commandName
Component {
id: commandDialog
MissionCommandDialog {
missionItem: _root.missionItem
}
}
visible: !commandLabel.visible
text: "Fly Area"
//onClicked: qgcView.showDialog(commandDialog, qsTr("Select Mission Command"), qgcView.showDialogDefaultWidth, StandardButton.Cancel)
}
QGCLabel {
id: commandLabel
anchors.fill: parent
verticalAlignment: Text.AlignVCenter
text: "Fly Area"
color: _outerTextColor
id: commandLabel
anchors.fill: commandPicker
visible: _currentItem
verticalAlignment: Text.AlignVCenter
text: "Fly Area"
color: _outerTextColor
}
Loader {
......
......@@ -808,7 +808,7 @@ QGCView {
map: editorMap
masterController: _planMasterController
flyArea: _flyArea
missionItem: object
polygon: object
width: parent.width
readOnly: false
rootQgcView: _qgcView
......@@ -986,48 +986,6 @@ QGCView {
}
}
Component {
id: patternDropPanel
ColumnLayout {
spacing: ScreenTools.defaultFontPixelWidth * 0.5
QGCLabel { text: qsTr("Create complex pattern:") }
Repeater {
model: _missionController.complexMissionItemNames
QGCButton {
text: modelData
Layout.fillWidth: true
onClicked: {
addComplexItem(modelData)
dropPanel.hide()
}
}
}
Rectangle {
width: parent.width * 0.8
height: 1
color: qgcPal.text
opacity: 0.5
Layout.fillWidth: true
Layout.columnSpan: 2
}
QGCButton {
text: qsTr("Load KML/SHP...")
Layout.fillWidth: true
enabled: !masterController.syncInProgress
onClicked: {
masterController.loadShapeFromSelectedFile()
dropPanel.hide()
}
}
} // Column
}
Component {
id: syncDropPanel
......
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