Before new ui stuff

This commit is contained in:
2025-01-31 01:36:15 +03:00
parent 287448a6f4
commit 82c4915e36
3 changed files with 44 additions and 25 deletions

32
main.py
View File

@ -1,10 +1,12 @@
import sys
import time
from threading import Timer
from PyQt6 import QtCore, QtGui, QtWidgets
from ui import Ui_Controller
from PyQt6 import QtCore, QtWidgets
import controller.controller_reifined as controller
from all import Ui_Controller
class Window(QtWidgets.QMainWindow):
def __init__(self):
@ -35,8 +37,16 @@ class Window(QtWidgets.QMainWindow):
self.ui.Current3Field,
self.ui.Current4Field,
]
self.voltageFields = [
self.ui.Voltage1Field,
self.ui.Voltage2Field,
self.ui.Voltage3Field,
self.ui.Voltage4Field,
]
self.currentsAvailable = False # 1.3
self.electricsAvailable = False # 1.4
# modes, currents, etc
self.modes = []
# connect signals
@ -49,6 +59,10 @@ class Window(QtWidgets.QMainWindow):
def clearAllFields(self) -> None:
for f in self.currentFields:
f.setText("")
for f in self.voltageFields:
f.setText("")
self.ui.PDop.setText("")
self.ui.ModeSelection.clear()
self.ui.DmxAddressField.clear()
@ -58,7 +72,9 @@ class Window(QtWidgets.QMainWindow):
def setStatus(self, text: str) -> None :
print(text)
self.ui.Status.setText(text)
self.repaint()
global app
app.processEvents()
def setTempStatus(self, new_status: str, reset_time: float) -> None:
if self.ui.Status.text() != new_status:
@ -291,9 +307,11 @@ class Window(QtWidgets.QMainWindow):
self.onEnter()
return super().eventFilter(obj, event)
app = QtWidgets.QApplication(sys.argv)
def start_ui() -> None:
import sys
app = QtWidgets.QApplication(sys.argv)
global app
window = Window()
window.show()
sys.exit(app.exec())
@ -303,5 +321,5 @@ def stress_test() -> None:
tests.start()
if __name__ == '__main__':
# start_ui()
stress_test()
start_ui()
# stress_test()

View File

@ -3,6 +3,7 @@
"mainwindow.py",
"currents.ui",
"question mark.png",
"power.ui"
"power.ui",
"all.ui"
]
}

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 13.0.0, 2024-12-25T20:11:57. -->
<!-- Written by QtCreator 15.0.0, 2025-01-30T19:27:19. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{36919190-efb7-4c8a-aed8-95d37a08a85c}</value>
<value type="QByteArray">{8e463638-2a2a-45ca-b331-8492857d10e0}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
@ -33,6 +33,7 @@
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.LineEndingBehavior">0</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
@ -69,41 +70,40 @@
<value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
<value type="bool" key="AutoTest.Framework.QtTest">true</value>
</valuemap>
<value type="bool" key="AutoTest.ApplyFilter">false</value>
<valuemap type="QVariantMap" key="AutoTest.CheckStates"/>
<valuelist type="QVariantList" key="AutoTest.PathFilters"/>
<value type="int" key="AutoTest.RunAfterBuild">0</value>
<value type="bool" key="AutoTest.UseGlobal">true</value>
<valuemap type="QVariantMap" key="ClangTools">
<value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
<value type="int" key="ClangTools.ParallelJobs">2</value>
<value type="int" key="ClangTools.ParallelJobs">4</value>
<value type="bool" key="ClangTools.PreferConfigFile">true</value>
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
</valuemap>
<value type="QByteArray" key="LanguageClient.ProjectSettings"></value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="DeviceType">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Python 3.12.3</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Python 3.12.3</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{81fa0cfd-796c-4d93-b88e-8dfac87f7741}</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Python 3.13.1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Python 3.13.1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{feaa6ff1-8c9e-4a7c-aef9-ff1f1ecd00d6}</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/livefish/Dev/Vadimus/PowerUI_QT/.venv</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/livefish/Dev/laptop/Vadimus/PowerUI_QT/ui/ControllerUI/.qtcreator/Python_3_13_1venv</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Python.PysideBuildStep</value>
<value type="QString" key="Python.PySideProjectTool">/home/livefish/Dev/Vadimus/PowerUI_QT/.venv/bin/pyside6-project</value>
<value type="QString" key="Python.PySideUic">/home/livefish/Dev/Vadimus/PowerUI_QT/.venv/bin/pyside6-uic</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
@ -121,10 +121,10 @@
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Python 3.12.3 Virtual Environment</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Python 3.13.1 Virtual Environment</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Python.PySideBuildConfiguration</value>
<value type="QString" key="python">/home/livefish/Dev/Vadimus/PowerUI_QT/.venv/bin/python</value>
<value type="QString" key="venv">/home/livefish/Dev/Vadimus/PowerUI_QT/.venv</value>
<value type="QString" key="python">/home/livefish/Dev/laptop/Vadimus/PowerUI_QT/ui/ControllerUI/.qtcreator/Python_3_13_1venv/bin/python</value>
<value type="QString" key="venv">/home/livefish/Dev/laptop/Vadimus/PowerUI_QT/ui/ControllerUI/.qtcreator/Python_3_13_1venv</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
@ -151,13 +151,13 @@
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">mainwindow.py</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">PythonEditor.RunConfiguration./home/livefish/Dev/Vadimus/PowerUI_QT/ui/ControllerUI/mainwindow.py</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/livefish/Dev/Vadimus/PowerUI_QT/ui/ControllerUI/mainwindow.py</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">PythonEditor.RunConfiguration.</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/livefish/Dev/laptop/Vadimus/PowerUI_QT/ui/ControllerUI/mainwindow.py</value>
<value type="bool" key="ProjectExplorer.RunConfiguration.Customized">true</value>
<value type="QString" key="PythonEditor.RunConfiguation.Script">/home/livefish/Dev/Vadimus/PowerUI_QT/ui/ControllerUI/mainwindow.py</value>
<value type="QString" key="PythonEditor.RunConfiguation.Script">/home/livefish/Dev/laptop/Vadimus/PowerUI_QT/ui/ControllerUI/mainwindow.py</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/livefish/Dev/Vadimus/PowerUI_QT/ui/ControllerUI</value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/livefish/Dev/laptop/Vadimus/PowerUI_QT/ui/ControllerUI</value>
<value type="QString" key="RunConfiguration.X11Forwarding">:0</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>