Added board firmware update functionality
This commit is contained in:
@@ -131,17 +131,8 @@ ApplicationWindow {
|
||||
RowLayout {
|
||||
id: topBar
|
||||
|
||||
property var labels: [
|
||||
qsTr("AKB monitor"),
|
||||
qsTr("Cell monitor"),
|
||||
qsTr("BMS settings"),
|
||||
qsTr("Visualization"),
|
||||
qsTr("Information output"),
|
||||
qsTr("Terminal"),
|
||||
]
|
||||
|
||||
Label {
|
||||
text: topBar.labels[stack.currentIndex]
|
||||
text: stack.itemAt(stack.currentIndex).title
|
||||
font.pixelSize: 38
|
||||
font.weight: Font.Bold
|
||||
color: Palette.textColor
|
||||
@@ -316,12 +307,15 @@ ApplicationWindow {
|
||||
Layout.bottomMargin: 30
|
||||
|
||||
Screens.AkbMonitorScreen {
|
||||
property string title: qsTr("AKB monitor")
|
||||
}
|
||||
|
||||
Screens.CellMonitorScreen {
|
||||
property string title: qsTr("Cell monitor")
|
||||
}
|
||||
|
||||
Screens.BmsSettingsScreen {
|
||||
property string title: qsTr("BMS settings")
|
||||
onNeedWait: {
|
||||
if (active) {
|
||||
busyPopup.text = text
|
||||
@@ -333,10 +327,12 @@ ApplicationWindow {
|
||||
}
|
||||
|
||||
Screens.VisualizationScreen {
|
||||
property string title: qsTr("Visualization")
|
||||
}
|
||||
|
||||
Screens.DebugInformationScreen {
|
||||
id: debugScreen
|
||||
property string title: qsTr("Information output")
|
||||
}
|
||||
|
||||
Screens.BmsServiceScreen {
|
||||
@@ -357,8 +353,6 @@ ApplicationWindow {
|
||||
serialLabel.text = "-"
|
||||
firmwareLabel.text = "-"
|
||||
}
|
||||
|
||||
debugScreen.printMessage(BmsInterface.getConnectedPortName(), true)
|
||||
}
|
||||
|
||||
onMessageDialog: {
|
||||
@@ -389,6 +383,22 @@ ApplicationWindow {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onFwUploadStatus: {
|
||||
if (isOngoing) {
|
||||
if (!progressPopup.opened) {
|
||||
progressPopup.open()
|
||||
}
|
||||
|
||||
progressPopup.text = status
|
||||
progressPopup.progress = progress
|
||||
} else {
|
||||
progressPopup.close()
|
||||
BmsInterface.emitMessageDialog(qsTr("Firmware update"), status, true)
|
||||
}
|
||||
}
|
||||
|
||||
onBmsConfigurationStored: busyPopup.close()
|
||||
}
|
||||
|
||||
Connections {
|
||||
@@ -440,7 +450,6 @@ ApplicationWindow {
|
||||
|
||||
onOpened: {
|
||||
hideStatusTimer.start()
|
||||
busyPopup.close()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -477,6 +486,8 @@ ApplicationWindow {
|
||||
font.pixelSize: 20
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
leftPadding: 10
|
||||
rightPadding: 10
|
||||
|
||||
background: Rectangle {
|
||||
color: Palette.textColor
|
||||
@@ -490,6 +501,48 @@ ApplicationWindow {
|
||||
onClosed: hideBusyTimer.stop()
|
||||
}
|
||||
|
||||
Popup {
|
||||
id: progressPopup
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
modal: true
|
||||
closePolicy: Popup.NoAutoClose
|
||||
|
||||
property alias text: progressText.text
|
||||
property alias progress: progressBar.value
|
||||
|
||||
background: Rectangle {
|
||||
color: "transparent"
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Controls.ProgressBar {
|
||||
id: progressBar
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
Layout.preferredWidth: 500
|
||||
}
|
||||
|
||||
Controls.SubtitleLabel {
|
||||
text: "asdfzasdf"
|
||||
id: progressText
|
||||
color: Palette.alternativeTextColor
|
||||
maximumLineCount: 3
|
||||
wrapMode: Text.Wrap
|
||||
font.pixelSize: 20
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
leftPadding: 10
|
||||
rightPadding: 10
|
||||
|
||||
background: Rectangle {
|
||||
color: Palette.textColor
|
||||
opacity: 0.3
|
||||
radius: 6
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: hideBusyTimer
|
||||
interval: 30000
|
||||
|
||||
Reference in New Issue
Block a user