From c70d1622ec2e95945e337d29ef31b64bbf50328c Mon Sep 17 00:00:00 2001 From: Zebartin <16185081+Zebartin@users.noreply.github.com> Date: Wed, 27 Sep 2023 12:52:37 +0800 Subject: [PATCH] Opt: Log of AssignmentStatus --- tasks/assignment/ui.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tasks/assignment/ui.py b/tasks/assignment/ui.py index d184c2d5b..1b8400bb3 100644 --- a/tasks/assignment/ui.py +++ b/tasks/assignment/ui.py @@ -217,6 +217,7 @@ class AssignmentUI(UI): def _check_assignment_status(self) -> AssignmentStatus: skip_first_screenshot = True timeout = Timer(2, count=3).start() + ret = AssignmentStatus.LOCKED while 1: if skip_first_screenshot: skip_first_screenshot = False @@ -229,12 +230,16 @@ class AssignmentUI(UI): ) break if self.appear(CLAIM): - return AssignmentStatus.CLAIMABLE + ret = AssignmentStatus.CLAIMABLE + break if self.appear(DISPATCHED): - return AssignmentStatus.DISPATCHED + ret = AssignmentStatus.DISPATCHED + break if self.appear(EMPTY_SLOT): - return AssignmentStatus.DISPATCHABLE - return AssignmentStatus.LOCKED + ret = AssignmentStatus.DISPATCHABLE + break + logger.attr('AssignmentStatus', ret.name) + return ret def _get_assignment_time(self) -> timedelta: return Duration(OCR_ASSIGNMENT_TIME).ocr_single_line(self.device.image)