Exemplo n.º 1
0
 public Signal(AbstractSignalDump dump)
 {
     this.dump = dump;
     this.type = dump.Type;
     this.name = dump.Name;
     InitChildrens();
     InitValue();
 }
Exemplo n.º 2
0
 public SignalViewBase(AbstractSignalDump data, ScaleManager scaleManager)
 {
     this.data         = data;
     this.scaleManager = scaleManager;
     markers           = new List <TimeMarker>();
 }
Exemplo n.º 3
0
        /// <summary>
        /// Отображение шины в обычном виде
        /// </summary>
        /// <param name="canvas"></param>
        /// <param name="iter"></param>
        /// <param name="DrawValue"></param>
        protected void RenderSimpleBus(Canvas canvas, IValueIterator iter, DrawValueDelegate DrawValue)
        {
            canvas.Children.Clear();

            UInt64 MinimumVisibleChange = scaleManager.MinimumVisibleChange;

            //Рисование начала диаграммы
            UInt64 x1 = 0, x2 = 0;
            string value = string.Empty;

            x1 = scaleManager.VisibleStartTime;

            iter.SetCurrentIndexByKey(scaleManager.VisibleStartTime);
            x2 = iter.LastEvent;
            if (x2 > scaleManager.VisibleEndTime)
            {
                x2 = scaleManager.VisibleEndTime;
            }
            if (x2 < scaleManager.VisibleStartTime)
            {
                x2 = scaleManager.VisibleStartTime;
            }

            Markers.Add(new TimeMarker(x1, scaleManager.GetOffset(x1)));

            while (true)
            {
                //Началась "серая" область
                if ((x2 - x1) <= MinimumVisibleChange)
                {
                    UInt64 whitespace = x1;

                    while (true)
                    {
                        x1 = iter.LastEvent;
                        if (x1 > scaleManager.VisibleEndTime)
                        {
                            x1 = scaleManager.VisibleEndTime;
                        }
                        if (x1 < scaleManager.VisibleStartTime)
                        {
                            x1 = scaleManager.VisibleStartTime;
                        }
                        iter.MoveNext();
                        x2 = iter.LastEvent;
                        if (x2 > scaleManager.VisibleEndTime)
                        {
                            x2 = scaleManager.VisibleEndTime;
                        }
                        if (x2 < scaleManager.VisibleStartTime)
                        {
                            x2 = scaleManager.VisibleStartTime;
                        }
                        //закончилась "серая" область
                        if ((x2 - x1) >= scaleManager.MinimumVisibleChange)
                        {
                            AddWhitespace(canvas, whitespace, x1, scaleManager);
                            value = AbstractSignalDump.GetStringValue(iter);
                            Markers.Add(new TimeMarker(x1, scaleManager.GetOffset(x1)));
                            DrawValue(canvas, x1, x2, scaleManager, value);
                            break;
                        }

                        if ((iter.LastEvent >= scaleManager.VisibleEndTime) || (iter.IsEndOfIteration == true))
                        {
                            Markers.Add(new TimeMarker(whitespace, scaleManager.GetOffset(whitespace)));
                            AddWhitespace(canvas, whitespace, iter.LastEvent, scaleManager);
                            break;
                        }
                        iter.SetCurrentIndexByKey(x1 + MinimumVisibleChange);
                    }
                }
                else
                {
                    value = AbstractSignalDump.GetStringValue(iter);
                    Markers.Add(new TimeMarker(x1, scaleManager.GetOffset(x1)));
                    DrawValue(canvas, x1, x2, scaleManager, value);
                    iter.MoveNext();
                }

                x1 = x2;
                x2 = iter.LastEvent;

                if ((iter.LastEvent >= scaleManager.VisibleEndTime) || (iter.IsEndOfIteration == true))
                {
                    value = AbstractSignalDump.GetStringValue(iter);
                    Markers.Add(new TimeMarker(x1, scaleManager.GetOffset(x1)));
                    DrawValue(canvas, x1, scaleManager.VisibleEndTime, scaleManager, value);
                    break;
                }

                if (x2 > scaleManager.VisibleEndTime)
                {
                    x2 = scaleManager.VisibleEndTime;
                }
                if (x2 < scaleManager.VisibleStartTime)
                {
                    x2 = scaleManager.VisibleStartTime;
                }
            }
        }