子程序优化
This commit is contained in:
@@ -568,16 +568,35 @@ namespace TestingModule.ViewModels
|
||||
{
|
||||
// 查找最近的未匹配循环开始
|
||||
StepVM? lastUnmatchedLoopStart = null;
|
||||
for (int i = Program.StepCollection.Count - 1; i >= 0; i--)
|
||||
if (_ScopedContext.SelectedStepList == "主程序")
|
||||
{
|
||||
if (Program.StepCollection[i].StepType == "循环开始")
|
||||
for (int i = Program.StepCollection.Count - 1; i >= 0; i--)
|
||||
{
|
||||
bool isMatched = Program.StepCollection.Any(s => s.StepType == "循环结束" && s.LoopStartStepId == Program.StepCollection[i].ID);
|
||||
|
||||
if (!isMatched)
|
||||
if (Program.StepCollection[i].StepType == "循环开始")
|
||||
{
|
||||
lastUnmatchedLoopStart = Program.StepCollection[i];
|
||||
break;
|
||||
bool isMatched = Program.StepCollection.Any(s => s.StepType == "循环结束" && s.LoopStartStepId == Program.StepCollection[i].ID);
|
||||
|
||||
if (!isMatched)
|
||||
{
|
||||
lastUnmatchedLoopStart = Program.StepCollection[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = Program.ErrorStepCollection.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (Program.ErrorStepCollection[i].StepType == "循环开始")
|
||||
{
|
||||
bool isMatched = Program.ErrorStepCollection.Any(s => s.StepType == "循环结束" && s.LoopStartStepId == Program.StepCollection[i].ID);
|
||||
|
||||
if (!isMatched)
|
||||
{
|
||||
lastUnmatchedLoopStart = Program.ErrorStepCollection[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user