Commit 106c2cf2 authored by Don Gagne's avatar Don Gagne

commit

parent e779c81c
......@@ -32,8 +32,103 @@ import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
Rectangle {
property QGCPalette qgcPal: QGCPalette { colorGroupEnabled: true }
QGCView {
id: rootQGCView
viewComponent: view
Component {
id: preCalibrationDialogComponent
QGCViewDialog {
id: preCalibrationDialog
Fact { id: sys_autostart; name: "SYS_AUTOSTART" }
function accept() {
sys_autostart.value = 0
customConfigDialog.hideDialog()
}
QGCLabel {
anchors.fill: parent
wrapMode: Text.WordWrap
text: "Your vehicle is using a custom airframe configuration. " +
"This configuration can only be modified through the Parameter Editor.\n\n" +
"If you want to Reset your airframe configuration and select a standard configuration, click 'Reset' above."
}
Rectangle {
property string calibrationType
id: boardRotationOverlay
width: 300
height: boardRotationOverlayColumn.height + 11
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
color: qgcPal.window
border.width: 1
border.color: qgcPal.text
visible: false
z: overlay.z + 1
Column {
id: boardRotationOverlayColumn
anchors.topMargin: 10
anchors.top: parent.top
width: parent.width
spacing: 10
Column {
anchors.leftMargin: 10
anchors.rightMargin: 10
anchors.left: parent.left
anchors.right: parent.right
spacing: 10
QGCLabel {
width: parent.width
wrapMode: Text.WordWrap
text: "Please check and/or update board rotation before calibrating"
}
FactComboBox {
width: rotationColumnWidth
model: rotations
fact: Fact { name: "SENS_BOARD_ROT" }
}
}
QGCButton {
x: 1
width: parent.width - 2
primary: true
text: "OK"
onClicked: {
boardRotationOverlay.visible = false
overlay.visible = false
if (boardRotationOverlay.calibrationType == "gyro") {
controller.calibrateGyro()
} else if (boardRotationOverlay.calibrationType == "accel") {
controller.calibrateAccel()
} else if (boardRotationOverlay.calibrationType == "compass") {
controller.calibrateCompass()
}
}
}
}
}
}
}
Component {
id: view
// FIXME: Need to convert QGCViewPanel to FactPanel
QGCViewPanel {
anchors.fill: parent
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
readonly property int rotationColumnWidth: 200
readonly property var rotations: [
......@@ -66,12 +161,11 @@ Rectangle {
"ROTATION_ROLL_270_YAW_270"
]
readonly property string statusTextAreaDefaultText: "Sensor config is a work in progress. Not all visuals for all calibration types fully implemented.\n\n" +
"For Compass calibration you will need to rotate your vehicle through a number of positions. For this calibration is is best " +
"to be connected to you vehicle via radio instead of USB since the USB cable will likely get in the way.\n\n" +
readonly property string statusTextAreaDefaultText: "For Compass calibration you will need to rotate your vehicle through a number of positions. For this calibration is is best " +
"to be connected to your vehicle via radio instead of USB since the USB cable will likely get in the way.\n\n" +
"For Gyroscope calibration you will need to place your vehicle right side up on solid surface and leave it still.\n\n" +
"For Accelerometer calibration you will need to place your vehicle on all six sides and hold it there for a few seconds.\n\n" +
"For Airspeed calibration you will need to keep your airspeed sensor out of any wind.\n\n"
"For Accelerometer calibration you will need to place your vehicle on all six sides and hold it still there for a few seconds.\n\n" +
"For Airspeed calibration you will need to keep your airspeed sensor out of any wind and then blow across the sensor.\n\n"
Fact { id: cal_mag0_id; name: "CAL_MAG0_ID" }
Fact { id: cal_mag1_id; name: "CAL_MAG1_ID" }
......@@ -146,68 +240,6 @@ Rectangle {
}
}
Rectangle {
property string calibrationType
id: boardRotationOverlay
width: 300
height: boardRotationOverlayColumn.height + 11
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
color: qgcPal.window
border.width: 1
border.color: qgcPal.text
visible: false
z: overlay.z + 1
Column {
id: boardRotationOverlayColumn
anchors.topMargin: 10
anchors.top: parent.top
width: parent.width
spacing: 10
Column {
anchors.leftMargin: 10
anchors.rightMargin: 10
anchors.left: parent.left
anchors.right: parent.right
spacing: 10
QGCLabel {
width: parent.width
wrapMode: Text.WordWrap
text: "Please check and/or update board rotation before calibrating"
}
FactComboBox {
width: rotationColumnWidth
model: rotations
fact: Fact { name: "SENS_BOARD_ROT" }
}
}
QGCButton {
x: 1
width: parent.width - 2
primary: true
text: "OK"
onClicked: {
boardRotationOverlay.visible = false
overlay.visible = false
if (boardRotationOverlay.calibrationType == "gyro") {
controller.calibrateGyro()
} else if (boardRotationOverlay.calibrationType == "accel") {
controller.calibrateAccel()
} else if (boardRotationOverlay.calibrationType == "compass") {
controller.calibrateCompass()
}
}
}
}
}
function showBoardRotationOverlay(calibrationType) {
boardRotationOverlay.calibrationType = calibrationType
......@@ -561,5 +593,6 @@ Rectangle {
}
}
}
} // Rectangle
} // Component - view
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment