123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- 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<LogManager>.Instance.Initialize();
- string s1 = System.Diagnostics.FileVersionInfo.GetVersionInfo(Path.Combine(PathManager.GetAppDir(), "EfemDualRT.exe")).ProductVersion;
- LOG.Write($"RT {s1} launch ...");
- Singleton<ConfigManager>.Instance.Initialize();
- Singleton<DatabaseManager>.Instance.Initialize(
- System.Configuration.ConfigurationManager.ConnectionStrings["PostgreSQL"].ConnectionString
- , RtInstance.DatabaseName
- , PathManager.GetCfgDir() + "DBModel.sql");
- Singleton<EventManager>.Instance.Initialize(PathManager.GetCfgDir() + "EventDefine.xml");
- Singleton<OperationManager>.Instance.Initialize();
- Singleton<SystemConfigManager>.Instance.Initialize(PathManager.GetCfgDir() + "System.sccfg");
- Singleton<LogManager>.Instance.InitLogDirectory();
- Singleton<DataManager>.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<EfemDualEquipment>.Instance.Initialize();
- //Singleton<FAJobController>.Instance.Initialize(RtInstance.SystemName, SC.GetLPInstalledCount());
- //Singleton<FAJobController>.Instance.JobCallBack = Singleton<EfemDualEquipment>.Instance;
- SecGemApplication.Instance.Initialize(PathManager.GetCfgDir() + "EquipmentVariables.xml",3);
- SecGemApplication.Instance.EquipmentCommand = Singleton<EfemDualEquipment>.Instance;
- Singleton<EventManager>.Instance.SubscribeOperationAndData();
- Singleton<EventManager>.Instance.FireEvent += InstanceOnOnEvent;
- CustomFAEvents.Initialize();
- //VIDManager.Instance.Initialize(RtInstance.SystemName, false, true);
- Singleton<ResourceMonitor>.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<ResourceMonitor>.Instance.Terminate();
- Singleton<EfemDualEquipment>.Instance.Terminate();
- DEVICE.Managers.ForEach(p=>p.Terminate());
- IoProviderManager.Instance.Terminate();
- Singleton<SystemConfigManager>.Instance.Terminate();
- DataCollectionManager.Instance.Terminate();
- Singleton<WcfServiceManager>.Instance.Terminate();
- Singleton<EventManager>.Instance.Terminate();
- Singleton<LogManager>.Instance.Terminate();
- Singleton<DatabaseManager>.Instance.Terminate();
- }
- }
- }
|