Browse Source

Merge pull request #4650 from DonLakeFlyer/QGCGroupBox

New QGCGroupBox control
QGC4.4
Don Gagne 8 years ago committed by GitHub
parent
commit
1f342e6185
  1. 1
      qgroundcontrol.qrc
  2. 123
      src/AutoPilotPlugins/PX4/PowerComponent.qml
  3. 32
      src/QmlControls/QGCGroupBox.qml
  4. 1
      src/QmlControls/QGroundControl.Controls.qmldir

1
qgroundcontrol.qrc

@ -79,6 +79,7 @@ @@ -79,6 +79,7 @@
<file alias="QGroundControl/Controls/QGCFlickable.qml">src/QmlControls/QGCFlickable.qml</file>
<file alias="QGroundControl/Controls/QGCFlickableHorizontalIndicator.qml">src/QmlControls/QGCFlickableHorizontalIndicator.qml</file>
<file alias="QGroundControl/Controls/QGCFlickableVerticalIndicator.qml">src/QmlControls/QGCFlickableVerticalIndicator.qml</file>
<file alias="QGroundControl/Controls/QGCGroupBox.qml">src/QmlControls/QGCGroupBox.qml</file>
<file alias="QGroundControl/Controls/QGCLabel.qml">src/QmlControls/QGCLabel.qml</file>
<file alias="QGroundControl/Controls/QGCListView.qml">src/QmlControls/QGCListView.qml</file>
<file alias="QGroundControl/Controls/QGCMapLabel.qml">src/QmlControls/QGCMapLabel.qml</file>

123
src/AutoPilotPlugins/PX4/PowerComponent.qml

