Browse Source

Merge pull request #6036 from DonLakeFlyer/ConsoleSpew

Fix console spew from Qml complaints
QGC4.4
Don Gagne 7 years ago committed by GitHub
parent
commit
4b415ceeb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/PlanView/MissionItemStatus.qml
  2. 333
      src/PlanView/MissionSettingsEditor.qml

4
src/PlanView/MissionItemStatus.qml

@ -31,7 +31,7 @@ Rectangle {
readonly property real _margins: ScreenTools.defaultFontPixelWidth readonly property real _margins: ScreenTools.defaultFontPixelWidth
onMaxWidthChanged: { onMaxWidthChanged: {
var calcLength = (statusListView.count + 1)*statusListView.contentItem.children[0].width var calcLength = (statusListView.count + 1) * (statusListView.count ? statusListView.contentItem.children[0].width : 1)
root.width = root.maxWidth > calcLength ? calcLength : root.maxWidth root.width = root.maxWidth > calcLength ? calcLength : root.maxWidth
} }
@ -63,7 +63,7 @@ Rectangle {
currentIndex: _missionController.currentPlanViewIndex currentIndex: _missionController.currentPlanViewIndex
onCountChanged: { onCountChanged: {
var calcLength = (statusListView.count + 1)*statusListView.contentItem.children[0].width var calcLength = (statusListView.count + 1) * (statusListView.count ? statusListView.contentItem.children[0].width : 1)
root.width = root.maxWidth > calcLength ? calcLength : root.maxWidth root.width = root.maxWidth > calcLength ? calcLength : root.maxWidth
} }

333
src/PlanView/MissionSettingsEditor.qml

@ -15,7 +15,7 @@ import QGroundControl.Controllers 1.0
Rectangle { Rectangle {
id: valuesRect id: valuesRect
width: availableWidth width: availableWidth
height: deferedload.status == Loader.Ready ? (visible ? deferedload.item.height : 0) : 0 height: valuesColumn.height + (_margin * 2)
color: qgcPal.windowShadeDark color: qgcPal.windowShadeDark
visible: missionItem.isCurrentItem visible: missionItem.isCurrentItem
radius: _radius radius: _radius
@ -39,128 +39,166 @@ Rectangle {
readonly property string _firmwareLabel: qsTr("Firmware") readonly property string _firmwareLabel: qsTr("Firmware")
readonly property string _vehicleLabel: qsTr("Vehicle") readonly property string _vehicleLabel: qsTr("Vehicle")
readonly property real _margin: ScreenTools.defaultFontPixelWidth / 2
QGCPalette { id: qgcPal } QGCPalette { id: qgcPal }
QGCFileDialogController { id: fileController } QGCFileDialogController { id: fileController }
Loader { Column {
id: deferedload id: valuesColumn
active: valuesRect.visible anchors.margins: _margin
asynchronous: true anchors.left: parent.left
anchors.margins: _margin anchors.right: parent.right
anchors.left: valuesRect.left anchors.top: parent.top
anchors.right: valuesRect.right spacing: _margin
anchors.top: valuesRect.top
sourceComponent: Component { Column {
Item { anchors.left: parent.left
id: valuesItem anchors.right: parent.right
height: valuesColumn.height + (_margin * 2) spacing: _margin
Column { GridLayout {
id: valuesColumn anchors.left: parent.left
anchors.left: parent.left anchors.right: parent.right
anchors.right: parent.right columnSpacing: ScreenTools.defaultFontPixelWidth
anchors.top: parent.top rowSpacing: columnSpacing
spacing: _margin columns: 2
Loader { QGCLabel {
anchors.left: parent.left text: qsTr("Waypoint alt")
anchors.right: parent.right }
sourceComponent: missionSettings FactTextField {
} fact: QGroundControl.settingsManager.appSettings.defaultMissionItemAltitude
} // Column Layout.fillWidth: true
} // Item }
} // Component
} // Loader
Component { QGCCheckBox {
id: missionSettings id: flightSpeedCheckBox
text: qsTr("Flight speed")
visible: !_missionVehicle.vtol
checked: missionItem.speedSection.specifyFlightSpeed
onClicked: missionItem.speedSection.specifyFlightSpeed = checked
}
FactTextField {
Layout.fillWidth: true
fact: missionItem.speedSection.flightSpeed
visible: flightSpeedCheckBox.visible
enabled: flightSpeedCheckBox.checked
}
} // GridLayout
}
CameraSection {
id: cameraSection
checked: missionItem.cameraSection.settingsSpecified
}
QGCLabel {
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Above camera commands will take affect immediately upon mission start.")
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
font.pointSize: ScreenTools.smallFontPointSize
visible: cameraSection.checked
}
SectionHeader {
id: missionEndHeader
text: qsTr("Mission End")
checked: true
}
Column { Column {
id: valuesColumn anchors.left: parent.left
anchors.left: parent ? parent.left : undefined anchors.right: parent.right
anchors.right: parent ? parent.right : undefined
anchors.top: parent ? parent.top : undefined
spacing: _margin spacing: _margin
visible: missionEndHeader.checked
Column { QGCCheckBox {
anchors.left: parent.left text: qsTr("Return To Launch")
anchors.right: parent.right checked: missionItem.missionEndRTL
spacing: _margin onClicked: missionItem.missionEndRTL = checked
}
}
GridLayout {
anchors.left: parent.left
anchors.right: parent.right
columnSpacing: ScreenTools.defaultFontPixelWidth
rowSpacing: columnSpacing
columns: 2
QGCLabel { SectionHeader {
text: qsTr("Waypoint alt") id: vehicleInfoSectionHeader
} text: qsTr("Vehicle Info")
FactTextField { visible: _offlineEditing && !_waypointsOnlyMode
fact: QGroundControl.settingsManager.appSettings.defaultMissionItemAltitude checked: false
Layout.fillWidth: true }
}
QGCCheckBox { GridLayout {
id: flightSpeedCheckBox anchors.left: parent.left
text: qsTr("Flight speed") anchors.right: parent.right
visible: !_missionVehicle.vtol columnSpacing: ScreenTools.defaultFontPixelWidth
checked: missionItem.speedSection.specifyFlightSpeed rowSpacing: columnSpacing
onClicked: missionItem.speedSection.specifyFlightSpeed = checked columns: 2
} visible: vehicleInfoSectionHeader.visible && vehicleInfoSectionHeader.checked
FactTextField {
Layout.fillWidth: true
fact: missionItem.speedSection.flightSpeed
visible: flightSpeedCheckBox.visible
enabled: flightSpeedCheckBox.checked
}
} // GridLayout
}
CameraSection { QGCLabel {
id: cameraSection text: _firmwareLabel
checked: missionItem.cameraSection.settingsSpecified Layout.fillWidth: true
visible: _showOfflineVehicleCombos
}
FactComboBox {
fact: QGroundControl.settingsManager.appSettings.offlineEditingFirmwareType
indexModel: false
Layout.preferredWidth: _fieldWidth
visible: _showOfflineVehicleCombos
enabled: _enableOfflineVehicleCombos
} }
QGCLabel { QGCLabel {
anchors.left: parent.left text: _vehicleLabel
anchors.right: parent.right Layout.fillWidth: true
text: qsTr("Above camera commands will take affect immediately upon mission start.") visible: _showOfflineVehicleCombos
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
font.pointSize: ScreenTools.smallFontPointSize
visible: cameraSection.checked
} }
FactComboBox {
SectionHeader { fact: QGroundControl.settingsManager.appSettings.offlineEditingVehicleType
id: missionEndHeader indexModel: false
text: qsTr("Mission End") Layout.preferredWidth: _fieldWidth
checked: true visible: _showOfflineVehicleCombos
enabled: _enableOfflineVehicleCombos
} }
Column { QGCLabel {
anchors.left: parent.left text: qsTr("Cruise speed")
anchors.right: parent.right visible: _showCruiseSpeed
spacing: _margin Layout.fillWidth: true
visible: missionEndHeader.checked }
FactTextField {
fact: QGroundControl.settingsManager.appSettings.offlineEditingCruiseSpeed
visible: _showCruiseSpeed
Layout.preferredWidth: _fieldWidth
}
QGCCheckBox { QGCLabel {
text: qsTr("Return To Launch") text: qsTr("Hover speed")
checked: missionItem.missionEndRTL visible: _showHoverSpeed
onClicked: missionItem.missionEndRTL = checked Layout.fillWidth: true
}
} }
FactTextField {
fact: QGroundControl.settingsManager.appSettings.offlineEditingHoverSpeed
visible: _showHoverSpeed
Layout.preferredWidth: _fieldWidth
}
} // GridLayout
SectionHeader {
id: plannedHomePositionSection
text: qsTr("Planned Home Position")
visible: !_vehicleHasHomePosition
checked: false
}
SectionHeader { Column {
id: vehicleInfoSectionHeader anchors.left: parent.left
text: qsTr("Vehicle Info") anchors.right: parent.right
visible: _offlineEditing && !_waypointsOnlyMode spacing: _margin
checked: false visible: plannedHomePositionSection.checked && !_vehicleHasHomePosition
}
GridLayout { GridLayout {
anchors.left: parent.left anchors.left: parent.left
@ -168,100 +206,29 @@ Rectangle {
columnSpacing: ScreenTools.defaultFontPixelWidth columnSpacing: ScreenTools.defaultFontPixelWidth
rowSpacing: columnSpacing rowSpacing: columnSpacing
columns: 2 columns: 2
visible: vehicleInfoSectionHeader.visible && vehicleInfoSectionHeader.checked
QGCLabel {
text: _firmwareLabel
Layout.fillWidth: true
visible: _showOfflineVehicleCombos
}
FactComboBox {
fact: QGroundControl.settingsManager.appSettings.offlineEditingFirmwareType
indexModel: false
Layout.preferredWidth: _fieldWidth
visible: _showOfflineVehicleCombos
enabled: _enableOfflineVehicleCombos
}
QGCLabel { QGCLabel {
text: _vehicleLabel text: qsTr("Altitude")
Layout.fillWidth: true
visible: _showOfflineVehicleCombos
}
FactComboBox {
fact: QGroundControl.settingsManager.appSettings.offlineEditingVehicleType
indexModel: false
Layout.preferredWidth: _fieldWidth
visible: _showOfflineVehicleCombos
enabled: _enableOfflineVehicleCombos
}
QGCLabel {
text: qsTr("Cruise speed")
visible: _showCruiseSpeed
Layout.fillWidth: true
} }
FactTextField { FactTextField {
fact: QGroundControl.settingsManager.appSettings.offlineEditingCruiseSpeed fact: missionItem.plannedHomePositionAltitude
visible: _showCruiseSpeed
Layout.preferredWidth: _fieldWidth
}
QGCLabel {
text: qsTr("Hover speed")
visible: _showHoverSpeed
Layout.fillWidth: true Layout.fillWidth: true
} }
FactTextField {
fact: QGroundControl.settingsManager.appSettings.offlineEditingHoverSpeed
visible: _showHoverSpeed
Layout.preferredWidth: _fieldWidth
}
} // GridLayout
SectionHeader {
id: plannedHomePositionSection
text: qsTr("Planned Home Position")
visible: !_vehicleHasHomePosition
checked: false
} }
Column { QGCLabel {
anchors.left: parent.left width: parent.width
anchors.right: parent.right wrapMode: Text.WordWrap
spacing: _margin font.pointSize: ScreenTools.smallFontPointSize
visible: plannedHomePositionSection.checked && !_vehicleHasHomePosition text: qsTr("Actual position set by vehicle at flight time.")
horizontalAlignment: Text.AlignHCenter
GridLayout { }
anchors.left: parent.left
anchors.right: parent.right
columnSpacing: ScreenTools.defaultFontPixelWidth
rowSpacing: columnSpacing
columns: 2
QGCLabel {
text: qsTr("Altitude")
}
FactTextField {
fact: missionItem.plannedHomePositionAltitude
Layout.fillWidth: true
}
}
QGCLabel {
width: parent.width
wrapMode: Text.WordWrap
font.pointSize: ScreenTools.smallFontPointSize
text: qsTr("Actual position set by vehicle at flight time.")
horizontalAlignment: Text.AlignHCenter
}
QGCButton { QGCButton {
text: qsTr("Set Home To Map Center") text: qsTr("Set Home To Map Center")
onClicked: missionItem.coordinate = map.center onClicked: missionItem.coordinate = map.center
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
}
} }
} // Column }
} // Deferred loader } // Column
} // Rectangle } // Rectangle

Loading…
Cancel
Save