@ -43,8 +43,7 @@ SetupPage {
/ / a b e t t e r w a y t o h i g h t l i g h t t h e m , o r u s e l e s s h i g h l i g h t s .
/ / a b e t t e r w a y t o h i g h t l i g h t t h e m , o r u s e l e s s h i g h l i g h t s .
/ / U s e r v i s i b l e s t r i n g s
/ / U s e r v i s i b l e s t r i n g s
readonly property string title: qsTr ( "Firmware Setup" ) / / P o p u p d i a l o g t i t l e
readonly property string title: qsTr ( "Firmware Setup" ) / / P o p u p d i a l o g t i t l e
readonly property string highlightPrefix: "<font color=\"" + qgcPal . warningText + "\">"
readonly property string highlightPrefix: "<font color=\"" + qgcPal . warningText + "\">"
readonly property string highlightSuffix: "</font>"
readonly property string highlightSuffix: "</font>"
readonly property string welcomeText: qsTr ( "%1 can upgrade the firmware on Pixhawk devices, SiK Radios and PX4 Flow Smart Cameras." ) . arg ( QGroundControl . appName )
readonly property string welcomeText: qsTr ( "%1 can upgrade the firmware on Pixhawk devices, SiK Radios and PX4 Flow Smart Cameras." ) . arg ( QGroundControl . appName )
@ -63,10 +62,11 @@ SetupPage {
property bool _defaultFirmwareIsPX4 : true
property bool _defaultFirmwareIsPX4 : true
property string firmwareWarningMessage
property string firmwareWarningMessage
property bool initialBoardSearch: true
property bool firmwareWarningMessageVisible: false
property bool initialBoardSearch: true
property string firmwareName
property string firmwareName
property bool _singleFirmwareMode : QGroundControl . corePlugin . options . firmwareUpgradeSingleURL . length != 0 / / / < t r u e : r u n n i n g i n s p e c i a l s i n g l e f i r m w a r e d o w n l o a d m o d e
property bool _singleFirmwareMode : QGroundControl . corePlugin . options . firmwareUpgradeSingleURL . length != 0 / / / < t r u e : r u n n i n g i n s p e c i a l s i n g l e f i r m w a r e d o w n l o a d m o d e
function cancelFlash ( ) {
function cancelFlash ( ) {
statusTextArea . append ( highlightPrefix + qsTr ( "Upgrade cancelled" ) + highlightSuffix )
statusTextArea . append ( highlightPrefix + qsTr ( "Upgrade cancelled" ) + highlightSuffix )
@ -78,18 +78,6 @@ SetupPage {
controller . startBoardSearch ( )
controller . startBoardSearch ( )
_defaultFirmwareIsPX4 = _defaultFirmwareFact . rawValue === _defaultFimwareTypePX4 / / w e d o n ' t w a n t t h i s t o b e b o u n d a n d c h a n g e a s r a d i o s a r e s e l e c t e d
_defaultFirmwareIsPX4 = _defaultFirmwareFact . rawValue === _defaultFimwareTypePX4 / / w e d o n ' t w a n t t h i s t o b e b o u n d a n d c h a n g e a s r a d i o s a r e s e l e c t e d
}
}
function firmwareVersionChanged ( model ) {
firmwareVersionWarningLabel . visible = false
/ / A l l o f t h i s b i z a r r e , s e t t i n g m o d e l t o n u l l a n d i n d e x t o 1 a n d t h e n t o 0 i s t o w o r k a r o u n d
/ / s t r a n g e n e s s i n t h e c o m b o b o x i m p l e m e n t a t i o n . T h i s s e q u e n c e o f s t e p s c o r r e c t l y c h a n g e s t h e c o m b o m o d e l
/ / w i t h o u t g e n e r a t i n g a n y w a r n i n g s a n d c o r r e c t l y u p d a t e s t h e c o m b o t e x t w i t h t h e n e w s e l e c t i o n .
firmwareBuildTypeCombo . model = null
firmwareBuildTypeCombo . model = model
firmwareBuildTypeCombo . currentIndex = 1
firmwareBuildTypeCombo . currentIndex = 0
}
QGCPalette { id: qgcPal ; colorGroupEnabled: true }
FirmwareUpgradeController {
FirmwareUpgradeController {
id: controller
id: controller
@ -149,6 +137,17 @@ SetupPage {
property bool showFirmwareTypeSelection: _advanced . checked
property bool showFirmwareTypeSelection: _advanced . checked
property bool px4Flow: controller . px4FlowBoard
property bool px4Flow: controller . px4FlowBoard
function firmwareVersionChanged ( model ) {
firmwareWarningMessageVisible = false
/ / A l l o f t h i s b i z a r r e , s e t t i n g m o d e l t o n u l l a n d i n d e x t o 1 a n d t h e n t o 0 i s t o w o r k a r o u n d
/ / s t r a n g e n e s s i n t h e c o m b o b o x i m p l e m e n t a t i o n . T h i s s e q u e n c e o f s t e p s c o r r e c t l y c h a n g e s t h e c o m b o m o d e l
/ / w i t h o u t g e n e r a t i n g a n y w a r n i n g s a n d c o r r e c t l y u p d a t e s t h e c o m b o t e x t w i t h t h e n e w s e l e c t i o n .
firmwareBuildTypeCombo . model = null
firmwareBuildTypeCombo . model = model
firmwareBuildTypeCombo . currentIndex = 1
firmwareBuildTypeCombo . currentIndex = 0
}
function updatePX4VersionDisplay ( ) {
function updatePX4VersionDisplay ( ) {
var versionString = ""
var versionString = ""
if ( _advanced . checked ) {
if ( _advanced . checked ) {
@ -284,17 +283,10 @@ SetupPage {
anchors.fill: parent
anchors.fill: parent
spacing: defaultTextHeight
spacing: defaultTextHeight
Component.onCompleted: {
if ( ! QGroundControl . hasAPMSupport ) {
_defaultFirmwareFact . rawValue = _defaultFimwareTypePX4
firmwareVersionChanged ( firmwareTypeList )
}
}
QGCLabel {
QGCLabel {
width: parent . width
width: parent . width
wrapMode: Text . WordWrap
wrapMode: Text . WordWrap
text: ( _singleFirmwareMode || ! QGroundControl . hasAPMSupport ) ? _singleFirmwareLabel : ( px4Flow ? _px4FlowLabel : _pixhawkLabel )
text: _singleFirmwareMode ? _singleFirmwareLabel : ( px4Flow ? _px4FlowLabel : _pixhawkLabel )
readonly property string _px4FlowLabel : qsTr ( "Detected PX4 Flow board. The firmware you use on the PX4 Flow must match the AutoPilot firmware type you are using on the vehicle:" )
readonly property string _px4FlowLabel : qsTr ( "Detected PX4 Flow board. The firmware you use on the PX4 Flow must match the AutoPilot firmware type you are using on the vehicle:" )
readonly property string _pixhawkLabel : qsTr ( "Detected Pixhawk board. You can select from the following flight stacks:" )
readonly property string _pixhawkLabel : qsTr ( "Detected Pixhawk board. You can select from the following flight stacks:" )
@ -303,17 +295,10 @@ SetupPage {
QGCLabel { text: qsTr ( "Flight Stack" ) }
QGCLabel { text: qsTr ( "Flight Stack" ) }
RowLayout {
Column {
spacing: _margins
layoutDirection: px4FlightStackRadio . checked ? Qt.LeftToRight : Qt . RightToLeft
/ / T h e f o l l o w i n g c r a z i n e s s o f t h r e e r a d i o b u t t o n s t o r e p r e s e n t t w o r a d i o b u t t o n s i s s o t h a t t h e
/ / o r d e r c a n b e c h a n g e d s u c h t h a t t h e d e f a u l t f i r m w a r e b u t t o n i s a l w a y s o n t h e t o p
/ / - - V i s i b l e o n l y i f y o u h a v e a n o p t i o n . I f i t ' s t h e o n l y o p t i o n , i t ' s a l r e a d y s e t u p .
QGCRadioButton {
QGCRadioButton {
id: px4FlightStackRadio
id: px4FlightStackRadio
exclusiveGroup: firmwareGroup
text: qsTr ( "PX4 Pro " )
text: qsTr ( "PX4 Pro " )
textBold: _defaultFirmwareIsPX4
textBold: _defaultFirmwareIsPX4
checked: _defaultFirmwareIsPX4
checked: _defaultFirmwareIsPX4
@ -327,11 +312,10 @@ SetupPage {
QGCRadioButton {
QGCRadioButton {
id: apmFlightStack
id: apmFlightStack
exclusiveGroup: firmwareGroup
text: qsTr ( "ArduPilot" )
text: qsTr ( "ArduPilot" )
textBold: ! _defaultFirmwareIsPX4
textBold: ! _defaultFirmwareIsPX4
checked: ! _defaultFirmwareIsPX4
checked: ! _defaultFirmwareIsPX4
visible: ! _singleFirmwareMode && ! px4Flow && QGroundControl . hasAPMSupport
visible: ! _singleFirmwareMode && ! px4Flow
onClicked: {
onClicked: {
_defaultFirmwareFact . rawValue = _defaultFimwareTypeAPM
_defaultFirmwareFact . rawValue = _defaultFimwareTypeAPM
@ -411,7 +395,7 @@ SetupPage {
onClicked: {
onClicked: {
firmwareBuildTypeCombo . currentIndex = 0
firmwareBuildTypeCombo . currentIndex = 0
firmwareVersionWarningLabel . v isible = false
firmwareWarningMessageV isible = false
updatePX4VersionDisplay ( )
updatePX4VersionDisplay ( )
}
}
}
}
@ -442,13 +426,13 @@ SetupPage {
onActivated: {
onActivated: {
controller . selectedFirmwareBuildType = model . get ( index ) . firmwareType
controller . selectedFirmwareBuildType = model . get ( index ) . firmwareType
if ( model . get ( index ) . firmwareType === FirmwareUpgradeController . BetaFirmware ) {
if ( model . get ( index ) . firmwareType === FirmwareUpgradeController . BetaFirmware ) {
firmwareVersionWarningLabel . v isible = true
firmwareWarningMessageV isible = true
firmwareVersionWarningLabel . text = qsTr ( "WARNING: BETA FIRMWARE. " ) +
firmwareVersionWarningLabel . text = qsTr ( "WARNING: BETA FIRMWARE. " ) +
qsTr ( "This firmware version is ONLY intended for beta testers. " ) +
qsTr ( "This firmware version is ONLY intended for beta testers. " ) +
qsTr ( "Although it has received FLIGHT TESTING, it represents actively changed code. " ) +
qsTr ( "Although it has received FLIGHT TESTING, it represents actively changed code. " ) +
qsTr ( "Do NOT use for normal operation." )
qsTr ( "Do NOT use for normal operation." )
} else if ( model . get ( index ) . firmwareType === FirmwareUpgradeController . DeveloperFirmware ) {
} else if ( model . get ( index ) . firmwareType === FirmwareUpgradeController . DeveloperFirmware ) {
firmwareVersionWarningLabel . v isible = true
firmwareWarningMessageV isible = true
firmwareVersionWarningLabel . text = qsTr ( "WARNING: CONTINUOUS BUILD FIRMWARE. " ) +
firmwareVersionWarningLabel . text = qsTr ( "WARNING: CONTINUOUS BUILD FIRMWARE. " ) +
qsTr ( "This firmware has NOT BEEN FLIGHT TESTED. " ) +
qsTr ( "This firmware has NOT BEEN FLIGHT TESTED. " ) +
qsTr ( "It is only intended for DEVELOPERS. " ) +
qsTr ( "It is only intended for DEVELOPERS. " ) +
@ -456,7 +440,7 @@ SetupPage {
qsTr ( "Do NOT fly this without additional safety precautions. " ) +
qsTr ( "Do NOT fly this without additional safety precautions. " ) +
qsTr ( "Follow the mailing list actively when using it." )
qsTr ( "Follow the mailing list actively when using it." )
} else {
} else {
firmwareVersionWarningLabel . v isible = false
firmwareWarningMessageV isible = false
}
}
updatePX4VersionDisplay ( )
updatePX4VersionDisplay ( )
}
}
@ -466,7 +450,7 @@ SetupPage {
id: firmwareVersionWarningLabel
id: firmwareVersionWarningLabel
width: parent . width
width: parent . width
wrapMode: Text . WordWrap
wrapMode: Text . WordWrap
visible: fals e
visible: firmwareWarningMessageVisibl e
}
}
} / / C o l u m n
} / / C o l u m n
} / / Q G C V i e w D i a l o g
} / / Q G C V i e w D i a l o g