Implemented QML skeleton for the application
This commit is contained in:
105
qml/Screens/AkbMonitorScreen.qml
Normal file
105
qml/Screens/AkbMonitorScreen.qml
Normal file
@@ -0,0 +1,105 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Layouts 1.12
|
||||
|
||||
import Controls 1.0 as Controls
|
||||
|
||||
Item {
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
|
||||
Controls.Frame {
|
||||
Layout.fillWidth: true
|
||||
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
|
||||
Controls.TitleLabel {
|
||||
text: qsTr("Serial number")
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Controls.TextField {
|
||||
text: "AABBCCDD"
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Controls.Frame {
|
||||
Layout.fillWidth: true
|
||||
|
||||
GridLayout {
|
||||
columns: 2
|
||||
anchors.fill: parent
|
||||
|
||||
RowLayout {
|
||||
Controls.ContentLabel {
|
||||
text: qsTr("Battery charge level, V")
|
||||
}
|
||||
|
||||
Controls.DotSeparator {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Controls.SubtitleLabel {
|
||||
text: "-"
|
||||
}
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Controls.ContentLabel {
|
||||
text: qsTr("Number of modules")
|
||||
}
|
||||
|
||||
Controls.DotSeparator {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Controls.SubtitleLabel {
|
||||
text: "-"
|
||||
}
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Controls.ContentLabel {
|
||||
text: qsTr("Battery voltage, V")
|
||||
}
|
||||
|
||||
Controls.DotSeparator {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Controls.SubtitleLabel {
|
||||
text: "-"
|
||||
}
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Controls.ContentLabel {
|
||||
text: qsTr("Number of cells")
|
||||
}
|
||||
|
||||
Controls.DotSeparator {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Controls.SubtitleLabel {
|
||||
text: "-"
|
||||
}
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
}
|
||||
}
|
||||
5
qml/Screens/CellMonitorScreen.qml
Normal file
5
qml/Screens/CellMonitorScreen.qml
Normal file
@@ -0,0 +1,5 @@
|
||||
import QtQuick 2.0
|
||||
|
||||
Item {
|
||||
|
||||
}
|
||||
49
qml/Screens/ConnectionScreen.qml
Normal file
49
qml/Screens/ConnectionScreen.qml
Normal file
@@ -0,0 +1,49 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Dialogs 1.2
|
||||
import QtQuick.Layouts 1.12
|
||||
|
||||
import Controls 1.0 as Controls
|
||||
import Cubo 1.0
|
||||
import Utils 1.0
|
||||
|
||||
Dialog {
|
||||
id: root
|
||||
title: qsTr("Connection Screen")
|
||||
width: 300
|
||||
height: 300
|
||||
standardButtons: Dialog.NoButton
|
||||
|
||||
contentItem: Rectangle {
|
||||
color: Palette.screenBackgroundColor
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 45
|
||||
|
||||
Label {
|
||||
text: qsTr("Select serial port")
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
|
||||
}
|
||||
|
||||
Controls.ComboBox {
|
||||
id: serialBox
|
||||
model: BmsInterface.serialPortNames()
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
}
|
||||
|
||||
Controls.AlternativeButton {
|
||||
text: qsTr("Connect")
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
||||
onClicked: {
|
||||
var currentPort = BmsInterface.serialPortNames()[serialBox.currentIndex]
|
||||
if (BmsInterface.connectSerial(currentPort))
|
||||
root.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
4
qml/Screens/qmldir
Normal file
4
qml/Screens/qmldir
Normal file
@@ -0,0 +1,4 @@
|
||||
module Screens
|
||||
ConnectionScreen 1.0 ConnectionScreen.qml
|
||||
AkbMonitorScreen 1.0 AkbMonitorScreen.qml
|
||||
CellMonitorScreen 1.0 CellMonitorScreen.qml
|
||||
Reference in New Issue
Block a user