diff --git a/qml/Controls/AlternativeButton.qml b/qml/Controls/AlternativeButton.qml deleted file mode 100644 index 7c586f9..0000000 --- a/qml/Controls/AlternativeButton.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -Button { - -} diff --git a/qml/Controls/Button.qml b/qml/Controls/Button.qml index 9c36e13..33dd131 100644 --- a/qml/Controls/Button.qml +++ b/qml/Controls/Button.qml @@ -1,5 +1,28 @@ -import QtQuick 2.0 +import QtQuick 2.12 +import QtQuick.Controls 2.12 -Item { +import Utils 1.0 +Button { + id: control + + contentItem: Text { + text: control.text + font.pixelSize: 16 + font.weight: Font.ExtraBold + opacity: enabled ? 1.0 : 0.3 + color: Palette.alternativeTextColor + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + elide: Text.ElideRight + } + + background: Rectangle { + implicitWidth: 200 + implicitHeight: 52 + opacity: enabled ? 1 : 0.3 + color: control.pressed ? Palette.pressedButtonColor : + control.hovered ? Palette.hoveredButtonColor : Palette.buttonColor + radius: 5 + } } diff --git a/qml/Controls/CheckBox.qml b/qml/Controls/CheckBox.qml new file mode 100644 index 0000000..c9611ea --- /dev/null +++ b/qml/Controls/CheckBox.qml @@ -0,0 +1,37 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.12 + +import Utils 1.0 + +CheckBox { + id: control + implicitHeight: 25 + spacing: 15 + + indicator: Rectangle { + implicitWidth: control.implicitHeight + implicitHeight: control.implicitHeight + x: control.leftPadding + y: parent.height / 2 - height / 2 + radius: 5 + border.color: Palette.borderColor + border.width: 1 + color: control.checked ? Palette.alternativeBackgroundColor : Palette.backgroundColor + + Image { + source: "qrc:/Icons/check-indicator.svg" + anchors.centerIn: parent + visible: control.checked + } + } + + contentItem: Text { + text: control.text + font.pixelSize: 18 + font.weight: Font.ExtraBold + color: Palette.textColor + elide: Text.ElideRight + verticalAlignment: Text.AlignVCenter + leftPadding: control.indicator.width + control.spacing + } +} diff --git a/qml/Controls/DotSeparator.qml b/qml/Controls/DotSeparator.qml index 598c6c9..7ac39cc 100644 --- a/qml/Controls/DotSeparator.qml +++ b/qml/Controls/DotSeparator.qml @@ -17,18 +17,3 @@ Shape { PathLine { x: shape.width; y: 0 } } } - -//Canvas { -// id: canvas -// contextType: "2d" -// implicitHeight: 1 - -// onPaint: { -// var ctx = getContext("2d"); -// ctx.setLineDash([2, 2]); -// ctx.beginPath(); -// ctx.moveTo(0, 0); -// ctx.lineTo(width, 0); -// ctx.stroke(); -// } -//} diff --git a/qml/Controls/LabelWithBackground.qml b/qml/Controls/LabelWithBackground.qml new file mode 100644 index 0000000..97cac16 --- /dev/null +++ b/qml/Controls/LabelWithBackground.qml @@ -0,0 +1,18 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.12 + +import Utils 1.0 + +Label { + color: Palette.textColor + font.pixelSize: 18 + font.weight: Font.ExtraBold + elide: Text.ElideRight + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + + background: Rectangle { + color: Palette.hoveredBackgroundColor + radius: 8 + } +} diff --git a/qml/Controls/LineSeparator.qml b/qml/Controls/LineSeparator.qml new file mode 100644 index 0000000..5703086 --- /dev/null +++ b/qml/Controls/LineSeparator.qml @@ -0,0 +1,17 @@ +import QtQuick 2.12 +import QtQuick.Shapes 1.12 + +import Utils 1.0 + +Shape { + id: shape + implicitHeight: 1 + + ShapePath { + strokeColor: Palette.borderColor + strokeStyle: ShapePath.SolidLine + startX: 0 + startY: 0 + PathLine { x: shape.width; y: 0 } + } +} diff --git a/qml/Controls/LinkLabel.qml b/qml/Controls/LinkLabel.qml new file mode 100644 index 0000000..57a9716 --- /dev/null +++ b/qml/Controls/LinkLabel.qml @@ -0,0 +1,22 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.12 + +import Utils 1.0 + +Label { + id: control + color: Palette.selectedTextColor + font.pixelSize: 18 + font.weight: Font.Medium + font.underline : true + elide: Text.ElideRight + + signal clicked() + + MouseArea{ + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onClicked: control.clicked() + } +} diff --git a/qml/Controls/OutlineButton.qml b/qml/Controls/OutlineButton.qml new file mode 100644 index 0000000..98ad8f4 --- /dev/null +++ b/qml/Controls/OutlineButton.qml @@ -0,0 +1,31 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.12 + +import Utils 1.0 + +Button { + id: control + + contentItem: Text { + text: control.text + font.pixelSize: 16 + font.weight: Font.ExtraBold + opacity: enabled ? 1.0 : 0.3 + color: control.hovered ? Palette.alternativeTextColor : Palette.textColor + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + elide: Text.ElideRight + } + + background: Rectangle { + implicitWidth: 200 + implicitHeight: 52 + opacity: enabled ? 1 : 0.3 + color: control.pressed ? Palette.pressedButtonColor : + control.hovered ? Palette.hoveredButtonColor : Palette.outlineButtonColor + border.color: control.pressed ? Palette.pressedButtonColor : + control.hovered ? Palette.hoveredButtonColor : Palette.buttonColor + border.width: 1 + radius: 5 + } +} diff --git a/qml/Controls/ScrollBar.qml b/qml/Controls/ScrollBar.qml index 030990f..a8fd1f4 100644 --- a/qml/Controls/ScrollBar.qml +++ b/qml/Controls/ScrollBar.qml @@ -1,6 +1,26 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -ScrollBar { +import Utils 1.0 +ScrollBar { + id: control + size: 0.3 + position: 0.2 + active: true + orientation: Qt.Vertical + + contentItem: Rectangle { + implicitWidth: 12 + implicitHeight: 100 + radius: width / 2 + color: Palette.alternativeBackgroundColor + // Hide the ScrollBar when it's not needed. + opacity: control.policy === ScrollBar.AlwaysOn || (control.active && control.size < 1.0) ? 0.75 : 0 + + // Animate the changes in opacity (default duration is 250 ms). + Behavior on opacity { + NumberAnimation {} + } + } } diff --git a/qml/Controls/qmldir b/qml/Controls/qmldir index d7f3912..60ca118 100644 --- a/qml/Controls/qmldir +++ b/qml/Controls/qmldir @@ -4,7 +4,7 @@ ComboBox 1.0 ComboBox.qml PaneItem 1.0 PaneItem.qml ScrollBar 1.0 ScrollBar.qml Button 1.0 Button.qml -AlternativeButton 1.0 AlternativeButton.qml +OutlineButton 1.0 OutlineButton.qml TextField 1.0 TextField.qml Frame 1.0 Frame.qml TitleLabel 1.0 TitleLabel.qml @@ -12,3 +12,7 @@ SubtitleLabel 1.0 SubtitleLabel.qml ContentLabel 1.0 ContentLabel.qml DotSeparator 1.0 DotSeparator.qml AvailabilityIndicator 1.0 AvailabilityIndicator.qml +LabelWithBackground 1.0 LabelWithBackground.qml +CheckBox 1.0 CheckBox.qml +LineSeparator 1.0 LineSeparator.qml +LinkLabel 1.0 LinkLabel.qml diff --git a/qml/Icons/check-indicator.svg b/qml/Icons/check-indicator.svg new file mode 100644 index 0000000..bdc67b3 --- /dev/null +++ b/qml/Icons/check-indicator.svg @@ -0,0 +1,3 @@ + + + diff --git a/qml/MainWindow.qml b/qml/MainWindow.qml index 1f333b3..39eb673 100644 --- a/qml/MainWindow.qml +++ b/qml/MainWindow.qml @@ -37,7 +37,6 @@ ApplicationWindow { source: "qrc:/Icons/cubo-logo.svg" sourceSize.width: pane.minimized ? 80 : 115 sourceSize.height: pane.minimized ? 80 : 115 - fillMode: Image.PreserveAspectFit Layout.alignment: Qt.AlignCenter } @@ -59,7 +58,6 @@ ApplicationWindow { Image { source: "qrc:/Icons/hide-menu.svg" - fillMode: Image.PreserveAspectFit mirror: pane.minimized Layout.alignment: Qt.AlignCenter } @@ -130,7 +128,6 @@ ApplicationWindow { Image { source: modelData.icon - fillMode: Image.PreserveAspectFit Layout.alignment: Qt.AlignCenter } @@ -147,7 +144,7 @@ ApplicationWindow { } background: Rectangle { - color: menuDelegate.highlighted ? Palette.pressedButtonColor : Palette.alternativeButtonColor + color: menuDelegate.highlighted ? Palette.pressedButtonColor : Palette.buttonColor } } @@ -173,8 +170,9 @@ ApplicationWindow { id: topBar property var labels: [ - qsTr("AKB Monitor"), - qsTr("Cell Monitor"), + qsTr("AKB monitor"), + qsTr("Cell monitor"), + qsTr("BMS settings"), ] Label { @@ -206,6 +204,9 @@ ApplicationWindow { Screens.CellMonitorScreen { } + + Screens.BmsSettingsScreen { + } } } } diff --git a/qml/Screens/AkbMonitorScreen.qml b/qml/Screens/AkbMonitorScreen.qml index a878c92..f9b74f9 100644 --- a/qml/Screens/AkbMonitorScreen.qml +++ b/qml/Screens/AkbMonitorScreen.qml @@ -25,7 +25,7 @@ Item { } Controls.TextField { - id: serialField + id: serialNumberField enabled: false Layout.fillWidth: true Layout.maximumWidth: (parent.width - parent.spacing) / 2 @@ -314,7 +314,7 @@ Item { Connections { target: BmsInterface.bmsConfig() onUpdated: { - serialField.text = BmsInterface.bmsConfig().getParamDouble("notUsedCurrentThreshold") // TODO + serialNumberField.text = BmsInterface.bmsConfig().getParamDouble("notUsedCurrentThreshold") // TODO numberOfModulesLabel.text = BmsInterface.bmsConfig().getParamInt("cellMonitorICCount") numberOfCellsLabel.text = BmsInterface.bmsConfig().getParamInt("noOfCellsSeries") diff --git a/qml/Screens/BmsSettingsScreen.qml b/qml/Screens/BmsSettingsScreen.qml new file mode 100644 index 0000000..0c057d0 --- /dev/null +++ b/qml/Screens/BmsSettingsScreen.qml @@ -0,0 +1,612 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Layouts 1.12 + +import Controls 1.0 as Controls +import Cubo 1.0 + +RowLayout { + property real contentPadding: 35 + property real contentRowSpacing: 20 + property real contentColumnSpacing: 35 + + spacing: contentColumnSpacing + + Flickable { + id: settingsFlickable + clip: true + contentHeight: configLayout.height + + ColumnLayout { + id: configLayout + width: parent.width + spacing: 15 + + Controls.Frame { + id: serialNumberSettingsFrame + padding: contentPadding + implicitWidth: parent.width + Layout.fillWidth: true + + RowLayout { + spacing: contentColumnSpacing + anchors.fill: parent + + Controls.TitleLabel { + text: qsTr("Serial number") + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.spacing) / 2 + } + + Controls.TextField { + id: serialNumberField + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.spacing) / 2 + } + } + } + + Controls.Frame { + id: configurationSettingsFrame + padding: contentPadding + implicitWidth: parent.width + Layout.fillWidth: true + + GridLayout { + columns: 2 + rowSpacing: contentRowSpacing + columnSpacing: contentColumnSpacing + anchors.fill: parent + + Controls.TitleLabel { + text: qsTr("Configuration") + Layout.fillWidth: true + Layout.columnSpan: 2 + } + + Controls.SubtitleLabel { + text: qsTr("Number of boards") + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.SubtitleLabel { + text: qsTr("Number of cells") + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.TextField { + id: numberOfBoardsField + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.TextField { + id: numberOfCellsField + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + } + } + + Controls.Frame { + id: socSettingsFrame + padding: contentPadding + implicitWidth: parent.width + Layout.fillWidth: true + + GridLayout { + columns: 2 + rowSpacing: contentRowSpacing + columnSpacing: contentColumnSpacing + anchors.fill: parent + + Controls.TitleLabel { + text: qsTr("SOC") + Layout.fillWidth: true + Layout.columnSpan: 2 + } + + Controls.SubtitleLabel { + text: qsTr("Number of cells connected in parallel") + maximumLineCount: 2 + wrapMode: Text.WordWrap + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.SubtitleLabel { + text: qsTr("Battery capacity") + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.TextField { + id: numberOfParallelCellsField + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.TextField { + id: batteryCapacityField + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + } + } + + Controls.Frame { + id: limitSettingsFrame + padding: contentPadding + implicitWidth: parent.width + Layout.fillWidth: true + + GridLayout { + columns: 2 + rowSpacing: contentRowSpacing + columnSpacing: contentColumnSpacing + anchors.fill: parent + + Controls.TitleLabel { + text: qsTr("Limits") + Layout.fillWidth: true + Layout.columnSpan: 2 + } + + Controls.SubtitleLabel { + text: qsTr("Maximum charge current, A") + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.SubtitleLabel { + text: qsTr("Maximum load current, A") + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.TextField { + id: maximumChargeCurrentField + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.TextField { + id: maximumLoadCurrentField + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.SubtitleLabel { + text: qsTr("Maximum temperature, °C") + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + Layout.columnSpan: 2 + } + + Controls.TextField { + id: maximumTemperatureField + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + Layout.columnSpan: 2 + } + } + } + + Controls.Frame { + id: cellSettingsFrame + padding: contentPadding + implicitWidth: parent.width + Layout.fillWidth: true + + GridLayout { + columns: 2 + rowSpacing: contentRowSpacing + columnSpacing: contentColumnSpacing + anchors.fill: parent + + Controls.TitleLabel { + text: qsTr("Cell configuration") + Layout.fillWidth: true + Layout.columnSpan: 2 + } + + Controls.SubtitleLabel { + text: qsTr("Lower shutdown threshold, V") + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.SubtitleLabel { + text: qsTr("Upper shutdown threshold, V") + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.TextField { + id: lowerShutdownThresholdField + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.TextField { + id: upperShutdownThresholdField + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + // TODO +// Controls.SubtitleLabel { +// text: qsTr("Lower shutdown threshold, V") +// Layout.fillWidth: true +// Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 +// } + +// Controls.SubtitleLabel { +// text: qsTr("Upper shutdown threshold, V") +// Layout.fillWidth: true +// Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 +// } + +// Controls.TextField { +// id: lowerShutdownThresholdField +// Layout.fillWidth: true +// Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 +// } + +// Controls.TextField { +// id: upperShutdownThresholdField +// Layout.fillWidth: true +// Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 +// } + } + } + + Controls.Frame { + id: balancingSettingsFrame + padding: contentPadding + implicitWidth: parent.width + Layout.fillWidth: true + + GridLayout { + columns: 2 + rowSpacing: contentRowSpacing + columnSpacing: contentColumnSpacing + anchors.fill: parent + + Controls.TitleLabel { + text: qsTr("Balancing configuration") + Layout.fillWidth: true + Layout.columnSpan: 2 + } + + Controls.SubtitleLabel { + text: qsTr("Balancing start voltage, V") + maximumLineCount: 2 + wrapMode: Text.WordWrap + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.SubtitleLabel { + text: qsTr("Cell voltage delta to start balancing, V") + maximumLineCount: 2 + wrapMode: Text.WordWrap + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.TextField { + id: balancingStartVoltageField + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.TextField { + id: balancingStartDeltaVoltageField + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + } + } + + Controls.Frame { + id: outputSettingsFrame + padding: contentPadding + implicitWidth: parent.width + Layout.fillWidth: true + + property real outputNumberSize: 60 + + GridLayout { + columns: 2 + rowSpacing: contentRowSpacing + columnSpacing: contentColumnSpacing + anchors.fill: parent + + Controls.TitleLabel { + text: qsTr("Output settings") + Layout.fillWidth: true + Layout.columnSpan: 2 + } + + RowLayout { + spacing: 20 + + Controls.LabelWithBackground { + text: qsTr("№ 1") + Layout.preferredWidth: outputSettingsFrame.outputNumberSize + Layout.preferredHeight: outputSettingsFrame.outputNumberSize + } + + Controls.CheckBox { + text: qsTr("Use for management") + Layout.fillWidth: true + Layout.preferredHeight: outputSettingsFrame.outputNumberSize + } + + Layout.fillWidth: true + Layout.columnSpan: 2 + } + + Controls.LineSeparator { + Layout.fillWidth: true + Layout.columnSpan: 2 + } + + RowLayout { + spacing: 20 + + Controls.LabelWithBackground { + text: qsTr("№ 2") + Layout.preferredWidth: outputSettingsFrame.outputNumberSize + Layout.preferredHeight: outputSettingsFrame.outputNumberSize + } + + Controls.CheckBox { + text: qsTr("Normally closed") + Layout.fillWidth: true + Layout.preferredHeight: outputSettingsFrame.outputNumberSize + } + + Layout.fillWidth: true + Layout.columnSpan: 2 + } + + Controls.SubtitleLabel { + text: qsTr("Change in value during SOC") + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + Layout.columnSpan: 2 + } + + Controls.TextField { + id: changeValueSocField + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + Layout.columnSpan: 2 + } + + Controls.LineSeparator { + Layout.fillWidth: true + Layout.columnSpan: 2 + } + + RowLayout { + spacing: 20 + + Controls.LabelWithBackground { + text: qsTr("№ 3") + Layout.preferredWidth: outputSettingsFrame.outputNumberSize + Layout.preferredHeight: outputSettingsFrame.outputNumberSize + } + + Controls.CheckBox { + Layout.fillWidth: true + Layout.preferredHeight: outputSettingsFrame.outputNumberSize + } + + Layout.fillWidth: true + Layout.columnSpan: 2 + } + + Controls.SubtitleLabel { + text: qsTr("Closes at t<, °C") + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.SubtitleLabel { + text: qsTr("Opens at t>, °C") + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.TextField { + id: closesBelowTemperatureThirdField + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.TextField { + id: opensGreaterTemperatureThirdField + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.LineSeparator { + Layout.fillWidth: true + Layout.columnSpan: 2 + } + + RowLayout { + spacing: 20 + + Controls.LabelWithBackground { + text: qsTr("№ 4") + Layout.preferredWidth: outputSettingsFrame.outputNumberSize + Layout.preferredHeight: outputSettingsFrame.outputNumberSize + } + + Controls.CheckBox { + Layout.fillWidth: true + Layout.preferredHeight: outputSettingsFrame.outputNumberSize + } + + Layout.fillWidth: true + Layout.columnSpan: 2 + } + + Controls.SubtitleLabel { + text: qsTr("Closes at t<, °C") + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.SubtitleLabel { + text: qsTr("Opens at t>, °C") + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.TextField { + id: closesBelowTemperatureFourthField + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.TextField { + id: opensGreaterTemperatureFourthField + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.LineSeparator { + Layout.fillWidth: true + Layout.columnSpan: 2 + } + } + } + + Controls.Frame { + id: zeroSensorSettingsFrame + padding: contentPadding + implicitWidth: parent.width + Layout.fillWidth: true + + GridLayout { + columns: 2 + rowSpacing: contentRowSpacing + columnSpacing: contentColumnSpacing + anchors.fill: parent + + Controls.SubtitleLabel { + text: qsTr("Current sensor value «0»") + Layout.fillWidth: true + Layout.columnSpan: 2 + } + + Controls.TextField { + id: zeroSensorValueField + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + Layout.columnSpan: 2 + } + + Controls.Button { + id: zeroSensorValueCalibrationButton + text: qsTr("Calibrate «0»") + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + Layout.columnSpan: 2 + } + } + } + } + + ScrollBar.vertical: Controls.ScrollBar { +// policy: ScrollBar.AlwaysOn + } + + Layout.fillWidth: true + Layout.fillHeight: true + } + + ColumnLayout { + spacing: contentRowSpacing + + Controls.LinkLabel { + text: qsTr("Serial number") + onClicked: settingsFlickable.contentY = serialNumberSettingsFrame.mapToItem(settingsFlickable.contentItem, 0, 0).y + } + + Controls.LinkLabel { + text: qsTr("Configuration") + onClicked: settingsFlickable.contentY = configurationSettingsFrame.mapToItem(settingsFlickable.contentItem, 0, 0).y + } + + Controls.LinkLabel { + text: qsTr("SOC") + onClicked: settingsFlickable.contentY = socSettingsFrame.mapToItem(settingsFlickable.contentItem, 0, 0).y + } + + Controls.LinkLabel { + text: qsTr("Limits") + onClicked: settingsFlickable.contentY = limitSettingsFrame.mapToItem(settingsFlickable.contentItem, 0, 0).y + } + + Controls.LinkLabel { + text: qsTr("Cell configuration") + onClicked: settingsFlickable.contentY = cellSettingsFrame.mapToItem(settingsFlickable.contentItem, 0, 0).y + } + + Controls.LinkLabel { + text: qsTr("Balancing configuration") + onClicked: settingsFlickable.contentY = balancingSettingsFrame.mapToItem(settingsFlickable.contentItem, 0, 0).y + } + + Controls.LinkLabel { + text: qsTr("Output settings") + onClicked: settingsFlickable.contentY = outputSettingsFrame.mapToItem(settingsFlickable.contentItem, 0, 0).y + } + + Controls.LinkLabel { + text: qsTr("Current sensor value «0»") + onClicked: settingsFlickable.contentY = zeroSensorSettingsFrame.mapToItem(settingsFlickable.contentItem, 0, 0).y + } + + Item { + Layout.fillHeight: true + } + + ColumnLayout { + spacing: 15 + + Controls.OutlineButton { + text: qsTr("Read settings from file") + Layout.fillWidth: true + } + + Controls.OutlineButton { + text: qsTr("Read current settings from BMS") + Layout.fillWidth: true + } + + Controls.OutlineButton { + text: qsTr("Write to non-volatile memory of BMS") + Layout.fillWidth: true + } + + Controls.Button { + text: qsTr("Write current values to BMS") + Layout.fillWidth: true + } + + Layout.fillWidth: true + } + + Layout.maximumWidth: 320 + Layout.fillHeight: true + } +} diff --git a/qml/Screens/CellMonitorScreen.qml b/qml/Screens/CellMonitorScreen.qml index 1700657..fb01ce5 100644 --- a/qml/Screens/CellMonitorScreen.qml +++ b/qml/Screens/CellMonitorScreen.qml @@ -63,7 +63,7 @@ Item { RowLayout { spacing: 10 width: ListView.view.width - height: 36 + height: 38 Item { Layout.preferredWidth: parent.width / 6 - 20 @@ -112,7 +112,7 @@ Item { anchors.fill: parent clip: true model: [] - spacing: 2 + spacing: 0 header: cellListHeader delegate: cellListDelegate @@ -131,7 +131,7 @@ Item { anchors.fill: parent clip: true model: [] - spacing: 2 + spacing: 0 header: cellListHeader delegate: cellListDelegate diff --git a/qml/Screens/ConnectionScreen.qml b/qml/Screens/ConnectionScreen.qml index df2ed6b..335b83f 100644 --- a/qml/Screens/ConnectionScreen.qml +++ b/qml/Screens/ConnectionScreen.qml @@ -34,7 +34,7 @@ Dialog { Layout.alignment: Qt.AlignCenter } - Controls.AlternativeButton { + Controls.Button { text: qsTr("Connect") Layout.fillWidth: true Layout.alignment: Qt.AlignHCenter | Qt.AlignTop diff --git a/qml/Screens/qmldir b/qml/Screens/qmldir index 4a978c8..44ad1a4 100644 --- a/qml/Screens/qmldir +++ b/qml/Screens/qmldir @@ -2,3 +2,4 @@ module Screens ConnectionScreen 1.0 ConnectionScreen.qml AkbMonitorScreen 1.0 AkbMonitorScreen.qml CellMonitorScreen 1.0 CellMonitorScreen.qml +BmsSettingsScreen 1.0 BmsSettingsScreen.qml diff --git a/qml/Utils/Palette.qml b/qml/Utils/Palette.qml index b5ae2f4..5664faf 100644 --- a/qml/Utils/Palette.qml +++ b/qml/Utils/Palette.qml @@ -17,8 +17,8 @@ QtObject { property color borderColor: "#DFE0EB" - property color buttonColor: "#F7F8FC" - property color alternativeButtonColor: "#009352" + property color buttonColor: "#009352" + property color outlineButtonColor: "#F7F8FC" property color hoveredButtonColor: "#03AC61" property color pressedButtonColor: "#057845" } diff --git a/qml/qml_icons.qrc b/qml/qml_icons.qrc index 747a353..aecde6e 100644 --- a/qml/qml_icons.qrc +++ b/qml/qml_icons.qrc @@ -9,5 +9,6 @@ Icons/hide-menu.svg Icons/history.svg Icons/visualization.svg + Icons/check-indicator.svg diff --git a/qml/qml_items.qrc b/qml/qml_items.qrc index 11a0ec5..78d1b5b 100644 --- a/qml/qml_items.qrc +++ b/qml/qml_items.qrc @@ -12,8 +12,8 @@ Screens/qmldir Utils/qmldir Controls/ScrollBar.qml + Controls/OutlineButton.qml Controls/Button.qml - Controls/AlternativeButton.qml Controls/TextField.qml Controls/Frame.qml Controls/TitleLabel.qml @@ -21,5 +21,10 @@ Controls/ContentLabel.qml Controls/DotSeparator.qml Controls/AvailabilityIndicator.qml + Screens/BmsSettingsScreen.qml + Controls/LabelWithBackground.qml + Controls/CheckBox.qml + Controls/LineSeparator.qml + Controls/LinkLabel.qml