Ejemplo n.º 1
0
 protected override void HintUpdate(PaintArgs p, PlotDataCursorDisplay display)
 {
     if (base.Style == PlotDataCursorMultipleStyle.ValueXY)
     {
         base.Hint.Text = display.XText + ", " + display.YText;
     }
     if (base.Style == PlotDataCursorMultipleStyle.ValueX)
     {
         base.Hint.Text = display.XText;
     }
     if (base.Style == PlotDataCursorMultipleStyle.ValueY)
     {
         base.Hint.Text = display.YText;
     }
     if (base.Style == PlotDataCursorMultipleStyle.DeltaX)
     {
         base.Hint.Text = base.Pointer1.AxisPosition.TextFormatting.GetText(Math.Abs(display.XValue - display.YValue));
     }
     if (base.Style == PlotDataCursorMultipleStyle.DeltaY)
     {
         base.Hint.Text = base.Pointer1.AxisPosition.TextFormatting.GetText(Math.Abs(display.XValue - display.YValue));
     }
     if (base.Style == PlotDataCursorMultipleStyle.InverseDeltaX)
     {
         base.Hint.Text = base.Pointer1.AxisPosition.TextFormatting.GetText(1.0 / Math.Abs(display.XValue - display.YValue) * base.Pointer1.AxisPosition.CursorScaler);
     }
     if (base.Style == PlotDataCursorMultipleStyle.InverseDeltaY)
     {
         base.Hint.Text = base.Pointer1.AxisPosition.TextFormatting.GetText(1.0 / Math.Abs(display.XValue - display.YValue) * base.Pointer1.AxisPosition.CursorScaler);
     }
 }
Ejemplo n.º 2
0
 protected override void CreateObjects()
 {
     base.CreateObjects();
     this.m_Display        = new PlotDataCursorDisplay();
     this.m_StyleMenuItems = new PlotDataCursorMultipleStyleMenuItems();
     base.AddSubClass(this.StyleMenuItems);
 }
Ejemplo n.º 3
0
 protected override void UpdateDisplays()
 {
     base.Displays.Clear();
     if (!(this.XAxisName == Const.EmptyString) && !(this.YAxisName == Const.EmptyString))
     {
         foreach (PlotChannelBase channel in base.Plot.Channels)
         {
             if (!(channel.XAxisName != this.XAxisName) && !(channel.YAxisName != this.YAxisName) && channel.Visible)
             {
                 PlotDataCursorDisplay plotDataCursorDisplay = new PlotDataCursorDisplay();
                 plotDataCursorDisplay.XPosition    = base.Pointer1.Position;
                 plotDataCursorDisplay.YPosition    = base.Pointer2.Position;
                 plotDataCursorDisplay.XValue       = base.Pointer1.AxisPosition.PercentToValue(base.Pointer1.Position);
                 plotDataCursorDisplay.YValue       = base.Pointer2.AxisPosition.PercentToValue(base.Pointer2.Position);
                 plotDataCursorDisplay.XText        = base.Pointer1.AxisPosition.TextFormatting.GetText(plotDataCursorDisplay.XValue);
                 plotDataCursorDisplay.YText        = base.Pointer2.AxisPosition.TextFormatting.GetText(plotDataCursorDisplay.YValue);
                 plotDataCursorDisplay.YStatus      = PlotChannelInterpolationResult.Valid;
                 plotDataCursorDisplay.HintPosition = base.Hint.Position;
                 if (channel is PlotChannelConsecutive)
                 {
                     plotDataCursorDisplay.YStatus = channel.GetYInterpolated(plotDataCursorDisplay.XValue, out plotDataCursorDisplay.YValue);
                     plotDataCursorDisplay.YText   = base.Pointer2.AxisPosition.TextFormatting.GetText(plotDataCursorDisplay.YValue);
                     if (plotDataCursorDisplay.YStatus == PlotChannelInterpolationResult.Valid)
                     {
                         plotDataCursorDisplay.YPosition    = base.Pointer2.AxisPosition.ValueToPercent(plotDataCursorDisplay.YValue);
                         plotDataCursorDisplay.HintPosition = plotDataCursorDisplay.YPosition;
                     }
                     else
                     {
                         if (plotDataCursorDisplay.YStatus == PlotChannelInterpolationResult.Empty)
                         {
                             plotDataCursorDisplay.YText = "Empty";
                         }
                         else if (plotDataCursorDisplay.YStatus == PlotChannelInterpolationResult.Invalid)
                         {
                             plotDataCursorDisplay.YText = "Invalid";
                         }
                         else if (plotDataCursorDisplay.YStatus == PlotChannelInterpolationResult.NoData)
                         {
                             plotDataCursorDisplay.YText = "NoData";
                         }
                         else if (plotDataCursorDisplay.YStatus == PlotChannelInterpolationResult.Null)
                         {
                             plotDataCursorDisplay.YText = "Invalid";
                         }
                         else if (plotDataCursorDisplay.YStatus == PlotChannelInterpolationResult.Valid)
                         {
                             plotDataCursorDisplay.YText = "Invalid";
                         }
                         else if (plotDataCursorDisplay.YStatus == PlotChannelInterpolationResult.Void)
                         {
                             plotDataCursorDisplay.YText = "Invalid";
                         }
                         else
                         {
                             plotDataCursorDisplay.YText = "Not Defined - Contact Iocomp for Update";
                         }
                         plotDataCursorDisplay.HintPosition = base.Pointer2.AxisPosition.ValueToPercent(channel.YMean);
                         if (!base.Pointer2.AxisPosition.ValueVisible(plotDataCursorDisplay.HintPosition))
                         {
                             plotDataCursorDisplay.HintPosition = base.Pointer2.AxisPosition.ValueToPercent(base.Pointer2.AxisPosition.Mid);
                         }
                     }
                 }
                 channel.DataCursorX = plotDataCursorDisplay.XValue;
                 channel.DataCursorY = plotDataCursorDisplay.YValue;
                 base.Displays.Add(plotDataCursorDisplay);
             }
         }
     }
 }
