forked from M-Labs/thermostat
Class names should be CamelCase
This commit is contained in:
parent
b6692b55a4
commit
1d2497d734
@ -1,11 +1,11 @@
|
|||||||
from view.zero_limits_warning import zero_limits_warning_view
|
from view.zero_limits_warning import ZeroLimitsWarningView
|
||||||
from view.net_settings_input_diag import net_settings_input_diag
|
from view.net_settings_input_diag import NetSettingsInputDiag
|
||||||
from view.thermostat_ctrl_menu import thermostat_ctrl_menu
|
from view.thermostat_ctrl_menu import ThermostatCtrlMenu
|
||||||
from view.conn_menu import conn_menu
|
from view.conn_menu import ConnMenu
|
||||||
from view.plot_options_menu import plot_options_menu
|
from view.plot_options_menu import PlotOptionsMenu
|
||||||
from view.live_plot_view import LiveDataPlotter
|
from view.live_plot_view import LiveDataPlotter
|
||||||
from view.ctrl_panel import ctrl_panel
|
from view.ctrl_panel import CtrlPanel
|
||||||
from view.info_box import info_box
|
from view.info_box import InfoBox
|
||||||
from model.pid_autotuner import PIDAutoTuner
|
from model.pid_autotuner import PIDAutoTuner
|
||||||
from model.thermostat_data_model import WrappedClient, Thermostat
|
from model.thermostat_data_model import WrappedClient, Thermostat
|
||||||
import json
|
import json
|
||||||
@ -66,7 +66,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
self.show()
|
self.show()
|
||||||
|
|
||||||
self.hw_rev_data = None
|
self.hw_rev_data = None
|
||||||
self.info_box = info_box()
|
self.info_box = InfoBox()
|
||||||
|
|
||||||
self.client = WrappedClient(self)
|
self.client = WrappedClient(self)
|
||||||
self.client.connection_error.connect(self.bail)
|
self.client.connection_error.connect(self.bail)
|
||||||
@ -94,10 +94,10 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
]
|
]
|
||||||
self.thermostat.info_box_trigger.connect(self.info_box.display_info_box)
|
self.thermostat.info_box_trigger.connect(self.info_box.display_info_box)
|
||||||
|
|
||||||
self.zero_limits_warning = zero_limits_warning_view(
|
self.zero_limits_warning = ZeroLimitsWarningView(
|
||||||
self.style(), self.limits_warning
|
self.style(), self.limits_warning
|
||||||
)
|
)
|
||||||
self.ctrl_panel_view = ctrl_panel(
|
self.ctrl_panel_view = CtrlPanel(
|
||||||
[self.ch0_tree, self.ch1_tree],
|
[self.ch0_tree, self.ch1_tree],
|
||||||
get_ctrl_panel_config(args),
|
get_ctrl_panel_config(args),
|
||||||
self.send_command,
|
self.send_command,
|
||||||
@ -136,17 +136,17 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
self.thermostat.report_update.connect(self.channel_graphs.update_report)
|
self.thermostat.report_update.connect(self.channel_graphs.update_report)
|
||||||
self.thermostat.pid_update.connect(self.channel_graphs.update_pid)
|
self.thermostat.pid_update.connect(self.channel_graphs.update_pid)
|
||||||
|
|
||||||
self.plot_options_menu = plot_options_menu()
|
self.plot_options_menu = PlotOptionsMenu()
|
||||||
self.plot_options_menu.clear.triggered.connect(self.clear_graphs)
|
self.plot_options_menu.clear.triggered.connect(self.clear_graphs)
|
||||||
self.plot_options_menu.samples_spinbox.valueChanged.connect(
|
self.plot_options_menu.samples_spinbox.valueChanged.connect(
|
||||||
self.channel_graphs.set_max_samples
|
self.channel_graphs.set_max_samples
|
||||||
)
|
)
|
||||||
self.plot_settings.setMenu(self.plot_options_menu)
|
self.plot_settings.setMenu(self.plot_options_menu)
|
||||||
|
|
||||||
self.conn_menu = conn_menu()
|
self.conn_menu = ConnMenu()
|
||||||
self.connect_btn.setMenu(self.conn_menu)
|
self.connect_btn.setMenu(self.conn_menu)
|
||||||
|
|
||||||
self.thermostat_ctrl_menu = thermostat_ctrl_menu(self.style())
|
self.thermostat_ctrl_menu = ThermostatCtrlMenu(self.style())
|
||||||
self.thermostat_ctrl_menu.fan_set_act.connect(self.fan_set_request)
|
self.thermostat_ctrl_menu.fan_set_act.connect(self.fan_set_request)
|
||||||
self.thermostat_ctrl_menu.fan_auto_set_act.connect(self.fan_auto_set_request)
|
self.thermostat_ctrl_menu.fan_auto_set_act.connect(self.fan_auto_set_request)
|
||||||
self.thermostat_ctrl_menu.reset_act.connect(self.reset_request)
|
self.thermostat_ctrl_menu.reset_act.connect(self.reset_request)
|
||||||
@ -399,7 +399,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
@asyncSlot(bool)
|
@asyncSlot(bool)
|
||||||
async def net_settings_request(self, _):
|
async def net_settings_request(self, _):
|
||||||
ipv4 = await self.thermostat.get_ipv4()
|
ipv4 = await self.thermostat.get_ipv4()
|
||||||
self.net_settings_input_diag = net_settings_input_diag(ipv4["addr"])
|
self.net_settings_input_diag = NetSettingsInputDiag(ipv4["addr"])
|
||||||
self.net_settings_input_diag.set_ipv4_act.connect(self.set_net_settings_request)
|
self.net_settings_input_diag.set_ipv4_act.connect(self.set_net_settings_request)
|
||||||
|
|
||||||
@asyncSlot(str)
|
@asyncSlot(str)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from PyQt6 import QtWidgets, QtCore
|
from PyQt6 import QtWidgets, QtCore
|
||||||
|
|
||||||
|
|
||||||
class conn_menu(QtWidgets.QMenu):
|
class ConnMenu(QtWidgets.QMenu):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.setTitle("Connection Settings")
|
self.setTitle("Connection Settings")
|
||||||
|
@ -49,7 +49,7 @@ def set_tree_label_tips(tree):
|
|||||||
item.setToolTip(0, p.opts["tip"])
|
item.setToolTip(0, p.opts["tip"])
|
||||||
|
|
||||||
|
|
||||||
class ctrl_panel(QObject):
|
class CtrlPanel(QObject):
|
||||||
set_zero_limits_warning_sig = pyqtSignal(list)
|
set_zero_limits_warning_sig = pyqtSignal(list)
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
|
@ -2,7 +2,7 @@ from PyQt6 import QtWidgets
|
|||||||
from PyQt6.QtCore import pyqtSlot
|
from PyQt6.QtCore import pyqtSlot
|
||||||
|
|
||||||
|
|
||||||
class info_box(QtWidgets.QMessageBox):
|
class InfoBox(QtWidgets.QMessageBox):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.setIcon(QtWidgets.QMessageBox.Icon.Information)
|
self.setIcon(QtWidgets.QMessageBox.Icon.Information)
|
||||||
|
@ -3,7 +3,7 @@ from PyQt6.QtWidgets import QAbstractButton
|
|||||||
from PyQt6.QtCore import pyqtSignal, pyqtSlot
|
from PyQt6.QtCore import pyqtSignal, pyqtSlot
|
||||||
|
|
||||||
|
|
||||||
class net_settings_input_diag(QtWidgets.QInputDialog):
|
class NetSettingsInputDiag(QtWidgets.QInputDialog):
|
||||||
set_ipv4_act = pyqtSignal(str)
|
set_ipv4_act = pyqtSignal(str)
|
||||||
|
|
||||||
def __init__(self, current_ipv4_settings):
|
def __init__(self, current_ipv4_settings):
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from PyQt6 import QtWidgets, QtGui
|
from PyQt6 import QtWidgets, QtGui
|
||||||
|
|
||||||
|
|
||||||
class plot_options_menu(QtWidgets.QMenu):
|
class PlotOptionsMenu(QtWidgets.QMenu):
|
||||||
def __init__(self, max_samples=1000):
|
def __init__(self, max_samples=1000):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.setTitle("Plot Settings")
|
self.setTitle("Plot Settings")
|
||||||
|
@ -2,7 +2,7 @@ from PyQt6 import QtWidgets, QtGui, QtCore
|
|||||||
from PyQt6.QtCore import pyqtSignal, pyqtSlot
|
from PyQt6.QtCore import pyqtSignal, pyqtSlot
|
||||||
|
|
||||||
|
|
||||||
class thermostat_ctrl_menu(QtWidgets.QMenu):
|
class ThermostatCtrlMenu(QtWidgets.QMenu):
|
||||||
fan_set_act = pyqtSignal(int)
|
fan_set_act = pyqtSignal(int)
|
||||||
fan_auto_set_act = pyqtSignal(int)
|
fan_auto_set_act = pyqtSignal(int)
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ from PyQt6.QtCore import pyqtSlot, QObject
|
|||||||
from PyQt6 import QtWidgets, QtGui
|
from PyQt6 import QtWidgets, QtGui
|
||||||
|
|
||||||
|
|
||||||
class zero_limits_warning_view(QObject):
|
class ZeroLimitsWarningView(QObject):
|
||||||
def __init__(self, style, limit_warning):
|
def __init__(self, style, limit_warning):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self._lbl = limit_warning
|
self._lbl = limit_warning
|
||||||
|
Loading…
Reference in New Issue
Block a user