Example #1
0
 public PlotChannelDataCollection(PlotChannelBase value)
 {
     this.I_Channel       = value;
     this.m_Data          = new ArrayList();
     this.m_RingHeadIndex = -1;
     this.m_RingTailIndex = -1;
 }
Example #2
0
        protected override void SetupObjectBeforeAmbientControlBaseConnection(object value)
        {
            base.SetupObjectBeforeAmbientControlBaseConnection(value);
            PlotChannelBase plotChannelBase = value as PlotChannelBase;
            Plot            plot            = base.ComponentBase as Plot;

            if (plotChannelBase.Color == Color.Empty)
            {
                plotChannelBase.Color = this.ColorTable.NextColor();
            }
            if (plot != null)
            {
                if (plotChannelBase.XAxisName == "" && plot.XAxes.Count != 0)
                {
                    plotChannelBase.XAxisName = plot.XAxes[0].Name;
                }
                if (plotChannelBase.YAxisName == "" && plot.YAxes.Count != 0)
                {
                    plotChannelBase.YAxisName = plot.YAxes[0].Name;
                }
                if (plotChannelBase.LegendName == "" && plot.Legends.Count != 0)
                {
                    plotChannelBase.LegendName = plot.Legends[0].Name;
                }
            }
        }
Example #3
0
 public override void ObjectAdded(PlotObject value)
 {
     base.ObjectAdded(value);
     if (value is PlotChannelBase && value.Name == this.m_ChannelName)
     {
         this.m_CachedChannel = (value as PlotChannelBase);
     }
 }
Example #4
0
 public PlotDataPointBase(PlotChannelBase channel)
 {
     if (channel == null)
     {
         throw new Exception("Channel must be specified");
     }
     this.m_CH = channel;
 }
Example #5
0
 protected override void InternalOnLostFocus(LostFocusEventArgs e)
 {
     if (e.NewFocusObject != null && e.NewFocusObject is PlotChannelBase)
     {
         PlotChannelBase plotChannelBase = e.NewFocusObject as PlotChannelBase;
         base.ChannelName = plotChannelBase.Name;
     }
 }
Example #6
0
 public override void ObjectRemoved(PlotObject value)
 {
     base.ObjectRemoved(value);
     if (value == this.m_CachedChannel)
     {
         this.m_CachedChannel = null;
     }
 }
Example #7
0
 public PlotChannelDataPointMovedEventArgs(PlotChannelBase channel, int index, double oldX, double oldY, double newX, double newY)
 {
     this.m_Channel = channel;
     this.m_Index   = index;
     this.m_OldX    = oldX;
     this.m_OldY    = oldY;
     this.m_NewX    = newX;
     this.m_NewY    = newY;
 }
Example #8
0
 public PlotDataPointPolynomial(PlotChannelBase channel)
     : base(channel)
 {
     if (!(channel is PlotChannelPolynomial))
     {
         throw new Exception("Invalid Channel type for PlotDataPointPolynomial");
     }
     this.m_Channel = (channel as PlotChannelPolynomial);
 }
Example #9
0
 public PlotDataPointCandlestick2(PlotChannelBase channel)
     : base(channel)
 {
     if (!(channel is PlotChannelCandlestick2))
     {
         throw new Exception("Invalid Channel type for PlotDataPointCandlestick2");
     }
     this.m_Channel = (channel as PlotChannelCandlestick2);
 }
Example #10
0
 public PlotDataPointBar(PlotChannelBase channel)
     : base(channel)
 {
     if (!(channel is PlotChannelBar))
     {
         throw new Exception("Invalid Channel type for PlotDataPointBar");
     }
     this.m_Channel = (channel as PlotChannelBar);
 }
 public PlotDataPointCubicSpline(PlotChannelBase channel)
     : base(channel)
 {
     if (!(channel is PlotChannelCubicSpline))
     {
         throw new Exception("Invalid Channel type for PlotDataPointCubicSpline");
     }
     this.m_Channel = (channel as PlotChannelCubicSpline);
 }
        protected override void DrawSetup(PaintArgs p)
        {
            base.DrawSetup(p);
            PlotChannelBase channel = this.Channel;

            if (channel != null)
            {
                base.XAxisName = channel.XAxisName;
                base.YAxisName = channel.YAxisName;
            }
        }
