import QtQuick 2.3 import QtQuick.Controls 1.2 import QtQuick.Controls.Styles 1.4 import QtQuick.Dialogs 1.2 import QtLocation 5.3 import QtPositioning 5.3 import QtQuick.Layouts 1.2 import QGroundControl 1.0 import QGroundControl.ScreenTools 1.0 import QGroundControl.Controls 1.0 import QGroundControl.Palette 1.0 import QGroundControl.Vehicle 1.0 import QGroundControl.FlightMap 1.0 import QGroundControl.Airspace 1.0 import QGroundControl.Airmap 1.0 import QGroundControl.FactSystem 1.0 import QGroundControl.FactControls 1.0 Item { id: _root height: 500 width: 300 property var wimaController // must be provided by the user // box containing all items Rectangle { anchors.left: parent.left anchors.bottom: parent.bottom height: enableWima.enableWimaBoolean ? parent.height : enableWima.height width: enableWima.enableWimaBoolean ? parent.width : enableWima.width color: enableWima.enableWimaBoolean ? qgcPal.window : "transparent" radius: ScreenTools.defaultFontPixelHeight / 4 anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.5 anchors.bottomMargin: ScreenTools.defaultFontPixelHeight * 0.5 anchors.rightMargin: ScreenTools.defaultFontPixelHeight * 0.5 anchors.leftMargin: ScreenTools.defaultFontPixelHeight * 0.5 // checkbox to enable/ disable wima SliderSwitch { id: enableWima anchors.horizontalCenter: parent.horizontalCenter anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.25 anchors.top: parent.top confirmText: enableWimaBoolean ? qsTr("disable WiMA") : qsTr("enable WiMA") property var enableWimaFact: wimaController.enableWimaController property bool enableWimaBoolean: enableWimaFact.value onAccept: { if (enableWimaBoolean) { enableWimaFact.value = false } else { enableWimaFact.value = true } } } Column { id: mainColumn anchors.top: enableWima.bottom anchors.left: parent.left anchors.right: parent.right anchors.bottom: parent.bottom anchors.margins: ScreenTools.defaultFontPixelHeight * 0.4 spacing: ScreenTools.defaultFontPixelHeight * 0.25 SectionHeader { id: settingsHeader text: qsTr("Settings") } GridLayout { columns: 2 rowSpacing: ScreenTools.defaultFontPixelHeight * 0.5 anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.25 visible: settingsHeader.checked // Settings QGCLabel { text: qsTr("Next Waypoint") } FactTextField { fact: wimaController.startWaypointIndex Layout.fillWidth: true } QGCLabel { text: qsTr("Max Waypoints") } FactTextField { fact: wimaController.maxWaypointsPerPhase Layout.fillWidth: true } QGCLabel { text: qsTr("Overlap") } FactTextField { fact: wimaController.overlapWaypoints Layout.fillWidth: true } FactCheckBox { text: qsTr("Show All") fact: wimaController.showAllMissionItems } FactCheckBox { text: qsTr("Show Current") fact: wimaController.showCurrentMissionItems } } SectionHeader{ id: commandHeader text: qsTr("Commands") } GridLayout { columns: 2 rowSpacing: ScreenTools.defaultFontPixelHeight * 0.5 anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.25 visible: commandHeader.checked // Buttons QGCButton { id: buttonPreviousMissionPhase text: qsTr("Reverse") onClicked: wimaController.previousPhase(); Layout.fillWidth: true } QGCButton { id: buttonNextMissionPhase text: qsTr("Forward") onClicked: wimaController.nextPhase(); Layout.fillWidth: true } QGCButton { id: buttonResetPhase text: qsTr("Reset Phase") onClicked: wimaController.resetPhase(); Layout.fillWidth: true } QGCButton { id: buttonUpload text: qsTr("Upload") onClicked: wimaController.uploadToVehicle(); Layout.fillWidth: true } QGCButton { id: buttonRemoveFromVehicle text: qsTr("Remove") onClicked: wimaController.removeFromVehicle(); Layout.fillWidth: true } } SectionHeader { id: statsHeader text: qsTr("Statistics") } GridLayout { columns: 2 rowSpacing: ScreenTools.defaultFontPixelHeight * 0.5 anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.25 visible: statsHeader.checked QGCLabel { anchors.left: parent.left anchors.right: parent.right text: qsTr("Phase Length: ") wrapMode: Text.WordWrap font.pointSize: ScreenTools.smallFontPointSize } } } } }