将FlowTrigger触发器整合成接口的形式方便替换

This commit is contained in:
fengjiayi
2024-12-23 23:19:10 +08:00
parent 0f9c9b9988
commit 5941f75313
29 changed files with 403 additions and 164 deletions

View File

@@ -4,7 +4,7 @@ using Serein.Library;
namespace Net462DllTest.Trigger
{
[AutoRegister]
public class PrakingDevice : FlowTrigger<ParkingCommand>
public class PrakingDevice : TaskFlowTrigger<ParkingCommand>
{
}

View File

@@ -19,7 +19,7 @@ namespace Net462DllTest.Trigger
[AutoRegister]
public class SiemensPlcDevice : FlowTrigger<PlcVarName>
public class SiemensPlcDevice : TaskFlowTrigger<PlcVarName>
{
public SiemensClient Client { get; set; }
public SiemensVersion Version { get; set; }
@@ -197,7 +197,7 @@ namespace Net462DllTest.Trigger
if (isNotification)
{
Console.WriteLine($"VarName: {signal}\t\tOld Data: {oldData}\tNew Data: {newData}");
Trigger(signal, newData);
await InvokeTriggerAsync(signal, newData);
}
@@ -238,7 +238,7 @@ namespace Net462DllTest.Trigger
{
return VarInfoDict[plcVarEnum];
}
var plcValue = EnumHelper.GetBoundValue<PlcVarName, PlcVarInfoAttribute, PlcVarInfo>(plcVarEnum, attr => attr.Info)
var plcValue = EnumHelper.GetAttributeValue<PlcVarName, PlcVarInfoAttribute, PlcVarInfo>(plcVarEnum, attr => attr.Info)
?? throw new Exception($"获取变量异常:{plcVarEnum}没有标记PlcValueAttribute");
if (string.IsNullOrEmpty(plcValue.Address))
{

View File

@@ -16,7 +16,7 @@ namespace Net462DllTest.Trigger
/// 视图管理
/// </summary>
[AutoRegister]
public class ViewManagement : FlowTrigger<CommandSignal>
public class ViewManagement : TaskFlowTrigger<CommandSignal>
{
private readonly UIContextOperation uiContextOperation;
public ViewManagement(UIContextOperation uiContextOperation)