public void SetDataPoints(int[] data, double a, double b, double c) { int[] n = new int[3200]; int lastEx = 0; for (int j = 1; j <= 2048; j++) { int ex = (int)(a * j * j + b * j + c); if (ex < 0) { ex = 0; } if (ex >= 3200) { break; } for (int p = lastEx; p <= ex; p++) { n[p] = data[j - 1]; } lastEx = ex; } EnergyCurveView curveView = (EnergyCurveView)this.CurveView; curveView.SetPoints(n); }
public void ClearPoints() { EnergyCurveView curveView = (EnergyCurveView)this.CurveView; curveView.ClearPoints(); //this.index = 0; }
public void SetDataPoints(int[] data) { EnergyCurveView curveView = (EnergyCurveView)this.CurveView; curveView.SetPoints(data); }
private void ZoomChartView(double scale) { double centerX = 0.0; EnergyCurveView curveView = (EnergyCurveView)this.CurveView; curveView.UpdateCurveScale(scale); centerX = curveView.CenterX; this.UpdateTimeAxisScale(scale, centerX); }
// ! public EnergyCurveView AddCurveView(string curveViewName, string displayName) { EnergyCurveView curveView = new EnergyCurveView(this); curveView.CurveViewName = curveViewName; curveView.PointAxisScale = this.PointAxisScale; curveView.Height = 400; this.ChartContainer.Children.Add(curveView); //this.ChartContainer.Height= 500; return(curveView); }
private void TrackTimeLine(MouseEventArgs e) { string timeLabel = string.Empty; EnergyCurveView curveView = (EnergyCurveView)this.CurveView; Point point = e.GetPosition((UIElement)curveView.View); double x = point.X; double centerX = curveView.CenterX; if (x >= 0) { double v = (x - centerX) / scale + centerX; double index = v / Grad / IntervalCount; timeLabel = this.GetFormatDateTime(this.currentBaseTime, index, IntervalCount * this.Interval); } curveView.TrackTimeLine(point, timeLabel); }
private void TrackTimeLine(MouseEventArgs e) { bool timed = false; string timeLabel = string.Empty; EnergyCurveView curveView = (EnergyCurveView)this.CurveView; Point point = e.GetPosition((UIElement)curveView.View); double x = point.X; double centerX = curveView.CenterX; if (!timed && x >= 0) { double v = (x - centerX) / scale + centerX; double index = v / Grad / IntervalCount; timeLabel = this.GetFormatDateTime(this.currentBaseTime, index, IntervalCount * this.Interval); } curveView.TrackTimeLine(point, timeLabel); /* * foreach (var view in this.ChartContainer.Children) * { * EnergyCurveView curveView = (EnergyCurveView)view; * * Point point = e.GetPosition((UIElement)curveView.View); * double x = point.X; * double centerX = curveView.CenterX; * if (!timed && x >= 0) * { * double v = (x - centerX) / scale + centerX; * double index = v / Grad / IntervalCount; * * timeLabel = this.GetFormatDateTime(this.currentBaseTime, index, IntervalCount * this.Interval); * } * * curveView.TrackTimeLine(point, timeLabel); * }*/ }
// ! public EnergyCurveView AddCurveView(string curveViewName, string displayName) { EnergyCurveView curveView = new EnergyCurveView(this); curveView.CurveViewName = curveViewName; curveView.PointAxisScale = this.PointAxisScale; curveView.Height = 400; this.ChartContainer.Children.Add(curveView); //this.ChartContainer.Height= 500; return curveView; }