Ver código fonte

1、时间精确到ms;2、时间更新变更;3、记录单体修改

Franike 11 meses atrás
pai
commit
8d57c264b2

+ 1 - 0
.gitignore

@@ -13,6 +13,7 @@ __pycache__/
 # Distribution / packaging
 .Python
 build/
+DataDirectory/
 develop-eggs/
 dist/
 downloads/

+ 1 - 2
controller/bms_hard_ctl.py

@@ -16,8 +16,7 @@ class BmsHardControll:
 
 
     def _rtc_time_update(self):
-        dataTime = QDateTime.currentDateTime()
-        text = dataTime.toString("yy MM dd HH mm ss")
+        text = QDateTime.currentDateTime().toString("yy MM dd HH mm ss")
         time_str = text.split(" ")
         print(time_str)
         # time_list = [bcd_hex(data) for data in time_str]

Diferenças do arquivo suprimidas por serem muito extensas
+ 785 - 676
controller/bms_home_ctl.py


+ 3 - 3
controller/bms_protect_ctl.py

@@ -13,9 +13,9 @@ class BmsProtectControll:
         self.init()
 
     def init(self):
-        self._view.on_read_param_signal.connect(self._read_param)
-        self._view.on_write_param_signal.connect(self._write_param)
-        self._view.on_exit_param_signal.connect(self._exit_param)
+        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)
         
 
     def _read_param(self):

+ 6 - 2
controller/bms_record_ctl.py

@@ -26,8 +26,12 @@ class BmsRecordControll:
         self._view.save_record.setDisabled(True)
         self._view.stop_record.setDisabled(False)
         header =  ["时间戳", "簇号", "故障等级", "簇电压", "簇电流", "簇SOC", "簇SOH", "簇单体V平均", "簇单体Vmax单体号", "簇单体Vmax", "簇单体Vmin单体号", "簇单体Vmin", "簇单体T平均", "簇单体Tmax单体号", "簇单体Tmax", "簇单体Tmin单体号", "簇单体Tmin", "主正接触器", "主负接触器", "预充接触器", "断路器", "干接点1", "干接点2", "最高单体SOC", "最低单体SOC", "平均单体SOC"]
-        header_1=  ["V" + str(i + 1) for i in range(396)]
-        header_2 =  ["T" + str(i + 1) for i in range(360)]
+        if SD.CCU_TYPE == 0:
+            header_1=  ["V" + str(i + 1) for i in range(16)]
+            header_2 =  ["T" + str(i + 1) for i in range(16)]
+        else:
+            header_1=  ["V" + str(i + 1) for i in range(396)]
+            header_2 =  ["T" + str(i + 1) for i in range(360)]            
         header.extend(header_1)
         header.extend(header_2)
         if ok:

+ 1 - 1
start.py

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

+ 1 - 0
ui/double_ccu.py

@@ -29,6 +29,7 @@ class DoubleCcu(MyFrame):
         self.double_ccu_under_layout = QtWidgets.QHBoxLayout(self.double_ccu_under_widget)
 
         self.on_line_ccu_table = QtWidgets.QTableWidget(self.double_ccu_under_widget)
+        self.on_line_ccu_table.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
         self.on_line_ccu_table.setColumnCount(15)
         self.on_line_ccu_table.verticalHeader().setVisible(False)
         self.on_line_ccu_table.verticalHeader().setHighlightSections(True)

+ 2 - 2
ui/hard.py

@@ -155,8 +155,8 @@ class Hard(MyFrame):
         self.qline_rtc = QtWidgets.QLineEdit(self.rtc_groupbox)
         self.qline_rtc.setReadOnly(True)
         self.rtc_groupbox_layout.addWidget(self.qline_rtc)
-        self.qcheckbox_rtc = QtWidgets.QCheckBox("实时更新")
-        self.rtc_groupbox_layout.addWidget(self.qcheckbox_rtc)
+        # self.qcheckbox_rtc = QtWidgets.QCheckBox("实时更新")
+        # self.rtc_groupbox_layout.addWidget(self.qcheckbox_rtc)
         self.btn_rtc = QtWidgets.QPushButton("时钟校准")
         self.rtc_groupbox_layout.addWidget(self.btn_rtc)
         self.hard_right_frame_layout.addWidget(self.rtc_groupbox, 1)

