1
0
Fork 0

gui: Add pd_mon config form

- force user to follow a sequence of steps for safely configuring pd_mon
This commit is contained in:
linuswck 2024-09-10 15:29:11 +08:00
parent 0aeffdbf7b
commit 0d64d62fb0
3 changed files with 904 additions and 7 deletions

View File

@ -26,6 +26,7 @@ from datetime import datetime, timezone, timedelta
from time import time from time import time
from typing import Any, Optional, List from typing import Any, Optional, List
from ui.ui_conn_settings_form import Ui_Conn_Settings_Form from ui.ui_conn_settings_form import Ui_Conn_Settings_Form
from ui.ui_config_pd_mon_form import Ui_Cfg_Pd_Mon_Form
from ui.ui_update_network_settings_form import Ui_Update_Network_Settings_Form from ui.ui_update_network_settings_form import Ui_Update_Network_Settings_Form
from dateutil import tz from dateutil import tz
import math import math
@ -54,6 +55,9 @@ def siConvert(val, suffix, typ=float):
siConvert(0.1, "mA") # returns 100 siConvert(0.1, "mA") # returns 100
""" """
if val is None:
val = 0.0
val, siprefix, suffix = siParse(str(val)+suffix, FLOAT_REGEX) val, siprefix, suffix = siParse(str(val)+suffix, FLOAT_REGEX)
v = typ(val) v = typ(val)
@ -70,6 +74,7 @@ class Kirdy(QObject):
connected_sig = pyqtSignal(bool) connected_sig = pyqtSignal(bool)
setting_update_sig = pyqtSignal(dict) setting_update_sig = pyqtSignal(dict)
report_update_sig = pyqtSignal(dict) report_update_sig = pyqtSignal(dict)
cmd_fail_sig = pyqtSignal(str)
def __init__(self, parent, kirdy, _poll_interval): def __init__(self, parent, kirdy, _poll_interval):
super().__init__(parent) super().__init__(parent)
@ -80,6 +85,7 @@ class Kirdy(QObject):
self.connected_sig.connect(self.connected_setup) self.connected_sig.connect(self.connected_setup)
self._kirdy.set_report_sig(self.report_update_sig) self._kirdy.set_report_sig(self.report_update_sig)
self._kirdy.set_err_msg_sig(self.cmd_fail_sig)
self._timer = QtCore.QBasicTimer() self._timer = QtCore.QBasicTimer()
def connected(self): def connected(self):
@ -317,6 +323,10 @@ class UpdateNetSettingsForm(QtWidgets.QDialog, Ui_Update_Network_Settings_Form):
except (OSError, ValueError): except (OSError, ValueError):
return None return None
class CfgPdMonForm(QtWidgets.QDialog, Ui_Cfg_Pd_Mon_Form):
def __init__(self):
super().__init__()
self.setupUi(self)
class ConnSettingsForm(QtWidgets.QDialog, Ui_Conn_Settings_Form): class ConnSettingsForm(QtWidgets.QDialog, Ui_Conn_Settings_Form):
def __init__(self): def __init__(self):
@ -355,18 +365,19 @@ class MainWindow(QtWidgets.QMainWindow):
{'name': 'LF Mod Termination (50 Ohm)', 'type': 'list', 'limits': ['On', 'Off'], 'readonly': True, "compactHeight": False} {'name': 'LF Mod Termination (50 Ohm)', 'type': 'list', 'limits': ['On', 'Off'], 'readonly': True, "compactHeight": False}
]}, ]},
{'name': 'Output Config', 'expanded': True, 'type': 'group', 'children': [ {'name': 'Output Config', 'expanded': True, 'type': 'group', 'children': [
{'name': 'LD Current Set', 'type': 'float', 'value': 0, 'step': 0.001, 'decimals': 6, 'limits': (0, 300), {'name': 'LD Current Set', 'type': 'float', 'value': 0, 'step': 0.001, 'format': '{value:.4f}', 'decimals': 6, 'limits': (0, 300),
'unit': 'mA', 'lock': False, 'target': 'laser', 'action': 'set_i', "compactHeight": False}, 'unit': 'mA', 'lock': False, 'target': 'laser', 'action': 'set_i', "compactHeight": False},
{'name': 'LD Terminals Short', 'type': 'bool', 'value': False, 'lock': False, 'target': 'laser', 'action': 'set_ld_terms_short', "compactHeight": False}, {'name': 'LD Terminals Short', 'type': 'bool', 'value': False, 'lock': False, 'target': 'laser', 'action': 'set_ld_terms_short', "compactHeight": False},
{'name': 'Default Power On', 'type': 'bool', 'value': False, 'lock': False, 'target': 'laser', 'action': 'set_default_pwr_on', "compactHeight": False}, {'name': 'Default Power On', 'type': 'bool', 'value': False, 'lock': False, 'target': 'laser', 'action': 'set_default_pwr_on', "compactHeight": False},
]}, ]},
{'name': 'Photodiode Monitor Config', 'expanded': False, 'type': 'group', 'children': [ {'name': 'Photodiode Monitor Config', 'expanded': False, 'type': 'group', 'children': [
{'name': 'LD Power Limit', 'type': 'float', 'value': 0, 'step': 0.001, 'decimals': 6, 'limits': (0, float("inf")), {'name': 'LD Power Limit', 'type': 'float', 'value': 0, 'step': 0.001, 'format': '{value:.4f}', 'decimals': 6, 'limits': (0, float("inf")),
'unit': 'mW', 'lock': False, 'target': 'laser', 'action': 'set_ld_pwr_limit', "compactHeight": False}, 'unit': 'mW', 'lock': False, 'target': 'laser', 'action': 'set_ld_pwr_limit', "compactHeight": False},
{'name': 'Responsitivity', 'type': 'float', 'value': 0, 'step': 0.001, 'decimals': 6, 'limits': (0, float("inf")), {'name': 'Responsitivity', 'type': 'float', 'value': 0, 'step': 0.001, 'format': '{value:.4f}', 'decimals': 6, 'limits': (0, float("inf")),
'unit': 'mA/W', 'lock': False, 'target': 'laser', 'action': 'set_pd_mon_responsitivity', "compactHeight": False}, 'unit': 'mA/W', 'lock': False, 'target': 'laser', 'action': 'set_pd_mon_responsitivity', "compactHeight": False, 'readonly': True},
{'name': 'Dark Current', 'type': 'float', 'value': 0, 'step': 1, 'decimals': 6, 'limits': (0, float("inf")), {'name': 'Dark Current', 'type': 'float', 'value': 0, 'step': 1, 'format': '{value:.4f}', 'decimals': 6, 'limits': (0, float("inf")),
'unit': 'uA', 'lock': False, 'target': 'laser', 'action': 'set_pd_mon_dark_current', "compactHeight": False}, 'unit': 'uA', 'lock': False, 'target': 'laser', 'action': 'set_pd_mon_dark_current', "compactHeight": False, 'readonly': True},
{'name': 'Configure Photodiode Monitor', 'type': 'action'},
]}, ]},
] ]
@ -451,6 +462,8 @@ class MainWindow(QtWidgets.QMainWindow):
self.ip_addr = self.DEFAULT_IP_ADDR self.ip_addr = self.DEFAULT_IP_ADDR
self.port = self.DEFAULT_PORT self.port = self.DEFAULT_PORT
self.cfg_pd_mon_form = CfgPdMonForm()
self.conn_settings_form = ConnSettingsForm() self.conn_settings_form = ConnSettingsForm()
self.conn_settings_form.accepted.connect(self.start_connecting) self.conn_settings_form.accepted.connect(self.start_connecting)
@ -502,6 +515,7 @@ class MainWindow(QtWidgets.QMainWindow):
Parameter.create(name=f"Thermostat Parameters", type='group', value=3, children=self.THERMOSTAT_PARAMETERS), Parameter.create(name=f"Thermostat Parameters", type='group', value=3, children=self.THERMOSTAT_PARAMETERS),
] ]
self._set_param_tree() self._set_param_tree()
self._set_up_pd_mon_form()
self.tec_i_graph.setTitle("TEC Current") self.tec_i_graph.setTitle("TEC Current")
self.tec_temp_graph.setTitle("TEC Temperature") self.tec_temp_graph.setTitle("TEC Temperature")
@ -516,6 +530,7 @@ class MainWindow(QtWidgets.QMainWindow):
self.kirdy_handler.setting_update_sig.connect(self.update_thermostat_ctrl_panel_settings) self.kirdy_handler.setting_update_sig.connect(self.update_thermostat_ctrl_panel_settings)
self.kirdy_handler.report_update_sig.connect(self.update_ld_ctrl_panel_readings) self.kirdy_handler.report_update_sig.connect(self.update_ld_ctrl_panel_readings)
self.kirdy_handler.report_update_sig.connect(self.update_thermostat_ctrl_panel_readings) self.kirdy_handler.report_update_sig.connect(self.update_thermostat_ctrl_panel_readings)
self.kirdy_handler.cmd_fail_sig.connect(self.cmd_cannot_execute)
self.graphs = Graphs(self.ld_i_set_graph, self.pd_mon_pwr_graph, self.tec_i_graph, self.tec_temp_graph, max_samples=self.max_samples) self.graphs = Graphs(self.ld_i_set_graph, self.pd_mon_pwr_graph, self.tec_i_graph, self.tec_temp_graph, max_samples=self.max_samples)
self.kirdy_handler.report_update_sig.connect(self.graphs.plot_append) self.kirdy_handler.report_update_sig.connect(self.graphs.plot_append)
@ -586,6 +601,21 @@ class MainWindow(QtWidgets.QMainWindow):
self.update_net_settings_form.show() self.update_net_settings_form.show()
self.menu_action_update_net_settings.triggered.connect(show_update_net_settings_form) self.menu_action_update_net_settings.triggered.connect(show_update_net_settings_form)
def update_pd_mon_form_readings(self, ld_settings):
pwr_unit = self.params[1].child('Photodiode Monitor Config', 'LD Power Limit').opts.get("unit", None)
self.params[1].child('Photodiode Monitor Config', 'LD Power Limit').setOpts(limits= (0, siConvert(ld_settings["ld_pwr_limit"]["max"], pwr_unit)))
self.cfg_pd_mon_form.settable_pwr_range_display_lbl.setText(f" 0 - {siConvert(ld_settings['ld_pwr_limit']['max'], pwr_unit):.4f}")
self.cfg_pd_mon_form.cfg_pwr_limit_spinbox.setMaximum(siConvert(ld_settings['ld_pwr_limit']['max'], pwr_unit))
responsitivity_unit = self.cfg_pd_mon_form.cfg_responsitivity_spinbox.unit
self.cfg_pd_mon_form.cfg_responsitivity_reading.setText(f"{siConvert(ld_settings['pd_mon_params']['responsitivity'], responsitivity_unit):.4f}")
i_dark_unit = self.cfg_pd_mon_form.cfg_dark_current_spinbox.unit
self.cfg_pd_mon_form.cfg_dark_current_reading.setText(f"{siConvert(ld_settings['pd_mon_params']['i_dark'], i_dark_unit):.4f}")
pwr_limit_unit = self.cfg_pd_mon_form.cfg_pwr_limit_spinbox.unit
self.cfg_pd_mon_form.cfg_pwr_limit_reading.setText(f"{siConvert(ld_settings['ld_pwr_limit']['value'], pwr_limit_unit):.4f}")
def show_conn_settings_form(self): def show_conn_settings_form(self):
ip_addr = self.ip_addr.split(".") ip_addr = self.ip_addr.split(".")
self.conn_settings_form.addr_in_0.setText(ip_addr[0]) self.conn_settings_form.addr_in_0.setText(ip_addr[0])
@ -648,6 +678,70 @@ class MainWindow(QtWidgets.QMainWindow):
self.plot_settings.setMenu(self.plot_menu) self.plot_settings.setMenu(self.plot_menu)
def _set_up_pd_mon_form(self):
@pyqtSlot(bool)
def ld_pwr_on(_):
self.kirdy.task_dispatcher(self.kirdy.laser.clear_alarm())
self.kirdy.task_dispatcher(self.kirdy.laser.set_power_on(True))
self.cfg_pd_mon_form.pwr_on_btn.clicked.connect(ld_pwr_on)
@pyqtSlot(bool)
def ld_pwr_off(_):
self.kirdy.task_dispatcher(self.kirdy.laser.set_power_on(False))
self.cfg_pd_mon_form.pwr_off_btn.clicked.connect(ld_pwr_off)
def get_spinbox_value(spinbox):
_, _, suffix = siParse(str(spinbox.value())+spinbox.unit, regex=FLOAT_REGEX)
return siEval(str(spinbox.value())+spinbox.unit, regex=FLOAT_REGEX, suffix=suffix)
def set_spinbox_value(spinbox, val):
spinbox.setValue(siConvert(val, spinbox.unit))
@pyqtSlot(bool)
def apply_pd_params(_):
responsitivity = get_spinbox_value(self.cfg_pd_mon_form.cfg_responsitivity_spinbox)
dark_current = get_spinbox_value(self.cfg_pd_mon_form.cfg_dark_current_spinbox)
self.kirdy.task_dispatcher(self.kirdy.laser.set_pd_mon_responsitivity(responsitivity))
self.kirdy.task_dispatcher(self.kirdy.laser.set_pd_mon_dark_current(dark_current))
self.kirdy.task_dispatcher(self.kirdy.laser.apply_pd_params())
self.cfg_pd_mon_form.apply_pd_params_btn.clicked.connect(apply_pd_params)
@pyqtSlot(bool)
def apply_ld_pwr_limit(_):
pwr_limit = get_spinbox_value(self.cfg_pd_mon_form.cfg_pwr_limit_spinbox)
self.kirdy.task_dispatcher(self.kirdy.laser.set_ld_pwr_limit(pwr_limit))
self.cfg_pd_mon_form.apply_pwr_limit_btn.clicked.connect(apply_ld_pwr_limit)
@pyqtSlot(bool)
def rst_ld_pwr_limit(_):
pwr_limit = self.cfg_pd_mon_form.cfg_pwr_limit_spinbox.value()
self.kirdy.task_dispatcher(self.kirdy.laser.set_ld_pwr_limit(0))
self.cfg_pd_mon_form.rst_ld_pwr_limit_btn.clicked.connect(rst_ld_pwr_limit)
@asyncSlot(bool)
async def apply_ld_pwr_limit_max(_):
settings = await self.kirdy.device.get_settings_summary()
set_spinbox_value(self.cfg_pd_mon_form.cfg_pwr_limit_spinbox, settings['laser']['ld_pwr_limit']['max'])
self.kirdy.task_dispatcher(self.kirdy.laser.set_ld_pwr_limit(settings['laser']['ld_pwr_limit']['max']))
self.cfg_pd_mon_form.apply_pwr_limit_max_btn.clicked.connect(apply_ld_pwr_limit_max)
ld_pwr_limit_unit = self.params[1].child('Photodiode Monitor Config', 'LD Power Limit').opts["unit"]
ld_pwr_limit_text = self.cfg_pd_mon_form.cfg_pwr_limit_lbl.text()
self.cfg_pd_mon_form.cfg_pwr_limit_lbl.setText(ld_pwr_limit_text.replace(":", f" ({ld_pwr_limit_unit}):"))
self.cfg_pd_mon_form.cfg_pwr_limit_spinbox.unit = ld_pwr_limit_unit
settable_pwr_limit_text = self.cfg_pd_mon_form.settable_pwr_range_lbl.text()
self.cfg_pd_mon_form.settable_pwr_range_lbl.setText(settable_pwr_limit_text.replace(":", f" ({ld_pwr_limit_unit}):"))
pd_responsitivity_unit = self.params[1].child('Photodiode Monitor Config', 'Responsitivity').opts["unit"]
pd_responsitivity_text = self.cfg_pd_mon_form.cfg_responsitivity_lbl.text()
self.cfg_pd_mon_form.cfg_responsitivity_lbl.setText(pd_responsitivity_text.replace(":", f" ({pd_responsitivity_unit}):"))
self.cfg_pd_mon_form.cfg_responsitivity_spinbox.unit = pd_responsitivity_unit
pd_dark_current_unit = self.params[1].child('Photodiode Monitor Config', 'Dark Current').opts["unit"]
pd_dark_current_text = self.cfg_pd_mon_form.cfg_dark_current_lbl.text()
self.cfg_pd_mon_form.cfg_dark_current_lbl.setText(pd_dark_current_text.replace(":", f" ({pd_dark_current_unit}):"))
self.cfg_pd_mon_form.cfg_dark_current_spinbox.unit = pd_dark_current_unit
def _set_param_tree(self): def _set_param_tree(self):
status = self.ld_status status = self.ld_status
status.setHeaderHidden(True) status.setHeaderHidden(True)
@ -695,6 +789,25 @@ class MainWindow(QtWidgets.QMainWindow):
self.loading_spinner.hide() self.loading_spinner.hide()
self.params[3].child('PID Config', 'PID Auto Tune', 'Run').sigActivated.connect(autotune) self.params[3].child('PID Config', 'PID Auto Tune', 'Run').sigActivated.connect(autotune)
@pyqtSlot()
def show_pd_mon_cfg_form(parm):
ld_pwr_limit = self.params[1].child('Photodiode Monitor Config', 'LD Power Limit').value()
pd_responsitivity = self.params[1].child('Photodiode Monitor Config', 'Responsitivity').value()
pd_dark_current = self.params[1].child('Photodiode Monitor Config', 'Dark Current').value()
self.cfg_pd_mon_form.cfg_responsitivity_spinbox.setValue(pd_responsitivity)
self.cfg_pd_mon_form.cfg_pwr_limit_spinbox.setValue(ld_pwr_limit)
self.cfg_pd_mon_form.cfg_dark_current_spinbox.setValue(pd_dark_current)
self.cfg_pd_mon_form.show()
self.params[1].child('Photodiode Monitor Config', 'Configure Photodiode Monitor').sigActivated.connect(show_pd_mon_cfg_form)
@pyqtSlot(str)
def cmd_cannot_execute(self, kirdy_msg):
self.info_box.setText(kirdy_msg)
self.info_box.setWindowTitle("Command fails to execute")
self.info_box.show()
@pyqtSlot(dict) @pyqtSlot(dict)
def autotune_tick(self, report): def autotune_tick(self, report):
match self.autotuner.state(): match self.autotuner.state():
@ -803,7 +916,8 @@ class MainWindow(QtWidgets.QMainWindow):
self.params[1].child('Output Config', 'LD Current Set').setValuewithLock(settings["ld_drive_current"]['value']) self.params[1].child('Output Config', 'LD Current Set').setValuewithLock(settings["ld_drive_current"]['value'])
self.params[1].child('Output Config', 'LD Terminals Short').setValuewithLock(settings["ld_terms_short"]) self.params[1].child('Output Config', 'LD Terminals Short').setValuewithLock(settings["ld_terms_short"])
self.params[1].child('Output Config', 'Default Power On').setValuewithLock(settings["default_pwr_on"]) self.params[1].child('Output Config', 'Default Power On').setValuewithLock(settings["default_pwr_on"])
self.params[1].child('Photodiode Monitor Config', 'LD Power Limit').setValuewithLock(settings["ld_pwr_limit"]) self.params[1].child('Photodiode Monitor Config', 'LD Power Limit').setValuewithLock(settings["ld_pwr_limit"]["value"])
self.update_pd_mon_form_readings(settings)
if settings["pd_mon_params"]["responsitivity"] is not None: if settings["pd_mon_params"]["responsitivity"] is not None:
self.params[1].child('Photodiode Monitor Config', 'Responsitivity').setValuewithLock(settings["pd_mon_params"]["responsitivity"]) self.params[1].child('Photodiode Monitor Config', 'Responsitivity').setValuewithLock(settings["pd_mon_params"]["responsitivity"])
else: else:

