Pārlūkot izejas kodu

1.5版本发布

Franike 7 mēneši atpakaļ
vecāks
revīzija
3dac7486f1

+ 0 - 7
build_pyd.py

@@ -1,12 +1,5 @@
 #!/usr/bin/env python
 #!/usr/bin/env python
 # -*- encoding: utf-8 -*-
 # -*- encoding: utf-8 -*-
-'''
-@文件    :setup.py
-@时间    :2022/02/21 17:00:46
-@作者    :None
-@版本    :1.0
-@说明    :源码编译文件
-'''
 
 
 
 
 import sys
 import sys

+ 106 - 133
controller/bms_home_ctl.py

@@ -1,12 +1,6 @@
 #!/usr/bin/env python
 #!/usr/bin/env python
 # -*- encoding: utf-8 -*-
 # -*- encoding: utf-8 -*-
-'''
-@文件    :bms_home_ctl.py
-@时间    :2022/02/21 16:56:26
-@作者    :None
-@版本    :1.0
-@说明    :主页面 CTL
-'''
+
 
 
 from controller.bms_cell_ctl import BmsCellControll
 from controller.bms_cell_ctl import BmsCellControll
 from controller.bms_double_ccu_ctl import BmsDoubleCcuControll
 from controller.bms_double_ccu_ctl import BmsDoubleCcuControll
@@ -21,7 +15,7 @@ from model.record_model import RecordModel
 from widget.bms_home import Win_GotionBMS
 from widget.bms_home import Win_GotionBMS
 from utils.globalvar import SD
 from utils.globalvar import SD
 from controller.bms_main_ctl import BmsMainControll
 from controller.bms_main_ctl import BmsMainControll
-from utils.qt import QTimer, QThread, QColor, Qt, QDateTime, QtGui, QtWidgets, QPixmap,QApplication
+from utils.qt import QThread, QColor, Qt, QDateTime, QtGui, QtWidgets, QApplication
 from utils.hex_bit import a_bit
 from utils.hex_bit import a_bit
 from worker.bms_work import BmsReceived
 from worker.bms_work import BmsReceived
 from ui.own.palette_theme import set_edt_bg
 from ui.own.palette_theme import set_edt_bg
@@ -86,18 +80,12 @@ class BmsHomeControll:
         if SD.CAN_ON_OFF:
         if SD.CAN_ON_OFF:
             self.bms_status._view.label_bms_connect.setText("通讯已连接" if SD.SYSTEM_LANGUAGE == 0 else "BMS Connected")
             self.bms_status._view.label_bms_connect.setText("通讯已连接" if SD.SYSTEM_LANGUAGE == 0 else "BMS Connected")
             SD.START_RUN = True
             SD.START_RUN = True
-            # CAN数据发送类
-            # self.bms_send_thread = QThread()
-            # self.bms_send = BmsSend()
-            # self.bms_send.moveToThread(self.bms_send_thread)
-            # self.bms_send_thread.started.connect(self.bms_send.send)
             # CAN数据接收类
             # CAN数据接收类
             self.bms_received_thread = QThread()
             self.bms_received_thread = QThread()
             self.bms_received = BmsReceived()
             self.bms_received = BmsReceived()
             self.bms_received.moveToThread(self.bms_received_thread)
             self.bms_received.moveToThread(self.bms_received_thread)
             self.bms_received_thread.started.connect(self.bms_received.received)
             self.bms_received_thread.started.connect(self.bms_received.received)
             # 启动线程
             # 启动线程
-            # self.bms_send_thread.start()
             self.bms_received_thread.start()
             self.bms_received_thread.start()
 
 
             self.bms_received.to_show_masterid_signal.connect(self._get_master_id)
             self.bms_received.to_show_masterid_signal.connect(self._get_master_id)
@@ -148,14 +136,6 @@ class BmsHomeControll:
             SD.START_RUN = False
             SD.START_RUN = False
             SD.CAN_CONTROL.close_can()
             SD.CAN_CONTROL.close_can()
 
 
-            # if self.bms_send_thread.isRunning():
-            #     self.bms_send_thread.quit()
-            #     self.bms_send_thread.wait()
-
-            # if self.bms_send_thread.isFinished():
-            #     del self.bms_send
-            #     del self.bms_send_thread
-
             if self.bms_received_thread.isRunning():
             if self.bms_received_thread.isRunning():
                 self.bms_received_thread.quit()
                 self.bms_received_thread.quit()
                 self.bms_received_thread.wait()
                 self.bms_received_thread.wait()
@@ -172,7 +152,6 @@ class BmsHomeControll:
 
 
 
 
     def app_cut(self):
     def app_cut(self):
-        # return
         main_window = QApplication.primaryScreen()
         main_window = QApplication.primaryScreen()
         pixmap = main_window.grabWindow(QtWidgets.QApplication.desktop().winId())
         pixmap = main_window.grabWindow(QtWidgets.QApplication.desktop().winId())
         pixmap.save("screenshot.png"); 
         pixmap.save("screenshot.png"); 
