diff --git a/commands.cpp b/commands.cpp index b0bada185..c4735f70f 100755 --- a/commands.cpp +++ b/commands.cpp @@ -722,6 +722,10 @@ void Commands::processPacket(QByteArray data) val.wh_cnt_dis_total = vb.vbPopFrontDouble32Auto(); } + if (vb.size() >= 2) { + val.pressure = vb.vbPopFrontDouble16(1e-1); + } + val.updateTimeStamp(); emit bmsValuesRx(val); diff --git a/datatypes.h b/datatypes.h index 4f2a3680c..8db4abe59 100644 --- a/datatypes.h +++ b/datatypes.h @@ -727,6 +727,7 @@ struct BMS_VALUES { Q_PROPERTY(QVector is_balancing MEMBER is_balancing) Q_PROPERTY(double temp_ic MEMBER temp_ic) Q_PROPERTY(double humidity MEMBER humidity) + Q_PROPERTY(double pressure MEMBER pressure) Q_PROPERTY(double temp_hum_sensor MEMBER temp_hum_sensor) Q_PROPERTY(double temp_cells_highest MEMBER temp_cells_highest) Q_PROPERTY(double soc MEMBER soc) @@ -746,6 +747,7 @@ struct BMS_VALUES { ah_cnt = 0.0; wh_cnt = 0.0; humidity = 0.0; + pressure = 0.0; temp_hum_sensor = 0.0; temp_cells_highest = 0.0; soc = 0.0; @@ -784,6 +786,7 @@ struct BMS_VALUES { QVector is_balancing; double temp_ic; double humidity; + double pressure; double temp_hum_sensor; double temp_cells_highest; double soc; diff --git a/mobile/BMS.qml b/mobile/BMS.qml index 021d7a936..8263a86be 100644 --- a/mobile/BMS.qml +++ b/mobile/BMS.qml @@ -346,10 +346,10 @@ Item { "Wh Cnt : " + parseFloat(val.wh_cnt).toFixed(2) + " Wh\n" + "Power : " + parseFloat(val.v_tot * val.i_in_ic).toFixed(2) + " W\n" + "Humidity : " + parseFloat(val.humidity).toFixed(1) + " %\n" + + "Pressure : " + parseFloat(val.pressure).toFixed(0) + " Pa\n" + "Temp Hum : " + parseFloat(val.temp_hum_sensor).toFixed(1) + " \u00B0C\n" + "Temp Max : " + parseFloat(val.temp_cells_highest).toFixed(1) + " \u00B0C\n" + "SoC : " + parseFloat(val.soc * 100).toFixed(1) + " %\n" + - "SoH : " + parseFloat(val.soh * 100).toFixed(1) + " %\n" + "Ah Chg Tot : " + parseFloat(val.ah_cnt_chg_total).toFixed(3) + " Ah" cellCanvas.requestPaint() diff --git a/pages/pagebms.cpp b/pages/pagebms.cpp index e590337c5..9d24506b9 100644 --- a/pages/pagebms.cpp +++ b/pages/pagebms.cpp @@ -126,11 +126,12 @@ void PageBms::bmsValuesRx(BMS_VALUES val) ui->valTable->item(8, 0)->setText(QString("%1 %").arg(val.soh * 100.0, 0, 'f', 0)); ui->valTable->item(9, 0)->setText(QString("%1 °C").arg(val.temp_cells_highest, 0, 'f', 2)); ui->valTable->item(10, 0)->setText(QString("%1 %").arg(val.humidity, 0, 'f', 2)); - ui->valTable->item(11, 0)->setText(QString("%1 °C").arg(val.temp_hum_sensor, 0, 'f', 2)); - ui->valTable->item(12, 0)->setText(QString("%1 Ah").arg(val.ah_cnt_chg_total, 0, 'f', 3)); - ui->valTable->item(13, 0)->setText(QString("%1 Wh").arg(val.wh_cnt_chg_total, 0, 'f', 3)); - ui->valTable->item(14, 0)->setText(QString("%1 Ah").arg(val.ah_cnt_dis_total, 0, 'f', 3)); - ui->valTable->item(15, 0)->setText(QString("%1 Wh").arg(val.wh_cnt_dis_total, 0, 'f', 3)); + ui->valTable->item(11, 0)->setText(QString("%1 Pa").arg(val.pressure, 0, 'f', 0)); + ui->valTable->item(12, 0)->setText(QString("%1 °C").arg(val.temp_hum_sensor, 0, 'f', 2)); + ui->valTable->item(13, 0)->setText(QString("%1 Ah").arg(val.ah_cnt_chg_total, 0, 'f', 3)); + ui->valTable->item(14, 0)->setText(QString("%1 Wh").arg(val.wh_cnt_chg_total, 0, 'f', 3)); + ui->valTable->item(15, 0)->setText(QString("%1 Ah").arg(val.ah_cnt_dis_total, 0, 'f', 3)); + ui->valTable->item(16, 0)->setText(QString("%1 Wh").arg(val.wh_cnt_dis_total, 0, 'f', 3)); } void PageBms::reloadCellBars(int cells) diff --git a/pages/pagebms.ui b/pages/pagebms.ui index fc9045050..f45a3492c 100644 --- a/pages/pagebms.ui +++ b/pages/pagebms.ui @@ -137,6 +137,11 @@ Humidity + + + Pressure + + Temp Hum Sensor @@ -247,6 +252,11 @@ + + + + +