예제 #1
0
 PointPairSpecial(PointPairSpecial other)
     : base(((ISpecial)other).X, ((ISpecial)other).Y)
 {
     xs        = other.xs == null ? null : (double[])other.xs.Clone();
     ys        = other.ys == null ? null : (double[])other.ys.Clone();
     _XChooser = other._XChooser;
     _YChooser = other._YChooser;
 }
예제 #2
0
        public void AddLabel(int n)
        {
            double time = (DateTime.Now - start).TotalMinutes;
            var    pp   = new PointPairSpecial(iteration - 0.5, n, new[] { time }, XScale, null, null);

            labels.Add(pp);
            graph.GraphPane.AddLabel(pp.X, n);
            graph.Refresh();
        }
예제 #3
0
        protected override sealed void RefreshGraph()
        {
            if (iteration > -1)
            {
                double time      = (Graph.MeasureGraph.Instance.DateTime - start).TotalMinutes;
                int    rowsCount = pspec.Count;

                if (rowsCount == 1)
                {
                    // no normalization when displaying 1 row
                    long peakSum = 0;
                    // TODO: move PeakSum counting to PointPairListPlus
                    foreach (var p in pspec[0].AssociatedPoints)
                    {
                        peakSum += (long)p.Y;
                    }
                    list[0].Add(new PointPairSpecial(iteration, peakSum, new[] { time }, XScale, null, null));
                }
                else
                {
                    var  temp = new PointPairList();
                    long sum  = 0;
                    for (int i = 0; i < rowsCount; ++i)
                    {
                        long peakSum = 0;
                        // TODO: move PeakSum counting to PointPairListPlus
                        foreach (var p in pspec[i].AssociatedPoints)
                        {
                            peakSum += (long)p.Y;
                        }
                        var pp = new PointPair(iteration, peakSum);
                        temp.Add(pp);
                        sum += peakSum;
                    }

                    lock (_locker) {
                        int    normPeakNumber = NormPeakNumber;
                        double normalization  = normPeakNumber == -1 ? 1 : temp[normPeakNumber].Y;
                        for (int i = 0; i < rowsCount; ++i)
                        {
                            var    pp = temp[i];
                            double x  = pp.X;
                            double y  = pp.Y;
                            // TODO: implement averaging
                            var pp2 = new PointPairSpecial(x, y, new[] { time }, XScale, new[] { y / sum, normPeakNumber != -1 ? y / normalization : 0 }, YScale);
                            list[i].Add(pp2);
                        }
                    }
                }
                //graph.GraphPane.XAxis.Scale.Min = list[0][0].X;
                // TODO: extract method?
                graph.AxisChange();
            }
            graph.Invalidate();
            //graph.Refresh();
        }
예제 #4
0
 PointPairSpecial(PointPairSpecial other)
     : base(((ISpecial)other).X, ((ISpecial)other).Y)
 {
     xs = other.xs == null ? null : (double[])other.xs.Clone();
     ys = other.ys == null ? null : (double[])other.ys.Clone();
     _XChooser = other._XChooser;
     _YChooser = other._YChooser;
 }
예제 #5
0
        protected override sealed void RefreshGraph()
        {
            if (iteration > -1) {
                double time = (Graph.MeasureGraph.Instance.DateTime - start).TotalMinutes;
                int rowsCount = pspec.Count;

                if (rowsCount == 1) {
                    // no normalization when displaying 1 row
                    long peakSum = 0;
                    // TODO: move PeakSum counting to PointPairListPlus
                    foreach (var p in pspec[0].AssociatedPoints)
                        peakSum += (long)p.Y;
                    list[0].Add(new PointPairSpecial(iteration, peakSum, new[] { time }, XScale, null, null));
                } else {
                    var temp = new PointPairList();
                    long sum = 0;
                    for (int i = 0; i < rowsCount; ++i) {
                        long peakSum = 0;
                        // TODO: move PeakSum counting to PointPairListPlus
                        foreach (var p in pspec[i].AssociatedPoints)
                            peakSum += (long)p.Y;
                        var pp = new PointPair(iteration, peakSum);
                        temp.Add(pp);
                        sum += peakSum;
                    }

                    lock (_locker) {
                        int normPeakNumber = NormPeakNumber;
                        double normalization = normPeakNumber == -1 ? 1 : temp[normPeakNumber].Y;
                        for (int i = 0; i < rowsCount; ++i) {
                            var pp = temp[i];
                            double x = pp.X;
                            double y = pp.Y;
                            // TODO: implement averaging
                            var pp2 = new PointPairSpecial(x, y, new[] { time }, XScale, new[] { y / sum, normPeakNumber != -1 ? y / normalization : 0 }, YScale);
                            list[i].Add(pp2);
                        }
                    }
                }
                //graph.GraphPane.XAxis.Scale.Min = list[0][0].X;
                // TODO: extract method?
                graph.AxisChange();
            }
            graph.Invalidate();
            //graph.Refresh();
        }
예제 #6
0
 public void AddLabel(int n)
 {
     double time = (DateTime.Now - start).TotalMinutes;
     var pp = new PointPairSpecial(iteration - 0.5, n, new[] { time }, XScale, null, null);
     labels.Add(pp);
     graph.GraphPane.AddLabel(pp.X, n);
     graph.Refresh();
 }