@ -30,10 +30,9 @@ SetupPage {
@@ -30,10 +30,9 @@ SetupPage {
Component {
id: sensorsPageComponent
RowLayout {
width: availableWidth
height: availableHeight
spacing: ScreenTools . defaultFontPixelWidth / 2
Item {
width: availableWidth
height: availableHeight
/ / 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 .
@ -74,10 +73,13 @@ SetupPage {
@@ -74,10 +73,13 @@ SetupPage {
readonly property int _calTypeCompass : 1 / / / < C a l i b r a t e c o m p a s s
readonly property int _calTypeAccel : 2 / / / < C a l i b r a t e a c c e l
readonly property int _calTypeSet : 3 / / / < S e t o r i e n t a t i o n s o n l y
readonly property int _buttonWidth : ScreenTools . defaultFontPixelWidth * 15
property bool _orientationsDialogShowCompass : true
property string _orientationDialogHelp : orientationHelpSet
property int _orientationDialogCalType
property var _activeVehicle : QGroundControl . multiVehicleManager . activeVehicle
property real _margins : ScreenTools . defaultFontPixelHeight / 2
function showOrientationsDialog ( calType ) {
var dialogTitle
@ -117,14 +119,8 @@ SetupPage {
@@ -117,14 +119,8 @@ SetupPage {
factPanel: sensorsPage . viewPanel
statusLog: statusTextArea
progressBar: progressBar
compassButton: compassButton
accelButton: accelButton
compassMotButton: motorInterferenceButton
levelButton: levelHorizonButton
calibratePressureButton: calibratePressureButton
nextButton: nextButton
cancelButton: cancelButton
setOrientationsButton: setOrientationsButton
orientationCalAreaHelpText: orientationCalAreaHelpText
property var rgCompassCalFitness: [ controller . compass1CalFitness , controller . compass2CalFitness , controller . compass3CalFitness ]
@ -152,6 +148,10 @@ SetupPage {
@@ -152,6 +148,10 @@ SetupPage {
break
}
}
onSetAllCalButtonsEnabled: {
buttonColumn . enabled = enabled
}
}
Component.onCompleted: {
@ -462,112 +462,122 @@ SetupPage {
@@ -462,112 +462,122 @@ SetupPage {
anchors.left: parent . left
anchors.right: parent . right
wrapMode: Text . WordWrap
text: qsTr ( "Pressure calibration will set the depth to zero at the current pressure reading." )
text: _helpText
readonly property string _altText : _activeVehicle . sub ? qsTr ( "depth" ) : qsTr ( "altitude" )
readonly property string _helpText : qsTr ( "Pressure calibration will set the %1 to zero at the current pressure reading. %2" ) . arg ( _altText ) . arg ( _helpTextFW )
readonly property string _helpTextFW : _activeVehicle . fixedWing ? qsTr ( "Cover airspeed sensor for calibration." ) : ""
}
} / / Q G C V i e w D i a l o g
} / / C o m p o n e n t - c a l i b r a t e P r e s s u r e D i a l o g C o m p o n e n t
/ / / L e f t b u t t o n c o l u m n
Column {
spacing: ScreenTools . defaultFontPixelHeight / 2
Layout.alignment: Qt . AlignLeft | Qt . AlignTop
QGCFlickable {
id: buttonFlickable
anchors.left: parent . left
anchors.top: parent . top
anchors.bottom: parent . bottom
width: _buttonWidth
contentHeight: nextCancelColumn . y + nextCancelColumn . height + _margins
readonly property int buttonWidth: ScreenTools . defaultFontPixelWidth * 15
/ / C a l i b r a t i o n b u t t o n c o l u m n - C a l i b r a t i n b u t t o n s a r e k e p t i n a s e p a r a t e c o l u m n f r o m N e x t / C a n c e l b u t t o n s
/ / s o w e c a n e n a b l e / d i s a b l e t h e m a l l a s a g r o u p
Column {
id: buttonColumn
spacing: _margins
Layout.alignment: Qt . AlignLeft | Qt . AlignTop
IndicatorButton {
id: accelButton
width: parent . buttonWidth
text: qsTr ( "Accelerometer" )
indicatorGreen: ! accelCalNeeded
IndicatorButton {
width: _buttonWidth
text: qsTr ( "Accelerometer" )
indicatorGreen: ! accelCalNeeded
onClicked: showOrientationsDialog ( _calTypeAccel )
}
onClicked: showOrientationsDialog ( _calTypeAccel )
}
IndicatorButton {
width: _buttonWidth
text: qsTr ( "Compass" )
indicatorGreen: ! compassCalNeeded
IndicatorButton {
id: compassButton
width: parent . buttonWidth
text: qsTr ( "Compass" )
indicatorGreen: ! compassCalNeeded
onClicked: {
if ( controller . accelSetupNeeded ) {
showMessage ( qsTr ( "Calibrate Compass" ) , qsTr ( "Accelerometer must be calibrated prior to Compass." ) , StandardButton . Ok )
} else {
showOrientationsDialog ( _calTypeCompass )
onClicked: {
if ( controller . accelSetupNeeded ) {
showMessage ( qsTr ( "Calibrate Compass" ) , qsTr ( "Accelerometer must be calibrated prior to Compass." ) , StandardButton . Ok )
} else {
showOrientationsDialog ( _calTypeCompass )
}
}
}
}
QGCButton {
id: levelHorizonButton
width: parent . buttonWidth
text: _levelHorizonText
QGCButton {
width: _buttonWidth
text: _levelHorizonText
readonly property string _levelHorizonText : qsTr ( "Level Horizon" )
readonly property string _levelHorizonText : qsTr ( "Level Horizon" )
onClicked: {
if ( controller . accelSetupNeeded ) {
showMessage ( _levelHorizonText , qsTr ( "Accelerometer must be calibrated prior to Level Horizon." ) , StandardButton . Ok )
} else {
showDialog ( levelHorizonDialogComponent , _levelHorizonText , qgcView . showDialogDefaultWidth , StandardButton . Cancel | StandardButton . Ok )
onClicked: {
if ( controller . accelSetupNeeded ) {
showMessage ( _levelHorizonText , qsTr ( "Accelerometer must be calibrated prior to Level Horizon." ) , StandardButton . Ok )
} else {
showDialog ( levelHorizonDialogComponent , _levelHorizonText , qgcView . showDialogDefaultWidth , StandardButton . Cancel | StandardButton . Ok )
}
}
}
}
QGCButton {
id: calibratePressureButton
width: parent . buttonWidth
text: _calibratePressureText
visible: _activeVehicle ? _activeVehicle . supportsCalibratePressure : false
QGCButton {
width: _buttonWidth
text: _calibratePressureText
onClicked: showDialog ( calibratePressureDialogComponent , _calibratePressureText , qgcView . showDialogDefaultWidth , StandardButton . Cancel | StandardButton . Ok )
readonly property string _calibratePressureText : qsTr ( "Calibrate Pressure" )
property var _activeVehicle : QGroundControl . multiVehicleManager . activeVehicle
onClicked: {
showDialog ( calibratePressureDialogComponent , _calibratePressureText , qgcView . showDialogDefaultWidth , StandardButton . Cancel | StandardButton . Ok )
readonly property string _calibratePressureText : _activeVehicle . fixedWing ? qsTr ( "Cal Baro/Airspeed" ) : qsTr ( "Calibrate Pressure" )
}
}
QGCButton {
id: motorInterferenceButton
width: parent . buttonWidth
text: qsTr ( "CompassMot" )
visible: _activeVehicle ? _activeVehicle . supportsMotorInterference : false
property var _activeVehicle : QGroundControl . multiVehicleManager . activeVehicle
QGCButton {
width: _buttonWidth
text: qsTr ( "CompassMot" )
visible: _activeVehicle ? _activeVehicle . supportsMotorInterference : false
onClicked: showDialog ( compassMotDialogComponent , qsTr ( "CompassMot - Compass Motor Interference Calibration" ) , qgcView . showDialogFullWidth , StandardButton . Cancel | StandardButton . Ok )
}
onClicked: showDialog ( compassMotDialogComponent , qsTr ( "CompassMot - Compass Motor Interference Calibration" ) , qgcView . showDialogFullWidth , StandardButton . Cancel | StandardButton . Ok )
}
QGCButton {
id: nextButton
width: parent . buttonWidth
text: qsTr ( "Next" )
enabled: false
onClicked: controller . nextClicked ( )
}
QGCButton {
width: _buttonWidth
text: qsTr ( "Sensor Settings" )
onClicked: showOrientationsDialog ( _calTypeSet )
}
} / / C o l u m n - C a l B u t t o n s
QGCButton {
id: cancelButton
width: parent . buttonWidth
text: qsTr ( "Cancel" )
enabled: false
onClicked: controller . cancelCalibration ( )
}
Column {
id: nextCancelColumn
anchors.topMargin: buttonColumn . spacing
anchors.top: buttonColumn . bottom
anchors.left: buttonColumn . left
spacing: buttonColumn . spacing
QGCButton {
id: nextButton
width: _buttonWidth
text: qsTr ( "Next" )
enabled: false
onClicked: controller . nextClicked ( )
}
QGCButton {
id: setOrientationsButton
width: parent . buttonWidth
text: qsTr ( "Sensor Settings" )
onClicked: showOrientationsDialog ( _calTypeSet )
QGCButton {
id: cancelButton
width: _buttonWidth
text: qsTr ( "Cancel" )
enabled: false
onClicked: controller . cancelCalibration ( )
}
}
} / / C o l u m n - B u t t o n s
} / / Q G C F l i c k a b l e - b u t t o n s
/ / / R i g h t c o l u m n - c a l a r e a
Column {
anchors.leftMargin: _margins
anchors.top: parent . top
anchors.bottom: parent . bottom
Layout.fillWidth: true
anchors.left: buttonFlickable . right
anchors.right: parent . right
ProgressBar {
id: progressBar