91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 15KB
    文件類型: .zip
    金幣: 2
    下載: 1 次
    發(fā)布日期: 2021-05-10
  • 語言: Python
  • 標(biāo)簽: python??pyside2??pyserial??

資源簡介

使用python開發(fā)的一個(gè)串口上位機(jī)應(yīng)用,主要使用的工具包有pyside2、PyQtgraphy、pyserial。程序入口文件為data_app.py

資源截圖

代碼片段和文件信息

#?encoding:?utf-8
import?sys
import?serial
import?serial.tools.list_ports
from?PySide2.QtCore?import?QTimer?QTime?QRegExp
from?PySide2.QtGui?import?QIcon?QRegExpValidator
from?PySide2.QtWidgets?import?QWidget?QApplication?QMainWindow?QMessageBox
import?pyqtgraph?as?pg
from?data_deal?import?Data_Deal
from?MainWindow?import?Ui_MainWindow

class?Data_App(QWidget?Ui_MainWindow):
????def?__init__(self):
????????super().__init__()
????????#?創(chuàng)建串口實(shí)例對(duì)象
????????self.serial?=?serial.Serial()
????????#?創(chuàng)建?QTimer?實(shí)例對(duì)象
????????self.timer1?=?QTimer()
????????self.timer2?=?QTimer()
????????self.time?=?QTime()
????????self.now_time?=?‘‘
????????#?創(chuàng)建顯示窗口
????????self.main_window?=?QMainWindow()
????????self.setupUi(self.main_window)
????????self.retranslateUi(self.main_window)
????????#?正則表達(dá)式相關(guān)
????????bit_3_validator?=?QRegExpValidator()
????????bit_3_validator.setRegExp(QRegExp(‘[0-9]{13}‘))
????????self.fresh_waste_edit.setValidator(bit_3_validator)
????????self.fresh_edit.setValidator(bit_3_validator)
????????self.waste_edit.setValidator(bit_3_validator)
????????self.blood_edit.setValidator(bit_3_validator)
????????self.ultrafiltration_edit.setValidator(bit_3_validator)
????????self.debug_send_edit.setValidator(bit_3_validator)

????????#?儲(chǔ)存所有存在的串口?字典
????????self.Com_Dict?=?{}
????????#?創(chuàng)建新csv文件標(biāo)志
????????self.create_file_flag?=?True
????????self.write_data_flag?=?False
????????#?要保存的當(dāng)前的文件名
????????self.now_file_name?=?None
????????#?串口接收的字符串
????????self.received_bit_data?=?None
????????self.received_data?=?None
????????#?圖像對(duì)象
????????self.fresh_pressure_plot?=?None
????????self.waste_pressure_plot?=?None
????????self.fresh_flow_plot?=?None
????????self.waste_flow_plot?=?None
????????self.blood_flow_plot?=?None
????????self.artery_pressure_plot?=?None
????????self.vein_pressure_plot?=?None
????????self.weight_1_plot?=?None
????????self.weight_2_plot?=?None
????????self.weight_3_plot?=?None
????????self.tmp_plot?=?None
????????#?self.ph_plot?=?None
????????#?self.temperature_plot?=?None
????????#?保存收到的數(shù)據(jù)?list
????????self.x?=?0
????????self.list_fresh_pressure?=?[0]?*?10
????????self.list_waste_pressure?=?[0]?*?10
????????self.list_fresh_flow?=?[0]*10
????????self.list_waste_flow?=?[0]*10
????????self.list_blood_flow?=?[0]*10
????????self.list_artery_pressure?=?[0]*10
????????self.list_vein_pressure?=?[0]*10
????????self.list_weight_1?=?[0]*10
????????self.list_weight_2?=?[0]*10
????????self.list_weight_3?=?[0]*10
????????self.list_tmp?=?[0]*10
????????#?self.list_ph?=?[0]*1000
????????#?接收到的最新的數(shù)據(jù)
????????self.flag?=?““
????????self.fresh_pressure_data?=?0
????????self.waste_pressure_data?=?0
????????self.fresh_flow_data?=?0
????????self.waste_flow_data?=?0
????????self.blood_flow_data?=?0
????????self.artery_pressure_data?=?0
????????self.vein_pressure_data?=?0
????????self.weight_1_data?=?0
????????self.weight_2_data?=?0
????????self.weight_3_data?=?0
????????#?跨膜壓
????????self.tmp_data?=?0
????????self.initial_temperature_data?=?0
????????self.proc

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????29531??2020-07-29?16:34??serial-python\data_app.py
?????文件????????4709??2020-07-22?17:15??serial-python\data_deal.py
?????文件???????37393??2020-07-14?15:24??serial-python\MainWindow.py
?????文件???????42366??2020-07-10?16:55??serial-python\MainWindow.ui

評(píng)論

共有 條評(píng)論