diff --git a/__pycache__/check_station.cpython-312.pyc b/__pycache__/check_station.cpython-312.pyc index 59327a0..948b434 100644 Binary files a/__pycache__/check_station.cpython-312.pyc and b/__pycache__/check_station.cpython-312.pyc differ diff --git a/actions.py b/actions.py index 43a8cce..3578f5e 100644 --- a/actions.py +++ b/actions.py @@ -241,54 +241,56 @@ class DeviceAutomation: task_count = 0 max_tasks = 1 # 最大任务数量,防止无限循环 - while task_count < max_tasks: - # 获取测量任务 - logging.info(f"设备 {self.device_id} 获取测量任务 (第{task_count + 1}次)") - # task_data = apis.get_measurement_task() - # logging.info(f"设备 {self.device_id} 获取到的测量任务: {task_data}") - task_data = { - "id": 39, - "user_name": "czsczq115ykl", - "name": "czsczq115ykl", - "line_num": "L179451", - "line_name": "CDWZQ-2标-资阳沱江特大桥-23-35-山区", - "remaining": "0", - "status": 1 - } - if not task_data: - logging.info(f"设备 {self.device_id} 未获取到状态为1的测量任务,等待后重试") - time.sleep(1) # 等待1秒后重试 - break - # continue - - # 设置全局变量 - global_variable.GLOBAL_CURRENT_PROJECT_NAME = task_data.get('line_name', '') - global_variable.GLOBAL_LINE_NUM = task_data.get('line_num', '') - logging.info(f"设备 {self.device_id} 当前要处理的项目名称:{global_variable.GLOBAL_CURRENT_PROJECT_NAME}") - - # 执行测量操作 - # logging.info(f"设备 {self.device_id} 开始执行测量操作") - if not self.measure_tabbar_page.measure_tabbar_page_manager(): - logging.error(f"设备 {self.device_id} 测量操作执行失败") - - # # 返回到测量页面 - # self.driver.back() - # self.check_and_click_confirm_popup_appium() - - continue # 继续下一个任务 - - logging.info(f"设备 {self.device_id} 测量页面操作执行成功") - - # 在测量操作完成后执行断面里程配置 - logging.info(f"设备 {self.device_id} 开始执行断面里程配置") - if not self.section_mileage_config_page.section_mileage_config_page_manager(): - logging.error(f"设备 {self.device_id} 断面里程配置执行失败") - continue # 继续下一个任务 - - # 任务完成后短暂等待 - logging.info(f"设备 {self.device_id} 第{task_count}个任务完成") - task_count += 1 + # while task_count < max_tasks: + # 获取测量任务 + logging.info(f"设备 {self.device_id} 获取测量任务 (第{task_count + 1}次)") + # task_data = apis.get_measurement_task() + # logging.info(f"设备 {self.device_id} 获取到的测量任务: {task_data}") + task_data = { + "id": 39, + "user_name": "czsczq115ykl", + "name": "czsczq115ykl", + "line_num": "L179451", + "line_name": "CDWZQ-2标-资阳沱江特大桥-23-35-山区", + "remaining": "0", + "status": 1 + } + if not task_data: + logging.info(f"设备 {self.device_id} 未获取到状态为1的测量任务,等待后重试") + time.sleep(1) # 等待1秒后重试 + # break + # continue + # 设置全局变量 + global_variable.GLOBAL_CURRENT_PROJECT_NAME = task_data.get('line_name', '') + global_variable.GLOBAL_LINE_NUM = task_data.get('line_num', '') + logging.info(f"设备 {self.device_id} 当前要处理的项目名称:{global_variable.GLOBAL_CURRENT_PROJECT_NAME}") + + # 执行测量操作 + # logging.info(f"设备 {self.device_id} 开始执行测量操作") + if not self.measure_tabbar_page.measure_tabbar_page_manager(): + logging.error(f"设备 {self.device_id} 测量操作执行失败") + + # # 返回到测量页面 + # self.driver.back() + # self.check_and_click_confirm_popup_appium() + + # continue # 继续下一个任务 + + logging.info(f"设备 {self.device_id} 测量页面操作执行成功") + + # 在测量操作完成后执行断面里程配置 + logging.info(f"设备 {self.device_id} 开始执行断面里程配置") + if not self.section_mileage_config_page.section_mileage_config_page_manager(): + logging.error(f"设备 {self.device_id} 断面里程配置执行失败") + # continue # 继续下一个任务 + + # 任务完成后短暂等待 + logging.info(f"设备 {self.device_id} 第{task_count}个任务完成") + task_count += 1 + + # +++++++++++++white+++++++++++++++++ + logging.info(f"设备 {self.device_id} 已完成{task_count}个任务,结束打数据流程") if task_count == 0: logging.error(f"没有完成打数据的线路,结束任务") diff --git a/check_station.py b/check_station.py index 0c02a46..8eeb3dd 100644 --- a/check_station.py +++ b/check_station.py @@ -266,7 +266,6 @@ class CheckStation: if not self.click_adjustment_button(device_id): self.logger.error(f"设备 {device_id} 点击平差处理按钮失败") return False - return True def click_adjustment_button(self, device_id): diff --git a/page_objects/__pycache__/login_page.cpython-312.pyc b/page_objects/__pycache__/login_page.cpython-312.pyc index 9a8cdc3..bb4cc2d 100644 Binary files a/page_objects/__pycache__/login_page.cpython-312.pyc and b/page_objects/__pycache__/login_page.cpython-312.pyc differ diff --git a/page_objects/__pycache__/measure_tabbar_page.cpython-312.pyc b/page_objects/__pycache__/measure_tabbar_page.cpython-312.pyc index 48ccda6..1f5328d 100644 Binary files a/page_objects/__pycache__/measure_tabbar_page.cpython-312.pyc and b/page_objects/__pycache__/measure_tabbar_page.cpython-312.pyc differ diff --git a/page_objects/__pycache__/screenshot_page.cpython-312.pyc b/page_objects/__pycache__/screenshot_page.cpython-312.pyc index 8a3d617..86c2135 100644 Binary files a/page_objects/__pycache__/screenshot_page.cpython-312.pyc and b/page_objects/__pycache__/screenshot_page.cpython-312.pyc differ diff --git a/page_objects/__pycache__/section_mileage_config_page.cpython-312.pyc b/page_objects/__pycache__/section_mileage_config_page.cpython-312.pyc index 53f2bf0..775c336 100644 Binary files a/page_objects/__pycache__/section_mileage_config_page.cpython-312.pyc and b/page_objects/__pycache__/section_mileage_config_page.cpython-312.pyc differ diff --git a/page_objects/login_page.py b/page_objects/login_page.py index bec8b43..fd66518 100644 --- a/page_objects/login_page.py +++ b/page_objects/login_page.py @@ -122,6 +122,12 @@ class LoginPage: pass 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] password = None account_id = False