@@ -192,41 +171,11 @@ class BmsHomeControll:
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(data - 1, 0, item) 
         self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(data - 1, 0, item) 
 
 
+
     def _inf_0000_signal(self, data, id):
     def _inf_0000_signal(self, data, id):
         if id == SD.BCU_ID:
         if id == SD.BCU_ID:
             self._model.ccu_id = SD.BCU_ID
             self._model.ccu_id = SD.BCU_ID
 
 
-            if SD.CCU_TYPE == 1:
-                set_edt_bg(self.bms_main_ctl._view.under_widget.di_1, QColor(Qt.gray) if (data[0] & 0x01 == 0) else QColor(Qt.green))
-                set_edt_bg(self.bms_main_ctl._view.under_widget.di_2, QColor(Qt.gray) if (data[0] & 0x02 == 0) else QColor(Qt.green))
-                set_edt_bg(self.bms_main_ctl._view.under_widget.di_3, QColor(Qt.gray) if (data[0] & 0x04 == 0) else QColor(Qt.green))
-                set_edt_bg(self.bms_main_ctl._view.under_widget.di_4, QColor(Qt.gray) if (data[0] & 0x08 == 0) else QColor(Qt.green))
-                set_edt_bg(self.bms_main_ctl._view.under_widget.di_5, QColor(Qt.gray) if (data[0] & 0x10 == 0) else QColor(Qt.green))
-                set_edt_bg(self.bms_main_ctl._view.under_widget.di_6, QColor(Qt.gray) if (data[0] & 0x20 == 0) else QColor(Qt.green))
-                set_edt_bg(self.bms_main_ctl._view.under_widget.di_7, QColor(Qt.gray) if (data[0] & 0x40 == 0) else QColor(Qt.green))
-                set_edt_bg(self.bms_main_ctl._view.under_widget.di_8, QColor(Qt.gray) if (data[0] & 0x80 == 0) else QColor(Qt.green))
-
-                set_edt_bg(self.bms_main_ctl._view.under_widget.do_1, QColor(Qt.gray) if (data[1] & 0x01 == 0) else QColor(Qt.green))
-                self._model.p = data[1] & 0x01
-                set_edt_bg(self.bms_main_ctl._view.under_widget.do_2, QColor(Qt.gray) if (data[1] & 0x02 == 0) else QColor(Qt.green))
-                self._model.n = (data[1] & 0x02) >> 1
-                set_edt_bg(self.bms_main_ctl._view.under_widget.do_3, QColor(Qt.gray) if (data[1] & 0x04 == 0) else QColor(Qt.green))
-                self._model.pre = (data[1] & 0x04) >> 2
-                set_edt_bg(self.bms_main_ctl._view.under_widget.do_4, QColor(Qt.gray) if (data[1] & 0x08 == 0) else QColor(Qt.green))
-                set_edt_bg(self.bms_main_ctl._view.under_widget.do_5, QColor(Qt.gray) if (data[1] & 0x10 == 0) else QColor(Qt.green))
-                self._model.dlq = (data[1] & 0x10) >> 4
-                set_edt_bg(self.bms_main_ctl._view.under_widget.do_6, QColor(Qt.gray) if (data[1] & 0x20 == 0) else QColor(Qt.green))
-                set_edt_bg(self.bms_main_ctl._view.under_widget.do_7, QColor(Qt.gray) if (data[1] & 0x40 == 0) else QColor(Qt.green))
-                set_edt_bg(self.bms_main_ctl._view.under_widget.do_8, QColor(Qt.gray) if (data[1] & 0x80 == 0) else QColor(Qt.green))
-            else:
-                set_edt_bg(self.bms_main_ctl._view.under_widget.fjd_1, QColor(Qt.gray) if (data[2] & 0x01 == 0) else QColor(Qt.green))
-                self._model.gjd_first = data[2] & 0x01
-                set_edt_bg(self.bms_main_ctl._view.under_widget.fjd_1, QColor(Qt.gray) if (data[2] & 0x02 == 0) else QColor(Qt.green))
-                self._model.gjd_second = (data[2] & 0x02) >> 1
-   
-
-    def _inf_0001_signal(self, data, id):
-        if id == SD.BCU_ID:
             # 系统状态
             # 系统状态
             if data[0] & 0x0F == 0x00:
             if data[0] & 0x0F == 0x00:
                 set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_no, QColor(Qt.green))
                 set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_no, QColor(Qt.green))
@@ -295,53 +244,54 @@ class BmsHomeControll:
         
         
             self._model.fault_level = (data[0] & 0x30) >> 4
             self._model.fault_level = (data[0] & 0x30) >> 4
 
 