@ -7,11 +7,6 @@ @@ -7,11 +7,6 @@
*
****************************************************************************/
/// @file
/// @brief Battery, propeller and magnetometer settings
/// @author Gus Grubba <mavlink@grubba.com>
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Dialogs 1.2
@ -30,10 +25,14 @@ SetupPage { @@ -30,10 +25,14 @@ SetupPage {
Component {
id: pageComponent
Column {
Item {
width: Math.max(availableWidth, innerColumn.width)
height: innerColumn.height
ColumnLayout {
id: innerColumn
width: availableWidth
spacing: ScreenTools.defaultFontPixelHeight * 0.5
anchors.horizontalCenter: parent.horizontalCenter
spacing: ScreenTools.defaultFontPixelHeight
property int textEditWidth: ScreenTools.defaultFontPixelWidth * 8
@ -216,22 +215,12 @@ SetupPage { @@ -216,22 +215,12 @@ SetupPage {
} // QGCViewDialog
} // Component - calcAmpsPerVoltDlgComponent
QGCLabel {
text: qsTr("Battery")
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
width: parent.width
height: batteryGrid.height + ScreenTools.defaultFontPixelHeight
color: qgcPal.windowShade
QGCGroupBox {
id: batteryGroup
title: qsTr("Battery")
GridLayout {
id: batteryGrid
anchors.margins: ScreenTools.defaultFontPixelHeight / 2
anchors.left: parent.left
anchors.top: parent.top
columns: 5
columnSpacing: ScreenTools.defaultFontPixelWidth
@ -356,31 +345,23 @@ SetupPage { @@ -356,31 +345,23 @@ SetupPage {
"Click the Calculate button for help with calculating a new value."
}
} // Grid
} // Rectangle - Battery settings
} // QGCGroupBox - Battery settings
QGCLabel {
text: qsTr("ESC PWM Minimum and Maximum Calibration")
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
width: parent.width
height: escCalColumn.height + ScreenTools.defaultFontPixelHeight
color: qgcPal.windowShade
QGCGroupBox {
anchors.left: batteryGroup.left
anchors.right: batteryGroup.right
title: qsTr("ESC PWM Minimum and Maximum Calibration")
Column {
id : escCalColumn
anchors.margins: ScreenTools.defaultFontPixelHeight / 2
ColumnLayout {
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
spacing: ScreenTools.defaultFontPixelWidth
QGCLabel {
width: parent.width
color: qgcPal.warningText
wrapMode: Text.WordWrap
text: qsTr("WARNING: Propellers must be removed from vehicle prior to performing ESC calibration.")
Layout.fillWidth: true
}
QGCLabel {
@ -401,23 +382,14 @@ SetupPage { @@ -401,23 +382,14 @@ SetupPage {
checked: uavcanEnable.rawValue != 0
}
QGCLabel {
text: qsTr("UAVCAN Bus Configuration")
font.family: ScreenTools.demiboldFontFamily
visible: showUAVCAN.checked
}
Rectangle {
width: parent.width
height: uavCanConfigRow.height + ScreenTools.defaultFontPixelHeight
color: qgcPal.windowShade
QGCGroupBox {
anchors.left: batteryGroup.left
anchors.right: batteryGroup.right
title: qsTr("UAVCAN Bus Configuration")
visible: showUAVCAN.checked
Row {
id: uavCanConfigRow
anchors.margins: ScreenTools.defaultFontPixelHeight / 2
anchors.left: parent.left
anchors.top: parent.top
spacing: ScreenTools.defaultFontPixelWidth
FactComboBox {
@ -434,44 +406,34 @@ SetupPage { @@ -434,44 +406,34 @@ SetupPage {
}
}
QGCLabel {
text: qsTr("UAVCAN Motor Index and Direction Assignment")
font.family: ScreenTools.demiboldFontFamily
visible: showUAVCAN.checked
}
Rectangle {
width: parent.width
height: uavCanEscCalColumn.height + ScreenTools.defaultFontPixelHeight
color: qgcPal.windowShade
QGCGroupBox {
anchors.left: batteryGroup.left
anchors.right: batteryGroup.right
title: qsTr("UAVCAN Motor Index and Direction Assignment")
visible: showUAVCAN.checked
enabled: uavcanEnabledCheckBox.checked
Column {
id: uavCanEscCalColumn
anchors.margins: ScreenTools.defaultFontPixelHeight / 2
ColumnLayout {
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
spacing: ScreenTools.defaultFontPixelWidth
QGCLabel {
width: parent.width
wrapMode: Text.WordWrap
color: qgcPal.warningText
text: qsTr("WARNING: Propellers must be removed from vehicle prior to performing UAVCAN ESC configuration.")
Layout.fillWidth: true
}
QGCLabel {
width: parent.width
wrapMode: Text.WordWrap
text: qsTr("ESC parameters will only be accessible in the editor after assignment.")
Layout.fillWidth: true
}
QGCLabel {
width: parent.width
wrapMode: Text.WordWrap
text: qsTr("Start the process, then turn each motor into its turn direction, in the order of their motor indices.")
Layout.fillWidth: true
}
QGCButton {
@ -493,25 +455,15 @@ SetupPage { @@ -493,25 +455,15 @@ SetupPage {
text: qsTr("Show Advanced Settings")
}
QGCLabel {
text: qsTr("Advanced Power Settings")
font.family: ScreenTools.demiboldFontFamily
visible: showAdvanced.checked
}
Rectangle {
id: batteryRectangle
width: parent.width
height: advBatteryColumn.height + ScreenTools.defaultFontPixelHeight
color: qgcPal.windowShade
QGCGroupBox {
anchors.left: batteryGroup.left
anchors.right: batteryGroup.right
title: qsTr("Advanced Power Settings")
visible: showAdvanced.checked
Column {
id: advBatteryColumn
anchors.margins: ScreenTools.defaultFontPixelHeight / 2
ColumnLayout {
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
spacing: ScreenTools.defaultFontPixelWidth
Row {
@ -531,11 +483,11 @@ SetupPage { @@ -531,11 +483,11 @@ SetupPage {
}
QGCLabel {
width: parent.width
wrapMode: Text.WordWrap
text: qsTr("Batteries show less voltage at high throttle. Enter the difference in Volts between idle throttle and full ") +
qsTr("throttle, divided by the number of battery cells. Leave at the default if unsure. ") +
highlightPrefix + qsTr("If this value is set too high, the battery might be deep discharged and damaged.") + highlightSuffix
Layout.fillWidth: true
}
Row {
@ -549,8 +501,9 @@ SetupPage { @@ -549,8 +501,9 @@ SetupPage {
text: ((battNumCells.value * battLowVolt.value) - (battNumCells.value * battVoltLoadDrop.value)).toFixed(1) + qsTr(" V")
}
}
}
} // Rectangle - Advanced power settings
} // Column
} // QGCGroupBox - Advanced power settings
} // Column
} // Item
} // Component
} // SetupPage

32
src/QmlControls/QGCGroupBox.qml

@ -0,0 +1,32 @@ @@ -0,0 +1,32 @@
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.2
import QtQuick.Controls 2.0
import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0
GroupBox {
id: control
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
background: Rectangle {
y: control.topPadding - control.padding
width: parent.width
height: parent.height - control.topPadding + control.padding
color: qgcPal.windowShade
}
label: QGCLabel {
width: control.availableWidth
text: control.title
}
}

1
src/QmlControls/QGroundControl.Controls.qmldir

@ -31,6 +31,7 @@ QGCCheckBox 1.0 QGCCheckBox.qml @@ -31,6 +31,7 @@ QGCCheckBox 1.0 QGCCheckBox.qml
QGCColoredImage 1.0 QGCColoredImage.qml
QGCComboBox 1.0 QGCComboBox.qml
QGCFlickable 1.0 QGCFlickable.qml
QGCGroupBox 1.0 QGCGroupBox.qml
QGCLabel 1.0 QGCLabel.qml
QGCListView 1.0 QGCListView.qml
QGCMapLabel 1.0 QGCMapLabel.qml

Loading…
Cancel
Save