diff --git a/scripts/compile_ui.ps1 b/scripts/compile_ui.ps1 index 2b32bbe..c754dd8 100644 --- a/scripts/compile_ui.ps1 +++ b/scripts/compile_ui.ps1 @@ -3,5 +3,6 @@ Get-ChildItem -Filter src/*.ui | ForEach-Object { $pyFile = [System.IO.Path]::ChangeExtension($uiFile, ".py") # add "ui_" prefix to the file name $pyFile = [System.IO.Path]::Combine($([System.IO.Path]::GetDirectoryName($pyFile)), "ui_$([System.IO.Path]::GetFileName($pyFile))") - pyside6-uic $uiFile -o $pyFile + pyside6-uic $uiFile -o $pyFile -p -n --no-qt-namespace --star-imports + Write-Host "Processed $UiFile -> $pyFile" } diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 45e08bc..bfe796d 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -1375,130 +1375,201 @@ - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 3 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - URL - - - - - - - https://app.overlays.uno/apiv2/controlapps/.../api - - - - - - - ▶️ - - - true - - - - - - - - - - - 0 - 0 - - - - - 0 - - - 5 - - - 0 - - - 5 + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 3 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + URL + + + + + + + https://app.overlays.uno/apiv2/controlapps/.../api + + + + + + + ▶️ + + + true + + + + + + + + + + + 0 + 0 + - - - - Send only new detections or also existing? - - - Send Same? - - - - - - - - 0 - 0 - - - - Rate Limit - - - - - - - - 0 - 0 - - - - /second - - - 1 - - - - - - - + + + 0 + + + 5 + + + 0 + + + 5 + + + + + + 0 + 0 + + + + Send only new detections or also existing? + + + Send Same? + + + + + + + + 0 + 0 + + + + Essentials + + + + + + + + 0 + 0 + + + + Rate Limit + + + + + + + + 0 + 0 + + + + /sec + + + 1 + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Overlay ID + + + + + + + + 0 + 0 + + + + + + + aaaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeeee + + + + + + + + - + false diff --git a/src/storage.py b/src/storage.py index 34ab8c8..5a0b1c5 100644 --- a/src/storage.py +++ b/src/storage.py @@ -172,7 +172,7 @@ def edit_item(self, item_name: str, new_item: TextDetectionTarget): self._data[i].settings = new_item.settings self.data_changed.emit(self._data) return - logger.warn("unable to find item to edit in storage: " + item_name) + logger.warning("unable to find item to edit in storage: " + item_name) def rename_item(self, old_name: str, new_name: str): for i, item in enumerate(self._data): @@ -180,7 +180,7 @@ def rename_item(self, old_name: str, new_name: str): self._data[i].name = new_name self.data_changed.emit(self._data) return True - logger.warn("unable to find item to rename in storage: " + old_name) + logger.warning("unable to find item to rename in storage: " + old_name) return False def get_data(self): diff --git a/src/ui_about.py b/src/ui_about.py index 6380db4..67e3f71 100644 --- a/src/ui_about.py +++ b/src/ui_about.py @@ -3,21 +3,14 @@ ################################################################################ ## Form generated from reading UI file 'about.ui' ## -## Created by: Qt User Interface Compiler version 6.7.3 +## Created by: Qt User Interface Compiler version 6.7.2 ## ## 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 (QAbstractButton, QApplication, QDialog, QDialogButtonBox, - QGridLayout, QLabel, QScrollArea, QSizePolicy, - QWidget) +from PySide6.QtCore import * # type: ignore +from PySide6.QtGui import * # type: ignore +from PySide6.QtWidgets import * # type: ignore class Ui_Dialog(object): def setupUi(self, Dialog): @@ -37,7 +30,7 @@ def setupUi(self, Dialog): self.scrollArea.setWidgetResizable(True) self.scrollAreaWidgetContents = QWidget() self.scrollAreaWidgetContents.setObjectName(u"scrollAreaWidgetContents") - self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 366, 984)) + self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 374, 830)) self.gridLayout_2 = QGridLayout(self.scrollAreaWidgetContents) self.gridLayout_2.setObjectName(u"gridLayout_2") self.label = QLabel(self.scrollAreaWidgetContents) @@ -68,10 +61,10 @@ def setupUi(self, Dialog): def retranslateUi(self, Dialog): Dialog.setWindowTitle(QCoreApplication.translate("Dialog", u"About", None)) - self.label.setText(QCoreApplication.translate("Dialog", u"

About ScoreSight

ScoreSight is a cutting-edge software solution designed to simplify visual reading of scoreboards.

License

MIT License

Copyright (c) 2024 OCC AI: Open tools for Content Creators and Streamers

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIE" - "D, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Third-Party Software
ScoreSight incorporates components from third-party sources under their respective licenses:

  • OpenCV is used under the Apache 2 License, permitting the use, distribution, and modification of the software provided that certain conditions are met. More information can be found at OpenCV License.
  • Tesseract OCR is used under the Apache 2 License, which allows for the use, distribution, and modification of the software in accordance with the terms set forth in the license. More details are available at Tesseract OCR License.

Detailed licensing information for these components is included within the software distribution.

Qt Application Framework

This application uses the Qt application framework, which is a comprehensive C++ library for cross-platform development of GUI applications. Qt is used under the terms of the GNU Lesser General Public License (LGPL) version 3. Qt is a registered trademark of The Qt Company Ltd and is developed and maintained by The Qt Project and various contributors.

For more information about Qt, including source code of Qt libraries used by thi" - "s application and guidance on how to obtain or replace Qt libraries, please visit the Qt Project's official website at http://www.qt.io.

We are committed to ensuring compliance with the LGPL v3 license and support the principles of open source software development. If you have any questions or concerns regarding our use of Qt, please contact us directly.

Disclaimer of Warranty
ScoreSight is provided "AS IS", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall Roy Shilkrot be liable for any claim, damages, or other liability, whether in an action of contract, tort or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software.

Contact Information
For support, feedback, or more information, please visit https://scoresight.live or contact us at info@scoresight.live.

", None)) + self.label.setText(QCoreApplication.translate("Dialog", u"

About ScoreSight

ScoreSight is an OCR software designed to simplify visual reading of scoreboards and live screencasts.

License

MIT License

Copyright (c) 2024 Locaal AI: AI tools for Developers and Creators

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Third-Party Software
ScoreSight incorporates components from third-party sources under their respective licenses:

  • OpenCV is used under the Apache 2 License, permitting the use, distribution, and modification of the soft" + "ware provided that certain conditions are met. More information can be found at OpenCV License.
  • Tesseract OCR is used under the Apache 2 License, which allows for the use, distribution, and modification of the software in accordance with the terms set forth in the license. More details are available at Tesseract OCR License.

Detailed licensing information for these components is included within the software distribution.

Qt Application Framework

This application uses the Qt application framework, which is a comprehensive C++ library for cross-platform development of GUI applications. Qt is used under the terms of the GNU Lesser General Public License (LGPL) version 3. Qt is a registered trademark of The Qt Company Ltd and is developed and maintained by The Qt Project and various c" + "ontributors.

For more information about Qt, including source code of Qt libraries used by this application and guidance on how to obtain or replace Qt libraries, please visit the Qt Project's official website at http://www.qt.io.

We are committed to ensuring compliance with the LGPL v3 license and support the principles of open source software development. If you have any questions or concerns regarding our use of Qt, please contact us directly.

Disclaimer of Warranty
ScoreSight is provided "AS IS", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall Roy Shilkrot be liable for any claim, damages, or other liability, whether in an action of contract, tort or otherwise, arising from, out of, or in connection " + "with the software or the use or other dealings in the software.

Contact Information
For support, feedback, or more information, please visit https://scoresight.live or contact us at info@scoresight.live.

", None)) # retranslateUi diff --git a/src/ui_connect_obs.py b/src/ui_connect_obs.py index c8257c8..4fceeb1 100644 --- a/src/ui_connect_obs.py +++ b/src/ui_connect_obs.py @@ -3,21 +3,14 @@ ################################################################################ ## Form generated from reading UI file 'connect_obs.ui' ## -## Created by: Qt User Interface Compiler version 6.7.3 +## Created by: Qt User Interface Compiler version 6.7.2 ## ## 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, QDialog, QFormLayout, QGridLayout, - QGroupBox, QLabel, QLineEdit, QPushButton, - QSizePolicy, QVBoxLayout, QWidget) +from PySide6.QtCore import * # type: ignore +from PySide6.QtGui import * # type: ignore +from PySide6.QtWidgets import * # type: ignore class Ui_Dialog(object): def setupUi(self, Dialog): diff --git a/src/ui_log_view.py b/src/ui_log_view.py index a394337..9edb215 100644 --- a/src/ui_log_view.py +++ b/src/ui_log_view.py @@ -3,21 +3,14 @@ ################################################################################ ## Form generated from reading UI file 'log_view.ui' ## -## Created by: Qt User Interface Compiler version 6.7.3 +## Created by: Qt User Interface Compiler version 6.7.2 ## ## 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 (QAbstractButton, QApplication, QCheckBox, QDialog, - QDialogButtonBox, QGridLayout, QHBoxLayout, QPushButton, - QScrollArea, QSizePolicy, QTextEdit, QWidget) +from PySide6.QtCore import * # type: ignore +from PySide6.QtGui import * # type: ignore +from PySide6.QtWidgets import * # type: ignore class Ui_Dialog(object): def setupUi(self, Dialog): diff --git a/src/ui_mainwindow.py b/src/ui_mainwindow.py index 1ac3264..1f46cb6 100644 --- a/src/ui_mainwindow.py +++ b/src/ui_mainwindow.py @@ -3,35 +3,25 @@ ################################################################################ ## Form generated from reading UI file 'mainwindow.ui' ## -## Created by: Qt User Interface Compiler version 6.7.3 +## Created by: Qt User Interface Compiler version 6.7.2 ## ## 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 (QAbstractItemView, QAbstractSpinBox, QApplication, QCheckBox, - QComboBox, QFormLayout, QFrame, QGridLayout, - QGroupBox, QHBoxLayout, QHeaderView, QLabel, - QLayout, QLineEdit, QMainWindow, QMenuBar, - QPushButton, QSizePolicy, QSlider, QSpacerItem, - QSpinBox, QTabWidget, QTableView, QTableWidget, - QTableWidgetItem, QToolButton, QVBoxLayout, QWidget) +from PySide6.QtCore import * # type: ignore +from PySide6.QtGui import * # type: ignore +from PySide6.QtWidgets import * # type: ignore class Ui_MainWindow(object): def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") - MainWindow.resize(963, 733) + MainWindow.resize(963, 718) self.centralwidget = QWidget(MainWindow) self.centralwidget.setObjectName(u"centralwidget") self.horizontalLayout_31 = QHBoxLayout(self.centralwidget) self.horizontalLayout_31.setObjectName(u"horizontalLayout_31") + self.horizontalLayout_31.setContentsMargins(-1, 0, -1, -1) self.frame = QFrame(self.centralwidget) self.frame.setObjectName(u"frame") sizePolicy = QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Preferred) @@ -42,9 +32,9 @@ def setupUi(self, MainWindow): self.frame.setFrameShape(QFrame.StyledPanel) self.frame.setFrameShadow(QFrame.Plain) self.frame.setLineWidth(0) - self.verticalLayout = QVBoxLayout(self.frame) - self.verticalLayout.setSpacing(3) - self.verticalLayout.setObjectName(u"verticalLayout") + self._2 = QVBoxLayout(self.frame) + self._2.setSpacing(3) + self._2.setObjectName(u"_2") self.groupBox_sb_info = QWidget(self.frame) self.groupBox_sb_info.setObjectName(u"groupBox_sb_info") self.groupBox_sb_info.setEnabled(False) @@ -473,7 +463,7 @@ def setupUi(self, MainWindow): self.verticalLayout_3.addWidget(self.widget_6) - self.verticalLayout.addWidget(self.groupBox_sb_info) + self._2.addWidget(self.groupBox_sb_info) self.line_2 = QFrame(self.frame) self.line_2.setObjectName(u"line_2") @@ -481,7 +471,7 @@ def setupUi(self, MainWindow): self.line_2.setFrameShape(QFrame.Shape.HLine) self.line_2.setFrameShadow(QFrame.Shadow.Sunken) - self.verticalLayout.addWidget(self.line_2) + self._2.addWidget(self.line_2) self.tabWidget_outputs = QTabWidget(self.frame) self.tabWidget_outputs.setObjectName(u"tabWidget_outputs") @@ -730,10 +720,13 @@ def setupUi(self, MainWindow): self.tab_uno.setObjectName(u"tab_uno") self.gridLayout_5 = QGridLayout(self.tab_uno) self.gridLayout_5.setObjectName(u"gridLayout_5") - self.verticalLayout_8 = QVBoxLayout() + self.widget_uno_props = QWidget(self.tab_uno) + self.widget_uno_props.setObjectName(u"widget_uno_props") + self.verticalLayout_8 = QVBoxLayout(self.widget_uno_props) + self.verticalLayout_8.setSpacing(0) self.verticalLayout_8.setObjectName(u"verticalLayout_8") self.verticalLayout_8.setContentsMargins(0, 0, 0, 0) - self.connectionWidget_2 = QWidget(self.tab_uno) + self.connectionWidget_2 = QWidget(self.widget_uno_props) self.connectionWidget_2.setObjectName(u"connectionWidget_2") self.horizontalLayout_29 = QHBoxLayout(self.connectionWidget_2) self.horizontalLayout_29.setSpacing(3) @@ -758,7 +751,7 @@ def setupUi(self, MainWindow): self.verticalLayout_8.addWidget(self.connectionWidget_2) - self.widget_26 = QWidget(self.tab_uno) + self.widget_26 = QWidget(self.widget_uno_props) self.widget_26.setObjectName(u"widget_26") self.widget_26.setMinimumSize(QSize(0, 0)) self.horizontalLayout_30 = QHBoxLayout(self.widget_26) @@ -766,9 +759,18 @@ def setupUi(self, MainWindow): self.horizontalLayout_30.setContentsMargins(0, 5, 0, 5) self.checkBox_uno_send_same = QCheckBox(self.widget_26) self.checkBox_uno_send_same.setObjectName(u"checkBox_uno_send_same") + sizePolicy2.setHeightForWidth(self.checkBox_uno_send_same.sizePolicy().hasHeightForWidth()) + self.checkBox_uno_send_same.setSizePolicy(sizePolicy2) self.horizontalLayout_30.addWidget(self.checkBox_uno_send_same) + self.checkBox_uno_essentials = QCheckBox(self.widget_26) + self.checkBox_uno_essentials.setObjectName(u"checkBox_uno_essentials") + sizePolicy2.setHeightForWidth(self.checkBox_uno_essentials.sizePolicy().hasHeightForWidth()) + self.checkBox_uno_essentials.setSizePolicy(sizePolicy2) + + self.horizontalLayout_30.addWidget(self.checkBox_uno_essentials) + self.label_23 = QLabel(self.widget_26) self.label_23.setObjectName(u"label_23") sizePolicy.setHeightForWidth(self.label_23.sizePolicy().hasHeightForWidth()) @@ -787,15 +789,37 @@ def setupUi(self, MainWindow): self.verticalLayout_8.addWidget(self.widget_26) + self.widget_uno_essentials_details = QWidget(self.widget_uno_props) + self.widget_uno_essentials_details.setObjectName(u"widget_uno_essentials_details") + self.horizontalLayout_21 = QHBoxLayout(self.widget_uno_essentials_details) + self.horizontalLayout_21.setObjectName(u"horizontalLayout_21") + self.horizontalLayout_21.setContentsMargins(0, 0, 0, 0) + self.label_24 = QLabel(self.widget_uno_essentials_details) + self.label_24.setObjectName(u"label_24") + sizePolicy.setHeightForWidth(self.label_24.sizePolicy().hasHeightForWidth()) + self.label_24.setSizePolicy(sizePolicy) + + self.horizontalLayout_21.addWidget(self.label_24) + + self.lineEdit_uno_essentials_id = QLineEdit(self.widget_uno_essentials_details) + self.lineEdit_uno_essentials_id.setObjectName(u"lineEdit_uno_essentials_id") + sizePolicy5.setHeightForWidth(self.lineEdit_uno_essentials_id.sizePolicy().hasHeightForWidth()) + self.lineEdit_uno_essentials_id.setSizePolicy(sizePolicy5) + + self.horizontalLayout_21.addWidget(self.lineEdit_uno_essentials_id) + + + self.verticalLayout_8.addWidget(self.widget_uno_essentials_details) + - self.gridLayout_5.addLayout(self.verticalLayout_8, 0, 0, 1, 1) + self.gridLayout_5.addWidget(self.widget_uno_props, 0, 0, 1, 1) self.tableView_unoMapping = QTableView(self.tab_uno) self.tableView_unoMapping.setObjectName(u"tableView_unoMapping") self.tableView_unoMapping.horizontalHeader().setVisible(False) self.tableView_unoMapping.horizontalHeader().setStretchLastSection(True) - self.gridLayout_5.addWidget(self.tableView_unoMapping, 1, 0, 1, 1) + self.gridLayout_5.addWidget(self.tableView_unoMapping, 2, 0, 1, 1) self.tabWidget_outputs.addTab(self.tab_uno, "") self.tab_api = QWidget() @@ -857,14 +881,14 @@ def setupUi(self, MainWindow): self.tabWidget_outputs.addTab(self.tab_api, "") - self.verticalLayout.addWidget(self.tabWidget_outputs, 0, Qt.AlignTop) + self._2.addWidget(self.tabWidget_outputs, 0, Qt.AlignTop) self.pushButton_stopUpdates = QPushButton(self.frame) self.pushButton_stopUpdates.setObjectName(u"pushButton_stopUpdates") self.pushButton_stopUpdates.setMinimumSize(QSize(0, 0)) self.pushButton_stopUpdates.setCheckable(True) - self.verticalLayout.addWidget(self.pushButton_stopUpdates) + self._2.addWidget(self.pushButton_stopUpdates) self.widget_detectionCadence = QWidget(self.frame) self.widget_detectionCadence.setObjectName(u"widget_detectionCadence") @@ -897,7 +921,7 @@ def setupUi(self, MainWindow): self.horizontalLayout_9.addWidget(self.checkBox_updateOnchange) - self.verticalLayout.addWidget(self.widget_detectionCadence) + self._2.addWidget(self.widget_detectionCadence) self.horizontalLayout_31.addWidget(self.frame) @@ -912,10 +936,9 @@ def setupUi(self, MainWindow): self.frame_source_view.setSizePolicy(sizePolicy6) self.frame_source_view.setFrameShape(QFrame.StyledPanel) self.frame_source_view.setFrameShadow(QFrame.Raised) - self.verticalLayout_2 = QVBoxLayout(self.frame_source_view) - self.verticalLayout_2.setSpacing(0) - self.verticalLayout_2.setObjectName(u"verticalLayout_2") - self.verticalLayout_2.setContentsMargins(-1, 6, -1, -1) + self._3 = QVBoxLayout(self.frame_source_view) + self._3.setSpacing(0) + self._3.setObjectName(u"_3") self.widget_4 = QWidget(self.frame_source_view) self.widget_4.setObjectName(u"widget_4") self.horizontalLayout_4 = QHBoxLayout(self.widget_4) @@ -974,7 +997,7 @@ def setupUi(self, MainWindow): self.horizontalLayout_4.addWidget(self.pushButton_saveOCRTrainingData) - self.verticalLayout_2.addWidget(self.widget_4) + self._3.addWidget(self.widget_4) self.widget_viewTools = QWidget(self.frame_source_view) self.widget_viewTools.setObjectName(u"widget_viewTools") @@ -1044,7 +1067,7 @@ def setupUi(self, MainWindow): self.horizontalLayout_10.addWidget(self.label_11) - self.verticalLayout_2.addWidget(self.widget_viewTools) + self._3.addWidget(self.widget_viewTools) self.widget_cropPanel = QWidget(self.frame_source_view) self.widget_cropPanel.setObjectName(u"widget_cropPanel") @@ -1123,7 +1146,7 @@ def setupUi(self, MainWindow): self.horizontalLayout_26.addItem(self.horizontalSpacer_4) - self.verticalLayout_2.addWidget(self.widget_cropPanel) + self._3.addWidget(self.widget_cropPanel) self.frame_for_source_view_label = QFrame(self.frame_source_view) self.frame_for_source_view_label.setObjectName(u"frame_for_source_view_label") @@ -1146,7 +1169,7 @@ def setupUi(self, MainWindow): self.gridLayout.addWidget(self.label_12, 0, 0, 1, 1) - self.verticalLayout_2.addWidget(self.frame_for_source_view_label) + self._3.addWidget(self.frame_for_source_view_label) self.horizontalLayout_31.addWidget(self.frame_source_view) @@ -1154,7 +1177,6 @@ def setupUi(self, MainWindow): MainWindow.setCentralWidget(self.centralwidget) self.menubar = QMenuBar(MainWindow) self.menubar.setObjectName(u"menubar") - self.menubar.setGeometry(QRect(0, 0, 963, 21)) MainWindow.setMenuBar(self.menubar) self.retranslateUi(MainWindow) @@ -1280,8 +1302,12 @@ def retranslateUi(self, MainWindow): self.checkBox_uno_send_same.setToolTip(QCoreApplication.translate("MainWindow", u"Send only new detections or also existing?", None)) #endif // QT_CONFIG(tooltip) self.checkBox_uno_send_same.setText(QCoreApplication.translate("MainWindow", u"Send Same?", None)) + self.checkBox_uno_essentials.setText(QCoreApplication.translate("MainWindow", u"Essentials", None)) self.label_23.setText(QCoreApplication.translate("MainWindow", u"Rate Limit", None)) - self.spinBox.setSuffix(QCoreApplication.translate("MainWindow", u"/second", None)) + self.spinBox.setSuffix(QCoreApplication.translate("MainWindow", u"/sec", None)) + self.label_24.setText(QCoreApplication.translate("MainWindow", u"Overlay ID", None)) + self.lineEdit_uno_essentials_id.setText("") + self.lineEdit_uno_essentials_id.setPlaceholderText(QCoreApplication.translate("MainWindow", u"aaaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeeee", None)) self.tabWidget_outputs.setTabText(self.tabWidget_outputs.indexOf(self.tab_uno), QCoreApplication.translate("MainWindow", u"UNO", None)) self.checkBox_enableOutAPI.setText(QCoreApplication.translate("MainWindow", u"Send out API requests to external services.", None)) self.label_21.setText(QCoreApplication.translate("MainWindow", u"Encode", None)) diff --git a/src/ui_ocr_training_data_dialog.py b/src/ui_ocr_training_data_dialog.py index fd034fe..62255e1 100644 --- a/src/ui_ocr_training_data_dialog.py +++ b/src/ui_ocr_training_data_dialog.py @@ -3,22 +3,14 @@ ################################################################################ ## Form generated from reading UI file 'ocr_training_data_dialog.ui' ## -## Created by: Qt User Interface Compiler version 6.7.3 +## Created by: Qt User Interface Compiler version 6.7.2 ## ## 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 (QAbstractButton, QApplication, QDialog, QDialogButtonBox, - QFormLayout, QGridLayout, QHBoxLayout, QLabel, - QLineEdit, QPushButton, QSizePolicy, QSpacerItem, - QSpinBox, QToolButton, QWidget) +from PySide6.QtCore import * # type: ignore +from PySide6.QtGui import * # type: ignore +from PySide6.QtWidgets import * # type: ignore class Ui_OCRTrainingDataDialog(object): def setupUi(self, OCRTrainingDataDialog): diff --git a/src/ui_screen_capture.py b/src/ui_screen_capture.py index 8b6b8f8..fe89951 100644 --- a/src/ui_screen_capture.py +++ b/src/ui_screen_capture.py @@ -3,21 +3,14 @@ ################################################################################ ## Form generated from reading UI file 'screen_capture.ui' ## -## Created by: Qt User Interface Compiler version 6.7.3 +## Created by: Qt User Interface Compiler version 6.7.2 ## ## 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 (QAbstractButton, QApplication, QComboBox, QDialog, - QDialogButtonBox, QFormLayout, QGridLayout, QLabel, - QSizePolicy, QWidget) +from PySide6.QtCore import * # type: ignore +from PySide6.QtGui import * # type: ignore +from PySide6.QtWidgets import * # type: ignore class Ui_Dialog(object): def setupUi(self, Dialog): diff --git a/src/ui_training_dojo.py b/src/ui_training_dojo.py index 8a33747..3c2c60f 100644 --- a/src/ui_training_dojo.py +++ b/src/ui_training_dojo.py @@ -3,21 +3,14 @@ ################################################################################ ## Form generated from reading UI file 'training_dojo.ui' ## -## Created by: Qt User Interface Compiler version 6.7.3 +## Created by: Qt User Interface Compiler version 6.7.2 ## ## 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, QDialog, QGridLayout, QHBoxLayout, - QLabel, QLineEdit, QListWidget, QListWidgetItem, - QPushButton, QSizePolicy, QVBoxLayout, QWidget) +from PySide6.QtCore import * # type: ignore +from PySide6.QtGui import * # type: ignore +from PySide6.QtWidgets import * # type: ignore class Ui_TrainingDojo(object): def setupUi(self, TrainingDojo): diff --git a/src/ui_update_available.py b/src/ui_update_available.py index ea07231..8b03abd 100644 --- a/src/ui_update_available.py +++ b/src/ui_update_available.py @@ -3,21 +3,14 @@ ################################################################################ ## Form generated from reading UI file 'update_available.ui' ## -## Created by: Qt User Interface Compiler version 6.7.3 +## Created by: Qt User Interface Compiler version 6.7.2 ## ## 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 (QAbstractButton, QApplication, QCheckBox, QDialog, - QDialogButtonBox, QFrame, QGridLayout, QLabel, - QSizePolicy, QWidget) +from PySide6.QtCore import * # type: ignore +from PySide6.QtGui import * # type: ignore +from PySide6.QtWidgets import * # type: ignore class Ui_Dialog(object): def setupUi(self, Dialog): diff --git a/src/ui_url_source.py b/src/ui_url_source.py index a7d418f..01bae77 100644 --- a/src/ui_url_source.py +++ b/src/ui_url_source.py @@ -3,20 +3,14 @@ ################################################################################ ## Form generated from reading UI file 'url_source.ui' ## -## Created by: Qt User Interface Compiler version 6.7.3 +## Created by: Qt User Interface Compiler version 6.7.2 ## ## 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 (QAbstractButton, QApplication, QDialog, QDialogButtonBox, - QLineEdit, QSizePolicy, QVBoxLayout, QWidget) +from PySide6.QtCore import * # type: ignore +from PySide6.QtGui import * # type: ignore +from PySide6.QtWidgets import * # type: ignore class Ui_Dialog(object): def setupUi(self, Dialog): diff --git a/src/ui_video_settings.py b/src/ui_video_settings.py index 80eadba..e837bd1 100644 --- a/src/ui_video_settings.py +++ b/src/ui_video_settings.py @@ -3,21 +3,14 @@ ################################################################################ ## Form generated from reading UI file 'video_settings.ui' ## -## Created by: Qt User Interface Compiler version 6.7.3 +## Created by: Qt User Interface Compiler version 6.7.2 ## ## 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 (QAbstractButton, QApplication, QComboBox, QDialog, - QDialogButtonBox, QFormLayout, QGridLayout, QLabel, - QPlainTextEdit, QSizePolicy, QSpinBox, QWidget) +from PySide6.QtCore import * # type: ignore +from PySide6.QtGui import * # type: ignore +from PySide6.QtWidgets import * # type: ignore class Ui_Dialog(object): def setupUi(self, Dialog): diff --git a/src/uno_output.py b/src/uno_output.py index 91ae8ff..548eba8 100644 --- a/src/uno_output.py +++ b/src/uno_output.py @@ -11,10 +11,22 @@ def __init__(self, endpoint, field_mapping): self.running = False self.update_same = fetch_data("scoresight.json", "uno_send_same", False) subscribe_to_data("scoresight.json", "uno_send_same", self.set_update_same) + self.essentials = fetch_data("scoresight.json", "uno_essentials", False) + subscribe_to_data("scoresight.json", "uno_essentials", self.set_essentials) + self.uno_essentials_id = fetch_data("scoresight.json", "uno_essentials_id", "") + subscribe_to_data( + "scoresight.json", "uno_essentials_id", self.set_uno_essentials_id + ) def set_update_same(self, update_same): self.update_same = update_same + def set_essentials(self, essentials): + self.essentials = essentials + + def set_uno_essentials_id(self, uno_essentials_id): + self.uno_essentials_id = uno_essentials_id + def set_field_mapping(self, field_mapping): logger.debug(f"Setting UNO field mapping: {field_mapping}") self.field_mapping = field_mapping @@ -37,7 +49,15 @@ def update_uno(self, detection: list[TextDetectionTargetWithResult]): self.send_uno_command(uno_command, target.result) def send_uno_command(self, command, value): - payload = {"command": command, "value": value} + if not self.essentials: + payload = {"command": command, "value": value} + else: + payload = { + "command": "SetOverlayContentField", + "value": value, + "fieldId": command, + "id": self.uno_essentials_id, + } try: response = requests.put(self.endpoint, json=payload) diff --git a/src/uno_ui_handler.py b/src/uno_ui_handler.py index 984f527..4b870cb 100644 --- a/src/uno_ui_handler.py +++ b/src/uno_ui_handler.py @@ -1,3 +1,4 @@ +from functools import partial from PySide6.QtGui import QStandardItemModel, QStandardItem from PySide6.QtCore import Qt @@ -78,7 +79,31 @@ def unoUiSetup(self): self.ui.checkBox_uno_send_same.setChecked( fetch_data("scoresight.json", "uno_send_same", False) ) - self.ui.checkBox_uno_send_same.stateChanged.connect(self.unoSendSameChanged) + self.ui.checkBox_uno_send_same.stateChanged.connect( + partial(self.globalSettingsChanged, "uno_send_same") + ) + + # connect the "essentials" checkbox + self.ui.checkBox_uno_essentials.setChecked( + fetch_data("scoresight.json", "uno_essentials", False) + ) + self.ui.checkBox_uno_essentials.stateChanged.connect(self.set_uno_essentials) + # show/ hide widget_uno_essentials_details based on the checkbox + self.ui.widget_uno_essentials_details.setVisible( + self.ui.checkBox_uno_essentials.isChecked() + ) + + # connect lineEdit_uno_essentials_id + self.ui.lineEdit_uno_essentials_id.setText( + fetch_data("scoresight.json", "uno_essentials_id", "") + ) + self.ui.lineEdit_uno_essentials_id.textChanged.connect( + partial(self.globalSettingsChanged, "uno_essentials_id") + ) + + def set_uno_essentials(self, value): + self.globalSettingsChanged("uno_essentials", value) + self.ui.widget_uno_essentials_details.setVisible(value) def toggleUNO(self, value): if not self.unoUpdater: @@ -90,9 +115,6 @@ def toggleUNO(self, value): self.ui.toolButton_toggleUno.setText("▶️") self.unoUpdater.stop() - def unoSendSameChanged(self, state): - self.globalSettingsChanged("uno_send_same", state == Qt.Checked) - def updateUNOTable(self, detectionTargets: list[TextDetectionTarget]): mapping_storage = fetch_data("scoresight.json", "uno_mapping") model = QStandardItemModel()