-            # 继电器
-            if SD.CCU_TYPE == 1:
-                set_edt_bg(self.bms_main_ctl._view.under_widget.do_1, QColor(Qt.gray) if (data[0] & 0x40 == 0) else QColor(Qt.green))
-                set_edt_bg(self.bms_main_ctl._view.under_widget.do_2, QColor(Qt.gray) if (data[0] & 0x80 == 0) else QColor(Qt.green))
-
-            # SOC
-            self.bms_main_ctl._view.top_widget.lb_soc_value.setText(str(round(data[1] * 0.4, 1)))
-            self._model.soc = round(data[1] * 0.4, 1)
-
-            # 总压
-            self.bms_main_ctl._view.top_widget.lb_tv_value.setText(str(round((data[3] << 8 | data[2]) * 0.1, 1)))
-            self._model.volt = round((data[3] << 8 | data[2]) * 0.1, 1)
-
-            # 电流
-            self.bms_main_ctl._view.top_widget.lb_tcur_value.setText(str(round((data[5] << 8 | data[4]) * 0.1 - 3200, 1)))
-            self._model.cur = round((data[5] << 8 | data[4]) * 0.1 - 3200, 1)
-
-            # SOH
-            self.bms_main_ctl._view.top_widget.lb_tsoh_value.setText(str(round(data[6] * 0.4, 1)))
-            self._model.soh = round(data[6] * 0.4, 1)
+            set_edt_bg(self.bms_main_ctl._view.under_widget.permit_chg, QColor(Qt.gray) if (data[0] & 0x40 == 0) else QColor(Qt.red))
+            set_edt_bg(self.bms_main_ctl._view.under_widget.permit_dchg, QColor(Qt.gray) if (data[0] & 0x80 == 0) else QColor(Qt.red))
 
 
             # MOS标志
             # MOS标志
             if SD.CCU_TYPE == 0: 
             if SD.CCU_TYPE == 0: 
-                set_edt_bg(self.bms_main_ctl._view.under_widget.mos_dchg, QColor(Qt.gray) if (data[7] & 0x01 == 0) else QColor(Qt.green))
-                set_edt_bg(self.bms_main_ctl._view.under_widget.mos_chg, QColor(Qt.gray) if (data[7] & 0x02 == 0) else QColor(Qt.green))
-                set_edt_bg(self.bms_main_ctl._view.under_widget.mos_pre, QColor(Qt.gray) if (data[7] & 0x04 == 0) else QColor(Qt.green))
-            
-            # if SD.CCU_TYPE == 1: 
-            #     set_edt_bg(self.bms_main_ctl._view.under_widget.do_4, QColor(Qt.gray) if (data[7] & 0x08 == 0) else QColor(Qt.green))
-            #     set_edt_bg(self.bms_main_ctl._view.under_widget.do_3, QColor(Qt.gray) if (data[7] & 0x40 == 0) else QColor(Qt.green))
-            #     set_edt_bg(self.bms_main_ctl._view.under_widget.do_5, QColor(Qt.gray) if (data[7] & 0x80 == 0) else QColor(Qt.green))
+                set_edt_bg(self.bms_main_ctl._view.under_widget.mos_dchg, QColor(Qt.gray) if (data[1] & 0x01 == 0) else QColor(Qt.green))
+                set_edt_bg(self.bms_main_ctl._view.under_widget.mos_chg, QColor(Qt.gray) if (data[1] & 0x02 == 0) else QColor(Qt.green))
+                set_edt_bg(self.bms_main_ctl._view.under_widget.mos_pre, QColor(Qt.gray) if (data[1] & 0x04 == 0) else QColor(Qt.green))
 
 
             # 充电MOS故障
             # 充电MOS故障
-            if a_bit(data[7], 5) == 0:
+            if a_bit(data[1], 5) == 0:
                 set_edt_bg(self.bms_main_ctl._view.center_widget.chg_mos_fault, QColor(Qt.gray))
                 set_edt_bg(self.bms_main_ctl._view.center_widget.chg_mos_fault, QColor(Qt.gray))
             else:
             else:
                 set_edt_bg(self.bms_main_ctl._view.center_widget.chg_mos_fault, QColor(Qt.red))
                 set_edt_bg(self.bms_main_ctl._view.center_widget.chg_mos_fault, QColor(Qt.red))
 
 
             # 放电MOS故障
             # 放电MOS故障
-            if a_bit(data[5], 4) == 0:
+            if a_bit(data[1], 4) == 0:
                 set_edt_bg(self.bms_main_ctl._view.center_widget.dchg_mos_fault, QColor(Qt.gray))
                 set_edt_bg(self.bms_main_ctl._view.center_widget.dchg_mos_fault, QColor(Qt.gray))
             else:
             else:
                 set_edt_bg(self.bms_main_ctl._view.center_widget.dchg_mos_fault, QColor(Qt.red))
                 set_edt_bg(self.bms_main_ctl._view.center_widget.dchg_mos_fault, QColor(Qt.red))
 
 
