Ver Fonte

1.3版本

Franike há 7 meses atrás
pai
commit
394497b503
9 ficheiros alterados com 189 adições e 98 exclusões
  1. 8 8
      controller/bms_home_ctl.py
  2. 19 1
      controller/bms_protect_ctl.py
  3. 1 1
      start.py
  4. 6 2
      ui/balance.py
  5. 8 2
      ui/home.py
  6. 92 48
      ui/main/top_page.py
  7. 1 1
      ui/main/under_page.py
  8. 49 35
      ui/protect.py
  9. 5 0
      widget/bms_protect.py

+ 8 - 8
controller/bms_home_ctl.py

@@ -810,8 +810,8 @@ class BmsHomeControll:
             # 最低单体温度值
             self.bms_main_ctl._view.top_widget.lb_l_temp_value.setText(str(round((data[5] << 8 | data[4]) * 0.1 - 40, 1)))
             self._model.min_cell_temp = round((data[5] << 8 | data[4]) * 0.1 - 40, 1)
-            # # 最低单体温度所在编号
-            # self.bms_main_ctl._view.top_widget.lb_tcelllv_index_value.setText(str(data[7] << 8 | data[6]))
+            # 最低单体温度所在编号
+            self.bms_main_ctl._view.top_widget.lb_l_temp_index_value.setText(str(data[7] << 8 | data[6]))
             self._model.min_cell_temp_id = data[7] << 8 | data[6]
 
         # 最高单体温度值
@@ -1033,7 +1033,7 @@ class BmsHomeControll:
 
                 self._model.cell_temp = self.cell_single_temp
 
-    # to do
+
     def _inf_0011_signal(self, data, id):
         if id == SD.BCU_ID:
             # 最高单体电压所在从控编号
@@ -1048,11 +1048,11 @@ class BmsHomeControll:
             self.bms_main_ctl._view.top_widget.lb_tcelllv_slave_index_value.setText(str(data[4]))
             # 最低单体电压所在从控内编号
             self.bms_main_ctl._view.top_widget.lb_tcelllv_in_index_value.setText(str(data[5]))
-            # to do
-            # # 最低单体温度所在从控编号
-            # self.bms_main_ctl._view.top_widget.lb_l_temp_slave_index_value.setText(str(data[6]))
-            # # 最低单体温度所在从控内编号
-            # self.bms_main_ctl._view.top_widget.lb_h_temp_in_index_value.setText(str(data[7]))
+            # 最低单体温度所在从控编号
+            self.bms_main_ctl._view.top_widget.lb_l_temp_slave_index_value.setText(str(data[6]))
+            # 最低单体温度所在从控内编号
+            self.bms_main_ctl._view.top_widget.lb_l_temp_in_index_value.setText(str(data[7]))
+
 
     def _inf_0012_signal(self, data, id):
         if id == SD.BCU_ID:

+ 19 - 1
controller/bms_protect_ctl.py

@@ -16,6 +16,7 @@ class BmsProtectControll:
         self._view.read_param_signal.connect(self._read_param)
         self._view.write_param_signal.connect(self._write_param)
         self._view.exit_param_signal.connect(self._exit_param)
+        self._view.reset_param_signal.connect(self._reset_param)
         
 
     def _read_param(self):
@@ -64,7 +65,7 @@ class BmsProtectControll:
             data = []
             if len(data) < 8:
                 data += (8 - len(data)) * [0]
-            data[0] = 3
+            data[0] = 0xEE
             data[1] = 0xFF
             data[6] = self.i
             self.i = self.i + 1
@@ -74,3 +75,20 @@ class BmsProtectControll:
             msg = SD.CAN_CONTROL.send((0x18 << 24) | (SD.BCU_ID << 16) | 0x1801, data)
         except:
             self._view.can_connect_error()
+
+
+    def _reset_param(self):
+        try:
+            data = []
+            if len(data) < 8:
+                data += (8 - len(data)) * [0]
+            data[0] = 3
+            data[1] = 0xFF
+            data[6] = self.i
+            self.i = self.i + 1
+            if self.i == 255:
+                self.i = 0
+            data[7] = data[0] + data[1] + data[2] + data[3] + data[4] + data[5] + data[6]
+            msg = SD.CAN_CONTROL.send((0x18 << 24) | (SD.BCU_ID << 16) | 0x1801, data)
+        except:
+            self._view.can_connect_error()

+ 1 - 1
start.py

@@ -22,7 +22,7 @@ def bms_start():
     # 主版本号
     SD.MAJOR_VERSION_NUMBER = 1
     # 子版本号
-    SD.MINOR_VERSION_NUMBER = 2
+    SD.MINOR_VERSION_NUMBER = 3
     # 修正版本号
     SD.REVISION_NUMBER = "0-build_test"
 

+ 6 - 2
ui/balance.py

@@ -26,6 +26,7 @@ class Balance(MyFrame):
         for i in range(15):
             bmu_label = QtWidgets.QLabel("CMU" + str(i + 1))
             bmu_label.setAlignment(Qt.AlignCenter)
+            bmu_label.setFixedWidth(50)
             self.line_qscrollarea_layout.addWidget(bmu_label, i, 0, 1, 1)
         for i in range(15):
             for j in range(72):
@@ -111,6 +112,7 @@ class Balance(MyFrame):
         for i in range(15):
             bmu_label = QtWidgets.QLabel("CMU" + str(i + 1))
             bmu_label.setAlignment(Qt.AlignCenter)
+            bmu_label.setFixedWidth(50)
             self.on_off_qscrollarea_layout.addWidget(bmu_label, i, 0, 1, 1)
         for i in range(15):
             for j in range(72):
