自动点击的定位修改 + 分布式任务的bug修改
This commit is contained in:
1 parent
f52f811b00
commit
bd89422ed0
2 files changed
+7
-4
No files matched your search
@@ -101,8 +101,8 @@ def is_run_stepx_nums(step):
|
|||||||
def need_run_stepx(task_distributed_id):
|
def need_run_stepx(task_distributed_id):
|
||||||
try:
|
try:
|
||||||
|
|
||||||
#查询task_distributed_id 对应的子任务是否正在执行,
|
#查询task_distributed_id 对应的子任务是否正在执行,hostname = "{hostname}" and
|
||||||
where = f'hostname = "{hostname}" and task_distributed_id = "{task_distributed_id}" order by id desc limit 1 for update'
|
where = f'task_distributed_id = "{task_distributed_id}" order by id desc limit 1 for update'
|
||||||
result = main_service_db.db_task_distributed_detail(where)
|
result = main_service_db.db_task_distributed_detail(where)
|
||||||
#如果一个子任务都没有,说明该任务还没有开始执行,需要执行step1
|
#如果一个子任务都没有,说明该任务还没有开始执行,需要执行step1
|
||||||
if result is None:
|
if result is None:
|
||||||
|
|||||||
@@ -51,6 +51,9 @@ def get_defineDistances(pid, left, top, right, bottom):
|
|||||||
distances = libs_db.get_floor_sticker_distances(psid) #config.ps_floor_sticker.get(psid, config.ps_floor_sticker['default'])
|
distances = libs_db.get_floor_sticker_distances(psid) #config.ps_floor_sticker.get(psid, config.ps_floor_sticker['default'])
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
y = 748
|
y = 748
|
||||||
|
yCreateDistance = 0
|
||||||
|
if len(distances.split(';')) == 1:
|
||||||
|
yCreateDistance = 2
|
||||||
for index, d in enumerate(distances.split(';')):
|
for index, d in enumerate(distances.split(';')):
|
||||||
p1, p2, distance = d.split(' ')
|
p1, p2, distance = d.split(' ')
|
||||||
if index == 0:
|
if index == 0:
|
||||||
@@ -58,12 +61,12 @@ def get_defineDistances(pid, left, top, right, bottom):
|
|||||||
ag.moveTo(14, 191)
|
ag.moveTo(14, 191)
|
||||||
else:
|
else:
|
||||||
#不是第一次就移动到 create distance
|
#不是第一次就移动到 create distance
|
||||||
ag.moveTo(65, 300+30) # Create distance line height 15
|
ag.moveTo(65, 300+yCreateDistance*15) # Create distance line height 15
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
ag.click()
|
ag.click()
|
||||||
time.sleep(1.2)
|
time.sleep(1.2)
|
||||||
if index == 0:
|
if index == 0:
|
||||||
ag.moveTo(65, 285+30)
|
ag.moveTo(65, 285+yCreateDistance*15)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
ag.click()
|
ag.click()
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user