完成S7变量启用和停用更新

This commit is contained in:
2025-09-16 14:42:23 +08:00
parent 3102938f92
commit 74fde6bd8b
59 changed files with 226 additions and 454 deletions

View File

@@ -2,6 +2,7 @@ using DMS.Application.Interfaces;
using DMS.Infrastructure.Configuration;
using DMS.Infrastructure.Interfaces.Services;
using DMS.Infrastructure.Services;
using DMS.Infrastructure.Services.OpcUa;
using Microsoft.Extensions.DependencyInjection;
namespace DMS.Infrastructure.Extensions

View File

@@ -1,32 +0,0 @@
using DMS.Application.Interfaces;
using DMS.Infrastructure.Interfaces;
using DMS.Infrastructure.Interfaces.Services;
using DMS.Infrastructure.Services;
using Microsoft.Extensions.DependencyInjection;
namespace DMS.Infrastructure.Extensions
{
/// <summary>
/// S7服务扩展方法
/// </summary>
public static class S7ServiceExtensions
{
/// <summary>
/// 添加S7服务
/// </summary>
public static IServiceCollection AddS7Services(this IServiceCollection services)
{
// 注册服务
services.AddSingleton<IS7ServiceFactory, S7ServiceFactory>();
services.AddSingleton<IS7ServiceManager, S7ServiceManager>();
// 注册后台服务
services.AddHostedService<S7BackgroundService>();
// 注册优化的后台服务(可选)
// services.AddHostedService<OptimizedS7BackgroundService>();
return services;
}
}
}