12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475 |
- #!/usr/bin/env python
- # -*- encoding: utf-8 -*-
- from controller.bms_cell_ctl import BmsCellControll
- from controller.bms_double_ccu_ctl import BmsDoubleCcuControll
- from controller.bms_protect_ctl import BmsProtectControll
- from controller.bms_hard_ctl import BmsHardControll
- from controller.bms_balance_ctl import BmsBalanceControll
- from controller.bms_record_ctl import BmsRecordControll
- from controller.bms_download_ctl import BmsDownloadControll
- from controller.bms_set_ctl import BmsSetControll
- from controller.bms_status_ctl import BmsStatusControll
- from model.record_model import RecordModel
- from widget.bms_home import Win_GotionBMS
- from controller.bms_main_ctl import BmsMainControll
- from utils.qt import QThread, QColor, Qt, QDateTime, QtGui, QtWidgets, QApplication, QtCore
- from utils.hex_bit import a_bit
- from utils.resource import resource_path
- from utils.globalvar import SD
- from worker.bms_work import BmsReceived
- from ui.own.palette_theme import set_edt_bg
- from ctypes import c_int16
- import csv
- import os
- class BmsHomeControll:
- def __init__(self):
- self._view = Win_GotionBMS()
- self._model = RecordModel()
- self.bms_sn_version = ["" for i in range(16)]
- self.battery_sn_version = ["" for i in range(16)]
- self.cell_single_volt = [0 for i in range(396)]
- self.cell_single_temp = [0 for i in range(360)]
- self.init()
- def init(self):
- self.bms_main_ctl = BmsMainControll()
- self._view.bms_tab.addWidget(self.bms_main_ctl._view.main)
- self.bms_cell_ctl = BmsCellControll()
- self._view.bms_tab.addWidget(self.bms_cell_ctl._view.cell)
- self.bms_double_ccu_ctl = BmsDoubleCcuControll()
- self._view.bms_tab.addWidget(self.bms_double_ccu_ctl._view.double_ccu)
- self.bms_protect_ctl = BmsProtectControll()
- self._view.bms_tab.addWidget(self.bms_protect_ctl._view.protect)
- self.bms_hard_ctl = BmsHardControll()
- self._view.bms_tab.addWidget(self.bms_hard_ctl._view.hard)
- self.bms_balance_ctl = BmsBalanceControll()
- self._view.bms_tab.addWidget(self.bms_balance_ctl._view.balance)
- self.bms_record_ctl = BmsRecordControll()
- self._view.bms_tab.addWidget(self.bms_record_ctl._view.record)
- self.bms_download_ctl = BmsDownloadControll()
- self._view.bms_tab.addWidget(self.bms_download_ctl._view.download)
- self.bms_set_ctl = BmsSetControll()
- self._view.bms_tab.addWidget(self.bms_set_ctl._view.set)
- self.bms_status = BmsStatusControll()
- self._view.setStatusBar(self.bms_status._view.statusbar)
- self._view.main_control_signal.connect(self._page_index)
- self._view.cell_inf_signal.connect(self._page_index)
- self._view.double_ccu_signal.connect(self._page_index)
- self._view.protect_inf_signal.connect(self._page_index)
- self._view.hard_cali_signal.connect(self._page_index)
- self._view.balance_inf_signal.connect(self._page_index)
- self._view.data_inf_signal.connect(self._page_index)
- self._view.download_signal.connect(self._page_index)
- self._view.set_inf_signal.connect(self._page_index)
- self._view.can_start_signal.connect(self.bcu_connect)
- self._view.can_stop_signal.connect(self.bcu_disconnect)
- self._view.cut_start_signal.connect(self.app_cut)
- self._view.bcu_online_list_signal.connect(self._view._bcu_connect_get)
- def _page_index(self,index):
- self._view.bms_tab.setCurrentIndex(index)
- def bcu_connect(self):
- try:
- SD.CAN_ON_OFF = SD.CAN_CONTROL.open_device()
- except:
- SD.CAN_ON_OFF = 0
- if SD.CAN_ON_OFF:
- self.bms_status._view.label_bms_connect.setText("通讯已连接" if SD.SYSTEM_LANGUAGE == 0 else "BMS Connected")
- SD.START_RUN = True
- # CAN数据接收类
- self.bms_received_thread = QThread()
- self.bms_received = BmsReceived()
- self.bms_received.moveToThread(self.bms_received_thread)
- self.bms_received_thread.started.connect(self.bms_received.received)
- # 启动线程
- self.bms_received_thread.start()
- self.bms_received.to_show_masterid_signal.connect(self._get_master_id)
- self.bms_received.to_show_0000_signal.connect(self._inf_0000_signal)
- self.bms_received.to_show_0001_signal.connect(self._inf_0001_signal)
- self.bms_received.to_show_0002_signal.connect(self._inf_0002_signal)
- self.bms_received.to_show_0003_signal.connect(self._inf_0003_signal)
- self.bms_received.to_show_0004_signal.connect(self._inf_0004_signal)
- self.bms_received.to_show_0005_signal.connect(self._inf_0005_signal)
- self.bms_received.to_show_0006_signal.connect(self._inf_0006_signal)
- self.bms_received.to_show_0007_signal.connect(self._inf_0007_signal)
- self.bms_received.to_show_0008_signal.connect(self._inf_0008_signal)
- self.bms_received.to_show_0009_signal.connect(self._inf_0009_signal)
- self.bms_received.to_show_000A_signal.connect(self._inf_000A_signal)
- self.bms_received.to_show_000B_signal.connect(self._inf_000B_signal)
- self.bms_received.to_show_000C_signal.connect(self._inf_000C_signal)
- self.bms_received.to_show_000D_signal.connect(self._inf_000D_signal)
- self.bms_received.to_show_000E_signal.connect(self._inf_000E_signal)
- self.bms_received.to_show_000F_signal.connect(self._inf_000F_signal)
- self.bms_received.to_show_0010_signal.connect(self._inf_0010_signal)
- self.bms_received.to_show_0011_signal.connect(self._inf_0011_signal)
- self.bms_received.to_show_0012_signal.connect(self._inf_0012_signal)
- self.bms_received.to_show_0013_signal.connect(self._inf_0013_signal)
- self.bms_received.to_show_0014_signal.connect(self._inf_0014_signal)
- self.bms_received.to_show_0015_signal.connect(self._inf_0015_signal)
- self.bms_received.to_show_0016_signal.connect(self._inf_0016_signal)
- self.bms_received.to_show_0017_signal.connect(self._inf_0017_signal)
- self.bms_received.to_show_0018_signal.connect(self._inf_0018_signal)
- self.bms_received.to_show_0019_signal.connect(self._inf_0019_signal)
- self.bms_received.to_show_001A_signal.connect(self._inf_001A_signal)
- self.bms_received.to_show_001B_signal.connect(self._inf_001B_signal)
- self.bms_received.to_show_001C_signal.connect(self._inf_001C_signal)
- self.bms_received.to_show_001D_signal.connect(self._inf_001D_signal)
- self.bms_received.to_show_001E_signal.connect(self._inf_001E_signal)
- self.bms_received.to_show_001F_signal.connect(self._inf_001F_signal)
- self.bms_received.to_show_0020_signal.connect(self._inf_0020_signal)
- self.bms_received.to_show_0021_signal.connect(self._inf_0021_signal)
- self.bms_received.to_show_0022_signal.connect(self._inf_0022_signal)
- self.bms_received.to_show_0023_signal.connect(self._inf_0023_signal)
- self.bms_received.to_show_1802_signal.connect(self._inf_1802_signal)
- self.bms_received.to_show_1803_signal.connect(self._inf_1803_signal)
- self._view.btn_start.setDisabled(True)
- self._view.btn_stop.setDisabled(False)
- else:
- self._view.can_connect_error()
-
- def bcu_disconnect(self):
- if SD.CAN_ON_OFF:
- SD.CAN_ON_OFF = False
- SD.START_RUN = False
- SD.CAN_CONTROL.close_can()
- if self.bms_received_thread.isRunning():
- self.bms_received_thread.quit()
- self.bms_received_thread.wait()
- if self.bms_received_thread.isFinished():
- del self.bms_received
- del self.bms_received_thread
- self._view.btn_start.setDisabled(False)
- self._view.btn_stop.setDisabled(True)
- self.bms_status._view.label_bms_connect.setText("通讯未连接" if SD.SYSTEM_LANGUAGE == 0 else "Not Connected")
-
- else:
- self._view.can_connect_error()
- def app_cut(self):
- main_window = QApplication.primaryScreen()
- rect = QtCore.QRect()
- rect.setX(self._view.mapToGlobal(QtCore.QPoint(0, 0)).x())
- rect.setY(self._view.mapToGlobal(QtCore.QPoint(0, 0)).y())
- rect.setWidth(self._view.width())
- rect.setHeight(self._view.height())
- print(rect.x())
- print(rect.y())
- print(rect.width())
- print(rect.height())
- pixmap = main_window.grabWindow(self._view.winId(), rect.x(), rect.y(), rect.width(), rect.height())
- # pixmap = pixmap.scaled(QtCore.QSize(rect.width(), rect.height()), Qt.KeepAspectRatio)
- time_str = "/shotcut_" + QDateTime.currentDateTime().toString("yyyy_MM_dd_HH_mm_ss") + '.png'
- shot_str_path = resource_path("screen_shot")
- if not os.path.exists(shot_str_path):
- os.mkdir(shot_str_path)
- pic_cut_name = shot_str_path + time_str
- pixmap.save(pic_cut_name);
- def _get_master_id(self, data):
- SD.BCU_LIST[data - 1] = 1
- SD.BCU_LIFE_STATE[data - 1] = QDateTime.currentMSecsSinceEpoch()
- current_secs_since_epoch = QDateTime.currentMSecsSinceEpoch()
- for i in range(9):
- if current_secs_since_epoch - SD.BCU_LIFE_STATE[i] > 2000:
- SD.BCU_LIST[i] = 0
- self._view.bcu_online_list_signal.emit(SD.BCU_LIST)
- # 簇号
- item = QtWidgets.QTableWidgetItem(str(data))
- item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
- self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(data - 1, 0, item)
- def _inf_0000_signal(self, data, id):
- if id == SD.BCU_ID:
- self._model.ccu_id = SD.BCU_ID
- # 系统状态
- 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_high_no, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_chg, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_dchg, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_stop, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_sleep, QColor(Qt.gray))
- elif data[0] & 0x0F == 0x01:
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_no, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_high_no, QColor(Qt.green))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_chg, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_dchg, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_stop, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_sleep, QColor(Qt.gray))
- elif data[0] & 0x0F == 0x02:
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_no, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_high_no, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_chg, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_dchg, QColor(Qt.green))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_stop, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_sleep, QColor(Qt.gray))
- elif data[0] & 0x0F == 0x03:
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_no, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_high_no, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_chg, QColor(Qt.green))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_dchg, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_stop, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_sleep, QColor(Qt.gray))
- elif data[0] & 0x0F == 0x04:
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_no, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_high_no, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_chg, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_dchg, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_stop, QColor(Qt.green))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_sleep, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_no, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_high_no, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_chg, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_dchg, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_stop, QColor(Qt.gray))
- set_edt_bg(self.bms_main_ctl._view.under_widget.sys_status_sleep, QColor(Qt.green))
-
- # 最高报警等级
- if (data[0] & 0x30) >> 4 == 0x00:
- self.bms_status._view.qrb_status_normal.setChecked(1)
- self.bms_status._view.qrb_status_warn.setChecked(0)
- self.bms_status._view.qrb_status_warner.setChecked(0)
- self.bms_status._view.qrb_status_warnest.setChecked(0)
- elif (data[0] & 0x30) >> 4 == 0x01:
- self.bms_status._view.qrb_status_normal.setChecked(0)
- self.bms_status._view.qrb_status_warn.setChecked(1)
- self.bms_status._view.qrb_status_warner.setChecked(0)
- self.bms_status._view.qrb_status_warnest.setChecked(0)
- elif (data[0] & 0x30) >> 4 == 0x02:
- self.bms_status._view.qrb_status_normal.setChecked(0)
- self.bms_status._view.qrb_status_warn.setChecked(0)
- self.bms_status._view.qrb_status_warner.setChecked(1)
- self.bms_status._view.qrb_status_warnest.setChecked(0)
- else:
- self.bms_status._view.qrb_status_normal.setChecked(0)
- self.bms_status._view.qrb_status_warn.setChecked(0)
- self.bms_status._view.qrb_status_warner.setChecked(0)
- self.bms_status._view.qrb_status_warnest.setChecked(1)
-
- self._model.fault_level = (data[0] & 0x30) >> 4
- 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标志
- if SD.CCU_TYPE == 0:
- 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故障
- if a_bit(data[1], 5) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.chg_mos_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.chg_mos_fault, QColor(Qt.red))
- # 放电MOS故障
- if a_bit(data[1], 4) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.dchg_mos_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.dchg_mos_fault, 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:
- sys_status = "低压上电"
- elif data[0] & 0x0F == 0x01:
- sys_status = "待机"
- elif data[0] & 0x0F == 0x02:
- sys_status = "放电"
- elif data[0] & 0x0F == 0x03:
- sys_status = "充电"
- elif data[0] & 0x0F == 0x04:
- sys_status = "停机"
- elif data[0] & 0x0F == 0x04:
- sys_status = "准备休眠"
- else:
- sys_status = "无"
-
- item = QtWidgets.QTableWidgetItem(sys_status)
- item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
- 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.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
- self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(id - 1, 2, item)
- # 总电流
- item = QtWidgets.QTableWidgetItem(str(round((data[5] << 8 | data[4]) * 0.1 - 3200, 1)))
- item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
- self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(id - 1, 3, item)
- # SOH
- item = QtWidgets.QTableWidgetItem(str(round((data[7] << 8 | data[6]) * 0.01, 2)))
- item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
- self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(id - 1, 5, item)
- def _inf_0002_signal(self, data, id):
- if id == SD.BCU_ID:
- # 单体过压告警
- if data[0] & 0x03 == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.over_cell_warn, QColor(Qt.gray))
- elif data[0] & 0x03 == 1:
- set_edt_bg(self.bms_main_ctl._view.center_widget.over_cell_warn, QColor(Qt.red))
- elif data[0] & 0x03 == 2:
- set_edt_bg(self.bms_main_ctl._view.center_widget.over_cell_warn, QColor(Qt.magenta))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.over_cell_warn, QColor(Qt.yellow))
- # 总压过压告警
- if ((data[0] & 0x0C) >> 2) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.hv_warn, QColor(Qt.gray))
- elif ((data[0] & 0x0C) >> 2) == 1:
- set_edt_bg(self.bms_main_ctl._view.center_widget.hv_warn, QColor(Qt.red))
- elif ((data[0] & 0x0C) >> 2) == 2:
- set_edt_bg(self.bms_main_ctl._view.center_widget.hv_warn, QColor(Qt.magenta))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.hv_warn, QColor(Qt.yellow))
- # 单体欠压告警
- if ((data[0] & 0x30) >> 4) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.under_cell_warn, QColor(Qt.gray))
- elif ((data[0] & 0x30) >> 4) == 1:
- set_edt_bg(self.bms_main_ctl._view.center_widget.under_cell_warn, QColor(Qt.red))
- elif ((data[0] & 0x30) >> 4) == 2:
- set_edt_bg(self.bms_main_ctl._view.center_widget.under_cell_warn, QColor(Qt.magenta))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.under_cell_warn, QColor(Qt.yellow))
- # 总压欠压告警
- if ((data[0] & 0xC0) >> 6) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.lv_warn, QColor(Qt.gray))
- elif ((data[0] & 0xC0) >> 6) == 1:
- set_edt_bg(self.bms_main_ctl._view.center_widget.lv_warn, QColor(Qt.red))
- elif ((data[0] & 0xC0) >> 6) == 2:
- set_edt_bg(self.bms_main_ctl._view.center_widget.lv_warn, QColor(Qt.magenta))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.lv_warn, QColor(Qt.yellow))
- # =====================================================================================
- # 充电低温告警
- if data[1] & 0x03 == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.chg_lt_warn, QColor(Qt.gray))
- elif data[1] & 0x03 == 1:
- set_edt_bg(self.bms_main_ctl._view.center_widget.chg_lt_warn, QColor(Qt.red))
- elif data[1] & 0x03 == 2:
- set_edt_bg(self.bms_main_ctl._view.center_widget.chg_lt_warn, QColor(Qt.magenta))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.chg_lt_warn, QColor(Qt.yellow))
- # 充电高温告警
- if ((data[1] & 0x0C) >> 2) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.chg_ht_warn, QColor(Qt.gray))
- elif ((data[1] & 0x0C) >> 2) == 1:
- set_edt_bg(self.bms_main_ctl._view.center_widget.chg_ht_warn, QColor(Qt.red))
- elif ((data[1] & 0x0C) >> 2) == 2:
- set_edt_bg(self.bms_main_ctl._view.center_widget.chg_ht_warn, QColor(Qt.magenta))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.chg_ht_warn, QColor(Qt.yellow))
- # 放电低温告警
- if ((data[1] & 0x30) >> 4) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.dchg_lt_warn, QColor(Qt.gray))
- elif ((data[1] & 0x30) >> 4) == 1:
- set_edt_bg(self.bms_main_ctl._view.center_widget.dchg_lt_warn, QColor(Qt.red))
- elif ((data[1] & 0x30) >> 4) == 2:
- set_edt_bg(self.bms_main_ctl._view.center_widget.dchg_lt_warn, QColor(Qt.magenta))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.dchg_lt_warn, QColor(Qt.yellow))
- # 放电高温告警
- if ((data[1] & 0xC0) >> 6) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.dchg_ht_warn, QColor(Qt.gray))
- elif ((data[1] & 0xC0) >> 6) == 1:
- set_edt_bg(self.bms_main_ctl._view.center_widget.dchg_ht_warn, QColor(Qt.red))
- elif ((data[1] & 0xC0) >> 6) == 2:
- set_edt_bg(self.bms_main_ctl._view.center_widget.dchg_ht_warn, QColor(Qt.magenta))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.dchg_ht_warn, QColor(Qt.yellow))
- # =====================================================================================
- # 充电过流告警
- if data[2] & 0x03 == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.chg_hcur_warn, QColor(Qt.gray))
- elif data[2] & 0x03 == 1:
- set_edt_bg(self.bms_main_ctl._view.center_widget.chg_hcur_warn, QColor(Qt.red))
- elif data[2] & 0x03 == 2:
- set_edt_bg(self.bms_main_ctl._view.center_widget.chg_hcur_warn, QColor(Qt.magenta))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.chg_hcur_warn, QColor(Qt.yellow))
- # 放电过流告警
- if ((data[2] & 0x0C) >> 2) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.dchg_hcur_warn, QColor(Qt.gray))
- elif ((data[2] & 0x0C) >> 2) == 1:
- set_edt_bg(self.bms_main_ctl._view.center_widget.dchg_hcur_warn, QColor(Qt.red))
- elif ((data[2] & 0x0C) >> 2) == 2:
- set_edt_bg(self.bms_main_ctl._view.center_widget.dchg_hcur_warn, QColor(Qt.magenta))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.dchg_hcur_warn, QColor(Qt.yellow))
- # 单体压差告警
- if ((data[2] & 0x30) >> 4) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.diff_cell_vol_warn, QColor(Qt.gray))
- elif ((data[2] & 0x30) >> 4) == 1:
- set_edt_bg(self.bms_main_ctl._view.center_widget.diff_cell_vol_warn, QColor(Qt.red))
- elif ((data[2] & 0x30) >> 4) == 2:
- set_edt_bg(self.bms_main_ctl._view.center_widget.diff_cell_vol_warn, QColor(Qt.magenta))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.diff_cell_vol_warn, QColor(Qt.yellow))
- # 单体温差告警
- if ((data[2] & 0xC0) >> 6) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.diff_cell_temp_warn, QColor(Qt.gray))
- elif ((data[2] & 0xC0) >> 6) == 1:
- set_edt_bg(self.bms_main_ctl._view.center_widget.diff_cell_temp_warn, QColor(Qt.red))
- elif ((data[2] & 0xC0) >> 6) == 2:
- set_edt_bg(self.bms_main_ctl._view.center_widget.diff_cell_temp_warn, QColor(Qt.magenta))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.diff_cell_temp_warn, QColor(Qt.yellow))
- # =====================================================================================
- # 绝缘过低报警
- if data[3] & 0x03 == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.against_warn, QColor(Qt.gray))
- elif data[3] & 0x03 == 1:
- set_edt_bg(self.bms_main_ctl._view.center_widget.against_warn, QColor(Qt.red))
- elif data[3] & 0x03 == 2:
- set_edt_bg(self.bms_main_ctl._view.center_widget.against_warn, QColor(Qt.magenta))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.against_warn, QColor(Qt.yellow))
- # 正极绝缘过低报警
- if a_bit(data[3], 3) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.p_against_warn, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.p_against_warn, QColor(Qt.red))
- # 负极绝缘过低报警
- if a_bit(data[3], 4) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.p_against_warn, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.p_against_warn, QColor(Qt.red))
- # AFE温度过高
- if ((data[3] & 0x30) >> 4) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.afe_high_temp_fault, QColor(Qt.gray))
- elif ((data[3] & 0x30) >> 4) == 1:
- set_edt_bg(self.bms_main_ctl._view.center_widget.afe_high_temp_fault, QColor(Qt.red))
- elif ((data[3] & 0x30) >> 4) == 2:
- set_edt_bg(self.bms_main_ctl._view.center_widget.afe_high_temp_fault, QColor(Qt.magenta))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.afe_high_temp_fault, QColor(Qt.yellow))
- # 极柱温度过高
- if ((data[3] & 0xC0) >> 6) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.jz_ht_warn, QColor(Qt.gray))
- elif ((data[3] & 0xC0) >> 6) == 1:
- set_edt_bg(self.bms_main_ctl._view.center_widget.jz_ht_warn, QColor(Qt.red))
- elif ((data[3] & 0xC0) >> 6) == 2:
- set_edt_bg(self.bms_main_ctl._view.center_widget.jz_ht_warn, QColor(Qt.magenta))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.jz_ht_warn, QColor(Qt.yellow))
- # =====================================================================================
- # 总压检测故障
- if a_bit(data[4], 1) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.vol_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.vol_fault, QColor(Qt.red))
-
- # 电流检测故障
- if a_bit(data[4], 2) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.cur_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.cur_fault, QColor(Qt.red))
- # 总控通讯故障
- if a_bit(data[4], 3) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.ccu_control_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.ccu_control_fault, QColor(Qt.red))
- # BMU通讯故障
- if a_bit(data[4], 4) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.bmu_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.bmu_fault, QColor(Qt.red))
- # 急停
- if a_bit(data[4], 5) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.stop_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.stop_fault, QColor(Qt.red))
- # NTC故障
- if a_bit(data[4], 6) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.ntc_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.ntc_fault, QColor(Qt.red))
- # AFE失效
- if a_bit(data[4], 7) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.afe_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.afe_fault, QColor(Qt.red))
- # 主正接触器故障
- if a_bit(data[4], 8) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.p_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.p_fault, QColor(Qt.red))
- # =====================================================================================
- # 主负接触器故障
- if a_bit(data[5], 1) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.n_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.n_fault, QColor(Qt.red))
-
- # 预充故障
- if a_bit(data[5], 2) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.pre_chg_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.pre_chg_fault, QColor(Qt.red))
- # 绝缘检测故障
- if a_bit(data[5], 3) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.against_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.against_fault, QColor(Qt.red))
- # 从控硬件故障
- if a_bit(data[5], 4) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.bcu_hard_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.bcu_hard_fault, QColor(Qt.red))
- # # 充电MOS故障
- # if a_bit(data[5], 3) == 0:
- # set_edt_bg(self.bms_main_ctl._view.center_widget.chg_mos_fault, QColor(Qt.gray))
- # else:
- # set_edt_bg(self.bms_main_ctl._view.center_widget.chg_mos_fault, QColor(Qt.red))
- # # 放电MOS故障
- # if a_bit(data[5], 4) == 0:
- # set_edt_bg(self.bms_main_ctl._view.center_widget.dchg_mos_fault, QColor(Qt.gray))
- # else:
- # set_edt_bg(self.bms_main_ctl._view.center_widget.dchg_mos_fault, QColor(Qt.red))
- # 风扇控制失效
- if a_bit(data[5], 5) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.fan_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.fan_fault, QColor(Qt.red))
- # 热失控故障
- if a_bit(data[5], 6) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.temp_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.temp_fault, QColor(Qt.red))
- # 温升过高故障
- if a_bit(data[5], 7) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.temp_up_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.temp_up_fault, QColor(Qt.red))
- # 中间接触器故障
- if a_bit(data[5], 8) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.center_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.center_fault, QColor(Qt.red))
- # =====================================================================================
- # 单体断线故障
- if a_bit(data[6], 1) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.cell_single_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.cell_single_fault, QColor(Qt.red))
-
- # 主控硬件故障
- if a_bit(data[6], 2) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.ccu_hard_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.ccu_hard_fault, QColor(Qt.red))
- # 主控初始化故障
- if a_bit(data[6], 3) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.ccu_start_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.ccu_start_fault, QColor(Qt.red))
- # EEPROM故障
- if a_bit(data[6], 4) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.eeprom_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.eeprom_fault, QColor(Qt.red))
- # 熔断器故障
- if a_bit(data[6], 5) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.rdq_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.rdq_fault, QColor(Qt.red))
- # 断路器反馈故障
- if a_bit(data[6], 6) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.dlq_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.dlq_fault, QColor(Qt.red))
- # 簇间压差故障
- if a_bit(data[6], 7) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.ccu_diff_vol_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.ccu_diff_vol_fault, QColor(Qt.red))
- # PCS通讯故障
- if a_bit(data[6], 8) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.pcs_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.pcs_fault, QColor(Qt.red))
- # =====================================================================================
- # 跳机故障
- if a_bit(data[7], 1) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.jump_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.jump_fault, QColor(Qt.red))
- # 隔离开关故障
- if a_bit(data[7], 2) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.glkg_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.glkg_fault, QColor(Qt.red))
- # 主控检测温度过高故障
- if a_bit(data[7], 3) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.ccu_ht_warn, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.ccu_ht_warn, QColor(Qt.red))
- # MOS温度过高故障
- if ((data[7] & 0x18) >> 3) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.mos_ht_warn, QColor(Qt.gray))
- elif ((data[7] & 0x18) >> 3) == 1:
- set_edt_bg(self.bms_main_ctl._view.center_widget.mos_ht_warn, QColor(Qt.red))
- elif ((data[2] & 0x18) >> 3) == 2:
- set_edt_bg(self.bms_main_ctl._view.center_widget.mos_ht_warn, QColor(Qt.magenta))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.mos_ht_warn, QColor(Qt.yellow))
- # 电芯故障
- if a_bit(data[7], 6) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.cell_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.cell_fault, QColor(Qt.red))
- # SOC过低故障
- if a_bit(data[7], 7) == 0:
- set_edt_bg(self.bms_main_ctl._view.center_widget.soc_fault, QColor(Qt.gray))
- else:
- set_edt_bg(self.bms_main_ctl._view.center_widget.soc_fault, QColor(Qt.red))
- def _inf_0003_signal(self, data, id):
- if id == SD.BCU_ID:
- # 最高单体电压值
- self.bms_main_ctl._view.top_widget.lb_tcellhv_value.setText(str(data[1] << 8 | data[0]))
- self._model.max_cell_volt = data[1] << 8 | data[0]
- # 最高单体电压所在编号
- self.bms_main_ctl._view.top_widget.lb_tcellhv_index_value.setText(str(data[3] << 8 | data[2]))
- self._model.max_cell_volt_id = data[3] << 8 | data[2]
- # 最低单体电压值
- self.bms_main_ctl._view.top_widget.lb_tcelllv_value.setText(str(data[5] << 8 | data[4]))
- self._model.min_cell_volt = data[5] << 8 | data[4]
- # 最低单体电压所在编号
- self.bms_main_ctl._view.top_widget.lb_tcelllv_index_value.setText(str(data[7] << 8 | data[6]))
- self._model.min_cell_volt_id = data[7] << 8 | data[6]
- # 最高单体电压值
- item = QtWidgets.QTableWidgetItem(str(data[1] << 8 | data[0]))
- item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
- self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(id - 1, 8, item)
- # 最高单体电压所在编号
- item = QtWidgets.QTableWidgetItem(str(data[3] << 8 | data[2]))
- item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
- self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(id - 1, 9, item)
- # 最低单体电压值
- item = QtWidgets.QTableWidgetItem(str(data[5] << 8 | data[4]))
- item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
- self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(id - 1, 10, item)
- # 最低单体电压所在编号
- item = QtWidgets.QTableWidgetItem(str(data[7] << 8 | data[6]))
- item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
- self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(id - 1, 11, item)
- def _inf_0004_signal(self, data, id):
- if id == SD.BCU_ID:
- # 最大压差
- self.bms_main_ctl._view.top_widget.lb_diff_vol_value.setText(str(data[1] << 8 | data[0]))
- # 平均电压
- self.bms_main_ctl._view.top_widget.lb_avg_vol_value.setText(str(data[3] << 8 | data[2]))
- self._model.avg_cell_volt = data[3] << 8 | data[2]
- # 最大温差
- self.bms_main_ctl._view.top_widget.lb_diff_temp_value.setText(str(round((data[5] << 8 | data[4]) * 0.1 - 40, 1)))
- # 平均温度
- self.bms_main_ctl._view.top_widget.lb_avg_temp_value.setText(str(round((data[7] << 8 | data[6]) * 0.1 - 40, 1)))
- self._model.avg_cell_temp = round((data[7] << 8 | data[6]) * 0.1 - 40, 1)
- def _inf_0005_signal(self, data, id):
- if id == SD.BCU_ID:
- # 最高单体温度值
- self.bms_main_ctl._view.top_widget.lb_h_temp_value.setText(str(round((data[1] << 8 | data[0]) * 0.1 - 40, 1)))
- self._model.max_cell_temp = round((data[1] << 8 | data[0]) * 0.1 - 40, 1)
- # 最高单体温度所在编号
- self.bms_main_ctl._view.top_widget.lb_h_temp_index_value.setText(str(data[3] << 8 | data[2]))
- self._model.max_cell_temp_id = data[3] << 8 | data[2]
- # 最低单体温度值
- 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_l_temp_index_value.setText(str(data[7] << 8 | data[6]))
- self._model.min_cell_temp_id = data[7] << 8 | data[6]
- # 最高单体温度值
- item = QtWidgets.QTableWidgetItem(str(round((data[1] << 8 | data[0]) * 0.1 - 40, 1)))
- item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
- self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(id - 1, 12, item)
- # 最高单体温度所在编号
- item = QtWidgets.QTableWidgetItem(str(data[3] << 8 | data[2]))
- item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
- self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(id - 1, 13, item)
- # 最低单体温度值
- item = QtWidgets.QTableWidgetItem(str(round((data[5] << 8 | data[4]) * 0.1 - 40, 1)))
- item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
- self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(id - 1, 14, item)
- # # 最低单体温度所在编号
- # item = QtWidgets.QTableWidgetItem(str(data[7] << 8 | data[6]))
- # item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
- # self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(id - 1, 15, item)
- def _inf_0006_signal(self, data, id):
- if id == SD.BCU_ID:
- # 当前允许最大放电功率
- self.bms_main_ctl._view.top_widget.lb_dchg_kw_value.setText(str(round((data[1] << 8 | data[0]) * 0.1, 1)))
- # 当前允许最大充电功率
- self.bms_main_ctl._view.top_widget.lb_chg_kw_value.setText(str(round((data[3] << 8 | data[2]) * 0.1, 1)))
- # # 当前可放电量
- # self.bms_main_ctl._view.top_widget.lb_.setText(str((data[5] << 8 | data[4]) * 0.1 - 40))
- # # 当前可充电量
- # self.bms_main_ctl._view.top_widget.lb_avg_temp_value.setText(str((data[7] << 8 | data[6]) * 0.1 - 40))
- def _inf_0007_signal(self, data, id):
- if id == SD.BCU_ID:
- # 当前允许最大充电电压
- self.bms_main_ctl._view.top_widget.lb_max_chg_vol_value.setText(str(round((data[1] << 8 | data[0]) * 0.1, 1)))
- # 当前允许最大充电电流
- self.bms_main_ctl._view.top_widget.lb_max_chg_cur_value.setText(str(round((data[3] << 8 | data[2]) * 0.1 - 3200, 1)))
- # 当前允许最大放电电流
- self.bms_main_ctl._view.top_widget.lb_max_dchg_cur_value.setText(str(round((data[5] << 8 | data[4]) * 0.1 - 3200, 1)))
- # 当前允许放电限制电压
- self.bms_main_ctl._view.top_widget.lb_max_dchg_vol_value.setText(str(round((data[7] << 8 | data[6]) * 0.1, 1)))
- def _inf_0008_signal(self, data, id):
- if id == SD.BCU_ID:
- # 电池组单体电压累加和
- self.bms_main_ctl._view.top_widget.lb_sum_vol_value.setText(str(round((data[1] << 8 | data[0]) * 0.1, 1)))
- # 总压一检测
- self.bms_main_ctl._view.top_widget.lb_tv_value.setText(str(round((data[3] << 8 | data[2]) * 0.1, 1)))
- # 总压二检测
- self.bms_main_ctl._view.top_widget.lb_tv_2_value.setText(str(round((data[5] << 8 | data[4]) * 0.1, 1)))
- # 总压三检测
- self.bms_main_ctl._view.top_widget.lb_tv_3_value.setText(str(round((data[7] << 8 | data[6]) * 0.1, 1)))
-
- def _inf_0009_signal(self, data, id):
- if id == SD.BCU_ID:
- # 电池组标称容量
- self.bms_main_ctl._view.top_widget.lb_nom_cap_value.setText(str(round((data[1] << 8 | data[0]) * 0.1, 1)))
- # 电池组总容量
- self.bms_main_ctl._view.top_widget.lb_all_cap_value.setText(str(round((data[3] << 8 | data[2]) * 0.1, 1)))
- # 电池组剩余容量
- self.bms_main_ctl._view.top_widget.lb_left_cap_value.setText(str(round((data[5] << 8 | data[4]) * 0.1, 1)))
- # SOE
- self.bms_main_ctl._view.top_widget.lb_tsoe_value.setText(str(round(data[6] * 0.4, 1)))
- # SOE
- item = QtWidgets.QTableWidgetItem(str(round(data[6] * 0.4, 1)))
- item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
- self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(id - 1, 6, item)
- def _inf_000A_signal(self, data, id):
- if id == SD.BCU_ID:
- # 最高单体SOC
- 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
- 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
- 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]))
- def _inf_000B_signal(self, data, id):
- if id == SD.BCU_ID:
- # 电池组标称能量
- self.bms_main_ctl._view.top_widget.lb_nom_energy_value.setText(str(round((data[1] << 8 | data[0]) * 0.1, 1)))
- # 电池组总能量
- self.bms_main_ctl._view.top_widget.lb_all_energy_value.setText(str(round((data[3] << 8 | data[2]) * 0.1, 1)))
- # 电池组剩余能量
- self.bms_main_ctl._view.top_widget.lb_left_energy_value.setText(str(round((data[5] << 8 | data[4]) * 0.1, 1)))
- # 供电采样电压
- self.bms_main_ctl._view.top_widget.lb_gdcy_vol_value.setText(str(round((data[7] << 8 | data[6]) * 0.1, 1)))
- def _inf_000C_signal(self, data, id):
- if id == SD.BCU_ID:
- # 累计放电电量
- self.bms_main_ctl._view.top_widget.lb_chg_kwh_value.setText(str(round((data[3] << 24 | data[2] << 16 | data[1] << 8 | data[0]) * 0.01, 2)))
- # 累计充电电量
- self.bms_main_ctl._view.top_widget.lb_dchg_kwh_value.setText(str(round((data[7] << 24 | data[6] << 16 | data[5] << 8 | data[4]) * 0.01, 2)))
-
- def _inf_000D_signal(self, data, id):
- if id == SD.BCU_ID:
- # 当天累计放电电量
- self.bms_main_ctl._view.top_widget.lb_nowday_chg_energy_value.setText(str(round((data[3] << 24 | data[2] << 16 | data[1] << 8 | data[0]) * 0.01, 2)))
- # 当天累计充电电量
- self.bms_main_ctl._view.top_widget.lb_nowday_dchg_energy_value.setText(str(round((data[7] << 24 | data[6] << 16 | data[5] << 8 | data[4]) * 0.01, 2)))
-
- def _inf_000E_signal(self, data, id):
- if id == SD.BCU_ID:
- # 系统对地绝缘阻值
- self.bms_main_ctl._view.top_widget.lb_sys_against_value.setText(str(data[1] << 8 | data[0]))
- # 正母线对地绝缘阻值
- self.bms_main_ctl._view.top_widget.lb_sys_p_against_value.setText(str(data[3] << 8 | data[2]))
- # 负母线对地绝缘阻值
- self.bms_main_ctl._view.top_widget.lb_sys_n_against_value.setText(str(data[5] << 8 | data[4]))
-
- # 地绝缘阻值
- item = QtWidgets.QTableWidgetItem(str(data[1] << 8 | data[0]))
- item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
- self.bms_double_ccu_ctl._view.on_line_ccu_table.setItem(id - 1, 7, item)
- def _inf_000F_signal(self, data, id):
- if id == SD.BCU_ID:
- # 单体电压
- # if data[1] == 0:
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(0, 1).setText(str(data[3] << 8 | data[2]) + " mV")
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(1, 1).setText(str(data[5] << 8 | data[4]) + " mV")
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(2, 1).setText(str(data[7] << 8 | data[6]) + " mV")
- # if data[1] == 1:
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(3, 1).setText(str(data[3] << 8 | data[2]) + " mV")
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(0, 4).setText(str(data[5] << 8 | data[4]) + " mV")
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(1, 4).setText(str(data[7] << 8 | data[6]) + " mV")
- # if data[1] == 2:
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(2, 4).setText(str(data[3] << 8 | data[2]) + " mV")
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(3, 4).setText(str(data[5] << 8 | data[4]) + " mV")
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(0, 7).setText(str(data[7] << 8 | data[6]) + " mV")
- # if data[1] == 3:
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(1, 7).setText(str(data[3] << 8 | data[2]) + " mV")
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(2, 7).setText(str(data[5] << 8 | data[4]) + " mV")
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(3, 7).setText(str(data[7] << 8 | data[6]) + " mV")
- # if data[1] == 4:
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(0, 10).setText(str(data[3] << 8 | data[2]) + " mV")
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(1, 10).setText(str(data[5] << 8 | data[4]) + " mV")
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(2, 10).setText(str(data[7] << 8 | data[6]) + " mV")
- # if data[1] == 5:
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(3, 10).setText(str(data[3] << 8 | data[2]) + " mV")
- if data[0] < 25:
- # 单体信息页面
- self.bms_cell_ctl._view.cell_vol_table.cellWidget(3 * data[1], data[0]).setText(str(data[3] << 8 | data[2]) + " mV")
- self.bms_cell_ctl._view.cell_vol_table.cellWidget(3 * data[1] + 1, data[0]).setText(str(data[5] << 8 | data[4]) + " mV")
- self.bms_cell_ctl._view.cell_vol_table.cellWidget(3 * data[1] + 2, data[0]).setText(str(data[7] << 8 | data[6]) + " mV")
-
- self.cell_single_volt[3 * data[1]] = data[3] << 8 | data[2]
- self.cell_single_volt[3 * data[1] + 1] = data[5] << 8 | data[4]
- self.cell_single_volt[3 * data[1] + 2] = data[7] << 8 | data[6]
- self._model.cell_volt = self.cell_single_volt
- # 硬件校准页面
- if (self.bms_hard_ctl._view.cb_bmu_index.currentIndex() + 1 == data[0]):
- self.bms_hard_ctl._view.hard_table.item(3 * data[1], 3).setText(str(data[3] << 8 | data[2]))
- self.bms_hard_ctl._view.hard_table.item(3 * data[1] + 1, 3).setText(str(data[5] << 8 | data[4]))
- self.bms_hard_ctl._view.hard_table.item(3 * data[1] + 2, 3).setText(str(data[7] << 8 | data[6]))
- def _inf_0010_signal(self, data, id):
- if id == SD.BCU_ID:
- # 单体温度
- # if data[1] == 0:
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(0, 2).setText(str(round((data[3] << 8 | data[2]) * 0.1 - 40, 1)) + " ℃")
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(1, 2).setText(str(round((data[5] << 8 | data[4]) * 0.1 - 40, 1)) + " ℃")
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(2, 2).setText(str(round((data[7] << 8 | data[6]) * 0.1 - 40, 1)) + " ℃")
- # if data[1] == 1:
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(3, 2).setText(str(round((data[3] << 8 | data[2]) * 0.1 - 40, 1)) + " ℃")
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(0, 5).setText(str(round((data[5] << 8 | data[4]) * 0.1 - 40, 1)) + " ℃")
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(1, 5).setText(str(round((data[7] << 8 | data[6]) * 0.1 - 40, 1)) + " ℃")
- # if data[1] == 2:
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(2, 5).setText(str(round((data[3] << 8 | data[2]) * 0.1 - 40, 1)) + " ℃")
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(3, 5).setText(str(round((data[5] << 8 | data[4]) * 0.1 - 40, 1)) + " ℃")
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(0, 8).setText(str(round((data[7] << 8 | data[6]) * 0.1 - 40, 1)) + " ℃")
- # if data[1] == 3:
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(1, 8).setText(str(round((data[3] << 8 | data[2]) * 0.1 - 40, 1)) + " ℃")
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(2, 8).setText(str(round((data[5] << 8 | data[4]) * 0.1 - 40, 1)) + " ℃")
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(3, 8).setText(str(round((data[7] << 8 | data[6]) * 0.1 - 40, 1)) + " ℃")
- # if data[1] == 4:
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(0, 11).setText(str(round((data[3] << 8 | data[2]) * 0.1 - 40, 1)) + " ℃")
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(1, 11).setText(str(round((data[5] << 8 | data[4]) * 0.1 - 40, 1)) + " ℃")
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(2, 11).setText(str(round((data[7] << 8 | data[6]) * 0.1 - 40, 1)) + " ℃")
- # if data[1] == 5:
- # self.bms_cell_ctl._view.home_cell_table.cellWidget(3, 11).setText(str(round((data[3] << 8 | data[2]) * 0.1 - 40, 1)) + " ℃")
- if data[0] < 25:
- self.bms_cell_ctl._view.cell_temp_table.cellWidget(3 * data[1], data[0]).setText(str(round((data[3] << 8 | data[2]) * 0.1 - 40, 1)) + " ℃")
- self.bms_cell_ctl._view.cell_temp_table.cellWidget(3 * data[1] + 1, data[0]).setText(str(round((data[5] << 8 | data[4]) * 0.1 - 40, 1)) + " ℃")
- self.bms_cell_ctl._view.cell_temp_table.cellWidget(3 * data[1] + 2, data[0]).setText(str(round((data[7] << 8 | data[6]) * 0.1 - 40, 1)) + " ℃")
- self.cell_single_temp[3 * data[1]] = round((data[3] << 8 | data[2]) * 0.1 - 40, 1)
- self.cell_single_temp[3 * data[1] + 1] = round((data[5] << 8 | data[4]) * 0.1 - 40, 1)
- self.cell_single_temp[3 * data[1] + 2] = round((data[7] << 8 | data[6]) * 0.1 - 40, 1)
- self._model.cell_temp = self.cell_single_temp
- def _inf_0011_signal(self, data, id):
- if id == SD.BCU_ID:
- # 最高单体电压所在从控编号
- self.bms_main_ctl._view.top_widget.lb_tcellhv_slave_index_value.setText(str(data[0]))
- # 最高单体电压所在从控内编号
- self.bms_main_ctl._view.top_widget.lb_tcellhv_in_index_value.setText(str(data[1]))
- # 最高单体温度所在从控编号
- self.bms_main_ctl._view.top_widget.lb_h_temp_slave_index_value.setText(str(data[2]))
- # 最高单体温度所在从控内编号
- self.bms_main_ctl._view.top_widget.lb_h_temp_in_index_value.setText(str(data[3]))
- # 最低单体电压所在从控编号
- 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]))
- # 最低单体温度所在从控编号
- 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:
- # 最高AFE温度值
- self.bms_main_ctl._view.top_widget.lb_afe_temp_high_value.setText(str(round((data[1] << 8 | data[0]) * 0.1 - 40, 1)))
- # 最高AFE温度所在从控编号
- self.bms_main_ctl._view.top_widget.lb_afe_temp_high_slave_value.setText(str(data[2]))
- # 最高AFE温度所在从控内编号
- self.bms_main_ctl._view.top_widget.lb_afe_temp_high_slave_in_value.setText(str(data[3]))
- # 最低AFE温度值
- self.bms_main_ctl._view.top_widget.lb_afe_temp_low_value.setText(str(round((data[5] << 8 | data[4]) * 0.1 - 40, 1)))
- # 最低AFE温度所在从控编号
- self.bms_main_ctl._view.top_widget.lb_afe_temp_low_slave_value.setText(str(data[6]))
- # 最低AFE温度所在从控内编号
- self.bms_main_ctl._view.top_widget.lb_afe_temp_low_slave_in_value.setText(str(data[7]))
- def _inf_0013_signal(self, data, id):
- if id == SD.BCU_ID:
- # BMS 硬件版本号
- self.bms_hard_version = ["" for i in range(8)]
- self.bms_hard_version[0] = chr(data[0])
- self.bms_hard_version[1] = chr(data[1])
- self.bms_hard_version[2] = chr(data[2])
- self.bms_hard_version[3] = chr(data[3])
- self.bms_hard_version[4] = chr(data[4])
- self.bms_hard_version[5] = chr(data[5])
- self.bms_hard_version[6] = chr(data[6])
- self.bms_hard_version[7] = chr(data[7])
- bms_hard_version = ''.join(self.bms_hard_version)
- self.bms_download_ctl._view.message_table.item(3, 2).setText(bms_hard_version)
-
- def _inf_0014_signal(self, data, id):
- if id == SD.BCU_ID:
- # BMS Boot版本号
- self.bms_boot_version = ["" for i in range(8)]
- self.bms_boot_version[0] = chr(data[0])
- self.bms_boot_version[1] = chr(data[1])
- self.bms_boot_version[2] = chr(data[2])
- self.bms_boot_version[3] = chr(data[3])
- self.bms_boot_version[4] = chr(data[4])
- self.bms_boot_version[5] = chr(data[5])
- self.bms_boot_version[6] = chr(data[6])
- self.bms_boot_version[7] = chr(data[7])
- bms_boot_version = ''.join(self.bms_boot_version)
- self.bms_download_ctl._view.message_table.item(0, 2).setText(bms_boot_version)
- def _inf_0016_signal(self, data, id):
- if id == SD.BCU_ID:
- # BMS 软件版本号
- self.bms_soft_version = ["" for i in range(8)]
- self.bms_soft_version[0] = chr(data[0])
- self.bms_soft_version[1] = chr(data[1])
- self.bms_soft_version[2] = chr(data[2])
- self.bms_soft_version[3] = chr(data[3])
- self.bms_soft_version[4] = chr(data[4])
- self.bms_soft_version[5] = chr(data[5])
- self.bms_soft_version[6] = chr(data[6])
- self.bms_soft_version[7] = chr(data[7])
- bms_soft_version = ''.join(self.bms_soft_version)
- self.bms_download_ctl._view.message_table.item(1, 2).setText(bms_soft_version)
- def _inf_0015_signal(self, data, id):
- if id == SD.BCU_ID:
- # BMS 算法版本号
- self.bms_sf_version = ["" for i in range(8)]
- self.bms_sf_version[0] = chr(data[0])
- self.bms_sf_version[1] = chr(data[1])
- self.bms_sf_version[2] = chr(data[2])
- self.bms_sf_version[3] = chr(data[3])
- self.bms_sf_version[4] = chr(data[4])
- self.bms_sf_version[5] = chr(data[5])
- self.bms_sf_version[6] = chr(data[6])
- self.bms_sf_version[7] = chr(data[7])
- bms_sf_version = ''.join(self.bms_sf_version)
- self.bms_download_ctl._view.message_table.item(2, 2).setText(bms_sf_version)
- def _inf_0017_signal(self, data, id):
- if id == SD.BCU_ID:
- # RTC时钟
- self.bms_hard_ctl._view.qline_rtc.setText(str(data[0] + 2000)+ "-" + str(data[1]) + "-" + str(data[2])+ " " + str(data[3]) + ":" + str(data[4]) + ":" + str(data[5]))
- def _inf_0018_signal(self, data, 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.on_off_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 1).widget(), QtGui.QColor(Qt.green))
- else:
- set_edt_bg(self.bms_balance_ctl._view.on_off_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.on_off_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 9).widget(), QtGui.QColor(Qt.green))
- else:
- set_edt_bg(self.bms_balance_ctl._view.on_off_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.on_off_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 17).widget(), QtGui.QColor(Qt.green))
- else:
- set_edt_bg(self.bms_balance_ctl._view.on_off_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.on_off_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 25).widget(), QtGui.QColor(Qt.green))
- else:
- set_edt_bg(self.bms_balance_ctl._view.on_off_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 25).widget(), QtGui.QColor(Qt.white))
- def _inf_0019_signal(self, data, 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.on_off_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 33).widget(), QtGui.QColor(Qt.green))
- else:
- set_edt_bg(self.bms_balance_ctl._view.on_off_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.on_off_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 41).widget(), QtGui.QColor(Qt.green))
- else:
- set_edt_bg(self.bms_balance_ctl._view.on_off_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.on_off_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 49).widget(), QtGui.QColor(Qt.green))
- else:
- set_edt_bg(self.bms_balance_ctl._view.on_off_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.on_off_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 57).widget(), QtGui.QColor(Qt.green))
- else:
- set_edt_bg(self.bms_balance_ctl._view.on_off_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.on_off_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 65).widget(), QtGui.QColor(Qt.green))
- else:
- set_edt_bg(self.bms_balance_ctl._view.on_off_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 65).widget(), QtGui.QColor(Qt.white))
- def _inf_001A_signal(self, data, 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 + 1).widget(), QtGui.QColor(Qt.red))
- else:
- 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))
- def _inf_001B_signal(self, data, id):
- if id == SD.BCU_ID:
- # 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):
- 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.line_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 1).widget(), QtGui.QColor(Qt.red))
- else:
- set_edt_bg(self.bms_balance_ctl._view.line_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.line_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 9).widget(), QtGui.QColor(Qt.red))
- else:
- set_edt_bg(self.bms_balance_ctl._view.line_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.line_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 17).widget(), QtGui.QColor(Qt.red))
- else:
- set_edt_bg(self.bms_balance_ctl._view.line_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.line_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 25).widget(), QtGui.QColor(Qt.red))
- else:
- set_edt_bg(self.bms_balance_ctl._view.line_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 25).widget(), QtGui.QColor(Qt.white))
- # for i in range(8):
- # if a_bit(data[1], i + 1) == 1:
- # set_edt_bg(self.bms_balance_ctl._view.line_qscrollarea_layout.itemAtPosition(i + 1, data[0] + 1).widget(), QtGui.QColor(Qt.red))
- # else:
- # set_edt_bg(self.bms_balance_ctl._view.line_qscrollarea_layout.itemAtPosition(i + 1, data[0] + 1).widget(), QtGui.QColor(Qt.white))
- # if a_bit(data[2], i + 1) == 1:
- # set_edt_bg(self.bms_balance_ctl._view.line_qscrollarea_layout.itemAtPosition(i + 9, data[0] + 1).widget(), QtGui.QColor(Qt.red))
- # else:
- # set_edt_bg(self.bms_balance_ctl._view.line_qscrollarea_layout.itemAtPosition(i + 9, data[0] + 1).widget(), QtGui.QColor(Qt.white))
- # if a_bit(data[3], i + 1) == 1:
- # set_edt_bg(self.bms_balance_ctl._view.line_qscrollarea_layout.itemAtPosition(i + 17, data[0] + 1).widget(), QtGui.QColor(Qt.red))
- # else:
- # set_edt_bg(self.bms_balance_ctl._view.line_qscrollarea_layout.itemAtPosition(i + 17, data[0] + 1).widget(), QtGui.QColor(Qt.white))
- # if a_bit(data[4], i + 1) == 1:
- # set_edt_bg(self.bms_balance_ctl._view.line_qscrollarea_layout.itemAtPosition(i + 25, data[0] + 1).widget(), QtGui.QColor(Qt.red))
- # else:
- # set_edt_bg(self.bms_balance_ctl._view.line_qscrollarea_layout.itemAtPosition(i + 25, data[0] + 1).widget(), QtGui.QColor(Qt.white))
- def _inf_001D_signal(self, data, 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.line_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 33).widget(), QtGui.QColor(Qt.red))
- else:
- set_edt_bg(self.bms_balance_ctl._view.line_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.line_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 41).widget(), QtGui.QColor(Qt.red))
- else:
- set_edt_bg(self.bms_balance_ctl._view.line_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.line_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 49).widget(), QtGui.QColor(Qt.red))
- else:
- set_edt_bg(self.bms_balance_ctl._view.line_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.line_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 57).widget(), QtGui.QColor(Qt.red))
- else:
- set_edt_bg(self.bms_balance_ctl._view.line_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.line_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 65).widget(), QtGui.QColor(Qt.red))
- else:
- set_edt_bg(self.bms_balance_ctl._view.line_qscrollarea_layout.itemAtPosition(data[0] - 1, i + 65).widget(), QtGui.QColor(Qt.white))
- # for i in range(8):
- # if a_bit(data[1], i + 1) == 1:
- # set_edt_bg(self.bms_balance_ctl._view.line_qscrollarea_layout.itemAtPosition(i + 33, data[0] + 1).widget(), QtGui.QColor(Qt.red))
- # else:
- # set_edt_bg(self.bms_balance_ctl._view.line_qscrollarea_layout.itemAtPosition(i + 33, data[0] + 1).widget(), QtGui.QColor(Qt.white))
- # if a_bit(data[2], i + 1) == 1:
- # set_edt_bg(self.bms_balance_ctl._view.line_qscrollarea_layout.itemAtPosition(i + 41, data[0] + 1).widget(), QtGui.QColor(Qt.red))
- # else:
- # set_edt_bg(self.bms_balance_ctl._view.line_qscrollarea_layout.itemAtPosition(i + 41, data[0] + 1).widget(), QtGui.QColor(Qt.white))
- # if a_bit(data[3], i + 1) == 1:
- # set_edt_bg(self.bms_balance_ctl._view.line_qscrollarea_layout.itemAtPosition(i + 49, data[0] + 1).widget(), QtGui.QColor(Qt.red))
- # else:
- # set_edt_bg(self.bms_balance_ctl._view.line_qscrollarea_layout.itemAtPosition(i + 49, data[0] + 1).widget(), QtGui.QColor(Qt.white))
- # if a_bit(data[4], i + 1) == 1:
- # set_edt_bg(self.bms_balance_ctl._view.line_qscrollarea_layout.itemAtPosition(i + 57, data[0] + 1).widget(), QtGui.QColor(Qt.red))
- # else:
- # set_edt_bg(self.bms_balance_ctl._view.line_qscrollarea_layout.itemAtPosition(i + 57, data[0] + 1).widget(), QtGui.QColor(Qt.white))
- # if a_bit(data[5], i + 1) == 1:
- # set_edt_bg(self.bms_balance_ctl._view.line_qscrollarea_layout.itemAtPosition(i + 65, data[0] + 1).widget(), QtGui.QColor(Qt.red))
- # else:
- # set_edt_bg(self.bms_balance_ctl._view.line_qscrollarea_layout.itemAtPosition(i + 65, data[0] + 1).widget(), QtGui.QColor(Qt.white))
- def _inf_001E_signal(self, data, id):
- return
- def _inf_001F_signal(self, data, id):
- return
- def _inf_0020_signal(self, data, id):
- if id == SD.BCU_ID:
- # BMS 电池编码
- self.bms_sn_version[0] = chr(data[0])
- self.bms_sn_version[1] = chr(data[1])
- self.bms_sn_version[2] = chr(data[2])
- self.bms_sn_version[3] = chr(data[3])
- self.bms_sn_version[4] = chr(data[4])
- self.bms_sn_version[5] = chr(data[5])
- self.bms_sn_version[6] = chr(data[6])
- self.bms_sn_version[7] = chr(data[7])
- def _inf_0021_signal(self, data, id):
- if id == SD.BCU_ID:
- self.bms_sn_version[8] = chr(data[0])
- self.bms_sn_version[9] = chr(data[1])
- self.bms_sn_version[10] = chr(data[2])
- self.bms_sn_version[11] = chr(data[3])
- self.bms_sn_version[12] = chr(data[4])
- self.bms_sn_version[13] = chr(data[5])
- self.bms_sn_version[14] = chr(data[6])
- self.bms_sn_version[15] = chr(data[7])
- bms_sn_version = ''.join(self.bms_sn_version)
- self.bms_download_ctl._view.message_table.item(4, 2).setText(bms_sn_version)
- def _inf_0022_signal(self, data, id):
- if id == SD.BCU_ID:
- # BMS 电池编码
- self.battery_sn_version[0] = chr(data[0])
- self.battery_sn_version[1] = chr(data[1])
- self.battery_sn_version[2] = chr(data[2])
- self.battery_sn_version[3] = chr(data[3])
- self.battery_sn_version[4] = chr(data[4])
- self.battery_sn_version[5] = chr(data[5])
- self.battery_sn_version[6] = chr(data[6])
- self.battery_sn_version[7] = chr(data[7])
- def _inf_0023_signal(self, data, id):
- if id == SD.BCU_ID:
- self.battery_sn_version[8] = chr(data[0])
- self.battery_sn_version[9] = chr(data[1])
- self.battery_sn_version[10] = chr(data[2])
- self.battery_sn_version[11] = chr(data[3])
- self.battery_sn_version[12] = chr(data[4])
- self.battery_sn_version[13] = chr(data[5])
- self.battery_sn_version[14] = chr(data[6])
- self.battery_sn_version[15] = chr(data[7])
- battery_sn_version = ''.join(self.battery_sn_version)
- self.bms_download_ctl._view.message_table.item(5, 2).setText(battery_sn_version)
- self.bms_status._view.lb_bms_sn.setText("BATSN:" + battery_sn_version)
- self._model.now_time = QDateTime.currentDateTime().toString("yyyy-MM-dd HH:mm:ss.zzz")
- if SD.RECORD_SAVE:
- record_data = []
- record_data.append(self._model.now_time)
- record_data.append(self._model.ccu_id)
- record_data.append(self._model.fault_level)
- record_data.append(self._model.volt)
- record_data.append(self._model.cur)
- record_data.append(self._model.soc)
- record_data.append(self._model.soh)
- record_data.append(self._model.avg_cell_volt)
- record_data.append(self._model.max_cell_volt_id)
- record_data.append(self._model.max_cell_volt)
- record_data.append(self._model.min_cell_volt_id)
- record_data.append(self._model.min_cell_volt)
- record_data.append(self._model.avg_cell_temp)
- record_data.append(self._model.max_cell_temp_id)
- record_data.append(self._model.max_cell_temp)
- record_data.append(self._model.min_cell_temp_id)
- record_data.append(self._model.min_cell_temp)
- record_data.append(self._model.p)
- record_data.append(self._model.n)
- record_data.append(self._model.pre)
- record_data.append(self._model.dlq)
- record_data.append(self._model.gjd_first)
- record_data.append(self._model.gjd_second)
- record_data.append(self._model.max_soc)
- record_data.append(self._model.min_soc)
- record_data.append(self._model.avg_soc)
- if SD.CCU_TYPE == 0:
- record_data.extend(self._model.cell_volt[0:16])
- record_data.extend(self._model.cell_temp[0:16])
- else:
- record_data.extend(self._model.cell_volt)
- record_data.extend(self._model.cell_temp)
- with open(SD.RECORD_NAME, 'a') as csvfile:
- writer = csv.writer(csvfile, dialect='excel', lineterminator='\n')
- writer.writerow(record_data)
- def _inf_1802_signal(self, data, id):
- if id == SD.BCU_ID:
- addr_index = ((data[1] << 8) | data[0])- 0xA000
- self.bms_protect_ctl._view.end_timer()
- try:
- item = QtWidgets.QTableWidgetItem(str((data[3] << 8) | data[2]))
- item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
- self.bms_protect_ctl._view.protect_table.setItem(addr_index, 8, item)
- real_value = ((data[3] << 8) | data[2]) * float(self.bms_protect_ctl._view.protect_table.item(addr_index, 6).text()) + float(self.bms_protect_ctl._view.protect_table.item(addr_index, 7).text())
- # print(str(((data[3] << 8) | data[2]) * float(self.bms_protect_ctl._view.protect_table.item(addr_index, 6).text()) + float(self.bms_protect_ctl._view.protect_table.item(addr_index, 7).text())))
- item = QtWidgets.QTableWidgetItem(str(round(real_value,1)))
- item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
- self.bms_protect_ctl._view.protect_table.setItem(addr_index, 1, item)
- except:
- return
-
-
- def _inf_1803_signal(self, data, id):
- if id == SD.BCU_ID:
- addr_index = ((data[1] << 8) | data[0]) - 0xB000
- # self.bms_protect_ctl._view.end_timer()
- if addr_index <=4:
- if addr_index <=2:
- self.bms_hard_ctl._view.vol_table.cellWidget(addr_index, 2).setText(str(round(float(c_int16(data[3] << 8 | data[2]).value * 0.1), 1)))
- elif addr_index == 3:
- self.bms_hard_ctl._view.qline_cali_fbl.setText(str(round(float(c_int16(data[3] << 8 | data[2]).value * 0.001), 3)))
- else:
- self.bms_hard_ctl._view.qline_cur_offset.setText(str(round(float(c_int16(data[3] << 8 | data[2]).value * 0.1), 1)))
- else:
- cell_vol_index = ((data[1] << 8) | data[0]) - 0xB110
- if cell_vol_index:
- try:
- if self.bms_hard_ctl._view.cb_bmu_index.currentIndex() + 1 == data[2]:
- item = QtWidgets.QTableWidgetItem(str(c_int16(data[4] << 8 | data[3]).value))
- item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
- self.bms_hard_ctl._view.hard_table.setItem(cell_vol_index - 1, 4, item)
- except:
- return
- else:
- self.bms_hard_ctl._view.edt_cell.setText(str(c_int16(data[4] << 8 | data[3]).value))
- def run(self):
- self._view.show()
|