PyQt5线程队列------LinkNode
2021/11/21 22:10:17
本文主要是介绍PyQt5线程队列------LinkNode,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
import sys import os from PyQt5.QtCore import QObject from PyQt5.QtWidgets import QApplication from PyQt5.QtGui import QGuiApplication """模块路径加到当前模块扫描的路径里""" sys.path.append(os.path.dirname(__file__)) # import numpy as np # import cv2 """ @项目 :ThreadLoop @文件 :LinkNode.py @作者 :xsh @时间 :2021/11/21 15:20 @功能 : @说明 : """ from myThread import myThread, DrawInfo class LinkNode(QObject): """当前节点的编号""" CurrentThreadNumber: int """当前节点线程""" CurrentThread: myThread """上一个节点""" LastNode: 'LinkNode' """下一个节点""" NextNode: 'LinkNode' def __init__(self, number=int(0), parent=None): super(LinkNode, self).__init__(parent) self.CurrentThreadNumber = number self.CurrentThread = myThread(self.CurrentThreadNumber, None) self.LastNode = None self.NextNode = None def __del__(self): if self.CurrentThread: self.CurrentThread.Stop(True) self.CurrentThread.deleteLater() """停止当前节点的线程""" def Stop(self): self.CurrentThread.Stop(True) while self.CurrentThread.isRunning(): pass pass """暂停当前节点的线程""" def Pause(self): if self.CurrentThread.getPause(): return else: self.CurrentThread.Pause(True) pass """启动当前节点的线程""" def Start(self, *args): self.CurrentThread.Start(*args) pass """线程是否空闲""" def isFree(self) -> bool: return self.CurrentThread.getPause() """线程是否在运行""" def isRunning(self) -> bool: return self.CurrentThread.getStop() is False
这篇关于PyQt5线程队列------LinkNode的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-23Springboot应用的多环境打包入门
- 2024-11-23Springboot应用的生产发布入门教程
- 2024-11-23Python编程入门指南
- 2024-11-23Java创业入门:从零开始的编程之旅
- 2024-11-23Java创业入门:新手必读的Java编程与创业指南
- 2024-11-23Java对接阿里云智能语音服务入门详解
- 2024-11-23Java对接阿里云智能语音服务入门教程
- 2024-11-23JAVA对接阿里云智能语音服务入门教程
- 2024-11-23Java副业入门:初学者的简单教程
- 2024-11-23JAVA副业入门:初学者的实战指南