Added project implementation

This commit is contained in:
Yury Shuvakin
2024-01-22 18:30:04 +09:00
parent 4ef6c3fcb5
commit ccd48df127
35 changed files with 1519 additions and 0 deletions

362
qml/main.qml Normal file
View File

@@ -0,0 +1,362 @@
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import Controls 1.0 as CustomControls
import Palette 1.0
import Tksi 1.0
ApplicationWindow {
id: root
width: 1920
height: 1080
visible: true
visibility: Qt.platform.os === "linux" ? "FullScreen" : "Windowed"
flags: Qt.platform.os === "linux" ? Qt.FramelessWindowHint | Qt.Window : Qt.Window
title: "ТКСИ 125 монитор"
ColumnLayout {
anchors.leftMargin: 56
anchors.rightMargin: 56
anchors.topMargin: 80
anchors.bottomMargin: 58
anchors.fill: parent
spacing: 72
RowLayout {
spacing: 96
ColumnLayout {
spacing: 16
CustomControls.Label {
text: "Статус модулей"
}
RowLayout {
spacing: 16
CustomControls.IndicatorTextField {
text: DataController.firstStatus
horizontalAlignment: Text.AlignLeft
readOnly: true
Layout.preferredWidth: 160
}
CustomControls.IndicatorTextField {
text: DataController.secondStatus
readOnly: true
Layout.preferredWidth: 160
}
CustomControls.IndicatorTextField {
visible: DataController.firstStatus === "0x07" && DataController.secondStatus === "0x07"
text: "Готов к работе"
backgroundColor: "#C4FFCA"
backgroundRadius: 16
font.pixelSize: 24
font.weight: Font.Normal
leftPadding: 16
rightPadding: 16
readOnly: true
Layout.preferredWidth: 200
}
}
Item {
Layout.fillHeight: true
}
Layout.fillHeight: true
}
Item {
Layout.fillWidth: true
}
CustomControls.DescriptionTextField {
visible: modeSwitch.checkState === Qt.PartiallyChecked
descriptionText: "Вход ПСН"
indicatorText: "В"
text: DataController.psnInputVoltage
readonly: true
Layout.alignment: Qt.AlignTop
Layout.fillWidth: false
Layout.preferredWidth: 320
}
CustomControls.DescriptionTextField {
descriptionText: "Сеть"
indicatorText: "В"
text: DataController.mainVoltage
readonly: true
Layout.alignment: Qt.AlignTop
Layout.fillWidth: false
Layout.preferredWidth: 320
}
ColumnLayout {
spacing: 16
CustomControls.Label {
id: dateLabel
text: "Статус модулей"
Layout.alignment: Qt.AlignCenter
}
CustomControls.IndicatorTextField {
id: timeField
readOnly: true
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: 220
}
Item {
Layout.fillHeight: true
}
Timer {
interval: 1000
repeat: true
running: true
triggeredOnStart: true
onTriggered: {
let date = new Date()
dateLabel.text = Qt.formatDate(date, "dd.MM.yyyy")
timeField.text = Qt.formatTime(date, "hh:mm:ss")
}
}
Layout.fillHeight: true
}
Layout.fillHeight: false
Layout.fillWidth: true
}
CustomControls.TristateSwitch {
id: modeSwitch
// enabled: false // uncomment for non clickable
firstStateDescription: "ПСН"
secondStateDescription: "ИПБС"
checkState: DataController.ipbsMode === 2 ? Qt.Unchecked : DataController.ipbsMode === 1 ? Qt.Checked : Qt.PartiallyChecked
Layout.fillHeight: false
Layout.fillWidth: true
}
RowLayout {
RowLayout {
spacing: 56
visible: modeSwitch.checkState === Qt.PartiallyChecked
CustomControls.GroupBox {
title: "АИН 1"
ColumnLayout {
anchors.fill: parent
spacing: 32
CustomControls.DescriptionTextField {
descriptionText: "Напряжение"
indicatorText: "B"
text: DataController.ainFirstVoltage
readonly: true
Layout.fillWidth: true
}
CustomControls.DescriptionTextField {
descriptionText: "Ток"
indicatorText: "А"
text: DataController.ainFirstCurrent
readonly: true
Layout.fillWidth: true
}
}
Layout.preferredWidth: (parent.width - 2 * parent.spacing) / 3
Layout.fillWidth: true
Layout.fillHeight: true
}
CustomControls.GroupBox {
title: "АИН 2"
ColumnLayout {
anchors.fill: parent
spacing: 32
CustomControls.DescriptionTextField {
descriptionText: "Напряжение"
indicatorText: "B"
text: DataController.ainSecondVoltage
readonly: true
Layout.fillWidth: true
}
CustomControls.DescriptionTextField {
descriptionText: "Ток"
indicatorText: "А"
text: DataController.ainSecondCurrent
readonly: true
Layout.fillWidth: true
}
}
Layout.preferredWidth: (parent.width - 2 * parent.spacing) / 3
Layout.fillWidth: true
Layout.fillHeight: true
}
CustomControls.GroupBox {
title: "АИН 3"
ColumnLayout {
anchors.fill: parent
spacing: 32
CustomControls.DescriptionTextField {
descriptionText: "Напряжение"
indicatorText: "B"
text: DataController.ainThirdVoltage
readonly: true
Layout.fillWidth: true
}
CustomControls.DescriptionTextField {
descriptionText: "Ток"
indicatorText: "А"
text: DataController.ainThirdCurrent
readonly: true
Layout.fillWidth: true
}
}
Layout.preferredWidth: (parent.width - 2 * parent.spacing) / 3
Layout.fillWidth: true
Layout.fillHeight: true
}
Layout.fillWidth: true
Layout.fillHeight: true
}
RowLayout {
spacing: 56
visible: modeSwitch.checkState === Qt.Checked
CustomControls.GroupBox {
title: "Выход 1 (Канал 1)"
ColumnLayout {
anchors.fill: parent
spacing: 32
CustomControls.DescriptionTextField {
descriptionText: "Напряжение"
indicatorText: "B"
text: DataController.ipbsFirstVoltage
readonly: true
Layout.fillWidth: true
}
CustomControls.DescriptionTextField {
descriptionText: "Ток"
indicatorText: "А"
text: DataController.ipbsFirstCurrent
readonly: true
Layout.fillWidth: true
}
}
Layout.preferredWidth: (parent.width - 2 * parent.spacing) / 3
Layout.fillWidth: true
Layout.fillHeight: true
}
CustomControls.GroupBox {
title: "Выход 1 (Канал 2)"
ColumnLayout {
anchors.fill: parent
spacing: 32
CustomControls.DescriptionTextField {
descriptionText: "Напряжение"
indicatorText: "B"
text: DataController.ipbsSecondVoltage
readonly: true
Layout.fillWidth: true
}
CustomControls.DescriptionTextField {
descriptionText: "Ток"
indicatorText: "А"
text: DataController.ipbsSecondCurrent
readonly: true
Layout.fillWidth: true
}
}
Layout.preferredWidth: (parent.width - 2 * parent.spacing) / 3
Layout.fillWidth: true
Layout.fillHeight: true
}
CustomControls.GroupBox {
title: "Выход 2"
ColumnLayout {
anchors.fill: parent
spacing: 32
CustomControls.DescriptionTextField {
descriptionText: "Напряжение"
indicatorText: "B"
text: DataController.ipbsThirdVoltage
readonly: true
Layout.fillWidth: true
}
CustomControls.DescriptionTextField {
descriptionText: "Ток"
indicatorText: "А"
text: DataController.ipbsThirdCurrent
readonly: true
Layout.fillWidth: true
}
}
Layout.preferredWidth: (parent.width - 2 * parent.spacing) / 3
Layout.fillWidth: true
Layout.fillHeight: true
}
Layout.fillWidth: true
Layout.fillHeight: true
}
Item {
visible: modeSwitch.checkState === Qt.Unchecked
Layout.fillWidth: true
Layout.fillHeight: true
}
Layout.fillWidth: true
Layout.fillHeight: true
}
}
MouseArea {
visible: Qt.platform.os === "linux"
anchors.fill: parent
enabled: false
cursorShape: Qt.BlankCursor
}
background: Rectangle {
color: Palette.backgroundColor
}
}