示例#1
0
        private int AddXY(double x, double y, bool nullValue, bool emptyValue)
        {
            this.m_SweepIndex++;
            if (this.m_SweepIndex >= this.SweepCount)
            {
                this.m_SweepIndex = 0;
                if (this.ClearOnRetrace)
                {
                    this.ClearDisplay();
                }
            }
            int sweepIndex = this.m_SweepIndex;

            this.m_LastAddIndex = this.m_SweepIndex;
            PlotDataPointSweepInterval plotDataPointSweepInterval = this[sweepIndex];

            base.DataPointInitializing = true;
            try
            {
                plotDataPointSweepInterval.Y     = y;
                plotDataPointSweepInterval.Null  = nullValue;
                plotDataPointSweepInterval.Empty = emptyValue;
            }
            finally
            {
                base.DataPointInitializing = false;
            }
            if (this.SweepLeadingBreakCount != 0)
            {
                for (int i = 0; i < this.SweepLeadingBreakCount; i++)
                {
                    int num = sweepIndex + i + 1;
                    if (num > this.SweepCount - 1)
                    {
                        num -= this.SweepCount;
                    }
                    this[num].Null = true;
                }
            }
            base.m_Data.UpdateMinMaxMean(plotDataPointSweepInterval);
            if (base.SendXAxisTrackingData)
            {
                PlotXAxis xAxis = base.XAxis;
                xAxis?.Tracking.NewData(x);
            }
            if (!nullValue && !emptyValue && base.SendYAxisTrackingData)
            {
                PlotYAxis yAxis = base.YAxis;
                yAxis?.Tracking.NewData(y);
            }
            this.DoDataChange();
            return(sweepIndex);
        }
示例#2
0
 public void ClearDisplay()
 {
     this.m_SweepIndex   = -1;
     this.m_LastAddIndex = -1;
     for (int i = 0; i < this.SweepCount; i++)
     {
         PlotDataPointSweepInterval plotDataPointSweepInterval = base.m_Data[i] as PlotDataPointSweepInterval;
         plotDataPointSweepInterval.X     = this.SweepXStart + (double)i * this.SweepXInterval;
         plotDataPointSweepInterval.Y     = this.SweepYDefaultValue;
         plotDataPointSweepInterval.Null  = this.SweepYDefaultNull;
         plotDataPointSweepInterval.Empty = this.SweepYDefaultNull;
     }
     this.DoDataChange();
 }
示例#3
0
 protected override void InternalOnMouseLeft(MouseEventArgs e, bool shouldFocus)
 {
     if (shouldFocus)
     {
         base.Focus();
     }
     if (this.UserCanMoveDataPoints && this.m_MouseDownDataPointIndex != -1)
     {
         base.IsMouseActive         = true;
         this.m_MouseDownDataPoint  = this[this.m_MouseDownDataPointIndex];
         this.m_MouseDownDataPointX = this.m_MouseDownDataPoint.X;
         this.m_MouseDownDataPointY = this.m_MouseDownDataPoint.Y;
         this.m_MouseDownPosX       = base.XAxis.PixelsToValue(e);
         this.m_MouseDownPosY       = base.YAxis.PixelsToValue(e);
     }
 }
示例#4
0
 private void ResetDataArray()
 {
     base.m_Data.Clear();
     base.m_Data.ClearMinMeanMax();
     this.m_SweepIndex   = -1;
     this.m_LastAddIndex = -1;
     for (int i = 0; i < this.SweepCount; i++)
     {
         PlotDataPointSweepInterval plotDataPointSweepInterval = (PlotDataPointSweepInterval)base.m_Data.AddNew();
         plotDataPointSweepInterval.X     = this.SweepXStart + (double)i * this.SweepXInterval;
         plotDataPointSweepInterval.Y     = this.SweepYDefaultValue;
         plotDataPointSweepInterval.Null  = this.SweepYDefaultNull;
         plotDataPointSweepInterval.Empty = this.SweepYDefaultNull;
     }
     this.DoDataChange();
 }
示例#5
0
 private void DrawRetraceLine(PaintArgs p, PlotXAxis xAxis, PlotYAxis yAxis)
 {
     if (this.RetraceLine.Visible && this.Count >= 1 && this.m_LastAddIndex != -1)
     {
         PlotDataPointSweepInterval plotDataPointSweepInterval = this[this.m_LastAddIndex];
         Pen pen       = ((IPlotPen)this.RetraceLine).GetPen(p);
         int num       = xAxis.ScaleDisplay.ValueToPixels(plotDataPointSweepInterval.X);
         int pixelsMin = yAxis.ScaleDisplay.PixelsMin;
         int num2      = xAxis.ScaleDisplay.ValueToPixels(plotDataPointSweepInterval.X);
         int pixelsMax = yAxis.ScaleDisplay.PixelsMax;
         if (base.XYSwapped)
         {
             p.Graphics.DrawLine(pen, pixelsMin, num, pixelsMax, num2);
         }
         else
         {
             p.Graphics.DrawLine(pen, num, pixelsMin, num2, pixelsMax);
         }
     }
 }
示例#6
0
 protected override bool InternalHitTest(MouseEventArgs e)
 {
     if (base.LegendRectangle.Contains(e.X, e.Y))
     {
         return(true);
     }
     this.m_MouseDownDataPointIndex = -1;
     if (this.IndexDrawStart == -1)
     {
         return(false);
     }
     if (this.IndexDrawStop == -1)
     {
         return(false);
     }
     if (this.Markers.Visible)
     {
         PlotXAxis xAxis = base.XAxis;
         PlotYAxis yAxis = base.YAxis;
         if (xAxis != null && yAxis != null)
         {
             int num = this.IndexDrawStart;
             while (num <= this.IndexDrawStop)
             {
                 PlotDataPointSweepInterval plotDataPointSweepInterval = this[num];
                 Point point = base.GetPoint(plotDataPointSweepInterval.X, plotDataPointSweepInterval.Y);
                 if (!new Rectangle(point.X - this.Markers.Size, point.Y - this.Markers.Size, this.Markers.Size * 2, this.Markers.Size * 2).Contains(e.X, e.Y))
                 {
                     num++;
                     continue;
                 }
                 this.m_MouseDownDataPointIndex = num;
                 return(true);
             }
         }
     }
     return(false);
 }