EntityErrorRaiseTrigger.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using Aitex.Core.RT.Event;
  2. using Aitex.Core.Util;
  3. using MECF.Framework.Common.Equipment;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace Venus_RT.Modules
  10. {
  11. internal class EntityErrorRaiseTrigger
  12. {
  13. private static EntityErrorRaiseTrigger instance;
  14. //线程锁
  15. private static readonly object _Object = new object();
  16. private EntityErrorRaiseTrigger()
  17. {
  18. }
  19. public static EntityErrorRaiseTrigger GetInstance()
  20. {
  21. lock (_Object)
  22. {
  23. if (instance == null)
  24. {
  25. instance = new EntityErrorRaiseTrigger();
  26. }
  27. }
  28. return instance;
  29. }
  30. public event Action<ModuleName> EntityErrorRaiseChangedEvent;
  31. public void OnEntityErrorRaiseChanged(ModuleName moduleName)
  32. {
  33. EntityErrorRaiseChangedEvent?.Invoke(moduleName);
  34. }
  35. }
  36. }