mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
单步执行和执行日志
This commit is contained in:
@@ -257,8 +257,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
if (oldchildren != null)
|
||||
{
|
||||
this.RemoveChild(oldchildren, container);
|
||||
}
|
||||
Root.Items.Remove(child);
|
||||
}
|
||||
if (child.LinkNode?.Previous != null)
|
||||
{
|
||||
child.LinkNode.Previous.Value.RemoveNext();
|
||||
@@ -268,6 +267,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
child.LinkNode.Next.Value.RemovePrevious();
|
||||
}
|
||||
container.InsertChild(child, index);
|
||||
Root.Items.Remove(child);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -283,9 +283,9 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
items = child.LinkNode.Value.RemoveSelf(true);
|
||||
}
|
||||
|
||||
items.ForEach(p => {
|
||||
Root.Items.Remove(p);
|
||||
items.ForEach(p => {
|
||||
container.InsertChild(p, index++);
|
||||
Root.Items.Remove(p);
|
||||
});
|
||||
|
||||
}
|
||||
@@ -317,16 +317,16 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}));
|
||||
}
|
||||
|
||||
private int _isExecuting;
|
||||
public int ExecutStatus
|
||||
private ExecutStatus _executStatus;
|
||||
public ExecutStatus ExecutStatus
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isExecuting;
|
||||
return _executStatus;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _isExecuting, value);
|
||||
SetProperty(ref _executStatus, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -369,6 +369,52 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
public BlockDesignerItemViewModel Next
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ParentContainer != null)
|
||||
{
|
||||
var index = ParentContainer.Children.IndexOf(this);
|
||||
if (index + 1 < ParentContainer.Children.Count)
|
||||
{
|
||||
return ParentContainer.Children[index + 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return LinkNode.Next?.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public BlockDesignerItemViewModel Previous
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ParentContainer != null)
|
||||
{
|
||||
var index = ParentContainer.Children.IndexOf(this);
|
||||
if (index - 1 >= 0)
|
||||
{
|
||||
return ParentContainer.Children[index - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return LinkNode.Previous?.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public BlockItemsContainerInfo ParentContainer
|
||||
{
|
||||
get; set;
|
||||
@@ -447,30 +493,25 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
#region 执行
|
||||
protected override async void ExecuteEditCommand(object param)
|
||||
{
|
||||
await this.LinkNode.List.First.Value.Execute();
|
||||
}
|
||||
|
||||
#region 执行
|
||||
public override void PreviewExecuteEdit()
|
||||
{
|
||||
var items = this.LinkNode.List.ToList();
|
||||
|
||||
items.ForEach(p => p.ExecutStatus = 1);
|
||||
items.ForEach(p => p.ExecutStatus = ExecutStatus.Preview);
|
||||
}
|
||||
|
||||
public override void ExitPreviewExecuteEdit()
|
||||
{
|
||||
var items = this.LinkNode.List.ToList();
|
||||
|
||||
items.ForEach(p => p.ExecutStatus = 0);
|
||||
items.ForEach(p => p.ExecutStatus = ExecutStatus.Stop);
|
||||
}
|
||||
|
||||
public virtual Task Execute()
|
||||
public virtual Task<bool> Execute()
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
public virtual object GetResult()
|
||||
{
|
||||
@@ -603,14 +644,11 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
#endregion
|
||||
|
||||
[FlagsAttribute]
|
||||
public enum ExecutStatus
|
||||
{
|
||||
Stop,
|
||||
Run,
|
||||
PauseCommand,
|
||||
ContinueCommand,
|
||||
StopCommand,
|
||||
|
||||
Pause,
|
||||
Preview,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user