public TimeStampDataEntity(PlotManager plotManager, DataEntityInfo dataInfo, int sampleCount) : base(plotManager, dataInfo)
        {
            _samplesInChart       = 0;
            _singleSamplePlotMode = (sampleCount == 1);
            if (_singleSamplePlotMode)
            {
                _timeStamps  = new List <DateTime>(dataInfo.Capacity);
                _blockCounts = null;
                _isEven      = true;
            }
            else
            {
                _timeStamps  = new List <DateTime>(dataInfo.Capacity / sampleCount);
                _blockCounts = new List <int>(dataInfo.Capacity / sampleCount);
                _isEven      = true;
            }

            _yBuffers = new List <OverLapWrapBuffer <TDataType> >(DataInfo.LineCount);
            for (int i = 0; i < DataInfo.LineCount; i++)
            {
                _yBuffers.Add(new OverLapWrapBuffer <TDataType>(DataInfo.Capacity));
            }

            _plotBuffer = new PlotBuffer <TDataType>(DataInfo.LineCount, DataInfo.Capacity);
        }
Exemplo n.º 2
0
        public void InitializeDataEntity <TDataType>(int lineCount, int sampleCount)
        {
            DataEntityInfo dataEntityInfo = new DataEntityInfo()
            {
                Capacity  = this.DisplayPoints,
                DataType  = typeof(TDataType),
                LineCount = lineCount,
                XType     = XDataType
            };

            if (null == DataEntity || !DataEntity.DataInfo.Equals(dataEntityInfo))
            {
                switch (XDataType)
                {
                case StripChartX.XAxisDataType.Index:
                    DataEntity = new IndexDataEntity <TDataType>(this, dataEntityInfo);
                    break;

                case StripChartX.XAxisDataType.String:
                    DataEntity = new StringDataEntity <TDataType>(this, dataEntityInfo);
                    break;

                case StripChartX.XAxisDataType.TimeStamp:
                    DataEntity = new TimeStampDataEntity <TDataType>(this, dataEntityInfo, sampleCount);
                    break;
                }
            }
            else
            {
                DataEntity.Clear();
                DataEntity.Initialize(sampleCount);
            }
            this.IsPlotting = true;
        }
Exemplo n.º 3
0
 public StringDataEntity(PlotManager plotManager, DataEntityInfo dataInfo) : base(plotManager, dataInfo)
 {
     _xBuffer  = new OverLapStrBuffer(DataInfo.Capacity);
     _yBuffers = new List <OverLapWrapBuffer <TDataType> >(DataInfo.LineCount);
     for (int i = 0; i < DataInfo.LineCount; i++)
     {
         _yBuffers.Add(new OverLapWrapBuffer <TDataType>(DataInfo.Capacity));
     }
     _plotBuffer = new PlotBuffer <TDataType>(DataInfo.LineCount, DataInfo.Capacity);
 }
Exemplo n.º 4
0
        public IndexDataEntity(PlotManager plotManager, DataEntityInfo dataInfo) : base(plotManager, dataInfo)
        {
            _plotManager     = plotManager;
            this._startIndex = _plotManager.StartIndex;
            this._nextIndex  = _plotManager.StartIndex;

            this._plotBuffer = new PlotBuffer <TDataType>(DataInfo.LineCount, DataInfo.Capacity);

            _yBuffers = new List <OverLapWrapBuffer <TDataType> >(DataInfo.LineCount);
            for (int i = 0; i < DataInfo.LineCount; i++)
            {
                _yBuffers.Add(new OverLapWrapBuffer <TDataType>(DataInfo.Capacity));
            }
        }