From 70233af5426b0d1c343ebe87183303a34a9aaa58 Mon Sep 17 00:00:00 2001
From: hutongqing <hutongqing@hnkhzn.com>
Date: 星期三, 20 十一月 2024 09:05:38 +0800
Subject: [PATCH] WIDESEAWCS_QuartzJob更新版本

---
 WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Storage.cs |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Storage.cs b/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Storage.cs
index 1935712..0e31e58 100644
--- a/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Storage.cs
+++ b/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Storage.cs
@@ -21,5 +21,27 @@
     public class Storage
     {
         public static List<IDevice> Devices = new List<IDevice>();
+
+        public List<IDevice> Pro_Devices { get; set; }
+
+        public Storage()
+        {
+            Pro_Devices = new List<IDevice>();
+        }
+
+        public IDevice? GetDevice(string deviceCode)
+        {
+            return Pro_Devices.FirstOrDefault(x => x.DeviceCode == deviceCode);
+        }
+
+        public List<IDevice> GetDevices(List<string> deviceCodes)
+        {
+            return Pro_Devices.Where(x => deviceCodes.Contains(x.DeviceCode)).ToList();
+        }
+
+        public BaseCommunicator? GetCommunicator(string deviceCode)
+        {
+            return Devices.FirstOrDefault(x => x.DeviceCode == deviceCode)?.Communicator;
+        }
     }
 }

--
Gitblit v1.9.3