-
-            set_edt_bg(self.bms_main_ctl._view.under_widget.permit_chg, QColor(Qt.gray) if (data[0] & 0x40 == 0) else QColor(Qt.red))
-            set_edt_bg(self.bms_main_ctl._view.under_widget.permit_dchg, QColor(Qt.gray) if (data[0] & 0x80 == 0) else QColor(Qt.red))
+            if SD.CCU_TYPE == 1:
+                set_edt_bg(self.bms_main_ctl._view.under_widget.di_1, QColor(Qt.gray) if (data[2] & 0x01 == 0) else QColor(Qt.green))
+                set_edt_bg(self.bms_main_ctl._view.under_widget.di_2, QColor(Qt.gray) if (data[2] & 0x02 == 0) else QColor(Qt.green))
+                set_edt_bg(self.bms_main_ctl._view.under_widget.di_3, QColor(Qt.gray) if (data[2] & 0x04 == 0) else QColor(Qt.green))
+                set_edt_bg(self.bms_main_ctl._view.under_widget.di_4, QColor(Qt.gray) if (data[2] & 0x08 == 0) else QColor(Qt.green))
+                set_edt_bg(self.bms_main_ctl._view.under_widget.di_5, QColor(Qt.gray) if (data[2] & 0x10 == 0) else QColor(Qt.green))
+                set_edt_bg(self.bms_main_ctl._view.under_widget.di_6, QColor(Qt.gray) if (data[2] & 0x20 == 0) else QColor(Qt.green))
+                set_edt_bg(self.bms_main_ctl._view.under_widget.di_7, QColor(Qt.gray) if (data[2] & 0x40 == 0) else QColor(Qt.green))
+                set_edt_bg(self.bms_main_ctl._view.under_widget.di_8, QColor(Qt.gray) if (data[2] & 0x80 == 0) else QColor(Qt.green))
+
+                set_edt_bg(self.bms_main_ctl._view.under_widget.do_1, QColor(Qt.gray) if (data[3] & 0x01 == 0) else QColor(Qt.green))
+                self._model.p = data[1] & 0x01
+                set_edt_bg(self.bms_main_ctl._view.under_widget.do_2, QColor(Qt.gray) if (data[3] & 0x02 == 0) else QColor(Qt.green))
+                self._model.n = (data[1] & 0x02) >> 1
+                set_edt_bg(self.bms_main_ctl._view.under_widget.do_3, QColor(Qt.gray) if (data[3] & 0x04 == 0) else QColor(Qt.green))
+                self._model.pre = (data[1] & 0x04) >> 2
+                set_edt_bg(self.bms_main_ctl._view.under_widget.do_4, QColor(Qt.gray) if (data[3] & 0x08 == 0) else QColor(Qt.green))
+                set_edt_bg(self.bms_main_ctl._view.under_widget.do_5, QColor(Qt.gray) if (data[3] & 0x10 == 0) else QColor(Qt.green))
+                self._model.dlq = (data[1] & 0x10) >> 4
+                set_edt_bg(self.bms_main_ctl._view.under_widget.do_6, QColor(Qt.gray) if (data[3] & 0x20 == 0) else QColor(Qt.green))
+                set_edt_bg(self.bms_main_ctl._view.under_widget.do_7, QColor(Qt.gray) if (data[3] & 0x40 == 0) else QColor(Qt.green))
+                set_edt_bg(self.bms_main_ctl._view.under_widget.do_8, QColor(Qt.gray) if (data[3] & 0x80 == 0) else QColor(Qt.green))
+            else:
+                set_edt_bg(self.bms_main_ctl._view.under_widget.fjd_1, QColor(Qt.gray) if (data[4] & 0x01 == 0) else QColor(Qt.green))
+                self._model.gjd_first = data[4] & 0x01
+                set_edt_bg(self.bms_main_ctl._view.under_widget.fjd_1, QColor(Qt.gray) if (data[4] & 0x02 == 0) else QColor(Qt.green))
+                self._model.gjd_second = (data[4] & 0x02) >> 1
 
 
         # 运行状态
         # 运行状态
         if data[0] & 0x0F == 0x00:
         if data[0] & 0x0F == 0x00:
@@ -359,10 +309,37 @@ class BmsHomeControll:
             sys_status = "准备休眠"
             sys_status = "准备休眠"
         else:
         else:
             sys_status = "无"
             sys_status = "无"
+            
         item = QtWidgets.QTableWidgetItem(sys_status)
         item = QtWidgets.QTableWidgetItem(sys_status)
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(id - 1, 1, item) 
         self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(id - 1, 1, item) 
 
 