+ 1 - 1
ui/home.py

@@ -74,7 +74,7 @@ class UiBmsHomePage(object):
         self.top_layout.addWidget(self.zkc)
         self.cb_bcu = QComboBox()
         for i in range(15):
-            self.cb_bcu.addItem("BMU" + str(i + 1))
+            self.cb_bcu.addItem("BCU" + str(i + 1))
         self.top_layout.addWidget(self.cb_bcu)
 
         self.top_layout.addStretch() 

+ 1 - 0
ui/record.py

@@ -17,6 +17,7 @@ class Record(MyFrame):
         self.record_box_layout = QtWidgets.QVBoxLayout(self.record_widget)
 
         self.record_table = QtWidgets.QTableWidget(self.record_widget)
+        self.record_table.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
         self.record_table.setColumnCount(14)
         self.record_table.verticalHeader().setVisible(False)
         self.record_table.verticalHeader().setHighlightSections(True)

+ 20 - 10
utils/can.py

@@ -454,9 +454,12 @@ class MessageDeal:
                 ret = PCAN.CAN_Initialize(self.canType, PCAN_BAUD_500K ,0,0,0)
             if TPCANStatus(ret) != PCAN_ERROR_OK:
                 return False
-            dataTime = QDateTime.currentDateTime()
-            time_str = dataTime.toString("yyMMddHHmmss") + '.csv'
-            self.can_file  = resource_path(time_str)
+            time_str = "/CAN_RawDataFile_" + QDateTime.currentDateTime().toString("yyyy_MM_dd_HH_mm_ss") + '.csv'
+            time_str_path = resource_path("DataDirectory")
+            if not os.path.exists(time_str_path):
+                os.mkdir(time_str_path)
+            self.can_file = time_str_path + time_str
+            # self.can_file  = resource_path(time_str)
             return True
         else:
             if (STATUS_OK != ZLGCAN.VCI_OpenDevice(self.canType, self.canChannel, self.canChannel)):
@@ -470,9 +473,11 @@ class MessageDeal:
 
             if (STATUS_OK != ZLGCAN.VCI_StartCAN(self.canType, self.canIndex, self.canChannel)):
                 return False
-            dataTime = QDateTime.currentDateTime()
-            time_str = dataTime.toString("yyMMddHHmmss") + '.csv'
-            self.can_file  = resource_path(time_str)  
+            time_str = "/CAN_RawDataFile_" + QDateTime.currentDateTime().toString("yyyy_MM_dd_HH_mm_ss") + '.csv'
+            time_str_path = resource_path("DataDirectory")
+            if not os.path.exists(time_str_path):
+                os.mkdir(time_str_path)
+            self.can_file = time_str_path + time_str
             return True
 
     def get_undeal_number(self):
@@ -487,6 +492,7 @@ class MessageDeal:
             timestamp = TPCANTimestamp()
             res = PCAN.CAN_Read(self.canType,ctypes.byref(msg),ctypes.byref(timestamp))
             if (res != PCAN_ERROR_QRCVEMPTY):
+                # print(QDateTime.fromMSecsSinceEpoch(timestamp.micros + 1000 * timestamp.millis + 0x100000000 * 1000 * timestamp.millis_overflow).toString("yyyy-MM-dd HH:mm:ss.zzz"))
                 self.format_msg_data(self.index, msg.ID, msg.LEN, msg.DATA, 1)
                 self.index += 1
                 return 1, msg.ID, msg.DATA
@@ -560,7 +566,9 @@ class MessageDeal:
 
     def format_msg_data(self, index, id, len, can_data, received):
         data = []
+        can_rec_time = QDateTime.currentDateTime().toString("yyyy-MM-dd HH:mm:ss.zzz")
         data.append('{0:0>7}'.format(index))
+        data.append(can_rec_time)
         data.append('接收' if received else '发送')
         data.append(str.upper('0x' + '{:0>8x}'.format(id)).replace('X', 'x'))
         data.append(len)
