| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using IndexFormula.Finance.DataProvider;
- using IndexFormula.Finance.Win;
- using MuchInfo.Chart.Data.EnumTypes;
- using MuchInfo.Chart.Data.Interfaces;
- using System;
- using System.Collections.Generic;
- namespace MuchInfo.Chart.DataAdapter
- {
- public class DataPointMananer : CacheDataManagerBase
- {
- private IDataService _dataService;
- private ChartWinControl _winChart;
- private CycleType _cycleType;
- private TimeSpan _timeSpan;
- private List<Data.Interfaces.IBarDataPoint> _iBarDataPoints;
- public DataPointMananer(ChartWinControl chart)
- {
- _dataService = new DataService();
- _winChart = chart;
- }
- public override IDataProvider GetData(string Code, int Count)
- {
- var dataProvider = _dataService.DataPointConvert(_iBarDataPoints, _cycleType, _timeSpan, this);
- dataProvider.SetStringData("Code", "XAU2");
- return dataProvider;
- }
- /// <summary>
- /// 设置数据源
- /// </summary>
- /// <param name="barDataPoints">数据源</param>
- public void SetDataSource(List<Data.Interfaces.IBarDataPoint> barDataPoints, CycleType cycleType, TimeSpan timeSpan)
- {
- _iBarDataPoints = barDataPoints;
- _cycleType = cycleType;
- _timeSpan = timeSpan;
- this._winChart.Symbol = "XAU2";
- _winChart.Skin = "BlackWhite";
- _winChart.BindData();
- _winChart.NeedRefresh();
- }
- /// <summary>
- /// 更新Tick数据
- /// </summary>
- /// <param name="barDataPoint">BarPoint</param>
- public void UpdatePoint(IBarDataPoint barDataPoint)
- {
- _winChart.NeedRefresh();
- }
- }
- }
|