/// <summary> /// Shows the specified stream in an appropriate visualization panel, creating a new one if needed. /// </summary> /// <typeparam name="TObject">The type of client stream visualization object (proxy) to create.</typeparam> /// <typeparam name="TData">The type of underlying data of the stream visualization object.</typeparam> /// <typeparam name="TConfig">The type of configuration of the stream visualization object</typeparam> /// <typeparam name="TPanel">The type of visauzalition panel required to show the stream.</typeparam> /// <param name="vc">The visualization client.</param> /// <param name="stream">Stream to show.</param> /// <returns>The newly created <see cref="StreamVisualizationObject{TData, TConfig}"/> used to show the stream.</returns> public static TObject Show <TObject, TData, TConfig, TPanel>(this VisualizationClient vc, IProducer <TData> stream) where TObject : StreamVisualizationObject <TData, TConfig>, new() where TConfig : StreamVisualizationObjectConfiguration, new() where TPanel : VisualizationPanel, new() { PsiStreamMetadata streamMetadata; if (!Store.TryGetMetadata(stream, out streamMetadata)) { throw new ApplicationException("Stream not found."); } var streamBinding = new StreamBinding(streamMetadata.Name, streamMetadata.PartitionName, streamMetadata.PartitionName, streamMetadata.PartitionPath, typeof(SimpleReader)); return(vc.Show <TObject, TData, TConfig, TPanel>(streamBinding)); }
/// <summary> /// Shows a stream of doubles. /// </summary> /// <param name="stream">A stream of doubles to show.</param> /// <param name="vc">The visualization client.</param> /// <returns>The newly created <see cref="StreamVisualizationObject{TData, TConfig}"/> used to show the stream.</returns> public static PlotVisualizationObject Show(this IProducer <double> stream, VisualizationClient vc) { PsiStreamMetadata streamMetadata; if (!Store.TryGetMetadata(stream, out streamMetadata)) { throw new ApplicationException("Stream not found."); } var streamBinding = new StreamBinding( streamMetadata.Name, streamMetadata.PartitionName, streamMetadata.PartitionName, streamMetadata.PartitionPath, typeof(SimpleReader), null, "Microsoft.Psi.Visualization.Summarizers.RangeSummarizer"); return(vc.Show <PlotVisualizationObject, double, PlotVisualizationObjectConfiguration, TimelineVisualizationPanel>(streamBinding)); }
/// <summary> /// Shows an audio stream. /// </summary> /// <param name="stream">Aduio stream to show.</param> /// <param name="vc">The visualization client.</param> /// <param name="channel">The audio channel to show. Default is 0.</param> /// <returns>The newly created <see cref="StreamVisualizationObject{TData, TConfig}"/> used to show the stream.</returns> public static AudioVisualizationObject Show(this IProducer <AudioBuffer> stream, VisualizationClient vc, int channel = 0) { PsiStreamMetadata streamMetadata; if (!Store.TryGetMetadata(stream, out streamMetadata)) { throw new ApplicationException("Stream not found."); } var streamBinding = new StreamBinding( streamMetadata.Name, streamMetadata.PartitionName, streamMetadata.PartitionName, streamMetadata.PartitionPath, typeof(SimpleReader), null, "Microsoft.Psi.Visualization.Summarizers.AudioSummarizer", new object[] { channel }); return(vc.Show <AudioVisualizationObject, double, AudioVisualizationObjectConfiguration, TimelineVisualizationPanel>(streamBinding)); }
/// <summary> /// Shows a list of 3D points stream in an XYZ visualization panel. /// </summary> /// <param name="stream">A list of 3D points stream to show.</param> /// <param name="vc">The visualization client.</param> /// <returns>The newly created <see cref="StreamVisualizationObject{TData, TConfig}"/> used to show the stream.</returns> public static Points3DVisualizationObject ShowScatterPlot3D(this IProducer <List <System.Windows.Media.Media3D.Point3D> > stream, VisualizationClient vc) { return(vc.Show <Points3DVisualizationObject, List <System.Windows.Media.Media3D.Point3D>, Points3DVisualizationObjectConfiguration, XYZVisualizationPanel>(stream)); }
/// <summary> /// Shows a Kinect bodies stream in an XYZ visualization panel. /// </summary> /// <param name="stream">Kinect bodies stream to show.</param> /// <param name="vc">The visualization client.</param> /// <returns>The newly created <see cref="StreamVisualizationObject{TData, TConfig}"/> used to show the stream.</returns> public static KinectBodies3DVisualizationObject Show(this IProducer <List <KinectBody> > stream, VisualizationClient vc) { return(vc.Show <KinectBodies3DVisualizationObject, List <KinectBody>, KinectBodies3DVisualizationObjectConfiguration, XYZVisualizationPanel>(stream)); }
/// <summary> /// Shows an image stream. /// </summary> /// <param name="stream">Image stream to show.</param> /// <param name="vc">The visualization client.</param> /// <returns>The newly created <see cref="StreamVisualizationObject{TData, TConfig}"/> used to show the stream.</returns> public static ImageVisualizationObject Show(this IProducer <Shared <Image> > stream, VisualizationClient vc) { return(vc.Show <ImageVisualizationObject, Shared <Image>, ImageVisualizationObjectBaseConfiguration, XYVisualizationPanel>(stream)); }
/// <summary> /// Shows the specified stream in an <see cref="XYVisualizationPanel"/> /// </summary> /// <typeparam name="TObject">The type of client stream visualization object (proxy) to create.</typeparam> /// <typeparam name="TData">The type of underlying data of the stream visualization object.</typeparam> /// <typeparam name="TConfig">The type of configuration of the stream visualization object</typeparam> /// <param name="stream">Stream to show.</param> /// <param name="vc">The visualization client.</param> /// <returns>The newly created <see cref="StreamVisualizationObject{TData, TConfig}"/> used to show the stream.</returns> public static TObject Show <TObject, TData, TConfig>(this IProducer <TData> stream, VisualizationClient vc) where TObject : StreamVisualizationObject <TData, TConfig>, new() where TConfig : StreamVisualizationObjectConfiguration, new() { return(vc.Show <TObject, TData, TConfig, XYVisualizationPanel>(stream)); }
/// <summary> /// Shows a stream of annotations /// </summary> /// <param name="stream">A stream of annotations show.</param> /// <param name="vc">The visuzalization client.</param> /// <returns>The newly created <see cref="StreamVisualizationObject{TData, TConfig}"/> used to show the stream.</returns> public static AnnotatedEventVisualizationObject ShowAnnotations(this IProducer <AnnotatedEvent> stream, VisualizationClient vc) { return(vc.Show <AnnotatedEventVisualizationObject, AnnotatedEvent, AnnotatedEventVisualizationObjectConfiguration, TimelineVisualizationPanel>(stream)); }
/// <summary> /// Shows a derived stream of message latencies for any other stream. /// </summary> /// <typeparam name="T">The type of the stream.</typeparam> /// <param name="stream">A stream of annotations show.</param> /// <param name="vc">The visuzalization client.</param> /// <returns>The newly created <see cref="StreamVisualizationObject{TData, TConfig}"/> used to show the stream.</returns> public static TimeIntervalVisualizationObject ShowLatency <T>(this IProducer <T> stream, VisualizationClient vc) { var latencyStream = stream.Select((data, env) => Tuple.Create(env.OriginatingTime, env.Time)); return(vc.Show <TimeIntervalVisualizationObject, Tuple <DateTime, DateTime>, TimeIntervalVisualizationObjectConfiguration, TimelineVisualizationPanel>(latencyStream)); }
/// <summary> /// Shows a stream of strings with durations. /// </summary> /// <param name="stream">A stream of strings with durations to show.</param> /// <param name="vc">The visuzalization client.</param> /// <returns>The newly created <see cref="StreamVisualizationObject{TData, TConfig}"/> used to show the stream.</returns> public static StringWithDurationVisualizationObject Show(this IProducer <Tuple <string, TimeSpan> > stream, VisualizationClient vc) { return(vc.Show <StringWithDurationVisualizationObject, Tuple <string, TimeSpan>, StringWithDurationVisualizationObjectConfiguration, TimelineVisualizationPanel>(stream)); }
/// <summary> /// Shows a stream of speech recognition results. /// </summary> /// <param name="stream">A stream of speech recognition results to show.</param> /// <param name="vc">The visuzalization client.</param> /// <returns>The newly created <see cref="StreamVisualizationObject{TData, TConfig}"/> used to show the stream.</returns> public static SpeechRecognitionVisualizationObject Show(this IProducer <IStreamingSpeechRecognitionResult> stream, VisualizationClient vc) { return(vc.Show <SpeechRecognitionVisualizationObject, IStreamingSpeechRecognitionResult, SpeechRecognitionVisualizationObjectConfiguration, TimelineVisualizationPanel>(stream)); }
/// <summary> /// Shows a stream of a list of rectangles. /// </summary> /// <param name="stream">A stream of a list of rectangles to show.</param> /// <param name="vc">The visuzalization client.</param> /// <returns>The newly created <see cref="StreamVisualizationObject{TData, TConfig}"/> used to show the stream.</returns> public static ScatterRectangleVisualizationObject Show(this IProducer <List <Tuple <System.Drawing.Rectangle, string> > > stream, VisualizationClient vc) { return(vc.Show <ScatterRectangleVisualizationObject, List <Tuple <System.Drawing.Rectangle, string> >, ScatterRectangleVisualizationObjectConfiguration, XYVisualizationPanel>(stream)); }
/// <summary> /// Shows a stream of a list of named points. /// </summary> /// <param name="stream">A stream of a list of named points to show.</param> /// <param name="vc">The visuzalization client.</param> /// <returns>The newly created <see cref="StreamVisualizationObject{TData, TConfig}"/> used to show the stream.</returns> public static ScatterPlotVisualizationObject Show(this IProducer <List <Tuple <Point, string> > > stream, VisualizationClient vc) { return(vc.Show <ScatterPlotVisualizationObject, List <Tuple <Point, string> >, ScatterPlotVisualizationObjectConfiguration, XYVisualizationPanel>(stream)); }
/// <summary> /// Shows a stream of a list of coordinate systems. /// </summary> /// <param name="stream">A stream of a list of coordinate systems to show.</param> /// <param name="vc">The visuzalization client.</param> /// <returns>The newly created <see cref="StreamVisualizationObject{TData, TConfig}"/> used to show the stream.</returns> public static ScatterCoordinateSystemsVisualizationObject Show(this IProducer <List <CoordinateSystem> > stream, VisualizationClient vc) { return(vc.Show <ScatterCoordinateSystemsVisualizationObject, List <CoordinateSystem>, ScatterCoordinateSystemsVisualizationObjectConfiguration, XYZVisualizationPanel>(stream)); }