截图未测试
This commit is contained in:
Binary file not shown.
10
actions.py
10
actions.py
@@ -241,7 +241,7 @@ class DeviceAutomation:
|
|||||||
task_count = 0
|
task_count = 0
|
||||||
max_tasks = 1 # 最大任务数量,防止无限循环
|
max_tasks = 1 # 最大任务数量,防止无限循环
|
||||||
|
|
||||||
while task_count < max_tasks:
|
# while task_count < max_tasks:
|
||||||
# 获取测量任务
|
# 获取测量任务
|
||||||
logging.info(f"设备 {self.device_id} 获取测量任务 (第{task_count + 1}次)")
|
logging.info(f"设备 {self.device_id} 获取测量任务 (第{task_count + 1}次)")
|
||||||
# task_data = apis.get_measurement_task()
|
# task_data = apis.get_measurement_task()
|
||||||
@@ -258,7 +258,7 @@ class DeviceAutomation:
|
|||||||
if not task_data:
|
if not task_data:
|
||||||
logging.info(f"设备 {self.device_id} 未获取到状态为1的测量任务,等待后重试")
|
logging.info(f"设备 {self.device_id} 未获取到状态为1的测量任务,等待后重试")
|
||||||
time.sleep(1) # 等待1秒后重试
|
time.sleep(1) # 等待1秒后重试
|
||||||
break
|
# break
|
||||||
# continue
|
# continue
|
||||||
|
|
||||||
# 设置全局变量
|
# 设置全局变量
|
||||||
@@ -275,7 +275,7 @@ class DeviceAutomation:
|
|||||||
# self.driver.back()
|
# self.driver.back()
|
||||||
# self.check_and_click_confirm_popup_appium()
|
# self.check_and_click_confirm_popup_appium()
|
||||||
|
|
||||||
continue # 继续下一个任务
|
# continue # 继续下一个任务
|
||||||
|
|
||||||
logging.info(f"设备 {self.device_id} 测量页面操作执行成功")
|
logging.info(f"设备 {self.device_id} 测量页面操作执行成功")
|
||||||
|
|
||||||
@@ -283,12 +283,14 @@ class DeviceAutomation:
|
|||||||
logging.info(f"设备 {self.device_id} 开始执行断面里程配置")
|
logging.info(f"设备 {self.device_id} 开始执行断面里程配置")
|
||||||
if not self.section_mileage_config_page.section_mileage_config_page_manager():
|
if not self.section_mileage_config_page.section_mileage_config_page_manager():
|
||||||
logging.error(f"设备 {self.device_id} 断面里程配置执行失败")
|
logging.error(f"设备 {self.device_id} 断面里程配置执行失败")
|
||||||
continue # 继续下一个任务
|
# continue # 继续下一个任务
|
||||||
|
|
||||||
# 任务完成后短暂等待
|
# 任务完成后短暂等待
|
||||||
logging.info(f"设备 {self.device_id} 第{task_count}个任务完成")
|
logging.info(f"设备 {self.device_id} 第{task_count}个任务完成")
|
||||||
task_count += 1
|
task_count += 1
|
||||||
|
|
||||||
|
# +++++++++++++white+++++++++++++++++
|
||||||
|
|
||||||
logging.info(f"设备 {self.device_id} 已完成{task_count}个任务,结束打数据流程")
|
logging.info(f"设备 {self.device_id} 已完成{task_count}个任务,结束打数据流程")
|
||||||
if task_count == 0:
|
if task_count == 0:
|
||||||
logging.error(f"没有完成打数据的线路,结束任务")
|
logging.error(f"没有完成打数据的线路,结束任务")
|
||||||
|
|||||||
@@ -266,7 +266,6 @@ class CheckStation:
|
|||||||
if not self.click_adjustment_button(device_id):
|
if not self.click_adjustment_button(device_id):
|
||||||
self.logger.error(f"设备 {device_id} 点击平差处理按钮失败")
|
self.logger.error(f"设备 {device_id} 点击平差处理按钮失败")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def click_adjustment_button(self, device_id):
|
def click_adjustment_button(self, device_id):
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -122,6 +122,12 @@ class LoginPage:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
accounts = apis.get_accounts_from_server("68ef0e02b0138d25e2ac9918")
|
accounts = apis.get_accounts_from_server("68ef0e02b0138d25e2ac9918")
|
||||||
|
|
||||||
|
# 检查accounts是否为None,如果是则设为空列表
|
||||||
|
if accounts is None:
|
||||||
|
logging.warning("获取账户列表返回None,设为空列表")
|
||||||
|
accounts = []
|
||||||
|
|
||||||
matches = [acc for acc in accounts if acc.get("username") == existing_username]
|
matches = [acc for acc in accounts if acc.get("username") == existing_username]
|
||||||
password = None
|
password = None
|
||||||
account_id = False
|
account_id = False
|
||||||
|
|||||||
Reference in New Issue
Block a user