数据库代码抽离,增加影棚ID
This commit is contained in:
1 parent
7ac055e796
commit
abca8a3cfc
10 files changed
+527
-327
No files matched your search
+65
-12
@@ -22,29 +22,82 @@ def find_and_maximize_window(window_title):
|
||||
return pid, left, top, right, bottom
|
||||
return '0', 0, 0, 0, 0
|
||||
|
||||
# def get_defineDistances(pid, left, top, right, bottom):
|
||||
# psid = libs.getPSid(pid)
|
||||
# distances = config.ps_floor_sticker.get(psid, config.ps_floor_sticker['default'])
|
||||
# for index, d in enumerate(distances.split(';')):
|
||||
# p1, p2, distance = d.split(' ')
|
||||
# if index == 0:
|
||||
# ag.moveTo(left + 80, top + 290)
|
||||
# else:
|
||||
# ag.moveTo(left + 80, top + 290 + 15) # Create distance line height 15
|
||||
# ag.click()
|
||||
|
||||
# ag.moveTo(left + 302, (bottom - 100)) # A point
|
||||
# ag.click();repeat_backspace(20)
|
||||
# ag.typewrite(p1)
|
||||
|
||||
# ag.moveTo(left + 302, (bottom - 80)) # B point
|
||||
# ag.click();repeat_backspace(20)
|
||||
# ag.typewrite(p2)
|
||||
|
||||
# ag.moveTo(left + 302, (bottom - 35)) # Definded distance
|
||||
# ag.click();repeat_backspace(8)
|
||||
# ag.typewrite(distance)
|
||||
# ag.press('enter')
|
||||
|
||||
def get_defineDistances(pid, left, top, right, bottom):
|
||||
psid = libs.getPSid(pid)
|
||||
distances = config.ps_floor_sticker.get(psid, config.ps_floor_sticker['default'])
|
||||
time.sleep(5)
|
||||
y = 748
|
||||
for index, d in enumerate(distances.split(';')):
|
||||
p1, p2, distance = d.split(' ')
|
||||
if index == 0:
|
||||
ag.moveTo(left + 80, top + 290)
|
||||
#移动到 control points
|
||||
ag.moveTo(14, 191)
|
||||
else:
|
||||
ag.moveTo(left + 80, top + 290 + 15) # Create distance line height 15
|
||||
#不是第一次就移动到 create distance
|
||||
ag.moveTo(65, 300+30) # Create distance line height 15
|
||||
time.sleep(0.5)
|
||||
ag.click()
|
||||
time.sleep(1.2)
|
||||
if index == 0:
|
||||
ag.moveTo(65, 285+30)
|
||||
time.sleep(1)
|
||||
ag.click()
|
||||
|
||||
ag.moveTo(left + 302, (bottom - 100)) # A point
|
||||
ag.click();repeat_backspace(20)
|
||||
#点击左下的A点
|
||||
time.sleep(0.5)
|
||||
ag.moveTo(233, y) # A point
|
||||
time.sleep(0.5)
|
||||
ag.click()
|
||||
time.sleep(0.5)
|
||||
repeat_backspace(20)
|
||||
time.sleep(1)
|
||||
ag.typewrite(p1)
|
||||
|
||||
ag.moveTo(left + 302, (bottom - 80)) # B point
|
||||
ag.click();repeat_backspace(20)
|
||||
time.sleep(1)
|
||||
#点击左下的B点
|
||||
ag.moveTo(233, y+15) # B point
|
||||
time.sleep(0.5)
|
||||
ag.click();
|
||||
time.sleep(0.5)
|
||||
repeat_backspace(20)
|
||||
time.sleep(1)
|
||||
ag.typewrite(p2)
|
||||
|
||||
ag.moveTo(left + 302, (bottom - 35)) # Definded distance
|
||||
ag.click();repeat_backspace(8)
|
||||
time.sleep(1)
|
||||
#点击左下的Definded distance
|
||||
ag.moveTo(233,y+60) # Definded distance
|
||||
time.sleep(0.5)
|
||||
ag.click();
|
||||
time.sleep(0.5)
|
||||
repeat_backspace(15)
|
||||
time.sleep(1.5)
|
||||
ag.typewrite(distance)
|
||||
time.sleep(1.5)
|
||||
ag.press('enter')
|
||||
print(f'执行距离划定{index}')
|
||||
|
||||
|
||||
|
||||
def repeat_backspace(times):
|
||||
@@ -58,8 +111,8 @@ def defind_distance(pid, left, top, right, bottom):
|
||||
print(f'left: {left}, top: {top}, right: {right}, bottom: {bottom}')
|
||||
# ag.PAUSE = 1
|
||||
|
||||
ag.moveTo(left + 20, top + 200) # open Control points
|
||||
ag.click()
|
||||
# ag.moveTo(left + 20, top + 200) # open Control points
|
||||
# ag.click()
|
||||
|
||||
get_defineDistances(pid, left, top, right, bottom)
|
||||
|
||||
|
||||
Reference in new issue
Block a user