Hidden BMS temperature controls. Fixed translations

This commit is contained in:
Yury Shuvakin
2024-01-22 12:26:22 +09:00
parent 649c9ed2a0
commit a83ecbb042
8 changed files with 123 additions and 119 deletions

View File

@@ -102,52 +102,52 @@ RowLayout {
Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
}
Repeater {
id: bmsSensorsMaskRepeater
// Repeater {
// id: bmsSensorsMaskRepeater
property var bmsSensorsMaskModel: []
// property var bmsSensorsMaskModel: []
ColumnLayout {
id: bmsSensorsMaskLayout
Layout.fillWidth: true
// ColumnLayout {
// id: bmsSensorsMaskLayout
// Layout.fillWidth: true
property var boardIndex: index
// property var boardIndex: index
Controls.SubtitleLabel {
text: index === 0 ? qsTr("BMS sensors mask for master board") : qsTr("BMS sensors mask for slave board #") + index
maximumLineCount: 2
wrapMode: Text.WordWrap
Layout.fillWidth: true
}
// Controls.SubtitleLabel {
// text: index === 0 ? qsTr("BMS sensors mask for master board") : qsTr("BMS sensors mask for slave board #") + index
// maximumLineCount: 2
// wrapMode: Text.WordWrap
// Layout.fillWidth: true
// }
Controls.Frame {
padding: 10
Layout.fillWidth: true
Layout.fillHeight: true
// Controls.Frame {
// padding: 10
// Layout.fillWidth: true
// Layout.fillHeight: true
ColumnLayout {
spacing: 10
anchors.fill: parent
// ColumnLayout {
// spacing: 10
// anchors.fill: parent
Repeater {
model: 4
Controls.CheckBox {
text: qsTr("#") + (index + 1)
opacity: (bmsSensorsMaskLayout.boardIndex === 0 && (index === 2 || index === 3)) ? 0 : 1
enabled: opacity
checked: bmsSensorsMaskRepeater.bmsSensorsMaskModel[bmsSensorsMaskLayout.boardIndex * 4 + index]
onCheckedChanged: bmsSensorsMaskRepeater.bmsSensorsMaskModel[bmsSensorsMaskLayout.boardIndex * 4 + index] = checked
}
}
// Repeater {
// model: 4
// Controls.CheckBox {
// text: qsTr("#") + (index + 1)
// opacity: (bmsSensorsMaskLayout.boardIndex === 0 && (index === 2 || index === 3)) ? 0 : 1
// enabled: opacity
// checked: bmsSensorsMaskRepeater.bmsSensorsMaskModel[bmsSensorsMaskLayout.boardIndex * 4 + index]
// onCheckedChanged: bmsSensorsMaskRepeater.bmsSensorsMaskModel[bmsSensorsMaskLayout.boardIndex * 4 + index] = checked
// }
// }
Item {
visible: index === 0
Layout.fillHeight: true
}
}
}
}
}
// Item {
// visible: index === 0
// Layout.fillHeight: true
// }
// }
// }
// }
// }
Repeater {
id: batterySensorsMaskRepeater
@@ -197,17 +197,17 @@ RowLayout {
}
function recalculateSensorsMasks() {
const bmsSensorsModel = bmsSensorsMaskRepeater.bmsSensorsMaskModel
// const bmsSensorsModel = bmsSensorsMaskRepeater.bmsSensorsMaskModel
const batterySensorsModel = batterySensorsMaskRepeater.batterySensorsMaskModel
const newSize = parseInt(numberOfBoardsField.text) * 4
if (newSize) {
arrayResize(bmsSensorsModel, newSize, false)
// arrayResize(bmsSensorsModel, newSize, false)
arrayResize(batterySensorsModel, newSize, true)
bmsSensorsMaskRepeater.model = 0
bmsSensorsMaskRepeater.bmsSensorsMaskModel = bmsSensorsModel
bmsSensorsMaskRepeater.model = parseInt(numberOfBoardsField.text)
// bmsSensorsMaskRepeater.model = 0
// bmsSensorsMaskRepeater.bmsSensorsMaskModel = bmsSensorsModel
// bmsSensorsMaskRepeater.model = parseInt(numberOfBoardsField.text)
batterySensorsMaskRepeater.model = 0
batterySensorsMaskRepeater.batterySensorsMaskModel = batterySensorsModel
@@ -394,7 +394,7 @@ RowLayout {
}
Controls.SubtitleLabel {
text: qsTr("Upper enable threshold (should be higher than disable), V")
text: qsTr("Upper enable threshold (should be lower than disable), V")
maximumLineCount: 3
wrapMode: Text.WordWrap
Layout.fillWidth: true
@@ -940,26 +940,26 @@ RowLayout {
BmsInterface.bmsConfig().setParamValue("noOfCellsSeries", parseInt(numberOfCellsField.text))
const numberOfBoards = parseInt(numberOfBoardsField.text)
const bmsSensorsModel = bmsSensorsMaskRepeater.bmsSensorsMaskModel
// const bmsSensorsModel = bmsSensorsMaskRepeater.bmsSensorsMaskModel
const batterySensorsModel = batterySensorsMaskRepeater.batterySensorsMaskModel
let bmsSensorsMask = 0
// let bmsSensorsMask = 0
let batterySensorsMask = 0
for (let i = 0; i < numberOfBoards * 4; ++i) {
bmsSensorsMask |= Number(bmsSensorsModel[i]) << i
// bmsSensorsMask |= Number(bmsSensorsModel[i]) << i
batterySensorsMask |= Number(batterySensorsModel[i]) << i
}
// disable 3 and 4 sensor for master
bmsSensorsMask = bmsSensorsMask & ~(1 << 2)
bmsSensorsMask = bmsSensorsMask & ~(1 << 3)
// bmsSensorsMask = bmsSensorsMask & ~(1 << 2)
// bmsSensorsMask = bmsSensorsMask & ~(1 << 3)
batterySensorsMask = batterySensorsMask & ~(1 << 2)
batterySensorsMask = batterySensorsMask & ~(1 << 3)
print(bmsSensorsMask, batterySensorsMask)
// print(bmsSensorsMask, batterySensorsMask)
BmsInterface.bmsConfig().setParamValue("tempEnableMaskBMS", bmsSensorsMask)
// BmsInterface.bmsConfig().setParamValue("tempEnableMaskBMS", bmsSensorsMask)
BmsInterface.bmsConfig().setParamValue("tempEnableMaskBattery", batterySensorsMask)
BmsInterface.bmsConfig().setParamValue("noOfCellsParallel", parseInt(numberOfParallelCellsField.text))
@@ -1008,17 +1008,17 @@ RowLayout {
const numberOfBoards = BmsInterface.bmsConfig().getParamInt("cellMonitorICCount")
const numberOfSensorsPerBoard = BmsInterface.bmsConfig().getParamInt("noOfTempSensorPerModule")
const bmsSensorsMask = BmsInterface.bmsConfig().getParamInt("tempEnableMaskBMS")
// const bmsSensorsMask = BmsInterface.bmsConfig().getParamInt("tempEnableMaskBMS")
const batterySensorsMask = BmsInterface.bmsConfig().getParamInt("tempEnableMaskBattery")
const bmsSensorsModel = []
// const bmsSensorsModel = []
const batterySensorsModel = []
for (let i = 0; i < numberOfBoards * numberOfSensorsPerBoard; ++i) {
bmsSensorsModel.push((bmsSensorsMask & (1 << i)) != 0)
// bmsSensorsModel.push((bmsSensorsMask & (1 << i)) != 0)
batterySensorsModel.push((batterySensorsMask & (1 << i)) != 0)
}
bmsSensorsMaskRepeater.bmsSensorsMaskModel = bmsSensorsModel
// bmsSensorsMaskRepeater.bmsSensorsMaskModel = bmsSensorsModel
batterySensorsMaskRepeater.batterySensorsMaskModel = batterySensorsModel
numberOfParallelCellsField.text = BmsInterface.bmsConfig().getParamInt("noOfCellsParallel")

View File

@@ -24,7 +24,7 @@ Item {
Layout.rightMargin: 10
GridLayout {
columns: 2
columns: 1 // 2
columnSpacing: 70
rowSpacing: 15
anchors.fill: parent
@@ -45,27 +45,27 @@ Item {
}
Layout.fillWidth: true
Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
// Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
}
RowLayout {
spacing: 10
Controls.ContentLabel {
text: qsTr("Minimum BMS temperature, °C")
}
// RowLayout {
// spacing: 10
// Controls.ContentLabel {
// text: qsTr("Minimum BMS temperature, °C")
// }
Controls.DotSeparator {
Layout.fillWidth: true
}
// Controls.DotSeparator {
// Layout.fillWidth: true
// }
Controls.SubtitleLabel {
id: minBmsTemperatureLabel
text: "-"
}
// Controls.SubtitleLabel {
// id: minBmsTemperatureLabel
// text: "-"
// }
Layout.fillWidth: true
Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
}
// Layout.fillWidth: true
// Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
// }
RowLayout {
spacing: 10
@@ -83,27 +83,27 @@ Item {
}
Layout.fillWidth: true
Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
// Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
}
RowLayout {
spacing: 10
Controls.ContentLabel {
text: qsTr("Average BMS temperature, °C")
}
// RowLayout {
// spacing: 10
// Controls.ContentLabel {
// text: qsTr("Average BMS temperature, °C")
// }
Controls.DotSeparator {
Layout.fillWidth: true
}
// Controls.DotSeparator {
// Layout.fillWidth: true
// }
Controls.SubtitleLabel {
id: avgBmsTemperatureLabel
text: "-"
}
// Controls.SubtitleLabel {
// id: avgBmsTemperatureLabel
// text: "-"
// }
Layout.fillWidth: true
Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
}
// Layout.fillWidth: true
// Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
// }
RowLayout {
spacing: 10
@@ -121,29 +121,29 @@ Item {
}
Layout.fillWidth: true
Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
// Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
}
RowLayout {
spacing: 10
Controls.ContentLabel {
text: qsTr("Maximum BMS temperature, °C")
}
// RowLayout {
// spacing: 10
// Controls.ContentLabel {
// text: qsTr("Maximum BMS temperature, °C")
// }
Controls.DotSeparator {
Layout.fillWidth: true
}
// Controls.DotSeparator {
// Layout.fillWidth: true
// }
Controls.SubtitleLabel {
id: maxBmsTemperatureLabel
text: "-"
}
// Controls.SubtitleLabel {
// id: maxBmsTemperatureLabel
// text: "-"
// }
Layout.fillWidth: true
Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
}
// Layout.fillWidth: true
// Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
// }
}
}
@@ -230,9 +230,9 @@ Item {
avgBatteryTemperatureLabel.text = MathHelper.roundDouble(values.tempBattAverage)
minBatteryTemperatureLabel.text = MathHelper.roundDouble(values.tempBattLow)
maxBmsTemperatureLabel.text = MathHelper.roundDouble(values.tempBMSHigh)
avgBmsTemperatureLabel.text = MathHelper.roundDouble(values.tempBMSAverage)
minBmsTemperatureLabel.text = MathHelper.roundDouble(values.tempBMSLow)
// maxBmsTemperatureLabel.text = MathHelper.roundDouble(values.tempBMSHigh)
// avgBmsTemperatureLabel.text = MathHelper.roundDouble(values.tempBMSAverage)
// minBmsTemperatureLabel.text = MathHelper.roundDouble(values.tempBMSLow)
}
onAuxReceived: {

Binary file not shown.

View File

@@ -317,11 +317,6 @@
<source>Lower enable threshold (should be higher than disable), V</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/Screens/BmsSettingsScreen.qml" line="397"/>
<source>Upper enable threshold (should be higher than disable), V</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/Screens/BmsSettingsScreen.qml" line="433"/>
<location filename="../qml/Screens/BmsSettingsScreen.qml" line="868"/>
@@ -478,6 +473,11 @@ Wait, please.</source>
<source>Battery sensors mask for slave board #</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/Screens/BmsSettingsScreen.qml" line="397"/>
<source>Upper enable threshold (should be lower than disable), V</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/Screens/BmsSettingsScreen.qml" line="551"/>
<source>Calibrate &quot;0&quot;</source>

Binary file not shown.

View File

@@ -317,11 +317,6 @@
<source>Lower enable threshold (should be higher than disable), V</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/Screens/BmsSettingsScreen.qml" line="397"/>
<source>Upper enable threshold (should be higher than disable), V</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/Screens/BmsSettingsScreen.qml" line="433"/>
<location filename="../qml/Screens/BmsSettingsScreen.qml" line="868"/>
@@ -478,6 +473,11 @@ Wait, please.</source>
<source>Battery sensors mask for slave board #</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/Screens/BmsSettingsScreen.qml" line="397"/>
<source>Upper enable threshold (should be lower than disable), V</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/Screens/BmsSettingsScreen.qml" line="551"/>
<source>Calibrate &quot;0&quot;</source>

Binary file not shown.

View File

@@ -350,9 +350,8 @@
<translation>Нижний порог включения (должен быть выше отключения), В</translation>
</message>
<message>
<location filename="../qml/Screens/BmsSettingsScreen.qml" line="397"/>
<source>Upper enable threshold (should be higher than disable), V</source>
<translation>Верхний порог включения (должен быть выше отключения), В</translation>
<translation type="vanished">Верхний порог включения (должен быть выше отключения), В</translation>
</message>
<message>
<location filename="../qml/Screens/BmsSettingsScreen.qml" line="433"/>
@@ -523,6 +522,11 @@ Wait, please.</source>
<source>Battery sensors mask for slave board #</source>
<translation>Маска сенсоров батареи для дополнительной платы </translation>
</message>
<message>
<location filename="../qml/Screens/BmsSettingsScreen.qml" line="397"/>
<source>Upper enable threshold (should be lower than disable), V</source>
<translation>Верхний порог включения (должен быть ниже отключения), В</translation>
</message>
<message>
<location filename="../qml/Screens/BmsSettingsScreen.qml" line="551"/>
<source>Calibrate &quot;0&quot;</source>