+
+    def _inf_0001_signal(self, data, id):
+        if id == SD.BCU_ID:
+            self._model.ccu_id = SD.BCU_ID
+
+            # SOC
+            self.bms_main_ctl._view.top_widget.lb_soc_value.setText(str(round((data[1] << 8 | data[0]) * 0.01, 2)))
+            self._model.soc = round((data[1] << 8 | data[0]) * 0.01, 2)
+
+            # 总压
+            self.bms_main_ctl._view.top_widget.lb_tv_value.setText(str(round((data[3] << 8 | data[2]) * 0.1, 1)))
+            self._model.volt = round((data[3] << 8 | data[2]) * 0.1, 1)
+
+            # 电流
+            self.bms_main_ctl._view.top_widget.lb_tcur_value.setText(str(round((data[5] << 8 | data[4]) * 0.1 - 3200, 1)))
+            self._model.cur = round((data[5] << 8 | data[4]) * 0.1 - 3200, 1)
+
+            # SOH
+            self.bms_main_ctl._view.top_widget.lb_tsoh_value.setText(str(round((data[7] << 8 | data[6]) * 0.01, 2)))
+            self._model.soh = round((data[7] << 8 | data[6]) * 0.01, 2)
+
+        # SOC
+        item = QtWidgets.QTableWidgetItem(str(round((data[1] << 8 | data[0]) * 0.01, 2)))
+        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
+        self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(id - 1, 4, item) 
+
         # 总电压
         # 总电压
         item = QtWidgets.QTableWidgetItem(str(round((data[3] << 8 | data[2]) * 0.1, 1)))
         item = QtWidgets.QTableWidgetItem(str(round((data[3] << 8 | data[2]) * 0.1, 1)))
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
@@ -373,13 +350,8 @@ class BmsHomeControll:
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(id - 1, 3, item) 
         self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(id - 1, 3, item) 
 
 
-        # SOC
-        item = QtWidgets.QTableWidgetItem(str(round(data[1] * 0.4, 1)))
-        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
-        self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(id - 1, 4, item) 
-
         # SOH
         # SOH
-        item = QtWidgets.QTableWidgetItem(str(round(data[6] * 0.4, 1)))
+        item = QtWidgets.QTableWidgetItem(str(round((data[7] << 8 | data[6]) * 0.01, 2)))
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(id - 1, 5, item) 
         self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(id - 1, 5, item) 
 
 
@@ -888,14 +860,14 @@ class BmsHomeControll:
     def _inf_000A_signal(self, data, id):
     def _inf_000A_signal(self, data, id):
         if id == SD.BCU_ID:
         if id == SD.BCU_ID:
             # 最高单体SOC
             # 最高单体SOC
-            self.bms_main_ctl._view.top_widget.lb_soc_high_value.setText(str(round((data[1] << 8 | data[0]) * 0.4, 1)))
-            self._model.max_soc = round((data[1] << 8 | data[0]) * 0.4, 1)
+            self.bms_main_ctl._view.top_widget.lb_soc_high_value.setText(str(round((data[1] << 8 | data[0]) * 0.01, 1)))
+            self._model.max_soc = round((data[1] << 8 | data[0]) * 0.01, 1)
             # 最低单体SOC
             # 最低单体SOC
-            self.bms_main_ctl._view.top_widget.lb_soc_low_value.setText(str(round((data[3] << 8 | data[2]) * 0.4, 1)))
-            self._model.min_soc = round((data[3] << 8 | data[2]) * 0.4, 1)
+            self.bms_main_ctl._view.top_widget.lb_soc_low_value.setText(str(round((data[3] << 8 | data[2]) * 0.01, 1)))
+            self._model.min_soc = round((data[3] << 8 | data[2]) * 0.01, 1)
             # 平均单体SOC
             # 平均单体SOC
-            self.bms_main_ctl._view.top_widget.lb_soc_avg_value.setText(str(round((data[5] << 8 | data[4]) * 0.4, 1)))
-            self._model.avg_soc = round((data[5] << 8 | data[4]) * 0.4, 1)
+            self.bms_main_ctl._view.top_widget.lb_soc_avg_value.setText(str(round((data[5] << 8 | data[4]) * 0.01, 1)))
+            self._model.avg_soc = round((data[5] << 8 | data[4]) * 0.01, 1)
             # 循环次数
             # 循环次数
             self.bms_main_ctl._view.top_widget.lb_circle_num_value.setText(str(data[7] << 8 | data[6]))
             self.bms_main_ctl._view.top_widget.lb_circle_num_value.setText(str(data[7] << 8 | data[6]))
 
 
@@ -1196,44 +1168,45 @@ class BmsHomeControll:
                     set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 1).widget(), QtGui.QColor(Qt.red))
                     set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 1).widget(), QtGui.QColor(Qt.red))
                 else:
                 else:
                     set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 1).widget(), QtGui.QColor(Qt.white))
                     set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 1).widget(), QtGui.QColor(Qt.white))
