123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- 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.Device;
- using Aitex.Core.RT.Device.Unit;
- using Aitex.Core.RT.Event;
- using Aitex.Core.RT.Key;
- 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.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 SorterRT.Modules;
- using Virgo_DCommon;
- using Virgo_DRT.Backends;
- using Virgo_DRT.Modules;
- namespace Virgo_DRT.Instances
- {
- class ToolLoader : IRtLoader
- {
- public void Initialize()
- {
- 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(null);
- Singleton<SystemConfigManager>.Instance.Initialize(PathManager.GetCfgDir() + "System.sccfg");
- IoProviderManager.Instance.Initialize(PathManager.GetCfgDir() + "IoProviderConfig.xml");
- IoManager.Instance.Initialize(PathManager.GetCfgDir() + "Interlock.Virgo_D.xml");
- WaferManager.Instance.Initialize();
- AccountExManager.Instance.Initialize(true);
- // Device manager
- Singleton<DeviceManager>.Instance.Initialize();
- Singleton<DeviceEntity>.Instance.Initialize();
- DataCollectionManager.Instance.Initialize(RtInstance.DatabaseName);
- KeyManager.Instance.Initialize(DEVICE.GetDevice<IoPlcDateTime>($"PMA.{Virgo_DDevice.PlcDateTime}"));
- RtSystemManager.Instance.AddCustomBackend("SC", new BackendSCConfigView());
- RtSystemManager.Instance.AddCustomBackend("IO", new IOView());
- RtSystemManager.Instance.AddCustomBackend("FSM", new FSMView());
- RtSystemManager.Instance.AddCustomBackend("License", new LicenseView());
- Singleton<RouteManager>.Instance.Initialize();
- LOG.Info("Virgo_DRT succeed to Launch");
- }
- public void Terminate()
- {
- Singleton<DeviceEntity>.Instance.Terminate();
- Singleton<DeviceManager>.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();
- }
- }
- }
|