123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- using Aitex.Core.RT.SCCore;
- using MECF.Framework.Common.CommonData;
- using Newtonsoft.Json;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace MECF.Framework.Common.RecipeCenter
- {
- public class QdrRecipe : NotifiableItem
- {
- #region 内部变量
- private string _author;
- private string _description;
- private string _ppid;
- private RecipeType _recipeType = RecipeType.DEP;
- private DateTime _saveDate;
- private DateTime _createDate;
- private int _step1DwellTimeSeconds;
- private int _step1NumberOfRinse;
- private bool _step1N2BubbleOn;
- private int _step1NumberOfDumpToMetalDrain;
- public int _step2DwellTimeSeconds;
- private bool _step2N2BubbleOn;
- private int _step2NumberOfRinse;
- private bool _finalRinseDry;
- private int _finalRinsePulseClampTime;
- private int _finalRinseSlowDrainTime;
- private int _resistivityDurationSeconds;
- private int _resistivityStartTimeSeconds;
- private int _resistivityMegaOhms;
- private int _n2ChargeTimeSeconds=5;
- private int _dumpTimeSeconds=3;
- #endregion
- #region 属性
- [JsonProperty]
- public string Author { get { return _author; } set { _author = value; InvokePropertyChanged(nameof(Author)); } }
- [JsonProperty]
- public string Description { get { return _description; } set { _description = value; InvokePropertyChanged(nameof(Description)); } }
- [JsonProperty]
- public string Ppid { get { return _ppid; } set { _ppid = value; InvokePropertyChanged(nameof(Ppid)); } }
- [JsonProperty]
- public RecipeType RecipeType { get { return _recipeType; } set { _recipeType = value; InvokePropertyChanged(nameof(RecipeType)); } }
- [JsonProperty]
- public DateTime CreateDate { get { return _createDate; } set { _createDate = value; InvokePropertyChanged(nameof(CreateDate)); } }
- [JsonProperty]
- public DateTime SaveDate { get { return _saveDate; } set { _saveDate = value; InvokePropertyChanged(nameof(SaveDate)); } }
- [JsonProperty]
- public int Step1DwellTimeSeconds{ get { return _step1DwellTimeSeconds; } set { _step1DwellTimeSeconds = value; InvokePropertyChanged(nameof(Step1DwellTimeSeconds)); }}
- [JsonProperty]
- public int Step1NumberOfRinse { get { return _step1NumberOfRinse;} set { _step1NumberOfRinse = value;InvokePropertyChanged(nameof(Step1NumberOfRinse)); }}
- [JsonProperty]
- public bool Step1N2BubbleOn { get { return _step1N2BubbleOn; } set { _step1N2BubbleOn = value; InvokePropertyChanged(nameof(Step1N2BubbleOn)); }}
- [JsonProperty]
- public int Step1NumberOfDumpToMetalDrain { get { return _step1NumberOfDumpToMetalDrain; } set { _step1NumberOfDumpToMetalDrain = value;InvokePropertyChanged(nameof(Step1NumberOfDumpToMetalDrain)); } }
- [JsonProperty]
- public int Step2DwellTimeSeconds { get { return _step2DwellTimeSeconds; } set { _step2DwellTimeSeconds = value; InvokePropertyChanged(nameof(Step2DwellTimeSeconds)); } }
- [JsonProperty]
- public bool Step2N2BubbleOn { get { return _step2N2BubbleOn; } set { _step2N2BubbleOn = value;InvokePropertyChanged(nameof(Step2N2BubbleOn)); } }
- [JsonProperty]
- public int Step2NumberOfRinse { get { return _step2NumberOfRinse; } set { _step2NumberOfRinse = value;InvokePropertyChanged(nameof(Step2NumberOfRinse)); } }
- [JsonProperty]
- public bool FinalRinseDry { get { return _finalRinseDry; } set { _finalRinseDry = value;InvokePropertyChanged(nameof(FinalRinseDry)); } }
- [JsonProperty]
- public int FinalRinsePulseClampTime { get { return _finalRinsePulseClampTime; } set { _finalRinsePulseClampTime = value;InvokePropertyChanged(nameof(FinalRinsePulseClampTime)); } }
- [JsonProperty]
- public int FinalRinseSlowDrainTime { get { return _finalRinseSlowDrainTime; } set { _finalRinseSlowDrainTime = value;InvokePropertyChanged(nameof(FinalRinseSlowDrainTime)); } }
- [JsonProperty]
- public int ResistivityDurationSeconds { get { return _resistivityDurationSeconds; } set { _resistivityDurationSeconds = value; InvokePropertyChanged(nameof(ResistivityDurationSeconds)); }}
- [JsonProperty]
- public int ResistivityStartTimeSeconds { get { return _resistivityStartTimeSeconds; } set { _resistivityStartTimeSeconds = value; InvokePropertyChanged(nameof(ResistivityStartTimeSeconds)); } }
- [JsonProperty]
- public int ResistivityMegaOhms { get { return _resistivityMegaOhms; } set { _resistivityMegaOhms = value;InvokePropertyChanged(nameof(ResistivityMegaOhms)); } }
- [JsonProperty]
- public int N2ChargeTimeSeconds { get { return _n2ChargeTimeSeconds!=0?_n2ChargeTimeSeconds:5; } set { _n2ChargeTimeSeconds = value; InvokePropertyChanged(nameof(N2ChargeTimeSeconds)); } }
- [JsonProperty]
- public int DumpTimeSeconds { get { return _dumpTimeSeconds!=0?_dumpTimeSeconds:3; } set { _dumpTimeSeconds = value; InvokePropertyChanged(nameof(DumpTimeSeconds)); } }
- #endregion
- /// <summary>
- /// 计算时间
- /// </summary>
- /// <param name="_recipe"></param>
- /// <param name="cycle"></param>
- /// <returns></returns>
- public int CalculateRunRecipeTime()
- {
- int concurrentFillTimeSeconds = SC.GetValue<int>("QDR.ConcurrentFillTimeSeconds");
- int totaltime = 0;
- Dictionary<string, int> processTimeDic = new Dictionary<string, int>();
- processTimeDic.Add("RinseFirstStep.WaitDrianEmpty", DumpTimeSeconds);
- if (Step1N2BubbleOn)
- {
- processTimeDic.Add("RinseFirstStep.N2BubbleOnDelay", this.N2ChargeTimeSeconds);
- }
- processTimeDic.Add("RinseFirstStep.Recipe_FirstRinseCycleWaitEndFillTime", concurrentFillTimeSeconds * Step1NumberOfRinse);
- processTimeDic.Add("RinseFirstStep.Recipe_FirstRinseCycleWaitDwell", Step1DwellTimeSeconds * Step1NumberOfRinse);
- processTimeDic.Add("RinseFirstStep.Recipe_FirstRinseCycleWaitDrainExtraTime", DumpTimeSeconds * Step1NumberOfRinse);
- if (!FinalRinseDry) //没有第三步rinse
- {
- processTimeDic.Add("RinseSecondStep.Recipe_SecondRinseCycleWaitEndFillTime", concurrentFillTimeSeconds * Step2NumberOfRinse);
- processTimeDic.Add("RinseSecondStep.Recipe_SecondRinseCycleWaitDwell", Step2DwellTimeSeconds * (Step2NumberOfRinse - 1));
- processTimeDic.Add("RinseSecondStep.Recipe_SecondRinseCycleWaitDrainExtraTime", DumpTimeSeconds * Step2NumberOfRinse);
- processTimeDic.Add("RinseSecondStep.Recipe_SecondRinseCycleWaitResistivityStart", ResistivityStartTimeSeconds);
- processTimeDic.Add("RinseSecondStep.Recipe_SecondRinseCycleResistivityAveraging", ResistivityDurationSeconds);
- }
- else //有第三步rinse
- {
- processTimeDic.Add("RinseSecondStep.Recipe_SecondRinseCycleWaitEndFillTime", concurrentFillTimeSeconds * Step2NumberOfRinse);
- processTimeDic.Add("RinseSecondStep.Recipe_SecondRinseCycleWaitDwell", Step2DwellTimeSeconds * Step2NumberOfRinse);
- processTimeDic.Add("RinseSecondStep.Recipe_SecondRinseCycleWaitDrainExtraTime", DumpTimeSeconds * Step2NumberOfRinse);
- processTimeDic.Add("RinseThirdStep.Recipe_ThirdRinseWaitEndFillTime", concurrentFillTimeSeconds);
- processTimeDic.Add("RinseThirdStep.Recipe_ThirdRinseCycleWaitSlowDrainTime", FinalRinseSlowDrainTime);
- processTimeDic.Add("RinseThirdStep.Recipe_ThirdRinseCycleWaitDrainExtraTime", DumpTimeSeconds);
- }
- totaltime = processTimeDic.Sum(x => x.Value);
- return totaltime;
- }
- }
- }
|