@@ -198,6 +200,7 @@ class Balance(MyFrame):
         for i in range(15):
             bmu_label = QtWidgets.QLabel("CMU" + str(i + 1))
             bmu_label.setAlignment(Qt.AlignCenter)
+            bmu_label.setFixedWidth(50)
             self.balance_control_qscrollarea_layout.addWidget(bmu_label, i, 0, 1, 1)
         for i in range(15):
             for j in range(72):
@@ -235,10 +238,11 @@ class Balance(MyFrame):
         for i in range(15):
             bmu_label = QtWidgets.QLabel("CMU" + str(i + 1))
             bmu_label.setAlignment(Qt.AlignCenter)
+            bmu_label.setFixedWidth(50)
             self.balance_fault_qscrollarea_layout.addWidget(bmu_label, i, 0, 1, 1)
         for i in range(15):
-            for j in range(72):
-                qbalance_fault_lebal = QtWidgets.QLineEdit("C" + str(j + 1))
+            for j in range(8):
+                qbalance_fault_lebal = QtWidgets.QLineEdit("AFE" + str(j + 1))
                 qbalance_fault_lebal.setAlignment(Qt.AlignCenter)
                 qbalance_fault_lebal.setReadOnly(True)
                 qbalance_fault_lebal.setFixedWidth(50)

+ 8 - 2
ui/home.py

@@ -9,12 +9,18 @@ from utils.resource import resource_path
 
 class UiBmsHomePage(object):
     def setupUi(self, main):
-        main.resize(1366, 768)
-        main.setMinimumSize(1366, 768)
+        # main.resize(1366, 768)
+        # main.setMinimumSize(1366, 768)
 
         # main.resize(1920, 1080)
         # main.setMinimumSize(1920, 1080)
 
+        # main.resize(1280, 720)
+        # main.setMinimumSize(1280, 720)
+
+        main.resize(1440, 900)
+        main.setMinimumSize(1440, 900)
+
         set_my_palette(main)
 
         self.central_widget = QWidget(main)

+ 92 - 48
ui/main/top_page.py

@@ -24,7 +24,7 @@ class TopPage(QtWidgets.QWidget):
         self.top_layout.setContentsMargins(0, 0, 0, 0)
         self.top_layout.setSpacing(0)
         self.top_groupbox = QtWidgets.QGroupBox(self.top_widget)
-        self.top_groupbox.setTitle("参数配置")
+        self.top_groupbox.setTitle("系统信息")
         self.top_groupbox_layout = QtWidgets.QHBoxLayout(self.top_groupbox)
 
         self.top_qscrollarea = QtWidgets.QScrollArea(self.top_groupbox)
@@ -50,7 +50,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_tv = QtWidgets.QLabel(self.tv)
         self.lb_tv.setText("V")
         self.tv_layout.addWidget(self.lb_tv)
-        self.top_qscrollarea_layout.addWidget(self.tv, 0, 0, 1, 1)
 
         self.tcur = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.tcur.setTitle("电流")
@@ -61,7 +60,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_tcur = QtWidgets.QLabel(self.tcur)
         self.lb_tcur.setText("A")
         self.tcur_layout.addWidget(self.lb_tcur)
-        self.top_qscrollarea_layout.addWidget(self.tcur, 0, 1, 1, 1)
 
         self.tsoc = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.tsoc.setTitle("SOC")
@@ -72,7 +70,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_soc = QtWidgets.QLabel(self.tsoc)
         self.lb_soc.setText("%")
         self.soc_layout.addWidget(self.lb_soc)
-        self.top_qscrollarea_layout.addWidget(self.tsoc, 0, 2, 1, 1)
 
         self.tsoh = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.tsoh.setTitle("SOH")
@@ -83,7 +80,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_tsoh = QtWidgets.QLabel(self.tsoh)
         self.lb_tsoh.setText("%")
         self.tsoh_layout.addWidget(self.lb_tsoh)
-        self.top_qscrollarea_layout.addWidget(self.tsoh, 0, 3, 1, 1)
 
         self.tsoe = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.tsoe.setTitle("SOE")
@@ -94,7 +90,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_tsoe = QtWidgets.QLabel(self.tsoe)
         self.lb_tsoe.setText("%")
         self.tsoe_layout.addWidget(self.lb_tsoe)
-        self.top_qscrollarea_layout.addWidget(self.tsoe, 0, 4, 1, 1)
 
         self.tcellhv = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.tcellhv.setTitle("单体最高电压")
@@ -105,7 +100,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_tcellhv = QtWidgets.QLabel(self.tcellhv)
         self.lb_tcellhv.setText("mV")
         self.tcellhv_layout.addWidget(self.lb_tcellhv)
-        self.top_qscrollarea_layout.addWidget(self.tcellhv, 0, 5, 1, 1)
 
         self.tcelllv = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.tcelllv.setTitle("单体最低电压")
@@ -116,7 +110,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_tcelllv = QtWidgets.QLabel(self.tcelllv)
         self.lb_tcelllv.setText("mV")
         self.tcelllv_layout.addWidget(self.lb_tcelllv)
-        self.top_qscrollarea_layout.addWidget(self.tcelllv, 0, 6, 1, 1)
 
         self.tcellhv_index = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.tcellhv_index.setTitle("最高单体电压编号")
@@ -127,7 +120,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_tcellhv_index = QtWidgets.QLabel(self.tcellhv_index)
         self.lb_tcellhv_index.setText("")
         self.tcellhv_index_layout.addWidget(self.lb_tcellhv_index)
-        self.top_qscrollarea_layout.addWidget(self.tcellhv_index, 0, 7, 1, 1)
 
         self.tcellhv_slave_index = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.tcellhv_slave_index.setTitle("最高单体电压从控编号")