-                if a_bit(data[2], i + 1) == 1:
-                    set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 9).widget(), QtGui.QColor(Qt.red))
-                else:
-                    set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 9).widget(), QtGui.QColor(Qt.white))
-                if a_bit(data[3], i + 1) == 1:
-                    set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 17).widget(), QtGui.QColor(Qt.red))
-                else:
-                    set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 17).widget(), QtGui.QColor(Qt.white))
-                if a_bit(data[4], i + 1) == 1:
-                    set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 25).widget(), QtGui.QColor(Qt.red))
-                else:
-                    set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 25).widget(), QtGui.QColor(Qt.white))
+                # if a_bit(data[2], i + 1) == 1:
+                #     set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 9).widget(), QtGui.QColor(Qt.red))
+                # else:
+                #     set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 9).widget(), QtGui.QColor(Qt.white))
+                # if a_bit(data[3], i + 1) == 1:
+                #     set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 17).widget(), QtGui.QColor(Qt.red))
+                # else:
+                #     set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 17).widget(), QtGui.QColor(Qt.white))
+                # if a_bit(data[4], i + 1) == 1:
+                #     set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 25).widget(), QtGui.QColor(Qt.red))
+                # else:
+                #     set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 25).widget(), QtGui.QColor(Qt.white))
 
 
 
 
     def _inf_001B_signal(self, data, id):
     def _inf_001B_signal(self, data, id):
         if id == SD.BCU_ID:
         if id == SD.BCU_ID:
-            # 电池均衡故障
-            for i in range(8):
-                if a_bit(data[1], i + 1) == 1:
-                    set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 33).widget(), QtGui.QColor(Qt.red))
-                else:
-                    set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 33).widget(), QtGui.QColor(Qt.white))
-                if a_bit(data[2], i + 1) == 1:
-                    set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 41).widget(), QtGui.QColor(Qt.red))
-                else:
-                    set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 41).widget(), QtGui.QColor(Qt.white))
-                if a_bit(data[3], i + 1) == 1:
-                    set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 49).widget(), QtGui.QColor(Qt.red))
-                else:
-                    set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 49).widget(), QtGui.QColor(Qt.white))
-                if a_bit(data[4], i + 1) == 1:
-                    set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 57).widget(), QtGui.QColor(Qt.red))
-                else:
-                    set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 57).widget(), QtGui.QColor(Qt.white))
-                if a_bit(data[5], i + 1) == 1:
-                    set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 65).widget(), QtGui.QColor(Qt.red))
-                else:
-                    set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 65).widget(), QtGui.QColor(Qt.white))
+            return
+            # # 电池均衡故障
+            # for i in range(8):
+            #     if a_bit(data[1], i + 1) == 1:
+            #         set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 33).widget(), QtGui.QColor(Qt.red))
+            #     else:
+            #         set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 33).widget(), QtGui.QColor(Qt.white))
+            #     if a_bit(data[2], i + 1) == 1:
+            #         set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 41).widget(), QtGui.QColor(Qt.red))
+            #     else:
+            #         set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 41).widget(), QtGui.QColor(Qt.white))
+            #     if a_bit(data[3], i + 1) == 1:
+            #         set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 49).widget(), QtGui.QColor(Qt.red))
+            #     else:
+            #         set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 49).widget(), QtGui.QColor(Qt.white))
+            #     if a_bit(data[4], i + 1) == 1:
+            #         set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 57).widget(), QtGui.QColor(Qt.red))
+            #     else:
+            #         set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 57).widget(), QtGui.QColor(Qt.white))
+            #     if a_bit(data[5], i + 1) == 1:
+            #         set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 65).widget(), QtGui.QColor(Qt.red))
+            #     else:
+            #         set_edt_bg(self.bms_balance_ctl._view.balance_fault_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 65).widget(), QtGui.QColor(Qt.white))
 
 
 
 
     def _inf_001C_signal(self, data, id):
     def _inf_001C_signal(self, data, id):

+ 0 - 7
controller/bms_status_ctl.py

@@ -1,12 +1,5 @@
 #!/usr/bin/env python
 #!/usr/bin/env python
 # -*- encoding: utf-8 -*-
 # -*- encoding: utf-8 -*-
-'''
-@文件    :bms_status_ctl.py
-@时间    :2022/02/21 16:57:56
-@作者    :None
-@版本    :1.0
-@说明    : 状态栏 CTL
-'''
 
 
 
 
 from widget.bms_status_bar import Win_Bms_Status_Bar
 from widget.bms_status_bar import Win_Bms_Status_Bar

+ 1 - 9
start.py

@@ -1,13 +1,5 @@
 #!/usr/bin/env python
 #!/usr/bin/env python
 # -*- encoding: utf-8 -*-
 # -*- encoding: utf-8 -*-
-'''
-@文件    :start.py
-@时间    :2023/11/26 15:57:45
-@作者    :樊春春
-@版本    :1.0
-@邮箱    :[email protected]
-@说明    :
-'''
 
 
 
 
 from sys import exit
 from sys import exit
@@ -22,7 +14,7 @@ def bms_start():
     # 主版本号
     # 主版本号
     SD.MAJOR_VERSION_NUMBER = 1
     SD.MAJOR_VERSION_NUMBER = 1
     # 子版本号
     # 子版本号
-    SD.MINOR_VERSION_NUMBER = 3
+    SD.MINOR_VERSION_NUMBER = 5
     # 修正版本号
     # 修正版本号
     SD.REVISION_NUMBER = "0-build_test"
     SD.REVISION_NUMBER = "0-build_test"
 
 

