bms_record.py 932 B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env python
  2. # -*- encoding: utf-8 -*-
  3. from ui.record import Record
  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 QFileDialog, QChart, QValueAxis, QHBoxLayout, QPainter, Qt, Signal, Slot, QLegendMarker
  8. class Win_Record(Record, MyFrame):
  9. can_record_start_signal = Signal()
  10. can_record_stop_signal = Signal()
  11. def __init__(self, parent=None):
  12. super(Win_Record, self).__init__(parent)
  13. self.setupUi(self)
  14. self.save_record.clicked.connect(self._start)
  15. self.stop_record.clicked.connect(self._stop)
  16. def _start(self):
  17. self.can_record_start_signal.emit()
  18. def _stop(self):
  19. self.can_record_stop_signal.emit()
  20. def save_csv(self):
  21. return QFileDialog.getSaveFileName(self, "保存文件" if SD.SYSTEM_LANGUAGE == 0 else "Save File", SD.FILE_PATH, 'CSV(*.csv)')