Browse Source

Merge pull request #3141 from DonLakeFlyer/RadioCalScroll

Radio cal scroll
QGC4.4
Don Gagne 9 years ago
parent
commit
18c6a4307d
  1. 513
      src/AutoPilotPlugins/Common/RadioComponent.qml
  2. 2
      src/FlightMap/MapItems/MissionItemIndicator.qml

513
src/AutoPilotPlugins/Common/RadioComponent.qml

@ -254,331 +254,336 @@ QGCView {
// Main view Qml starts here // Main view Qml starts here
// Left side column QGCFlickable {
Column { anchors.fill: parent
id: leftColumn contentHeight: Math.max(leftColumn.height, rightColumn.height)
anchors.top: parent.top clip: true
anchors.left: parent.left
anchors.right: columnSpacer.left // Left side column
spacing: 10
// Attitude Controls
Column { Column {
width: parent.width id: leftColumn
spacing: 5 anchors.left: parent.left
anchors.right: columnSpacer.left
spacing: 10
QGCLabel { text: "Attitude Controls" } // Attitude Controls
Column {
width: parent.width
spacing: 5
Item { QGCLabel { text: "Attitude Controls" }
width: parent.width
height: defaultTextHeight * 2
QGCLabel { Item {
id: rollLabel width: parent.width
width: defaultTextWidth * 10 height: defaultTextHeight * 2
text: "Roll"
}
Loader { QGCLabel {
id: rollLoader id: rollLabel
anchors.left: rollLabel.right width: defaultTextWidth * 10
anchors.right: parent.right text: "Roll"
height: qgcView.defaultTextHeight }
width: 100
sourceComponent: channelMonitorDisplayComponent
property real defaultTextWidth: qgcView.defaultTextWidth
property bool mapped: controller.rollChannelMapped
property bool reversed: controller.rollChannelReversed
}
Connections { Loader {
target: controller id: rollLoader
anchors.left: rollLabel.right
anchors.right: parent.right
height: qgcView.defaultTextHeight
width: 100
sourceComponent: channelMonitorDisplayComponent
property real defaultTextWidth: qgcView.defaultTextWidth
property bool mapped: controller.rollChannelMapped
property bool reversed: controller.rollChannelReversed
}
Connections {
target: controller
onRollChannelRCValueChanged: rollLoader.item.rcValue = rcValue onRollChannelRCValueChanged: rollLoader.item.rcValue = rcValue
}
} }
}
Item { Item {
width: parent.width width: parent.width
height: defaultTextHeight * 2 height: defaultTextHeight * 2
QGCLabel { QGCLabel {
id: pitchLabel id: pitchLabel
width: defaultTextWidth * 10 width: defaultTextWidth * 10
text: "Pitch" text: "Pitch"
} }
Loader { Loader {
id: pitchLoader id: pitchLoader
anchors.left: pitchLabel.right anchors.left: pitchLabel.right
anchors.right: parent.right anchors.right: parent.right
height: qgcView.defaultTextHeight height: qgcView.defaultTextHeight
width: 100 width: 100
sourceComponent: channelMonitorDisplayComponent sourceComponent: channelMonitorDisplayComponent
property real defaultTextWidth: qgcView.defaultTextWidth property real defaultTextWidth: qgcView.defaultTextWidth
property bool mapped: controller.pitchChannelMapped property bool mapped: controller.pitchChannelMapped
property bool reversed: controller.pitchChannelReversed property bool reversed: controller.pitchChannelReversed
} }
Connections { Connections {
target: controller target: controller
onPitchChannelRCValueChanged: pitchLoader.item.rcValue = rcValue onPitchChannelRCValueChanged: pitchLoader.item.rcValue = rcValue
}
} }
}
Item { Item {
width: parent.width width: parent.width
height: defaultTextHeight * 2 height: defaultTextHeight * 2
QGCLabel { QGCLabel {
id: yawLabel id: yawLabel
width: defaultTextWidth * 10 width: defaultTextWidth * 10
text: "Yaw" text: "Yaw"
} }
Loader { Loader {
id: yawLoader id: yawLoader
anchors.left: yawLabel.right anchors.left: yawLabel.right
anchors.right: parent.right anchors.right: parent.right
height: qgcView.defaultTextHeight height: qgcView.defaultTextHeight
width: 100 width: 100
sourceComponent: channelMonitorDisplayComponent sourceComponent: channelMonitorDisplayComponent
property real defaultTextWidth: qgcView.defaultTextWidth property real defaultTextWidth: qgcView.defaultTextWidth
property bool mapped: controller.yawChannelMapped property bool mapped: controller.yawChannelMapped
property bool reversed: controller.yawChannelReversed property bool reversed: controller.yawChannelReversed
} }
Connections { Connections {
target: controller target: controller
onYawChannelRCValueChanged: yawLoader.item.rcValue = rcValue onYawChannelRCValueChanged: yawLoader.item.rcValue = rcValue
}
} }
}
Item { Item {
width: parent.width width: parent.width
height: defaultTextHeight * 2 height: defaultTextHeight * 2
QGCLabel { QGCLabel {
id: throttleLabel id: throttleLabel
width: defaultTextWidth * 10 width: defaultTextWidth * 10
text: "Throttle" text: "Throttle"
} }
Loader { Loader {
id: throttleLoader id: throttleLoader
anchors.left: throttleLabel.right anchors.left: throttleLabel.right
anchors.right: parent.right anchors.right: parent.right
height: qgcView.defaultTextHeight height: qgcView.defaultTextHeight
width: 100 width: 100
sourceComponent: channelMonitorDisplayComponent sourceComponent: channelMonitorDisplayComponent
property real defaultTextWidth: qgcView.defaultTextWidth property real defaultTextWidth: qgcView.defaultTextWidth
property bool mapped: controller.throttleChannelMapped property bool mapped: controller.throttleChannelMapped
property bool reversed: controller.throttleChannelReversed property bool reversed: controller.throttleChannelReversed
} }
Connections { Connections {
target: controller target: controller
onThrottleChannelRCValueChanged: throttleLoader.item.rcValue = rcValue onThrottleChannelRCValueChanged: throttleLoader.item.rcValue = rcValue
}
} }
} } // Column - Attitude Control labels
} // Column - Attitude Control labels
// Command Buttons // Command Buttons
Row { Row {
spacing: 10 spacing: 10
QGCButton { QGCButton {
id: skipButton id: skipButton
text: "Skip" text: "Skip"
onClicked: controller.skipButtonClicked() onClicked: controller.skipButtonClicked()
} }
QGCButton { QGCButton {
id: cancelButton id: cancelButton
text: "Cancel" text: "Cancel"
onClicked: controller.cancelButtonClicked() onClicked: controller.cancelButtonClicked()
} }
QGCButton { QGCButton {
id: nextButton id: nextButton
primary: true primary: true
text: "Calibrate" text: "Calibrate"
onClicked: { onClicked: {
if (text == "Calibrate") { if (text == "Calibrate") {
showDialog(zeroTrimsDialogComponent, dialogTitle, qgcView.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel) showDialog(zeroTrimsDialogComponent, dialogTitle, qgcView.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel)
} else { } else {
controller.nextButtonClicked() controller.nextButtonClicked()
}
} }
} }
} } // Row - Buttons
} // Row - Buttons
// Status Text
QGCLabel {
id: statusText
width: parent.width
wrapMode: Text.WordWrap
}
Item {
width: 10
height: defaultTextHeight * 4
}
Rectangle {
width: parent.width
height: 1
border.color: qgcPal.text
border.width: 1
}
QGCLabel { text: "Additional Radio setup:" }
Row {
spacing: 10
// Status Text
QGCLabel { QGCLabel {
anchors.baseline: bindButton.baseline id: statusText
text: "Place Spektrum satellite receiver in bind mode:" width: parent.width
wrapMode: Text.WordWrap
} }
QGCButton { Item {
id: bindButton width: 10
text: "Spektrum Bind" height: defaultTextHeight * 4
onClicked: showDialog(spektrumBindDialogComponent, dialogTitle, qgcView.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel)
} }
}
QGCButton { Rectangle {
text: "Copy Trims" width: parent.width
visible: QGroundControl.multiVehicleManager.activeVehicle.px4Firmware height: 1
onClicked: showDialog(copyTrimsDialogComponent, dialogTitle, qgcView.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel) border.color: qgcPal.text
} border.width: 1
}
Repeater { QGCLabel { text: "Additional Radio setup:" }
model: QGroundControl.multiVehicleManager.activeVehicle.px4Firmware ? [ "RC_MAP_FLAPS", "RC_MAP_AUX1", "RC_MAP_AUX2", "RC_MAP_AUX3" ] : 0
Row { Row {
spacing: ScreenTools.defaultFontPixelWidth spacing: 10
property Fact fact: controller.getParameterFact(-1, modelData)
QGCLabel { QGCLabel {
anchors.baseline: optCombo.baseline anchors.baseline: bindButton.baseline
text: fact.shortDescription + ":" text: "Place Spektrum satellite receiver in bind mode:"
} }
FactComboBox { QGCButton {
id: optCombo id: bindButton
width: ScreenTools.defaultFontPixelWidth * 15 text: "Spektrum Bind"
fact: parent.fact
indexModel: false onClicked: showDialog(spektrumBindDialogComponent, dialogTitle, qgcView.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel)
} }
} }
} // Repeater
} // Column - Left Column
Item {
id: columnSpacer
anchors.right: rightColumn.left
width: 20
}
// Right side column QGCButton {
Column { text: "Copy Trims"
id: rightColumn visible: QGroundControl.multiVehicleManager.activeVehicle.px4Firmware
anchors.top: parent.top onClicked: showDialog(copyTrimsDialogComponent, dialogTitle, qgcView.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel)
anchors.right: parent.right }
width: defaultTextWidth * 35
spacing: 10
Row { Repeater {
spacing: 10 model: QGroundControl.multiVehicleManager.activeVehicle.px4Firmware ? [ "RC_MAP_FLAPS", "RC_MAP_AUX1", "RC_MAP_AUX2", "RC_MAP_AUX3" ] : 0
ExclusiveGroup { id: modeGroup }
QGCRadioButton { Row {
exclusiveGroup: modeGroup spacing: ScreenTools.defaultFontPixelWidth
text: "Mode 1"
checked: controller.transmitterMode == 1
onClicked: controller.transmitterMode = 1 property Fact fact: controller.getParameterFact(-1, modelData)
}
QGCRadioButton { QGCLabel {
exclusiveGroup: modeGroup anchors.baseline: optCombo.baseline
text: "Mode 2" text: fact.shortDescription + ":"
checked: controller.transmitterMode == 2 }
onClicked: controller.transmitterMode = 2 FactComboBox {
} id: optCombo
} width: ScreenTools.defaultFontPixelWidth * 15
fact: parent.fact
indexModel: false
}
}
} // Repeater
} // Column - Left Column
Image { Item {
width: parent.width id: columnSpacer
height: defaultTextHeight * 15 anchors.right: rightColumn.left
fillMode: Image.PreserveAspectFit width: 20
smooth: true
source: controller.imageHelp
} }
// Channel monitor // Right side column
Column { Column {
width: parent.width id: rightColumn
spacing: 5 anchors.top: parent.top
anchors.right: parent.right
width: defaultTextWidth * 35
spacing: 10
QGCLabel { text: "Channel Monitor" } Row {
spacing: 10
ExclusiveGroup { id: modeGroup }
Connections { QGCRadioButton {
target: controller exclusiveGroup: modeGroup
text: "Mode 1"
checked: controller.transmitterMode == 1
onChannelRCValueChanged: { onClicked: controller.transmitterMode = 1
if (channelMonitorRepeater.itemAt(channel)) { }
channelMonitorRepeater.itemAt(channel).loader.item.rcValue = rcValue
} QGCRadioButton {
exclusiveGroup: modeGroup
text: "Mode 2"
checked: controller.transmitterMode == 2
onClicked: controller.transmitterMode = 2
} }
} }
Repeater { Image {
id: channelMonitorRepeater width: parent.width
model: controller.channelCount height: defaultTextHeight * 15
width: parent.width fillMode: Image.PreserveAspectFit
smooth: true
source: controller.imageHelp
}
Row { // Channel monitor
spacing: 5 Column {
width: parent.width
spacing: 5
// Need this to get to loader from Connections above QGCLabel { text: "Channel Monitor" }
property Item loader: theLoader
QGCLabel { Connections {
id: channelLabel target: controller
text: modelData + 1
onChannelRCValueChanged: {
if (channelMonitorRepeater.itemAt(channel)) {
channelMonitorRepeater.itemAt(channel).loader.item.rcValue = rcValue
}
} }
}
Loader { Repeater {
id: theLoader id: channelMonitorRepeater
anchors.verticalCenter: channelLabel.verticalCenter model: controller.channelCount
height: qgcView.defaultTextHeight width: parent.width
width: 200
sourceComponent: channelMonitorDisplayComponent Row {
spacing: 5
property real defaultTextWidth: qgcView.defaultTextWidth
property bool mapped: true // Need this to get to loader from Connections above
readonly property bool reversed: false property Item loader: theLoader
QGCLabel {
id: channelLabel
text: modelData + 1
}
Loader {
id: theLoader
anchors.verticalCenter: channelLabel.verticalCenter
height: qgcView.defaultTextHeight
width: 200
sourceComponent: channelMonitorDisplayComponent
property real defaultTextWidth: qgcView.defaultTextWidth
property bool mapped: true
readonly property bool reversed: false
}
} }
} }
} } // Column - Channel Monitor
} // Column - Channel Monitor } // Column - Right Column
} // Column - Right Column } // QGCFlickable
} // QGCViewPanel } // QGCViewPanel
} }

2
src/FlightMap/MapItems/MissionItemIndicator.qml

@ -44,7 +44,7 @@ MapQuickItem {
MissionItemIndexLabel { MissionItemIndexLabel {
id: _label id: _label
isCurrentItem: _isCurrentItem isCurrentItem: _isCurrentItem
label: missionItem.abbreviation label: missionItem ? missionItem.abbreviation : ""
onClicked: _item.clicked() onClicked: _item.clicked()
property bool _isCurrentItem: missionItem ? missionItem.isCurrentItem : false property bool _isCurrentItem: missionItem ? missionItem.isCurrentItem : false

Loading…
Cancel
Save