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 MECF.Framework.FA.Core.CommonTypes; using MECF.Framework.FA.Core.FAControl; 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(); RecipeFileManager.Instance.Initialize(new JetVirgoPMRecipeFileContext()); AccountExManager.Instance.Initialize(true); Singleton.Instance.Initialize(PathManager.GetCfgDir() + "System.sccfg"); 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, 3); Singleton.Instance.JobCallBack = Singleton.Instance; Singleton.Instance.SubscribeOperationAndData(); Singleton.Instance.FireEvent += InstanceOnOnEvent; //VIDManager.Instance.Initialize(RtInstance.SystemName, false, true); } private void InstanceOnOnEvent(EventItem obj) { if (obj.Level != EventLevel.Alarm) { Singleton.Instance.NotifyEvent(obj.EventEnum, obj.DVID, obj.ObjDVID); } else { Singleton.Instance.NotifyAlarm(obj.EventEnum, obj.DVID, obj.ObjDVID); } } public void Terminate() { Singleton.Instance.Terminate(); DataCollectionManager.Instance.Terminate(); Singleton.Instance.Terminate(); Singleton.Instance.Terminate(); Singleton.Instance.Terminate(); Singleton.Instance.Terminate(); } } }