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