使用设计模式优化一下逻辑图

This commit is contained in:
艾竹
2023-04-15 23:32:29 +08:00
parent c6bc57140f
commit 488e23ea57
4 changed files with 489 additions and 272 deletions

View File

@@ -12,8 +12,14 @@ namespace AIStudio.Wpf.DiagramDesigner
{
public abstract class LogicalGateItemViewModelBase : DesignerItemViewModelBase
{
public ICommand AddInputCommand { get; private set; }
public ICommand AddOutputCommand { get; private set; }
public ICommand AddInputCommand
{
get; private set;
}
public ICommand AddOutputCommand
{
get; private set;
}
public LogicalGateItemViewModelBase(LogicalType logicalType) : this(null, logicalType)
@@ -96,7 +102,7 @@ namespace AIStudio.Wpf.DiagramDesigner
}
protected override void Init(IDiagramViewModel root, bool initNew)
{
{
ShowRotate = false;
ShowArrow = false;
AddInputCommand = new SimpleCommand(Command_Enable, para => ExecuteAddInput(para));
@@ -216,7 +222,10 @@ namespace AIStudio.Wpf.DiagramDesigner
}
}
public LogicalType LogicalType { get; set; }
public LogicalType LogicalType
{
get; set;
}
public Dictionary<int, LogicalConnectorInfo> Input { get; set; } = new Dictionary<int, LogicalConnectorInfo>();
@@ -294,6 +303,15 @@ namespace AIStudio.Wpf.DiagramDesigner
}
}
}
public virtual void GetInput()
{
}
public virtual void CalculateOutput()
{
}
}