使用异步重构了节点执行方法,将触发器节点与其他节点统一。使用Channel代替Tcs更改了信号触发,使其符合异步编程的习惯。增加了节点是否启用勾选框、参数遮罩勾选框,节点右键面板增加中断功能(试验)。增加了选择后被选择的节点的视觉效果。更改平移缩放逻辑,使其更加符合一般的使用习惯。

This commit is contained in:
fengjiayi
2024-09-20 10:50:32 +08:00
parent 8335094656
commit f5924aa31e
30 changed files with 1298 additions and 539 deletions

View File

@@ -23,6 +23,9 @@ namespace Serein.WorkBench.Node.ViewModel
/// </summary>
internal NodeModelBase Node { get; }
private bool isSelect;
/// <summary>
/// 表示节点控件是否被选中
@@ -37,29 +40,68 @@ namespace Serein.WorkBench.Node.ViewModel
}
}
private MethodDetails methodDetails;
public MethodDetails MethodDetails
public NodeDebugSetting DebugSetting
{
get => methodDetails;
get => Node.DebugSetting;
set
{
methodDetails = value;
OnPropertyChanged();
if (value != null)
{
Node.DebugSetting = value;
OnPropertyChanged(nameof(DebugSetting));
}
}
}
public MethodDetails MethodDetails
{
get => Node.MethodDetails;
set
{
if(value != null)
{
Node.MethodDetails = value;
OnPropertyChanged(nameof(MethodDetails));
}
}
}
public bool IsInterrupt
{
get => Node.DebugSetting.IsInterrupt;
set
{
if (value)
{
Node.Interrupt();
}
else
{
Node.CancelInterrupt();
}
OnPropertyChanged(nameof(IsInterrupt));
}
}
//public bool IsProtectionParameter
//{
// get => MethodDetails.IsProtectionParameter;
// set
// {
// MethodDetails.IsProtectionParameter = value;
// OnPropertyChanged(nameof(IsInterrupt));
// }
//}
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
/// <summary>
///
/// </summary>
public void Selected()
{
IsSelect = true;
@@ -69,5 +111,7 @@ namespace Serein.WorkBench.Node.ViewModel
{
IsSelect = false;
}
}
}