private void Create(int count, byte[] data, bool inverse) { System.Diagnostics.Debug.Assert(count == data.Length / 8); _curvePoints = new List <CurvePoint>(); for (int i = 0; i < count; i++) { byte[] buffer = new byte[8]; Buffer.BlockCopy(data, i * 8, buffer, 0, 8); CurvePoint crvPt = new CurvePoint(buffer); crvPt.ODValue = ((double)(crvPt.PointValue - _zeroODPoint)) * _pointUnit; if (inverse) { crvPt.Percent = ((double)(crvPt.PointValue - _initialMax)) / ((double)(_initialMin - _initialMax)); } else { crvPt.Percent = ((double)(crvPt.PointValue - _initialMin)) / ((double)(_initialMax - _initialMin)); } _curvePoints.Add(crvPt); } }
private void Create(int count, byte[] data, bool inverse) { System.Diagnostics.Debug.Assert(count == data.Length / 8); _curvePoints = new List<CurvePoint>(); for (int i = 0; i < count; i++) { byte[] buffer = new byte[8]; Buffer.BlockCopy(data, i * 8, buffer, 0, 8); CurvePoint crvPt = new CurvePoint(buffer); crvPt.ODValue = ((double)(crvPt.PointValue - _zeroODPoint)) * _pointUnit; if (inverse) { crvPt.Percent = ((double)(crvPt.PointValue - _initialMax)) / ((double)(_initialMin - _initialMax)); } else { crvPt.Percent = ((double)(crvPt.PointValue - _initialMin)) / ((double)(_initialMax - _initialMin)); } _curvePoints.Add(crvPt); } }