using System; using System.Collections.Generic; using Aitex.Common.Util; using Aitex.Core.RT.ConfigCenter; using Aitex.Core.RT.DataCenter; using Aitex.Core.RT.DataCollection; using Aitex.Core.RT.DBCore; using Aitex.Core.RT.Event; using Aitex.Core.RT.Log; using Aitex.Core.RT.OperationCenter; using Aitex.Core.RT.RecipeCenter; using Aitex.Core.Util; using Aitex.Core.WCF; using MECF.Framework.Common.Account; using MECF.Framework.Common.Communications; using MECF.Framework.Common.Equipment; using MECF.Framework.Common.FAServices; using MECF.Framework.Common.IOCore; using MECF.Framework.Common.SCCore; using MECF.Framework.Common.SubstrateTrackings; using MECF.Framework.RT.Core.Applications; using MECF.Framework.RT.Core.Backend; using MECF.Framework.RT.Core.IoProviders; using System.IO; using EfemDualRT.Equipments.Systems; using JetVirgoPM.PMs.RecipeExecutors; using Aitex.Core.RT.SCCore; using SecsGem.Core.Application; using Aitex.Core.RT.Device; using EfemDualRT.Resources; namespace EfemDualRT.Instances { class ToolLoader : IRtLoader { public void Initialize() { Singleton.Instance.Initialize(); string s1 = System.Diagnostics.FileVersionInfo.GetVersionInfo(Path.Combine(PathManager.GetAppDir(), "EfemDualRT.exe")).ProductVersion; LOG.Write($"RT {s1} launch ..."); Singleton.Instance.Initialize(); Singleton.Instance.Initialize( System.Configuration.ConfigurationManager.ConnectionStrings["PostgreSQL"].ConnectionString , RtInstance.DatabaseName , PathManager.GetCfgDir() + "DBModel.sql"); Singleton.Instance.Initialize(PathManager.GetCfgDir() + "EventDefine.xml"); Singleton.Instance.Initialize(); Singleton.Instance.Initialize(PathManager.GetCfgDir() + "System.sccfg"); Singleton.Instance.InitLogDirectory(); Singleton.Instance.Initialize(); RecipeFileManager.Instance.Initialize(new JetVirgoPMRecipeFileContext()); AccountExManager.Instance.Initialize(true); ConnectionManager.Instance.Initialize(); WaferManager.Instance.Initialize(); DataCollectionManager.Instance.Initialize( RtInstance.DatabaseName); RtSystemManager.Instance.AddCustomBackend("SC", new BackendSCConfigView()); Singleton.Instance.Initialize(); //Singleton.Instance.Initialize(RtInstance.SystemName, SC.GetLPInstalledCount()); //Singleton.Instance.JobCallBack = Singleton.Instance; SecGemApplication.Instance.Initialize(PathManager.GetCfgDir() + "EquipmentVariables.xml",3); SecGemApplication.Instance.EquipmentCommand = Singleton.Instance; Singleton.Instance.SubscribeOperationAndData(); Singleton.Instance.FireEvent += InstanceOnOnEvent; CustomFAEvents.Initialize(); //VIDManager.Instance.Initialize(RtInstance.SystemName, false, true); Singleton.Instance.Initialize(); } private void InstanceOnOnEvent(EventItem obj) { if (obj.Level != EventLevel.Alarm) { SecGemApplication.Instance.NotifyEvent(obj.EventEnum, obj.DVID, obj.ObjDVID); } else { SecGemApplication.Instance.NotifyAlarm(obj.EventEnum, obj.DVID, obj.ObjDVID); } } public void Terminate() { Singleton.Instance.Terminate(); Singleton.Instance.Terminate(); DEVICE.Managers.ForEach(p=>p.Terminate()); IoProviderManager.Instance.Terminate(); Singleton.Instance.Terminate(); DataCollectionManager.Instance.Terminate(); Singleton.Instance.Terminate(); Singleton.Instance.Terminate(); Singleton.Instance.Terminate(); Singleton.Instance.Terminate(); } } }