| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 | 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 VirgoCommon;using VirgoRT.Devices;namespace VirgoRT.Instances{    public class DeviceEntity : DeviceEntityT<DeviceManager>    {        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\\", GetDeviceModelFileName());        }        private string GetDeviceModelFileName()        {            return (SC.ContainsItem("System.ChamberType") && SC.GetValue<int>("System.ChamberType") == (int)JetChamber.VirgoR) ? RtInstance.DeviceModelFileName_R : RtInstance.DeviceModelFileName;        }        public override bool Initialize()        {            if (ModuleHelper.IsInstalled(ModuleName.PMA))                InitPM(ModuleName.PMA);            if (ModuleHelper.IsInstalled(ModuleName.PMB))                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<int>($"{mod}.Rf.CommunicationType") == (int)CommunicationType.RS232 &&                SC.GetValue<int>($"{mod}.Rf.MFG") == (int)GeneratorMFG.AdTec)            {                AddCustomModuleDevice(new AdTecGenerator(mod));            }            if (SC.GetValue<bool>($"{mod}.BiasRf.EnableBiasRF") &&                SC.GetValue<int>($"{mod}.BiasRf.CommunicationType") == (int)CommunicationType.Ethernet &&                SC.GetValue<int>($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.Comet)            {                AddCustomModuleDevice(new CometRF(mod, SC.GetStringValue($"{mod}.BiasRf.IPAddress")));            }            if (SC.GetValue<bool>($"{mod}.Chiller.EnableChiller") &&                SC.GetValue<int>($"{mod}.Chiller.CommunicationType") == (int)CommunicationType.RS232 &&                SC.GetValue<int>($"{mod}.Chiller.MFG") == (int)ChillerMFG.SMC)            {                AddCustomModuleDevice(new SMCChiller(mod, "Chiller"));            }            if (SC.GetValue<bool>($"{mod}.GridChiller.EnableChiller") &&                SC.GetValue<int>($"{mod}.GridChiller.CommunicationType") == (int)CommunicationType.RS232 &&                SC.GetValue<int>($"{mod}.GridChiller.MFG") == (int)ChillerMFG.SMC)            {                AddCustomModuleDevice(new SMCChiller(mod, "GridChiller"));            }            if (SC.GetValue<bool>($"{mod}.match.EnableMatch") &&                SC.GetValue<int>($"{mod}.match.CommunicationType") == (int)CommunicationType.RS232 &&                SC.GetValue<int>($"{mod}.match.MFG") == (int)MatchMFG.AdTec)            {                AddCustomModuleDevice(new AdTecMatch(mod));            }            if (SC.GetValue<bool>($"{mod}.match.EnableMatch") &&               SC.GetValue<int>($"{mod}.match.CommunicationType") == (int)CommunicationType.Ethernet &&               SC.GetValue<int>($"{mod}.match.MFG") == (int)MatchMFG.Revtech)            {                AddCustomModuleDevice(new RevtechMatch(mod, VirgoDevice.Match.ToString(), VirgoDevice.Match.ToString().ToLower()));            }            if (SC.GetValue<bool>($"{mod}.BiasRf.EnableBiasRF") &&                SC.GetValue<int>($"{mod}.BiasRf.CommunicationType") == (int)CommunicationType.RS232 &&                SC.GetValue<int>($"{mod}.BiasRf.MFG") == (int)GeneratorMFG.AdTec)            {                AddCustomModuleDevice(new AdTecGenerator(mod, VirgoDevice.BiasRf.ToString()));            }            if (SC.GetValue<bool>($"{mod}.BiasMatch.EnableBiasMatch") &&                SC.GetValue<int>($"{mod}.BiasMatch.CommunicationType") == (int)CommunicationType.Ethernet &&                SC.GetValue<int>($"{mod}.BiasMatch.MFG") == (int)MatchMFG.Revtech)            {                AddCustomModuleDevice(new RevtechMatch(mod, VirgoDevice.BiasMatch.ToString(), VirgoDevice.BiasMatch.ToString()));            }            if (SC.GetValue<int>($"{mod}.DryPump.CommunicationType") == (int)CommunicationType.RS232)            {                if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.SKY)                {                    AddCustomModuleDevice(new SkyPump(mod));                }                else if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.Edwards)                {                    AddCustomModuleDevice(new EdwardsPump(mod));                }            }            AddCustomDevice(new JetPM(mod));            SmallPinWaferSize = MapWaferSize(SC.GetValue<int>($"System.SmallWafer"));            MediumPinWaferSize = MapWaferSize(SC.GetValue<int>($"System.MidWafer"));            BigPinWaferSize = MapWaferSize(SC.GetValue<int>($"System.BigWafer"));            if (SC.GetValue<bool>($"{mod}.EPD.IsEnabled") && SC.GetValue<bool>("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;        }    }}
 |