Files
HPI/library/message_box.py
tangchao0503 98cf134cca 第一次提交
1、hpi的可用代码;
2、修复了多次点击曝光后,福亮度数据错误的问题;
3、定标方式为大的蓝菲积分球的标准能量曲线,而不是基于asd的能量曲线;
2022-09-06 22:54:14 +08:00

54 lines
1.6 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from PyQt5.QtWidgets import QApplication, QDialog
from PyQt5.QtCore import Qt
import sys
from library.message_box_ui import *
class MessageBox(QDialog, Ui_message_box_ui):
def __init__(self, txt, parent=None):
'''
The super().__init__() method invokes the base class constructor from the MyForm class,
that is, the constructor of the QDialog class is invoked from MyForm class to indicate that
QDialog is displayed through this class iss a top-level window.
'''
super(MessageBox, self).__init__(parent)
self.setupUi(self)
# self.setWindowState(Qt.WindowMaximized) # 初始化时就最大化窗口
self.setWindowModality(Qt.ApplicationModal) # 阻塞此窗口只能在关闭此窗口之后才能操作后面的窗口但是不会阻塞调用此窗口的进程的代码此行代码必须放在show()函数之前
# self.setWindowModality(Qt.WindowModal)
# 无边框
# self.setWindowFlags(Qt.FramelessWindowHint)
self.txt = txt
self.info()
self.confirm_bt.clicked.connect(self.shutdown)
# 禁止调整大小
# self.setFixedSize(self.width(), self.height())
def info(self):
self.info_label.setText(self.txt)
# self.exec() # 阻塞调用此窗口后的进程的代码,只有此窗口返回后才能执行此窗口外的代码
# self.show() # 只是显示,不会阻塞任何代码
def shutdown(self):
self.close()
if __name__ == '__main__':
app = QApplication(sys.argv)
x = MessageBox('请先曝光和采集暗电流!')
# x.show()
sys.exit(app.exec_())