void EnsureTimeSeriesInitialized()
        {
            if (timeSeriesForm != null)
            {
                return;
            }

            var viewObjects = CreateTimeSeriesViewObjects();

            timeSeriesForm = viewObjects.Item1;
            var view = viewObjects.Item2;

            timeSeriesModel = new LogJoint.Postprocessing.TimeSeries.TimelineVisualizerModel(
                app.Model.Postprocessing.PostprocessorsManager,
                app.Model.SourcesManager,
                app.Model.Postprocessing.ShortNames,
                app.Model.Postprocessing.LogSourceNamesProvider
                );
            timeSeriesPresenter = new Presenters.Postprocessing.TimeSeriesVisualizer.TimeSeriesVisualizerPresenter(
                timeSeriesModel,
                view,
                new Presenters.Postprocessing.Common.PresentationObjectsFactory(app.Model.Postprocessing.PostprocessorsManager, app.Model.SourcesManager),
                app.Presentation.LoadedMessages.LogViewerPresenter,
                app.Model.Bookmarks,
                app.Presentation.Facade
                );
            FormCreated?.Invoke(this, new PostprocessorOutputFormCreatedEventArgs(ViewControlId.TimeSeries, timeSeriesForm, timeSeriesPresenter));
        }
        void EnsureStateInspectorInitialized()
        {
            if (stateInspectorForm != null)
            {
                return;
            }
            var viewObjects = CreateStateInspectorViewObjects();

            stateInspectorForm = viewObjects.Item1;
            var view = viewObjects.Item2;

            stateInspectorModel = new LogJoint.Postprocessing.StateInspector.StateInspectorVisualizerModel(
                app.Model.Postprocessing.PostprocessorsManager,
                app.Model.SourcesManager,
                app.Model.ModelThreadSynchronization,
                app.Model.Postprocessing.ShortNames
                );
            stateInspectorPresenter = new Presenters.Postprocessing.StateInspectorVisualizer.StateInspectorPresenter(
                view,
                stateInspectorModel,
                app.Model.Postprocessing.ShortNames,
                app.Model.SourcesManager,
                app.Presentation.LoadedMessages,
                app.Model.Bookmarks,
                app.Model.Threads,
                app.Presentation.Facade,
                app.Presentation.ClipboardAccess,
                app.Presentation.SourcesManager
                );
            FormCreated?.Invoke(this, new PostprocessorOutputFormCreatedEventArgs(ViewControlId.StateInspector, stateInspectorForm, stateInspectorPresenter));
        }
        void EnsureSequenceDiagramInitialized()
        {
            if (sequenceDiagramForm != null)
            {
                return;
            }

            EnsureStateInspectorInitialized();

            var viewObjects = CreateSequenceDiagramViewObjects();

            sequenceDiagramForm = viewObjects.Item1;
            var view = viewObjects.Item2;

            sequenceDiagramModel = new LogJoint.Postprocessing.SequenceDiagram.SequenceDiagramVisualizerModel(
                app.Model.Postprocessing.PostprocessorsManager,
                app.Model.SourcesManager,
                app.Model.Postprocessing.ShortNames,
                app.Model.Postprocessing.LogSourceNamesProvider
                );
            sequenceDiagramPresenter = new Presenters.Postprocessing.SequenceDiagramVisualizer.SequenceDiagramVisualizerPresenter(
                sequenceDiagramModel,
                view,
                stateInspectorPresenter,
                new Presenters.Postprocessing.Common.PresentationObjectsFactory(app.Model.Postprocessing.PostprocessorsManager, app.Model.SourcesManager),
                app.Presentation.LoadedMessages,
                app.Model.Bookmarks,
                app.Model.StorageManager,
                app.Presentation.Facade,
                app.Model.Postprocessing.ShortNames
                );
            FormCreated?.Invoke(this, new PostprocessorOutputFormCreatedEventArgs(ViewControlId.Sequence, sequenceDiagramForm, sequenceDiagramPresenter));
        }
