|
@@ -301,6 +301,10 @@ namespace Bird_tool
|
|
|
// 判断是否在测试
|
|
|
StopTest(isError);
|
|
|
};
|
|
|
+ _serialManager.OnConnect += () =>
|
|
|
+ {
|
|
|
+ _uart_ui_change(true);
|
|
|
+ };
|
|
|
}
|
|
|
private void load_app_config()
|
|
|
{
|
|
@@ -842,25 +846,31 @@ namespace Bird_tool
|
|
|
progressPanel.CurrentTest = "初始化测试环境";
|
|
|
progressPanel.Message = "准备开始硬件测试...";
|
|
|
progressPanel.startTest();
|
|
|
+ bool start_flag = false;
|
|
|
if (string.IsNullOrEmpty(groupId))
|
|
|
{
|
|
|
- _testExecutor.StartTest();
|
|
|
+ start_flag = _testExecutor.StartTest();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
if (testType == TestType.StartFrom)
|
|
|
{
|
|
|
- _testExecutor.StartTestFromGroup(groupId);
|
|
|
+ start_flag = _testExecutor.StartTestFromGroup(groupId);
|
|
|
}
|
|
|
else if (testType == TestType.TestSingle)
|
|
|
{
|
|
|
- _testExecutor.StartTestGroup(groupId);
|
|
|
+ start_flag = _testExecutor.StartTestGroup(groupId);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- _testExecutor.StartTest();
|
|
|
+ start_flag = _testExecutor.StartTest();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if (!start_flag)
|
|
|
+ {
|
|
|
+ StopTest(false);
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
private void StopTest(bool isQuery = true)
|
|
@@ -886,6 +896,12 @@ namespace Bird_tool
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ progressPanel.ShowTestResult(false, "测试已取消", LoadCancelledImage());
|
|
|
+
|
|
|
+ // 添加日志
|
|
|
+ logBuilder.AppendLine($"[{DateTime.Now}] 测试已取消");
|
|
|
+ _testExecutor.StopTestAsync();
|
|
|
+ progressPanel.Message = "停止异常中止";
|
|
|
Log($"[{DateTime.Now}] 测试中止");
|
|
|
}
|
|
|
|
|
@@ -983,13 +999,35 @@ namespace Bird_tool
|
|
|
|
|
|
// 红外传感器测试
|
|
|
new TestStepConfig
|
|
|
+ {
|
|
|
+ GroupId = "pir_test",
|
|
|
+ ShowStep = false,
|
|
|
+ Name = "配置变量",
|
|
|
+ Tips = "设置变量",
|
|
|
+ PrivateCammand = true,
|
|
|
+ Action = ActionMode.SetVal,
|
|
|
+ VariableNames = { "pir" },
|
|
|
+ VariableValues = { appConfig.pir },
|
|
|
+ },
|
|
|
+ new TestStepConfig
|
|
|
+ {
|
|
|
+ GroupId = "pir_test",
|
|
|
+ Name = "配置红外",
|
|
|
+ Tips = "配置红外灵敏度中",
|
|
|
+ Command = "AT+SPIR={{pir}}\r\n",
|
|
|
+ SuccessPattern = @"sensitivity to \d+ OK",
|
|
|
+ Timeout = 3000,
|
|
|
+ DelayAfter = 10,
|
|
|
+ MaxRetries = 5,
|
|
|
+ },
|
|
|
+ new TestStepConfig
|
|
|
{
|
|
|
GroupId = "pir_test",
|
|
|
Name = "配置设备状态",
|
|
|
Tips = "等待任务自动执行",
|
|
|
Command = "AT+RBOT=0\r\n",
|
|
|
SuccessPattern = "OS start",
|
|
|
- Timeout = 10000,
|
|
|
+ Timeout = 15000,
|
|
|
DelayBefore = 1000,
|
|
|
MaxRetries = 5,
|
|
|
},
|
|
@@ -1004,14 +1042,14 @@ namespace Bird_tool
|
|
|
DelayBefore = 1000,
|
|
|
MaxRetries = 5,
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
new TestStepConfig
|
|
|
{
|
|
|
GroupId = "pir_test",
|
|
|
- Name = "红外触发1",
|
|
|
- Tips = "请将手移动至红外传感器上 第一次",
|
|
|
+ Name = "等待设备休眠",
|
|
|
+ Tips = "等待设备进入休眠状态",
|
|
|
Command = "\r\n",
|
|
|
- SuccessPattern = "SOC: <=OK cmd:17",
|
|
|
+ SuccessPattern = "CAM: Close",
|
|
|
Timeout = 30000,
|
|
|
DelayAfter = 100,
|
|
|
MaxRetries = 3,
|