@@ -138,7 +130,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_tcellhv_slave_index = QtWidgets.QLabel(self.tcellhv_slave_index)
         self.lb_tcellhv_slave_index.setText("")
         self.tcellhv_slave_index_layout.addWidget(self.lb_tcellhv_slave_index)
-        self.top_qscrollarea_layout.addWidget(self.tcellhv_slave_index, 0, 8, 1, 1)
 
         self.tcellhv_in_index = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.tcellhv_in_index.setTitle("最高单体电压从控内编号")
@@ -149,7 +140,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_tcellhv_in_index = QtWidgets.QLabel(self.tcellhv_in_index)
         self.lb_tcellhv_in_index.setText("")
         self.tcellhv_in_index_layout.addWidget(self.lb_tcellhv_in_index)
-        self.top_qscrollarea_layout.addWidget(self.tcellhv_in_index, 0, 9, 1, 1)
 
         self.tcelllv_index = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.tcelllv_index.setTitle("最低单体电压编号")
@@ -160,7 +150,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_tcelllv_index = QtWidgets.QLabel(self.tcelllv_index)
         self.lb_tcelllv_index.setText("")
         self.tcelllv_index_layout.addWidget(self.lb_tcelllv_index)
-        self.top_qscrollarea_layout.addWidget(self.tcelllv_index, 1, 0, 1, 1)
 
         self.tcelllv_slave_index = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.tcelllv_slave_index.setTitle("最低单体电压从控编号")
@@ -171,7 +160,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_tcelllv_slave_index = QtWidgets.QLabel(self.tcelllv_slave_index)
         self.lb_tcelllv_slave_index.setText("")
         self.tcelllv_slave_index_layout.addWidget(self.lb_tcelllv_slave_index)
-        self.top_qscrollarea_layout.addWidget(self.tcelllv_slave_index, 1, 1, 1, 1)
 
         self.tcelllv_in_index = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.tcelllv_in_index.setTitle("最低单体电压从控内编号")
@@ -182,7 +170,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_tcelllv_in_index = QtWidgets.QLabel(self.tcelllv_in_index)
         self.lb_tcelllv_in_index.setText("")
         self.tcelllv_in_index_layout.addWidget(self.lb_tcelllv_in_index)
-        self.top_qscrollarea_layout.addWidget(self.tcelllv_in_index, 1, 2, 1, 1)
 
         self.avg_vol = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.avg_vol.setTitle("平均电压")
@@ -193,7 +180,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_avg_vol = QtWidgets.QLabel(self.avg_vol)
         self.lb_avg_vol.setText("mV")
         self.avg_vol_layout.addWidget(self.lb_avg_vol)
-        self.top_qscrollarea_layout.addWidget(self.avg_vol, 1, 3, 1, 1)
 
         self.diff_vol = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.diff_vol.setTitle("单体最大压差")
@@ -204,7 +190,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_diff_vol = QtWidgets.QLabel(self.diff_vol)
         self.lb_diff_vol.setText("mV")
         self.diff_vol_layout.addWidget(self.lb_diff_vol)
-        self.top_qscrollarea_layout.addWidget(self.diff_vol, 1, 4, 1, 1)
 
         self.h_temp = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.h_temp.setTitle("最高电池温度")
@@ -215,7 +200,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_h_temp = QtWidgets.QLabel(self.h_temp)
         self.lb_h_temp.setText("℃")
         self.h_temp_layout.addWidget(self.lb_h_temp)
-        self.top_qscrollarea_layout.addWidget(self.h_temp, 1, 5, 1, 1)
 
         self.l_temp = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.l_temp.setTitle("最低电池温度")
@@ -226,7 +210,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_l_temp = QtWidgets.QLabel(self.l_temp)
         self.lb_l_temp.setText("℃")
         self.l_temp_layout.addWidget(self.lb_l_temp)
-        self.top_qscrollarea_layout.addWidget(self.l_temp, 1, 6, 1, 1)
 
         self.h_temp_index = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.h_temp_index.setTitle("最高单体温度编号")
@@ -237,7 +220,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_h_temp_index = QtWidgets.QLabel(self.h_temp_index)
         self.lb_h_temp_index.setText("")
         self.h_temp_index_layout.addWidget(self.lb_h_temp_index)
-        self.top_qscrollarea_layout.addWidget(self.h_temp_index, 1, 7, 1, 1)
 
         self.h_temp_slave_index = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.h_temp_slave_index.setTitle("最高单体温度从控编号")
@@ -248,7 +230,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_h_temp_slave_index = QtWidgets.QLabel(self.h_temp_slave_index)
         self.lb_h_temp_slave_index.setText("")
         self.h_temp_slave_index_layout.addWidget(self.lb_h_temp_slave_index)
-        self.top_qscrollarea_layout.addWidget(self.h_temp_slave_index, 1, 8, 1, 1)
 
         self.h_temp_in_index = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.h_temp_in_index.setTitle("最高单体温度从控内编号")
@@ -259,7 +240,36 @@ class TopPage(QtWidgets.QWidget):
         self.lb_h_temp_in_index = QtWidgets.QLabel(self.h_temp_in_index)
         self.lb_h_temp_in_index.setText("")
         self.h_temp_in_index_layout.addWidget(self.lb_h_temp_in_index)