Example #13
0
        private void CheckChannelsForSynchronization()
        {
            PlotChannelBase plotChannelBase = this.Plot.Channels[0];
            int             num             = 1;

            while (true)
            {
                if (num < this.Plot.Channels.Count)
                {
                    if (plotChannelBase.Count == this.Plot.Channels[num].Count)
                    {
                        num++;
                        continue;
                    }
                    break;
                }
                return;
            }
            throw new Exception("Log Activate Error: Channels not Synchronized (Data-Point Counts Differ).");
        }
Example #14
0
 private Brush GetTitleBrush(PaintArgs p, PlotChannelBase ch)
 {
     if (this.TitleColorStyle == LegendTitleColorStyle.ForeColor)
     {
         return(p.Graphics.Brush(base.ForeColor));
     }
     if (this.TitleColorStyle == LegendTitleColorStyle.ChannelColor)
     {
         return(p.Graphics.Brush(ch.Color));
     }
     if (this.TitleColorStyle == LegendTitleColorStyle.XAxisColor && ch.XAxis != null)
     {
         return(p.Graphics.Brush(ch.XAxis.Color));
     }
     if (this.TitleColorStyle == LegendTitleColorStyle.YAxisColor && ch.YAxis != null)
     {
         return(p.Graphics.Brush(ch.YAxis.Color));
     }
     return(p.Graphics.Brush(base.ForeColor));
 }
Example #15
0
        protected override void UpdateDisplays()
        {
            base.Displays.Clear();
            PlotChannelBase channel = base.Channel;

            if (channel != null)
            {
                bool flag = false;
                if (base.Style == PlotDataCursorMultipleStyle.ValueXY)
                {
                    flag = true;
                }
                if (base.Style == PlotDataCursorMultipleStyle.ValueX)
                {
                    flag = true;
                }
                if (base.Style == PlotDataCursorMultipleStyle.ValueY)
                {
                    flag = true;
                }
                base.Display.XPosition    = base.Pointer1.Position;
                base.Display.YPosition    = base.Pointer2.Position;
                base.Display.XValue       = base.Pointer1.AxisPosition.PercentToValue(base.Pointer1.Position);
                base.Display.YValue       = base.Pointer2.AxisPosition.PercentToValue(base.Pointer2.Position);
                base.Display.XText        = base.Pointer1.AxisPosition.TextFormatting.GetText(base.Display.XValue);
                base.Display.YText        = base.Pointer2.AxisPosition.TextFormatting.GetText(base.Display.YValue);
                base.Display.YStatus      = PlotChannelInterpolationResult.Valid;
                base.Display.HintPosition = base.Hint.Position;
                if (channel is PlotChannelConsecutive && flag)
                {
                    base.Display.YStatus = channel.GetYInterpolated(base.Display.XValue, out base.Display.YValue);
                    if (base.Display.YStatus == PlotChannelInterpolationResult.Valid)
                    {
                        base.Display.YText = channel.GetYValueText(base.Display.YValue);
                        ((ISubClassBase)base.Pointer2).FreezePropertyChange = true;
                        base.Pointer2.Position = base.Pointer2.AxisPosition.ValueToPercent(channel.GetYValueAxisValue(base.Display.YValue));
                        ((ISubClassBase)base.Pointer2).FreezePropertyChange = false;
                        base.Display.YPosition = base.Pointer2.Position;
                    }
                    else
                    {
                        if (base.Display.YStatus == PlotChannelInterpolationResult.Empty)
                        {
                            base.Display.YText = "Empty";
                        }
                        else if (base.Display.YStatus == PlotChannelInterpolationResult.Invalid)
                        {
                            base.Display.YText = "Invalid";
                        }
                        else if (base.Display.YStatus == PlotChannelInterpolationResult.NoData)
                        {
                            base.Display.YText = "NoData";
                        }
                        else if (base.Display.YStatus == PlotChannelInterpolationResult.Null)
                        {
                            base.Display.YText = "Null";
                        }
                        else if (base.Display.YStatus == PlotChannelInterpolationResult.Valid)
                        {
                            base.Display.YText = "Invalid";
                        }
                        else if (base.Display.YStatus == PlotChannelInterpolationResult.Void)
                        {
                            base.Display.YText = "Invalid";
                        }
                        else
                        {
                            base.Display.YText = "Not Defined - Contact Iocomp for Update";
                        }
                        base.Display.YPosition = base.Pointer2.AxisPosition.ValueToPercent(channel.GetYValueAxisValue(channel.YMean));
                        ((ISubClassBase)base.Pointer2).FreezePropertyChange = true;
                        base.Pointer2.Position = base.Display.YPosition;
                        ((ISubClassBase)base.Pointer2).FreezePropertyChange = false;
                    }
                }
                channel.DataCursorX = base.Display.XValue;
                channel.DataCursorY = base.Display.YValue;
                base.Displays.Add(base.Display);
            }
        }
 public PlotChannelDataPointClickEventArgs(PlotChannelBase channel, MouseButtons button, int index)
 {
     this.m_Channel = channel;
     this.m_Button  = button;
     this.m_Index   = index;
 }
