From f08871fe7d148d667f2f11f80f64de71a0d9504c Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期一, 15 六月 2026 18:19:37 +0800
Subject: [PATCH] 优化标准老化界面

---
 SimpleUtil/HMI.Simple.Util/AlarmUtil.cs |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/SimpleUtil/HMI.Simple.Util/AlarmUtil.cs b/SimpleUtil/HMI.Simple.Util/AlarmUtil.cs
index c6bcb1b..34c2ce9 100644
--- a/SimpleUtil/HMI.Simple.Util/AlarmUtil.cs
+++ b/SimpleUtil/HMI.Simple.Util/AlarmUtil.cs
@@ -4,19 +4,15 @@
 {
     public class AlarmUtil
     {
-        private static string ConcatAlarm(string source, string content)
-        {
-            return $"{source},{content}";
-        }
 
-        public static bool CreateAlarm(string source, string content, out string msg)
+        public static bool CreateAlarm(string source, string content, int level, out string msg)
         {
             msg = string.Empty;
             try
             {
                 using (var helper = new MSMQHelper("HMI_Alarm"))
                 {
-                    helper.Send("Alarm", ConcatAlarm(source, content));
+                    helper.Send("Alarm", source, content, level);
                     return true;
                 }
             }
@@ -34,16 +30,16 @@
         /// <param name="contents">鎶ヨ鍐呭锛屽悓涓�鏉ユ簮鐨勬姤璀﹀彲浠ュ鏉″悓鏃跺垱寤�</param>
         /// <param name="msg">鍒涘缓澶辫触鏃朵负寮傚父淇℃伅</param>
         /// <returns>鍒涘缓澶辫触鏃朵负寮傚父淇℃伅</returns>
-        public static bool CreateAlarm(string source, string[] contents, out string msg)
+        public static bool CreateAlarm(string source, string[] contents, int[] levels, out string msg)
         {
             msg = string.Empty;
             try
             {
                 using (var helper = new MSMQHelper("HMI_Alarm"))
                 {
-                    foreach (string content in contents)
+                    for (int i = 0; i < contents.Length; i++)
                     {
-                        helper.Send("Alarm", ConcatAlarm(source, content));
+                        helper.Send("Alarm", source, contents[i], levels[i]);
                     }
                     return true;
                 }
@@ -54,10 +50,13 @@
                 return false;
             }
         }
-
-        public static bool CreateAlarm(string content, out string msg)
-        {
-            return CreateAlarm("PC", content, out msg);
-        }
+        //private static string ConcatAlarm(string source, string content)
+        //{
+        //    return $"{source},{content}";
+        //}
+        //public static bool CreateAlarm(string content, int level, out string msg)
+        //{
+        //    return CreateAlarm("PC", content, level, out msg);
+        //}
     }
 }

--
Gitblit v1.9.1