-        self.top_qscrollarea_layout.addWidget(self.h_temp_in_index, 1, 9, 1, 1)
+
+        self.l_temp_index = QtWidgets.QGroupBox(self.top_qscrollarea)
+        self.l_temp_index.setTitle("最低单体温度编号")
+        self.l_temp_index_layout = QtWidgets.QHBoxLayout(self.l_temp_index)
+        self.lb_l_temp_index_value = QtWidgets.QLabel(self.l_temp_index)
+        self.lb_l_temp_index_value.setText("    ")
+        self.l_temp_index_layout.addWidget(self.lb_l_temp_index_value)
+        self.lb_l_temp_index = QtWidgets.QLabel(self.l_temp_index)
+        self.lb_l_temp_index.setText("")
+        self.l_temp_index_layout.addWidget(self.lb_l_temp_index)
+
+        self.l_temp_in_index = QtWidgets.QGroupBox(self.top_qscrollarea)
+        self.l_temp_in_index.setTitle("最低单体温度从控内编号")
+        self.l_temp_in_index_layout = QtWidgets.QHBoxLayout(self.l_temp_in_index)
+        self.lb_l_temp_in_index_value = QtWidgets.QLabel(self.l_temp_in_index)
+        self.lb_l_temp_in_index_value.setText("    ")
+        self.l_temp_in_index_layout.addWidget(self.lb_l_temp_in_index_value)
+        self.lb_l_temp_in_index = QtWidgets.QLabel(self.l_temp_in_index)
+        self.lb_l_temp_in_index.setText("")
+        self.l_temp_in_index_layout.addWidget(self.lb_l_temp_in_index)
+
+        self.l_temp_slave_index = QtWidgets.QGroupBox(self.top_qscrollarea)
+        self.l_temp_slave_index.setTitle("最低单体温度从控编号")
+        self.l_temp_slave_index_layout = QtWidgets.QHBoxLayout(self.l_temp_slave_index)
+        self.lb_l_temp_slave_index_value = QtWidgets.QLabel(self.l_temp_slave_index)
+        self.lb_l_temp_slave_index_value.setText("    ")
+        self.l_temp_slave_index_layout.addWidget(self.lb_l_temp_slave_index_value)
+        self.lb_l_temp_slave_index = QtWidgets.QLabel(self.l_temp_slave_index)
+        self.lb_l_temp_slave_index.setText("")
+        self.l_temp_slave_index_layout.addWidget(self.lb_l_temp_slave_index)
 
         self.avg_temp = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.avg_temp.setTitle("平均温度")
@@ -269,10 +279,9 @@ class TopPage(QtWidgets.QWidget):
         self.avg_temp_layout.addWidget(self.lb_avg_temp_value)
         self.lb_avg_temp = QtWidgets.QLabel("℃")
         self.avg_temp_layout.addWidget(self.lb_avg_temp)
-        self.top_qscrollarea_layout.addWidget(self.avg_temp, 2, 0, 1, 1)
 
         self.diff_temp = QtWidgets.QGroupBox(self.top_qscrollarea)
-        self.diff_temp.setTitle("单体最大温差")
+        self.diff_temp.setTitle("单体最大温差        ")
         self.diff_temp_layout = QtWidgets.QHBoxLayout(self.diff_temp)
         self.lb_diff_temp_value = QtWidgets.QLabel(self.diff_temp)
         self.lb_diff_temp_value.setText("    ")
@@ -280,7 +289,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_diff_temp = QtWidgets.QLabel(self.diff_temp)
         self.lb_diff_temp.setText("℃")
         self.diff_temp_layout.addWidget(self.lb_diff_temp)
-        self.top_qscrollarea_layout.addWidget(self.diff_temp, 2, 1, 1, 1)
 
         self.sys_against = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.sys_against.setTitle("系统绝缘阻抗")
@@ -476,7 +484,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_left_energy = QtWidgets.QLabel(self.left_energy)
         self.lb_left_energy.setText("kWh")
         self.left_energy_layout.addWidget(self.lb_left_energy)
-        self.top_qscrollarea_layout.addWidget(self.left_energy, 4, 0, 1, 1)
 
         self.nowday_chg_energy = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.nowday_chg_energy.setTitle("当天累计充电能量")
@@ -487,7 +494,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_nowday_chg_energy = QtWidgets.QLabel(self.nowday_chg_energy)
         self.lb_nowday_chg_energy.setText("kWh")
         self.nowday_chg_energy_layout.addWidget(self.lb_nowday_chg_energy)
-        self.top_qscrollarea_layout.addWidget(self.nowday_chg_energy, 4, 1, 1, 1)
 
         self.nowday_dchg_energy = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.nowday_dchg_energy.setTitle("当天累计放电能量")
@@ -498,7 +504,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_nowday_dchg_energy = QtWidgets.QLabel(self.nowday_dchg_energy)
         self.lb_nowday_dchg_energy.setText("kWh")
         self.nowday_dchg_energy_layout.addWidget(self.lb_nowday_dchg_energy)
-        self.top_qscrollarea_layout.addWidget(self.nowday_dchg_energy, 4, 2, 1, 1)
 
         self.circle_num = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.circle_num.setTitle("循环次数")
@@ -509,7 +514,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_circle_num = QtWidgets.QLabel(self.circle_num)
         self.lb_circle_num.setText("")
         self.circle_num_layout.addWidget(self.lb_circle_num)
-        self.top_qscrollarea_layout.addWidget(self.circle_num, 4, 3, 1, 1)
 
         self.gdcy_vol = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.gdcy_vol.setTitle("供电采样电压")
@@ -520,7 +524,6 @@ class TopPage(QtWidgets.QWidget):
         self.lb_gdcy_vol = QtWidgets.QLabel(self.gdcy_vol)
         self.lb_gdcy_vol.setText("V")
         self.gdcy_vol_layout.addWidget(self.lb_gdcy_vol)
-        self.top_qscrollarea_layout.addWidget(self.gdcy_vol, 4, 4, 1, 1)
 
         self.jz_temp_high = QtWidgets.QGroupBox(self.top_qscrollarea)
         self.jz_temp_high.setTitle("最高极柱温度")
