using Newtonsoft.Json;
|
using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
|
using Quartz;
|
using SqlSugar;
|
using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Drawing;
|
using System.Linq;
|
using System.Reflection;
|
using System.Text;
|
using System.Threading.Tasks;
|
using WIDESEAWCS_Communicator;
|
using WIDESEAWCS_Core.Enums;
|
using WIDESEAWCS_Core.Helper;
|
using WIDESEAWCS_QuartzJob.DeviceBase;
|
using WIDESEAWCS_QuartzJob.DeviceEnum;
|
|
namespace WIDESEAWCS_QuartzJob
|
{
|
/// <summary>
|
/// 静态变脸存储区,可使用静态变量,也可注入使用
|
/// </summary>
|
public class Storage
|
{
|
/// <summary>
|
/// 已连接设备对象集合
|
/// </summary>
|
public static List<IDevice> Devices = new List<IDevice>();
|
|
/// <summary>
|
/// 设备对象
|
/// </summary>
|
public List<IDevice> Pro_Devices { get; set; }
|
|
/// <summary>
|
/// 构造函数
|
/// </summary>
|
public Storage()
|
{
|
Pro_Devices = new List<IDevice>();
|
}
|
|
/// <summary>
|
/// 获取设备
|
/// </summary>
|
/// <param name="deviceCode"></param>
|
/// <returns></returns>
|
public IDevice? GetDevice(string deviceCode)
|
{
|
return Pro_Devices.FirstOrDefault(x => x.DeviceCode == deviceCode);
|
}
|
|
/// <summary>
|
/// 获取设备
|
/// </summary>
|
/// <param name="deviceCodes"></param>
|
/// <returns></returns>
|
public List<IDevice> GetDevices(List<string> deviceCodes)
|
{
|
return Pro_Devices.Where(x => deviceCodes.Contains(x.DeviceCode)).ToList();
|
}
|
|
}
|
}
|