public void draw(Graphics g, GridCalculator X, GridCalculator Y)
            {
                if (!_on)
                {
                    return;
                }
                if ((linecache == null) || (linecache.Length != len))
                {
                    // Reallocate
                    linecache = new PointF[len];
                }
                double tstep = (double)intMax / root.linePlotter.owner.sampleRate;

                for (int i = 0; i < len; i++)
                {
                    linecache[i].X = (float)X.getInterpolatedPos(-(double)i * tstep);
                    double y = data[i];
                    if (_acOut)
                    {
                        y -= acOutOfs / len;
                    }
                    y = Y.getInterpolatedPos(y * _scale + _offset);
                    linecache[i].Y = (float)y;
                }
                g.DrawLines(drawPen, linecache);
            }
            public void plot(Graphics g, GridCalculator XAxis, GridCalculator YAxis)
            {
                if (!on)
                {
                    return;
                }
                if ((pts == null) || (pts.Length != data.Length))
                {
                    pts = new PointF[data.Length];
                }
                if (contains == 0)
                {
                    return;
                }

                int i    = 0;
                int pnum = 0;

                while (i < contains)
                {
                    double ydata = data[(write + data.Length - 1 - i) % data.Length];
                    if (!Double.IsNaN(ydata))
                    {
                        pts[pnum].X = (float)XAxis.getInterpolatedPos((double)i / data.Length * root.traceTime);
                        pts[pnum].Y = (float)YAxis.getInterpolatedPos(ydata);
                        pnum++;
                    }
                    i++;
                }
                for (int j = 0; j < pnum - 1; j++)
                {
                    g.DrawLine(p, pts[j], pts[j + 1]);
                }
            }
 public void reCalcX()
 {
     if (freq == null)
     {
         return;
     }
     if ((xpos == null) || (xpos.Length != freq.Length))
     {
         xpos = new double[freq.Length];
     }
     for (int i = 0; i < freq.Length; i++)
     {
         xpos[i] = gridF.getInterpolatedPos(freq[i]);
     }
 }