1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- 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<ModuleName, string> LoadRobotTeachStation()
- {
- var path = PathManager.GetCfgDir() + $"{SC.GetStringValue("System.DeviceType")}\\" + "RobotTeachStation.xml";
- if (!File.Exists(path))
- return null;
- var teachStation = new Dictionary<ModuleName, string>();
- 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<ModuleName, string> LoadRobotSlotToSlot()
- {
- var path = PathManager.GetCfgDir() + $"{SC.GetStringValue("System.DeviceType")}\\" + "RobotTeachStation.xml";
- if (!File.Exists(path))
- return null;
- var slot2Slot = new Dictionary<ModuleName, string>();
- 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<ModuleName, string> LoadMotionAxisTeachStation()
- {
- var path = PathManager.GetCfgDir() + $"{SC.GetStringValue("System.DeviceType")}\\" + "RobotTeachStation.xml";
- if (!File.Exists(path))
- return null;
- var teachStation = new Dictionary<ModuleName, string>();
- 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;
- }
- }
- }
|