@@ -643,7 +646,7 @@ class TopPage(QtWidgets.QWidget):
         self.afe_temp_high_layout.addWidget(self.lb_afe_temp_high)
 
         self.afe_temp_high_slave = QtWidgets.QGroupBox(self.top_qscrollarea)
-        self.afe_temp_high_slave.setTitle("最高AFE温度所在从控ID")
+        self.afe_temp_high_slave.setTitle("最高AFE温度从控ID")
         self.afe_temp_high_slave_layout = QtWidgets.QHBoxLayout(self.afe_temp_high_slave)
         self.lb_afe_temp_high_slave_value = QtWidgets.QLabel(self.afe_temp_high_slave)
         self.lb_afe_temp_high_slave_value.setText("    ")
@@ -653,7 +656,7 @@ class TopPage(QtWidgets.QWidget):
         self.afe_temp_high_slave_layout.addWidget(self.lb_afe_temp_high_slave)
 
         self.afe_temp_high_slave_in = QtWidgets.QGroupBox(self.top_qscrollarea)
-        self.afe_temp_high_slave_in.setTitle("最高AFE温度所在从控内编号")
+        self.afe_temp_high_slave_in.setTitle("最高AFE温度从控内编号")
         self.afe_temp_high_slave_in_layout = QtWidgets.QHBoxLayout(self.afe_temp_high_slave_in)
         self.lb_afe_temp_high_slave_in_value = QtWidgets.QLabel(self.afe_temp_high_slave_in)
         self.lb_afe_temp_high_slave_in_value.setText("    ")
@@ -673,7 +676,7 @@ class TopPage(QtWidgets.QWidget):
         self.afe_temp_low_layout.addWidget(self.lb_afe_temp_low)
 
         self.afe_temp_low_slave = QtWidgets.QGroupBox(self.top_qscrollarea)
-        self.afe_temp_low_slave.setTitle("最低AFE温度所在从控ID")
+        self.afe_temp_low_slave.setTitle("最低AFE温度从控ID")
         self.afe_temp_low_slave_layout = QtWidgets.QHBoxLayout(self.afe_temp_low_slave)
         self.lb_afe_temp_low_slave_value = QtWidgets.QLabel(self.afe_temp_low_slave)
         self.lb_afe_temp_low_slave_value.setText("    ")
@@ -683,7 +686,7 @@ class TopPage(QtWidgets.QWidget):
         self.afe_temp_low_slave_layout.addWidget(self.lb_afe_temp_low_slave)
 
         self.afe_temp_low_slave_in = QtWidgets.QGroupBox(self.top_qscrollarea)
-        self.afe_temp_low_slave_in.setTitle("最低AFE温度所在从控内编号")
+        self.afe_temp_low_slave_in.setTitle("最低AFE温度从控内编号")
         self.afe_temp_low_slave_in_layout = QtWidgets.QHBoxLayout(self.afe_temp_low_slave_in)
         self.lb_afe_temp_low_slave_in_value = QtWidgets.QLabel(self.afe_temp_low_slave_in)
         self.lb_afe_temp_low_slave_in_value.setText("    ")
@@ -692,11 +695,41 @@ class TopPage(QtWidgets.QWidget):
         self.lb_afe_temp_low_slave_in.setText("")
         self.afe_temp_low_slave_in_layout.addWidget(self.lb_afe_temp_low_slave_in)
 
+        self.top_qscrollarea_layout.addWidget(self.tv, 0, 0, 1, 1)
+        self.top_qscrollarea_layout.addWidget(self.tcur, 0, 1, 1, 1)
+        self.top_qscrollarea_layout.addWidget(self.tsoc, 0, 2, 1, 1)
+        self.top_qscrollarea_layout.addWidget(self.tsoh, 0, 3, 1, 1)
+        self.top_qscrollarea_layout.addWidget(self.tsoe, 0, 4, 1, 1)
+        self.top_qscrollarea_layout.addWidget(self.tcellhv, 0, 5, 1, 1)
+        self.top_qscrollarea_layout.addWidget(self.tcelllv, 0, 6, 1, 1)
+        self.top_qscrollarea_layout.addWidget(self.h_temp, 0, 7, 1, 1)
+        self.top_qscrollarea_layout.addWidget(self.l_temp, 0, 8, 1, 1)
+        self.top_qscrollarea_layout.addWidget(self.avg_temp, 0, 9, 1, 1)
+
+        self.top_qscrollarea_layout.addWidget(self.diff_temp, 1, 0, 1, 1)
+        self.top_qscrollarea_layout.addWidget(self.tcellhv_index, 1, 1, 1, 1)
+        self.top_qscrollarea_layout.addWidget(self.tcellhv_slave_index, 1, 2, 1, 1)
+        self.top_qscrollarea_layout.addWidget(self.tcellhv_in_index, 1, 3, 1, 1)
+        self.top_qscrollarea_layout.addWidget(self.tcelllv_index, 1, 4, 1, 1)
+        self.top_qscrollarea_layout.addWidget(self.tcelllv_slave_index, 1, 5, 1, 1)
+        self.top_qscrollarea_layout.addWidget(self.tcelllv_in_index, 1, 6, 1, 1)
+        self.top_qscrollarea_layout.addWidget(self.h_temp_index, 1, 7, 1, 1)
+        self.top_qscrollarea_layout.addWidget(self.h_temp_slave_index, 1, 8, 1, 1)
+        self.top_qscrollarea_layout.addWidget(self.h_temp_in_index, 1, 9, 1, 1)
+        self.top_qscrollarea_layout.addWidget(self.avg_vol, 2, 0, 1, 1)
+        self.top_qscrollarea_layout.addWidget(self.diff_vol, 2, 1, 1, 1)
+
+
         if SD.CCU_TYPE == 1:
             self.top_qscrollarea_layout.addWidget(self.tv_2, 3, 6, 1, 1)
             self.top_qscrollarea_layout.addWidget(self.tv_3, 3, 7, 1, 1)
             self.top_qscrollarea_layout.addWidget(self.nom_energy, 3, 8, 1, 1)
             self.top_qscrollarea_layout.addWidget(self.all_energy, 3, 9, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.left_energy, 4, 0, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.nowday_chg_energy, 4, 1, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.nowday_dchg_energy, 4, 2, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.circle_num, 4, 3, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.gdcy_vol, 4, 4, 1, 1)
             self.top_qscrollarea_layout.addWidget(self.jz_temp_high, 4, 5, 1, 1)
             self.top_qscrollarea_layout.addWidget(self.jz_temp_high_index, 4, 6, 1, 1)
             self.top_qscrollarea_layout.addWidget(self.bcu_temp_high, 4, 7, 1, 1)
