Beispiel #1
0
 public void EditSampleList(RollerSampleInfo rsi)
 {
     lock (rollersampleinfos)
     {
         int index = this.rollersampleinfos.FindIndex(x => x.RollerSampleInfoID == rsi.RollerSampleInfoID);
         if (!index.Equals(-1))
         {
             this.rollersampleinfos.RemoveAt(index);
             this.rollersampleinfos.Add(rsi);
         }
     }
 }
Beispiel #2
0
        public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
        {
            RollerSampleInfo rollersampleinfo = validationContext.ObjectInstance as RollerSampleInfo;

            if (rollersampleinfo.SetValue > rollersampleinfo.UpLimit || rollersampleinfo.SetValue < rollersampleinfo.DnLimit)
            {
                yield return(new ValidationResult("设定值不符合要求", new string[] { "SetValue" }));
            }
            if (rollersampleinfo.UpLimit < rollersampleinfo.SetValue || rollersampleinfo.UpLimit < rollersampleinfo.DnLimit)
            {
                yield return(new ValidationResult("上限值不符合要求", new string[] { "UpLimit" }));
            }
            if (rollersampleinfo.DnLimit > rollersampleinfo.SetValue || rollersampleinfo.UpLimit < rollersampleinfo.DnLimit)
            {
                yield return(new ValidationResult("下限值不符合要求", new string[] { "DnLimit" }));
            }
        }
Beispiel #3
0
 public void AddTestSample(RollerSampleInfo rsi)
 {
     lock (rollersampleinfos)
     {
         bool flag = false;
         foreach (var p in rollersampleinfos)
         {
             if (p.RollerSampleInfoID == rsi.RollerSampleInfoID)
             {
                 flag = true;
             }
         }
         if (!flag)
         {
             this.rollersampleinfos.Add(rsi);
         }
     }
 }