Example #1
0
        /// <summary>
        /// Calculates synchronized selection
        /// </summary>
        /// <param name="selection">The etalon selection</param>
        /// <returns>Synchronized selection</returns>
        public IArgumentSelection SynchronizedSelection(IArgumentSelection selection)
        {
            if (!(selection is SeriesBase))
            {
                throw new Exception("Incompatible selections");
            }
            SeriesBase etalon = selection as SeriesBase;
            SeriesBase s      = new SeriesBase();

            for (int i = 0; i < etalon.PointsCount; i++)
            {
                double x = etalon[i, 0];
                double a = this[0, 0];
                if (x < a)
                {
                    s.AddXY(x, this[0, 1]);
                    continue;
                }
                double b = this[PointsCount - 1, 0];
                if (x > b)
                {
                    s.AddXY(x, this[PointsCount - 1, 1]);
                    continue;
                }
                s.AddXY(x, this[x][1]);
            }
            return(s);
        }
Example #2
0
            internal static IMeasurement[] CreateMeasurements(SeriesBase s)
            {
                List <IMeasurement> l = new List <IMeasurement>();

                int[] b = new int[2];
                for (int i = 0; i < 2; i++)
                {
                    for (int j = 0; j < 2; j++)
                    {
                        b[0] = j;
                        b[1] = i;
                        l.Add(new EndPointMeasure(b, s));
                    }
                }
                return(l.ToArray());
            }
Example #3
0
            private EndPointMeasure(int[] b, SeriesBase s)
            {
                this.s = s;
                if (b[0] == 0)
                {
                    name = "X_" + (b[1] + 1);
                    if (b[1] == 0)
                    {
                        par = x1;

                        return;
                    }
                    par = x2;
                    return;
                }
                name = "Y_" + (b[1] + 1);
                if (b[1] == 0)
                {
                    par = y1;
                    return;
                }
                par = y2;
            }
Example #4
0
 public XSelection(SeriesBase s)
 {
     this.s = s;
 }
Example #5
0
 YMeasure(SeriesBase s)
 {
     this.s = s;
 }
Example #6
0
 public static IMeasurement getMeasure(SeriesBase s)
 {
     return(new YMeasure(s));
 }