Beispiel #1
0
        public void Add(TraceItem item)
        {
            ModifyCount++;
            traceItems.Add(item);

            if (FirstTime == long.MinValue)
            {
                FirstTime = item.Time;
            }

            var chItem = item as TraceItemChannel;

            if (chItem == null)
            {
                return;
            }

            if (ChannelCount == 0)
            {
                ChannelCount = chItem.Channels.Count;
            }

            if (item.Host == Host.A)
            {
                chItem.UpdateDeltas(lastTraceItemChannelB);
                lastTraceItemChannelB = chItem;
            }
            else
            {
                chItem.UpdateDeltas(lastTraceItemChannelA);
                lastTraceItemChannelA = chItem;
            }
        }
Beispiel #2
0
        public void UpdateDeltas(TraceItemChannel lastItem)
        {
            if (lastItem == null)
            {
                return;
            }
            PreviousTime = lastItem.Time;
            var deltaSeconds = (Time - PreviousTime) / (double)Stopwatch.Frequency;

            for (var i = 0; i < Channels.Count; i++)
            {
                Channels[i].UpdateDeltas(lastItem.Channels[i], deltaSeconds);
            }
        }
Beispiel #3
0
        private void AddTraceItem(Host host, TestNode.GetStateResult result)
        {
            var item = new TraceItemChannel
            {
                Time = Stopwatch.GetTimestamp(),
                Host = host
                       //Channels = results[0].Channels
            };
            var channelId = 0;

            foreach (var ch in result.Channels)
            {
                item.Channels.Add(new ChannelState
                {
                    ChannelId    = channelId,
                    RecvPosition = ch.RecvPostion,
                    XmitPosition = ch.XmitPosition,
                    RecvLimit    = ch.RecvLimit,
                    XmitLimit    = ch.XmitLimit,
                });
                channelId++;
            }
            Trace.Add(item);
        }