public void RangeTest(string rangeStr, int testValue, bool expectedResult) { var range = DetectionRange.Parse(rangeStr); var result = range.IsInRange(testValue); Debug.Assert(result == expectedResult); }
protected override IEnumerable <Control> GetControls() { yield return(new InputBox("Width (mm)", () => GetCurrent().Width.ToString(), (o) => ModifyCurrent(id => id.Width = ToFloat(o)) )); yield return(new InputBox("Height (mm)", () => GetCurrent().Height.ToString(), (o) => ModifyCurrent(id => id.Height = ToFloat(o)) )); yield return(new InputBox("Max X (px)", () => GetCurrent().MaxX.ToString(), (o) => ModifyCurrent(id => id.MaxX = ToFloat(o)) )); yield return(new InputBox("Max Y (px)", () => GetCurrent().MaxY.ToString(), (o) => ModifyCurrent(id => id.MaxY = ToFloat(o)) )); yield return(new InputBox("Max Pressure", () => GetCurrent().MaxPressure.ToString(), (o) => ModifyCurrent(id => id.MaxPressure = ToUInt(o)) )); yield return(new InputBox("Active Report ID", () => GetCurrent().ActiveReportID?.ToString() ?? new DetectionRange().ToString(), (o) => ModifyCurrent(id => id.ActiveReportID = DetectionRange.Parse(o)) )); foreach (var control in base.GetControls()) { yield return(control); } }