using Aitex.Common.Util; using Aitex.Core.RT.SCCore; 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 EFEM.RT.Systems { public static class XmlConfig { public static Dictionary LoadRobotTeachStation() { var path = PathManager.GetCfgDir() + $"{SC.GetStringValue("System.DeviceType")}\\" + "RobotTeachStation.xml"; if (!File.Exists(path)) return null; var teachStation = new Dictionary(); var doc = XDocument.Load(path); if (doc == null) return null; var items = doc.Root.Elements(); if (items == null) return null; items.ToList().ForEach(x => teachStation.Add(ModuleHelper.Converter(x.Attribute("Module").Value), x.Attribute("Station").Value)); return teachStation; } public static Dictionary LoadRobotSlotToSlot() { var path = PathManager.GetCfgDir() + $"{SC.GetStringValue("System.DeviceType")}\\" + "RobotTeachStation.xml"; if (!File.Exists(path)) return null; var slot2Slot = new Dictionary(); var doc = XDocument.Load(path); if (doc == null) return null; var items = doc.Root.Elements(); if (items == null) return null; items.ToList().ForEach(x => slot2Slot.Add(ModuleHelper.Converter(x.Attribute("Module").Value), x.Attribute("Slot2Slot").Value)); return slot2Slot; } public static Dictionary LoadMotionAxisTeachStation() { var path = PathManager.GetCfgDir() + $"{SC.GetStringValue("System.DeviceType")}\\" + "RobotTeachStation.xml"; if (!File.Exists(path)) return null; var teachStation = new Dictionary(); var doc = XDocument.Load(path); if (doc == null) return null; var items = doc.Root.Elements(); if (items == null) return null; items.ToList().ForEach(x => teachStation.Add(ModuleHelper.Converter(x.Attribute("Module").Value), x.Attribute("MotionAxisStation").Value)); return teachStation; } } }