wip: DeviceV2 ocr support

This commit is contained in:
2023-08-15 15:33:11 +08:00
parent 0126ce6b9a
commit 044a8eb07a
5 changed files with 335 additions and 168 deletions

View File

@ -16,7 +16,7 @@ from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QGroupBox, QHBoxLayout, QPushButton,
QSizePolicy, QVBoxLayout, QWidget)
QSizePolicy, QStackedWidget, QVBoxLayout, QWidget)
from ui.implements.components import (DevicesComboBox, FileSelector, OcrQueue)
@ -50,7 +50,36 @@ class Ui_TabOcr(object):
self.verticalLayout_3.addWidget(self.groupBox)
self.groupBox_4 = QGroupBox(TabOcr)
self.horizontalWidget = QWidget(TabOcr)
self.horizontalWidget.setObjectName(u"horizontalWidget")
sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Maximum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.horizontalWidget.sizePolicy().hasHeightForWidth())
self.horizontalWidget.setSizePolicy(sizePolicy)
self.horizontalLayout_2 = QHBoxLayout(self.horizontalWidget)
self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
self.groupBox_6 = QGroupBox(self.horizontalWidget)
self.groupBox_6.setObjectName(u"groupBox_6")
self.verticalLayout_6 = QVBoxLayout(self.groupBox_6)
self.verticalLayout_6.setObjectName(u"verticalLayout_6")
self.knnModelSelector = FileSelector(self.groupBox_6)
self.knnModelSelector.setObjectName(u"knnModelSelector")
self.verticalLayout_6.addWidget(self.knnModelSelector)
self.horizontalLayout_2.addWidget(self.groupBox_6)
self.deviceDependenciesStackedWidget = QStackedWidget(self.horizontalWidget)
self.deviceDependenciesStackedWidget.setObjectName(u"deviceDependenciesStackedWidget")
self.deviceV1 = QWidget()
self.deviceV1.setObjectName(u"deviceV1")
self.verticalLayout_2 = QVBoxLayout(self.deviceV1)
self.verticalLayout_2.setObjectName(u"verticalLayout_2")
self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
self.groupBox_4 = QGroupBox(self.deviceV1)
self.groupBox_4.setObjectName(u"groupBox_4")
self.verticalLayout_5 = QVBoxLayout(self.groupBox_4)
self.verticalLayout_5.setObjectName(u"verticalLayout_5")
@ -60,10 +89,40 @@ class Ui_TabOcr(object):
self.verticalLayout_5.addWidget(self.tesseractFileSelector)
self.verticalLayout_3.addWidget(self.groupBox_4)
self.verticalLayout_2.addWidget(self.groupBox_4)
self.deviceDependenciesStackedWidget.addWidget(self.deviceV1)
self.deviceV2 = QWidget()
self.deviceV2.setObjectName(u"deviceV2")
self.verticalLayout_4 = QVBoxLayout(self.deviceV2)
self.verticalLayout_4.setObjectName(u"verticalLayout_4")
self.verticalLayout_4.setContentsMargins(0, 0, 0, 0)
self.groupBox_5 = QGroupBox(self.deviceV2)
self.groupBox_5.setObjectName(u"groupBox_5")
self.verticalLayout_7 = QVBoxLayout(self.groupBox_5)
self.verticalLayout_7.setObjectName(u"verticalLayout_7")
self.siftDatabaseSelector = FileSelector(self.groupBox_5)
self.siftDatabaseSelector.setObjectName(u"siftDatabaseSelector")
self.verticalLayout_7.addWidget(self.siftDatabaseSelector)
self.verticalLayout_4.addWidget(self.groupBox_5)
self.deviceDependenciesStackedWidget.addWidget(self.deviceV2)
self.horizontalLayout_2.addWidget(self.deviceDependenciesStackedWidget)
self.verticalLayout_3.addWidget(self.horizontalWidget)
self.groupBox_2 = QGroupBox(TabOcr)
self.groupBox_2.setObjectName(u"groupBox_2")
sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding)
sizePolicy1.setHorizontalStretch(0)
sizePolicy1.setVerticalStretch(0)
sizePolicy1.setHeightForWidth(self.groupBox_2.sizePolicy().hasHeightForWidth())
self.groupBox_2.setSizePolicy(sizePolicy1)
self.horizontalLayout = QHBoxLayout(self.groupBox_2)
self.horizontalLayout.setObjectName(u"horizontalLayout")
self.ocrQueue = OcrQueue(self.groupBox_2)
@ -77,13 +136,18 @@ class Ui_TabOcr(object):
self.retranslateUi(TabOcr)
self.deviceDependenciesStackedWidget.setCurrentIndex(0)
QMetaObject.connectSlotsByName(TabOcr)
# setupUi
def retranslateUi(self, TabOcr):
self.openWizardButton.setText(QCoreApplication.translate("TabOcr", u"openWizardButton", None))
self.groupBox.setTitle(QCoreApplication.translate("TabOcr", u"deviceSelector.title", None))
self.groupBox_6.setTitle(QCoreApplication.translate("TabOcr", u"knnModelSelector.title", None))
self.groupBox_4.setTitle(QCoreApplication.translate("TabOcr", u"tesseractSelector.title", None))
self.groupBox_5.setTitle(QCoreApplication.translate("TabOcr", u"siftDatabaseSelector.title", None))
self.groupBox_2.setTitle(QCoreApplication.translate("TabOcr", u"ocr.title", None))
pass
# retranslateUi