diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopter.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopter.qml index dfa8ae0..4dc4314 100644 --- a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopter.qml +++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopter.qml @@ -22,6 +22,7 @@ SetupPage { id: pageComponent PX4TuningComponentCopterAll { + height: availableHeight } } // Component - pageComponent } // SetupPage diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterAll.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterAll.qml index bb6ef3e..ebd2ba9 100644 --- a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterAll.qml +++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterAll.qml @@ -53,5 +53,6 @@ Item { width: parent.width anchors.top: bar.bottom anchors.topMargin: ScreenTools.defaultFontPixelWidth + anchors.bottom: parent.bottom } } diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterAttitude.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterAttitude.qml index a7e98f4..017cae8 100644 --- a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterAttitude.qml +++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterAttitude.qml @@ -18,8 +18,9 @@ import QGroundControl.FactControls 1.0 import QGroundControl.ScreenTools 1.0 import QGroundControl.Vehicle 1.0 -Column { +ColumnLayout { width: availableWidth + anchors.fill: parent PIDTuning { width: availableWidth @@ -75,8 +76,6 @@ Column { } } } - anchors.left: parent.left - anchors.right: parent.right title: "Attitude" tuningMode: Vehicle.ModeRateAndAttitude unit: "deg" diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterPosition.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterPosition.qml index 6962f4b..ee68bee 100644 --- a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterPosition.qml +++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterPosition.qml @@ -18,8 +18,9 @@ import QGroundControl.FactControls 1.0 import QGroundControl.ScreenTools 1.0 import QGroundControl.Vehicle 1.0 -Column { +ColumnLayout { width: availableWidth + anchors.fill: parent property Fact _mcPosMode: controller.getParameterFact(-1, "MPC_POS_MODE", false) GridLayout { @@ -73,8 +74,6 @@ Column { } } } - anchors.left: parent.left - anchors.right: parent.right title: "Position" tuningMode: Vehicle.ModeVelocityAndPosition unit: "m" diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterRate.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterRate.qml index 8515522..ef3efaf 100644 --- a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterRate.qml +++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterRate.qml @@ -18,8 +18,9 @@ import QGroundControl.FactControls 1.0 import QGroundControl.ScreenTools 1.0 import QGroundControl.Vehicle 1.0 -Column { +ColumnLayout { width: availableWidth + anchors.fill: parent property Fact _airmode: controller.getParameterFact(-1, "MC_AIRMODE", 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" tuningMode: Vehicle.ModeRateAndAttitude unit: "deg/s" diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterVelocity.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterVelocity.qml index 8e946cc..e60ba22 100644 --- a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterVelocity.qml +++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterVelocity.qml @@ -18,8 +18,9 @@ import QGroundControl.FactControls 1.0 import QGroundControl.ScreenTools 1.0 import QGroundControl.Vehicle 1.0 -Column { +ColumnLayout { width: availableWidth + anchors.fill: parent property Fact _mcPosMode: controller.getParameterFact(-1, "MPC_POS_MODE", false) GridLayout { @@ -105,8 +106,6 @@ Column { } } } - anchors.left: parent.left - anchors.right: parent.right title: "Velocity" tuningMode: Vehicle.ModeVelocityAndPosition unit: "m/s" diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentPlane.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentPlane.qml index 8b57ec4..2b67e51 100644 --- a/src/AutoPilotPlugins/PX4/PX4TuningComponentPlane.qml +++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentPlane.qml @@ -22,6 +22,7 @@ SetupPage { id: pageComponent PX4TuningComponentPlaneAll { + height: availableHeight } } // Component - pageComponent } // SetupPage diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneAll.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneAll.qml index 3cc9e4f..f815acb 100644 --- a/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneAll.qml +++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneAll.qml @@ -41,5 +41,6 @@ Item { width: parent.width anchors.top: bar.bottom anchors.topMargin: ScreenTools.defaultFontPixelWidth + anchors.bottom: parent.bottom } } diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneTECS.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneTECS.qml index 8908afc..c2475c7 100644 --- a/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneTECS.qml +++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneTECS.qml @@ -18,8 +18,9 @@ import QGroundControl.FactControls 1.0 import QGroundControl.ScreenTools 1.0 import QGroundControl.Vehicle 1.0 -Column { +ColumnLayout { width: availableWidth + anchors.fill: parent PIDTuning { width: availableWidth @@ -43,8 +44,6 @@ Column { } // TODO: add other params } - anchors.left: parent.left - anchors.right: parent.right title: "TECS" tuningMode: Vehicle.ModeAltitudeAndAirspeed unit: "" diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentVTOL.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentVTOL.qml index 4e65646..824f4c0 100644 --- a/src/AutoPilotPlugins/PX4/PX4TuningComponentVTOL.qml +++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentVTOL.qml @@ -24,6 +24,7 @@ SetupPage { Item { width: availableWidth + height: availableHeight FactPanelController { id: controller @@ -52,6 +53,7 @@ SetupPage { width: parent.width anchors.top: bar.bottom anchors.topMargin: ScreenTools.defaultFontPixelWidth + anchors.bottom: parent.bottom } } } // Component - pageComponent diff --git a/src/QmlControls/PIDTuning.qml b/src/QmlControls/PIDTuning.qml index a303c69..8558a53 100644 --- a/src/QmlControls/PIDTuning.qml +++ b/src/QmlControls/PIDTuning.qml @@ -165,92 +165,98 @@ RowLayout { property int _maxPointCount: 10000 / interval } - Column { - spacing: _margins - Layout.alignment: Qt.AlignTop - width: parent.width * (_showCharts ? 0.4 : 1) - + 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 { - - RowLayout { - spacing: _margins - visible: axis.length > 1 - - QGCLabel { text: qsTr("Select Tuning:") } - - Repeater { - model: axis - QGCRadioButton { - text: modelData.name - checked: index == _currentAxis - onClicked: _currentAxis = index + spacing: _margins + Layout.alignment: Qt.AlignTop + width: parent.width + id: rightColumn + + Column { + + RowLayout { + spacing: _margins + visible: axis.length > 1 + + QGCLabel { text: qsTr("Select Tuning:") } + + Repeater { + model: axis + QGCRadioButton { + text: modelData.name + checked: index == _currentAxis + onClicked: _currentAxis = index + } } } } - } - // Instantiate all sliders (instead of switching the model), so that - // values are not changed unexpectedly if they do not match with a tick - // value - Repeater { - model: axis - FactSliderPanel { - width: parent.width - visible: _currentAxis === index - sliderModel: axis[index].params + // Instantiate all sliders (instead of switching the model), so that + // values are not changed unexpectedly if they do not match with a tick + // value + Repeater { + model: axis + FactSliderPanel { + width: parent.width + visible: _currentAxis === index + sliderModel: axis[index].params + } } - } - Column { - QGCLabel { text: qsTr("Clipboard Values:") } + Column { + QGCLabel { text: qsTr("Clipboard Values:") } - GridLayout { - rows: savedRepeater.model.length - flow: GridLayout.TopToBottom - rowSpacing: 0 - columnSpacing: _margins + GridLayout { + rows: savedRepeater.model.length + flow: GridLayout.TopToBottom + rowSpacing: 0 + columnSpacing: _margins - Repeater { - model: axis[_currentAxis].params + Repeater { + model: axis[_currentAxis].params - QGCLabel { text: param } - } + QGCLabel { text: param } + } - Repeater { - id: savedRepeater + Repeater { + id: savedRepeater - QGCLabel { text: modelData } + QGCLabel { text: modelData } + } } } - } - RowLayout { - spacing: _margins + RowLayout { + spacing: _margins - QGCButton { - text: qsTr("Save To Clipboard") - onClicked: saveTuningParamValues() - } + QGCButton { + text: qsTr("Save To Clipboard") + onClicked: saveTuningParamValues() + } - QGCButton { - text: qsTr("Restore From Clipboard") - onClicked: resetToSavedTuningParamValues() + QGCButton { + text: qsTr("Restore From Clipboard") + onClicked: resetToSavedTuningParamValues() + } } } } - Column { - Layout.fillWidth: true - Layout.alignment: Qt.AlignTop + ColumnLayout { visible: _showCharts ChartView { id: chart - anchors.left: parent.left - anchors.right: parent.right - height: availableHeight * 0.75 antialiasing: true legend.alignment: Qt.AlignBottom + Layout.fillHeight: true + Layout.fillWidth: true // enable mouse dragging MouseArea {