123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- using System;
- using System.Collections.Generic;
- using System.IO;
- using Aitex.Common.Util;
- using Aitex.Core.Account;
- 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.Equipment;
- using MECF.Framework.Common.IOCore;
- using MECF.Framework.Common.RecipeCenter;
- 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 Venus_RT.Modules;
- //using VirgoCommon;
- using Venus_RT.Backends;
- using Venus_RT.HostWrapper;
- //using Venus_RT.Modules;
- using Venus_RT.Modules.PMs;
- using MECF.Framework.Common.OperationCenter;
- using MECF.Framework.Common.DataCenter;
- namespace Venus_RT.Instances
- {
- class ToolLoader : IRtLoader
- {
- public void Initialize()
- {
- //WcfServiceManager.Instance.Initialize(new Type[]
- // {
- // typeof (AccountService), typeof (InvokeService),
- // typeof (QueryDataService),typeof (RecipeService)
- // });
- WcfServiceManager.Instance.Initialize(new Type[]
- {
- typeof (RecipeService)
- });
- Singleton<LogManager>.Instance.Initialize();
- 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 VirgoRecipeFileContext(), new VirgoSequenceFileContext(), true);
- Singleton<SystemConfigManager>.Instance.Initialize(PathManager.GetCfgDir() + "System.sccfg");
- //IoProviderManager.Instance.Initialize(PathManager.GetCfgDir() + "IoProviderConfig.xml");
- //IoManager.Instance.Initialize(PathManager.GetCfgDir() + "Interlock.Virgo.xml");
- //WaferManager.Instance.Initialize();
- //AccountExManager.Instance.Initialize(true);
- // Device manager
- //Singleton<DeviceManager>.Instance.Initialize();
- //Singleton<DeviceEntity>.Instance.Initialize();
- //Singleton<FaManager>.Instance.Initialize();
- //DataCollectionManager.Instance.Initialize(RtInstance.DatabaseName);
- RtSystemManager.Instance.AddCustomBackend("SC", new BackendSCConfigView());
- RtSystemManager.Instance.AddCustomBackend("IO", new IOView());
- RtSystemManager.Instance.AddCustomBackend("FSM", new FSMView());
- //Singleton<RouteManager>.Instance.Initialize();
- //Singleton<EventManager>.Instance.FireEvent += InstanceOnOnEvent;
- string s1 = System.Diagnostics.FileVersionInfo.GetVersionInfo(Path.Combine(PathManager.GetAppDir(), "Venus_RT.exe")).ProductVersion;
- LOG.Info($"Venus_RT {s1} succeed to Launch");
- }
- private void InstanceOnOnEvent(EventItem obj)
- {
- if (obj.Level != EventLevel.Alarm)
- {
- Singleton<FaManager>.Instance.NotifyEvent(obj.EventEnum, obj.DVID, obj.ObjDVID);
- }
- else
- {
- Singleton<FaManager>.Instance.NotifyAlarm(obj.EventEnum, obj.DVID, obj.ObjDVID, obj.Description);
- }
- }
- public void Terminate()
- {
- Singleton<DeviceEntity>.Instance.Terminate();
- Singleton<DeviceManager>.Instance.Terminate();
- Singleton<FaManager>.Instance.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();
- }
- }
- }
|