bms_download.py 1.1 KB

123456789101112131415161718192021222324252627282930313233
  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 ui.own.my_chart_view import MyChartView
  6. from utils.globalvar import SD
  7. from utils.qt import QMessageBox, QChart, QValueAxis, QHBoxLayout, QPainter, Qt, Signal, Slot, QLegendMarker
  8. class Win_Download(Download, MyFrame):
  9. bms_sn_signal = Signal()
  10. bat_sn_signal = Signal()
  11. def __init__(self, parent=None):
  12. super(Win_Download, self).__init__(parent)
  13. self.setupUi(self)
  14. self.btn_bms_sn.clicked.connect(self._bms_sn)
  15. self.btn_battery_sn.clicked.connect(self._battery_sn)
  16. def _bms_sn(self):
  17. self.bms_sn_signal.emit()
  18. def _battery_sn(self):
  19. self.bat_sn_signal.emit()
  20. def can_connect_error(self):
  21. QMessageBox.critical(self, "连接状态" if SD.SYSTEM_LANGUAGE == 0 else "Connect State", "CAN 连接失败!" if SD.SYSTEM_LANGUAGE == 0 else "CAN Connect Error!")
  22. def index_error(self):
  23. QMessageBox.critical(self, "错误的SN" if SD.SYSTEM_LANGUAGE == 0 else "SN error", "SN不符!" if SD.SYSTEM_LANGUAGE == 0 else "SN not aviable!")