代码拉取完成,页面将自动刷新
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/9/27 21:40
# @Author : leon yan
# @Site :
# @File : OneHeight.py
# @Software: PyCharm
from PyQt5.QtCore import pyqtSlot, pyqtSignal
from PyQt5.QtWidgets import QWidget, QApplication, QMessageBox
import Globalist as gl
from resource.OneHeight_ui import Ui_Form
class QOneHeight(QWidget, Ui_Form):
def __init__(self, parent=None, *args, **kwargs):
super().__init__(parent, *args, **kwargs)
self.setupUi(self)
self.widget.setTableSheet("oneHeight", False)
self.widget.frame.setVisible(False)
self.setTable()
'''启动更新方法'''
self.threadObj = gl.get_value("obj_UpdateThread")
self.threadObj.bPulse.connect(self.do_UpdateStatus)
def __del__(self):
print("OneHeight is deleted")
def closeEvent(self, event):
pass
def setTable(self):
deviceIpDict = gl.global_var["deviceIpDict"]
# print(deviceIpDict)
curHeightDict = gl.global_var["Plc_read_area"]["data_rdArea4"]["dArea"]
# print(curHeightDict)
aa = []
for key, value in curHeightDict.items():
bb = []
for i in range(len(value[2])):
bb.append(value[2][i])
bb2 = len(bb)
for j in range(4 - bb2):
bb.append("")
bb.insert(0, deviceIpDict[int(key)][2])
aa.append(bb)
self.widget.fileToTable(aa)
@pyqtSlot()
def on_btnClose_clicked(self):
self.close()
@pyqtSlot()
def on_btnApply_clicked(self):
pass
@pyqtSlot()
def do_UpdateStatus(self):
self.setTable()
if __name__ == '__main__':
import sys
app = QApplication(sys.argv)
objWindow = QOneHeight()
objWindow.show()
sys.exit(app.exec_())
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。