@@ -706,13 +739,16 @@ class TopPage(QtWidgets.QWidget):
             self.top_qscrollarea_layout.addWidget(self.soc_high, 5, 1, 1, 1)
             self.top_qscrollarea_layout.addWidget(self.soc_low, 5, 2, 1, 1)
             self.top_qscrollarea_layout.addWidget(self.soc_avg, 5, 3, 1, 1)
-            self.top_qscrollarea_layout.addWidget(self.max_dchg_vol, 5, 4, 1, 1)
-            self.top_qscrollarea_layout.addWidget(self.afe_temp_high, 5, 5, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.afe_temp_high, 5, 4, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.afe_temp_low, 5, 5, 1, 1)
             self.top_qscrollarea_layout.addWidget(self.afe_temp_high_slave, 5, 6, 1, 1)
             self.top_qscrollarea_layout.addWidget(self.afe_temp_high_slave_in, 5, 7, 1, 1)
-            self.top_qscrollarea_layout.addWidget(self.afe_temp_low, 5, 8, 1, 1)
-            self.top_qscrollarea_layout.addWidget(self.afe_temp_low_slave, 5, 9, 1, 1)
-            self.top_qscrollarea_layout.addWidget(self.afe_temp_low_slave_in, 6, 0, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.afe_temp_low_slave, 5, 8, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.afe_temp_low_slave_in, 5, 9, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.max_dchg_vol, 6, 0, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.l_temp_in_index, 6, 1, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.l_temp_index, 6, 2, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.l_temp_slave_index, 6, 3, 1, 1)
         else:
             self.tv_2.setHidden(True)
             self.tv_3.setHidden(True)
@@ -724,15 +760,23 @@ class TopPage(QtWidgets.QWidget):
             self.top_qscrollarea_layout.addWidget(self.all_energy, 3, 7, 1, 1)
             self.top_qscrollarea_layout.addWidget(self.mos_temp_1, 3, 8, 1, 1)
             self.top_qscrollarea_layout.addWidget(self.mos_temp_2, 3, 9, 1, 1)
-            self.top_qscrollarea_layout.addWidget(self.soc_high, 4, 5, 1, 1)
-            self.top_qscrollarea_layout.addWidget(self.soc_low, 4, 6, 1, 1)
-            self.top_qscrollarea_layout.addWidget(self.soc_avg, 4, 7, 1, 1)
-            self.top_qscrollarea_layout.addWidget(self.max_dchg_vol, 4, 8, 1, 1)
-            self.top_qscrollarea_layout.addWidget(self.afe_temp_high, 4, 9, 1, 1)
-            self.top_qscrollarea_layout.addWidget(self.afe_temp_high_slave, 5, 0, 1, 1)
-            self.top_qscrollarea_layout.addWidget(self.afe_temp_high_slave_in, 5, 1, 1, 1)
-            self.top_qscrollarea_layout.addWidget(self.afe_temp_low, 5, 2, 1, 1)
-            self.top_qscrollarea_layout.addWidget(self.afe_temp_low_slave, 5, 3, 1, 1)
-            self.top_qscrollarea_layout.addWidget(self.afe_temp_low_slave_in, 5, 4, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.max_dchg_vol, 4, 0, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.afe_temp_high, 4, 1, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.afe_temp_high_slave, 4, 2, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.afe_temp_high_slave_in, 4, 3, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.left_energy, 4, 4, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.afe_temp_low, 4, 5, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.afe_temp_low_slave, 4, 6, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.afe_temp_low_slave_in, 4, 7, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.nowday_chg_energy, 4, 8, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.nowday_dchg_energy, 4, 9, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.l_temp_index, 5, 0, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.l_temp_slave_index, 5, 1, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.l_temp_in_index, 5, 2, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.circle_num, 5, 3, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.gdcy_vol, 5, 4, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.soc_high, 5, 5, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.soc_low, 5, 6, 1, 1)
+            self.top_qscrollarea_layout.addWidget(self.soc_avg, 5, 7, 1, 1)
         self.top_layout.addWidget(self.top_groupbox)
         self.verticalLayout.addWidget(self.top_widget)

+ 1 - 1
ui/main/under_page.py

@@ -42,7 +42,7 @@ class UnderPage(QtWidgets.QWidget):
         # self.under_left_groupbox_layout.addItem(spacerItem1)
 
         self.sys_status_no = QtWidgets.QLineEdit(self.under_left_groupbox)
-        self.sys_status_no.setText("低压上电")
+        self.sys_status_no.setText("上电")
         self.sys_status_no.setAlignment(Qt.AlignCenter)
         self.sys_status_no.setReadOnly(True)
         set_edt_bg(self.sys_status_no, QColor(Qt.gray))

+ 49 - 35
ui/protect.py

