From 569e91c63636345391f741df049c9374a141a434 Mon Sep 17 00:00:00 2001 From: hutongqing <hutongqing@hnkhzn.com> Date: 星期一, 26 八月 2024 08:57:33 +0800 Subject: [PATCH] 添加路由新建配置,重新导出种子数据 --- WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/ConveyorLine/CommonConveyorLine.cs | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/ConveyorLine/CommonConveyorLine.cs b/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/ConveyorLine/CommonConveyorLine.cs index d4761ce..ccf896d 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; @@ -107,7 +108,7 @@ throw new NotImplementedException(); } - public bool SendCommand(DeviceCommand command, string deviceChildCode) + public bool SendCommand<T>(T command, 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) @@ -121,6 +122,20 @@ return false; } + public T ReadCustomer<T>(string deviceChildCode) where T : IDataTransfer, new() + { + DeviceProDTO? devicePro = _deviceProDTOs.Where(x => x.DeviceProParamType == "ReadDeviceCommand" && 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