using System; using System.Collections.Generic; using System.IO; using Aitex.Core.Common; using Aitex.Core.RT.Device; using Aitex.Core.RT.OperationCenter; using Aitex.Core.RT.SCCore; using Aitex.RT.Device.Custom; using MECF.Framework.Common.Equipment; using SorterRT.Modules; using VirgoRT.Devices; namespace VirgoRT.Instances { public class DeviceEntity : DeviceEntityT { public DeviceEntity() { } } public class DeviceManager : DeviceManagerBase { public WaferSize SmallPinWaferSize { get; set; } public WaferSize MediumPinWaferSize { get; set; } public WaferSize BigPinWaferSize { get; set; } private readonly string device_model_file; public DeviceManager() { device_model_file = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config\\", RtInstance.DeviceModelFileName); } public override bool Initialize() { if (SC.GetValue("System.PMAIsInstalled")) InitPM(ModuleName.PMA); if (SC.GetValue("System.PMBIsInstalled")) InitPM(ModuleName.PMB); AddCustomModuleDevice(new VirgoSignalTower("System", "SignalTower")); OP.Subscribe("DeviceOperation", this.Invoke); return true; } private void InitPM(ModuleName mod) { Initialize(device_model_file, RtInstance.SystemName, mod, mod.ToString()); if (SC.GetValue($"{mod}.Rf.CommunicationType") == (int)CommunicationType.RS232 && SC.GetValue($"{mod}.Rf.MFG") == (int)GeneratorMFG.AdTec) { AddCustomModuleDevice(new AdTecGenerator(mod, "Rf")); } if (SC.GetValue($"{mod}.BiasRf.EnableBiasRF") && SC.GetValue($"{mod}.BiasRf.CommunicationType") == (int)CommunicationType.Ethernet && SC.GetValue($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.Comet) { AddCustomModuleDevice(new CometRF(mod, SC.GetStringValue($"{mod}.BiasRf.IPAddress"))); } if (SC.GetValue($"{mod}.BiasRf.EnableBiasRF") && SC.GetValue($"{mod}.BiasRf.CommunicationType") == (int)CommunicationType.RS232 && SC.GetValue($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.AdTec) { AddCustomModuleDevice(new AdTecGenerator(mod, "BiasRf")); } if (SC.GetValue($"{mod}.Chiller.EnableChiller") && SC.GetValue($"{mod}.Chiller.CommunicationType") == (int)CommunicationType.RS232 && SC.GetValue($"{mod}.Chiller.MFG") == (int)ChillerMFG.SMC) { AddCustomModuleDevice(new SMCChiller(mod, "Chiller")); } if (SC.GetValue($"{mod}.GridChiller.EnableChiller") && SC.GetValue($"{mod}.GridChiller.CommunicationType") == (int)CommunicationType.RS232 && SC.GetValue($"{mod}.GridChiller.MFG") == (int)ChillerMFG.SMC) { AddCustomModuleDevice(new SMCChiller(mod, "GridChiller")); } if (SC.GetValue($"{mod}.match.EnableMatch") && SC.GetValue($"{mod}.match.CommunicationType") == (int)CommunicationType.RS232 && SC.GetValue($"{mod}.match.MFG") == (int)MatchMFG.AdTec) { AddCustomModuleDevice(new AdTecMatch(mod, "match")); } if (SC.GetValue($"{mod}.BiasMatch.EnableBiasMatch") && SC.GetValue($"{mod}.BiasMatch.CommunicationType") == (int)CommunicationType.RS232 && SC.GetValue($"{mod}.BiasMatch.MFG") == (int)MatchMFG.AdTec) { AddCustomModuleDevice(new AdTecMatch(mod, "BiasMatch")); } if (SC.GetValue($"{mod}.DryPump.CommunicationType") == (int)CommunicationType.RS232) { if (SC.GetValue($"{mod}.DryPump.MFG") == (int)DryPumpMFG.SKY) { AddCustomModuleDevice(new SkyPump(mod)); } else if (SC.GetValue($"{mod}.DryPump.MFG") == (int)DryPumpMFG.Edwards) { AddCustomModuleDevice(new EdwardsPump(mod)); } } if (SC.GetValue($"{mod}.DryPump.MFG") == (int)DryPumpMFG.Kashiyama) AddCustomModuleDevice(new KashiyamaPump(mod)); AddCustomDevice(new JetPM(mod)); SmallPinWaferSize = MapWaferSize(SC.GetValue($"System.SmallWafer")); MediumPinWaferSize = MapWaferSize(SC.GetValue($"System.MidWafer")); BigPinWaferSize = MapWaferSize(SC.GetValue($"System.BigWafer")); if (SC.GetValue($"{mod}.EPD.IsEnabled") && SC.GetValue("System.SetUp.EPDInstalled")) { AddCustomModuleDevice(new EPDDevice(mod.ToString(), "EPD")); } } private WaferSize MapWaferSize(int value) { switch (value) { case 3: return WaferSize.WS3; case 4: return WaferSize.WS4; case 6: return WaferSize.WS6; case 8: return WaferSize.WS8; } return WaferSize.WS0; } private bool Invoke(string arg1, object[] args) { string name = (string)args[0]; string func = (string)args[1]; object[] param = new object[args.Length - 2]; for (int i = 2; i < args.Length; i++) param[i - 2] = args[i].ToString(); DEVICE.Do(string.Format("{0}.{1}", name, func), 0, true, param); return true; } } }