Beispiel #1
0
 def guess_good(self, good_id):
     '''
     按住货物,探测绿光出现的位置
     这一段应该用numpy来实现,奈何我对numpy不熟。。。
     '''
     diff_screens = self.get_screenshot_while_touching(GOODS_POSITIONS[good_id]) 
     return UIMatcher.findGreenLight(diff_screens)
 def _DeterminePos_Android(self, pos, pressed_time=0.2):
     screen_before = self._Sshot()
     x, y = self._pos_good[pos]
     x, y = (x * self.dWidth, y * self.dHeight)
     self.d.touch.down(x, y)
     time.sleep(pressed_time)
     screen_after = self._Sshot()
     self.d.touch.up(x, y)
     diff_screens = (screen_before, screen_after)
     result = UIMatcher.findGreenLight(diff_screens, self.pos)
     return result