From e98b07c84a2a496da895ef6b523b29ccc75e004d Mon Sep 17 00:00:00 2001 From: hutongqing <hutongqing@hnkhzn.com> Date: 星期五, 23 八月 2024 11:27:01 +0800 Subject: [PATCH] 更新QuartzJob种子数据插入 --- WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/ConveyorLine/CommonConveyorLine.cs | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/ConveyorLine/CommonConveyorLine.cs b/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/ConveyorLine/CommonConveyorLine.cs index d4761ce..8ba525a 100644 --- a/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/ConveyorLine/CommonConveyorLine.cs +++ b/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/ConveyorLine/CommonConveyorLine.cs @@ -15,6 +15,7 @@ *----------------------------------------------------------------*/ #endregion << 鐗� 鏈� 娉� 閲� >> +using HslCommunication; using System; using System.Collections.Generic; using System.ComponentModel; @@ -121,6 +122,20 @@ return false; } + public T ReadCustomer<T>(string deviceChildCode) where T : IDataTransfer, new() + { + DeviceProDTO? devicePro = _deviceProDTOs.Where(x => x.DeviceProParamType == nameof(DeviceCommand) && x.DeviceChildCode == deviceChildCode).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); + + if (devicePro == null) + { + throw new Exception(); + } + else + { + return Communicator.ReadCustomer<T>(devicePro.DeviceProAddress); + } + } + public bool SetValue<TEnum, TValue>(TEnum @enum, TValue value, string deviceChildCode) where TEnum : Enum where TValue : notnull -- Gitblit v1.9.3