2022-11-19 18:05:48 +03:00
|
|
|
|
import sys
|
|
|
|
|
import random
|
|
|
|
|
from PySide6 import QtCore, QtWidgets, QtGui
|
2022-11-20 21:54:32 +03:00
|
|
|
|
import time
|
2022-11-19 18:05:48 +03:00
|
|
|
|
|
|
|
|
|
|
2022-11-20 21:54:32 +03:00
|
|
|
|
class TitleScreen(QtWidgets.QWidget):
|
2022-11-19 18:05:48 +03:00
|
|
|
|
def __init__(self):
|
|
|
|
|
super().__init__()
|
|
|
|
|
self.q = QtGui.QScreen.availableGeometry(QtWidgets.QApplication.primaryScreen())
|
2022-11-20 21:54:32 +03:00
|
|
|
|
self.part1 = Part1()
|
|
|
|
|
self.part2 = Part2()
|
2022-11-19 18:05:48 +03:00
|
|
|
|
|
|
|
|
|
self.button = QtWidgets.QPushButton(self)
|
|
|
|
|
self.button.setGeometry(QtCore.QRect(20, 20, 40, 40))
|
|
|
|
|
self.button.setText("Esc")
|
|
|
|
|
self.text = QtWidgets.QLabel(self)
|
2022-11-20 21:54:32 +03:00
|
|
|
|
self.text.setText(
|
|
|
|
|
"<html><head/><body><p align=\"center\"><span style=\" font-size:20pt; font-weight:600;\">Лабораторная "
|
|
|
|
|
"работа 3.5.1</span></p><p align=\"center\"><span style=\" font-size:16pt;\">Исследование плазмы газового "
|
|
|
|
|
"разряда</span></p></body></html>")
|
|
|
|
|
self.text.setGeometry(QtCore.QRect(self.q.width() // 3 - 250, self.q.height() // 2 - 50, 500, 100))
|
2022-11-19 18:05:48 +03:00
|
|
|
|
self.vline = QtWidgets.QFrame(self)
|
|
|
|
|
self.vline.setFrameShape(QtWidgets.QFrame.VLine)
|
|
|
|
|
self.vline.setGeometry(QtCore.QRect(2 * self.q.width() // 3, 0, 10, self.q.height() + 40))
|
|
|
|
|
self.hline = QtWidgets.QFrame(self)
|
|
|
|
|
self.hline.setFrameShape(QtWidgets.QFrame.HLine)
|
|
|
|
|
self.hline.setGeometry(QtCore.QRect(2 * self.q.width() // 3 + 5, self.q.height() // 2, self.q.width() // 3, 40))
|
|
|
|
|
self.label1 = QtWidgets.QLabel(self)
|
|
|
|
|
self.label1.setText(
|
2022-11-20 21:54:32 +03:00
|
|
|
|
"<html><head/><body><p align=\"center\"><span style=\" font-size:10pt; font-weight:600;\">ЧАСТЬ "
|
|
|
|
|
"I</span></p><p align=\"center\"><span style=\" font-size:10pt;\">Вольт-амперная характеристика газового "
|
|
|
|
|
"разряда</span></p></body></html>")
|
2022-11-19 18:05:48 +03:00
|
|
|
|
self.label1.setGeometry(QtCore.QRect(5 * self.q.width() // 6 - 150, self.q.height() // 4 - 40, 300, 80))
|
|
|
|
|
self.label2 = QtWidgets.QLabel(self)
|
|
|
|
|
self.label2.setText(
|
2022-11-20 21:54:32 +03:00
|
|
|
|
"<html><head/><body><p align=\"center\"><span style=\" font-size:10pt; font-weight:600;\"> ЧАСТЬ "
|
|
|
|
|
"II</span></p><p align=\"center\"><span style=\" font-size:10pt;\">Зондовые характеристики "
|
|
|
|
|
"плазмы</span></p></body></html>")
|
2022-11-19 18:05:48 +03:00
|
|
|
|
self.label2.setGeometry(QtCore.QRect(5 * self.q.width() // 6 - 150, 3 * self.q.height() // 4 - 40, 300, 80))
|
|
|
|
|
self.button1 = QtWidgets.QPushButton(self)
|
|
|
|
|
self.button1.setGeometry(QtCore.QRect(5 * self.q.width() // 6 - 40, self.q.height() // 4 + 80, 80, 40))
|
|
|
|
|
self.button1.setText("Начать")
|
|
|
|
|
self.button2 = QtWidgets.QPushButton(self)
|
|
|
|
|
self.button2.setGeometry(QtCore.QRect(5 * self.q.width() // 6 - 40, 3 * self.q.height() // 4 + 80, 80, 40))
|
|
|
|
|
self.button2.setText("Начать")
|
|
|
|
|
|
2022-11-20 21:54:32 +03:00
|
|
|
|
self.button.clicked.connect(self.esc)
|
|
|
|
|
self.button1.clicked.connect(self.open_part1)
|
|
|
|
|
self.button2.clicked.connect(self.open_part2)
|
|
|
|
|
|
|
|
|
|
@QtCore.Slot()
|
|
|
|
|
def esc(self):
|
|
|
|
|
self.close()
|
|
|
|
|
|
|
|
|
|
def open_part1(self):
|
|
|
|
|
self.part1.showFullScreen()
|
|
|
|
|
self.close()
|
|
|
|
|
|
|
|
|
|
def open_part2(self):
|
|
|
|
|
self.part2.showFullScreen()
|
|
|
|
|
self.close()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Part1(QtWidgets.QWidget):
|
|
|
|
|
def __init__(self):
|
|
|
|
|
super().__init__()
|
|
|
|
|
self.started = False
|
|
|
|
|
self.q = QtGui.QScreen.availableGeometry(QtWidgets.QApplication.primaryScreen())
|
|
|
|
|
h = self.q.height() * 0.2
|
|
|
|
|
|
|
|
|
|
self.button = QtWidgets.QPushButton(self)
|
|
|
|
|
self.button.setGeometry(QtCore.QRect(20, 20, 40, 40))
|
|
|
|
|
self.button.setText("Esc")
|
|
|
|
|
|
|
|
|
|
self.title = QtWidgets.QLabel(self)
|
|
|
|
|
self.title.setText(
|
|
|
|
|
"<html><head/><body><p align=\"center\"><span style=\" font-size:16pt; font-weight:600;\">ЧАСТЬ "
|
|
|
|
|
"I</span></p><p align=\"center\"><span style=\" font-size:12pt;\">Вольт-амперная характеристика газового "
|
|
|
|
|
"разряда</span></p></body></html>")
|
|
|
|
|
self.title.setGeometry(QtCore.QRect(self.q.width() // 2 - 200, 20, 400, 80))
|
|
|
|
|
|
|
|
|
|
self.back_button = QtWidgets.QPushButton(self)
|
|
|
|
|
self.back_button.setGeometry(QtCore.QRect(20, self.q.height() - 20, 80, 40))
|
|
|
|
|
self.back_button.setText("Назад")
|
|
|
|
|
|
|
|
|
|
self.pixmap0 = QtGui.QPixmap('Aspect-ratio-4x3.png')
|
|
|
|
|
self.pixmap = self.pixmap0.scaledToHeight(3 * h)
|
|
|
|
|
self.plot1 = QtWidgets.QLabel(self)
|
|
|
|
|
self.plot1.setPixmap(self.pixmap)
|
|
|
|
|
self.plot1.setGeometry(QtCore.QRect(h, h + 20, 4 * h, 3 * h))
|
|
|
|
|
|
|
|
|
|
self.text = QtWidgets.QLabel(self)
|
|
|
|
|
self.text.setText("<html><p align=\"left\"><span style=\" font-size:10pt;\">Перед проведением измерений ВАХ "
|
|
|
|
|
"газового разряда</p><p align=\"left\"><span style=\" font-size:10pt;\">проверьте "
|
|
|
|
|
"подключение вольтметра V<sub>1</sub> и амперметра A<sub>1</sub>,"
|
|
|
|
|
"</p><p align=\"left\"><span style=\" font-size:10pt;\">а также убедитесь, "
|
|
|
|
|
"что переключатель П<sub>1</sub> находится в положении I.</p><p align=\"left\"><span "
|
|
|
|
|
"style=\" font-size:10pt;\">При проведении измерений медленно увеличивайте выходное"
|
|
|
|
|
"</p><p align=\"left\"><span style=\" font-size:10pt;\">напряжение ВИП до достижения "
|
|
|
|
|
"максимального значения тока"
|
|
|
|
|
"</p><p align=\"left\"><span style=\" font-size:10pt;\">через амперметр "
|
|
|
|
|
"А<sub>1 </sub>(не более 5 мА), затем проведите измерения "
|
|
|
|
|
"</p><p align=\"left\"><span style=\" font-size:10pt;\">в обратную сторону.</p><p "
|
|
|
|
|
"align=\"left\"><span style=\" font-size:10pt;\">График "
|
|
|
|
|
"I<sub>р</sub>(U<sub>р</sub>) будет строиться автоматически,</p><p align=\"left\"><span "
|
|
|
|
|
"style=\" font-size:10pt;\">после завершения измерений можно сохранить полученные</p><p "
|
|
|
|
|
"align=\"left\"><span style=\" font-size:10pt;\">значения "
|
|
|
|
|
"и график.</p></html>")
|
|
|
|
|
self.text.setGeometry(QtCore.QRect(6 * h, h + 20, 3 * h, 2 * h + 20))
|
|
|
|
|
|
|
|
|
|
self.start_btn = QtWidgets.QPushButton(self)
|
|
|
|
|
self.start_btn.setText("Начать измерения")
|
|
|
|
|
self.start_btn.setGeometry(QtCore.QRect(7.5 * h - 150, 4 * h - 50, 120, 30))
|
|
|
|
|
|
|
|
|
|
self.reset_btn = QtWidgets.QPushButton(self)
|
|
|
|
|
self.reset_btn.setText("Сбросить")
|
|
|
|
|
self.reset_btn.setGeometry(QtCore.QRect(7.5 * h + 30, 4 * h - 50, 120, 30))
|
|
|
|
|
|
|
|
|
|
self.save_btn = QtWidgets.QPushButton(self)
|
|
|
|
|
self.save_btn.setText("Сохранить")
|
|
|
|
|
self.save_btn.setGeometry(QtCore.QRect(7.5 * h - 60, 4 * h, 120, 30))
|
|
|
|
|
self.save_btn.hide()
|
2022-11-19 18:05:48 +03:00
|
|
|
|
|
|
|
|
|
self.button.clicked.connect(self.esc)
|
2022-11-20 21:54:32 +03:00
|
|
|
|
self.back_button.clicked.connect(self.back)
|
|
|
|
|
self.start_btn.clicked.connect(self.start_stop)
|
|
|
|
|
self.reset_btn.clicked.connect(self.reset)
|
2022-11-19 18:05:48 +03:00
|
|
|
|
|
|
|
|
|
@QtCore.Slot()
|
|
|
|
|
def esc(self):
|
|
|
|
|
self.close()
|
|
|
|
|
|
2022-11-20 21:54:32 +03:00
|
|
|
|
def back(self):
|
|
|
|
|
self.w = TitleScreen()
|
|
|
|
|
self.w.showFullScreen()
|
|
|
|
|
self.close()
|
|
|
|
|
|
|
|
|
|
def start_stop(self):
|
|
|
|
|
if not self.started:
|
|
|
|
|
self.start_btn.setText("Стоп")
|
|
|
|
|
self.started = True
|
|
|
|
|
self.save_btn.hide()
|
|
|
|
|
else:
|
|
|
|
|
self.start_btn.setText("Продолжить")
|
|
|
|
|
self.started = False
|
|
|
|
|
self.save_btn.show()
|
|
|
|
|
|
|
|
|
|
def reset(self):
|
|
|
|
|
self.started = False
|
|
|
|
|
self.start_btn.setText("Начать измерения")
|
|
|
|
|
self.save_btn.hide()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Part2(QtWidgets.QWidget):
|
|
|
|
|
def __init__(self):
|
|
|
|
|
super().__init__()
|
|
|
|
|
self.started = False
|
|
|
|
|
self.n = 0
|
|
|
|
|
self.q = QtGui.QScreen.availableGeometry(QtWidgets.QApplication.primaryScreen())
|
|
|
|
|
h = self.q.height() * 0.2
|
|
|
|
|
|
|
|
|
|
self.button = QtWidgets.QPushButton(self)
|
|
|
|
|
self.button.setGeometry(QtCore.QRect(20, 20, 40, 40))
|
|
|
|
|
self.button.setText("Esc")
|
|
|
|
|
|
|
|
|
|
self.title = QtWidgets.QLabel(self)
|
|
|
|
|
self.title.setText(
|
|
|
|
|
"<html><head/><body><p align=\"center\"><span style=\" font-size:16pt; font-weight:600;\"> ЧАСТЬ "
|
|
|
|
|
"II</span></p><p align=\"center\"><span style=\" font-size:12pt;\">Зондовые характеристики "
|
|
|
|
|
"плазмы</span></p></body></html>")
|
|
|
|
|
self.title.setGeometry(QtCore.QRect(self.q.width() // 2 - 200, 20, 400, 80))
|
|
|
|
|
|
|
|
|
|
self.back_button = QtWidgets.QPushButton(self)
|
|
|
|
|
self.back_button.setGeometry(QtCore.QRect(20, self.q.height() - 20, 80, 40))
|
|
|
|
|
self.back_button.setText("Назад")
|
|
|
|
|
|
|
|
|
|
self.pixmap0 = QtGui.QPixmap('Aspect-ratio-4x3.png')
|
|
|
|
|
self.pixmap = self.pixmap0.scaledToHeight(3 * h)
|
|
|
|
|
self.plot1 = QtWidgets.QLabel(self)
|
|
|
|
|
self.plot1.setPixmap(self.pixmap)
|
|
|
|
|
self.plot1.setGeometry(QtCore.QRect(h, h + 20, 4 * h, 3 * h))
|
|
|
|
|
|
|
|
|
|
self.text = QtWidgets.QLabel(self)
|
|
|
|
|
self.text.setText("<html><p align=\"left\"><span style=\" font-size:10pt;\">Перед проведением измерений "
|
|
|
|
|
"зондовых характеристик</p><p align=\"left\"><span style=\" font-size:10pt;\">плазмы "
|
|
|
|
|
"проверьте подключение вольтметра V<sub>2</sub></p><p align=\"left\"><span style=\" "
|
|
|
|
|
"font-size:10pt;\">и амперметров A<sub>1 </sub>и А<sub>2</sub>, а также убедитесь,"
|
|
|
|
|
"</p><p align=\"left\"><span style=\" font-size:10pt\";>что переключатель П<sub>1</sub> "
|
|
|
|
|
"находится в положении II.</p><p align=\"left\"><span style=\" font-size:10pt;\">Установите "
|
|
|
|
|
"требуемый согласно методике разрядный ток,</p><p align=\"left\"><span style=\" "
|
|
|
|
|
"font-size:10pt\";>не изменяйте его в момент проведения серии измерений.</p><p "
|
|
|
|
|
"align=\"left\"><span style=\" font-size:10pt;\">При помощи потенциометра измерьте "
|
|
|
|
|
"ВАХ</p><p align=\"left\"><span style=\" font-size:10pt;\">в максимальном диапазоне, "
|
|
|
|
|
"учтите,</p><p align=\"left\"><span style=\" font-size:10pt;\">что полярность можно менять "
|
|
|
|
|
"с помощью</p><p align=\"left\"><span style=\" font-size:10pt;\">переключателя "
|
|
|
|
|
"П<sub>2</sub> только при токе I<sub>з</sub>= 0.</p><p align=\"left\"><span style=\" "
|
|
|
|
|
"font-size:10pt;\">График I<sub>з</sub>(U<sub>з</sub>) будет строиться автоматически,"
|
|
|
|
|
"</p><p align=\"left\"><span style=\" font-size:10pt;\">после завершения всех серий "
|
|
|
|
|
"измерений</p><p align=\"left\"><span style=\" font-size:10pt;\">можно сохранить полученные "
|
|
|
|
|
"значения и график.</p></html>")
|
|
|
|
|
self.text.setGeometry(QtCore.QRect(6 * h, h + 20, 3 * h, 2 * h + 20))
|
|
|
|
|
|
|
|
|
|
self.start_btn = QtWidgets.QPushButton(self)
|
|
|
|
|
self.start_btn.setText("Добавить серию")
|
|
|
|
|
self.start_btn.setGeometry(QtCore.QRect(7.5 * h - 150, 4 * h - 50, 120, 30))
|
|
|
|
|
|
|
|
|
|
self.delete_btn = QtWidgets.QPushButton(self)
|
|
|
|
|
self.delete_btn.setText("Удалить серию")
|
|
|
|
|
self.delete_btn.setGeometry(QtCore.QRect(7.5 * h + 30, 4 * h - 50, 120, 30))
|
|
|
|
|
self.delete_btn.hide()
|
|
|
|
|
|
|
|
|
|
self.save_btn = QtWidgets.QPushButton(self)
|
|
|
|
|
self.save_btn.setText("Сохранить")
|
|
|
|
|
self.save_btn.setGeometry(QtCore.QRect(7.5 * h - 60, 4 * h, 120, 30))
|
|
|
|
|
self.save_btn.hide()
|
|
|
|
|
|
|
|
|
|
self.button.clicked.connect(self.esc)
|
|
|
|
|
self.back_button.clicked.connect(self.back)
|
|
|
|
|
self.start_btn.clicked.connect(self.start_stop)
|
|
|
|
|
self.delete_btn.clicked.connect(self.delete)
|
|
|
|
|
|
|
|
|
|
@QtCore.Slot()
|
|
|
|
|
def esc(self):
|
|
|
|
|
self.close()
|
|
|
|
|
|
|
|
|
|
def back(self):
|
|
|
|
|
self.w = TitleScreen()
|
|
|
|
|
self.w.showFullScreen()
|
|
|
|
|
self.close()
|
|
|
|
|
|
|
|
|
|
def start_stop(self):
|
|
|
|
|
if not self.started:
|
|
|
|
|
self.start_btn.setText("Стоп")
|
|
|
|
|
self.started = True
|
|
|
|
|
self.save_btn.hide()
|
|
|
|
|
self.n += 1
|
|
|
|
|
else:
|
|
|
|
|
self.start_btn.setText("Добавить серию")
|
|
|
|
|
self.started = False
|
|
|
|
|
self.save_btn.show()
|
|
|
|
|
self.delete_btn.show()
|
|
|
|
|
|
|
|
|
|
def delete(self):
|
|
|
|
|
self.started = False
|
|
|
|
|
self.start_btn.setText("Добавить серию")
|
|
|
|
|
self.n -= 1
|
|
|
|
|
if self.n == 0:
|
|
|
|
|
self.save_btn.hide()
|
|
|
|
|
self.delete_btn.hide()
|
|
|
|
|
|
2022-11-19 18:05:48 +03:00
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
app = QtWidgets.QApplication([])
|
|
|
|
|
|
2022-11-20 21:54:32 +03:00
|
|
|
|
widget = TitleScreen()
|
2022-11-19 18:05:48 +03:00
|
|
|
|
widget.showFullScreen()
|
|
|
|
|
|
2022-11-20 21:54:32 +03:00
|
|
|
|
sys.exit(app.exec())
|