当前位置: 首页>>代码示例>>C#>>正文


C# EnumerableDataSource.SetXYMapping方法代码示例

本文整理汇总了C#中EnumerableDataSource.SetXYMapping方法的典型用法代码示例。如果您正苦于以下问题:C# EnumerableDataSource.SetXYMapping方法的具体用法?C# EnumerableDataSource.SetXYMapping怎么用?C# EnumerableDataSource.SetXYMapping使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EnumerableDataSource的用法示例。


在下文中一共展示了EnumerableDataSource.SetXYMapping方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddLineGraph

		private void AddLineGraph(Point startPoint, Point endPoint)
		{
			var ds = new EnumerableDataSource<Point>(new List<Point> {
        new Point { X = startPoint.X, Y = startPoint.Y }, 
        new Point { X = endPoint.X, Y = endPoint.Y } 
      });
			ds.SetXYMapping(pt => pt);

			plotter.AddLineGraph(ds);
		}
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:10,代码来源:Window1.xaml.cs

示例2: CreateSineDataSource

		private IPointDataSource CreateSineDataSource(double phase)
		{
			const int N = 100;

			Point[] pts = new Point[N];
			for (int i = 0; i < N; i++)
			{
				double x = i / (N / 10.0) + phase;
				pts[i] = new Point(x, Math.Sin(x - phase));
			}

			var ds = new EnumerableDataSource<Point>(pts);
			ds.SetXYMapping(pt => pt);

			return ds;
		}
开发者ID:modulexcite,项目名称:DynamicDataDisplay,代码行数:16,代码来源:Window1.xaml.cs

示例3: CreateSineDataSource

        private IPointDataSource CreateSineDataSource(double phase)
        {
            const int N = 100000;

            Point[] pts = new Point[N];
            Random r = new Random();
            for (int i = 0; i < N; i++)
            {
                double x = 10.0* i / N + phase;
                pts[i] = new Point(x, Math.Sin(x - phase) + (r.NextDouble()-0.5)/1000);
            }

            var ds = new EnumerableDataSource<Point>(pts);
            ds.SetXYMapping(pt => pt);

            return ds;
        }
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:17,代码来源:Window1.xaml.cs

示例4: plotter_Loaded

        private void plotter_Loaded(object sender, RoutedEventArgs e)
        {
            innerPlotter.ViewportBindingConverter = new InjectedPlotterVerticalSyncConverter(innerPlotter);

            if (Record != null && !string.IsNullOrEmpty(Record.Id))
            {
                Record = MySession.Session.Get<Exerciserecord>(Record.Id);

                if (Record != null)
                {
                    float[] targetLine = null;
                    float[] actionLine = null;
                    float[] powerLine = null;
                    int xLength = int.MaxValue;

                    if (Record.Record1 != null && !string.IsNullOrEmpty(Record.Record1)) //目标轨迹
                    {
                        var temp = record.Record1.Split('|');
                        targetLine = new float[temp.Length];
                        for (int i = 0; i < temp.Length; i++)
                        {
                            if (!string.IsNullOrEmpty(temp[i]))
                            {
                                targetLine[i] = Convert.ToSingle(temp[i]);
                            }
                        }
                        if (temp.Length < xLength) xLength = temp.Length;
                    }

                    if (Record.Record2 != null && !string.IsNullOrEmpty(Record.Record2)) //实际运动轨迹
                    {
                        var temp = record.Record2.Split('|');
                        actionLine = new float[temp.Length];
                        for (int i = 0; i < temp.Length; i++)
                        {
                            if (!string.IsNullOrEmpty(temp[i]))
                            {
                                actionLine[i] = Convert.ToSingle(temp[i]);
                            }
                        }
                        if (temp.Length < xLength) xLength = temp.Length;
                    }

                    if (Record.Record3 != null && !string.IsNullOrEmpty(Record.Record3)) //力量
                    {
                        var temp = record.Record3.Split('|');
                        powerLine = new float[temp.Length];
                        for (int i = 0; i < temp.Length; i++)
                        {
                            if (!string.IsNullOrEmpty(temp[i]))
                            {
                                powerLine[i] = Convert.ToSingle(temp[i]);
                            }
                        }
                        if (temp.Length < xLength) xLength = temp.Length;
                    }

                    if (xLength < int.MaxValue)
                    {
                        //添加X轴
                        var xs = Enumerable.Range(1, xLength).Select(i => i * 1).ToArray();
                        //var xds = xs.AsXDataSource();

                        plotter.Visible = DataRect.Create(0, -60, xLength, 60);

                        //添加目标轨迹
                        if (targetLine != null)
                        {
                            var target = targetLine.Take(xLength).ToArray();
                            //var tl = target.Join(xds);
                            var tl = new List<Point>();
                            for (int i = 0; i < xLength; i++)
                            {
                                Point p = new Point(xs[i], target[i]);
                                tl.Add(p);
                            }
                            var ds = new EnumerableDataSource<Point>(tl);
                            ds.SetXYMapping(pt => pt);
                            plotter.AddLineGraph(ds, Colors.Red, 2, "目标轨迹");
                        }

                        //添加运动轨迹
                        if (actionLine != null)
                        {
                            var action = actionLine.Take(xLength).ToArray();
                            //var al = action.Join(xds);
                            var al = new List<Point>();
                            for (int i = 0; i < xLength; i++)
                            {
                                Point p = new Point(xs[i], action[i]);
                                al.Add(p);
                            }
                            var ds = new EnumerableDataSource<Point>(al);
                            ds.SetXYMapping(pt => pt);
                            plotter.AddLineGraph(ds, Colors.Blue, 2, "运动轨迹");
                        }

                        //添加力量
                        if (powerLine != null)
                        {
//.........这里部分代码省略.........
开发者ID:wybq68,项目名称:DIH_LUMBARROBAT,代码行数:101,代码来源:TrainRecordDialog.xaml.cs


注:本文中的EnumerableDataSource.SetXYMapping方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。