aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml.cs
blob: d4c737bcc283f8cff0d3866e557d9f6850970b5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Tango.PPC.UI.Dialogs
{
    /// <summary>
    /// Interaction logic for PowerUpView.xaml
    /// </summary>
    public partial class ThreadLoadingView : UserControl
    {
        public ThreadLoadingView()
        {
            InitializeComponent();
        }
    }
}
quot;>The type of the graph data series.</typeparam> /// <typeparam name="XDataPoint">The type of the x-axis data point.</typeparam> /// <typeparam name="YDataPoint">The type of the y-axis data point.</typeparam> /// <seealso cref="RealTimeGraphX.GraphRendererBase{XDataPoint, YDataPoint}" /> public class GraphScrollingRenderer<TDataSeries, XDataPoint, YDataPoint> : GraphRendererBase<TDataSeries, XDataPoint, YDataPoint> where XDataPoint : GraphDataPointBase where YDataPoint : GraphDataPointBase where TDataSeries : IGraphDataSeries { /// <summary> /// Returns an array of absolute graph data points to render. /// This method is called per data series. /// </summary> /// <param name="seriesCollection">A collection of all data series that is currently in the rendering pass.</param> /// <param name="series">The current data series to render.</param> /// <param name="toRender">Pending data series object to render.</param> /// <returns></returns> protected override List<GraphPoint> OnRender(IEnumerable<PendingSeries> seriesCollection, TDataSeries series, PendingSeries toRender) { List<GraphPoint> points = new List<GraphPoint>(); if (toRender.XX.Count > 0 && toRender.YY.Count > 0) { XDataPoint min_x = toRender.XX.First(); XDataPoint max_x = toRender.XX.Last(); YDataPoint min_y = Input.Range.MinimumY; YDataPoint max_y = Input.Range.MaximumY; if (Input.Range.AutoY) { min_y = _current_min_y; max_y = _current_max_y; } OnEffectiveRangeXChanged(min_x, max_x); OnEffectiveRangeYChanged(min_y, max_y); var dxList = toRender.XX.Select(x => x.ComputeRelativePosition(min_x, max_x)).ToList(); var dyList = toRender.YY.Select(x => x.ComputeRelativePosition(min_y, max_y)).ToList(); if (max_x - min_x > Input.Range.MaximumX) { var offset = ((max_x - min_x) - Input.Range.MaximumX) + min_x; for (int i = 0; i < toRender.XX.Count; i++) { if (toRender.XX[i] < offset) { toRender.XX.RemoveAt(i); toRender.YY.RemoveAt(i); i--; } else { break; } } } for (int i = 0; i < dxList.Count; i++) { float image_x = ConvertXValueToRendererValue(dxList[i]); float image_y = (float)Math.Min(ConvertYValueToRendererValue(dyList[i]), Output.SurfaceHeight - 2); GraphPoint point = new GraphPoint(image_x, image_y); points.Add(point); } } return points; } } }