@@ -37,9 +37,9 @@ class Protect(MyFrame):
         self.protect_table.verticalHeader().setSectionResizeMode(QtWidgets.QHeaderView.Stretch)
         self.protect_table.horizontalHeader().setSectionResizeMode(QtWidgets.QHeaderView.Stretch)
         self.protect_table.horizontalHeader().setSectionResizeMode(0, QtWidgets.QHeaderView.ResizeToContents)
-        self.protect_table.setRowCount(81)
+        self.protect_table.setRowCount(82)
 
-        for i in range(81):
+        for i in range(82):
             item = QtWidgets.QTableWidgetItem("N/A")
             item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
             self.protect_table.setItem(i, 1, item)
@@ -658,17 +658,18 @@ class Protect(MyFrame):
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(58, 6, item)
 
-        item = QtWidgets.QTableWidgetItem("均衡开启电压")
+        item = QtWidgets.QTableWidgetItem("绝缘过低回差阈值")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(59, 0, item)
-        item = QtWidgets.QTableWidgetItem("mV")
+        item = QtWidgets.QTableWidgetItem("")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(59, 2, item)
         item = QtWidgets.QTableWidgetItem("1")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(59, 6, item)
 
-        item = QtWidgets.QTableWidgetItem("均衡关闭电压")
+
+        item = QtWidgets.QTableWidgetItem("均衡开启电压")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(60, 0, item)
         item = QtWidgets.QTableWidgetItem("mV")
@@ -678,7 +679,7 @@ class Protect(MyFrame):
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(60, 6, item)
 
-        item = QtWidgets.QTableWidgetItem("均衡开启压差")
+        item = QtWidgets.QTableWidgetItem("均衡关闭电压")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(61, 0, item)
         item = QtWidgets.QTableWidgetItem("mV")
@@ -688,7 +689,7 @@ class Protect(MyFrame):
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(61, 6, item)
 
-        item = QtWidgets.QTableWidgetItem("均衡关闭压差")
+        item = QtWidgets.QTableWidgetItem("均衡开启压差")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(62, 0, item)
         item = QtWidgets.QTableWidgetItem("mV")
@@ -698,17 +699,17 @@ class Protect(MyFrame):
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(62, 6, item)
 
-        item = QtWidgets.QTableWidgetItem("单次均衡开启时长")
+        item = QtWidgets.QTableWidgetItem("均衡关闭压差")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(63, 0, item)
-        item = QtWidgets.QTableWidgetItem("s")
+        item = QtWidgets.QTableWidgetItem("mV")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(63, 2, item)
-        item = QtWidgets.QTableWidgetItem("0.1")
+        item = QtWidgets.QTableWidgetItem("1")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(63, 6, item)
 
-        item = QtWidgets.QTableWidgetItem("告警判定延时")
+        item = QtWidgets.QTableWidgetItem("单次均衡开启时长")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(64, 0, item)
         item = QtWidgets.QTableWidgetItem("s")
@@ -718,7 +719,7 @@ class Protect(MyFrame):
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(64, 6, item)
 
-        item = QtWidgets.QTableWidgetItem("告警恢复延时")
+        item = QtWidgets.QTableWidgetItem("告警判定延时")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(65, 0, item)
         item = QtWidgets.QTableWidgetItem("s")
@@ -728,17 +729,17 @@ class Protect(MyFrame):
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(65, 6, item)
 
-        item = QtWidgets.QTableWidgetItem("当前允许最大充电功率")
+        item = QtWidgets.QTableWidgetItem("告警恢复延时")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(66, 0, item)
-        item = QtWidgets.QTableWidgetItem("kW")
+        item = QtWidgets.QTableWidgetItem("s")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(66, 2, item)
         item = QtWidgets.QTableWidgetItem("0.1")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(66, 6, item)
 
-        item = QtWidgets.QTableWidgetItem("当前允许最大电功率")
+        item = QtWidgets.QTableWidgetItem("当前允许最大电功率")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(67, 0, item)
         item = QtWidgets.QTableWidgetItem("kW")
@@ -748,27 +749,27 @@ class Protect(MyFrame):
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(67, 6, item)
 
-        item = QtWidgets.QTableWidgetItem("当前允许最大充电电压")
+        item = QtWidgets.QTableWidgetItem("当前允许最大放电功率")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(68, 0, item)
-        item = QtWidgets.QTableWidgetItem("V")
+        item = QtWidgets.QTableWidgetItem("kW")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(68, 2, item)
         item = QtWidgets.QTableWidgetItem("0.1")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(68, 6, item)
 
-        item = QtWidgets.QTableWidgetItem("当前允许最大充电电")
+        item = QtWidgets.QTableWidgetItem("当前允许最大充电电")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(69, 0, item)
-        item = QtWidgets.QTableWidgetItem("A")
+        item = QtWidgets.QTableWidgetItem("V")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(69, 2, item)
         item = QtWidgets.QTableWidgetItem("0.1")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(69, 6, item)
 
-        item = QtWidgets.QTableWidgetItem("当前允许最大电电流")
+        item = QtWidgets.QTableWidgetItem("当前允许最大电电流")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(70, 0, item)
         item = QtWidgets.QTableWidgetItem("A")
@@ -778,17 +779,17 @@ class Protect(MyFrame):
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(70, 6, item)
 
-        item = QtWidgets.QTableWidgetItem("标称容量配置")
+        item = QtWidgets.QTableWidgetItem("当前允许最大放电电流")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(71, 0, item)
-        item = QtWidgets.QTableWidgetItem("Ah")
+        item = QtWidgets.QTableWidgetItem("A")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(71, 2, item)
         item = QtWidgets.QTableWidgetItem("0.1")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(71, 6, item)
 
