SimulatorSystem.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using Aitex.Core.RT.DataCenter;
  2. using Aitex.Core.RT.IOCore;
  3. using Aitex.Core.RT.Log;
  4. using Aitex.Core.Util;
  5. using MECF.Framework.Common.Equipment;
  6. using MECF.Framework.Simulator.Core.Driver;
  7. using System;
  8. using System.Collections.Generic;
  9. using CyberX8_Simulator.Devices;
  10. using System.Threading;
  11. using CyberX8_Core;
  12. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.PMs;
  13. using System.Diagnostics.Eventing.Reader;
  14. namespace CyberX8_Simulator.Instances
  15. {
  16. public class SimulatorSystem : Singleton<SimulatorSystem>
  17. {
  18. private PeriodicJob _thread;
  19. private Random _rd = new Random();
  20. private RD_TRIG _trigATM = new RD_TRIG();
  21. private RD_TRIG _trigVAC = new RD_TRIG();
  22. private R_TRIG _trigLLExtend = new R_TRIG();
  23. private R_TRIG _trigLLRetract = new R_TRIG();
  24. private static int count = 0;
  25. private readonly float ATM_THRESHOLD = 750000;
  26. private readonly float ATM_PRESSURE = 760000;
  27. private readonly float ATM_LoadLock_PRESSURE = 760000;
  28. private readonly uint VAC_SW_PRESSURE = 9500;
  29. private readonly uint PROCESS_GAUGE = 10000;
  30. private Dictionary<ModuleName, DeviceSimulator> _MockDevices = new Dictionary<ModuleName, DeviceSimulator>();
  31. private Dictionary<ModuleName, JetChamber> jetChambers = new Dictionary<ModuleName, JetChamber>();
  32. public SimulatorSystem()
  33. {
  34. }
  35. ~SimulatorSystem()
  36. {
  37. _thread?.Stop();
  38. }
  39. public void Initialize()
  40. {
  41. Singleton<DataManager>.Instance.Initialize(false);
  42. _thread = new PeriodicJob(500, OnMonitor, nameof(SimulatorSystem), true);
  43. }
  44. private bool OnMonitor()
  45. {
  46. try
  47. {
  48. }
  49. catch (Exception e)
  50. {
  51. LOG.WriteExeption(e);
  52. }
  53. return true;
  54. }
  55. public void Terminate()
  56. {
  57. _thread.Stop();
  58. }
  59. public void SetCoolantOutletTemp(string module, int Temp)
  60. {
  61. }
  62. }
  63. }