123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- 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<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<DataManager>.Instance.Initialize();
- RecipeFileManager.Instance.Initialize(new JetVirgoPMRecipeFileContext());
- AccountExManager.Instance.Initialize(true);
- Singleton<SystemConfigManager>.Instance.Initialize(PathManager.GetCfgDir() + "System.sccfg");
- 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, 3);
- Singleton<FAJobController>.Instance.JobCallBack = Singleton<EfemDualEquipment>.Instance;
- Singleton<EventManager>.Instance.SubscribeOperationAndData();
- Singleton<EventManager>.Instance.FireEvent += InstanceOnOnEvent;
- //VIDManager.Instance.Initialize(RtInstance.SystemName, false, true);
- }
- private void InstanceOnOnEvent(EventItem obj)
- {
- if (obj.Level != EventLevel.Alarm)
- {
- Singleton<FAJobController>.Instance.NotifyEvent(obj.EventEnum, obj.DVID, obj.ObjDVID);
- }
- else
- {
- Singleton<FAJobController>.Instance.NotifyAlarm(obj.EventEnum, obj.DVID, obj.ObjDVID);
- }
- }
- public void Terminate()
- {
-
- Singleton<SystemConfigManager>.Instance.Terminate();
- DataCollectionManager.Instance.Terminate();
- Singleton<WcfServiceManager>.Instance.Terminate();
- Singleton<EventManager>.Instance.Terminate();
- Singleton<LogManager>.Instance.Terminate();
- Singleton<DatabaseManager>.Instance.Terminate();
- }
- }
- }
|