-        item = QtWidgets.QTableWidgetItem("容量配置")
+        item = QtWidgets.QTableWidgetItem("标称容量配置")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(72, 0, item)
         item = QtWidgets.QTableWidgetItem("Ah")
@@ -798,7 +799,7 @@ class Protect(MyFrame):
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(72, 6, item)
 
-        item = QtWidgets.QTableWidgetItem("剩余容量配置")
+        item = QtWidgets.QTableWidgetItem("容量配置")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(73, 0, item)
         item = QtWidgets.QTableWidgetItem("Ah")
@@ -808,17 +809,17 @@ class Protect(MyFrame):
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(73, 6, item)
 
-        item = QtWidgets.QTableWidgetItem("累计充电电量")
+        item = QtWidgets.QTableWidgetItem("剩余容量配置")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(74, 0, item)
-        item = QtWidgets.QTableWidgetItem("kWh")
+        item = QtWidgets.QTableWidgetItem("Ah")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(74, 2, item)
         item = QtWidgets.QTableWidgetItem("0.1")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(74, 6, item)
 
-        item = QtWidgets.QTableWidgetItem("累计电电量")
+        item = QtWidgets.QTableWidgetItem("累计电电量")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(75, 0, item)
         item = QtWidgets.QTableWidgetItem("kWh")
@@ -828,27 +829,27 @@ class Protect(MyFrame):
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(75, 6, item)
 
-        item = QtWidgets.QTableWidgetItem("当前允许放电限制电压")
+        item = QtWidgets.QTableWidgetItem("累计放电电量")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(76, 0, item)
-        item = QtWidgets.QTableWidgetItem("V")
+        item = QtWidgets.QTableWidgetItem("kWh")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(76, 2, item)
         item = QtWidgets.QTableWidgetItem("0.1")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(76, 6, item)
 
-        item = QtWidgets.QTableWidgetItem("AFE高温三级告警")
+        item = QtWidgets.QTableWidgetItem("当前允许放电限制电压")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(77, 0, item)
-        item = QtWidgets.QTableWidgetItem("")
+        item = QtWidgets.QTableWidgetItem("V")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(77, 2, item)
-        item = QtWidgets.QTableWidgetItem("1")
+        item = QtWidgets.QTableWidgetItem("0.1")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(77, 6, item)
 
-        item = QtWidgets.QTableWidgetItem("AFE高温级告警")
+        item = QtWidgets.QTableWidgetItem("AFE高温级告警")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(78, 0, item)
         item = QtWidgets.QTableWidgetItem("℃")
@@ -858,7 +859,7 @@ class Protect(MyFrame):
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(78, 6, item)
 
-        item = QtWidgets.QTableWidgetItem("AFE高温级告警")
+        item = QtWidgets.QTableWidgetItem("AFE高温级告警")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(79, 0, item)
         item = QtWidgets.QTableWidgetItem("℃")
@@ -868,7 +869,7 @@ class Protect(MyFrame):
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(79, 6, item)
 
-        item = QtWidgets.QTableWidgetItem("AFE高温恢复回差阈值")
+        item = QtWidgets.QTableWidgetItem("AFE高温一级告警")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(80, 0, item)
         item = QtWidgets.QTableWidgetItem("℃")
@@ -878,6 +879,16 @@ class Protect(MyFrame):
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(80, 6, item)
 
+        item = QtWidgets.QTableWidgetItem("AFE高温恢复回差阈值")
+        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
+        self.protect_table.setItem(81, 0, item)
+        item = QtWidgets.QTableWidgetItem("℃")
+        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
+        self.protect_table.setItem(81, 2, item)
+        item = QtWidgets.QTableWidgetItem("1")
+        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
+        self.protect_table.setItem(81, 6, item)
+
         # item = QtWidgets.QTableWidgetItem("单体过压三级告警")
         # item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         # self.protect_table.setItem(0, 0, item)
@@ -977,6 +988,9 @@ class Protect(MyFrame):
         self.btn_exit_param = QtWidgets.QPushButton("退出参数标定")
         self.protect_right_groupbox_layout.addWidget(self.btn_exit_param, 10, 0, 1, 2)
 
+        self.btn_reset_param = QtWidgets.QPushButton("参数复位")
+        self.protect_right_groupbox_layout.addWidget(self.btn_reset_param, 11, 0, 1, 2)
+
         self.protect_layout.addWidget(self.protect_right_groupbox, 2)
 
         QtCore.QMetaObject.connectSlotsByName(Protect)

+ 5 - 0
widget/bms_protect.py

@@ -14,6 +14,7 @@ class Win_Protect(Protect, MyFrame):
     read_param_signal = Signal()
     write_param_signal = Signal()
     exit_param_signal = Signal()
+    reset_param_signal = Signal()
 
     def __init__(self, parent=None):
         super(Win_Protect, self).__init__(parent)
@@ -22,6 +23,7 @@ class Win_Protect(Protect, MyFrame):
         self.btn_read_param.clicked.connect(self.on_btn_read_param)
         self.btn_write_param.clicked.connect(self.on_btn_write_param)
         self.btn_exit_param.clicked.connect(self.on_btn_exit_param)
+        self.btn_reset_param.clicked.connect(self.on_btn_reset_param)
         self.protect_table.itemClicked.connect(self._param_item_clicked)
         self.qline_data_set.returnPressed.connect(self._protect_data_changed)
 
@@ -36,6 +38,9 @@ class Win_Protect(Protect, MyFrame):
     def on_btn_exit_param(self):
         self.exit_param_signal.emit()
 
+    def on_btn_reset_param(self):
+        self.reset_param_signal.emit()
+
     def _protect_data_changed(self):
         value = (float(self.qline_data_set.text()) - float(self.qline_offset.text()))/float(self.qline_fbl.text())
         self.qline_data.setText(str(value))