Exemple #4
0
        public static void Init(IApplication app)
        {
            app.Model.Postprocessing.TimeSeriesTypes.RegisterTimeSeriesTypesAssembly(typeof(Chromium.TimeSeries.PostprocessorsFactory).Assembly);

            IPostprocessorsRegistry postprocessorsRegistry = new PostprocessorsInitializer(
                app.Model.Postprocessing.PostprocessorsManager,
                app.Model.UserDefinedFormatsManager,
                new Chromium.StateInspector.PostprocessorsFactory(),
                new Chromium.TimeSeries.PostprocessorsFactory(app.Model.Postprocessing.TimeSeriesTypes),
                new Chromium.Correlator.PostprocessorsFactory(app.Model),
                new Chromium.Timeline.PostprocessorsFactory()
                );


            UI.Presenters.Postprocessing.TimeSeriesVisualizer.IPresenter            timeSeriesPresenter = null;
            UI.Presenters.Postprocessing.MainWindowTabPage.IPostprocessorOutputForm timeSeriesForm      = null;

            app.Presentation.PostprocessorsFormFactory.FormCreated += (sender, evt) =>
            {
                if (evt.Id == UI.Presenters.Postprocessing.MainWindowTabPage.ViewControlId.StateInspector)
                {
                    var stateInspectorPresenter = evt.Presenter as UI.Presenters.Postprocessing.StateInspectorVisualizer.IPresenter;
                    if (stateInspectorPresenter != null)
                    {
                        stateInspectorPresenter.OnNodeCreated += (senderPresenter, arg) =>
                        {
                            if (Chromium.ChromeDebugLog.WebRtcStateInspector.ShouldBePresentedCollapsed(arg.NodeObject))
                            {
                                arg.CreateCollapsed = true;
                            }
                            else if (Chromium.WebrtcInternalsDump.WebRtcStateInspector.ShouldBePresentedCollapsed(arg.NodeObject))
                            {
                                arg.CreateCollapsed = true;
                            }
                        };
                        stateInspectorPresenter.OnMenu += (senderPresenter, arg) =>
                        {
                            if (stateInspectorPresenter.SelectedObject != null)
                            {
                                if (WebrtcInternalsDump.WebRtcStateInspector.HasTimeSeries(stateInspectorPresenter.SelectedObject) ||
                                    ChromeDebugLog.WebRtcStateInspector.HasTimeSeries(stateInspectorPresenter.SelectedObject))
                                {
                                    app.Presentation.PostprocessorsFormFactory.GetPostprocessorOutputForm(UI.Presenters.Postprocessing.MainWindowTabPage.ViewControlId.TimeSeries);
                                    Predicate <UI.Presenters.Postprocessing.TimeSeriesVisualizer.TreeNodeData> predicate = node =>
                                                                                                                           node.Type == UI.Presenters.Postprocessing.TimeSeriesVisualizer.ConfigDialogNodeType.ObjectIdGroup &&
                                                                                                                           node.Caption.Contains(stateInspectorPresenter.SelectedObject.Id) &&
                                                                                                                           stateInspectorPresenter.SelectedObject.Owner.Outputs.Any(x => x.LogSource == node.Owner.LogSource);
                                    if (timeSeriesPresenter != null && timeSeriesPresenter.ConfigNodeExists(predicate))
                                    {
                                        arg.Items.Add(new UI.Presenters.Postprocessing.StateInspectorVisualizer.MenuData.Item()
                                        {
                                            Text  = "Go to time series",
                                            Click = () =>
                                            {
                                                timeSeriesForm.Show();
                                                timeSeriesPresenter.OpenConfigDialog();
                                                timeSeriesPresenter.SelectConfigNode(predicate);
                                            }
                                        });
                                    }
                                }
                            }
                        };
                    }
                }
                else if (evt.Id == UI.Presenters.Postprocessing.MainWindowTabPage.ViewControlId.TimeSeries)
                {
                    timeSeriesPresenter = evt.Presenter as UI.Presenters.Postprocessing.TimeSeriesVisualizer.IPresenter;
                    timeSeriesForm      = evt.Form;
                }
            };

            app.Model.PreprocessingManagerExtensionsRegistry.Register(
                new WebrtcInternalsDump.PreprocessingManagerExtension(app.Model.PreprocessingStepsFactory)
                );
            app.Model.PreprocessingManagerExtensionsRegistry.Register(
                new ChromeDriver.PreprocessingManagerExtension(app.Model.PreprocessingStepsFactory, postprocessorsRegistry.ChromeDriver.LogProviderFactory)
                );
        }