예제 #1
0
        public void Initialize()
        {
            ClassifierMachineLearning  = GetClassifierMachineLearning();
            ClassifierFixtureListUpper = new FixtureListClassifier();
            ClassifierFixtureListUpper.FixtureProfiles = AnalysisUpper.FixtureProfiles;

            var classifierCompositeUpper = new CompositeClassifier();

            classifierCompositeUpper.ClassifierMachineLearning = ClassifierMachineLearning;
            classifierCompositeUpper.ClassifierFixtureList     = ClassifierFixtureListUpper;

            StyledEventsViewerUpper.EventsViewer.LinedEventsCanvas.ClassifierDisaggregation = classifierCompositeUpper;
            StyledEventsViewerUpper.Events          = AnalysisUpper.Events;
            StyledEventsViewerUpper.ViewportSeconds = EventsViewer.SecondsTwoHours;
            StyledEventsViewerUpper.ViewportVolume  = EventsViewer.VolumeTen;
            StyledEventsViewerUpper.Initialize();

            ClassifierFixtureListLower = new FixtureListClassifier();
            ClassifierFixtureListLower.FixtureProfiles = AnalysisLower.FixtureProfiles;

            var classifierCompositeLower = new CompositeClassifier();

            classifierCompositeLower.ClassifierMachineLearning = ClassifierMachineLearning;
            classifierCompositeLower.ClassifierFixtureList     = ClassifierFixtureListLower;

            StyledEventsViewerLower.EventsViewer.LinedEventsCanvas.ClassifierDisaggregation = classifierCompositeLower;
            StyledEventsViewerLower.Events          = AnalysisLower.Events;
            StyledEventsViewerLower.ViewportSeconds = EventsViewer.SecondsTwoHours;
            StyledEventsViewerLower.ViewportVolume  = EventsViewer.VolumeTen;
            StyledEventsViewerLower.Initialize();

            ButtonLinkScrollBars.IsEnabled    = CanLinkScrollBars(AnalysisUpper, AnalysisLower);
            ButtonSynchronizeGraphs.IsEnabled = CanSynchronizeGraphs(AnalysisUpper, AnalysisLower);

            ButtonSynchronizeGraphs.Click += new RoutedEventHandler(ButtonSynchronizeGraphs_Click);
            ButtonLinkScrollBars.Click    += new RoutedEventHandler(ButtonLinkScrollBars_Click);
            ButtonAppend.Click            += new RoutedEventHandler(ButtonAppend_Click);

            ButtonAppend.MouseEnter            += new MouseEventHandler(ButtonAppend_MouseEnter);
            ButtonSynchronizeGraphs.MouseEnter += new MouseEventHandler(ButtonSynchronizeGraphs_MouseEnter);

            this.Loaded += new RoutedEventHandler(CompareAnalysesPanel_Loaded);
        }
