diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..dc71d4a --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..e71df04 --- /dev/null +++ b/main.py @@ -0,0 +1,23 @@ +from PyQt6 import QtCore, QtGui, QtWidgets +from ui import Ui_Controller + +class Window(QtWidgets.QMainWindow): + def __init__(self): + QtWidgets.QMainWindow.__init__(self) + self.ui = Ui_Controller() + self.ui.setupUi(self) + + self.ui.Read.clicked.connect(self.handleCalculate) + + def connectMethods(self): + pass + + def handleCalculate(self): + self.ui.Status.setText("Goool") + +if __name__ == '__main__': + import sys + app = QtWidgets.QApplication(sys.argv) + window = Window() + window.show() + sys.exit(app.exec()) \ No newline at end of file diff --git a/new_ui.py b/new_ui.py new file mode 100644 index 0000000..5e56296 --- /dev/null +++ b/new_ui.py @@ -0,0 +1,33 @@ +import PySide6 +from PySide6.QtCore import QFile, QIODevice +from PySide6.QtUiTools import QUiLoader +from PySide6.QtWidgets import QApplication + +import sys + +# Base source: https://doc.qt.io/qt-6/designer-using-a-ui-file-python.html +def load_ui(filename: str) -> tuple[PySide6.QtWidgets.QWidget, QApplication]: + app = QApplication(sys.argv) + ui_file = QFile(filename) + if not ui_file.open(QIODevice.ReadOnly): + print("Cannot open {}: {}".format(filename, ui_file.errorString())) + sys.exit(-1) + + loader = QUiLoader() + widget = loader.load(ui_file, None) + ui_file.close() + + if not widget: + print(loader.errorString()) + sys.exit(-1) + + return widget, app + + +if __name__ == '__main__': + widget, app = load_ui('ui/ControllerUI/currents.ui') + widget.show() + + print(widget) + + sys.exit(app.exec()) diff --git a/ui.py b/ui.py new file mode 100644 index 0000000..7b50464 --- /dev/null +++ b/ui.py @@ -0,0 +1,210 @@ +# Form implementation generated from reading ui file './ui/ControllerUI/power.ui' +# +# Created by: PyQt6 UI code generator 6.6.1 +# +# 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_Controller(object): + def setupUi(self, Controller): + Controller.setObjectName("Controller") + Controller.resize(273, 350) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(Controller.sizePolicy().hasHeightForWidth()) + Controller.setSizePolicy(sizePolicy) + Controller.setMinimumSize(QtCore.QSize(273, 350)) + Controller.setMaximumSize(QtCore.QSize(273, 350)) + self.centralwidget = QtWidgets.QWidget(parent=Controller) + self.centralwidget.setObjectName("centralwidget") + self.formLayoutWidget = QtWidgets.QWidget(parent=self.centralwidget) + self.formLayoutWidget.setGeometry(QtCore.QRect(0, 0, 284, 251)) + self.formLayoutWidget.setObjectName("formLayoutWidget") + self.formLayout = QtWidgets.QFormLayout(self.formLayoutWidget) + self.formLayout.setRowWrapPolicy(QtWidgets.QFormLayout.RowWrapPolicy.DontWrapRows) + self.formLayout.setLabelAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter) + self.formLayout.setContentsMargins(10, 10, 0, 0) + self.formLayout.setVerticalSpacing(8) + self.formLayout.setObjectName("formLayout") + self.ComPort = QtWidgets.QLabel(parent=self.formLayoutWidget) + font = QtGui.QFont() + font.setFamily("Ubuntu Sans") + self.ComPort.setFont(font) + self.ComPort.setObjectName("ComPort") + self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.ComPort) + self.DeviceSelection = QtWidgets.QComboBox(parent=self.formLayoutWidget) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.DeviceSelection.sizePolicy().hasHeightForWidth()) + self.DeviceSelection.setSizePolicy(sizePolicy) + self.DeviceSelection.setMaximumSize(QtCore.QSize(110, 16777215)) + font = QtGui.QFont() + font.setFamily("Arial") + font.setPointSize(10) + self.DeviceSelection.setFont(font) + self.DeviceSelection.setObjectName("DeviceSelection") + self.DeviceSelection.addItem("") + self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.DeviceSelection) + self.DmxAddress = QtWidgets.QLabel(parent=self.formLayoutWidget) + self.DmxAddress.setObjectName("DmxAddress") + self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.DmxAddress) + self.DmxAddressField = QtWidgets.QLineEdit(parent=self.formLayoutWidget) + self.DmxAddressField.setMaximumSize(QtCore.QSize(45, 16777215)) + self.DmxAddressField.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) + self.DmxAddressField.setObjectName("DmxAddressField") + self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.DmxAddressField) + self.Personality = QtWidgets.QLabel(parent=self.formLayoutWidget) + self.Personality.setObjectName("Personality") + self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.Personality) + self.Current1 = QtWidgets.QLabel(parent=self.formLayoutWidget) + self.Current1.setObjectName("Current1") + self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.LabelRole, self.Current1) + self.horizontalLayout_2 = QtWidgets.QHBoxLayout() + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.Current1Field = QtWidgets.QLineEdit(parent=self.formLayoutWidget) + self.Current1Field.setMaximumSize(QtCore.QSize(45, 16777215)) + self.Current1Field.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) + self.Current1Field.setObjectName("Current1Field") + self.horizontalLayout_2.addWidget(self.Current1Field) + self.ma1 = QtWidgets.QLabel(parent=self.formLayoutWidget) + self.ma1.setMaximumSize(QtCore.QSize(16777215, 16777215)) + self.ma1.setObjectName("ma1") + self.horizontalLayout_2.addWidget(self.ma1) + self.formLayout.setLayout(3, QtWidgets.QFormLayout.ItemRole.FieldRole, self.horizontalLayout_2) + self.Current2 = QtWidgets.QLabel(parent=self.formLayoutWidget) + self.Current2.setObjectName("Current2") + self.formLayout.setWidget(4, QtWidgets.QFormLayout.ItemRole.LabelRole, self.Current2) + self.horizontalLayout_3 = QtWidgets.QHBoxLayout() + self.horizontalLayout_3.setObjectName("horizontalLayout_3") + self.Current2Field = QtWidgets.QLineEdit(parent=self.formLayoutWidget) + self.Current2Field.setMaximumSize(QtCore.QSize(45, 16777215)) + self.Current2Field.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) + self.Current2Field.setObjectName("Current2Field") + self.horizontalLayout_3.addWidget(self.Current2Field) + self.ma2 = QtWidgets.QLabel(parent=self.formLayoutWidget) + self.ma2.setObjectName("ma2") + self.horizontalLayout_3.addWidget(self.ma2) + self.formLayout.setLayout(4, QtWidgets.QFormLayout.ItemRole.FieldRole, self.horizontalLayout_3) + self.Current3 = QtWidgets.QLabel(parent=self.formLayoutWidget) + self.Current3.setObjectName("Current3") + self.formLayout.setWidget(5, QtWidgets.QFormLayout.ItemRole.LabelRole, self.Current3) + self.horizontalLayout_4 = QtWidgets.QHBoxLayout() + self.horizontalLayout_4.setObjectName("horizontalLayout_4") + self.Current3Field = QtWidgets.QLineEdit(parent=self.formLayoutWidget) + self.Current3Field.setMaximumSize(QtCore.QSize(45, 16777215)) + self.Current3Field.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) + self.Current3Field.setObjectName("Current3Field") + self.horizontalLayout_4.addWidget(self.Current3Field) + self.ma3 = QtWidgets.QLabel(parent=self.formLayoutWidget) + self.ma3.setObjectName("ma3") + self.horizontalLayout_4.addWidget(self.ma3) + self.formLayout.setLayout(5, QtWidgets.QFormLayout.ItemRole.FieldRole, self.horizontalLayout_4) + self.Current4 = QtWidgets.QLabel(parent=self.formLayoutWidget) + self.Current4.setObjectName("Current4") + self.formLayout.setWidget(6, QtWidgets.QFormLayout.ItemRole.LabelRole, self.Current4) + self.horizontalLayout_5 = QtWidgets.QHBoxLayout() + self.horizontalLayout_5.setObjectName("horizontalLayout_5") + self.Current4Field = QtWidgets.QLineEdit(parent=self.formLayoutWidget) + self.Current4Field.setMaximumSize(QtCore.QSize(45, 16777215)) + self.Current4Field.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) + self.Current4Field.setObjectName("Current4Field") + self.horizontalLayout_5.addWidget(self.Current4Field) + self.ma4 = QtWidgets.QLabel(parent=self.formLayoutWidget) + self.ma4.setObjectName("ma4") + self.horizontalLayout_5.addWidget(self.ma4) + self.formLayout.setLayout(6, QtWidgets.QFormLayout.ItemRole.FieldRole, self.horizontalLayout_5) + self.horizontalLayout = QtWidgets.QHBoxLayout() + self.horizontalLayout.setContentsMargins(-1, -1, 0, -1) + self.horizontalLayout.setSpacing(0) + self.horizontalLayout.setObjectName("horizontalLayout") + self.ModeSelection = QtWidgets.QComboBox(parent=self.formLayoutWidget) + self.ModeSelection.setMaximumSize(QtCore.QSize(131, 32)) + font = QtGui.QFont() + font.setFamily("Arial") + font.setPointSize(9) + self.ModeSelection.setFont(font) + self.ModeSelection.setFrame(True) + self.ModeSelection.setObjectName("ModeSelection") + self.ModeSelection.addItem("") + self.horizontalLayout.addWidget(self.ModeSelection) + self.ModeInfo = QtWidgets.QPushButton(parent=self.formLayoutWidget) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.ModeInfo.sizePolicy().hasHeightForWidth()) + self.ModeInfo.setSizePolicy(sizePolicy) + self.ModeInfo.setMaximumSize(QtCore.QSize(32, 32)) + self.ModeInfo.setText("") + icon = QtGui.QIcon.fromTheme("dialog-question") + self.ModeInfo.setIcon(icon) + self.ModeInfo.setIconSize(QtCore.QSize(20, 20)) + self.ModeInfo.setCheckable(False) + self.ModeInfo.setObjectName("ModeInfo") + self.horizontalLayout.addWidget(self.ModeInfo) + self.formLayout.setLayout(2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.horizontalLayout) + self.verticalLayoutWidget = QtWidgets.QWidget(parent=self.centralwidget) + self.verticalLayoutWidget.setGeometry(QtCore.QRect(0, 250, 271, 101)) + self.verticalLayoutWidget.setObjectName("verticalLayoutWidget") + self.verticalLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget) + self.verticalLayout.setContentsMargins(0, 0, 0, 0) + self.verticalLayout.setObjectName("verticalLayout") + self.horizontalLayout_6 = QtWidgets.QHBoxLayout() + self.horizontalLayout_6.setContentsMargins(10, -1, 10, -1) + self.horizontalLayout_6.setSpacing(50) + self.horizontalLayout_6.setObjectName("horizontalLayout_6") + self.Read = QtWidgets.QPushButton(parent=self.verticalLayoutWidget) + self.Read.setObjectName("Read") + self.horizontalLayout_6.addWidget(self.Read) + self.Write = QtWidgets.QPushButton(parent=self.verticalLayoutWidget) + self.Write.setObjectName("Write") + self.horizontalLayout_6.addWidget(self.Write) + self.verticalLayout.addLayout(self.horizontalLayout_6) + self.horizontalLayout_7 = QtWidgets.QHBoxLayout() + self.horizontalLayout_7.setContentsMargins(0, -1, -1, -1) + self.horizontalLayout_7.setObjectName("horizontalLayout_7") + self.Check = QtWidgets.QCheckBox(parent=self.verticalLayoutWidget) + self.Check.setMaximumSize(QtCore.QSize(97, 16777215)) + self.Check.setObjectName("Check") + self.horizontalLayout_7.addWidget(self.Check) + self.verticalLayout.addLayout(self.horizontalLayout_7) + self.Status = QtWidgets.QLabel(parent=self.verticalLayoutWidget) + self.Status.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) + self.Status.setObjectName("Status") + self.verticalLayout.addWidget(self.Status) + Controller.setCentralWidget(self.centralwidget) + + self.retranslateUi(Controller) + QtCore.QMetaObject.connectSlotsByName(Controller) + + def retranslateUi(self, Controller): + _translate = QtCore.QCoreApplication.translate + Controller.setWindowTitle(_translate("Controller", "Controller")) + self.ComPort.setText(_translate("Controller", "COM Порт:")) + self.DeviceSelection.setItemText(0, _translate("Controller", "/dev/ttyUSB0")) + self.DmxAddress.setText(_translate("Controller", "DMX Адрес:")) + self.DmxAddressField.setText(_translate("Controller", "10")) + self.DmxAddressField.setPlaceholderText(_translate("Controller", "no data")) + self.Personality.setText(_translate("Controller", "Personality:")) + self.Current1.setText(_translate("Controller", " I1")) + self.Current1Field.setText(_translate("Controller", "1000")) + self.ma1.setText(_translate("Controller", " mA")) + self.Current2.setText(_translate("Controller", " I2")) + self.Current2Field.setText(_translate("Controller", "450")) + self.ma2.setText(_translate("Controller", " mA")) + self.Current3.setText(_translate("Controller", " I3")) + self.Current3Field.setText(_translate("Controller", "520")) + self.ma3.setText(_translate("Controller", " mA")) + self.Current4.setText(_translate("Controller", " I4")) + self.Current4Field.setText(_translate("Controller", "780")) + self.ma4.setText(_translate("Controller", " mA")) + self.ModeSelection.setItemText(0, _translate("Controller", "28:CH RGB45 SLO")) + self.Read.setText(_translate("Controller", "Чтение")) + self.Write.setText(_translate("Controller", "Запись")) + self.Check.setText(_translate("Controller", "Проверить")) + self.Status.setText(_translate("Controller", "Выбранный порт: /dev/ttyUSB0")) diff --git a/ui/ControllerUI/ControllerUI.pyproject b/ui/ControllerUI/ControllerUI.pyproject new file mode 100644 index 0000000..08627f3 --- /dev/null +++ b/ui/ControllerUI/ControllerUI.pyproject @@ -0,0 +1,8 @@ +{ + "files": [ + "mainwindow.py", + "currents.ui", + "question mark.png", + "power.ui" + ] +} diff --git a/ui/ControllerUI/ControllerUI.pyproject.user b/ui/ControllerUI/ControllerUI.pyproject.user new file mode 100644 index 0000000..4a4fc15 --- /dev/null +++ b/ui/ControllerUI/ControllerUI.pyproject.user @@ -0,0 +1,178 @@ + + + + + + EnvironmentId + {36919190-efb7-4c8a-aed8-95d37a08a85c} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + 0 + false + true + false + 2 + true + true + 0 + 8 + true + false + 1 + true + true + true + *.md, *.MD, Makefile + false + true + true + + + + ProjectExplorer.Project.PluginSettings + + + true + false + true + true + true + true + + + 0 + true + + true + true + Builtin.DefaultTidyAndClazy + 2 + true + + + + true + + + + + + ProjectExplorer.Project.Target.0 + + Desktop + Python 3.12.3 + Python 3.12.3 + {81fa0cfd-796c-4d93-b88e-8dfac87f7741} + 0 + 0 + 0 + + /home/livefish/Dev/Vadimus/PowerUI_QT/.venv + + + true + Python.PysideBuildStep + /home/livefish/Dev/Vadimus/PowerUI_QT/.venv/bin/pyside6-project + /home/livefish/Dev/Vadimus/PowerUI_QT/.venv/bin/pyside6-uic + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + 0 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Python 3.12.3 Virtual Environment + Python.PySideBuildConfiguration + /home/livefish/Dev/Vadimus/PowerUI_QT/.venv/bin/python + /home/livefish/Dev/Vadimus/PowerUI_QT/.venv + + 1 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + true + 0 + true + + 2 + + false + -e cpu-cycles --call-graph dwarf,4096 -F 250 + mainwindow.py + PythonEditor.RunConfiguration./home/livefish/Dev/Vadimus/PowerUI_QT/ui/ControllerUI/mainwindow.py + /home/livefish/Dev/Vadimus/PowerUI_QT/ui/ControllerUI/mainwindow.py + true + /home/livefish/Dev/Vadimus/PowerUI_QT/ui/ControllerUI/mainwindow.py + true + true + /home/livefish/Dev/Vadimus/PowerUI_QT/ui/ControllerUI + :0 + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/ui/ControllerUI/currents.ui b/ui/ControllerUI/currents.ui new file mode 100644 index 0000000..db8d171 --- /dev/null +++ b/ui/ControllerUI/currents.ui @@ -0,0 +1,418 @@ + + + Controller + + + + 0 + 0 + 273 + 350 + + + + + 0 + 0 + + + + + 273 + 350 + + + + + 273 + 350 + + + + Controller + + + + + + 0 + 0 + 284 + 251 + + + + + QFormLayout::DontWrapRows + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 8 + + + 10 + + + 10 + + + 0 + + + + + + Ubuntu Sans + + + + COM Порт: + + + + + + + + 0 + 0 + + + + + 110 + 16777215 + + + + + Arial + 10 + + + + + /dev/ttyUSB0 + + + + + + + + DMX Адрес: + + + + + + + + 45 + 16777215 + + + + 10 + + + Qt::AlignCenter + + + no data + + + + + + + Personality: + + + + + + + I1 + + + + + + + + + + 45 + 16777215 + + + + 1000 + + + Qt::AlignCenter + + + + + + + + 16777215 + 16777215 + + + + mA + + + + + + + + + I2 + + + + + + + + + + 45 + 16777215 + + + + 450 + + + Qt::AlignCenter + + + + + + + mA + + + + + + + + + I3 + + + + + + + + + + 45 + 16777215 + + + + 520 + + + Qt::AlignCenter + + + + + + + mA + + + + + + + + + I4 + + + + + + + + + + 45 + 16777215 + + + + 780 + + + Qt::AlignCenter + + + + + + + mA + + + + + + + + + 0 + + + 0 + + + + + + 131 + 32 + + + + + Arial + 9 + + + + true + + + + 28:CH RGB45 SLO + + + + + + + + + 0 + 0 + + + + + 32 + 32 + + + + + + + + .. + + + + 20 + 20 + + + + false + + + + + + + + + + + 0 + 250 + 271 + 101 + + + + + + + 50 + + + 10 + + + 10 + + + + + Чтение + + + + + + + Запись + + + + + + + + + 0 + + + + + + 97 + 16777215 + + + + Проверить + + + + + + + + + Выбранный порт: /dev/ttyUSB0 + + + Qt::AlignCenter + + + + + + + + + + diff --git a/ui/ControllerUI/mainwindow.py b/ui/ControllerUI/mainwindow.py new file mode 100644 index 0000000..49c1a62 --- /dev/null +++ b/ui/ControllerUI/mainwindow.py @@ -0,0 +1,25 @@ +# This Python file uses the following encoding: utf-8 +import sys + +from PySide6.QtWidgets import QApplication, QMainWindow + +# Important: +# You need to run the following command to generate the ui_form.py file +# pyside6-uic form.ui -o ui_form.py, or +# pyside2-uic form.ui -o ui_form.py +from ui_form import Ui_Controller +from PySide6 import QtCore + +class MainWindow(QMainWindow): + def __init__(self, parent=None): + super().__init__(parent) + self.setWindowFlags(QtCore.Qt.WindowMinimizeButtonHint) + self.ui = Ui_Controller() + self.ui.setupUi(self) + + +if __name__ == "__main__": + app = QApplication(sys.argv) + widget = MainWindow() + widget.show() + sys.exit(app.exec()) diff --git a/ui/ControllerUI/power.ui b/ui/ControllerUI/power.ui new file mode 100644 index 0000000..db8d171 --- /dev/null +++ b/ui/ControllerUI/power.ui @@ -0,0 +1,418 @@ + + + Controller + + + + 0 + 0 + 273 + 350 + + + + + 0 + 0 + + + + + 273 + 350 + + + + + 273 + 350 + + + + Controller + + + + + + 0 + 0 + 284 + 251 + + + + + QFormLayout::DontWrapRows + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 8 + + + 10 + + + 10 + + + 0 + + + + + + Ubuntu Sans + + + + COM Порт: + + + + + + + + 0 + 0 + + + + + 110 + 16777215 + + + + + Arial + 10 + + + + + /dev/ttyUSB0 + + + + + + + + DMX Адрес: + + + + + + + + 45 + 16777215 + + + + 10 + + + Qt::AlignCenter + + + no data + + + + + + + Personality: + + + + + + + I1 + + + + + + + + + + 45 + 16777215 + + + + 1000 + + + Qt::AlignCenter + + + + + + + + 16777215 + 16777215 + + + + mA + + + + + + + + + I2 + + + + + + + + + + 45 + 16777215 + + + + 450 + + + Qt::AlignCenter + + + + + + + mA + + + + + + + + + I3 + + + + + + + + + + 45 + 16777215 + + + + 520 + + + Qt::AlignCenter + + + + + + + mA + + + + + + + + + I4 + + + + + + + + + + 45 + 16777215 + + + + 780 + + + Qt::AlignCenter + + + + + + + mA + + + + + + + + + 0 + + + 0 + + + + + + 131 + 32 + + + + + Arial + 9 + + + + true + + + + 28:CH RGB45 SLO + + + + + + + + + 0 + 0 + + + + + 32 + 32 + + + + + + + + .. + + + + 20 + 20 + + + + false + + + + + + + + + + + 0 + 250 + 271 + 101 + + + + + + + 50 + + + 10 + + + 10 + + + + + Чтение + + + + + + + Запись + + + + + + + + + 0 + + + + + + 97 + 16777215 + + + + Проверить + + + + + + + + + Выбранный порт: /dev/ttyUSB0 + + + Qt::AlignCenter + + + + + + + + + + diff --git a/ui/ControllerUI/power.ui.autosave b/ui/ControllerUI/power.ui.autosave new file mode 100644 index 0000000..db8d171 --- /dev/null +++ b/ui/ControllerUI/power.ui.autosave @@ -0,0 +1,418 @@ + + + Controller + + + + 0 + 0 + 273 + 350 + + + + + 0 + 0 + + + + + 273 + 350 + + + + + 273 + 350 + + + + Controller + + + + + + 0 + 0 + 284 + 251 + + + + + QFormLayout::DontWrapRows + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 8 + + + 10 + + + 10 + + + 0 + + + + + + Ubuntu Sans + + + + COM Порт: + + + + + + + + 0 + 0 + + + + + 110 + 16777215 + + + + + Arial + 10 + + + + + /dev/ttyUSB0 + + + + + + + + DMX Адрес: + + + + + + + + 45 + 16777215 + + + + 10 + + + Qt::AlignCenter + + + no data + + + + + + + Personality: + + + + + + + I1 + + + + + + + + + + 45 + 16777215 + + + + 1000 + + + Qt::AlignCenter + + + + + + + + 16777215 + 16777215 + + + + mA + + + + + + + + + I2 + + + + + + + + + + 45 + 16777215 + + + + 450 + + + Qt::AlignCenter + + + + + + + mA + + + + + + + + + I3 + + + + + + + + + + 45 + 16777215 + + + + 520 + + + Qt::AlignCenter + + + + + + + mA + + + + + + + + + I4 + + + + + + + + + + 45 + 16777215 + + + + 780 + + + Qt::AlignCenter + + + + + + + mA + + + + + + + + + 0 + + + 0 + + + + + + 131 + 32 + + + + + Arial + 9 + + + + true + + + + 28:CH RGB45 SLO + + + + + + + + + 0 + 0 + + + + + 32 + 32 + + + + + + + + .. + + + + 20 + 20 + + + + false + + + + + + + + + + + 0 + 250 + 271 + 101 + + + + + + + 50 + + + 10 + + + 10 + + + + + Чтение + + + + + + + Запись + + + + + + + + + 0 + + + + + + 97 + 16777215 + + + + Проверить + + + + + + + + + Выбранный порт: /dev/ttyUSB0 + + + Qt::AlignCenter + + + + + + + + + + diff --git a/ui/ControllerUI/question mark.png b/ui/ControllerUI/question mark.png new file mode 100644 index 0000000..312f78e Binary files /dev/null and b/ui/ControllerUI/question mark.png differ diff --git a/ui/ControllerUI/requirements.txt b/ui/ControllerUI/requirements.txt new file mode 100644 index 0000000..7fa34f0 --- /dev/null +++ b/ui/ControllerUI/requirements.txt @@ -0,0 +1 @@ +PySide6 diff --git a/ui/ControllerUI/ui_currents.py b/ui/ControllerUI/ui_currents.py new file mode 100644 index 0000000..375ba54 --- /dev/null +++ b/ui/ControllerUI/ui_currents.py @@ -0,0 +1,289 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'currents.ui' +## +## Created by: Qt User Interface Compiler version 6.8.0 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, + QSize, QTime, QUrl, Qt) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, + QFont, QFontDatabase, QGradient, QIcon, + QImage, QKeySequence, QLinearGradient, QPainter, + QPalette, QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QApplication, QCheckBox, QComboBox, QFormLayout, + QHBoxLayout, QLabel, QLineEdit, QMainWindow, + QPushButton, QSizePolicy, QVBoxLayout, QWidget) + +class Ui_Controller(object): + def setupUi(self, Controller): + if not Controller.objectName(): + Controller.setObjectName(u"Controller") + Controller.resize(273, 350) + sizePolicy = QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(Controller.sizePolicy().hasHeightForWidth()) + Controller.setSizePolicy(sizePolicy) + Controller.setMinimumSize(QSize(273, 350)) + Controller.setMaximumSize(QSize(273, 350)) + self.centralwidget = QWidget(Controller) + self.centralwidget.setObjectName(u"centralwidget") + self.formLayoutWidget = QWidget(self.centralwidget) + self.formLayoutWidget.setObjectName(u"formLayoutWidget") + self.formLayoutWidget.setGeometry(QRect(0, 0, 271, 251)) + self.formLayout = QFormLayout(self.formLayoutWidget) + self.formLayout.setObjectName(u"formLayout") + self.formLayout.setRowWrapPolicy(QFormLayout.DontWrapRows) + self.formLayout.setLabelAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) + self.formLayout.setVerticalSpacing(8) + self.formLayout.setContentsMargins(10, 10, 0, 0) + self.ComPort = QLabel(self.formLayoutWidget) + self.ComPort.setObjectName(u"ComPort") + font = QFont() + font.setFamilies([u"Ubuntu Sans"]) + self.ComPort.setFont(font) + + self.formLayout.setWidget(0, QFormLayout.LabelRole, self.ComPort) + + self.DeviceSelection = QComboBox(self.formLayoutWidget) + self.DeviceSelection.addItem("") + self.DeviceSelection.setObjectName(u"DeviceSelection") + sizePolicy1 = QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed) + sizePolicy1.setHorizontalStretch(0) + sizePolicy1.setVerticalStretch(0) + sizePolicy1.setHeightForWidth(self.DeviceSelection.sizePolicy().hasHeightForWidth()) + self.DeviceSelection.setSizePolicy(sizePolicy1) + self.DeviceSelection.setMaximumSize(QSize(110, 16777215)) + font1 = QFont() + font1.setFamilies([u"Arial"]) + font1.setPointSize(10) + self.DeviceSelection.setFont(font1) + + self.formLayout.setWidget(0, QFormLayout.FieldRole, self.DeviceSelection) + + self.DmxAddress = QLabel(self.formLayoutWidget) + self.DmxAddress.setObjectName(u"DmxAddress") + + self.formLayout.setWidget(1, QFormLayout.LabelRole, self.DmxAddress) + + self.DmxAddressField = QLineEdit(self.formLayoutWidget) + self.DmxAddressField.setObjectName(u"DmxAddressField") + self.DmxAddressField.setMaximumSize(QSize(50, 16777215)) + self.DmxAddressField.setAlignment(Qt.AlignCenter) + + self.formLayout.setWidget(1, QFormLayout.FieldRole, self.DmxAddressField) + + self.Personality = QLabel(self.formLayoutWidget) + self.Personality.setObjectName(u"Personality") + + self.formLayout.setWidget(2, QFormLayout.LabelRole, self.Personality) + + self.Current1 = QLabel(self.formLayoutWidget) + self.Current1.setObjectName(u"Current1") + + self.formLayout.setWidget(3, QFormLayout.LabelRole, self.Current1) + + self.horizontalLayout_2 = QHBoxLayout() + self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") + self.Current1Field = QLineEdit(self.formLayoutWidget) + self.Current1Field.setObjectName(u"Current1Field") + self.Current1Field.setMaximumSize(QSize(50, 16777215)) + self.Current1Field.setAlignment(Qt.AlignCenter) + + self.horizontalLayout_2.addWidget(self.Current1Field) + + self.ma1 = QLabel(self.formLayoutWidget) + self.ma1.setObjectName(u"ma1") + self.ma1.setMaximumSize(QSize(16777215, 16777215)) + + self.horizontalLayout_2.addWidget(self.ma1) + + + self.formLayout.setLayout(3, QFormLayout.FieldRole, self.horizontalLayout_2) + + self.Current2 = QLabel(self.formLayoutWidget) + self.Current2.setObjectName(u"Current2") + + self.formLayout.setWidget(4, QFormLayout.LabelRole, self.Current2) + + self.horizontalLayout_3 = QHBoxLayout() + self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") + self.Current2Field = QLineEdit(self.formLayoutWidget) + self.Current2Field.setObjectName(u"Current2Field") + self.Current2Field.setMaximumSize(QSize(50, 16777215)) + self.Current2Field.setAlignment(Qt.AlignCenter) + + self.horizontalLayout_3.addWidget(self.Current2Field) + + self.ma2 = QLabel(self.formLayoutWidget) + self.ma2.setObjectName(u"ma2") + + self.horizontalLayout_3.addWidget(self.ma2) + + + self.formLayout.setLayout(4, QFormLayout.FieldRole, self.horizontalLayout_3) + + self.Current3 = QLabel(self.formLayoutWidget) + self.Current3.setObjectName(u"Current3") + + self.formLayout.setWidget(5, QFormLayout.LabelRole, self.Current3) + + self.horizontalLayout_4 = QHBoxLayout() + self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") + self.Current3Field = QLineEdit(self.formLayoutWidget) + self.Current3Field.setObjectName(u"Current3Field") + self.Current3Field.setMaximumSize(QSize(50, 16777215)) + self.Current3Field.setAlignment(Qt.AlignCenter) + + self.horizontalLayout_4.addWidget(self.Current3Field) + + self.ma3 = QLabel(self.formLayoutWidget) + self.ma3.setObjectName(u"ma3") + + self.horizontalLayout_4.addWidget(self.ma3) + + + self.formLayout.setLayout(5, QFormLayout.FieldRole, self.horizontalLayout_4) + + self.Current4 = QLabel(self.formLayoutWidget) + self.Current4.setObjectName(u"Current4") + + self.formLayout.setWidget(6, QFormLayout.LabelRole, self.Current4) + + self.horizontalLayout_5 = QHBoxLayout() + self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") + self.Current4Field = QLineEdit(self.formLayoutWidget) + self.Current4Field.setObjectName(u"Current4Field") + self.Current4Field.setMaximumSize(QSize(50, 16777215)) + self.Current4Field.setAlignment(Qt.AlignCenter) + + self.horizontalLayout_5.addWidget(self.Current4Field) + + self.ma4 = QLabel(self.formLayoutWidget) + self.ma4.setObjectName(u"ma4") + + self.horizontalLayout_5.addWidget(self.ma4) + + + self.formLayout.setLayout(6, QFormLayout.FieldRole, self.horizontalLayout_5) + + self.horizontalLayout = QHBoxLayout() + self.horizontalLayout.setSpacing(0) + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.horizontalLayout.setContentsMargins(-1, -1, 0, -1) + self.ModeSelection = QComboBox(self.formLayoutWidget) + self.ModeSelection.addItem("") + self.ModeSelection.setObjectName(u"ModeSelection") + self.ModeSelection.setMaximumSize(QSize(131, 32)) + font2 = QFont() + font2.setFamilies([u"Arial"]) + font2.setPointSize(9) + self.ModeSelection.setFont(font2) + self.ModeSelection.setFrame(True) + + self.horizontalLayout.addWidget(self.ModeSelection) + + self.ModeInfo = QPushButton(self.formLayoutWidget) + self.ModeInfo.setObjectName(u"ModeInfo") + sizePolicy1.setHeightForWidth(self.ModeInfo.sizePolicy().hasHeightForWidth()) + self.ModeInfo.setSizePolicy(sizePolicy1) + self.ModeInfo.setMaximumSize(QSize(32, 32)) + icon = QIcon() + iconThemeName = u"dialog-question" + if QIcon.hasThemeIcon(iconThemeName): + icon = QIcon.fromTheme(iconThemeName) + else: + icon.addFile(u".", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + + self.ModeInfo.setIcon(icon) + self.ModeInfo.setIconSize(QSize(20, 20)) + self.ModeInfo.setCheckable(False) + + self.horizontalLayout.addWidget(self.ModeInfo) + + + self.formLayout.setLayout(2, QFormLayout.FieldRole, self.horizontalLayout) + + self.verticalLayoutWidget = QWidget(self.centralwidget) + self.verticalLayoutWidget.setObjectName(u"verticalLayoutWidget") + self.verticalLayoutWidget.setGeometry(QRect(0, 250, 271, 101)) + self.verticalLayout = QVBoxLayout(self.verticalLayoutWidget) + self.verticalLayout.setObjectName(u"verticalLayout") + self.verticalLayout.setContentsMargins(0, 0, 0, 0) + self.horizontalLayout_6 = QHBoxLayout() + self.horizontalLayout_6.setSpacing(50) + self.horizontalLayout_6.setObjectName(u"horizontalLayout_6") + self.horizontalLayout_6.setContentsMargins(10, -1, 10, -1) + self.Read = QPushButton(self.verticalLayoutWidget) + self.Read.setObjectName(u"Read") + + self.horizontalLayout_6.addWidget(self.Read) + + self.Write = QPushButton(self.verticalLayoutWidget) + self.Write.setObjectName(u"Write") + + self.horizontalLayout_6.addWidget(self.Write) + + + self.verticalLayout.addLayout(self.horizontalLayout_6) + + self.horizontalLayout_7 = QHBoxLayout() + self.horizontalLayout_7.setObjectName(u"horizontalLayout_7") + self.horizontalLayout_7.setContentsMargins(0, -1, -1, -1) + self.Check = QCheckBox(self.verticalLayoutWidget) + self.Check.setObjectName(u"Check") + self.Check.setMaximumSize(QSize(97, 16777215)) + + self.horizontalLayout_7.addWidget(self.Check) + + + self.verticalLayout.addLayout(self.horizontalLayout_7) + + self.Status = QLabel(self.verticalLayoutWidget) + self.Status.setObjectName(u"Status") + self.Status.setAlignment(Qt.AlignCenter) + + self.verticalLayout.addWidget(self.Status) + + Controller.setCentralWidget(self.centralwidget) + + self.retranslateUi(Controller) + + QMetaObject.connectSlotsByName(Controller) + # setupUi + + def retranslateUi(self, Controller): + Controller.setWindowTitle(QCoreApplication.translate("Controller", u"Controller", None)) + self.ComPort.setText(QCoreApplication.translate("Controller", u"COM \u041f\u043e\u0440\u0442:", None)) + self.DeviceSelection.setItemText(0, QCoreApplication.translate("Controller", u"/dev/ttyUSB0", None)) + + self.DmxAddress.setText(QCoreApplication.translate("Controller", u"DMX \u0410\u0434\u0440\u0435\u0441:", None)) + self.DmxAddressField.setText(QCoreApplication.translate("Controller", u"10", None)) + self.DmxAddressField.setPlaceholderText(QCoreApplication.translate("Controller", u"no data", None)) + self.Personality.setText(QCoreApplication.translate("Controller", u"Personality:", None)) + self.Current1.setText(QCoreApplication.translate("Controller", u" I1", None)) + self.Current1Field.setText(QCoreApplication.translate("Controller", u"1000", None)) + self.ma1.setText(QCoreApplication.translate("Controller", u"mA", None)) + self.Current2.setText(QCoreApplication.translate("Controller", u" I2", None)) + self.Current2Field.setText(QCoreApplication.translate("Controller", u"450", None)) + self.ma2.setText(QCoreApplication.translate("Controller", u"mA", None)) + self.Current3.setText(QCoreApplication.translate("Controller", u" I3", None)) + self.Current3Field.setText(QCoreApplication.translate("Controller", u"520", None)) + self.ma3.setText(QCoreApplication.translate("Controller", u"mA", None)) + self.Current4.setText(QCoreApplication.translate("Controller", u" I4", None)) + self.Current4Field.setText(QCoreApplication.translate("Controller", u"780", None)) + self.ma4.setText(QCoreApplication.translate("Controller", u"mA", None)) + self.ModeSelection.setItemText(0, QCoreApplication.translate("Controller", u"28:CH RGB45 SLO", None)) + + self.ModeInfo.setText("") + self.Read.setText(QCoreApplication.translate("Controller", u"\u0427\u0442\u0435\u043d\u0438\u0435", None)) + self.Write.setText(QCoreApplication.translate("Controller", u"\u0417\u0430\u043f\u0438\u0441\u044c", None)) + self.Check.setText(QCoreApplication.translate("Controller", u"\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c", None)) + self.Status.setText(QCoreApplication.translate("Controller", u"\u0412\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0440\u0442: /dev/ttyUSB0", None)) + # retranslateUi + diff --git a/ui/ControllerUI/ui_form.py b/ui/ControllerUI/ui_form.py new file mode 100644 index 0000000..2baafbb --- /dev/null +++ b/ui/ControllerUI/ui_form.py @@ -0,0 +1,289 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'form.ui' +## +## Created by: Qt User Interface Compiler version 6.8.0 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, + QSize, QTime, QUrl, Qt) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, + QFont, QFontDatabase, QGradient, QIcon, + QImage, QKeySequence, QLinearGradient, QPainter, + QPalette, QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QApplication, QCheckBox, QComboBox, QFormLayout, + QHBoxLayout, QLabel, QLineEdit, QMainWindow, + QPushButton, QSizePolicy, QVBoxLayout, QWidget) + +class Ui_Controller(object): + def setupUi(self, Controller): + if not Controller.objectName(): + Controller.setObjectName(u"Controller") + Controller.resize(273, 350) + sizePolicy = QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(Controller.sizePolicy().hasHeightForWidth()) + Controller.setSizePolicy(sizePolicy) + Controller.setMinimumSize(QSize(273, 350)) + Controller.setMaximumSize(QSize(273, 350)) + self.centralwidget = QWidget(Controller) + self.centralwidget.setObjectName(u"centralwidget") + self.formLayoutWidget = QWidget(self.centralwidget) + self.formLayoutWidget.setObjectName(u"formLayoutWidget") + self.formLayoutWidget.setGeometry(QRect(0, 0, 271, 251)) + self.formLayout = QFormLayout(self.formLayoutWidget) + self.formLayout.setObjectName(u"formLayout") + self.formLayout.setRowWrapPolicy(QFormLayout.DontWrapRows) + self.formLayout.setLabelAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) + self.formLayout.setVerticalSpacing(8) + self.formLayout.setContentsMargins(10, 10, 0, 0) + self.label = QLabel(self.formLayoutWidget) + self.label.setObjectName(u"label") + font = QFont() + font.setFamilies([u"Ubuntu Sans"]) + self.label.setFont(font) + + self.formLayout.setWidget(0, QFormLayout.LabelRole, self.label) + + self.comboBox = QComboBox(self.formLayoutWidget) + self.comboBox.addItem("") + self.comboBox.setObjectName(u"comboBox") + sizePolicy1 = QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed) + sizePolicy1.setHorizontalStretch(0) + sizePolicy1.setVerticalStretch(0) + sizePolicy1.setHeightForWidth(self.comboBox.sizePolicy().hasHeightForWidth()) + self.comboBox.setSizePolicy(sizePolicy1) + self.comboBox.setMaximumSize(QSize(110, 16777215)) + font1 = QFont() + font1.setFamilies([u"Arial"]) + font1.setPointSize(10) + self.comboBox.setFont(font1) + + self.formLayout.setWidget(0, QFormLayout.FieldRole, self.comboBox) + + self.label_2 = QLabel(self.formLayoutWidget) + self.label_2.setObjectName(u"label_2") + + self.formLayout.setWidget(1, QFormLayout.LabelRole, self.label_2) + + self.lineEdit = QLineEdit(self.formLayoutWidget) + self.lineEdit.setObjectName(u"lineEdit") + self.lineEdit.setMaximumSize(QSize(50, 16777215)) + self.lineEdit.setAlignment(Qt.AlignCenter) + + self.formLayout.setWidget(1, QFormLayout.FieldRole, self.lineEdit) + + self.label_3 = QLabel(self.formLayoutWidget) + self.label_3.setObjectName(u"label_3") + + self.formLayout.setWidget(2, QFormLayout.LabelRole, self.label_3) + + self.label_4 = QLabel(self.formLayoutWidget) + self.label_4.setObjectName(u"label_4") + + self.formLayout.setWidget(3, QFormLayout.LabelRole, self.label_4) + + self.horizontalLayout_2 = QHBoxLayout() + self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") + self.lineEdit_2 = QLineEdit(self.formLayoutWidget) + self.lineEdit_2.setObjectName(u"lineEdit_2") + self.lineEdit_2.setMaximumSize(QSize(50, 16777215)) + self.lineEdit_2.setAlignment(Qt.AlignCenter) + + self.horizontalLayout_2.addWidget(self.lineEdit_2) + + self.label_5 = QLabel(self.formLayoutWidget) + self.label_5.setObjectName(u"label_5") + self.label_5.setMaximumSize(QSize(16777215, 16777215)) + + self.horizontalLayout_2.addWidget(self.label_5) + + + self.formLayout.setLayout(3, QFormLayout.FieldRole, self.horizontalLayout_2) + + self.label_6 = QLabel(self.formLayoutWidget) + self.label_6.setObjectName(u"label_6") + + self.formLayout.setWidget(4, QFormLayout.LabelRole, self.label_6) + + self.horizontalLayout_3 = QHBoxLayout() + self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") + self.lineEdit_3 = QLineEdit(self.formLayoutWidget) + self.lineEdit_3.setObjectName(u"lineEdit_3") + self.lineEdit_3.setMaximumSize(QSize(50, 16777215)) + self.lineEdit_3.setAlignment(Qt.AlignCenter) + + self.horizontalLayout_3.addWidget(self.lineEdit_3) + + self.label_7 = QLabel(self.formLayoutWidget) + self.label_7.setObjectName(u"label_7") + + self.horizontalLayout_3.addWidget(self.label_7) + + + self.formLayout.setLayout(4, QFormLayout.FieldRole, self.horizontalLayout_3) + + self.label_8 = QLabel(self.formLayoutWidget) + self.label_8.setObjectName(u"label_8") + + self.formLayout.setWidget(5, QFormLayout.LabelRole, self.label_8) + + self.horizontalLayout_4 = QHBoxLayout() + self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") + self.lineEdit_4 = QLineEdit(self.formLayoutWidget) + self.lineEdit_4.setObjectName(u"lineEdit_4") + self.lineEdit_4.setMaximumSize(QSize(50, 16777215)) + self.lineEdit_4.setAlignment(Qt.AlignCenter) + + self.horizontalLayout_4.addWidget(self.lineEdit_4) + + self.label_9 = QLabel(self.formLayoutWidget) + self.label_9.setObjectName(u"label_9") + + self.horizontalLayout_4.addWidget(self.label_9) + + + self.formLayout.setLayout(5, QFormLayout.FieldRole, self.horizontalLayout_4) + + self.label_10 = QLabel(self.formLayoutWidget) + self.label_10.setObjectName(u"label_10") + + self.formLayout.setWidget(6, QFormLayout.LabelRole, self.label_10) + + self.horizontalLayout_5 = QHBoxLayout() + self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") + self.lineEdit_5 = QLineEdit(self.formLayoutWidget) + self.lineEdit_5.setObjectName(u"lineEdit_5") + self.lineEdit_5.setMaximumSize(QSize(50, 16777215)) + self.lineEdit_5.setAlignment(Qt.AlignCenter) + + self.horizontalLayout_5.addWidget(self.lineEdit_5) + + self.label_11 = QLabel(self.formLayoutWidget) + self.label_11.setObjectName(u"label_11") + + self.horizontalLayout_5.addWidget(self.label_11) + + + self.formLayout.setLayout(6, QFormLayout.FieldRole, self.horizontalLayout_5) + + self.horizontalLayout = QHBoxLayout() + self.horizontalLayout.setSpacing(0) + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.horizontalLayout.setContentsMargins(-1, -1, 0, -1) + self.comboBox_2 = QComboBox(self.formLayoutWidget) + self.comboBox_2.addItem("") + self.comboBox_2.setObjectName(u"comboBox_2") + self.comboBox_2.setMaximumSize(QSize(131, 32)) + font2 = QFont() + font2.setFamilies([u"Arial"]) + font2.setPointSize(9) + self.comboBox_2.setFont(font2) + self.comboBox_2.setFrame(True) + + self.horizontalLayout.addWidget(self.comboBox_2) + + self.pushButton = QPushButton(self.formLayoutWidget) + self.pushButton.setObjectName(u"pushButton") + sizePolicy1.setHeightForWidth(self.pushButton.sizePolicy().hasHeightForWidth()) + self.pushButton.setSizePolicy(sizePolicy1) + self.pushButton.setMaximumSize(QSize(32, 32)) + icon = QIcon() + iconThemeName = u"dialog-question" + if QIcon.hasThemeIcon(iconThemeName): + icon = QIcon.fromTheme(iconThemeName) + else: + icon.addFile(u".", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + + self.pushButton.setIcon(icon) + self.pushButton.setIconSize(QSize(20, 20)) + self.pushButton.setCheckable(False) + + self.horizontalLayout.addWidget(self.pushButton) + + + self.formLayout.setLayout(2, QFormLayout.FieldRole, self.horizontalLayout) + + self.verticalLayoutWidget = QWidget(self.centralwidget) + self.verticalLayoutWidget.setObjectName(u"verticalLayoutWidget") + self.verticalLayoutWidget.setGeometry(QRect(0, 250, 271, 101)) + self.verticalLayout = QVBoxLayout(self.verticalLayoutWidget) + self.verticalLayout.setObjectName(u"verticalLayout") + self.verticalLayout.setContentsMargins(0, 0, 0, 0) + self.horizontalLayout_6 = QHBoxLayout() + self.horizontalLayout_6.setSpacing(50) + self.horizontalLayout_6.setObjectName(u"horizontalLayout_6") + self.horizontalLayout_6.setContentsMargins(10, -1, 10, -1) + self.pushButton_3 = QPushButton(self.verticalLayoutWidget) + self.pushButton_3.setObjectName(u"pushButton_3") + + self.horizontalLayout_6.addWidget(self.pushButton_3) + + self.pushButton_2 = QPushButton(self.verticalLayoutWidget) + self.pushButton_2.setObjectName(u"pushButton_2") + + self.horizontalLayout_6.addWidget(self.pushButton_2) + + + self.verticalLayout.addLayout(self.horizontalLayout_6) + + self.horizontalLayout_7 = QHBoxLayout() + self.horizontalLayout_7.setObjectName(u"horizontalLayout_7") + self.horizontalLayout_7.setContentsMargins(0, -1, -1, -1) + self.checkBox = QCheckBox(self.verticalLayoutWidget) + self.checkBox.setObjectName(u"checkBox") + self.checkBox.setMaximumSize(QSize(97, 16777215)) + + self.horizontalLayout_7.addWidget(self.checkBox) + + + self.verticalLayout.addLayout(self.horizontalLayout_7) + + self.label_12 = QLabel(self.verticalLayoutWidget) + self.label_12.setObjectName(u"label_12") + self.label_12.setAlignment(Qt.AlignCenter) + + self.verticalLayout.addWidget(self.label_12) + + Controller.setCentralWidget(self.centralwidget) + + self.retranslateUi(Controller) + + QMetaObject.connectSlotsByName(Controller) + # setupUi + + def retranslateUi(self, Controller): + Controller.setWindowTitle(QCoreApplication.translate("Controller", u"Controller", None)) + self.label.setText(QCoreApplication.translate("Controller", u"COM \u041f\u043e\u0440\u0442:", None)) + self.comboBox.setItemText(0, QCoreApplication.translate("Controller", u"/dev/ttyUSB0", None)) + + self.label_2.setText(QCoreApplication.translate("Controller", u"DMX \u0410\u0434\u0440\u0435\u0441:", None)) + self.lineEdit.setText(QCoreApplication.translate("Controller", u"10", None)) + self.lineEdit.setPlaceholderText(QCoreApplication.translate("Controller", u"no data", None)) + self.label_3.setText(QCoreApplication.translate("Controller", u"Personality:", None)) + self.label_4.setText(QCoreApplication.translate("Controller", u"\u0422\u043e\u043a \u043a\u0430\u043d\u0430\u043b 1:", None)) + self.lineEdit_2.setText(QCoreApplication.translate("Controller", u"1000", None)) + self.label_5.setText(QCoreApplication.translate("Controller", u"mA", None)) + self.label_6.setText(QCoreApplication.translate("Controller", u"\u0422\u043e\u043a \u043a\u0430\u043d\u0430\u043b 2:", None)) + self.lineEdit_3.setText(QCoreApplication.translate("Controller", u"450", None)) + self.label_7.setText(QCoreApplication.translate("Controller", u"mA", None)) + self.label_8.setText(QCoreApplication.translate("Controller", u"\u0422\u043e\u043a \u043a\u0430\u043d\u0430\u043b 3:", None)) + self.lineEdit_4.setText(QCoreApplication.translate("Controller", u"520", None)) + self.label_9.setText(QCoreApplication.translate("Controller", u"mA", None)) + self.label_10.setText(QCoreApplication.translate("Controller", u"\u0422\u043e\u043a \u043a\u0430\u043d\u0430\u043b 4:", None)) + self.lineEdit_5.setText(QCoreApplication.translate("Controller", u"780", None)) + self.label_11.setText(QCoreApplication.translate("Controller", u"mA", None)) + self.comboBox_2.setItemText(0, QCoreApplication.translate("Controller", u"28:CH RGB45 SLO", None)) + + self.pushButton.setText("") + self.pushButton_3.setText(QCoreApplication.translate("Controller", u"\u0427\u0442\u0435\u043d\u0438\u0435", None)) + self.pushButton_2.setText(QCoreApplication.translate("Controller", u"\u0417\u0430\u043f\u0438\u0441\u044c", None)) + self.checkBox.setText(QCoreApplication.translate("Controller", u"\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c", None)) + self.label_12.setText(QCoreApplication.translate("Controller", u"\u0412\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0440\u0442: /dev/ttyUSB0", None)) + # retranslateUi + diff --git a/ui/ControllerUI/ui_power.py b/ui/ControllerUI/ui_power.py new file mode 100644 index 0000000..83d3158 --- /dev/null +++ b/ui/ControllerUI/ui_power.py @@ -0,0 +1,289 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'power.ui' +## +## Created by: Qt User Interface Compiler version 6.8.0 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, + QSize, QTime, QUrl, Qt) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, + QFont, QFontDatabase, QGradient, QIcon, + QImage, QKeySequence, QLinearGradient, QPainter, + QPalette, QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QApplication, QCheckBox, QComboBox, QFormLayout, + QHBoxLayout, QLabel, QLineEdit, QMainWindow, + QPushButton, QSizePolicy, QVBoxLayout, QWidget) + +class Ui_Controller(object): + def setupUi(self, Controller): + if not Controller.objectName(): + Controller.setObjectName(u"Controller") + Controller.resize(273, 350) + sizePolicy = QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(Controller.sizePolicy().hasHeightForWidth()) + Controller.setSizePolicy(sizePolicy) + Controller.setMinimumSize(QSize(273, 350)) + Controller.setMaximumSize(QSize(273, 350)) + self.centralwidget = QWidget(Controller) + self.centralwidget.setObjectName(u"centralwidget") + self.formLayoutWidget = QWidget(self.centralwidget) + self.formLayoutWidget.setObjectName(u"formLayoutWidget") + self.formLayoutWidget.setGeometry(QRect(0, 0, 271, 251)) + self.formLayout = QFormLayout(self.formLayoutWidget) + self.formLayout.setObjectName(u"formLayout") + self.formLayout.setRowWrapPolicy(QFormLayout.DontWrapRows) + self.formLayout.setLabelAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) + self.formLayout.setVerticalSpacing(8) + self.formLayout.setContentsMargins(10, 10, 0, 0) + self.ComPort = QLabel(self.formLayoutWidget) + self.ComPort.setObjectName(u"ComPort") + font = QFont() + font.setFamilies([u"Ubuntu Sans"]) + self.ComPort.setFont(font) + + self.formLayout.setWidget(0, QFormLayout.LabelRole, self.ComPort) + + self.DeviceSelection = QComboBox(self.formLayoutWidget) + self.DeviceSelection.addItem("") + self.DeviceSelection.setObjectName(u"DeviceSelection") + sizePolicy1 = QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed) + sizePolicy1.setHorizontalStretch(0) + sizePolicy1.setVerticalStretch(0) + sizePolicy1.setHeightForWidth(self.DeviceSelection.sizePolicy().hasHeightForWidth()) + self.DeviceSelection.setSizePolicy(sizePolicy1) + self.DeviceSelection.setMaximumSize(QSize(110, 16777215)) + font1 = QFont() + font1.setFamilies([u"Arial"]) + font1.setPointSize(10) + self.DeviceSelection.setFont(font1) + + self.formLayout.setWidget(0, QFormLayout.FieldRole, self.DeviceSelection) + + self.DmxAddress = QLabel(self.formLayoutWidget) + self.DmxAddress.setObjectName(u"DmxAddress") + + self.formLayout.setWidget(1, QFormLayout.LabelRole, self.DmxAddress) + + self.DmxAddressField = QLineEdit(self.formLayoutWidget) + self.DmxAddressField.setObjectName(u"DmxAddressField") + self.DmxAddressField.setMaximumSize(QSize(50, 16777215)) + self.DmxAddressField.setAlignment(Qt.AlignCenter) + + self.formLayout.setWidget(1, QFormLayout.FieldRole, self.DmxAddressField) + + self.Personality = QLabel(self.formLayoutWidget) + self.Personality.setObjectName(u"Personality") + + self.formLayout.setWidget(2, QFormLayout.LabelRole, self.Personality) + + self.Current1 = QLabel(self.formLayoutWidget) + self.Current1.setObjectName(u"Current1") + + self.formLayout.setWidget(3, QFormLayout.LabelRole, self.Current1) + + self.horizontalLayout_2 = QHBoxLayout() + self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") + self.Current1Field = QLineEdit(self.formLayoutWidget) + self.Current1Field.setObjectName(u"Current1Field") + self.Current1Field.setMaximumSize(QSize(50, 16777215)) + self.Current1Field.setAlignment(Qt.AlignCenter) + + self.horizontalLayout_2.addWidget(self.Current1Field) + + self.ma1 = QLabel(self.formLayoutWidget) + self.ma1.setObjectName(u"ma1") + self.ma1.setMaximumSize(QSize(16777215, 16777215)) + + self.horizontalLayout_2.addWidget(self.ma1) + + + self.formLayout.setLayout(3, QFormLayout.FieldRole, self.horizontalLayout_2) + + self.Current2 = QLabel(self.formLayoutWidget) + self.Current2.setObjectName(u"Current2") + + self.formLayout.setWidget(4, QFormLayout.LabelRole, self.Current2) + + self.horizontalLayout_3 = QHBoxLayout() + self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") + self.Current2Field = QLineEdit(self.formLayoutWidget) + self.Current2Field.setObjectName(u"Current2Field") + self.Current2Field.setMaximumSize(QSize(50, 16777215)) + self.Current2Field.setAlignment(Qt.AlignCenter) + + self.horizontalLayout_3.addWidget(self.Current2Field) + + self.ma2 = QLabel(self.formLayoutWidget) + self.ma2.setObjectName(u"ma2") + + self.horizontalLayout_3.addWidget(self.ma2) + + + self.formLayout.setLayout(4, QFormLayout.FieldRole, self.horizontalLayout_3) + + self.Current3 = QLabel(self.formLayoutWidget) + self.Current3.setObjectName(u"Current3") + + self.formLayout.setWidget(5, QFormLayout.LabelRole, self.Current3) + + self.horizontalLayout_4 = QHBoxLayout() + self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") + self.Current3Field = QLineEdit(self.formLayoutWidget) + self.Current3Field.setObjectName(u"Current3Field") + self.Current3Field.setMaximumSize(QSize(50, 16777215)) + self.Current3Field.setAlignment(Qt.AlignCenter) + + self.horizontalLayout_4.addWidget(self.Current3Field) + + self.ma3 = QLabel(self.formLayoutWidget) + self.ma3.setObjectName(u"ma3") + + self.horizontalLayout_4.addWidget(self.ma3) + + + self.formLayout.setLayout(5, QFormLayout.FieldRole, self.horizontalLayout_4) + + self.Current4 = QLabel(self.formLayoutWidget) + self.Current4.setObjectName(u"Current4") + + self.formLayout.setWidget(6, QFormLayout.LabelRole, self.Current4) + + self.horizontalLayout_5 = QHBoxLayout() + self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") + self.Current4Field = QLineEdit(self.formLayoutWidget) + self.Current4Field.setObjectName(u"Current4Field") + self.Current4Field.setMaximumSize(QSize(50, 16777215)) + self.Current4Field.setAlignment(Qt.AlignCenter) + + self.horizontalLayout_5.addWidget(self.Current4Field) + + self.ma4 = QLabel(self.formLayoutWidget) + self.ma4.setObjectName(u"ma4") + + self.horizontalLayout_5.addWidget(self.ma4) + + + self.formLayout.setLayout(6, QFormLayout.FieldRole, self.horizontalLayout_5) + + self.horizontalLayout = QHBoxLayout() + self.horizontalLayout.setSpacing(0) + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.horizontalLayout.setContentsMargins(-1, -1, 0, -1) + self.ModeSelection = QComboBox(self.formLayoutWidget) + self.ModeSelection.addItem("") + self.ModeSelection.setObjectName(u"ModeSelection") + self.ModeSelection.setMaximumSize(QSize(131, 32)) + font2 = QFont() + font2.setFamilies([u"Arial"]) + font2.setPointSize(9) + self.ModeSelection.setFont(font2) + self.ModeSelection.setFrame(True) + + self.horizontalLayout.addWidget(self.ModeSelection) + + self.ModeInfo = QPushButton(self.formLayoutWidget) + self.ModeInfo.setObjectName(u"ModeInfo") + sizePolicy1.setHeightForWidth(self.ModeInfo.sizePolicy().hasHeightForWidth()) + self.ModeInfo.setSizePolicy(sizePolicy1) + self.ModeInfo.setMaximumSize(QSize(32, 32)) + icon = QIcon() + iconThemeName = u"dialog-question" + if QIcon.hasThemeIcon(iconThemeName): + icon = QIcon.fromTheme(iconThemeName) + else: + icon.addFile(u".", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + + self.ModeInfo.setIcon(icon) + self.ModeInfo.setIconSize(QSize(20, 20)) + self.ModeInfo.setCheckable(False) + + self.horizontalLayout.addWidget(self.ModeInfo) + + + self.formLayout.setLayout(2, QFormLayout.FieldRole, self.horizontalLayout) + + self.verticalLayoutWidget = QWidget(self.centralwidget) + self.verticalLayoutWidget.setObjectName(u"verticalLayoutWidget") + self.verticalLayoutWidget.setGeometry(QRect(0, 250, 271, 101)) + self.verticalLayout = QVBoxLayout(self.verticalLayoutWidget) + self.verticalLayout.setObjectName(u"verticalLayout") + self.verticalLayout.setContentsMargins(0, 0, 0, 0) + self.horizontalLayout_6 = QHBoxLayout() + self.horizontalLayout_6.setSpacing(50) + self.horizontalLayout_6.setObjectName(u"horizontalLayout_6") + self.horizontalLayout_6.setContentsMargins(10, -1, 10, -1) + self.Read = QPushButton(self.verticalLayoutWidget) + self.Read.setObjectName(u"Read") + + self.horizontalLayout_6.addWidget(self.Read) + + self.Write = QPushButton(self.verticalLayoutWidget) + self.Write.setObjectName(u"Write") + + self.horizontalLayout_6.addWidget(self.Write) + + + self.verticalLayout.addLayout(self.horizontalLayout_6) + + self.horizontalLayout_7 = QHBoxLayout() + self.horizontalLayout_7.setObjectName(u"horizontalLayout_7") + self.horizontalLayout_7.setContentsMargins(0, -1, -1, -1) + self.Check = QCheckBox(self.verticalLayoutWidget) + self.Check.setObjectName(u"Check") + self.Check.setMaximumSize(QSize(97, 16777215)) + + self.horizontalLayout_7.addWidget(self.Check) + + + self.verticalLayout.addLayout(self.horizontalLayout_7) + + self.Status = QLabel(self.verticalLayoutWidget) + self.Status.setObjectName(u"Status") + self.Status.setAlignment(Qt.AlignCenter) + + self.verticalLayout.addWidget(self.Status) + + Controller.setCentralWidget(self.centralwidget) + + self.retranslateUi(Controller) + + QMetaObject.connectSlotsByName(Controller) + # setupUi + + def retranslateUi(self, Controller): + Controller.setWindowTitle(QCoreApplication.translate("Controller", u"Controller", None)) + self.ComPort.setText(QCoreApplication.translate("Controller", u"COM \u041f\u043e\u0440\u0442:", None)) + self.DeviceSelection.setItemText(0, QCoreApplication.translate("Controller", u"/dev/ttyUSB0", None)) + + self.DmxAddress.setText(QCoreApplication.translate("Controller", u"DMX \u0410\u0434\u0440\u0435\u0441:", None)) + self.DmxAddressField.setText(QCoreApplication.translate("Controller", u"10", None)) + self.DmxAddressField.setPlaceholderText(QCoreApplication.translate("Controller", u"no data", None)) + self.Personality.setText(QCoreApplication.translate("Controller", u"Personality:", None)) + self.Current1.setText(QCoreApplication.translate("Controller", u"\u0422\u043e\u043a \u043a\u0430\u043d\u0430\u043b 1:", None)) + self.Current1Field.setText(QCoreApplication.translate("Controller", u"1000", None)) + self.ma1.setText(QCoreApplication.translate("Controller", u"mA", None)) + self.Current2.setText(QCoreApplication.translate("Controller", u"\u0422\u043e\u043a \u043a\u0430\u043d\u0430\u043b 2:", None)) + self.Current2Field.setText(QCoreApplication.translate("Controller", u"450", None)) + self.ma2.setText(QCoreApplication.translate("Controller", u"mA", None)) + self.Current3.setText(QCoreApplication.translate("Controller", u"\u0422\u043e\u043a \u043a\u0430\u043d\u0430\u043b 3:", None)) + self.Current3Field.setText(QCoreApplication.translate("Controller", u"520", None)) + self.ma3.setText(QCoreApplication.translate("Controller", u"mA", None)) + self.Current4.setText(QCoreApplication.translate("Controller", u"\u0422\u043e\u043a \u043a\u0430\u043d\u0430\u043b 4:", None)) + self.Current4Field.setText(QCoreApplication.translate("Controller", u"780", None)) + self.ma4.setText(QCoreApplication.translate("Controller", u"mA", None)) + self.ModeSelection.setItemText(0, QCoreApplication.translate("Controller", u"28:CH RGB45 SLO", None)) + + self.ModeInfo.setText("") + self.Read.setText(QCoreApplication.translate("Controller", u"\u0427\u0442\u0435\u043d\u0438\u0435", None)) + self.Write.setText(QCoreApplication.translate("Controller", u"\u0417\u0430\u043f\u0438\u0441\u044c", None)) + self.Check.setText(QCoreApplication.translate("Controller", u"\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c", None)) + self.Status.setText(QCoreApplication.translate("Controller", u"\u0412\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0440\u0442: /dev/ttyUSB0", None)) + # retranslateUi +