Example #17
0
 public bool Contains(PlotChannelBase value)
 {
     return(base.List.Contains(value));
 }
Example #18
0
 public int IndexOf(PlotChannelBase value)
 {
     return(base.List.IndexOf(value));
 }
Example #19
0
 public void Remove(PlotChannelBase value)
 {
     base.List.Remove(value);
 }
Example #20
0
 public void Insert(int index, PlotChannelBase value)
 {
     base.List.Insert(index, value);
 }
Example #21
0
 public int Add(PlotChannelBase value)
 {
     return(base.List.Add(value));
 }
Example #22
0
        protected override void Draw(PaintArgs p)
        {
            base.I_Fill.Draw(p, base.BoundsAlignment);
            DrawStringFormat genericTypographic = DrawStringFormat.GenericTypographic;

            genericTypographic.Alignment     = StringAlignment.Near;
            genericTypographic.LineAlignment = StringAlignment.Near;
            this.m_Rect.Rectangle            = base.BoundsAlignment;
            Size      size;
            Rectangle rectangle;

            if (base.DockHorizontal)
            {
                int num  = base.BoundsAlignment.Top + this.m_MarginOuterPixels;
                int num2 = base.BoundsAlignment.Left + this.m_MarginOuterPixels;
                this.m_Rect.Top    = num;
                this.m_Rect.Height = this.m_MarkerSize;
                this.m_Rect.Width  = this.m_MarkerWidthPixels;
                for (int i = 0; i < base.Channels.Count; i++)
                {
                    PlotChannelBase plotChannelBase = base.Channels[i] as PlotChannelBase;
                    if (plotChannelBase != null)
                    {
                        Brush  titleBrush         = this.GetTitleBrush(p, plotChannelBase);
                        string displayDescription = plotChannelBase.DisplayDescription;
                        size = p.Graphics.MeasureString(displayDescription, base.Font);
                        int num3 = i / this.m_MaxElementCount;
                        int num4 = i % this.m_MaxElementCount;
                        this.m_Rect.Top  = num + num4 * (this.m_SpacingPixels + this.m_MarkerSize);
                        this.m_Rect.Left = num2 + num3 * (this.m_MaxElementWidth + this.m_WrapMarginPixels);
                        rectangle        = new Rectangle(this.m_Rect.Left - this.m_MarginOuterPixels, this.m_Rect.Top, this.m_MarginOuterPixels + this.m_MarkerWidthPixels + this.m_TitleMarginPixels + size.Width, size.Height);
                        rectangle.Inflate(1, 1);
                        plotChannelBase.LegendRectangle = rectangle;
                        if (plotChannelBase.Focused && !rectangle.IsEmpty)
                        {
                            p.Graphics.DrawFocusRectangle(rectangle, base.BackColor);
                        }
                        ((IPlotChannelBase)plotChannelBase).DrawLegendMarker(p, this.m_Rect.Rectangle);
                        this.m_Rect.Left = num2 + num3 * (this.m_MaxElementWidth + this.m_WrapMarginPixels) + this.m_MarkerWidthPixels + this.m_TitleMarginPixels;
                        p.Graphics.DrawString(displayDescription, base.Font, titleBrush, (float)this.m_Rect.Left, (float)this.m_Rect.Top, genericTypographic);
                    }
                }
            }
            else
            {
                int num  = base.BoundsAlignment.Top + this.m_MarginOuterPixels;
                int num2 = base.BoundsAlignment.Left + this.m_MarginOuterPixels;
                this.m_Rect.Top    = num;
                this.m_Rect.Left   = num2;
                this.m_Rect.Height = this.m_MarkerSize;
                this.m_Rect.Width  = this.m_MarkerWidthPixels;
                for (int j = 0; j < base.Channels.Count; j++)
                {
                    PlotChannelBase plotChannelBase    = base.Channels[j] as PlotChannelBase;
                    Brush           titleBrush         = this.GetTitleBrush(p, plotChannelBase);
                    string          displayDescription = plotChannelBase.DisplayDescription;
                    size = p.Graphics.MeasureString(displayDescription, base.Font);
                    int num3 = j / this.m_MaxElementCount;
                    int num4 = j % this.m_MaxElementCount;
                    this.m_Rect.Top  = num + num3 * (this.m_WrapMarginPixels + this.m_MarkerSize);
                    this.m_Rect.Left = num2 + num4 * (this.m_MaxElementWidth + this.m_SpacingPixels);
                    rectangle        = new Rectangle(this.m_Rect.Left - this.m_MarginOuterPixels, this.m_Rect.Top, this.m_MarginOuterPixels + this.m_MarkerWidthPixels + this.m_TitleMarginPixels + size.Width, size.Height);
                    rectangle.Inflate(1, 1);
                    plotChannelBase.LegendRectangle = rectangle;
                    if (plotChannelBase.Focused && !rectangle.IsEmpty)
                    {
                        p.Graphics.DrawFocusRectangle(rectangle, base.BackColor);
                    }
                    ((IPlotChannelBase)plotChannelBase).DrawLegendMarker(p, this.m_Rect.Rectangle);
                    this.m_Rect.Left = num2 + num4 * (this.m_MaxElementWidth + this.m_SpacingPixels) + this.m_MarkerWidthPixels + this.m_TitleMarginPixels;
                    p.Graphics.DrawString(displayDescription, base.Font, titleBrush, (float)this.m_Rect.Left, (float)this.m_Rect.Top, genericTypographic);
                }
            }
        }
Example #23
0
        protected override void CalculateDepthPixels(PaintArgs p)
        {
            base.FreezePropertyChange = true;
            base.IgnoreCellChanges    = true;
            if (base.DockVertical)
            {
                base.ColTitlesVisible = false;
                base.RowTitlesVisible = true;
                base.DataRowCount     = 2;
                base.DataColCount     = this.DataPointCount;
                base[0, 1].Text       = "X";
                base[0, 2].Text       = "Y";
            }
            else
            {
                base.ColTitlesVisible = true;
                base.RowTitlesVisible = false;
                base.DataColCount     = 2;
                base.DataRowCount     = this.DataPointCount;
                base[1, 0].Text       = "X";
                base[2, 0].Text       = "Y";
            }
            PlotChannelBase channel = this.Channel;

            if (channel == null)
            {
                this.SetupForError("Channel Not Assigend");
            }
            else if (channel.XAxis == null)
            {
                this.SetupForError("Channel X-Axis not Assigend");
            }
            else if (channel.YAxis == null)
            {
                this.SetupForError("Channel Y-Axis not Assigend");
            }
            else
            {
                int num = (this.DataPointRangeStyle != 0) ? ((this.DataPointRangeStyle != PlotTableDataPointRangeStyle.Ending) ? ((this.DataPointRangeStyle == PlotTableDataPointRangeStyle.FromStartIndex) ? this.DataPointStartIndex : 0) : (channel.Count - this.DataPointCount)) : 0;
                for (int i = 0; i < this.DataPointCount; i++)
                {
                    int           num2 = i + 1;
                    int           num3 = num + i;
                    PlotTableCell plotTableCell;
                    PlotTableCell plotTableCell2;
                    if (base.DockVertical)
                    {
                        plotTableCell  = base[num2, 1];
                        plotTableCell2 = base[num2, 2];
                    }
                    else
                    {
                        plotTableCell  = base[1, num2];
                        plotTableCell2 = base[2, num2];
                    }
                    if (channel.Count != 0 && num3 >= 0 && num3 <= channel.IndexLast)
                    {
                        plotTableCell.Text  = channel.XAxis.TextFormatting.GetText(channel.GetX(num3));
                        plotTableCell2.Text = channel.YAxis.TextFormatting.GetText(channel.GetY(num3));
                    }
                    else
                    {
                        plotTableCell.Text  = Const.EmptyString;
                        plotTableCell2.Text = Const.EmptyString;
                    }
                }
                base.FreezePropertyChange = false;
                base.IgnoreCellChanges    = false;
                base.CalculateDepthPixels(p);
            }
        }
Example #24
0
        protected override void SetupPointers()
        {
            PlotChannelBase channel = base.Channel;
            bool            visible;

            if (channel != null)
            {
                if (channel is PlotChannelConsecutive)
                {
                    base.YIsInterpolated = true;
                }
                else
                {
                    base.YIsInterpolated = false;
                }
                visible = (!(channel is PlotChannelDigital) && true);
            }
            else
            {
                base.YIsInterpolated = false;
                visible = false;
            }
            if (base.Style == PlotDataCursorMultipleStyle.ValueX)
            {
                base.SetupPointersValueX();
            }
            else if (base.Style == PlotDataCursorMultipleStyle.DeltaX)
            {
                base.SetupPointersDeltaX();
            }
            else if (base.Style == PlotDataCursorMultipleStyle.DeltaY)
            {
                base.SetupPointersDeltaY();
            }
            else if (base.Style == PlotDataCursorMultipleStyle.InverseDeltaX)
            {
                base.SetupPointersInverseDeltaX();
            }
            else if (base.Style == PlotDataCursorMultipleStyle.InverseDeltaY)
            {
                base.SetupPointersInverseDeltaY();
            }
            else if (!base.YIsInterpolated)
            {
                if (base.Style == PlotDataCursorMultipleStyle.ValueXY)
                {
                    base.SetupPointersValueXY();
                }
                else if (base.Style == PlotDataCursorMultipleStyle.ValueY)
                {
                    base.SetupPointersValueY();
                }
            }
            else if (base.Style == PlotDataCursorMultipleStyle.ValueXY)
            {
                base.Pointer1.Style   = PlotAxisReference.XAxis;
                base.Pointer2.Style   = PlotAxisReference.YAxis;
                base.Pointer1.Visible = true;
                base.Pointer2.Visible = visible;
            }
            else if (base.Style == PlotDataCursorMultipleStyle.ValueY)
            {
                base.Pointer1.Style   = PlotAxisReference.XAxis;
                base.Pointer2.Style   = PlotAxisReference.YAxis;
                base.Pointer1.Visible = true;
                base.Pointer2.Visible = false;
            }
        }