首次上传

This commit is contained in:
hanqiangqiang
2026-03-24 15:04:02 +08:00
commit 2e080a8764
1392 changed files with 406579 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SicPM1.Utilities
{
public class UnitAlarmItem
{
public string DI { get; set; }//IO name
public string ID { get; set; }
public string Description { get; set; }
public string GlobalDescription_en { get; set; }
public string GlobalDescription_zh { get; set; }
public string Level { get; set; }
public bool AlarmValue { get; set; }
}
}
+42
View File
@@ -0,0 +1,42 @@
using Aitex.Common.Util;
using MECF.Framework.Common.Equipment;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace SicPM1.Utilities
{
public static class XmlConfig
{
public static Dictionary<string, UnitAlarmItem> LoadUnitAlarmDefineConfig(string moduleName, string target)
{
var path = PathManager.GetCfgDir() + $"UnitAlarmDefine/{moduleName}UnitAlarmDefine.xml";
var spinUnitAlarmDic = new Dictionary<string, UnitAlarmItem>();
var doc = XDocument.Load(path);
var items = doc.Root.Elements();
if (items == null)
return null;
items.ToList().ForEach(x => spinUnitAlarmDic[$"{target}.{x.Attribute("DI").Value}"] = new UnitAlarmItem()
{
DI = x.Attribute("DI").Value,
ID = x.Attribute("ID").Value,
Description = x.Attribute("Description").Value,
GlobalDescription_en = x.Attribute("GlobalDescription_en").Value,
GlobalDescription_zh = x.Attribute("GlobalDescription_zh").Value,
Level = x.Attribute("Level").Value,
AlarmValue = x.Attribute("AlarmValue").Value == "1"?true:false,
});
return spinUnitAlarmDic;
}
}
}