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

View File

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

Binary file not shown.

View File

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

Binary file not shown.

View File

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