示例#1
0
 def drag(self, title, text, x1, y1, x2, y2):
     '''
     :description 执行鼠标拖拽操作
     '''
     pos = autoit.win_get_pos(title, text=text)
     autoit.mouse_click_drag(x1 + pos[0], y1 + pos[1], x2 + pos[0],
                             y2 + pos[1])
示例#2
0
def extract_rr(filename):
    pid = autoit.run("C:/Program Files/Kubios/Kubios HRV Standard/kubioshrv.exe")
    
    # wait until screen is loaded
    assert autoit.win_wait_active(f"[TITLE:{kubios_title}]", 30)
    time.sleep(0.25)
    
    # get position and click menu->open
    x, y, _, _ = autoit.win_get_pos(f"[TITLE:{kubios_title}]")
    assert autoit.mouse_click(x=x+20, y=y+50, speed=10)
    time.sleep(0.5)
    assert autoit.mouse_click(x=x+20, y=y+70, speed=10)
    
    # wait for loading of file input screen
    assert autoit.win_wait_active(f"[TITLE:{title_open}]", 30)
    time.sleep(0.25)
    assert autoit.control_send(f"[TITLE:{title_open}]", "[CLASS:Edit]", filename)
    time.sleep(0.25)
    assert autoit.control_click(f"[TITLE:{title_open}]", "[CLASS:Button; INSTANCE:1]")
    time.sleep(1)
    
    # check if there was an error (if Open Data File is still there)
    assert not autoit.win_active(f"[TITLE:{title_open}]"), 'Failed to load!'
    
    assert os.system(f"taskkill /PID {pid} /F")==0
 def click1(cls, title, text, x, y, button="", clicks=1):
     """
     :description 执行鼠标点击操作
     :return:
     """
     # 使用相对坐标的情况
     pos = autoit.win_get_pos(title, text=text)
     autoit.mouse_click(button, x + pos[0], y + pos[1], clicks=clicks)
 def right_click_native(self, window_name, x, y):
     """ Click the left mouse button on a screen location
         Example:
         | Left Click Native | 320 | 240 |
     """
     logger.debug("Setting native cursor position to {0},{1}".format(x, y))
     logger.debug("Clicking right button")
     left, top, right, bottom = autoit.win_get_pos(window_name)
     autoit.mouse_move(left + x, top + y)
     autoit.mouse_click(button="right", x=left + x, y=top + y)
示例#5
0
	def click(self, title, text, x, y, button="main", clicks=1):
		"""鼠标点击"""
		pos = autoit.win_get_pos(title, text=text)
		'''
		win_get_pos()为获取指定窗口的坐标位置和大小
		[0]X坐标
		[1]Y坐标
		[2]宽度
		[3]高度
		'''
		#autoit.mouse_click(button, x + pos[0], y + pos[1], clicks=clicks)
		autoit.mouse_click(button, x, y, clicks=clicks)
示例#6
0
 def getPos(self):
     '''
     :description 获取指定窗口的坐标位置和大小等属性.
     :return Returns left, top, right, bottom    (x1,y1,x2,y2)
     '''
     return autoit.win_get_pos(self.title, text=self.text)
示例#7
0
 def move(self, title, text, x, y):
     '''
     :description 移动鼠标指针
     '''
     pos = autoit.win_get_pos(title, text=text)
     autoit.mouse_move(x + pos[0], y + pos[1])
示例#8
0
 def click(self, title, text, x, y, button="main", clicks=1):
     '''
     :description 执行鼠标点击操作
     '''
     pos = autoit.win_get_pos(title, text=text)
     autoit.mouse_click(button, x + pos[0], y + pos[1], clicks=clicks)
示例#9
0
	def getPos(self):
		"""获取指定窗口的坐标位置和大小"""
		return autoit.win_get_pos(self.title, text=self.text)
示例#10
0
	def drag(self, title, text, x1, y1,x2, y2):
		"""鼠标拖拽"""
		pos = autoit.win_get_pos(title, text=text)
		autoit.mouse_click_drag(x1, y1, x2, y2)
示例#11
0
	def move(self, title, text, x, y):
		"""移动鼠标指针"""
		pos = autoit.win_get_pos(title, text=text)
		#autoit.mouse_move(x + pos[0], y + [pos][1])
		autoit.mouse_move(x, y)
示例#12
0
def move_to_initial_position(win_name='ASPy'):
    left_upper_corner = autoit.win_get_pos(win_name)
    pyautogui.moveTo(left_upper_corner[0] + 272, left_upper_corner[1] + 298)