Browse Source

pid tuning: fix layouting

- use correct available height for chart (fill height)
- show scrollbar if param list overflows the window size
QGC4.4
Beat Küng 4 years ago committed by Lorenz Meier
parent
commit
6b5db72a54
  1. 1
      src/AutoPilotPlugins/PX4/PX4TuningComponentCopter.qml
  2. 1
      src/AutoPilotPlugins/PX4/PX4TuningComponentCopterAll.qml
  3. 5
      src/AutoPilotPlugins/PX4/PX4TuningComponentCopterAttitude.qml
  4. 5
      src/AutoPilotPlugins/PX4/PX4TuningComponentCopterPosition.qml
  5. 5
      src/AutoPilotPlugins/PX4/PX4TuningComponentCopterRate.qml
  6. 5
      src/AutoPilotPlugins/PX4/PX4TuningComponentCopterVelocity.qml
  7. 1
      src/AutoPilotPlugins/PX4/PX4TuningComponentPlane.qml
  8. 1
      src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneAll.qml
  9. 5
      src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneTECS.qml
  10. 2
      src/AutoPilotPlugins/PX4/PX4TuningComponentVTOL.qml
  11. 20
      src/QmlControls/PIDTuning.qml

1
src/AutoPilotPlugins/PX4/PX4TuningComponentCopter.qml

@ -22,6 +22,7 @@ SetupPage {
id: pageComponent id: pageComponent
PX4TuningComponentCopterAll { PX4TuningComponentCopterAll {
height: availableHeight
} }
} // Component - pageComponent } // Component - pageComponent
} // SetupPage } // SetupPage

1
src/AutoPilotPlugins/PX4/PX4TuningComponentCopterAll.qml

@ -53,5 +53,6 @@ Item {
width: parent.width width: parent.width
anchors.top: bar.bottom anchors.top: bar.bottom
anchors.topMargin: ScreenTools.defaultFontPixelWidth anchors.topMargin: ScreenTools.defaultFontPixelWidth
anchors.bottom: parent.bottom
} }
} }

5
src/AutoPilotPlugins/PX4/PX4TuningComponentCopterAttitude.qml

@ -18,8 +18,9 @@ import QGroundControl.FactControls 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
import QGroundControl.Vehicle 1.0 import QGroundControl.Vehicle 1.0
Column { ColumnLayout {
width: availableWidth width: availableWidth
anchors.fill: parent
PIDTuning { PIDTuning {
width: availableWidth width: availableWidth
@ -75,8 +76,6 @@ Column {
} }
} }
} }
anchors.left: parent.left
anchors.right: parent.right
title: "Attitude" title: "Attitude"
tuningMode: Vehicle.ModeRateAndAttitude tuningMode: Vehicle.ModeRateAndAttitude
unit: "deg" unit: "deg"

5
src/AutoPilotPlugins/PX4/PX4TuningComponentCopterPosition.qml

@ -18,8 +18,9 @@ import QGroundControl.FactControls 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
import QGroundControl.Vehicle 1.0 import QGroundControl.Vehicle 1.0
Column { ColumnLayout {
width: availableWidth width: availableWidth
anchors.fill: parent
property Fact _mcPosMode: controller.getParameterFact(-1, "MPC_POS_MODE", false) property Fact _mcPosMode: controller.getParameterFact(-1, "MPC_POS_MODE", false)
GridLayout { GridLayout {
@ -73,8 +74,6 @@ Column {
} }
} }
} }
anchors.left: parent.left
anchors.right: parent.right
title: "Position" title: "Position"
tuningMode: Vehicle.ModeVelocityAndPosition tuningMode: Vehicle.ModeVelocityAndPosition
unit: "m" unit: "m"

5
src/AutoPilotPlugins/PX4/PX4TuningComponentCopterRate.qml

@ -18,8 +18,9 @@ import QGroundControl.FactControls 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
import QGroundControl.Vehicle 1.0 import QGroundControl.Vehicle 1.0
Column { ColumnLayout {
width: availableWidth width: availableWidth
anchors.fill: parent
property Fact _airmode: controller.getParameterFact(-1, "MC_AIRMODE", false) property Fact _airmode: controller.getParameterFact(-1, "MC_AIRMODE", false)
property Fact _thrustModelFactor: controller.getParameterFact(-1, "THR_MDL_FAC", false) property Fact _thrustModelFactor: controller.getParameterFact(-1, "THR_MDL_FAC", false)
@ -143,8 +144,6 @@ Column {
} }
} }
} }
anchors.left: parent.left
anchors.right: parent.right
title: "Rate" title: "Rate"
tuningMode: Vehicle.ModeRateAndAttitude tuningMode: Vehicle.ModeRateAndAttitude
unit: "deg/s" unit: "deg/s"