View File

@ -0,0 +1,488 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Cfg_Pd_Mon_Form</class>
<widget class="QDialog" name="Cfg_Pd_Mon_Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>520</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>500</width>
<height>520</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>500</width>
<height>520</height>
</size>
</property>
<property name="windowTitle">
<string>config_pd_mon_form</string>
</property>
<widget class="QWidget" name="verticalLayoutWidget_2">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>481</width>
<height>500</height>
</rect>
</property>
<layout class="QVBoxLayout" name="cfg_pd_mon_form_layout" stretch="0,2,2,2,2,2,1">
<item>
<widget class="QLabel" name="title_lbl">
<property name="font">
<font>
<pointsize>22</pointsize>
</font>
</property>
<property name="text">
<string>Configure Photodiode Monitor</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="pwr_off_layout" stretch="5,4">
<property name="spacing">
<number>12</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SizeConstraint::SetDefaultConstraint</enum>
</property>
<item>
<widget class="QLabel" name="pwr_off_lbl">
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string> Step 1: Turn off Laser Power</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pwr_off_btn">
<property name="text">
<string>Power Off</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="rst_ld_pwr_limit_layout" stretch="5,4">
<item>
<widget class="QLabel" name="rst_ld_pwr_limit_lbl">
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string> Step 2: Reset Ld Pwr Limit to 0</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="rst_ld_pwr_limit_btn">
<property name="text">
<string>Reset Ld Pwr Limit</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="cfg_pd_params_layout">
<item>
<widget class="QLabel" name="cfg_pd_params_lbl">
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string> Step 3: Configure Photodiode Parameters</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="5,2,2">
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string> Value</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Reading</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="cfg_responsitivity_layout" stretch="5,2,2">
<item>
<widget class="QLabel" name="cfg_responsitivity_lbl">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>Responsitivity: </string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="cfg_responsitivity_spinbox">
<property name="suffix">
<string/>
</property>
<property name="decimals">
<number>4</number>
</property>
<property name="maximum">
<double>1000.000000000000000</double>
</property>
<property name="singleStep">
<double>0.001000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="cfg_responsitivity_reading">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>0.0000</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="cfg_dark_current_layout" stretch="5,2,2">
<item>
<widget class="QLabel" name="cfg_dark_current_lbl">
<property name="text">
<string>Dark Current: </string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="cfg_dark_current_spinbox">
<property name="decimals">
<number>4</number>
</property>
<property name="singleStep">
<double>0.001000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="cfg_dark_current_reading">
<property name="text">
<string>0.0000</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="apply_pd_params_layout" stretch="5,4">
<property name="spacing">
<number>12</number>
</property>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="apply_pd_params_btn">
<property name="text">
<string>Apply</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="cfg_pwr_limit_layout">
<item>
<widget class="QLabel" name="cfg_pd_pwr_limit_lbl">
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string> Step 4: Configure Laser Diode Power Limit</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="5,2,2">
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string> Value</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Reading</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="pwr_limit_layout" stretch="5,2,2">
<item>
<widget class="QLabel" name="cfg_pwr_limit_lbl">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>Power Limit:</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="cfg_pwr_limit_spinbox">
<property name="decimals">
<number>4</number>
</property>
<property name="singleStep">
<double>0.001000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="cfg_pwr_limit_reading">
<property name="text">
<string>0.0000</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="settable_pwr_range_layout" stretch="5,4">
<property name="spacing">
<number>12</number>
</property>
<item>
<widget class="QLabel" name="settable_pwr_range_lbl">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>Settable Power Range:</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="settable_pwr_range_display_lbl">
<property name="minimumSize">
<size>
<width>0</width>
<height>28</height>
</size>
</property>
<property name="text">
<string>( Power Range )</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="apply_pwr_limit_layout" stretch="2,3,4">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="apply_pwr_limit_max_btn">
<property name="text">
<string>Apply Max</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="apply_pwr_limit_btn">
<property name="text">
<string>Apply</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="pwr_on_layout" stretch="5,4">
<property name="spacing">
<number>12</number>
</property>
<item>
<widget class="QLabel" name="pwr_on_lbl">
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string> Step 5: Turn On Laser Power</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pwr_on_btn">
<property name="text">
<string>Clear Alarm and Power On</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="close_btn_layout" stretch="5,4">
<property name="spacing">
<number>12</number>
</property>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="close_btn">
<property name="text">
<string>Close</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections>
<connection>
<sender>close_btn</sender>
<signal>clicked()</signal>
<receiver>Cfg_Pd_Mon_Form</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>141</x>
<y>456</y>
</hint>
<hint type="destinationlabel">
<x>281</x>
<y>355</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -0,0 +1,295 @@
# Form implementation generated from reading ui file 'config_pd_mon_form.ui'
#
# Created by: PyQt6 UI code generator 6.6.0
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_Cfg_Pd_Mon_Form(object):
def setupUi(self, Cfg_Pd_Mon_Form):
Cfg_Pd_Mon_Form.setObjectName("Cfg_Pd_Mon_Form")
Cfg_Pd_Mon_Form.resize(500, 520)
Cfg_Pd_Mon_Form.setMinimumSize(QtCore.QSize(500, 520))
Cfg_Pd_Mon_Form.setMaximumSize(QtCore.QSize(500, 520))
self.verticalLayoutWidget_2 = QtWidgets.QWidget(parent=Cfg_Pd_Mon_Form)
self.verticalLayoutWidget_2.setGeometry(QtCore.QRect(10, 10, 481, 500))
self.verticalLayoutWidget_2.setObjectName("verticalLayoutWidget_2")
self.cfg_pd_mon_form_layout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget_2)
self.cfg_pd_mon_form_layout.setContentsMargins(0, 0, 0, 0)
self.cfg_pd_mon_form_layout.setObjectName("cfg_pd_mon_form_layout")
self.title_lbl = QtWidgets.QLabel(parent=self.verticalLayoutWidget_2)
font = QtGui.QFont()
font.setPointSize(22)
self.title_lbl.setFont(font)
self.title_lbl.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.title_lbl.setObjectName("title_lbl")
self.cfg_pd_mon_form_layout.addWidget(self.title_lbl)
self.pwr_off_layout = QtWidgets.QHBoxLayout()
self.pwr_off_layout.setSizeConstraint(QtWidgets.QLayout.SizeConstraint.SetDefaultConstraint)
self.pwr_off_layout.setSpacing(12)
self.pwr_off_layout.setObjectName("pwr_off_layout")
self.pwr_off_lbl = QtWidgets.QLabel(parent=self.verticalLayoutWidget_2)
font = QtGui.QFont()
font.setPointSize(14)
self.pwr_off_lbl.setFont(font)
self.pwr_off_lbl.setObjectName("pwr_off_lbl")
self.pwr_off_layout.addWidget(self.pwr_off_lbl)
self.pwr_off_btn = QtWidgets.QPushButton(parent=self.verticalLayoutWidget_2)
self.pwr_off_btn.setObjectName("pwr_off_btn")
self.pwr_off_layout.addWidget(self.pwr_off_btn)
self.pwr_off_layout.setStretch(0, 5)
self.pwr_off_layout.setStretch(1, 4)
self.cfg_pd_mon_form_layout.addLayout(self.pwr_off_layout)
self.rst_ld_pwr_limit_layout = QtWidgets.QHBoxLayout()
self.rst_ld_pwr_limit_layout.setObjectName("rst_ld_pwr_limit_layout")
self.rst_ld_pwr_limit_lbl = QtWidgets.QLabel(parent=self.verticalLayoutWidget_2)
font = QtGui.QFont()
font.setPointSize(14)
self.rst_ld_pwr_limit_lbl.setFont(font)
self.rst_ld_pwr_limit_lbl.setObjectName("rst_ld_pwr_limit_lbl")
self.rst_ld_pwr_limit_layout.addWidget(self.rst_ld_pwr_limit_lbl)
self.rst_ld_pwr_limit_btn = QtWidgets.QPushButton(parent=self.verticalLayoutWidget_2)
self.rst_ld_pwr_limit_btn.setObjectName("rst_ld_pwr_limit_btn")
self.rst_ld_pwr_limit_layout.addWidget(self.rst_ld_pwr_limit_btn)
self.rst_ld_pwr_limit_layout.setStretch(0, 5)
self.rst_ld_pwr_limit_layout.setStretch(1, 4)
self.cfg_pd_mon_form_layout.addLayout(self.rst_ld_pwr_limit_layout)
self.cfg_pd_params_layout = QtWidgets.QVBoxLayout()
self.cfg_pd_params_layout.setObjectName("cfg_pd_params_layout")
self.cfg_pd_params_lbl = QtWidgets.QLabel(parent=self.verticalLayoutWidget_2)
font = QtGui.QFont()
font.setPointSize(14)
self.cfg_pd_params_lbl.setFont(font)
self.cfg_pd_params_lbl.setObjectName("cfg_pd_params_lbl")
self.cfg_pd_params_layout.addWidget(self.cfg_pd_params_lbl)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.label_2 = QtWidgets.QLabel(parent=self.verticalLayoutWidget_2)
self.label_2.setObjectName("label_2")
self.horizontalLayout.addWidget(self.label_2)
self.label = QtWidgets.QLabel(parent=self.verticalLayoutWidget_2)
self.label.setObjectName("label")
self.horizontalLayout.addWidget(self.label)
self.horizontalLayout.setStretch(0, 5)
self.horizontalLayout.setStretch(1, 2)
self.horizontalLayout.setStretch(2, 2)
self.cfg_pd_params_layout.addLayout(self.horizontalLayout)
self.cfg_responsitivity_layout = QtWidgets.QHBoxLayout()
self.cfg_responsitivity_layout.setObjectName("cfg_responsitivity_layout")
self.cfg_responsitivity_lbl = QtWidgets.QLabel(parent=self.verticalLayoutWidget_2)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.cfg_responsitivity_lbl.sizePolicy().hasHeightForWidth())
self.cfg_responsitivity_lbl.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setPointSize(12)
self.cfg_responsitivity_lbl.setFont(font)
self.cfg_responsitivity_lbl.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.cfg_responsitivity_lbl.setObjectName("cfg_responsitivity_lbl")
self.cfg_responsitivity_layout.addWidget(self.cfg_responsitivity_lbl)
self.cfg_responsitivity_spinbox = QtWidgets.QDoubleSpinBox(parent=self.verticalLayoutWidget_2)
self.cfg_responsitivity_spinbox.setSuffix("")
self.cfg_responsitivity_spinbox.setDecimals(4)
self.cfg_responsitivity_spinbox.setMaximum(1000.0)
self.cfg_responsitivity_spinbox.setSingleStep(0.001)
self.cfg_responsitivity_spinbox.setObjectName("cfg_responsitivity_spinbox")
self.cfg_responsitivity_layout.addWidget(self.cfg_responsitivity_spinbox)
self.cfg_responsitivity_reading = QtWidgets.QLabel(parent=self.verticalLayoutWidget_2)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.cfg_responsitivity_reading.sizePolicy().hasHeightForWidth())
self.cfg_responsitivity_reading.setSizePolicy(sizePolicy)
self.cfg_responsitivity_reading.setObjectName("cfg_responsitivity_reading")
self.cfg_responsitivity_layout.addWidget(self.cfg_responsitivity_reading)
self.cfg_responsitivity_layout.setStretch(0, 5)
self.cfg_responsitivity_layout.setStretch(1, 2)
self.cfg_responsitivity_layout.setStretch(2, 2)
self.cfg_pd_params_layout.addLayout(self.cfg_responsitivity_layout)
self.cfg_dark_current_layout = QtWidgets.QHBoxLayout()
self.cfg_dark_current_layout.setObjectName("cfg_dark_current_layout")
self.cfg_dark_current_lbl = QtWidgets.QLabel(parent=self.verticalLayoutWidget_2)
self.cfg_dark_current_lbl.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.cfg_dark_current_lbl.setObjectName("cfg_dark_current_lbl")
self.cfg_dark_current_layout.addWidget(self.cfg_dark_current_lbl)
self.cfg_dark_current_spinbox = QtWidgets.QDoubleSpinBox(parent=self.verticalLayoutWidget_2)
self.cfg_dark_current_spinbox.setDecimals(4)
self.cfg_dark_current_spinbox.setSingleStep(0.001)
self.cfg_dark_current_spinbox.setObjectName("cfg_dark_current_spinbox")
self.cfg_dark_current_layout.addWidget(self.cfg_dark_current_spinbox)
self.cfg_dark_current_reading = QtWidgets.QLabel(parent=self.verticalLayoutWidget_2)
self.cfg_dark_current_reading.setObjectName("cfg_dark_current_reading")
self.cfg_dark_current_layout.addWidget(self.cfg_dark_current_reading)
self.cfg_dark_current_layout.setStretch(0, 5)
self.cfg_dark_current_layout.setStretch(1, 2)
self.cfg_dark_current_layout.setStretch(2, 2)
self.cfg_pd_params_layout.addLayout(self.cfg_dark_current_layout)
self.apply_pd_params_layout = QtWidgets.QHBoxLayout()
self.apply_pd_params_layout.setSpacing(12)
self.apply_pd_params_layout.setObjectName("apply_pd_params_layout")
spacerItem1 = QtWidgets.QSpacerItem(10, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.apply_pd_params_layout.addItem(spacerItem1)
self.apply_pd_params_btn = QtWidgets.QPushButton(parent=self.verticalLayoutWidget_2)
self.apply_pd_params_btn.setObjectName("apply_pd_params_btn")
self.apply_pd_params_layout.addWidget(self.apply_pd_params_btn)
self.apply_pd_params_layout.setStretch(0, 5)
self.apply_pd_params_layout.setStretch(1, 4)
self.cfg_pd_params_layout.addLayout(self.apply_pd_params_layout)
self.cfg_pd_mon_form_layout.addLayout(self.cfg_pd_params_layout)
self.cfg_pwr_limit_layout = QtWidgets.QVBoxLayout()
self.cfg_pwr_limit_layout.setObjectName("cfg_pwr_limit_layout")
self.cfg_pd_pwr_limit_lbl = QtWidgets.QLabel(parent=self.verticalLayoutWidget_2)
font = QtGui.QFont()
font.setPointSize(14)
self.cfg_pd_pwr_limit_lbl.setFont(font)
self.cfg_pd_pwr_limit_lbl.setObjectName("cfg_pd_pwr_limit_lbl")
self.cfg_pwr_limit_layout.addWidget(self.cfg_pd_pwr_limit_lbl)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.horizontalLayout_2.addItem(spacerItem2)
self.label_3 = QtWidgets.QLabel(parent=self.verticalLayoutWidget_2)
self.label_3.setObjectName("label_3")
self.horizontalLayout_2.addWidget(self.label_3)
self.label_4 = QtWidgets.QLabel(parent=self.verticalLayoutWidget_2)
self.label_4.setObjectName("label_4")
self.horizontalLayout_2.addWidget(self.label_4)
self.horizontalLayout_2.setStretch(0, 5)
self.horizontalLayout_2.setStretch(1, 2)
self.horizontalLayout_2.setStretch(2, 2)
self.cfg_pwr_limit_layout.addLayout(self.horizontalLayout_2)
self.pwr_limit_layout = QtWidgets.QHBoxLayout()
self.pwr_limit_layout.setObjectName("pwr_limit_layout")
self.cfg_pwr_limit_lbl = QtWidgets.QLabel(parent=self.verticalLayoutWidget_2)
font = QtGui.QFont()
font.setPointSize(12)
self.cfg_pwr_limit_lbl.setFont(font)
self.cfg_pwr_limit_lbl.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.cfg_pwr_limit_lbl.setObjectName("cfg_pwr_limit_lbl")
self.pwr_limit_layout.addWidget(self.cfg_pwr_limit_lbl)
self.cfg_pwr_limit_spinbox = QtWidgets.QDoubleSpinBox(parent=self.verticalLayoutWidget_2)
self.cfg_pwr_limit_spinbox.setDecimals(4)
self.cfg_pwr_limit_spinbox.setSingleStep(0.001)
self.cfg_pwr_limit_spinbox.setObjectName("cfg_pwr_limit_spinbox")
self.pwr_limit_layout.addWidget(self.cfg_pwr_limit_spinbox)
self.cfg_pwr_limit_reading = QtWidgets.QLabel(parent=self.verticalLayoutWidget_2)
self.cfg_pwr_limit_reading.setObjectName("cfg_pwr_limit_reading")
self.pwr_limit_layout.addWidget(self.cfg_pwr_limit_reading)
self.pwr_limit_layout.setStretch(0, 5)
self.pwr_limit_layout.setStretch(1, 2)
self.pwr_limit_layout.setStretch(2, 2)
self.cfg_pwr_limit_layout.addLayout(self.pwr_limit_layout)
self.settable_pwr_range_layout = QtWidgets.QHBoxLayout()
self.settable_pwr_range_layout.setSpacing(12)
self.settable_pwr_range_layout.setObjectName("settable_pwr_range_layout")
self.settable_pwr_range_lbl = QtWidgets.QLabel(parent=self.verticalLayoutWidget_2)
font = QtGui.QFont()
font.setPointSize(12)
self.settable_pwr_range_lbl.setFont(font)
self.settable_pwr_range_lbl.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.settable_pwr_range_lbl.setObjectName("settable_pwr_range_lbl")
self.settable_pwr_range_layout.addWidget(self.settable_pwr_range_lbl)
self.settable_pwr_range_display_lbl = QtWidgets.QLabel(parent=self.verticalLayoutWidget_2)
self.settable_pwr_range_display_lbl.setMinimumSize(QtCore.QSize(0, 28))
self.settable_pwr_range_display_lbl.setObjectName("settable_pwr_range_display_lbl")
self.settable_pwr_range_layout.addWidget(self.settable_pwr_range_display_lbl)
self.settable_pwr_range_layout.setStretch(0, 5)
self.settable_pwr_range_layout.setStretch(1, 4)
self.cfg_pwr_limit_layout.addLayout(self.settable_pwr_range_layout)
self.apply_pwr_limit_layout = QtWidgets.QHBoxLayout()
self.apply_pwr_limit_layout.setObjectName("apply_pwr_limit_layout")
spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.apply_pwr_limit_layout.addItem(spacerItem3)
self.apply_pwr_limit_max_btn = QtWidgets.QPushButton(parent=self.verticalLayoutWidget_2)
self.apply_pwr_limit_max_btn.setObjectName("apply_pwr_limit_max_btn")
self.apply_pwr_limit_layout.addWidget(self.apply_pwr_limit_max_btn)
self.apply_pwr_limit_btn = QtWidgets.QPushButton(parent=self.verticalLayoutWidget_2)
self.apply_pwr_limit_btn.setObjectName("apply_pwr_limit_btn")
self.apply_pwr_limit_layout.addWidget(self.apply_pwr_limit_btn)
self.apply_pwr_limit_layout.setStretch(0, 2)
self.apply_pwr_limit_layout.setStretch(1, 3)
self.apply_pwr_limit_layout.setStretch(2, 4)
self.cfg_pwr_limit_layout.addLayout(self.apply_pwr_limit_layout)
self.cfg_pd_mon_form_layout.addLayout(self.cfg_pwr_limit_layout)
self.pwr_on_layout = QtWidgets.QHBoxLayout()
self.pwr_on_layout.setSpacing(12)
self.pwr_on_layout.setObjectName("pwr_on_layout")
self.pwr_on_lbl = QtWidgets.QLabel(parent=self.verticalLayoutWidget_2)
font = QtGui.QFont()
font.setPointSize(14)
self.pwr_on_lbl.setFont(font)
self.pwr_on_lbl.setObjectName("pwr_on_lbl")
self.pwr_on_layout.addWidget(self.pwr_on_lbl)
self.pwr_on_btn = QtWidgets.QPushButton(parent=self.verticalLayoutWidget_2)
self.pwr_on_btn.setObjectName("pwr_on_btn")
self.pwr_on_layout.addWidget(self.pwr_on_btn)
self.pwr_on_layout.setStretch(0, 5)
self.pwr_on_layout.setStretch(1, 4)
self.cfg_pd_mon_form_layout.addLayout(self.pwr_on_layout)
self.close_btn_layout = QtWidgets.QHBoxLayout()
self.close_btn_layout.setSpacing(12)
self.close_btn_layout.setObjectName("close_btn_layout")
spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.close_btn_layout.addItem(spacerItem4)
self.close_btn = QtWidgets.QPushButton(parent=self.verticalLayoutWidget_2)
self.close_btn.setObjectName("close_btn")
self.close_btn_layout.addWidget(self.close_btn)
self.close_btn_layout.setStretch(0, 5)
self.close_btn_layout.setStretch(1, 4)
self.cfg_pd_mon_form_layout.addLayout(self.close_btn_layout)
self.cfg_pd_mon_form_layout.setStretch(1, 2)
self.cfg_pd_mon_form_layout.setStretch(2, 2)
self.cfg_pd_mon_form_layout.setStretch(3, 2)
self.cfg_pd_mon_form_layout.setStretch(4, 2)
self.cfg_pd_mon_form_layout.setStretch(5, 2)
self.cfg_pd_mon_form_layout.setStretch(6, 1)
self.retranslateUi(Cfg_Pd_Mon_Form)
self.close_btn.clicked.connect(Cfg_Pd_Mon_Form.accept) # type: ignore
QtCore.QMetaObject.connectSlotsByName(Cfg_Pd_Mon_Form)
def retranslateUi(self, Cfg_Pd_Mon_Form):
_translate = QtCore.QCoreApplication.translate
Cfg_Pd_Mon_Form.setWindowTitle(_translate("Cfg_Pd_Mon_Form", "config_pd_mon_form"))
self.title_lbl.setText(_translate("Cfg_Pd_Mon_Form", "Configure Photodiode Monitor"))
self.pwr_off_lbl.setText(_translate("Cfg_Pd_Mon_Form", " Step 1: Turn off Laser Power"))
self.pwr_off_btn.setText(_translate("Cfg_Pd_Mon_Form", "Power Off"))
self.rst_ld_pwr_limit_lbl.setText(_translate("Cfg_Pd_Mon_Form", " Step 2: Reset Ld Pwr Limit to 0"))
self.rst_ld_pwr_limit_btn.setText(_translate("Cfg_Pd_Mon_Form", "Reset Ld Pwr Limit"))
self.cfg_pd_params_lbl.setText(_translate("Cfg_Pd_Mon_Form", " Step 3: Configure Photodiode Parameters"))
self.label_2.setText(_translate("Cfg_Pd_Mon_Form", " Value"))
self.label.setText(_translate("Cfg_Pd_Mon_Form", "Reading"))
self.cfg_responsitivity_lbl.setText(_translate("Cfg_Pd_Mon_Form", "Responsitivity: "))
self.cfg_responsitivity_reading.setText(_translate("Cfg_Pd_Mon_Form", "0.0000"))
self.cfg_dark_current_lbl.setText(_translate("Cfg_Pd_Mon_Form", "Dark Current: "))
self.cfg_dark_current_reading.setText(_translate("Cfg_Pd_Mon_Form", "0.0000"))
self.apply_pd_params_btn.setText(_translate("Cfg_Pd_Mon_Form", "Apply"))
self.cfg_pd_pwr_limit_lbl.setText(_translate("Cfg_Pd_Mon_Form", " Step 4: Configure Laser Diode Power Limit"))
self.label_3.setText(_translate("Cfg_Pd_Mon_Form", " Value"))
self.label_4.setText(_translate("Cfg_Pd_Mon_Form", "Reading"))
self.cfg_pwr_limit_lbl.setText(_translate("Cfg_Pd_Mon_Form", "Power Limit:"))
self.cfg_pwr_limit_reading.setText(_translate("Cfg_Pd_Mon_Form", "0.0000"))
self.settable_pwr_range_lbl.setText(_translate("Cfg_Pd_Mon_Form", "Settable Power Range:"))
self.settable_pwr_range_display_lbl.setText(_translate("Cfg_Pd_Mon_Form", "( Power Range )"))
self.apply_pwr_limit_max_btn.setText(_translate("Cfg_Pd_Mon_Form", "Apply Max"))
self.apply_pwr_limit_btn.setText(_translate("Cfg_Pd_Mon_Form", "Apply"))
self.pwr_on_lbl.setText(_translate("Cfg_Pd_Mon_Form", " Step 5: Turn On Laser Power"))
self.pwr_on_btn.setText(_translate("Cfg_Pd_Mon_Form", "Clear Alarm and Power On"))
self.close_btn.setText(_translate("Cfg_Pd_Mon_Form", "Close"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Cfg_Pd_Mon_Form = QtWidgets.QDialog()
ui = Ui_Cfg_Pd_Mon_Form()
ui.setupUi(Cfg_Pd_Mon_Form)
Cfg_Pd_Mon_Form.show()
sys.exit(app.exec())