huangrunheng 2 жил өмнө
parent
commit
7215fb5aaf

+ 8 - 1
tasks/Component/Costume/costume_base.py

@@ -57,11 +57,18 @@ main_costume_model = {
 realm_costume_model = {
     RealmType.COSTUME_REALM_1: {'I_SHI_CARD': 'I_SHI_CARD_1',
                                 'I_SHI_DEFENSE': 'I_SHI_DEFENSE_1',},
+    RealmType.COSTUME_REALM_2: {'I_SHI_CARD': 'I_SHI_CARD_2',
+                                'I_SHI_DEFENSE': 'I_SHI_DEFENSE_2',
+                                'I_SHI_GROWN': 'I_SHI_GROWN_2',
+                                'I_BOX_AP': 'I_BOX_AP_2',
+                                'I_BOX_EXP': 'I_BOX_EXP_2'},
 }
 
 class CostumeBase:
 
-    def check_costume(self, config: CostumeConfig):
+    def check_costume(self, config: CostumeConfig=None):
+        if config is None:
+            config: CostumeConfig = self.config.model.global_game.costume_config
         self.check_costume_main(config.costume_main_type)
         self.check_costume_realm(config.costume_realm_type)
 

+ 10 - 3
tasks/Component/Costume/costume_test_realm.py

@@ -7,6 +7,7 @@ from module.logger import logger
 from module.base.timer import Timer
 
 from tasks.KekkaiActivation.script_task import ScriptTask as KekkaiActivationScriptTask
+from tasks.Component.Costume.config import RealmType
 
 class ScriptTask(KekkaiActivationScriptTask):
 
@@ -42,12 +43,17 @@ class ScriptTask(KekkaiActivationScriptTask):
                 logger.info('Five seconds test over')
                 break
 
-        logger.info('--------------------------------------------------------')
-        logger.info('%-20s   %s' % ('Image', 'Count'))
+        print('--------------------------------------------------------')
+        print('%-20s   %s' % ('Image', 'Count'))
         for i in images_count:
-            logger.info('%-20s %3d times' % (i[0], i[1]))
+            print('%-20s %3d times' % (i[0], i[1]))
         logger.info('Test Done')
 
+    def set_costume(self, costume: RealmType=RealmType.COSTUME_REALM_DEFAULT):
+        self.config.model.global_game.costume_config.costume_realm_type = costume
+        self.check_costume()
+        logger.info('Set costume to %s' % self.config.model.global_game.costume_config.costume_realm_type)
+
 
 if __name__ == '__main__':
     from module.config.config import Config
@@ -56,6 +62,7 @@ if __name__ == '__main__':
     c = Config('oas1')
     d = Device(c)
     t = ScriptTask(c, d)
+    t.set_costume(RealmType.COSTUME_REALM_2)
     t.run()
 
 

+ 30 - 0
tasks/Component/CostumeRealm/README.md

@@ -0,0 +1,30 @@
+
+用于存放测试结果,但是这样也不是办法
+### 1
+```
+Image                  Count
+REALM_SHI_GROWN        4 times
+REALM1_SHI_CARD_1      5 times
+REALM1_SHI_DEFENSE_1   5 times
+REALM_REALM_SHIN       5 times
+REALM_CARD_EXP         5 times
+REALM_BOX_AP           5 times
+REALM_BOX_EXP          5 times
+REALM_BOX_EXP_MAX      0 times
+REALM_UTILIZE_EXP      0 times
+```
+
+### 2
+```
+Image                  Count
+REALM2_SHI_GROWN_2     4 times
+REALM2_SHI_CARD_2      5 times
+REALM2_SHI_DEFENSE_2   5 times
+REALM_REALM_SHIN       5 times
+REALM_CARD_EXP         5 times
+REALM2_BOX_AP_2        5 times
+REALM2_BOX_EXP_2       5 times
+REALM_BOX_EXP_MAX      0 times
+REALM_UTILIZE_EXP      0 times
+```
+

+ 13 - 0
tasks/Component/CostumeRealm/assets.py

@@ -17,3 +17,16 @@ class CostumeRealmAssets:
 	I_SHI_DEFENSE_1 = RuleImage(roi_front=(308,294,35,100), roi_back=(197,241,247,207), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm1/realm1_shi_defense_1.png")
 
 
+	# Image Rule Assets
+	# description 
+	I_SHI_GROWN_2 = RuleImage(roi_front=(663,344,36,68), roi_back=(598,280,159,186), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm2/realm2_shi_grown_2.png")
+	# description 
+	I_SHI_CARD_2 = RuleImage(roi_front=(934,351,36,43), roi_back=(903,318,100,100), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm2/realm2_shi_card_2.png")
+	# description 
+	I_SHI_DEFENSE_2 = RuleImage(roi_front=(369,365,33,100), roi_back=(285,315,178,188), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm2/realm2_shi_defense_2.png")
+	# description 
+	I_BOX_AP_2 = RuleImage(roi_front=(925,448,50,54), roi_back=(852,377,154,160), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm2/realm2_box_ap_2.png")
+	# description 
+	I_BOX_EXP_2 = RuleImage(roi_front=(991,448,41,59), roi_back=(921,372,155,173), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm2/realm2_box_exp_2.png")
+
+

+ 47 - 0
tasks/Component/CostumeRealm/realm2/image.json

@@ -0,0 +1,47 @@
+[
+  {
+    "itemName": "shi_grown_2",
+    "imageName": "realm2_shi_grown_2.png",
+    "roiFront": "663,344,36,68",
+    "roiBack": "598,280,159,186",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "shi_card_2",
+    "imageName": "realm2_shi_card_2.png",
+    "roiFront": "934,351,36,43",
+    "roiBack": "903,318,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "shi_defense_2",
+    "imageName": "realm2_shi_defense_2.png",
+    "roiFront": "369,365,33,100",
+    "roiBack": "285,315,178,188",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "box_ap_2",
+    "imageName": "realm2_box_ap_2.png",
+    "roiFront": "925,448,50,54",
+    "roiBack": "852,377,154,160",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "box_exp_2",
+    "imageName": "realm2_box_exp_2.png",
+    "roiFront": "991,448,41,59",
+    "roiBack": "921,372,155,173",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  }
+]

BIN
tasks/Component/CostumeRealm/realm2/realm2_box_ap_2.png


BIN
tasks/Component/CostumeRealm/realm2/realm2_box_exp_2.png


BIN
tasks/Component/CostumeRealm/realm2/realm2_shi_card_2.png


BIN
tasks/Component/CostumeRealm/realm2/realm2_shi_defense_2.png


BIN
tasks/Component/CostumeRealm/realm2/realm2_shi_grown_2.png