Example #1
0
 public static void Load()
 {
     instance = JsonUtil.Deserialize <RTVPurgePrm>(pathRTVPurgePrm);
     if (instance == null)
     {
         instance = new RTVPurgePrm();
     }
 }
Example #2
0
        public Result DoPurge(Valve valve)
        {
            Result ret = Result.OK;

            if (RTVPurgePrm.Instance.Lines.Count == 0 ||
                RTVPurgePrm.Instance.CurrLineIndex >= RTVPurgePrm.Instance.Lines.Count ||
                RTVPurgePrm.Instance.CurrLineCycle > RTVPurgePrm.Instance.Cycles - 1)
            {
                return(Result.FAILED);
            }

            ret = this.ExecuteLine(RTVPurgePrm.Instance.Lines[RTVPurgePrm.Instance.CurrLineIndex].Item1,
                                   RTVPurgePrm.Instance.Lines[RTVPurgePrm.Instance.CurrLineIndex].Item2, RTVPurgePrm.Instance.posZ,
                                   RTVPurgePrm.Instance.Vel, RTVPurgePrm.Instance.DispenseDelay);

            //如果当前清洗线的执行次数等于设定的次数,则要跳到下一条清洗线
            if (RTVPurgePrm.Instance.CurrLineCycle == RTVPurgePrm.Instance.Cycles - 1)
            {
                RTVPurgePrm.Instance.CurrLineCycle = 0;

                //如果是最后一条清洗线,报警处理。
                if (RTVPurgePrm.Instance.CurrLineIndex == RTVPurgePrm.Instance.Lines.Count - 1)
                {
                    RTVPurgePrm.Instance.CurrLineIndex = 0;
                    AlarmServer.Instance.Fire(this, ErrorPurge);
                }
                else
                {
                    RTVPurgePrm.Instance.CurrLineIndex++;
                }
            }
            else
            {
                RTVPurgePrm.Instance.CurrLineCycle++;
            }

            RTVPurgePrm.Save();
            return(ret);
        }