@@ -570,12 +578,14 @@ class MessageDeal:
                 writer = csv.writer(csvfile, dialect='excel', lineterminator='\n')
                 writer.writerow(data)
         else:
-            dataTime = QDateTime.currentDateTime()
-            time_str = dataTime.toString("yyMMddHHmmss") + '.csv'
-            self.can_file  = resource_path(time_str)
+            time_str = "/CAN_RawDataFile_" + QDateTime.currentDateTime().toString("yyyy_MM_dd_HH_mm_ss") + '.csv'
+            time_str_path = resource_path("DataDirectory")
+            if not os.path.exists(time_str_path):
+                os.mkdir(time_str_path)
+            self.can_file = time_str_path + time_str
             with open(self.can_file, 'w') as csvfile:
                 writer = csv.writer(csvfile, dialect='excel', lineterminator='\n')
-                header = ["序号", "收/发", "CAN ID", "CAN LEN", "CAN DATA"]
+                header = ["序号", "时间戳", "收/发", "CAN ID", "CAN LEN", "CAN DATA"]
                 writer.writerow(header)
                 writer.writerow(data)
             

+ 6 - 6
widget/bms_protect.py

@@ -12,9 +12,9 @@ from utils.qt import QMessageBox, QChart, QValueAxis, QHBoxLayout, QPainter, Qt,
 class Win_Protect(Protect, MyFrame):
 
     # 信号传递
-    on_read_param_signal = Signal()
-    on_write_param_signal = Signal()
-    on_exit_param_signal = Signal()
+    read_param_signal = Signal()
+    write_param_signal = Signal()
+    exit_param_signal = Signal()
 
     def __init__(self, parent=None):
         super(Win_Protect, self).__init__(parent)
@@ -28,14 +28,14 @@ class Win_Protect(Protect, MyFrame):
 
 
     def on_btn_read_param(self):
-        self.on_read_param_signal.emit()
+        self.read_param_signal.emit()
 
 
     def on_btn_write_param(self):
-        self.on_write_param_signal.emit()
+        self.write_param_signal.emit()
 
     def on_btn_exit_param(self):
-        self.on_exit_param_signal.emit()
+        self.exit_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())

+ 1 - 2
widget/bms_status_bar.py

@@ -20,8 +20,7 @@ class Win_Bms_Status_Bar(UiStatusBar, MyFrame):
         self._show_local_data_time()
 
     def _show_local_data_time(self):
-        dataTime = QDateTime.currentDateTime()
-        text = dataTime.toString("yyyy-MM-dd HH:mm:ss")
+        text = QDateTime.currentDateTime().toString("yyyy-MM-dd HH:mm:ss")
         self.lb_local_time.setText(text)
 
     def bms_error(self):

+ 108 - 108
worker/bms_work.py

@@ -103,42 +103,42 @@ class BmsSend(QObject):
 class BmsReceived(QObject):
 
     to_show_masterid_signal = Signal(int)