5
src/AutoPilotPlugins/PX4/PX4TuningComponentCopterVelocity.qml

@ -18,8 +18,9 @@ import QGroundControl.FactControls 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
import QGroundControl.Vehicle 1.0 import QGroundControl.Vehicle 1.0
Column { ColumnLayout {
width: availableWidth width: availableWidth
anchors.fill: parent
property Fact _mcPosMode: controller.getParameterFact(-1, "MPC_POS_MODE", false) property Fact _mcPosMode: controller.getParameterFact(-1, "MPC_POS_MODE", false)
GridLayout { GridLayout {
@ -105,8 +106,6 @@ Column {
} }
} }
} }
anchors.left: parent.left
anchors.right: parent.right
title: "Velocity" title: "Velocity"
tuningMode: Vehicle.ModeVelocityAndPosition tuningMode: Vehicle.ModeVelocityAndPosition
unit: "m/s" unit: "m/s"

1
src/AutoPilotPlugins/PX4/PX4TuningComponentPlane.qml

@ -22,6 +22,7 @@ SetupPage {
id: pageComponent id: pageComponent
PX4TuningComponentPlaneAll { PX4TuningComponentPlaneAll {
height: availableHeight
} }
} // Component - pageComponent } // Component - pageComponent
} // SetupPage } // SetupPage

1
src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneAll.qml

@ -41,5 +41,6 @@ Item {
width: parent.width width: parent.width
anchors.top: bar.bottom anchors.top: bar.bottom
anchors.topMargin: ScreenTools.defaultFontPixelWidth anchors.topMargin: ScreenTools.defaultFontPixelWidth
anchors.bottom: parent.bottom
} }
} }

5
src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneTECS.qml

@ -18,8 +18,9 @@ import QGroundControl.FactControls 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
import QGroundControl.Vehicle 1.0 import QGroundControl.Vehicle 1.0
Column { ColumnLayout {
width: availableWidth width: availableWidth
anchors.fill: parent
PIDTuning { PIDTuning {
width: availableWidth width: availableWidth
@ -43,8 +44,6 @@ Column {
} }
// TODO: add other params // TODO: add other params
} }
anchors.left: parent.left
anchors.right: parent.right
title: "TECS" title: "TECS"
tuningMode: Vehicle.ModeAltitudeAndAirspeed tuningMode: Vehicle.ModeAltitudeAndAirspeed
unit: "" unit: ""

2
src/AutoPilotPlugins/PX4/PX4TuningComponentVTOL.qml

@ -24,6 +24,7 @@ SetupPage {
Item { Item {
width: availableWidth width: availableWidth
height: availableHeight
FactPanelController { FactPanelController {
id: controller id: controller
@ -52,6 +53,7 @@ SetupPage {
width: parent.width width: parent.width
anchors.top: bar.bottom anchors.top: bar.bottom
anchors.topMargin: ScreenTools.defaultFontPixelWidth anchors.topMargin: ScreenTools.defaultFontPixelWidth
anchors.bottom: parent.bottom
} }
} }
} // Component - pageComponent } // Component - pageComponent

20
src/QmlControls/PIDTuning.qml

@ -165,10 +165,18 @@ RowLayout {
property int _maxPointCount: 10000 / interval property int _maxPointCount: 10000 / interval
} }
QGCFlickable {
contentWidth: parent.width * (_showCharts ? 0.4 : 1)
contentHeight: rightColumn.height
Layout.fillHeight: true
Layout.minimumWidth: contentWidth
Layout.maximumWidth: contentWidth
Layout.alignment: Qt.AlignTop
Column { Column {
spacing: _margins spacing: _margins
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignTop
width: parent.width * (_showCharts ? 0.4 : 1) width: parent.width
id: rightColumn
Column { Column {
@ -238,19 +246,17 @@ RowLayout {
} }
} }
} }
}
Column { ColumnLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop
visible: _showCharts visible: _showCharts
ChartView { ChartView {
id: chart id: chart
anchors.left: parent.left
anchors.right: parent.right
height: availableHeight * 0.75
antialiasing: true antialiasing: true
legend.alignment: Qt.AlignBottom legend.alignment: Qt.AlignBottom
Layout.fillHeight: true
Layout.fillWidth: true
// enable mouse dragging // enable mouse dragging
MouseArea { MouseArea {

Loading…
Cancel
Save