예제 #1
0
        /// <summary>
        /// 开启或关闭TRACE功能,以ChannelTraceType标识TRACE的类型
        /// </summary>
        /// <param name="ctt"></param>
        /// <param name="value"></param>
        public void Trace(ChannelTraceType ctt, bool value)
        {
            if (ctt != ChannelTraceType.cttRlt)
            {
                plot.chnls.ResetTrace(ctt, value);

                RedrawCurve();
            }
        }
예제 #2
0
        private void MaxMinHldTrace(ChannelTraceType ctt, int dataIndex)
        {
            int i;
            int k0, k;
            PointF[] d1;
            PointF[] d2;

            PointF[] temp1, temp2;

            k0 = (int)ChannelTraceType.cttRlt;
            k  = (int)ctt;

            d1 = chnls[k0].DataOf(dataIndex);
            d2 = chnls[k].DataOf(dataIndex);

            if (d1 == null)
                return;

            if (d2 == null) {
                chnls[k].Insert(d1, dataIndex);
                return;
            }

            if (d1.Length == d2.Length)
            {
                if (ctt == ChannelTraceType.cttMax)
                {
                    for (i = 0; i < d2.Length; i++)
                        if (d1[i].Y > d2[i].Y)
                            d2[i] = d1[i];

                } else if (ctt == ChannelTraceType.cttMin)
                {
                    for (i = 0; i < d2.Length; i++)
                        if (d1[i].Y < d2[i].Y)
                            d2[i] = d1[i];
                }

            } else if (d1.Length > d2.Length) 
            {
                temp1 = new PointF[d1.Length];
               
                for (i = 0; i < d1.Length; i++)               
                    temp1[i] = d1[i];

                if (ctt == ChannelTraceType.cttMax)
                {
                    for (i = 0; i < d2.Length; i++)
                    {
                        if (d2[i].Y > temp1[i].Y)
                            temp1[i] = d2[i];
                    }

                } else if (ctt == ChannelTraceType.cttMin)
                {
                    for (i = 0; i < d2.Length; i++)
                    {
                        if (d2[i].Y < temp1[i].Y)
                            temp1[i] = d2[i];
                    }
                }                
               
                chnls[k].Insert(temp1, dataIndex);

            } else {
                temp2 = new PointF[d2.Length];

                for (i = 0; i < d2.Length; i++)
                    temp2[i] = d2[i];

                if (ctt == ChannelTraceType.cttMax)
                {
                    for (i = 0; i < d1.Length; i++)
                    {
                        if (d1[i].Y > temp2[i].Y)
                            temp2[i] = d1[i];
                    }

                } else if (ctt == ChannelTraceType.cttMin)
                {
                    for (i = 0; i < d1.Length; i++)
                    {
                        if (d1[i].Y < temp2[i].Y)
                            temp2[i] = d1[i];
                    }
                }

                chnls[k].Insert(temp2, dataIndex);
            }
        }
예제 #3
0
        //重置某一个TRACE Channel, 开启、关闭Trace支持功能 
        internal void ResetTrace(ChannelTraceType ctt, bool value)
        {          
            int k = (int)ctt;

            visible[k] = value;

            enableTrace[k] = value;

            if (value) {
                if ((ctt == ChannelTraceType.cttMax) ||
                    (ctt == ChannelTraceType.cttMin) ||
                    (ctt == ChannelTraceType.cttHld)) 
                    ResetMaxMinHld(ctt); 
            } 
        }
예제 #4
0
        private void ResetMaxMinHld(ChannelTraceType ctt)
        {
            int i;
            int k0, k;

            PointF[] d1; 

            k0 = (int)ChannelTraceType.cttRlt;
            k  = (int)ctt;
            
            chnls[k].Clear();
                    
            for (i = 0; i <= chnls[k0].MaxIndex; i++)
            {
                d1 = chnls[k0].DataOf(i);
                if (d1 != null)               
                    chnls[k].Insert(d1, i);
            }
        }