wip: arcaea-offline==0.2.0

This commit is contained in:
2023-09-01 04:01:14 +08:00
parent a9d2b5f75d
commit ecd4ed619e
8 changed files with 40 additions and 30 deletions

View File

@ -105,10 +105,10 @@ class ScoreEditor(Ui_ScoreEditor, QWidget):
def setLimits(self, chart: Chart):
self.setMinimums()
self.pureSpinBox.setMaximum(chart.note)
self.farSpinBox.setMaximum(chart.note)
self.lostSpinBox.setMaximum(chart.note)
self.maxRecallSpinBox.setMaximum(chart.note)
self.pureSpinBox.setMaximum(chart.notes)
self.farSpinBox.setMaximum(chart.notes)
self.lostSpinBox.setMaximum(chart.notes)
self.maxRecallSpinBox.setMaximum(chart.notes)
def resetLimits(self):
self.setMinimums()
@ -132,9 +132,9 @@ class ScoreEditor(Ui_ScoreEditor, QWidget):
score = self.value()
score_range = calculate_score_range(self.__chart.note, score.pure, score.far)
score_range = calculate_score_range(self.__chart.notes, score.pure, score.far)
score_in_range = score_range[0] <= score.score <= score_range[1]
note_in_range = score.pure + score.far + score.lost <= self.__chart.note
note_in_range = score.pure + score.far + score.lost <= self.__chart.notes
if not score_in_range or not note_in_range:
return ScoreValidateResult.ScoreMismatch
if score.score == 0:
@ -170,7 +170,6 @@ class ScoreEditor(Ui_ScoreEditor, QWidget):
max_recall=self.maxRecallSpinBox.value()
if self.maxRecallSpinBox.value() > -1
else None,
r10_clear_type=None,
)
def setValue(self, score: Score):
@ -184,8 +183,6 @@ class ScoreEditor(Ui_ScoreEditor, QWidget):
self.dateTimeEdit.setDateTime(QDateTime.fromSecsSinceEpoch(score.date))
if score.max_recall is not None:
self.maxRecallSpinBox.setValue(score.max_recall)
if score.r10_clear_type is not None:
self.clearTypeComboBox.setCurrentIndex(score.r10_clear_type)
def reset(self):
self.setChart(None)

View File

@ -14,10 +14,7 @@ from ui.designer.tabs.tabOcr.tabOcr_B30_ui import Ui_TabOcr_B30
from ui.extends.components.ocrQueue import OcrQueueModel
from ui.extends.shared.cv2_utils import cv2BgrMatToQImage, qImageToCvMatBgr
from ui.extends.shared.settings import Settings
from ui.extends.tabs.tabOcr.tabOcr_B30 import (
ChieriV4OcrRunnable,
b30ResultToScoreInsert,
)
from ui.extends.tabs.tabOcr.tabOcr_B30 import ChieriV4OcrRunnable, b30ResultToScore
logger = logging.getLogger(__name__)
@ -161,7 +158,7 @@ class TabOcr_B30(Ui_TabOcr_B30, QWidget):
self.ocrQueueModel.setData(index, runnable, OcrQueueModel.OcrRunnableRole)
self.ocrQueueModel.setData(
index,
b30ResultToScoreInsert,
b30ResultToScore,
OcrQueueModel.ProcessOcrResultFuncRole,
)
self.ocrQueueModel.startQueue()