예제 #2
0
        public void Initialize()
        {
            ClassifierMachineLearning = GetClassifierMachineLearning();
            var classifierFixtureList = new FixtureListClassifier();

            classifierFixtureList.FixtureProfiles = Analysis.FixtureProfiles;

            ClassifierComposite = new CompositeClassifier();
            ClassifierComposite.ClassifierMachineLearning = ClassifierMachineLearning;
            ClassifierComposite.ClassifierFixtureList     = classifierFixtureList;

            Analysis.UndoManager.RenderEvent   = StyledEventsViewer.EventsViewer.LinedEventsCanvas.RenderEvent;
            Analysis.UndoManager.RemovePolygon = StyledEventsViewer.EventsViewer.LinedEventsCanvas.Remove;

            StyledEventsViewer.EventsViewer.LinedEventsCanvas.PropertyChanged += new PropertyChangedEventHandler(EventsCanvas_PropertyChanged);
            GraphToolBar.PropertyChanged += new PropertyChangedEventHandler(GraphToolBar_PropertyChanged);
            CommandPanel.PropertyChanged += new PropertyChangedEventHandler(CommandPanel_PropertyChanged);

            GraphToolBar.Analysis     = Analysis;
            GraphToolBar.FeatureLevel = FeatureLevel;
            GraphToolBar.UndoManager  = Analysis.UndoManager;
            GraphToolBar.ClassifierMachineLearning = ClassifierMachineLearning;
            //GraphToolBar.ClassifierFixtureList = classifierComposite;
            GraphToolBar.Initialize();

            CommandPanel.AnalysisPanel = this;
            CommandPanel.Initialize();

            FixtureProfilesEditor.Analysis = this.Analysis;
            FixtureProfilesEditor.Initialize();

            Binding binding;

            if (Properties.Settings.Default.ShowEventPanelsOnLeft)
            {
                dockEventPanelsHorizontal.Visibility = Visibility.Collapsed;

                SelectedEventPanelVertical.Analysis = Analysis;
                Analysis.Events.PropertyChanged    += new PropertyChangedEventHandler(SelectedEventPanelVertical.Events_PropertyChanged);
                SelectedEventPanelVertical.Initialize();
                binding        = new Binding("Visibility");
                binding.Source = SelectedEventPanelVertical;
                BindingOperations.SetBinding(SeparatorSelectedEventPanelVertical, VisibilityProperty, binding);

                CurrentEventPanelVertical.Analysis = Analysis;
                StyledEventsViewer.EventsViewer.LinedEventsCanvas.PropertyChanged += new PropertyChangedEventHandler(CurrentEventPanelVertical.EventsCanvas_PropertyChanged);
                CurrentEventPanelVertical.ShowSelectedEvent = false;
                CurrentEventPanelVertical.Initialize();
            }
            else
            {
                dockEventPanelsVertical.Visibility = Visibility.Collapsed;

                SelectedEventPanel.Analysis      = Analysis;
                Analysis.Events.PropertyChanged += new PropertyChangedEventHandler(SelectedEventPanel.Events_PropertyChanged);
                SelectedEventPanel.Initialize();
                binding        = new Binding("Visibility");
                binding.Source = SelectedEventPanel;
                BindingOperations.SetBinding(SeparatorSelectedEventPanel, VisibilityProperty, binding);

                CurrentEventPanel.Analysis = Analysis;
                StyledEventsViewer.EventsViewer.LinedEventsCanvas.PropertyChanged += new PropertyChangedEventHandler(CurrentEventPanel.EventsCanvas_PropertyChanged);
                CurrentEventPanel.ShowSelectedEvent = false;
                CurrentEventPanel.Initialize();
                binding        = new Binding("Visibility");
                binding.Source = CurrentEventPanel;
                BindingOperations.SetBinding(SeparatorCurrentEventPanel, VisibilityProperty, binding);
            }

            LogMeter log = Analysis.Log as LogMeter;

            if (log == null)
            {
                LogPropertiesPanel.Visibility = Visibility.Collapsed;
            }
            else
            {
                LogPropertiesPanel.Analysis = Analysis;
                LogPropertiesPanel.Initialize();
            }

            binding        = new Binding("Visibility");
            binding.Source = LogPropertiesPanel;
            BindingOperations.SetBinding(SeparatorLogPanel, VisibilityProperty, binding);

            PieChartsPanel.Analysis = Analysis;
            PieChartsPanel.Initialize();

            binding        = new Binding("Visibility");
            binding.Source = PieChartsPanel;
            BindingOperations.SetBinding(SeparatorPieChartsPanel, VisibilityProperty, binding);

            ReportsPanel.Analysis = Analysis;
            ReportsPanel.Initialize();

            binding        = new Binding("Visibility");
            binding.Source = ReportsPanel;
            BindingOperations.SetBinding(SeparatorReportsPanel, VisibilityProperty, binding);

            FixturesPanel.Analysis = Analysis;
            FixturesPanel.Initialize();

            StyledEventsViewer.EventsViewer.LinedEventsCanvas.ClassifierDisaggregation = ClassifierComposite;
            StyledEventsViewer.Events          = Analysis.Events;
            StyledEventsViewer.ViewportSeconds = ViewportSeconds;
            StyledEventsViewer.ViewportVolume  = ViewportVolume;
            StyledEventsViewer.Initialize();
        }