ModuleManager.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System.Collections.Generic;
  2. using MECF.Framework.Common.DataCenter;
  3. using OpenSEMI.ClientBase;
  4. namespace VirgoUI.Client
  5. {
  6. public static class ModuleManager
  7. {
  8. /// <summary>
  9. /// all module need init
  10. /// </summary>
  11. public static readonly List<string> ModulesID = new List<string>()
  12. {
  13. "EfemRobot","Aligner1","Aligner2","Cooling1","Cooling2","LP1", "LP2"
  14. };
  15. public static Dictionary<string, ModuleInfo> ModuleInfos { get; private set; } = new Dictionary<string, ModuleInfo>();
  16. static ModuleManager()
  17. {
  18. bool bInstalledA = (bool)QueryDataClient.Instance.Service.GetConfig("System.PMAIsInstalled");
  19. if (bInstalledA)
  20. ModulesID.Add("PMA");
  21. bool bInstalledB = (bool)QueryDataClient.Instance.Service.GetConfig("System.PMBIsInstalled");
  22. if (bInstalledB)
  23. ModulesID.Add("PMB");
  24. }
  25. public static void Initialize()
  26. {
  27. ModuleInfos.Clear();
  28. foreach (string moduleID in ModulesID)
  29. {
  30. ModuleInfo modInfo = CreateModule(moduleID, true);
  31. ModuleInfos.Add(moduleID, modInfo);
  32. }
  33. }
  34. private static ModuleInfo CreateModule(string p_modid, bool p_install)
  35. {
  36. ModuleInfo m_data;
  37. if (p_install)
  38. m_data = new ModuleInfo(p_modid, p_install, VirgoUI.Client.ClientApp.Instance.WaferStatusManager.WaferStatusDic[p_modid], false);
  39. else
  40. m_data = new ModuleInfo(p_modid, p_install, null, false);
  41. return m_data;
  42. }
  43. }
  44. }