From 1d2497d73457c312b606b663d0ad2aefce52d163 Mon Sep 17 00:00:00 2001 From: atse Date: Thu, 20 Jun 2024 17:08:07 +0800 Subject: [PATCH] Class names should be CamelCase --- pytec/tec_qt.py | 28 +++++++++++++-------------- pytec/view/conn_menu.py | 2 +- pytec/view/ctrl_panel.py | 2 +- pytec/view/info_box.py | 2 +- pytec/view/net_settings_input_diag.py | 2 +- pytec/view/plot_options_menu.py | 2 +- pytec/view/thermostat_ctrl_menu.py | 2 +- pytec/view/zero_limits_warning.py | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index 7c65f08..03b24e3 100644 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -1,11 +1,11 @@ -from view.zero_limits_warning import zero_limits_warning_view -from view.net_settings_input_diag import net_settings_input_diag -from view.thermostat_ctrl_menu import thermostat_ctrl_menu -from view.conn_menu import conn_menu -from view.plot_options_menu import plot_options_menu +from view.zero_limits_warning import ZeroLimitsWarningView +from view.net_settings_input_diag import NetSettingsInputDiag +from view.thermostat_ctrl_menu import ThermostatCtrlMenu +from view.conn_menu import ConnMenu +from view.plot_options_menu import PlotOptionsMenu from view.live_plot_view import LiveDataPlotter -from view.ctrl_panel import ctrl_panel -from view.info_box import info_box +from view.ctrl_panel import CtrlPanel +from view.info_box import InfoBox from model.pid_autotuner import PIDAutoTuner from model.thermostat_data_model import WrappedClient, Thermostat import json @@ -66,7 +66,7 @@ class MainWindow(QtWidgets.QMainWindow): self.show() self.hw_rev_data = None - self.info_box = info_box() + self.info_box = InfoBox() self.client = WrappedClient(self) 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.zero_limits_warning = zero_limits_warning_view( + self.zero_limits_warning = ZeroLimitsWarningView( self.style(), self.limits_warning ) - self.ctrl_panel_view = ctrl_panel( + self.ctrl_panel_view = CtrlPanel( [self.ch0_tree, self.ch1_tree], get_ctrl_panel_config(args), self.send_command, @@ -136,17 +136,17 @@ class MainWindow(QtWidgets.QMainWindow): self.thermostat.report_update.connect(self.channel_graphs.update_report) 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.samples_spinbox.valueChanged.connect( self.channel_graphs.set_max_samples ) 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.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_auto_set_act.connect(self.fan_auto_set_request) self.thermostat_ctrl_menu.reset_act.connect(self.reset_request) @@ -399,7 +399,7 @@ class MainWindow(QtWidgets.QMainWindow): @asyncSlot(bool) async def net_settings_request(self, _): 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) @asyncSlot(str) diff --git a/pytec/view/conn_menu.py b/pytec/view/conn_menu.py index 80da10c..89c9896 100644 --- a/pytec/view/conn_menu.py +++ b/pytec/view/conn_menu.py @@ -1,7 +1,7 @@ from PyQt6 import QtWidgets, QtCore -class conn_menu(QtWidgets.QMenu): +class ConnMenu(QtWidgets.QMenu): def __init__(self): super().__init__() self.setTitle("Connection Settings") diff --git a/pytec/view/ctrl_panel.py b/pytec/view/ctrl_panel.py index 899f05f..7c9bf89 100644 --- a/pytec/view/ctrl_panel.py +++ b/pytec/view/ctrl_panel.py @@ -49,7 +49,7 @@ def set_tree_label_tips(tree): item.setToolTip(0, p.opts["tip"]) -class ctrl_panel(QObject): +class CtrlPanel(QObject): set_zero_limits_warning_sig = pyqtSignal(list) def __init__( diff --git a/pytec/view/info_box.py b/pytec/view/info_box.py index 3d5c491..cde0591 100644 --- a/pytec/view/info_box.py +++ b/pytec/view/info_box.py @@ -2,7 +2,7 @@ from PyQt6 import QtWidgets from PyQt6.QtCore import pyqtSlot -class info_box(QtWidgets.QMessageBox): +class InfoBox(QtWidgets.QMessageBox): def __init__(self): super().__init__() self.setIcon(QtWidgets.QMessageBox.Icon.Information) diff --git a/pytec/view/net_settings_input_diag.py b/pytec/view/net_settings_input_diag.py index fb1c242..1ef4f61 100644 --- a/pytec/view/net_settings_input_diag.py +++ b/pytec/view/net_settings_input_diag.py @@ -3,7 +3,7 @@ from PyQt6.QtWidgets import QAbstractButton from PyQt6.QtCore import pyqtSignal, pyqtSlot -class net_settings_input_diag(QtWidgets.QInputDialog): +class NetSettingsInputDiag(QtWidgets.QInputDialog): set_ipv4_act = pyqtSignal(str) def __init__(self, current_ipv4_settings): diff --git a/pytec/view/plot_options_menu.py b/pytec/view/plot_options_menu.py index 427684a..7817d58 100644 --- a/pytec/view/plot_options_menu.py +++ b/pytec/view/plot_options_menu.py @@ -1,7 +1,7 @@ from PyQt6 import QtWidgets, QtGui -class plot_options_menu(QtWidgets.QMenu): +class PlotOptionsMenu(QtWidgets.QMenu): def __init__(self, max_samples=1000): super().__init__() self.setTitle("Plot Settings") diff --git a/pytec/view/thermostat_ctrl_menu.py b/pytec/view/thermostat_ctrl_menu.py index e22dfba..2ef321b 100644 --- a/pytec/view/thermostat_ctrl_menu.py +++ b/pytec/view/thermostat_ctrl_menu.py @@ -2,7 +2,7 @@ from PyQt6 import QtWidgets, QtGui, QtCore from PyQt6.QtCore import pyqtSignal, pyqtSlot -class thermostat_ctrl_menu(QtWidgets.QMenu): +class ThermostatCtrlMenu(QtWidgets.QMenu): fan_set_act = pyqtSignal(int) fan_auto_set_act = pyqtSignal(int) diff --git a/pytec/view/zero_limits_warning.py b/pytec/view/zero_limits_warning.py index 574e04d..113aef0 100644 --- a/pytec/view/zero_limits_warning.py +++ b/pytec/view/zero_limits_warning.py @@ -2,7 +2,7 @@ from PyQt6.QtCore import pyqtSlot, QObject from PyQt6 import QtWidgets, QtGui -class zero_limits_warning_view(QObject): +class ZeroLimitsWarningView(QObject): def __init__(self, style, limit_warning): super().__init__() self._lbl = limit_warning