示例#1
0
    def _Move_good_IOS(self):
        goods = self._bd["gds"]
        for good in self.harvest_filter:
            img = UIMatcher.getLittleSquare(self._Sshot(),
                                            self._pos_good[good],
                                            scale=2)
            UIMatcher.saveScreen(img, good)

            for target in goods.keys():
                imageB = cv2.imread(target.value, 1)
                #msg("SSIM: {}  Target {}".format(score,str(target)))
                result = UIMatcher.find(img,
                                        imageB,
                                        criteria=diff_situation(good, target))

                if result:
                    msg(str(target) + " move to " + str(goods[target]))
                    position = self.pos[goods[target]]
                    #Pout(sx,sy,ex,ey)
                    self._move_good_by_id(good, position, times=4)
                    #self._drag(sx, sy, ex , ey,0.5)
                    break

            if not self._DEBUG:
                os.remove("s" + str(good) + ".png")
示例#2
0
 def _Test(self):
     for good in self.harvest_filter:
         img = UIMatcher.getLittleSquare(self._Sshot(),
                                         self._pos_good[good])
         UIMatcher.saveScreen(img, good)