|
|
|
@ -16,6 +16,7 @@ import qtawesome as qta
|
|
|
|
|
from datetime import datetime
|
|
|
|
|
import random
|
|
|
|
|
import json
|
|
|
|
|
import time
|
|
|
|
|
|
|
|
|
|
from model.ProcedureModel.ProcedureProcessor import StepTableModel
|
|
|
|
|
from utils.DBModels.ProcedureModel import DatabaseManager
|
|
|
|
@ -449,7 +450,7 @@ class StepExecutor(QWidget):
|
|
|
|
|
|
|
|
|
|
if result is None:
|
|
|
|
|
print(f"警告:步骤 {stepInfo['stepId']} 返回了None结果,设置为False")
|
|
|
|
|
result = '未检测到关键字'
|
|
|
|
|
result = '执行失败,未检测到关键字'
|
|
|
|
|
|
|
|
|
|
executionTime = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
|
|
|
|
stepResult = {
|
|
|
|
@ -630,10 +631,19 @@ class StepExecutor(QWidget):
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
def performWaitOperation(self, stepId, description, keyword):
|
|
|
|
|
"""执行等待操作"""
|
|
|
|
|
"""执行等待操作,等待时间取自描述字段中的数字(秒)"""
|
|
|
|
|
print(f"执行等待操作 (步骤 {stepId}): {description}")
|
|
|
|
|
# 这里可以添加具体的等待操作逻辑
|
|
|
|
|
return '执行成功'
|
|
|
|
|
import re, time
|
|
|
|
|
# 只提取描述中的数字(支持小数),不再匹配"等待"字样
|
|
|
|
|
match = re.search(r'([0-9]+(?:\.[0-9]+)?)', description)
|
|
|
|
|
if match:
|
|
|
|
|
seconds = float(match.group(1))
|
|
|
|
|
print(f" 等待 {seconds} 秒...")
|
|
|
|
|
time.sleep(seconds)
|
|
|
|
|
return '执行成功'
|
|
|
|
|
else:
|
|
|
|
|
print(" 未检测到等待时间")
|
|
|
|
|
return '未检测到等待时间'
|
|
|
|
|
|
|
|
|
|
def performDeltaTOperation(self, stepId, description, keyword):
|
|
|
|
|
"""执行接收操作"""
|
|
|
|
@ -842,8 +852,8 @@ class StepExecutor(QWidget):
|
|
|
|
|
if step.get('executed', False):
|
|
|
|
|
rowCells[2].text = step.get('time', '').strftime("%Y-%m-%d %H:%M:%S") if step.get('time') else ''
|
|
|
|
|
result = step.get('result', False)
|
|
|
|
|
rowCells[3].text = "✓ 成功" if result else "✗ 失败"
|
|
|
|
|
rowCells[4].text = "正常执行" if result else "执行失败"
|
|
|
|
|
rowCells[3].text = "✓ 成功" if '失败' not in result else "✗ 失败"
|
|
|
|
|
rowCells[4].text = result
|
|
|
|
|
|
|
|
|
|
if result:
|
|
|
|
|
rowCells[3].paragraphs[0].runs[0].font.color.rgb = RGBColor(0, 176, 80)
|
|
|
|
|