bms_download.py 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env python
  2. # -*- encoding: utf-8 -*-
  3. from ui.download import Download
  4. from ui.own.frame_theme import MyFrame
  5. from utils.globalvar import SD
  6. from utils.qt import QMessageBox, Signal
  7. class Win_Download(Download, MyFrame):
  8. bms_sn_signal = Signal()
  9. bat_sn_signal = Signal()
  10. def __init__(self, parent=None):
  11. super(Win_Download, self).__init__(parent)
  12. self.setupUi(self)
  13. self.btn_bms_sn.clicked.connect(self._bms_sn)
  14. self.btn_battery_sn.clicked.connect(self._battery_sn)
  15. def _bms_sn(self):
  16. self.bms_sn_signal.emit()
  17. def _battery_sn(self):
  18. self.bat_sn_signal.emit()
  19. def can_connect_error(self):
  20. QMessageBox.critical(self, "连接状态" if SD.SYSTEM_LANGUAGE == 0 else "Connect State", "CAN 连接失败!" if SD.SYSTEM_LANGUAGE == 0 else "CAN Connect Error!")
  21. def index_error(self):
  22. QMessageBox.critical(self, "错误的SN" if SD.SYSTEM_LANGUAGE == 0 else "SN error", "SN不符!" if SD.SYSTEM_LANGUAGE == 0 else "SN not aviable!")