+ 1 - 1
ui/login.py

@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 #!/usr/bin/env python
 # -*- encoding: utf-8 -*-
 # -*- encoding: utf-8 -*-
 
 
-import os
+
 from ui.own.palette_theme import set_my_palette, set_sure_background
 from ui.own.palette_theme import set_my_palette, set_sure_background
 from utils.globalvar import SD
 from utils.globalvar import SD
 from utils.qt import QWidget, QComboBox, QVBoxLayout, QHBoxLayout, QLabel, QPushButton, QLineEdit, QSize, QRect, QCoreApplication, QMetaObject
 from utils.qt import QWidget, QComboBox, QVBoxLayout, QHBoxLayout, QLabel, QPushButton, QLineEdit, QSize, QRect, QCoreApplication, QMetaObject

+ 0 - 8
ui/main/main.py

@@ -1,13 +1,5 @@
 #!/usr/bin/env python
 #!/usr/bin/env python
 # -*- encoding: utf-8 -*-
 # -*- encoding: utf-8 -*-
-'''
-@文件    :main.py
-@时间    :2023/11/26 16:04:21
-@作者    :樊春春
-@版本    :1.0
-@邮箱    :[email protected]
-@说明    :
-'''
 
 
 
 
 from ui.own.frame_theme import MyFrame
 from ui.own.frame_theme import MyFrame

+ 1 - 1
ui/main/top_page.py

@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 #!/usr/bin/env python
 # -*- encoding: utf-8 -*-
 # -*- encoding: utf-8 -*-
 
 
-import os
+
 from ui.own.frame_theme import MyFrame
 from ui.own.frame_theme import MyFrame
 from utils.qt import QtWidgets
 from utils.qt import QtWidgets
 from utils.globalvar import SD
 from utils.globalvar import SD

+ 1 - 1
ui/main/under_page.py

@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 #!/usr/bin/env python
 # -*- encoding: utf-8 -*-
 # -*- encoding: utf-8 -*-
 
 
-import os
+
 from ui.own.frame_theme import MyFrame
 from ui.own.frame_theme import MyFrame
 from ui.own.palette_theme import set_edt_bg
 from ui.own.palette_theme import set_edt_bg
 from utils.qt import QtWidgets, Qt, QColor
 from utils.qt import QtWidgets, Qt, QColor

+ 6 - 6
ui/protect.py

@@ -799,23 +799,23 @@ class Protect(MyFrame):
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(72, 6, item)
         self.protect_table.setItem(72, 6, item)
 
 
-        item = QtWidgets.QTableWidgetItem("总容量配置")
+        item = QtWidgets.QTableWidgetItem("SOH配置")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(73, 0, item)
         self.protect_table.setItem(73, 0, item)
-        item = QtWidgets.QTableWidgetItem("Ah")
+        item = QtWidgets.QTableWidgetItem("")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(73, 2, item)
         self.protect_table.setItem(73, 2, item)
-        item = QtWidgets.QTableWidgetItem("0.1")
+        item = QtWidgets.QTableWidgetItem("0.01")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(73, 6, item)
         self.protect_table.setItem(73, 6, item)
 
 
-        item = QtWidgets.QTableWidgetItem("剩余容量配置")
+        item = QtWidgets.QTableWidgetItem("SOC配置")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(74, 0, item)
         self.protect_table.setItem(74, 0, item)
-        item = QtWidgets.QTableWidgetItem("Ah")
+        item = QtWidgets.QTableWidgetItem("")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(74, 2, item)
         self.protect_table.setItem(74, 2, item)
-        item = QtWidgets.QTableWidgetItem("0.1")
+        item = QtWidgets.QTableWidgetItem("0.01")
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
         self.protect_table.setItem(74, 6, item)
         self.protect_table.setItem(74, 6, item)
 
 

+ 0 - 7
ui/statusbar.py

@@ -1,12 +1,5 @@
 #!/usr/bin/env python
 #!/usr/bin/env python
 # -*- encoding: utf-8 -*-
 # -*- encoding: utf-8 -*-
-'''
-@文件    :statusbar.py
-@时间    :2022/01/22 09:55:34
-@作者    :None
-@版本    :1.0
-@说明    :状态栏页面
-'''
 
 
 
 
 from utils.qt import QStatusBar, QLabel, QFrame, QProgressBar, QMetaObject, QCoreApplication, QRadioButton, QButtonGroup, Qt
 from utils.qt import QStatusBar, QLabel, QFrame, QProgressBar, QMetaObject, QCoreApplication, QRadioButton, QButtonGroup, Qt

+ 0 - 8
utils/can.py

@@ -1,12 +1,5 @@
 #!/usr/bin/env python
 #!/usr/bin/env python
 # -*- encoding: utf-8 -*-
 # -*- encoding: utf-8 -*-
-'''
-@文件    :canConnect.py
-@时间    :2021/12/09 13:47:58
-@作者    :None
-@版本    :1.0
-@说明    :CAN连接驱动
-'''
 
 
 
 
 import csv
 import csv