-    to_show_0000_signal = Signal(object)
-    to_show_0001_signal = Signal(object)
-    to_show_0002_signal = Signal(object)
-    to_show_0003_signal = Signal(object)
-    to_show_0004_signal = Signal(object)
-    to_show_0005_signal = Signal(object)
-    to_show_0006_signal = Signal(object)
-    to_show_0007_signal = Signal(object)
-    to_show_0008_signal = Signal(object)
-    to_show_0009_signal = Signal(object)
-    to_show_000A_signal = Signal(object)
-    to_show_000B_signal = Signal(object)
-    to_show_000C_signal = Signal(object)
-    to_show_000D_signal = Signal(object)
-    to_show_000E_signal = Signal(object)
-    to_show_000F_signal = Signal(object)
-    to_show_0010_signal = Signal(object)
-    to_show_0011_signal = Signal(object)
-    to_show_0012_signal = Signal(object)
-    to_show_0013_signal = Signal(object)
-    to_show_0014_signal = Signal(object)
-    to_show_0015_signal = Signal(object)
-    to_show_0016_signal = Signal(object)
-    to_show_0017_signal = Signal(object)
-    to_show_0018_signal = Signal(object)
-    to_show_0019_signal = Signal(object)
-    to_show_001A_signal = Signal(object)
-    to_show_001B_signal = Signal(object)
-    to_show_001C_signal = Signal(object)
-    to_show_001D_signal = Signal(object)
-    to_show_001E_signal = Signal(object)
-    to_show_001F_signal = Signal(object)
-    to_show_0020_signal = Signal(object)
-    to_show_0021_signal = Signal(object)
-    to_show_0022_signal = Signal(object)
-    to_show_0023_signal = Signal(object)
+    to_show_0000_signal = Signal(object, int)
+    to_show_0001_signal = Signal(object, int)
+    to_show_0002_signal = Signal(object, int)
+    to_show_0003_signal = Signal(object, int)
+    to_show_0004_signal = Signal(object, int)
+    to_show_0005_signal = Signal(object, int)
+    to_show_0006_signal = Signal(object, int)
+    to_show_0007_signal = Signal(object, int)
+    to_show_0008_signal = Signal(object, int)
+    to_show_0009_signal = Signal(object, int)
+    to_show_000A_signal = Signal(object, int)
+    to_show_000B_signal = Signal(object, int)
+    to_show_000C_signal = Signal(object, int)
+    to_show_000D_signal = Signal(object, int)
+    to_show_000E_signal = Signal(object, int)
+    to_show_000F_signal = Signal(object, int)
+    to_show_0010_signal = Signal(object, int)
+    to_show_0011_signal = Signal(object, int)
+    to_show_0012_signal = Signal(object, int)
+    to_show_0013_signal = Signal(object, int)
+    to_show_0014_signal = Signal(object, int)
+    to_show_0015_signal = Signal(object, int)
+    to_show_0016_signal = Signal(object, int)
+    to_show_0017_signal = Signal(object, int)
+    to_show_0018_signal = Signal(object, int)
+    to_show_0019_signal = Signal(object, int)
+    to_show_001A_signal = Signal(object, int)
+    to_show_001B_signal = Signal(object, int)
+    to_show_001C_signal = Signal(object, int)
+    to_show_001D_signal = Signal(object, int)
+    to_show_001E_signal = Signal(object, int)
+    to_show_001F_signal = Signal(object, int)
+    to_show_0020_signal = Signal(object, int)
+    to_show_0021_signal = Signal(object, int)
+    to_show_0022_signal = Signal(object, int)
+    to_show_0023_signal = Signal(object, int)
 
     def __init__(self):
         super(BmsReceived, self).__init__()
@@ -159,113 +159,113 @@ class BmsReceived(QObject):
                 if result[1] & 0xFFFF == 1:
                     self.to_show_masterid_signal.emit((result[1] >> 16) & 0xFF)
                 # 0001