Ejemplo n.º 4
0
 protected override void HintUpdate(PaintArgs p, PlotDataCursorDisplay display)
 {
     base.Hint.Text = display.XText + ", " + display.YText;
 }
Ejemplo n.º 5
0
        private void Draw(PaintArgs p, PlotDataCursorDisplay display)
        {
            int num = 3;

            if (this.DataCursor.WindowShowing)
            {
                num += this.DataCursor.Window.Size;
            }
            if (this.HitRegion != null)
            {
                this.HitRegion.Dispose();
                this.HitRegion = null;
            }
            if (this.Visible && !this.Hide && this.DataCursor != null && this.XAxis != null && this.YAxis != null)
            {
                PlotDataCursorPointer pointer  = this.DataCursor.Pointer1;
                PlotDataCursorPointer pointer2 = this.DataCursor.Pointer2;
                Pen  pen = p.Graphics.Pen(this.DataCursor.Line.Color, DashStyle.Dash, (float)this.DataCursor.Line.Thickness);
                bool flag;
                int  num2;
                if (pointer.Visible && pointer2.Visible && pointer.AxisPosition == pointer2.AxisPosition)
                {
                    flag = true;
                    this.AxisPosition = pointer.AxisRange;
                    num2 = (pointer.PositionPixels + pointer2.PositionPixels) / 2;
                }
                else if (pointer.Visible && pointer2.Visible)
                {
                    flag = false;
                    if (pointer.AxisRange.DockHorizontal)
                    {
                        this.AxisPosition = pointer.AxisRange;
                        num2 = pointer.PositionPixels;
                    }
                    else
                    {
                        this.AxisPosition = pointer2.AxisRange;
                        num2 = pointer2.PositionPixels;
                    }
                }
                else
                {
                    flag = false;
                    if (pointer.Visible)
                    {
                        this.AxisPosition = pointer.AxisRange;
                        num2 = pointer.AxisPosition.PercentToPixels(display.XPosition);
                    }
                    else
                    {
                        this.AxisPosition = pointer2.AxisRange;
                        num2 = pointer2.AxisPosition.PercentToPixels(display.YPosition);
                    }
                }
                Orientation orientation = this.AxisPosition.DockHorizontal ? Orientation.Vertical : Orientation.Horizontal;
                Size        size        = p.Graphics.MeasureString(this.Text, this.Font);
                int         width       = size.Width;
                int         height      = size.Height;
                int         num3        = width + 6;
                int         num4        = height + 6;
                int         num5        = this.AxisPosition.PercentToPixels(display.HintPosition);
                Rectangle   r;
                if (orientation == Orientation.Vertical)
                {
                    int num6 = width + num + 6;
                    r = new Rectangle(num2 - num3 / 2, num5 - num4 / 2, num3, num4);
                    if (!flag)
                    {
                        if (num2 + num6 > this.DataCursor.BoundsClip.Right)
                        {
                            r.Offset(-(num3 / 2 + num), 0);
                        }
                        else
                        {
                            r.Offset(num3 / 2 + num, 0);
                        }
                    }
                    else
                    {
                        p.Graphics.DrawLine(pen, pointer.PositionPixels, num5, pointer2.PositionPixels, num5);
                    }
                }
                else
                {
                    int num6 = height + num + 6;
                    r = new Rectangle(num5 - num3 / 2, num2 - num4 / 2, num3, num4);
                    if (!flag)
                    {
                        if (num2 + num6 > this.DataCursor.BoundsClip.Bottom)
                        {
                            r.Offset(0, -(num4 / 2 + num));
                        }
                        else
                        {
                            r.Offset(0, num4 / 2 + num);
                        }
                    }
                    else
                    {
                        p.Graphics.DrawLine(pen, num5, pointer.PositionPixels, num5, pointer2.PositionPixels);
                    }
                }
                this.DrawHintBox(p, r);
            }
        }
Ejemplo n.º 6
0
 void IPlotDataCursorHint.Draw(PaintArgs p, PlotDataCursorDisplay display)
 {
     this.Draw(p, display);
 }
Ejemplo n.º 7
0
 protected abstract void HintUpdate(PaintArgs p, PlotDataCursorDisplay display);
Ejemplo n.º 8
0
 public int IndexOf(PlotDataCursorDisplay value)
 {
     return(this.m_List.IndexOf(value));
 }
Ejemplo n.º 9
0
 public int Add(PlotDataCursorDisplay value)
 {
     return(this.m_List.Add(value));
 }