@@ -492,7 +485,6 @@ class MessageDeal:
             timestamp = TPCANTimestamp()
             timestamp = TPCANTimestamp()
             res = PCAN.CAN_Read(self.canType,ctypes.byref(msg),ctypes.byref(timestamp))
             res = PCAN.CAN_Read(self.canType,ctypes.byref(msg),ctypes.byref(timestamp))
             if (res != PCAN_ERROR_QRCVEMPTY):
             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.format_msg_data(self.index, msg.ID, msg.LEN, msg.DATA, 1)
                 self.index += 1
                 self.index += 1
                 return 1, msg.ID, msg.DATA
                 return 1, msg.ID, msg.DATA

+ 0 - 7
utils/globalvar.py

@@ -1,12 +1,5 @@
 #!/usr/bin/env python
 #!/usr/bin/env python
 # -*- encoding: utf-8 -*-
 # -*- encoding: utf-8 -*-
-'''
-@文件    :globalvar.py
-@时间    :2022/01/22 10:11:23
-@作者    :None
-@版本    :1.0
-@说明    :全局变量
-'''
 
 
 
 
 from utils.can import MessageDeal
 from utils.can import MessageDeal

+ 0 - 7
utils/hex_bit.py

@@ -1,12 +1,5 @@
 #!/usr/bin/env python
 #!/usr/bin/env python
 # -*- encoding: utf-8 -*-
 # -*- encoding: utf-8 -*-
-'''
-@文件    :hexBit.py
-@时间    :2021/12/09 13:48:58
-@作者    :None
-@版本    :1.0
-@说明    :获取位的值
-'''
 
 
 
 
 def a_bit(data, i):
 def a_bit(data, i):

+ 0 - 8
utils/qt.py

@@ -1,13 +1,5 @@
 #!/usr/bin/env python
 #!/usr/bin/env python
 # -*- encoding: utf-8 -*-
 # -*- encoding: utf-8 -*-
-'''
-@文件    :qt.py
-@时间    :2022/02/21 16:48:46
-@作者    :None
-@版本    :1.0
-@说明    : pyqt和pyside2兼容包
-'''
-
 
 
 QT_CHOSE = 1
 QT_CHOSE = 1
 if QT_CHOSE:
 if QT_CHOSE:

+ 0 - 7
utils/resource.py

@@ -1,12 +1,5 @@
 #!/usr/bin/env python
 #!/usr/bin/env python
 # -*- encoding: utf-8 -*-
 # -*- encoding: utf-8 -*-
-'''
-@文件    :resourcePath.py
-@时间    :2021/12/09 13:49:58
-@作者    :None
-@版本    :1.0
-@说明    :资源文件路径配置
-'''
 
 
 
 
 from os import path
 from os import path

+ 0 - 1
widget/bms_balance.py

@@ -27,5 +27,4 @@ class Win_Balance(Balance, MyFrame):
 
 
 
 
     def _balance_ctl(self, state, cmu_id, cell_id):
     def _balance_ctl(self, state, cmu_id, cell_id):
-        # print(cmu_id, cell_id, state)
         self.balance_control_signal.emit(cmu_id, cell_id, state)
         self.balance_control_signal.emit(cmu_id, cell_id, state)

+ 0 - 7
widget/bms_home.py

@@ -1,12 +1,5 @@
 #!/usr/bin/env python
 #!/usr/bin/env python
 # -*- encoding: utf-8 -*-
 # -*- encoding: utf-8 -*-
-'''
-@文件    :bms_home.py
-@时间    :2021/12/09 13:33:56
-@作者    :None
-@版本    :1.0
-@说明    :主页面逻辑
-'''
 
 
 
 
 from utils.globalvar import SD
 from utils.globalvar import SD

+ 0 - 7
widget/bms_login.py

@@ -1,12 +1,5 @@
 #!/usr/bin/env python
 #!/usr/bin/env python
 # -*- encoding: utf-8 -*-
 # -*- encoding: utf-8 -*-
-'''
-@文件    :bms_login.py
-@时间    :2022/01/03 09:35:16
-@作者    :None
-@版本    :1.0
-@说明    :登录逻辑
-'''
 
 
 
 
 from ui.login import UiBmsLoginPage
 from ui.login import UiBmsLoginPage

+ 1 - 8
worker/bms_work.py

@@ -1,13 +1,6 @@
 #!/usr/bin/env python
 #!/usr/bin/env python
 # -*- encoding: utf-8 -*-
 # -*- encoding: utf-8 -*-
-'''
-@文件    :bms_work.py
-@时间    :2024/03/09 13:28:43
-@作者    :FF
-@版本    :1.0
-@邮箱    :[email protected]
-@说明    :BMS工作线程
-'''
+
 
 
 from utils.globalvar import SD
 from utils.globalvar import SD
 from utils.qt import QObject, Signal
 from utils.qt import QObject, Signal