public Task<ObservableCollection<WaterFallDataSource2>> InitalrenderSourceandBrush2(int width) { Stopwatch w = new Stopwatch(); w.Start(); points3.Clear(); int wavelength = GlobalStorage.BigWaves.Length; int allRows = wavelength / width; w.Stop(); Debug.WriteLine(\"w.ElapsedMilliseconds:\" + w.ElapsedMilliseconds); Debug.WriteLine(\"allRows:\" + allRows); if (allRows > 0) { Parallel.For(0, _pagesize, (lk) => { ObservableCollection<DataPoint3> dataPoints = new ObservableCollection<DataPoint3>(); for (byte j = 0; j < 150; j++) { for (short i = 0; i < width; i++) { DataPoint3 dataPoint = new DataPoint3() { VariableX = i, VariableY = j }; dataPoint.Type = GetColorIndex2(GlobalStorage.BigWaves[lk * width + i][j]); dataPoints.Add(dataPoint); } } WaterFallDataSource2 waterFallDataSource = new WaterFallDataSource2(); waterFallDataSource.DataPoints = dataPoints; waterFallDataSource.BrushInfo = brushes; waterFallDataSource.Index = lk; waterFallDataSource.Width = width; waterFallDataSource.StartTime = BeatWaveDataConversionExtension.WaveDotToDateTime(BeatInfoCache.BeatInfos.ElementAt(lk * width).R).ToString(); points3.Add(waterFallDataSource); }); return Task.FromResult<ObservableCollection<WaterFallDataSource2>>(points3.OrderBy(p => p.Index).ToObservableCollection<WaterFallDataSource2>()); } else { ObservableCollection<DataPoint3> dataPoints = new ObservableCollection<DataPoint3>(); WaterFallDataSource2 waterFallDataSource = new WaterFallDataSource2(); for (byte j = 0; j < 150; j++) { for (short i = 0; i < wavelength; i++) { short value = GlobalStorage.BigWaves[i][j]; DataPoint3 dataPoint = new DataPoint3() { VariableX = i, VariableY = j }; dataPoint.Type = GetColorIndex2(value); dataPoints.Add(dataPoint); } } waterFallDataSource.DataPoints = dataPoints; waterFallDataSource.BrushInfo = brushes; waterFallDataSource.Index = 0; waterFallDataSource.Width = width; points3.Add(waterFallDataSource); return Task.FromResult<ObservableCollection<WaterFallDataSource2>>(points3); } }
调用
var reuslt = await _stTrendController.InitalrenderSourceandBrush2((int)firstrowgrid.ActualWidth - 27);
继续阅读与本文标签相同的文章
上一篇 :
利用OnionScan对暗网进行搜索(一)
下一篇 :
理性的相亲方法!精品课:《决策树》
-
阿里云如何创建挂载文件系统NAS?
2026-05-19栏目: 教程
-
如何在ECS中挂载文件系统NAS?
2026-05-19栏目: 教程
-
Android 9.0 Http不能访问网络
2026-05-19栏目: 教程
-
java.io.File实现批量创建,递归目录查询、删除操作
2026-05-19栏目: 教程
-
从求生存到修体系,我在阿里找到了技术人的成长模式
2026-05-19栏目: 教程
