Commit f2cc7a93 authored by Don Gagne's avatar Don Gagne

Allow custom firmware flash on PX4Flow

parent d14444a5
...@@ -96,7 +96,7 @@ QGCView { ...@@ -96,7 +96,7 @@ QGCView {
} else { } else {
// We end up here when we detect a board plugged in after we've started upgrade // We end up here when we detect a board plugged in after we've started upgrade
statusTextArea.append(highlightPrefix + "Found device" + highlightSuffix + ": " + controller.boardType) statusTextArea.append(highlightPrefix + "Found device" + highlightSuffix + ": " + controller.boardType)
if (controller.boardType == "Pixhawk" || controller.boardType == "AeroCore") { if (controller.boardType == "Pixhawk" || controller.boardType == "AeroCore" || controller.boardType == "PX4 Flow") {
showDialog(pixhawkFirmwareSelectDialog, title, 50, StandardButton.Ok | StandardButton.Cancel) showDialog(pixhawkFirmwareSelectDialog, title, 50, StandardButton.Ok | StandardButton.Cancel)
} }
} }
...@@ -140,6 +140,7 @@ QGCView { ...@@ -140,6 +140,7 @@ QGCView {
anchors.fill: parent anchors.fill: parent
property bool showVersionSelection: apmFlightStack.checked || advancedMode.checked property bool showVersionSelection: apmFlightStack.checked || advancedMode.checked
property bool px4Flow: controller.boardType == "PX4 Flow"
function accept() { function accept() {
hideDialog() hideDialog()
...@@ -159,20 +160,20 @@ QGCView { ...@@ -159,20 +160,20 @@ QGCView {
id: px4FirmwareTypeList id: px4FirmwareTypeList
ListElement { ListElement {
text: qsTr("Standard Version (stable)"); text: "Standard Version (stable)";
firmwareType: FirmwareUpgradeController.PX4StableFirmware firmwareType: FirmwareUpgradeController.PX4StableFirmware
} }
ListElement { ListElement {
text: qsTr("Beta Testing (beta)"); text: "Beta Testing (beta)";
firmwareType: FirmwareUpgradeController.PX4BetaFirmware firmwareType: FirmwareUpgradeController.PX4BetaFirmware
} }
ListElement { ListElement {
text: qsTr("Developer Build (master)"); text: "Developer Build (master)";
firmwareType: FirmwareUpgradeController.PX4DeveloperFirmware firmwareType: FirmwareUpgradeController.PX4DeveloperFirmware
} }
ListElement { ListElement {
text: qsTr("Custom firmware file..."); text: "Custom firmware file...";
firmwareType: FirmwareUpgradeController.PX4CustomFirmware firmwareType: FirmwareUpgradeController.PX4CustomFirmware
} }
} }
...@@ -217,6 +218,19 @@ QGCView { ...@@ -217,6 +218,19 @@ QGCView {
} }
} }
ListModel {
id: px4FlowTypeList
ListElement {
text: "Standard Version (stable)";
firmwareType: FirmwareUpgradeController.PX4StableFirmware
}
ListElement {
text: "Custom firmware file...";
firmwareType: FirmwareUpgradeController.PX4CustomFirmware
}
}
Column { Column {
anchors.fill: parent anchors.fill: parent
spacing: defaultTextHeight spacing: defaultTextHeight
...@@ -224,7 +238,7 @@ QGCView { ...@@ -224,7 +238,7 @@ QGCView {
QGCLabel { QGCLabel {
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: "Detected Pixhawk board. You can select from the following flight stacks:" text: px4Flow ? "Detected PX4 Flow board. You can select from the following firmware:" : "Detected Pixhawk board. You can select from the following flight stacks:"
} }
function firmwareVersionChanged(model) { function firmwareVersionChanged(model) {
...@@ -243,6 +257,7 @@ QGCView { ...@@ -243,6 +257,7 @@ QGCView {
checked: true checked: true
exclusiveGroup: firmwareGroup exclusiveGroup: firmwareGroup
text: "PX4 Flight Stack (full QGC support)" text: "PX4 Flight Stack (full QGC support)"
visible: !px4Flow
onClicked: parent.firmwareVersionChanged(px4FirmwareTypeList) onClicked: parent.firmwareVersionChanged(px4FirmwareTypeList)
} }
...@@ -251,6 +266,7 @@ QGCView { ...@@ -251,6 +266,7 @@ QGCView {
id: apmFlightStack id: apmFlightStack
exclusiveGroup: firmwareGroup exclusiveGroup: firmwareGroup
text: "APM Flight Stack (partial QGC support)" text: "APM Flight Stack (partial QGC support)"
visible: !px4Flow
onClicked: parent.firmwareVersionChanged(apmFirmwareTypeList) onClicked: parent.firmwareVersionChanged(apmFirmwareTypeList)
} }
...@@ -259,14 +275,14 @@ QGCView { ...@@ -259,14 +275,14 @@ QGCView {
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
visible: showVersionSelection visible: showVersionSelection
text: "Select which version of the above flight stack you would like to install:" text: px4Flow ? "Select which version of the firmware you would like to install:" : "Select which version of the above flight stack you would like to install:"
} }
QGCComboBox { QGCComboBox {
id: firmwareVersionCombo id: firmwareVersionCombo
width: 200 width: 200
visible: showVersionSelection visible: showVersionSelection
model: px4FirmwareTypeList model: px4Flow ? px4FlowTypeList : px4FirmwareTypeList
onActivated: { onActivated: {
if (model.get(index).firmwareType == FirmwareUpgradeController.PX4BetaFirmware) { if (model.get(index).firmwareType == FirmwareUpgradeController.PX4BetaFirmware) {
...@@ -301,6 +317,8 @@ QGCView { ...@@ -301,6 +317,8 @@ QGCView {
id: advancedMode id: advancedMode
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
text: "Advanced mode" text: "Advanced mode"
checked: px4Flow ? true : false
visible: !px4Flow
onClicked: { onClicked: {
firmwareVersionCombo.currentIndex = 0 firmwareVersionCombo.currentIndex = 0
...@@ -314,6 +332,7 @@ QGCView { ...@@ -314,6 +332,7 @@ QGCView {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
text: "Help me pick a flight stack" text: "Help me pick a flight stack"
onClicked: Qt.openUrlExternally("http://pixhawk.org/choice") onClicked: Qt.openUrlExternally("http://pixhawk.org/choice")
visible: !px4Flow
} }
} // QGCViewDialog } // QGCViewDialog
} // Component - pixhawkFirmwareSelectDialog } // Component - pixhawkFirmwareSelectDialog
......
...@@ -94,15 +94,18 @@ void FirmwareUpgradeController::_foundBoard(bool firstAttempt, const QSerialPort ...@@ -94,15 +94,18 @@ void FirmwareUpgradeController::_foundBoard(bool firstAttempt, const QSerialPort
_foundBoardType = "Pixhawk"; _foundBoardType = "Pixhawk";
_startFlashWhenBootloaderFound = false; _startFlashWhenBootloaderFound = false;
break; break;
case FoundBoardAeroCore: case FoundBoardAeroCore:
_foundBoardType = "AeroCore"; _foundBoardType = "AeroCore";
_startFlashWhenBootloaderFound = false; _startFlashWhenBootloaderFound = false;
break; break;
case FoundBoardPX4Flow: case FoundBoardPX4Flow:
_foundBoardType = "PX4 Flow";
_startFlashWhenBootloaderFound = false;
break;
case FoundBoard3drRadio: case FoundBoard3drRadio:
_foundBoardType = type == FoundBoardPX4Flow ? "PX4 Flow" : "3DR Radio"; _foundBoardType = "3DR Radio";
if (!firstAttempt) { if (!firstAttempt) {
// PX4 Flow and Radio always flash stable firmware, so we can start right away without // Radio always flashes stable firmware, so we can start right away without
// any further user input. // any further user input.
_startFlashWhenBootloaderFound = true; _startFlashWhenBootloaderFound = true;
_startFlashWhenBootloaderFoundFirmwareType = PX4StableFirmware; _startFlashWhenBootloaderFoundFirmwareType = PX4StableFirmware;
......
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