Commit 99d9796c authored by Valentin Platzgummer's avatar Valentin Platzgummer

wimaMenu edited

parent a1d6f37c
...@@ -551,8 +551,8 @@ QGCView { ...@@ -551,8 +551,8 @@ QGCView {
z: _panel.z + 4 z: _panel.z + 4
anchors.left: parent.left anchors.left: parent.left
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.leftMargin: ScreenTools.defaultFontPixelHeight * 0.25 anchors.leftMargin: ScreenTools.defaultFontPixelWidth
anchors.bottomMargin: ScreenTools.defaultFontPixelHeight * 0.25 anchors.bottomMargin: ScreenTools.defaultFontPixelWidth
wimaController: wimaController wimaController: wimaController
......
import QtQuick 2.3 import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.4 import QtQuick.Controls.Styles 1.4
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs 1.2
import QtLocation 5.3 import QtLocation 5.3
import QtPositioning 5.3 import QtPositioning 5.3
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.2 import QtQuick.Layouts 1.2
import QGroundControl 1.0 import QGroundControl 1.0
...@@ -19,7 +19,7 @@ import QGroundControl.FactControls 1.0 ...@@ -19,7 +19,7 @@ import QGroundControl.FactControls 1.0
Item { Item {
id: _root id: _root
height: 700 height: 600
width: 300 width: 300
property var wimaController // must be provided by the user property var wimaController // must be provided by the user
...@@ -50,8 +50,12 @@ Item { ...@@ -50,8 +50,12 @@ Item {
return Qt.formatTime(t, 'hh:mm:ss') return Qt.formatTime(t, 'hh:mm:ss')
} }
QGCPalette { id: qgcPal }
// box containing all items // box containing all items
Rectangle { Rectangle { // maybe replace with column and remove anchors => dynamic height:
id: mainFrame
anchors.left: parent.left anchors.left: parent.left
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
height: enableWima.enableWimaBoolean ? parent.height : enableWima.height height: enableWima.enableWimaBoolean ? parent.height : enableWima.height
...@@ -83,201 +87,201 @@ Item { ...@@ -83,201 +87,201 @@ Item {
} }
} }
Column { Rectangle {
id: mainColumn id: controllerFrame
anchors.top: enableWima.bottom anchors.top: enableWima.bottom
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.margins: ScreenTools.defaultFontPixelHeight * 0.4 anchors.margins: ScreenTools.defaultFontPixelHeight *0.25
spacing: ScreenTools.defaultFontPixelHeight * 0.25 color: qgcPal.window
clip: true
SectionHeader {
id: settingsHeader ScrollView {
text: qsTr("Settings") id: scrollView
} anchors.fill: parent
GridLayout {
columns: 2 Column {
rowSpacing: ScreenTools.defaultFontPixelHeight * 0.5 /*SectionHeader {
columnSpacing: ScreenTools.defaultFontPixelHeight * 0.5 id: settingsHeader
anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.5 text: qsTr("Settings")
anchors.left: parent.left }*/
anchors.right: parent.right
visible: settingsHeader.checked GridLayout {
columns: 2
// Settings rowSpacing: ScreenTools.defaultFontPixelHeight * 0.5
QGCLabel { text: qsTr("Next Waypoint") } columnSpacing: ScreenTools.defaultFontPixelHeight * 0.5
FactTextField { visible: settingsHeader.checked
fact: wimaController.startWaypointIndex
Layout.fillWidth: true // Settings
} QGCLabel { text: qsTr("Next Waypoint") }
FactTextField {
QGCLabel { text: qsTr("Max Waypoints") } fact: wimaController.startWaypointIndex
FactTextField { Layout.fillWidth: true
fact: wimaController.maxWaypointsPerPhase }
Layout.fillWidth: true
} QGCLabel { text: qsTr("Max Waypoints") }
FactTextField {
QGCLabel { text: qsTr("Overlap") } fact: wimaController.maxWaypointsPerPhase
FactTextField { Layout.fillWidth: true
fact: wimaController.overlapWaypoints }
Layout.fillWidth: true
} QGCLabel { text: qsTr("Overlap") }
FactTextField {
FactCheckBox { fact: wimaController.overlapWaypoints
text: qsTr("Show All") Layout.fillWidth: true
fact: wimaController.showAllMissionItems }
}
FactCheckBox {
FactCheckBox { text: qsTr("Show All")
text: qsTr("Show Current") fact: wimaController.showAllMissionItems
fact: wimaController.showCurrentMissionItems }
}
FactCheckBox {
} text: qsTr("Show Current")
fact: wimaController.showCurrentMissionItems
SectionHeader{ }
id: missionHeader
text: qsTr("Mission") }
}
GridLayout { /*SectionHeader{
columns: 2 id: missionHeader
rowSpacing: ScreenTools.defaultFontPixelHeight * 0.5 text: qsTr("Mission")
columnSpacing: ScreenTools.defaultFontPixelHeight * 0.5 }*/
anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.5 GridLayout {
anchors.left: parent.left columns: 2
anchors.right: parent.right rowSpacing: ScreenTools.defaultFontPixelHeight * 0.5
visible: missionHeader.checked columnSpacing: ScreenTools.defaultFontPixelHeight * 0.5
visible: missionHeader.checked
QGCLabel { text: qsTr("Speed") }
FactTextField { QGCLabel { text: qsTr("Speed") }
fact: wimaController.flightSpeed FactTextField {
Layout.fillWidth: true fact: wimaController.flightSpeed
} Layout.fillWidth: true
}
QGCLabel { text: qsTr("Altitude") }
FactTextField { QGCLabel { text: qsTr("Altitude") }
fact: wimaController.altitude FactTextField {
Layout.fillWidth: true fact: wimaController.altitude
} Layout.fillWidth: true
}
// Buttons
QGCButton { // Buttons
id: buttonPreviousMissionPhase QGCButton {
text: qsTr("Reverse") id: buttonPreviousMissionPhase
onClicked: wimaController.previousPhase(); text: qsTr("Reverse")
Layout.fillWidth: true onClicked: wimaController.previousPhase();
} Layout.fillWidth: true
}
QGCButton {
id: buttonNextMissionPhase QGCButton {
text: qsTr("Forward") id: buttonNextMissionPhase
onClicked: wimaController.nextPhase(); text: qsTr("Forward")
Layout.fillWidth: true onClicked: wimaController.nextPhase();
} Layout.fillWidth: true
}
QGCButton {
id: buttonResetPhase QGCButton {
text: qsTr("Reset Phase") id: buttonResetPhase
onClicked: wimaController.resetPhase(); text: qsTr("Reset Phase")
Layout.fillWidth: true onClicked: wimaController.resetPhase();
Layout.rowSpan: 2 Layout.fillWidth: true
} Layout.rowSpan: 2
}
}
/*}
SectionHeader{
id: vehicleHeader SectionHeader{
text: qsTr("Vehicle") id: vehicleHeader
} text: qsTr("Vehicle")
GridLayout { }
columns: 2 GridLayout {
rowSpacing: ScreenTools.defaultFontPixelHeight * 0.5 columns: 2
columnSpacing: ScreenTools.defaultFontPixelHeight * 0.5 rowSpacing: ScreenTools.defaultFontPixelHeight * 0.5
anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.5 columnSpacing: ScreenTools.defaultFontPixelHeight * 0.5
anchors.left: parent.left visible: vehicleHeader.checked*/
anchors.right: parent.right
visible: vehicleHeader.checked QGCButton {
id: buttonUpload
QGCButton { text: qsTr("Upload")
id: buttonUpload onClicked: wimaController.uploadToVehicle();
text: qsTr("Upload") Layout.fillWidth: true
onClicked: wimaController.uploadToVehicle(); }
Layout.fillWidth: true
} QGCButton {
id: buttonRemoveFromVehicle
QGCButton { text: qsTr("Remove")
id: buttonRemoveFromVehicle onClicked: wimaController.removeFromVehicle();
text: qsTr("Remove") Layout.fillWidth: true
onClicked: wimaController.removeFromVehicle(); }
Layout.fillWidth: true
} QGCButton {
id: buttonSmartRTL
QGCButton { text: qsTr("Smart RTL")
id: buttonSmartRTL onClicked: initSmartRTL()
text: qsTr("Smart RTL") Layout.fillWidth: true
onClicked: initSmartRTL() }
Layout.fillWidth: true // placeholder, remove if you add stuff
} QGCLabel { text: "" }
// placeholder, remove if you add stuff
QGCLabel { text: "" }
// progess bar
Rectangle {
// progess bar id: progressBar
Rectangle { height: 4
id: progressBar width: _controllerProgressPct * parent.width
height: 4 color: qgcPal.colorGreen
width: _controllerProgressPct * parent.width visible: false
color: qgcPal.colorGreen }
visible: false
} QGCLabel {
id: uploadCompleteText
QGCLabel { font.pointSize: ScreenTools.largeFontPointSize
id: uploadCompleteText Layout.columnSpan: 2
font.pointSize: ScreenTools.largeFontPointSize horizontalAlignment: Text.AlignHCenter
Layout.columnSpan: 2 verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter text: "Done"
verticalAlignment: Text.AlignVCenter visible: false
text: "Done" }
visible: false
} }
} /*SectionHeader {
id: statsHeader
SectionHeader { text: qsTr("Statistics")
id: statsHeader }*/
text: qsTr("Statistics") GridLayout {
} columns: 2
GridLayout { rowSpacing: ScreenTools.defaultFontPixelHeight * 0.5
columns: 2 anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.25
rowSpacing: ScreenTools.defaultFontPixelHeight * 0.5 visible: statsHeader.checked
anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.25
visible: statsHeader.checked QGCLabel {
text: qsTr("Phase Length: ")
QGCLabel { wrapMode: Text.WordWrap
text: qsTr("Phase Length: ") font.pointSize: ScreenTools.smallFontPointSize
wrapMode: Text.WordWrap }
font.pointSize: ScreenTools.smallFontPointSize QGCLabel {
} text: wimaController.phaseDistance >= 0 ? wimaController.phaseDistance.toFixed(2) + " m": ""
QGCLabel { wrapMode: Text.WordWrap
text: wimaController.phaseDistance >= 0 ? wimaController.phaseDistance.toFixed(2) + " m": "" font.pointSize: ScreenTools.smallFontPointSize
wrapMode: Text.WordWrap }
font.pointSize: ScreenTools.smallFontPointSize
} QGCLabel {
text: qsTr("Phase Duration: ")
QGCLabel { wrapMode: Text.WordWrap
text: qsTr("Phase Duration: ") font.pointSize: ScreenTools.smallFontPointSize
wrapMode: Text.WordWrap }
font.pointSize: ScreenTools.smallFontPointSize QGCLabel {
} text: wimaController.phaseDuration >= 0 ? getTime(wimaController.phaseDuration) : ""
QGCLabel { wrapMode: Text.WordWrap
text: wimaController.phaseDuration >= 0 ? getTime(wimaController.phaseDuration) : "" font.pointSize: ScreenTools.smallFontPointSize
wrapMode: Text.WordWrap }
font.pointSize: ScreenTools.smallFontPointSize }
} } // mainColumn
} } // item
} } // Rectangle
} }
} }
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