QdrRecipe.cs 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. using Aitex.Core.RT.SCCore;
  2. using MECF.Framework.Common.CommonData;
  3. using Newtonsoft.Json;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace MECF.Framework.Common.RecipeCenter
  10. {
  11. public class QdrRecipe : NotifiableItem
  12. {
  13. #region 内部变量
  14. private string _author;
  15. private string _description;
  16. private string _ppid;
  17. private RecipeType _recipeType = RecipeType.DEP;
  18. private DateTime _saveDate;
  19. private DateTime _createDate;
  20. private int _step1DwellTimeSeconds;
  21. private int _step1NumberOfRinse;
  22. private bool _step1N2BubbleOn;
  23. private int _step1NumberOfDumpToMetalDrain;
  24. public int _step2DwellTimeSeconds;
  25. private bool _step2N2BubbleOn;
  26. private int _step2NumberOfRinse;
  27. private bool _finalRinseDry;
  28. private int _finalRinsePulseClampTime;
  29. private int _finalRinseSlowDrainTime;
  30. private int _resistivityDurationSeconds;
  31. private int _resistivityStartTimeSeconds;
  32. private int _resistivityMegaOhms;
  33. private int _n2ChargeTimeSeconds=5;
  34. private int _dumpTimeSeconds=3;
  35. #endregion
  36. #region 属性
  37. [JsonProperty]
  38. public string Author { get { return _author; } set { _author = value; InvokePropertyChanged(nameof(Author)); } }
  39. [JsonProperty]
  40. public string Description { get { return _description; } set { _description = value; InvokePropertyChanged(nameof(Description)); } }
  41. [JsonProperty]
  42. public string Ppid { get { return _ppid; } set { _ppid = value; InvokePropertyChanged(nameof(Ppid)); } }
  43. [JsonProperty]
  44. public RecipeType RecipeType { get { return _recipeType; } set { _recipeType = value; InvokePropertyChanged(nameof(RecipeType)); } }
  45. [JsonProperty]
  46. public DateTime CreateDate { get { return _createDate; } set { _createDate = value; InvokePropertyChanged(nameof(CreateDate)); } }
  47. [JsonProperty]
  48. public DateTime SaveDate { get { return _saveDate; } set { _saveDate = value; InvokePropertyChanged(nameof(SaveDate)); } }
  49. [JsonProperty]
  50. public int Step1DwellTimeSeconds{ get { return _step1DwellTimeSeconds; } set { _step1DwellTimeSeconds = value; InvokePropertyChanged(nameof(Step1DwellTimeSeconds)); }}
  51. [JsonProperty]
  52. public int Step1NumberOfRinse { get { return _step1NumberOfRinse;} set { _step1NumberOfRinse = value;InvokePropertyChanged(nameof(Step1NumberOfRinse)); }}
  53. [JsonProperty]
  54. public bool Step1N2BubbleOn { get { return _step1N2BubbleOn; } set { _step1N2BubbleOn = value; InvokePropertyChanged(nameof(Step1N2BubbleOn)); }}
  55. [JsonProperty]
  56. public int Step1NumberOfDumpToMetalDrain { get { return _step1NumberOfDumpToMetalDrain; } set { _step1NumberOfDumpToMetalDrain = value;InvokePropertyChanged(nameof(Step1NumberOfDumpToMetalDrain)); } }
  57. [JsonProperty]
  58. public int Step2DwellTimeSeconds { get { return _step2DwellTimeSeconds; } set { _step2DwellTimeSeconds = value; InvokePropertyChanged(nameof(Step2DwellTimeSeconds)); } }
  59. [JsonProperty]
  60. public bool Step2N2BubbleOn { get { return _step2N2BubbleOn; } set { _step2N2BubbleOn = value;InvokePropertyChanged(nameof(Step2N2BubbleOn)); } }
  61. [JsonProperty]
  62. public int Step2NumberOfRinse { get { return _step2NumberOfRinse; } set { _step2NumberOfRinse = value;InvokePropertyChanged(nameof(Step2NumberOfRinse)); } }
  63. [JsonProperty]
  64. public bool FinalRinseDry { get { return _finalRinseDry; } set { _finalRinseDry = value;InvokePropertyChanged(nameof(FinalRinseDry)); } }
  65. [JsonProperty]
  66. public int FinalRinsePulseClampTime { get { return _finalRinsePulseClampTime; } set { _finalRinsePulseClampTime = value;InvokePropertyChanged(nameof(FinalRinsePulseClampTime)); } }
  67. [JsonProperty]
  68. public int FinalRinseSlowDrainTime { get { return _finalRinseSlowDrainTime; } set { _finalRinseSlowDrainTime = value;InvokePropertyChanged(nameof(FinalRinseSlowDrainTime)); } }
  69. [JsonProperty]
  70. public int ResistivityDurationSeconds { get { return _resistivityDurationSeconds; } set { _resistivityDurationSeconds = value; InvokePropertyChanged(nameof(ResistivityDurationSeconds)); }}
  71. [JsonProperty]
  72. public int ResistivityStartTimeSeconds { get { return _resistivityStartTimeSeconds; } set { _resistivityStartTimeSeconds = value; InvokePropertyChanged(nameof(ResistivityStartTimeSeconds)); } }
  73. [JsonProperty]
  74. public int ResistivityMegaOhms { get { return _resistivityMegaOhms; } set { _resistivityMegaOhms = value;InvokePropertyChanged(nameof(ResistivityMegaOhms)); } }
  75. [JsonProperty]
  76. public int N2ChargeTimeSeconds { get { return _n2ChargeTimeSeconds!=0?_n2ChargeTimeSeconds:5; } set { _n2ChargeTimeSeconds = value; InvokePropertyChanged(nameof(N2ChargeTimeSeconds)); } }
  77. [JsonProperty]
  78. public int DumpTimeSeconds { get { return _dumpTimeSeconds!=0?_dumpTimeSeconds:3; } set { _dumpTimeSeconds = value; InvokePropertyChanged(nameof(DumpTimeSeconds)); } }
  79. #endregion
  80. /// <summary>
  81. /// 计算时间
  82. /// </summary>
  83. /// <param name="_recipe"></param>
  84. /// <param name="cycle"></param>
  85. /// <returns></returns>
  86. public int CalculateRunRecipeTime()
  87. {
  88. int concurrentFillTimeSeconds = SC.GetValue<int>("QDR.ConcurrentFillTimeSeconds");
  89. int totaltime = 0;
  90. Dictionary<string, int> processTimeDic = new Dictionary<string, int>();
  91. processTimeDic.Add("RinseFirstStep.WaitDrianEmpty", DumpTimeSeconds);
  92. if (Step1N2BubbleOn)
  93. {
  94. processTimeDic.Add("RinseFirstStep.N2BubbleOnDelay", this.N2ChargeTimeSeconds);
  95. }
  96. processTimeDic.Add("RinseFirstStep.Recipe_FirstRinseCycleWaitEndFillTime", concurrentFillTimeSeconds * Step1NumberOfRinse);
  97. processTimeDic.Add("RinseFirstStep.Recipe_FirstRinseCycleWaitDwell", Step1DwellTimeSeconds * Step1NumberOfRinse);
  98. processTimeDic.Add("RinseFirstStep.Recipe_FirstRinseCycleWaitDrainExtraTime", DumpTimeSeconds * Step1NumberOfRinse);
  99. if (!FinalRinseDry) //没有第三步rinse
  100. {
  101. processTimeDic.Add("RinseSecondStep.Recipe_SecondRinseCycleWaitEndFillTime", concurrentFillTimeSeconds * Step2NumberOfRinse);
  102. processTimeDic.Add("RinseSecondStep.Recipe_SecondRinseCycleWaitDwell", Step2DwellTimeSeconds * (Step2NumberOfRinse - 1));
  103. processTimeDic.Add("RinseSecondStep.Recipe_SecondRinseCycleWaitDrainExtraTime", DumpTimeSeconds * Step2NumberOfRinse);
  104. processTimeDic.Add("RinseSecondStep.Recipe_SecondRinseCycleWaitResistivityStart", ResistivityStartTimeSeconds);
  105. processTimeDic.Add("RinseSecondStep.Recipe_SecondRinseCycleResistivityAveraging", ResistivityDurationSeconds);
  106. }
  107. else //有第三步rinse
  108. {
  109. processTimeDic.Add("RinseSecondStep.Recipe_SecondRinseCycleWaitEndFillTime", concurrentFillTimeSeconds * Step2NumberOfRinse);
  110. processTimeDic.Add("RinseSecondStep.Recipe_SecondRinseCycleWaitDwell", Step2DwellTimeSeconds * Step2NumberOfRinse);
  111. processTimeDic.Add("RinseSecondStep.Recipe_SecondRinseCycleWaitDrainExtraTime", DumpTimeSeconds * Step2NumberOfRinse);
  112. processTimeDic.Add("RinseThirdStep.Recipe_ThirdRinseWaitEndFillTime", concurrentFillTimeSeconds);
  113. processTimeDic.Add("RinseThirdStep.Recipe_ThirdRinseCycleWaitSlowDrainTime", FinalRinseSlowDrainTime);
  114. processTimeDic.Add("RinseThirdStep.Recipe_ThirdRinseCycleWaitDrainExtraTime", DumpTimeSeconds);
  115. }
  116. totaltime = processTimeDic.Sum(x => x.Value);
  117. return totaltime;
  118. }
  119. }
  120. }