@ -36,7 +36,7 @@ QGCView {
@@ -36,7 +36,7 @@ QGCView {
readonly property string levelHelp: qsTr ( "To level the horizon you need to place the vehicle in its level flight position and press OK." )
readonly property string airspeedHelp: qsTr ( "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: qsTr ( "Start the individual calibration steps by clicking one of the buttons above ." )
readonly property string statusTextAreaDefaultText: qsTr ( "Start the individual calibration steps by clicking one of the buttons to the left ." )
/ / 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
@ -44,7 +44,7 @@ QGCView {
@@ -44,7 +44,7 @@ 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: 25 0
readonly property int rotationColumnWidth: ScreenTools . defaultFontPixelWidth * 3 0
readonly property var rotations: [
"ROTATION_NONE" ,
"ROTATION_YAW_45" ,
@ -114,7 +114,7 @@ QGCView {
@@ -114,7 +114,7 @@ QGCView {
onSetCompassRotations: {
if ( showCompass0Rot || showCompass1Rot || showCompass2Rot ) {
showDialog ( compassRotation DialogComponent, qsTr ( "Set Compass Rotation(s)" ) , qgcView . showDialogDefaultWidth , StandardButton . Ok )
showDialog ( setOrientations DialogComponent, qsTr ( "Set Compass Rotation(s)" ) , qgcView . showDialogDefaultWidth , StandardButton . Ok )
}
}
@ -187,183 +187,232 @@ QGCView {
@@ -187,183 +187,232 @@ QGCView {
}
Component {
id: compassRotation DialogComponent
id: setOrientations DialogComponent
QGCViewDialog {
id: compassRotation Dialog
id: setOrientations Dialog
Column {
anchors.fill: parent
spacing: ScreenTools . defaultFontPixelHeight
QGCLabel {
width: parent . width
wrapMode: Text . WordWrap
text: compassRotationText
}
QGCFlickable {
anchors.fill: parent
contentHeight: columnLayout . height
clip: true
/ / C o m p a s s 0 r o t a t i o n
Component {
id: compass0ComponentLabel
Column {
id: columnLayout
anchors.margins: ScreenTools . defaultFontPixelWidth
anchors.left: parent . left
anchors.right: parent . right
anchors.top: parent . top
spacing: ScreenTools . defaultFontPixelHeight
QGCLabel {
text: qsTr ( "External Compass Orientation" )
width: parent . width
wrapMode: Text . WordWrap
text: boardRotationText
}
}
Component {
id: compass0ComponentCombo
FactComboBox {
id: compass0RotationCombo
width: rotationColumnWidth
model: rotations
fact: cal_mag0_rot
Column {
QGCLabel {
text: qsTr ( "Autopilot Orientation:" )
}
FactComboBox {
id: boardRotationCombo
width: rotationColumnWidth ;
model: rotations
fact: sens_board_rot
}
}
}
Loader { sourceComponent: showCompass0Rot ? compass0ComponentLabel : 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
QGCLabel { text: qsTr ( "Compass 1 Orientation" ) }
}
Component {
id: compass1ComponentCombo
FactComboBox {
id: compass1RotationCombo
width: rotationColumnWidth
model: rotations
fact: cal_mag1_rot
Column {
/ / C o m p a s s 0 r o t a t i o n
Component {
id: compass0ComponentLabel2
QGCLabel {
text: qsTr ( "External Compass Orientation:" )
}
}
Component {
id: compass0ComponentCombo2
FactComboBox {
id: compass0RotationCombo
width: rotationColumnWidth
model: rotations
fact: cal_mag0_rot
}
}
Loader { sourceComponent: showCompass0Rot ? compass0ComponentLabel2 : null }
Loader { sourceComponent: showCompass0Rot ? compass0ComponentCombo2 : null }
}
}
Loader { sourceComponent: showCompass1Rot ? compass1ComponentLabel : null }
Loader { sourceComponent: showCompass1Rot ? compass1ComponentCombo : null }
/ / C o m p a s s 2 r o t a t i o n
Component {
id: compass2ComponentLabel
Column {
/ / C o m p a s s 1 r o t a t i o n
Component {
id: compass1ComponentLabel2
QGCLabel { text: qsTr ( "Compass 2 Orientation" ) }
}
Component {
id: compass2ComponentCombo
FactComboBox {
id: compass1RotationCombo
width: rotationColumnWidth
model: rotations
fact: cal_mag2_rot
QGCLabel {
text: qsTr ( "External Compass 1 Orientation:" )
}
}
Component {
id: compass1ComponentCombo2
FactComboBox {
id: compass1RotationCombo
width: rotationColumnWidth
model: rotations
fact: cal_mag1_rot
}
}
Loader { sourceComponent: showCompass1Rot ? compass1ComponentLabel2 : null }
Loader { sourceComponent: showCompass1Rot ? compass1ComponentCombo2 : null }
}
}
Loader { sourceComponent: showCompass2Rot ? compass2ComponentLabel : null }
Loader { sourceComponent: showCompass2Rot ? compass2ComponentCombo : null }
} / / C o l u m n
Column {
spacing: ScreenTools . defaultFontPixelWidth
/ / C o m p a s s 2 r o t a t i o n
Component {
id: compass2ComponentLabel2
QGCLabel {
text: qsTr ( "Compass 2 Orientation" )
}
}
Component {
id: compass2ComponentCombo2
FactComboBox {
id: compass1RotationCombo
width: rotationColumnWidth
model: rotations
fact: cal_mag2_rot
}
}
Loader { sourceComponent: showCompass2Rot ? compass2ComponentLabel2 : null }
Loader { sourceComponent: showCompass2Rot ? compass2ComponentCombo2 : null }
}
} / / C o l u m n
} / / Q G C F l i c k a b l e
} / / Q G C V i e w D i a l o g
} / / C o m p o n e n t - c o m p a s s R o t a t i o n D i a l o g C o m p o n e n t
} / / C o m p o n e n t - s e t O r i e n t a t i o n s D i a l o g C o m p o n e n t
QGCViewPanel {
id: panel
anchors.fill: parent
Column {
anchors.fill: parent
Row {
readonly property int buttonWidth: ScreenTools . defaultFontPixelWidth * 15
id: buttonColumn
spacing: ScreenTools . defaultFontPixelHeight / 2
spacing: ScreenTools . defaultFontPixelWidth
readonly property int buttonWidth: ScreenTools . defaultFontPixelWidth * 15
QGCLabel { text: qsTr ( "Calibrate:" ) ; anchors.baseline: compassButton . baseline }
IndicatorButton {
id: compassButton
width: parent . buttonWidth
text: qsTr ( "Compass" )
indicatorGreen: cal_mag0_id . value != 0
IndicatorButton {
id: compassButton
width: parent . buttonWidth
text: qsTr ( "Compass" )
indicatorGreen: cal_mag0_id . value != 0
onClicked: {
preCalibrationDialogType = "compass"
preCalibrationDialogHelp = compassHelp
showDialog ( preCalibrationDialogComponent , qsTr ( "Calibrate Compass" ) , qgcView . showDialogDefaultWidth , StandardButton . Cancel | StandardButton . Ok )
}
onClicked: {
preCalibrationDialogType = "compass"
preCalibrationDialogHelp = compassHelp
showDialog ( preCalibrationDialogComponent , qsTr ( "Calibrate Compass" ) , qgcView . showDialogDefaultWidth , StandardButton . Cancel | StandardButton . Ok )
}
}
IndicatorButton {
id: gyroButton
width: parent . buttonWidth
text: qsTr ( "Gyroscope" )
indicatorGreen: cal_gyro0_id . value != 0
IndicatorButton {
id: gyroButton
width: parent . buttonWidth
text: qsTr ( "Gyroscope" )
indicatorGreen: cal_gyro0_id . value != 0
onClicked: {
preCalibrationDialogType = "gyro"
preCalibrationDialogHelp = gyroHelp
showDialog ( preCalibrationDialogComponent , qsTr ( "Calibrate Gyro" ) , qgcView . showDialogDefaultWidth , StandardButton . Cancel | StandardButton . Ok )
}
onClicked: {
preCalibrationDialogType = "gyro"
preCalibrationDialogHelp = gyroHelp
showDialog ( preCalibrationDialogComponent , qsTr ( "Calibrate Gyro" ) , qgcView . showDialogDefaultWidth , StandardButton . Cancel | StandardButton . Ok )
}
}
IndicatorButton {
id: accelButton
width: parent . buttonWidth
text: qsTr ( "Accelerometer" )
indicatorGreen: cal_acc0_id . value != 0
IndicatorButton {
id: accelButton
width: parent . buttonWidth
text: qsTr ( "Accelerometer" )
indicatorGreen: cal_acc0_id . value != 0
onClicked: {
preCalibrationDialogType = "accel"
preCalibrationDialogHelp = accelHelp
showDialog ( preCalibrationDialogComponent , qsTr ( "Calibrate Accelerometer" ) , qgcView . showDialogDefaultWidth , StandardButton . Cancel | StandardButton . Ok )
}
onClicked: {
preCalibrationDialogType = "accel"
preCalibrationDialogHelp = accelHelp
showDialog ( preCalibrationDialogComponent , qsTr ( "Calibrate Accelerometer" ) , qgcView . showDialogDefaultWidth , StandardButton . Cancel | StandardButton . Ok )
}
}
IndicatorButton {
id: levelButton
width: parent . buttonWidth
text: qsTr ( "Level Horizon" )
indicatorGreen: sens_board_x_off . value != 0
enabled: cal_acc0_id . value != 0 && cal_gyro0_id . value != 0
onClicked: {
preCalibrationDialogType = "level"
preCalibrationDialogHelp = levelHelp
showDialog ( preCalibrationDialogComponent , qsTr ( "Level Horizon" ) , qgcView . showDialogDefaultWidth , StandardButton . Cancel | StandardButton . Ok )
}
IndicatorButton {
id: levelButton
width: parent . buttonWidth
text: qsTr ( "Level Horizon" )
indicatorGreen: sens_board_x_off . value != 0
enabled: cal_acc0_id . value != 0 && cal_gyro0_id . value != 0
onClicked: {
preCalibrationDialogType = "level"
preCalibrationDialogHelp = levelHelp
showDialog ( preCalibrationDialogComponent , qsTr ( "Level Horizon" ) , qgcView . showDialogDefaultWidth , StandardButton . Cancel | StandardButton . Ok )
}
}
IndicatorButton {
id: airspeedButton
width: parent . buttonWidth
text: qsTr ( "Airspeed" )
visible: ( controller . vehicle . fixedWing || controller . vehicle . vtol ) && controller . getParameterFact ( - 1 , "CBRK_AIRSPD_CHK" ) . value != 162128
indicatorGreen: sens_dpres_off . value != 0
onClicked: {
preCalibrationDialogType = "airspeed"
preCalibrationDialogHelp = airspeedHelp
showDialog ( preCalibrationDialogComponent , qsTr ( "Calibrate Airspeed" ) , qgcView . showDialogDefaultWidth , StandardButton . Cancel | StandardButton . Ok )
}
IndicatorButton {
id: airspeedButton
width: parent . buttonWidth
text: qsTr ( "Airspeed" )
visible: ( controller . vehicle . fixedWing || controller . vehicle . vtol ) && controller . getParameterFact ( - 1 , "CBRK_AIRSPD_CHK" ) . value != 162128
indicatorGreen: sens_dpres_off . value != 0
onClicked: {
preCalibrationDialogType = "airspeed"
preCalibrationDialogHelp = airspeedHelp
showDialog ( preCalibrationDialogComponent , qsTr ( "Calibrate Airspeed" ) , qgcView . showDialogDefaultWidth , StandardButton . Cancel | StandardButton . Ok )
}
}
QGCButton {
id: cancelButton
text: qsTr ( "Cancel" )
enabled: false
onClicked: controller . cancelCalibration ( )
}
QGCButton {
id: cancelButton
width: parent . buttonWidth
text: qsTr ( "Cancel" )
enabled: false
onClicked: controller . cancelCalibration ( )
}
Item { height: ScreenTools . defaultFontPixelHeight ; width: 10 } / / s p a c e r
QGCButton {
width: parent . buttonWidth
text: qsTr ( "Set Orientations" )
onClicked: showDialog ( setOrientationsDialogComponent , qsTr ( "Set Orientations" ) , qgcView . showDialogDefaultWidth , StandardButton . Ok )
}
} / / C o l u m n - B u t t o n s
Column {
anchors.leftMargin: ScreenTools . defaultFontPixelWidth / 2
anchors.left: buttonColumn . right
anchors.right: parent . right
anchors.top: parent . top
anchors.bottom: parent . bottom
ProgressBar {
id: progressBar
width: parent . width - rotationColumnWidth
id: progressBar
anchors.left: parent . left
anchors.right: parent . right
}
Item { height: ScreenTools . defaultFontPixelHeight ; width: 10 } / / s p a c e r
Item {
property int calDisplayAreaWidth: parent . width - rotationColumnWidth
property int calDisplayAreaWidth: parent . width
width: parent . width
height: parent . height - y
@ -402,12 +451,19 @@ QGCView {
@@ -402,12 +451,19 @@ QGCView {
Flow {
anchors.topMargin: ScreenTools . defaultFontPixelWidth
anchors.top: orientationCalAreaHelpText . bottom
anchors.left: orientationCalAreaHelpText . left
anchors.bottom: parent . bottom
anchors.left: parent . left
anchors.right: parent . right
width: parent . width
height: parent . height - orientationCalAreaHelpText . implicitHeight
spacing: ScreenTools . defaultFontPixelWidth
spacing: ScreenTools . defaultFontPixelWidth / 2
property real indicatorWidth: ( width / 3 ) - ( spacing * 2 )
property real indicatorHeight: ( height / 2 ) - spacing
VehicleRotationCal {
width: parent . indicatorWidth
height: parent . indicatorHeight
visible: controller . orientationCalDownSideVisible
calValid: controller . orientationCalDownSideDone
calInProgress: controller . orientationCalDownSideInProgress
@ -415,6 +471,8 @@ QGCView {
@@ -415,6 +471,8 @@ QGCView {
imageSource: controller . orientationCalDownSideRotate ? "qrc:///qmlimages/VehicleDownRotate.png" : "qrc:///qmlimages/VehicleDown.png"
}
VehicleRotationCal {
width: parent . indicatorWidth
height: parent . indicatorHeight
visible: controller . orientationCalUpsideDownSideVisible
calValid: controller . orientationCalUpsideDownSideDone
calInProgress: controller . orientationCalUpsideDownSideInProgress
@ -422,6 +480,8 @@ QGCView {
@@ -422,6 +480,8 @@ QGCView {
imageSource: controller . orientationCalUpsideDownSideRotate ? "qrc:///qmlimages/VehicleUpsideDownRotate.png" : "qrc:///qmlimages/VehicleUpsideDown.png"
}
VehicleRotationCal {
width: parent . indicatorWidth
height: parent . indicatorHeight
visible: controller . orientationCalNoseDownSideVisible
calValid: controller . orientationCalNoseDownSideDone
calInProgress: controller . orientationCalNoseDownSideInProgress
@ -429,6 +489,8 @@ QGCView {
@@ -429,6 +489,8 @@ QGCView {
imageSource: controller . orientationCalNoseDownSideRotate ? "qrc:///qmlimages/VehicleNoseDownRotate.png" : "qrc:///qmlimages/VehicleNoseDown.png"
}
VehicleRotationCal {
width: parent . indicatorWidth
height: parent . indicatorHeight
visible: controller . orientationCalTailDownSideVisible
calValid: controller . orientationCalTailDownSideDone
calInProgress: controller . orientationCalTailDownSideInProgress
@ -436,6 +498,8 @@ QGCView {
@@ -436,6 +498,8 @@ QGCView {
imageSource: controller . orientationCalTailDownSideRotate ? "qrc:///qmlimages/VehicleTailDownRotate.png" : "qrc:///qmlimages/VehicleTailDown.png"
}
VehicleRotationCal {
width: parent . indicatorWidth
height: parent . indicatorHeight
visible: controller . orientationCalLeftSideVisible
calValid: controller . orientationCalLeftSideDone
calInProgress: controller . orientationCalLeftSideInProgress
@ -443,6 +507,8 @@ QGCView {
@@ -443,6 +507,8 @@ QGCView {
imageSource: controller . orientationCalLeftSideRotate ? "qrc:///qmlimages/VehicleLeftRotate.png" : "qrc:///qmlimages/VehicleLeft.png"
}
VehicleRotationCal {
width: parent . indicatorWidth
height: parent . indicatorHeight
visible: controller . orientationCalRightSideVisible
calValid: controller . orientationCalRightSideDone
calInProgress: controller . orientationCalRightSideInProgress
@ -451,113 +517,6 @@ QGCView {
@@ -451,113 +517,6 @@ QGCView {
}
}
}
Column {
anchors.leftMargin: ScreenTools . defaultFontPixelWidth
anchors.left: orientationCalArea . right
x: parent . width - rotationColumnWidth
spacing: ScreenTools . defaultFontPixelHeight
QGCLabel {
font.pointSize: ScreenTools . mediumFontPointSize
text: qsTr ( "Set Orientations" )
}
QGCLabel {
width: parent . width
wrapMode: Text . WordWrap
text: boardRotationText
}
Column {
QGCLabel {
text: qsTr ( "Autpilot Orientation:" )
}
FactComboBox {
id: boardRotationCombo
width: rotationColumnWidth ;
model: rotations
fact: sens_board_rot
}
}
Column {
/ / C o m p a s s 0 r o t a t i o n
Component {
id: compass0ComponentLabel2
QGCLabel {
text: qsTr ( "External Compass Orientation:" )
}
}
Component {
id: compass0ComponentCombo2
FactComboBox {
id: compass0RotationCombo
width: rotationColumnWidth
model: rotations
fact: cal_mag0_rot
}
}
Loader { sourceComponent: showCompass0Rot ? compass0ComponentLabel2 : null }
Loader { sourceComponent: showCompass0Rot ? compass0ComponentCombo2 : null }
}
Column {
/ / C o m p a s s 1 r o t a t i o n
Component {
id: compass1ComponentLabel2
QGCLabel {
text: qsTr ( "External Compass 1 Orientation:" )
}
}
Component {
id: compass1ComponentCombo2
FactComboBox {
id: compass1RotationCombo
width: rotationColumnWidth
model: rotations
fact: cal_mag1_rot
}
}
Loader { sourceComponent: showCompass1Rot ? compass1ComponentLabel2 : null }
Loader { sourceComponent: showCompass1Rot ? compass1ComponentCombo2 : null }
}
Column {
spacing: ScreenTools . defaultFontPixelWidth
/ / C o m p a s s 2 r o t a t i o n
Component {
id: compass2ComponentLabel2
QGCLabel {
text: qsTr ( "Compass 2 Orientation" )
}
}
Component {
id: compass2ComponentCombo2
FactComboBox {
id: compass1RotationCombo
width: rotationColumnWidth
model: rotations
fact: cal_mag2_rot
}
}
Loader { sourceComponent: showCompass2Rot ? compass2ComponentLabel2 : null }
Loader { sourceComponent: showCompass2Rot ? compass2ComponentCombo2 : null }
}
}
}
}
} / / Q G C V i e w P a n e l