-                if result[1] == 0x18000000 | (SD.BCU_ID << 16):
-                    self.to_show_0000_signal.emit(result[2])
+                if (result[1] ^ 0x18000000) & 0xFFFF == 0:
+                    self.to_show_0000_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0001
-                if result[1] == 0x18000001 | (SD.BCU_ID << 16):
-                    self.to_show_0001_signal.emit(result[2])
+                if (result[1] ^ 0x18000001) & 0xFFFF == 0:
+                    self.to_show_0001_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0002  
-                elif result[1] == 0x18000002 | (SD.BCU_ID << 16):
-                    self.to_show_0002_signal.emit(result[2])
+                elif (result[1] ^ 0x18000002) & 0xFFFF == 0:
+                    self.to_show_0002_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0003
-                elif result[1] == 0x18000003 | (SD.BCU_ID << 16):
-                    self.to_show_0003_signal.emit(result[2])
+                elif (result[1] ^ 0x18000003) & 0xFFFF == 0:
+                    self.to_show_0003_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0004  
-                elif result[1] == 0x18000004 | (SD.BCU_ID << 16):
-                    self.to_show_0004_signal.emit(result[2])
+                elif (result[1] ^ 0x18000004) & 0xFFFF == 0:
+                    self.to_show_0004_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0005
-                elif result[1] == 0x18000005 | (SD.BCU_ID << 16):
-                    self.to_show_0005_signal.emit(result[2])
+                elif (result[1] ^ 0x18000005) & 0xFFFF == 0:
+                    self.to_show_0005_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0006  
-                elif result[1] == 0x18000006 | (SD.BCU_ID << 16):
-                    self.to_show_0006_signal.emit(result[2])
+                elif (result[1] ^ 0x18000006) & 0xFFFF == 0:
+                    self.to_show_0006_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0007
-                elif result[1] == 0x18000007 | (SD.BCU_ID << 16):
-                    self.to_show_0007_signal.emit(result[2])
+                elif (result[1] ^ 0x18000007) & 0xFFFF == 0:
+                    self.to_show_0007_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0008
-                elif result[1] == 0x18000008 | (SD.BCU_ID << 16):
-                    self.to_show_0008_signal.emit(result[2])
+                elif (result[1] ^ 0x18000008) & 0xFFFF == 0:
+                    self.to_show_0008_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0009
-                elif result[1] == 0x18000009 | (SD.BCU_ID << 16):
-                    self.to_show_0009_signal.emit(result[2])
+                elif (result[1] ^ 0x18000009) & 0xFFFF == 0:
+                    self.to_show_0009_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 000A
-                elif result[1] == 0x1800000A | (SD.BCU_ID << 16):
-                    self.to_show_000A_signal.emit(result[2])
+                elif (result[1] ^ 0x1800000A) & 0xFFFF == 0:
+                    self.to_show_000A_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 000B
-                elif result[1] == 0x1800000B | (SD.BCU_ID << 16):
-                    self.to_show_000B_signal.emit(result[2])
+                elif (result[1] ^ 0x1800000B) & 0xFFFF == 0:
+                    self.to_show_000B_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 000C 
-                elif result[1] == 0x1800000C | (SD.BCU_ID << 16):
-                    self.to_show_000C_signal.emit(result[2])
+                elif (result[1] ^ 0x1800000C) & 0xFFFF == 0:
+                    self.to_show_000C_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 000D
-                elif result[1] == 0x1800000D | (SD.BCU_ID << 16):
-                    self.to_show_000D_signal.emit(result[2])
+                elif (result[1] ^ 0x1800000D) & 0xFFFF == 0:
+                    self.to_show_000D_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 000E
-                elif result[1] == 0x1800000E | (SD.BCU_ID << 16):
-                    self.to_show_000E_signal.emit(result[2])
+                elif (result[1] ^ 0x1800000E) & 0xFFFF == 0:
+                    self.to_show_000E_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 000F
-                elif result[1] == 0x1800000F | (SD.BCU_ID << 16):
-                    self.to_show_000F_signal.emit(result[2])
+                elif (result[1] ^ 0x1800000F) & 0xFFFF == 0:
+                    self.to_show_000F_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0010
-                elif result[1] == 0x18000010 | (SD.BCU_ID << 16):
-                    self.to_show_0010_signal.emit(result[2])
+                elif (result[1] ^ 0x18000010) & 0xFFFF == 0:
+                    self.to_show_0010_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0011
-                elif result[1] == 0x18000011 | (SD.BCU_ID << 16):
-                    self.to_show_0011_signal.emit(result[2])
+                elif (result[1] ^ 0x18000011) & 0xFFFF == 0:
+                    self.to_show_0011_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0012
-                elif result[1] == 0x18000012 | (SD.BCU_ID << 16):
-                    self.to_show_0012_signal.emit(result[2])
+                elif (result[1] ^ 0x18000012) & 0xFFFF == 0:
+                    self.to_show_0012_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0013
-                elif result[1] == 0x18000013 | (SD.BCU_ID << 16):
-                    self.to_show_0013_signal.emit(result[2])
+                elif (result[1] ^ 0x18000013) & 0xFFFF == 0:
+                    self.to_show_0013_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0014
-                elif result[1] == 0x18000014 | (SD.BCU_ID << 16):
-                    self.to_show_0014_signal.emit(result[2])
+                elif (result[1] ^ 0x18000014) & 0xFFFF == 0:
+                    self.to_show_0014_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0015
-                elif result[1] == 0x18000015 | (SD.BCU_ID << 16):
-                    self.to_show_0015_signal.emit(result[2])
+                elif (result[1] ^ 0x18000015) & 0xFFFF == 0:
+                    self.to_show_0015_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0016
-                elif result[1] == 0x18000016 | (SD.BCU_ID << 16):
-                    self.to_show_0016_signal.emit(result[2])
+                elif (result[1] ^ 0x18000016) & 0xFFFF == 0:
+                    self.to_show_0016_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0017
-                elif result[1] == 0x18000017 | (SD.BCU_ID << 16):
-                    self.to_show_0017_signal.emit(result[2])
+                elif (result[1] ^ 0x18000017) & 0xFFFF == 0:
+                    self.to_show_0017_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0018
-                elif result[1] == 0x18000018 | (SD.BCU_ID << 16):
-                    self.to_show_0018_signal.emit(result[2])
+                elif (result[1] ^ 0x18000018) & 0xFFFF == 0:
+                    self.to_show_0018_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0019
-                elif result[1] == 0x18000019 | (SD.BCU_ID << 16):
-                    self.to_show_0019_signal.emit(result[2])
+                elif (result[1] ^ 0x18000019) & 0xFFFF == 0:
+                    self.to_show_0019_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 001A
-                elif result[1] == 0x1800001A | (SD.BCU_ID << 16):
-                    self.to_show_001A_signal.emit(result[2])
+                elif (result[1] ^ 0x1800001A) & 0xFFFF == 0:
+                    self.to_show_001A_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 001B
-                elif result[1] == 0x1800001B | (SD.BCU_ID << 16):
-                    self.to_show_001B_signal.emit(result[2])
+                elif (result[1] ^ 0x1800001B) & 0xFFFF == 0:
+                    self.to_show_001B_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 001C
-                elif result[1] == 0x1800001C | (SD.BCU_ID << 16):
-                    self.to_show_001C_signal.emit(result[2])
+                elif (result[1] ^ 0x1800001C) & 0xFFFF == 0:
+                    self.to_show_001C_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 001D
-                elif result[1] == 0x1800001D | (SD.BCU_ID << 16):
-                    self.to_show_001D_signal.emit(result[2])
+                elif (result[1] ^ 0x1800001D) & 0xFFFF == 0:
+                    self.to_show_001D_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 001E
-                elif result[1] == 0x1800001E | (SD.BCU_ID << 16):
-                    self.to_show_001E_signal.emit(result[2])
+                elif (result[1] ^ 0x1800001E) & 0xFFFF == 0:
+                    self.to_show_001E_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 001F
-                elif result[1] == 0x1800001F | (SD.BCU_ID << 16):
-                    self.to_show_001F_signal.emit(result[2])
+                elif (result[1] ^ 0x1800001F) & 0xFFFF == 0:
+                    self.to_show_001F_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0020
-                elif result[1] == 0x18000020 | (SD.BCU_ID << 16):
-                    self.to_show_0020_signal.emit(result[2])
+                elif (result[1] ^ 0x18000020) & 0xFFFF == 0:
+                    self.to_show_0020_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0021
-                elif result[1] == 0x18000021 | (SD.BCU_ID << 16):
-                    self.to_show_0021_signal.emit(result[2])
+                elif (result[1] ^ 0x18000021) & 0xFFFF == 0:
+                    self.to_show_0021_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0022
-                elif result[1] == 0x18000022 | (SD.BCU_ID << 16):
-                    self.to_show_0022_signal.emit(result[2])
+                elif (result[1] ^ 0x18000022) & 0xFFFF == 0:
+                    self.to_show_0022_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                 # 0023
-                elif result[1] == 0x18000023 | (SD.BCU_ID << 16):
-                    self.to_show_0023_signal.emit(result[2])
+                elif (result[1] ^ 0x18000023) & 0xFFFF == 0:
+                    self.to_show_0023_signal.emit(result[2], (result[1] >> 16) & 0xFF)
                     
     # # 接收数据
     # def received(self):

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff