wanshenmean
10 小时以前 96adc295cb04fd135d63d3a907f2732274f90965
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Storage.cs
@@ -3,6 +3,7 @@
using Quartz;
using SqlSugar;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
@@ -19,14 +20,14 @@
namespace WIDESEAWCS_QuartzJob
{
    /// <summary>
    /// 静态变脸存储区,可使用静态变量,也可注入使用
    /// 静态变量存储区,可使用静态变量,也可注入使用
    /// </summary>
    public class Storage
    {
        /// <summary>
        /// 已连接设备对象集合
        /// 已连接设备对象集合(线程安全)
        /// </summary>
        public static List<IDevice> Devices = new List<IDevice>();
        public static ConcurrentBag<IDevice> Devices = new ConcurrentBag<IDevice>();
        /// <summary>
        /// 设备对象
@@ -44,8 +45,8 @@
        /// <summary>
        /// 获取设备
        /// </summary>
        /// <param name="deviceCode"></param>
        /// <returns></returns>
        /// <param name="deviceCode">设备编码</param>
        /// <returns>设备实例,未找到返回 null</returns>
        public IDevice? GetDevice(string deviceCode)
        {
            return Pro_Devices.FirstOrDefault(x => x.DeviceCode == deviceCode);
@@ -54,8 +55,8 @@
        /// <summary>
        /// 获取设备
        /// </summary>
        /// <param name="deviceCodes"></param>
        /// <returns></returns>
        /// <param name="deviceCodes">设备编码列表</param>
        /// <returns>匹配的设备列表</returns>
        public List<IDevice> GetDevices(List<string> deviceCodes)
        {
            return Pro_Devices.Where(x => deviceCodes.Contains(x.DeviceCode)).ToList();