示例#1
0
        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);
            }
        }
示例#2
0
        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);
            }
        }