public static bool IsDefective(LotAttributeValues attributeValue, ProductAttributeSpec productSpec) { if (attributeValue == null || productSpec == null || attributeValue.HasResolvedDefects) { return(false); } return(attributeValue.LabTestValue < productSpec.MinValue || attributeValue.LabTestValue > productSpec.MaxValue); }
public static double?GetMeanValue(ProductAttributeSpec spec) { if (spec == null) { return(null); } if (spec.MaxValue.HasValue && spec.MinValue.HasValue) { return((new[] { spec.MaxValue.Value, spec.MinValue.Value }).Average()); } return(spec.MinValue ?? spec.MaxValue); }