diff --git a/assets/cn/assignment/claim/REPORT.png b/assets/cn/assignment/claim/REPORT.png new file mode 100644 index 000000000..2517443e9 Binary files /dev/null and b/assets/cn/assignment/claim/REPORT.png differ diff --git a/assets/en/assignment/claim/REPORT.png b/assets/en/assignment/claim/REPORT.png new file mode 100644 index 000000000..780e6bbaa Binary files /dev/null and b/assets/en/assignment/claim/REPORT.png differ diff --git a/assets/share/assignment/claim/REPORT.png b/assets/share/assignment/claim/REPORT.png deleted file mode 100644 index 8351c9a92..000000000 Binary files a/assets/share/assignment/claim/REPORT.png and /dev/null differ diff --git a/assets/share/assignment/ui/LOCKED.png b/assets/share/assignment/ui/LOCKED.png deleted file mode 100644 index 47a2fbb0f..000000000 Binary files a/assets/share/assignment/ui/LOCKED.png and /dev/null differ diff --git a/tasks/assignment/assets/assets_assignment_claim.py b/tasks/assignment/assets/assets_assignment_claim.py index fc395f5d1..7ca249749 100644 --- a/tasks/assignment/assets/assets_assignment_claim.py +++ b/tasks/assignment/assets/assets_assignment_claim.py @@ -45,11 +45,18 @@ REDISPATCH = ButtonWrapper( ) REPORT = ButtonWrapper( name='REPORT', - share=Button( - file='./assets/share/assignment/claim/REPORT.png', - area=(0, 154, 266, 542), - search=(0, 134, 286, 562), - color=(33, 34, 37), - button=(0, 154, 266, 542), + cn=Button( + file='./assets/cn/assignment/claim/REPORT.png', + area=(537, 80, 742, 128), + search=(517, 60, 762, 148), + color=(102, 90, 68), + button=(537, 80, 742, 128), + ), + en=Button( + file='./assets/en/assignment/claim/REPORT.png', + area=(393, 83, 885, 137), + search=(373, 63, 905, 157), + color=(71, 63, 49), + button=(393, 83, 885, 137), ), ) diff --git a/tasks/assignment/assets/assets_assignment_ui.py b/tasks/assignment/assets/assets_assignment_ui.py index be4d6683b..7eacff5b5 100644 --- a/tasks/assignment/assets/assets_assignment_ui.py +++ b/tasks/assignment/assets/assets_assignment_ui.py @@ -30,16 +30,6 @@ ENTRY_LOADED = ButtonWrapper( button=(467, 235, 498, 619), ), ) -LOCKED = ButtonWrapper( - name='LOCKED', - share=Button( - file='./assets/share/assignment/ui/LOCKED.png', - area=(1051, 480, 1237, 630), - search=(1031, 460, 1257, 650), - color=(53, 48, 40), - button=(1051, 480, 1237, 630), - ), -) OCR_ASSIGNMENT_ENTRY_LIST = ButtonWrapper( name='OCR_ASSIGNMENT_ENTRY_LIST', share=Button( diff --git a/tasks/assignment/assignment.py b/tasks/assignment/assignment.py index 445b4d9b1..9ba8e2b27 100644 --- a/tasks/assignment/assignment.py +++ b/tasks/assignment/assignment.py @@ -3,7 +3,7 @@ from datetime import datetime from module.logger import logger from tasks.assignment.assets.assets_assignment_claim import CLAIM from tasks.assignment.assets.assets_assignment_dispatch import EMPTY_SLOT -from tasks.assignment.assets.assets_assignment_ui import DISPATCHED, LOCKED +from tasks.assignment.assets.assets_assignment_ui import DISPATCHED from tasks.assignment.claim import AssignmentClaim from tasks.assignment.keywords import (KEYWORDS_ASSIGNMENT_GROUP, AssignmentEntry, AssignmentEventGroup) @@ -196,12 +196,13 @@ class Assignment(AssignmentClaim, SynthesizeUI): logger.hr('Assignment event', level=2) logger.info(f'Check assignment event: {assignment}') self.goto_entry(assignment) - if self.appear(LOCKED): - logger.info('Assignment is locked') - break + # No need to check dispatched here, should have been checked in _check_all if self.appear(EMPTY_SLOT): self.dispatch(assignment, None) remain -= 1 if remain <= 0: return remain + continue + logger.info('Assignment is locked') + break return remain diff --git a/tasks/assignment/claim.py b/tasks/assignment/claim.py index 6763653f9..297ab24eb 100644 --- a/tasks/assignment/claim.py +++ b/tasks/assignment/claim.py @@ -80,10 +80,8 @@ class AssignmentClaim(AssignmentDispatch): logger.info('Assignment report is closed') break # Close report - if self.appear_then_click(click_button, interval=2): - continue - # Only for EVENT assignments - if self.appear_then_click(REPORT, interval=2): + if self.appear(REPORT, interval=2): + self.device.click(click_button) continue def _is_duration_expected(self, duration: int) -> bool: