Implemented terminal screen
This commit is contained in:
11
qml/Controls/TextArea.qml
Normal file
11
qml/Controls/TextArea.qml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import QtQuick 2.12
|
||||||
|
import QtQuick.Controls 2.12
|
||||||
|
|
||||||
|
import Utils 1.0
|
||||||
|
|
||||||
|
TextArea {
|
||||||
|
color: Palette.textColor
|
||||||
|
selectByMouse: true
|
||||||
|
selectionColor: Palette.alternativeBackgroundColor
|
||||||
|
font.pixelSize: 16
|
||||||
|
}
|
||||||
@@ -19,3 +19,4 @@ LinkLabel 1.0 LinkLabel.qml
|
|||||||
TabButton 1.0 TabButton.qml
|
TabButton 1.0 TabButton.qml
|
||||||
TabBar 1.0 TabBar.qml
|
TabBar 1.0 TabBar.qml
|
||||||
ChartView 1.0 ChartView.qml
|
ChartView 1.0 ChartView.qml
|
||||||
|
TextArea 1.0 TextArea.qml
|
||||||
|
|||||||
@@ -174,6 +174,9 @@ ApplicationWindow {
|
|||||||
qsTr("Cell monitor"),
|
qsTr("Cell monitor"),
|
||||||
qsTr("BMS settings"),
|
qsTr("BMS settings"),
|
||||||
qsTr("Visualization"),
|
qsTr("Visualization"),
|
||||||
|
qsTr("History"),
|
||||||
|
qsTr("Terminal"),
|
||||||
|
qsTr("Exit"),
|
||||||
]
|
]
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
@@ -211,6 +214,12 @@ ApplicationWindow {
|
|||||||
|
|
||||||
Screens.VisualizationScreen {
|
Screens.VisualizationScreen {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Screens.BmsSettingsScreen {
|
||||||
|
}
|
||||||
|
|
||||||
|
Screens.BmsServiceScreen {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
63
qml/Screens/BmsServiceScreen.qml
Normal file
63
qml/Screens/BmsServiceScreen.qml
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
import QtQuick 2.12
|
||||||
|
import QtQuick.Controls 2.12
|
||||||
|
import QtQuick.Layouts 1.12
|
||||||
|
|
||||||
|
import Controls 1.0 as Controls
|
||||||
|
import Cubo 1.0
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
spacing: 20
|
||||||
|
|
||||||
|
Keys.onReturnPressed: sendButton.clicked()
|
||||||
|
Keys.onEnterPressed: sendButton.clicked()
|
||||||
|
|
||||||
|
Controls.Frame {
|
||||||
|
ScrollView {
|
||||||
|
anchors.fill: parent
|
||||||
|
Controls.TextArea {
|
||||||
|
id: outputArea
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
spacing: 20
|
||||||
|
|
||||||
|
Controls.Button {
|
||||||
|
text: qsTr("Clear")
|
||||||
|
Layout.preferredWidth: 120
|
||||||
|
onClicked: outputArea.clear()
|
||||||
|
}
|
||||||
|
|
||||||
|
Controls.TextField {
|
||||||
|
id: commandField
|
||||||
|
implicitHeight: 52
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Controls.Button {
|
||||||
|
id: sendButton
|
||||||
|
text: qsTr("Send")
|
||||||
|
Layout.preferredWidth: 120
|
||||||
|
onClicked: {
|
||||||
|
BmsInterface.commands().sendTerminalCmd(commandField.text)
|
||||||
|
commandField.clear()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Controls.Button {
|
||||||
|
text: qsTr("Help")
|
||||||
|
Layout.preferredWidth: 120
|
||||||
|
onClicked: BmsInterface.commands().sendTerminalCmd("help")
|
||||||
|
}
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: BmsInterface.commands()
|
||||||
|
onPrintReceived: outputArea.append(str)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,3 +4,4 @@ AkbMonitorScreen 1.0 AkbMonitorScreen.qml
|
|||||||
CellMonitorScreen 1.0 CellMonitorScreen.qml
|
CellMonitorScreen 1.0 CellMonitorScreen.qml
|
||||||
BmsSettingsScreen 1.0 BmsSettingsScreen.qml
|
BmsSettingsScreen 1.0 BmsSettingsScreen.qml
|
||||||
VisualizationScreen 1.0 VisualizationScreen.qml
|
VisualizationScreen 1.0 VisualizationScreen.qml
|
||||||
|
BmsServiceScreen 1.0 BmsServiceScreen.qml
|
||||||
|
|||||||
@@ -30,5 +30,7 @@
|
|||||||
<file>Controls/TabButton.qml</file>
|
<file>Controls/TabButton.qml</file>
|
||||||
<file>Controls/TabBar.qml</file>
|
<file>Controls/TabBar.qml</file>
|
||||||
<file>Controls/ChartView.qml</file>
|
<file>Controls/ChartView.qml</file>
|
||||||
|
<file>Screens/BmsServiceScreen.qml</file>
|
||||||
|
<file>Controls/TextArea.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
Reference in New Issue
Block a user