Ejemplo n.º 1
0
 /// <summary>
 /// Notifies that a partition's live status has changed.
 /// </summary>
 /// <param name="storePath">The path to the store whose live status has changed.</param>
 /// <param name="isLive">True if the partition is live, otherwise false.</param>
 public void NotifyLivePartitionStatus(string storePath, bool isLive)
 {
     // For every visualization object, if its source of data is
     // storePath, then update the visualization object's IsLive value
     foreach (VisualizationPanel panel in this.Panels)
     {
         foreach (VisualizationObject visualizationobject in panel.VisualizationObjects)
         {
             IStreamVisualizationObject streamVisualizationObject = visualizationobject as IStreamVisualizationObject;
             if ((streamVisualizationObject != null) && (streamVisualizationObject.StreamBinding.StorePath == storePath))
             {
                 streamVisualizationObject.IsLive = isLive;
             }
         }
     }
 }
        private DateTime GetTimeAtMousePointer(Point point, TimelineScroller root, bool useSnap)
        {
            double   percent   = point.X / root.ActualWidth;
            var      viewRange = this.Navigator.ViewRange;
            DateTime time      = viewRange.StartTime + TimeSpan.FromTicks((long)((double)viewRange.Duration.Ticks * percent));

            // If we're currently snapping to some Visualization Object, adjust the time to the timestamp of the nearest message
            DateTime?snappedTime = null;

            if (useSnap)
            {
                IStreamVisualizationObject snapToVisualizationObject = this.Container.SnapToVisualizationObject as IStreamVisualizationObject;
                if (snapToVisualizationObject != null)
                {
                    snappedTime = snapToVisualizationObject.GetSnappedTime(time, SnappingBehavior.Nearest);
                }
            }

            return(snappedTime ?? time);
        }
Ejemplo n.º 3
0
        private void ZoomToPanel()
        {
            // Get a list of time intervals for all stream visualization objects in this panel
            List <TimeInterval> streamIntervals = new List <TimeInterval>();

            foreach (VisualizationObject visualizationObject in this.VisualizationObjects)
            {
                IStreamVisualizationObject streamVisualizationObject = visualizationObject as IStreamVisualizationObject;
                IStreamMetadata            streamMetadata            = streamVisualizationObject?.StreamBinding?.StreamMetadata;
                if (streamMetadata != null)
                {
                    streamIntervals.Add(new TimeInterval(streamMetadata.FirstMessageOriginatingTime, streamMetadata.LastMessageOriginatingTime));
                }
            }

            // Zoom to the coverage of the stream visualization objects
            if (streamIntervals.Count > 0)
            {
                TimeInterval panelInterval = TimeInterval.Coverage(streamIntervals);
                this.Container.Navigator.Zoom(panelInterval.Left, panelInterval.Right);
            }
        }