From d26440e5c2f73f3675510aeb0ce75e4ea6bf28be Mon Sep 17 00:00:00 2001 From: gcw_MV9p2JJN Date: Wed, 28 Jan 2026 19:57:53 +0800 Subject: [PATCH] 1 --- Infrastructure/Model/OptionsSetting.cs | 2 ++ .../Stations/Into/PlcIntoStationService_OP70_01.cs | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Infrastructure/Model/OptionsSetting.cs b/Infrastructure/Model/OptionsSetting.cs index 2787d71..7f2ab3d 100644 --- a/Infrastructure/Model/OptionsSetting.cs +++ b/Infrastructure/Model/OptionsSetting.cs @@ -56,6 +56,8 @@ namespace Infrastructure.Model /// public RedisServerConfig RedisServer { get; set; } + public PlcSettings PlcSettings { get; set; } + } diff --git a/RIZO.Service/PLCBackground/Stations/Into/PlcIntoStationService_OP70_01.cs b/RIZO.Service/PLCBackground/Stations/Into/PlcIntoStationService_OP70_01.cs index 3e8c72a..c0ca638 100644 --- a/RIZO.Service/PLCBackground/Stations/Into/PlcIntoStationService_OP70_01.cs +++ b/RIZO.Service/PLCBackground/Stations/Into/PlcIntoStationService_OP70_01.cs @@ -1,8 +1,11 @@ using Infrastructure.Attribute; +using Infrastructure.Extensions; +using Infrastructure.Model; using MDM.Model.Plant; using MDM.Model.Process; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; using NLog; using RIZO.Model.Mes; using RIZO.Model.MES.product_trace; @@ -30,9 +33,13 @@ namespace RIZO.Service.PLCBackground.Stations.Into private readonly CpuType _cpuType = CpuType.S71500; private string WorkstationCode; private readonly SqlSugarClient Context; - public PlcIntoStationService_OP70_01() + private readonly OptionsSetting _optionsSetting; + private readonly PlcSettings plcSetting; + public PlcIntoStationService_OP70_01(IOptions options) { Context = DbScoped.SugarScope.CopyNew(); + _optionsSetting= options.Value; + plcSetting = _optionsSetting.PlcSettings; } protected override async Task ExecuteAsync(CancellationToken stoppingToken)