Implemented QML skeleton for the application

This commit is contained in:
Yury Shuvakin
2022-08-15 08:49:12 +03:00
parent 14a7aa699f
commit dce22c65d6
36 changed files with 791 additions and 117 deletions

View 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
}
}
}

View File

@@ -0,0 +1,5 @@
import QtQuick 2.0
Item {
}

View 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
View File

@@ -0,0 +1,4 @@
module Screens
ConnectionScreen 1.0 ConnectionScreen.qml
AkbMonitorScreen 1.0 AkbMonitorScreen.qml
CellMonitorScreen 1.0 CellMonitorScreen.qml