@ -40,14 +40,16 @@ QGCView {
@@ -40,14 +40,16 @@ QGCView {
/ / H e l p t e x t w h i c h i s s h o w n b o t h i n t h e s t a t u s t e x t a r e a p r i o r t o p r e s s i n g a c a l b u t t o n a n d i n t h e
/ / p r e - c a l i b r a t i o n d i a l o g .
readonly property string compassHelp: "For Compass calibration you will need to rotate your vehicle through a number of positions. For this calibration it is best " +
"to be connected to your vehicle via radio instead of USB, since the USB cable will likely get in the way."
readonly property string gyroHelp: "For Gyroscope calibration you will need to place your vehicle right side up on solid surface and leave it still."
readonly property string accelHelp: "For Accelerometer calibration you will need to place your vehicle on all six sides on a level surface and hold it still in each orientation for a few seconds."
readonly property string levelHelp: "To level the horizon you need to place the vehicle in its level flight position."
readonly property string boardRotationText: "If the autopilot is mounted in flight direction, leave the default value (ROTATION_NONE)"
readonly property string compassRotationText: "If the compass or GPS module is mounted in flight direction, leave the default value (ROTATION_NONE)"
readonly property string compassHelp: "For Compass calibration you will need to rotate your vehicle through a number of positions. Most users prefer to do this wirelessly with the telemetry link."
readonly property string gyroHelp: "For Gyroscope calibration you will need to place your vehicle on a surface and leave it still."
readonly property string accelHelp: "For Accelerometer calibration you will need to place your vehicle on all six sides on a perfectly level surface and hold it still in each orientation for a few seconds."
readonly property string levelHelp: "To level the horizon you need to place the vehicle in its level flight position and press OK."
readonly property string airspeedHelp: "For Airspeed calibration you will need to keep your airspeed sensor out of any wind and then blow across the sensor."
readonly property string statusTextAreaDefaultText: compassHelp + "\n\n" + gyroHelp + "\n\n" + accelHelp + "\n\n" + airspeedHelp + "\n\n "
readonly property string statusTextAreaDefaultText: "Start the individual calibration steps by clicking one of the buttons above. "
/ / U s e d t o p a s s w h a t t y p e o f c a l i b r a t i o n i s b e i n g p e r f o r m e d t o t h e p r e C a l i b r a t i o n D i a l o g
property string preCalibrationDialogType
@ -55,7 +57,10 @@ QGCView {
@@ -55,7 +57,10 @@ QGCView {
/ / U s e d t o p a s s h e l p t e x t t o t h e p r e C a l i b r a t i o n D i a l o g d i a l o g
property string preCalibrationDialogHelp
readonly property int rotationColumnWidth: 200
readonly property int sideBarH1PointSize: ( ScreenTools . defaultFontPointSize * 1.3 + 0.5 )
readonly property int mainTextH1PointSize: ( ScreenTools . defaultFontPointSize * 1.5 + 0.5 )
readonly property int rotationColumnWidth: 300
readonly property var rotations: [
"ROTATION_NONE" ,
"ROTATION_YAW_45" ,
@ -141,7 +146,7 @@ QGCView {
@@ -141,7 +146,7 @@ QGCView {
Column {
anchors.fill: parent
spacing: 10
spacing: 5
QGCLabel {
width: parent . width
@ -152,14 +157,14 @@ QGCView {
@@ -152,14 +157,14 @@ QGCView {
QGCLabel {
width: parent . width
wrapMode: Text . WordWrap
visible: preCalibrationDialogType != "airspeed"
text: "Please check and/or update board rotation before calibrating."
visible: ( preCalibrationDialogType != "airspeed" ) && ( preCalibrationDialogType != "gyro" )
text: boardRotationText
}
FactComboBox {
width: rotationColumnWidth
model: rotations
visible: preCalibrationDialogType != "airspeed"
visible: preCalibrationDialogType != "airspeed" && ( preCalibrationDialogType != "gyro" )
fact: Fact { name: "SENS_BOARD_ROT" ; onFactMissing: showMissingFactOverlay ( name ) }
}
}
@ -174,33 +179,43 @@ QGCView {
@@ -174,33 +179,43 @@ QGCView {
Column {
anchors.fill: parent
spacing: 10
spacing: 10
QGCLabel {
width: parent . width
wrapMode: Text . WordWrap
text: "Please check and/or update compass rotation(s)"
}
Column {
spacing: 5
/ / C o m p a s s 0 r o t a t i o n
Component {
id: compass0ComponentLabel
/ / C o m p a s s 0 r o t a t i o n
Component {
id: compass0ComponentLabel
QGCLabel {
font.pointSize: sideBarH1PointSize
text: "External Compass Orientation"
}
QGCLabel { text: "External Compass Orientation" }
}
Component {
id: compass0ComponentCombo
}
Component {
id: compass0ComponentText
FactComboBox {
id: compass0RotationCombo
width: rotationColumnWidth
model: rotations
fact: Fact { name: "CAL_MAG0_ROT" ; onFactMissing: showMissingFactOverlay ( name ) }
QGCLabel {
width: parent . width
wrapMode: Text . WordWrap
text: compassRotationText
}
}
}
Loader { sourceComponent: showCompass0Rot ? compass0ComponentLabel : null }
Loader { sourceComponent: showCompass0Rot ? compass0ComponentCombo : null }
Component {
id: compass0ComponentCombo
FactComboBox {
id: compass0RotationCombo
width: rotationColumnWidth
model: rotations
fact: Fact { name: "CAL_MAG0_ROT" ; onFactMissing: showMissingFactOverlay ( name ) }
}
}
Loader { sourceComponent: showCompass0Rot ? compass0ComponentLabel : null }
Loader { sourceComponent: showCompass0Rot ? compass0ComponentText : null }
Loader { sourceComponent: showCompass0Rot ? compass0ComponentCombo : null }
}
/ / C o m p a s s 1 r o t a t i o n
Component {
id: compass1ComponentLabel
@ -335,11 +350,14 @@ QGCView {
@@ -335,11 +350,14 @@ QGCView {
IndicatorButton {
property Fact fact: Fact { name: "SENS_BOARD_X_OFF" }
property Fact checkAcc: Fact { name: "CAL_ACC0_ID" }
property Fact checkGyro: Fact { name: "CAL_GYRO0_ID" }
id: levelButton
width: parent . buttonWidth
text: "Level Horizon"
indicatorGreen: fact . value != 0
enabled: checkAcc . value != 0 && checkGyro . value != 0
onClicked: {
preCalibrationDialogType = "level"
@ -468,73 +486,108 @@ QGCView {
@@ -468,73 +486,108 @@ QGCView {
}
Column {
anchors.left: orientationCalArea . right
anchors.leftMargin: 5
spacing: 20
x: parent . width - rotationColumnWidth
QGCLabel { text: "Autopilot Orientation" }
FactComboBox {
id: boardRotationCombo
width: rotationColumnWidth ;
model: rotations
fact: Fact { name: "SENS_BOARD_ROT" }
}
Column {
spacing: 5
/ / C o m p a s s 0 r o t a t i o n
Component {
id: compass0ComponentLabel2
QGCLabel {
font.pointSize: sideBarH1PointSize
text: "Autopilot Orientation"
}
QGCLabel { text: "External Compass Orientation" }
}
Component {
id: compass0ComponentCombo2
QGCLabel {
width: parent . width
wrapMode: Text . WordWrap
text: boardRotationText
}
FactComboBox {
id: compass0 RotationCombo
width: rotationColumnWidth
id: board RotationCombo
width: rotationColumnWidth ;
model: rotations
fact: Fact { name: "CAL_MAG0 _ROT" }
fact: Fact { name: "SENS_BOARD _ROT" }
}
}
Loader { sourceComponent: showCompass0Rot ? compass0ComponentLabel2 : null }
Loader { sourceComponent: showCompass0Rot ? compass0ComponentCombo2 : null }
/ / C o m p a s s 1 r o t a t i o n
Component {
id: compass1ComponentLabel2
Column {
spacing: 5
QGCLabel { text: "Compass 1 Orientation" }
}
Component {
id: compass1ComponentCombo2
/ / C o m p a s s 0 r o t a t i o n
Component {
id: compass0ComponentLabel2
FactComboBox {
id: compass1RotationCombo
width: rotationColumnWidth
model: rotations
fact: Fact { name: "CAL_MAG1_ROT" }
QGCLabel {
font.pointSize: sideBarH1PointSize
text: "External Compass Orientation"
}
}
Component {
id: compass0ComponentCombo2
FactComboBox {
id: compass0RotationCombo
width: rotationColumnWidth
model: rotations
fact: Fact { name: "CAL_MAG0_ROT" }
}
}
Loader { sourceComponent: showCompass0Rot ? compass0ComponentLabel2 : null }
Loader { sourceComponent: showCompass0Rot ? compass0ComponentCombo2 : null }
}
Loader { sourceComponent: showCompass1Rot ? compass1ComponentLabel2 : null }
Loader { sourceComponent: showCompass1Rot ? compass1ComponentCombo2 : null }
/ / C o m p a s s 2 r o t a t i o n
Component {
id: compass2ComponentLabel2
Column {
spacing: 5
/ / C o m p a s s 1 r o t a t i o n
Component {
id: compass1ComponentLabel2
QGCLabel { text: "Compass 2 Orientation" }
QGCLabel {
font.pointSize: sideBarH1PointSize
text: "External Compass 1 Orientation"
}
}
Component {
id: compass1ComponentCombo2
FactComboBox {
id: compass1RotationCombo
width: rotationColumnWidth
model: rotations
fact: Fact { name: "CAL_MAG1_ROT" }
}
}
Loader { sourceComponent: showCompass1Rot ? compass1ComponentLabel2 : null }
Loader { sourceComponent: showCompass1Rot ? compass1ComponentCombo2 : null }
}
Component {
id: compass2ComponentCombo2
FactComboBox {
id: compass1RotationCombo
width: rotationColumnWidth
model: rotations
fact: Fact { name: "CAL_MAG2_ROT" }
Column {
spacing: 5
/ / C o m p a s s 2 r o t a t i o n
Component {
id: compass2ComponentLabel2
QGCLabel {
font.pointSize: sidebarH1PointSize
text: "Compass 2 Orientation"
}
}
Component {
id: compass2ComponentCombo2
FactComboBox {
id: compass1RotationCombo
width: rotationColumnWidth
model: rotations
fact: Fact { name: "CAL_MAG2_ROT" }
}
}
Loader { sourceComponent: showCompass2Rot ? compass2ComponentLabel2 : null }
Loader { sourceComponent: showCompass2Rot ? compass2ComponentCombo2 : null }
}
Loader { sourceComponent: showCompass2Rot ? compass2ComponentLabel2 : null }
Loader { sourceComponent: showCompass2Rot ? compass2ComponentCombo2 : null }
}
}
}