Пример #1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.LayoutRoot = ((System.Windows.Controls.Grid)(target));
                return;

            case 2:
                this.GridCount = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.ScrollViewerCount = ((System.Windows.Controls.ScrollViewer)(target));

            #line 52 "..\..\..\View\MainWindow.xaml"
                this.ScrollViewerCount.ScrollChanged += new System.Windows.Controls.ScrollChangedEventHandler(this.ScrollChanged);

            #line default
            #line hidden
                return;

            case 4:
                this.CountChart = ((System.Windows.Controls.DataVisualization.Charting.Chart)(target));

            #line 54 "..\..\..\View\MainWindow.xaml"
                this.CountChart.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.MouseLeftButtonDown);

            #line default
            #line hidden

            #line 54 "..\..\..\View\MainWindow.xaml"
                this.CountChart.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.MouseWheel);

            #line default
            #line hidden
                return;

            case 5:
                this.GridLay1 = ((System.Windows.Controls.Grid)(target));
                return;

            case 6:
                this.ScrollViewerLayer1 = ((System.Windows.Controls.ScrollViewer)(target));

            #line 207 "..\..\..\View\MainWindow.xaml"
                this.ScrollViewerLayer1.ScrollChanged += new System.Windows.Controls.ScrollChangedEventHandler(this.ScrollChanged);

            #line default
            #line hidden
                return;

            case 7:
                this.ChartLayer1 = ((System.Windows.Controls.DataVisualization.Charting.Chart)(target));

            #line 208 "..\..\..\View\MainWindow.xaml"
                this.ChartLayer1.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.MouseLeftButtonDown);

            #line default
            #line hidden

            #line 209 "..\..\..\View\MainWindow.xaml"
                this.ChartLayer1.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.MouseWheel);

            #line default
            #line hidden
                return;

            case 8:
                this.GridLay2 = ((System.Windows.Controls.Grid)(target));
                return;

            case 9:
                this.ScrollViewerLayer2 = ((System.Windows.Controls.ScrollViewer)(target));

            #line 237 "..\..\..\View\MainWindow.xaml"
                this.ScrollViewerLayer2.ScrollChanged += new System.Windows.Controls.ScrollChangedEventHandler(this.ScrollChanged);

            #line default
            #line hidden
                return;

            case 10:
                this.ChartLayer2 = ((System.Windows.Controls.DataVisualization.Charting.Chart)(target));

            #line 238 "..\..\..\View\MainWindow.xaml"
                this.ChartLayer2.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.MouseLeftButtonDown);

            #line default
            #line hidden

            #line 239 "..\..\..\View\MainWindow.xaml"
                this.ChartLayer2.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.MouseWheel);

            #line default
            #line hidden
                return;

            case 11:
                this.GridLay3 = ((System.Windows.Controls.Grid)(target));
                return;

            case 12:
                this.ScrollViewerLayer3 = ((System.Windows.Controls.ScrollViewer)(target));

            #line 308 "..\..\..\View\MainWindow.xaml"
                this.ScrollViewerLayer3.ScrollChanged += new System.Windows.Controls.ScrollChangedEventHandler(this.ScrollChanged);

            #line default
            #line hidden
                return;

            case 13:
                this.ChartLayer3 = ((System.Windows.Controls.DataVisualization.Charting.Chart)(target));

            #line 310 "..\..\..\View\MainWindow.xaml"
                this.ChartLayer3.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.MouseLeftButtonDown);

            #line default
            #line hidden

            #line 310 "..\..\..\View\MainWindow.xaml"
                this.ChartLayer3.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.MouseWheel);

            #line default
            #line hidden
                return;

            case 14:
                this.GridPlotn = ((System.Windows.Controls.Grid)(target));
                return;

            case 15:
                this.DensityScrollViewer = ((System.Windows.Controls.ScrollViewer)(target));

            #line 387 "..\..\..\View\MainWindow.xaml"
                this.DensityScrollViewer.ScrollChanged += new System.Windows.Controls.ScrollChangedEventHandler(this.ScrollChanged);

            #line default
            #line hidden
                return;

            case 16:
                this.Plotnost = ((System.Windows.Controls.DataVisualization.Charting.Chart)(target));

            #line 388 "..\..\..\View\MainWindow.xaml"
                this.Plotnost.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.MouseLeftButtonDown);

            #line default
            #line hidden

            #line 389 "..\..\..\View\MainWindow.xaml"
                this.Plotnost.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.MouseWheel);

            #line default
            #line hidden
                return;

            case 17:
                this.GridAll = ((System.Windows.Controls.Grid)(target));
                return;

            case 18:
                this.HeightScrollViewerAll = ((System.Windows.Controls.ScrollViewer)(target));

            #line 437 "..\..\..\View\MainWindow.xaml"
                this.HeightScrollViewerAll.ScrollChanged += new System.Windows.Controls.ScrollChangedEventHandler(this.ScrollChanged);

            #line default
            #line hidden
                return;

            case 19:
                this.ChartAll = ((System.Windows.Controls.DataVisualization.Charting.Chart)(target));

            #line 438 "..\..\..\View\MainWindow.xaml"
                this.ChartAll.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.MouseLeftButtonDown);

            #line default
            #line hidden

            #line 439 "..\..\..\View\MainWindow.xaml"
                this.ChartAll.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.MouseWheel);

            #line default
            #line hidden
                return;

            case 20:
                this.GridGen = ((System.Windows.Controls.Grid)(target));
                return;

            case 21:
                this.ScrollViewerGeneral = ((System.Windows.Controls.ScrollViewer)(target));

            #line 539 "..\..\..\View\MainWindow.xaml"
                this.ScrollViewerGeneral.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.MouseWheel);

            #line default
            #line hidden

            #line 539 "..\..\..\View\MainWindow.xaml"
                this.ScrollViewerGeneral.ScrollChanged += new System.Windows.Controls.ScrollChangedEventHandler(this.ScrollChanged);

            #line default
            #line hidden
                return;

            case 22:
                this.GeneralGraff = ((CondorVisualizator.View.Graff)(target));
                return;

            case 23:
                this.TimeBlock = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 24:
                this.Combobox = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 25:

            #line 574 "..\..\..\View\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button);

            #line default
            #line hidden

            #line 574 "..\..\..\View\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Button);

            #line default
            #line hidden

            #line 574 "..\..\..\View\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.Button);

            #line default
            #line hidden
                return;

            case 26:
                this.DataGrid = ((System.Windows.Controls.DataGrid)(target));

            #line 581 "..\..\..\View\MainWindow.xaml"
                this.DataGrid.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.DataGrid_MouseDoubleClick);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Пример #2
0
        public MainWindow()
        {
            InitializeComponent();


            _tempsize = DensityScrollViewer.ContentHorizontalOffset;

            Closing += (s, e) => ViewModelLocator.Cleanup();

            Messenger.Default.Register <DataRoad>(this, "ShowInfo", message =>
            {
                Info = message;
            });
            Messenger.Default.Register <float>(this, "ShowInfoDistance", message =>
            {
                Distance = message;
            });
            Messenger.Default.Register <ObservableCollection <Graphics> >(this, "ShowGeneralGraff", message =>
                                                                          GeneralGraff.DrawGraphic(message, collor = true));
            var timer = new System.Windows.Threading.DispatcherTimer
            {
                Interval  = new TimeSpan(0, 0, 1),
                IsEnabled = true
            };

            timer.Tick +=
                (o, t) =>
            {
                TimeBlock.Text = "        " + DateTime.Now.ToLongTimeString() + "\n" +
                                 DateTime.Now.ToLongDateString();
            };
            timer.Start();

            Messenger.Default.Register <List <List <object> > >(this, "GreatGraphic", message =>
            {
                LineSeries LS;
                AreaSeries AS;
                ColumnSeries CL;
                List <byte> CountGener;
                List <float> Distance;
                List <float> Layer123;
                List <double> Plotnost;
                List <Graphics> dataValues;
                LinearAxis linerAxx;
                LinearAxis linerAxy;
                Setter setter;
                Style style;
                Style legendStyle;
                Setter legendSetterw;
                Setter legendSetterl;
                AreaDataPoint areaDataPoint;
                int max;
                Control control;
                LineDataPoint lineDataPoint;
                Setter setterpoint;
                switch (_greatGraphicName)
                {
                case "CountChart":
                    CountGener = new List <byte>();
                    Distance   = new List <float>();
                    foreach (var count in message[0])
                    {
                        CountGener.Add(Convert.ToByte(count));
                    }
                    foreach (var distance in message[1])
                    {
                        Distance.Add(Convert.ToSingle(distance));
                    }

                    dataValues = new List <Graphics>();

                    for (var i = 0; i < CountGener.Count - 1; i++)
                    {
                        var graph        = new Graphics();
                        graph.CountLayer = CountGener[i];
                        graph.Distance   = Distance[i];
                        dataValues.Add(graph);
                    }
                    setter = new Setter();

                    setter.Property     = BackgroundProperty;
                    setter.Value        = Brushes.Black;
                    style               = new Style();
                    var columnDataPoint = new ColumnDataPoint();
                    style.TargetType    = columnDataPoint.GetType();
                    style.Setters.Add(setter);

                    CL = new ColumnSeries
                    {
                        ItemsSource          = dataValues,
                        DependentValuePath   = "CountLayer",
                        IndependentValuePath = "Distance"
                    };
                    CL.DataPointStyle = style;



                    linerAxx               = new LinearAxis();
                    linerAxy               = new LinearAxis();
                    linerAxx.Orientation   = AxisOrientation.X;
                    linerAxy.Orientation   = AxisOrientation.Y;
                    linerAxy.ShowGridLines = true;
                    linerAxy.Minimum       = 0;
                    linerAxy.Maximum       = 4;
                    linerAxx.Title         = "Расстояние, [м]";

                    chart = new Chart()
                    {
                        Background = new SolidColorBrush(Color.FromRgb(3, 94, 129)),
                        Title      = "Количество слоёв",
                    };
                    legendSetterw          = new Setter();
                    legendSetterl          = new Setter();
                    legendStyle            = new Style();
                    control                = new Control();
                    legendSetterw.Property = WidthProperty;
                    legendSetterw.Value    = (double)0;
                    legendSetterl.Property = HeightProperty;
                    legendSetterl.Value    = (double)0;
                    legendStyle.TargetType = control.GetType();
                    legendStyle.Setters.Add(legendSetterl);
                    legendStyle.Setters.Add(legendSetterw);
                    chart.LegendStyle = legendStyle;
                    chart.Axes.Add(linerAxx);
                    chart.Axes.Add(linerAxy);
                    chart.MouseLeftButtonDown += MouseLeftButtonDownGrid;
                    chart.Series.Add(CL);
                    LayoutRoot.Children.Add(chart);

                    break;

                case "ChartLayer3":
                    Layer123 = new List <float>();
                    Distance = new List <float>();

                    foreach (var count in message[0])
                    {
                        Layer123.Add(Convert.ToByte(count));
                    }
                    foreach (var distance in message[1])
                    {
                        Distance.Add(Convert.ToSingle(distance));
                    }

                    dataValues = new List <Graphics>();
                    max        = Convert.ToInt16(Layer123[0]);
                    for (var i = 0; i < Layer123.Count - 1; i++)
                    {
                        var graph      = new Graphics();
                        graph.Layer3   = Layer123[i];
                        graph.Distance = Distance[i];
                        dataValues.Add(graph);
                        if (Layer123[i] > max)
                        {
                            max = Convert.ToInt16(Layer123[i]);
                        }
                    }
                    linerAxx               = new LinearAxis();
                    linerAxx.Orientation   = AxisOrientation.X;
                    linerAxx.ShowGridLines = true;
                    linerAxx.Title         = "Расстояние, [м]";
                    linerAxy               = new LinearAxis();
                    linerAxy.Orientation   = AxisOrientation.Y;
                    linerAxy.ShowGridLines = true;
                    linerAxy.Title         = "Толщина, [см]";
                    linerAxy.Minimum       = 0;
                    linerAxy.Maximum       = max + 2;



                    chart = new Chart()
                    {
                        Background = new SolidColorBrush(Color.FromRgb(3, 94, 129)),
                        Title      = "Толщина слоя №1",
                    };

                    setter               = new Setter();
                    setterpoint          = new Setter();
                    setterpoint.Property = OpacityProperty;
                    setterpoint.Value    = (double)0;
                    setter.Property      = BackgroundProperty;
                    setter.Value         = Brushes.DodgerBlue;

                    style            = new Style();
                    areaDataPoint    = new AreaDataPoint();
                    style.TargetType = areaDataPoint.GetType();
                    style.Setters.Add(setterpoint);
                    style.Setters.Add(setter);

                    AS = new AreaSeries
                    {
                        ItemsSource          = dataValues,
                        DependentValuePath   = "Layer3",
                        IndependentValuePath = "Distance",
                    };
                    AS.DataPointStyle      = style;
                    legendSetterw          = new Setter();
                    legendSetterl          = new Setter();
                    legendStyle            = new Style();
                    control                = new Control();
                    legendSetterw.Property = WidthProperty;
                    legendSetterw.Value    = (double)0;
                    legendSetterl.Property = HeightProperty;
                    legendSetterl.Value    = (double)0;
                    legendStyle.TargetType = control.GetType();
                    legendStyle.Setters.Add(legendSetterl);
                    legendStyle.Setters.Add(legendSetterw);
                    chart.LegendStyle = legendStyle;


                    chart.Axes.Add(linerAxx);
                    chart.Axes.Add(linerAxy);
                    chart.MouseLeftButtonDown += MouseLeftButtonDownGrid;
                    chart.Series.Add(AS);
                    LayoutRoot.Children.Add(chart);

                    break;


                case "ChartLayer2":
                    Layer123 = new List <float>();
                    Distance = new List <float>();
                    foreach (var count in message[0])
                    {
                        Layer123.Add(Convert.ToByte(count));
                    }
                    foreach (var distance in message[1])
                    {
                        Distance.Add(Convert.ToSingle(distance));
                    }

                    dataValues = new List <Graphics>();
                    max        = Convert.ToInt16(Layer123[0]);
                    for (var i = 0; i < Layer123.Count - 1; i++)
                    {
                        var graph      = new Graphics();
                        graph.Layer2   = Layer123[i];
                        graph.Distance = Distance[i];
                        dataValues.Add(graph);
                        if (Layer123[i] > max)
                        {
                            max = Convert.ToInt16(Layer123[i]);
                        }
                    }
                    linerAxx               = new LinearAxis();
                    linerAxx.Orientation   = AxisOrientation.X;
                    linerAxx.ShowGridLines = true;
                    linerAxx.Title         = "Расстояние, [м]";
                    linerAxy               = new LinearAxis();
                    linerAxy.Orientation   = AxisOrientation.Y;
                    linerAxy.ShowGridLines = true;
                    linerAxy.Title         = "Толщина, [см]";
                    linerAxy.Minimum       = 0;
                    linerAxy.Maximum       = max + 2;



                    chart = new Chart()
                    {
                        Background = new SolidColorBrush(Color.FromRgb(3, 94, 129)),
                        Title      = "Толщина слоя №2",
                    };
                    setter               = new Setter();
                    setterpoint          = new Setter();
                    setterpoint.Property = OpacityProperty;
                    setterpoint.Value    = (double)0;
                    setter.Property      = BackgroundProperty;
                    setter.Value         = Brushes.DarkRed;
                    style            = new Style();
                    areaDataPoint    = new AreaDataPoint();
                    style.TargetType = areaDataPoint.GetType();
                    style.Setters.Add(setter);
                    style.Setters.Add(setterpoint);
                    AS = new AreaSeries
                    {
                        ItemsSource          = dataValues,
                        DependentValuePath   = "Layer2",
                        IndependentValuePath = "Distance"
                    };
                    AS.DataPointStyle      = style;
                    legendSetterw          = new Setter();
                    legendSetterl          = new Setter();
                    legendStyle            = new Style();
                    control                = new Control();
                    legendSetterw.Property = WidthProperty;
                    legendSetterw.Value    = (double)0;
                    legendSetterl.Property = HeightProperty;
                    legendSetterl.Value    = (double)0;
                    legendStyle.TargetType = control.GetType();
                    legendStyle.Setters.Add(legendSetterl);
                    legendStyle.Setters.Add(legendSetterw);
                    chart.LegendStyle = legendStyle;

                    chart.Axes.Add(linerAxx);
                    chart.Axes.Add(linerAxy);
                    chart.MouseLeftButtonDown += MouseLeftButtonDownGrid;

                    chart.Series.Add(AS);
                    LayoutRoot.Children.Add(chart);

                    break;

                case "ChartLayer1":
                    Layer123 = new List <float>();
                    Distance = new List <float>();
                    foreach (var count in message[0])
                    {
                        Layer123.Add(Convert.ToByte(count));
                    }
                    foreach (var distance in message[1])
                    {
                        Distance.Add(Convert.ToSingle(distance));
                    }

                    dataValues = new List <Graphics>();
                    max        = Convert.ToInt16(Layer123[0]);
                    for (var i = 0; i < Layer123.Count - 1; i++)
                    {
                        var graph      = new Graphics();
                        graph.Layer1   = Layer123[i];
                        graph.Distance = Distance[i];
                        dataValues.Add(graph);
                        if (Layer123[i] > max)
                        {
                            max = Convert.ToInt16(Layer123[i]);
                        }
                    }



                    linerAxx               = new LinearAxis();
                    linerAxx.Orientation   = AxisOrientation.X;
                    linerAxx.ShowGridLines = true;
                    linerAxx.Title         = "Расстояние, [м]";
                    linerAxy               = new LinearAxis();
                    linerAxy.Orientation   = AxisOrientation.Y;
                    linerAxy.ShowGridLines = true;
                    linerAxy.Title         = "Толщина, [см]";
                    linerAxy.Minimum       = 0;
                    linerAxy.Maximum       = max + 2;


                    setter               = new Setter();
                    setterpoint          = new Setter();
                    setterpoint.Property = OpacityProperty;
                    setterpoint.Value    = (double)0;
                    setter.Property      = BackgroundProperty;
                    setter.Value         = Brushes.OliveDrab;
                    style            = new Style();
                    areaDataPoint    = new AreaDataPoint();
                    style.TargetType = areaDataPoint.GetType();
                    style.Setters.Add(setter);
                    style.Setters.Add(setterpoint);
                    AS = new AreaSeries
                    {
                        ItemsSource          = dataValues,
                        DependentValuePath   = "Layer1",
                        IndependentValuePath = "Distance"
                    };
                    AS.DataPointStyle = style;


                    chart = new Chart()
                    {
                        Background = new SolidColorBrush(Color.FromRgb(3, 94, 129)),
                        Title      = "Толщина слоя №3",
                    };

                    legendSetterw          = new Setter();
                    legendSetterl          = new Setter();
                    legendStyle            = new Style();
                    control                = new Control();
                    legendSetterw.Property = WidthProperty;
                    legendSetterw.Value    = (double)0;
                    legendSetterl.Property = HeightProperty;
                    legendSetterl.Value    = (double)0;
                    legendStyle.TargetType = control.GetType();
                    legendStyle.Setters.Add(legendSetterl);
                    legendStyle.Setters.Add(legendSetterw);
                    chart.LegendStyle = legendStyle;

                    chart.Axes.Add(linerAxx);
                    chart.Axes.Add(linerAxy);
                    chart.MouseLeftButtonDown += MouseLeftButtonDownGrid;

                    chart.Series.Add(AS);
                    LayoutRoot.Children.Add(chart);

                    break;

                case "ChartAll":
                    var Layer1 = new List <float>();
                    var Layer2 = new List <float>();
                    var Layer3 = new List <float>();
                    Distance   = new List <float>();
                    foreach (var count in message[0])
                    {
                        Layer1.Add(Convert.ToByte(count));
                    }
                    foreach (var distance in message[1])
                    {
                        Distance.Add(Convert.ToSingle(distance));
                    }
                    foreach (var count in message[2])
                    {
                        Layer2.Add(Convert.ToByte(count));
                    }
                    foreach (var count in message[3])
                    {
                        Layer3.Add(Convert.ToByte(count));
                    }

                    dataValues = new List <Graphics>();
                    max        = Convert.ToInt16(Layer3[0]);

                    for (var i = 0; i < Layer1.Count - 1; i++)
                    {
                        var graph      = new Graphics();
                        graph.Layer3   = Layer3[i];
                        graph.Layer2   = Layer2[i];
                        graph.Layer1   = Layer1[i];
                        graph.Distance = Distance[i];
                        dataValues.Add(graph);

                        if (Layer3[i] > max)
                        {
                            max = Convert.ToInt16(Layer3[i]);
                        }
                    }

                    linerAxx               = new LinearAxis();
                    linerAxx.Orientation   = AxisOrientation.X;
                    linerAxx.ShowGridLines = true;
                    linerAxx.Title         = "Расстояние, [м]";
                    linerAxy               = new LinearAxis();
                    linerAxy.Orientation   = AxisOrientation.Y;
                    linerAxy.ShowGridLines = true;
                    linerAxy.Title         = "Толщина, [см]";
                    linerAxy.Minimum       = 0;
                    linerAxy.Maximum       = max + 2;

                    ////
                    var setter1           = new Setter();
                    var setterpoint1      = new Setter();
                    setterpoint1.Property = OpacityProperty;
                    setterpoint1.Value    = (double)0;
                    setter1.Property      = BackgroundProperty;
                    setter1.Value         = Brushes.OliveDrab;
                    var style1            = new Style();
                    var areaDataPoint1    = new AreaDataPoint();
                    style1.TargetType     = areaDataPoint1.GetType();
                    style1.Setters.Add(setter1);
                    style1.Setters.Add(setterpoint1);
                    var ser1 = new AreaSeries
                    {
                        ItemsSource          = dataValues,
                        DependentValuePath   = "Layer1",
                        IndependentValuePath = "Distance",
                        Title = "Слой №3"
                    };
                    ser1.DataPointStyle = style1;
                    ///
                    var setter2           = new Setter();
                    var setterpoint2      = new Setter();
                    setterpoint2.Property = OpacityProperty;
                    setterpoint2.Value    = (double)0;
                    setter2.Property      = BackgroundProperty;
                    setter2.Value         = Brushes.DarkRed;
                    var style2            = new Style();
                    var areaDataPoint2    = new AreaDataPoint();
                    style2.TargetType     = areaDataPoint2.GetType();
                    style2.Setters.Add(setter2);
                    style2.Setters.Add(setterpoint2);
                    var ser2 = new AreaSeries
                    {
                        ItemsSource          = dataValues,
                        DependentValuePath   = "Layer2",
                        IndependentValuePath = "Distance",
                        Title = "Слой №2"
                    };
                    ser2.DataPointStyle = style2;
                    ///
                    var setter3           = new Setter();
                    var setterpoint3      = new Setter();
                    setterpoint3.Property = OpacityProperty;
                    setterpoint3.Value    = (double)0;
                    setter3.Property      = BackgroundProperty;
                    setter3.Value         = Brushes.DodgerBlue;
                    var style3            = new Style();
                    var areaDataPoint3    = new AreaDataPoint();
                    style3.TargetType     = areaDataPoint3.GetType();
                    style3.Setters.Add(setter3);
                    style3.Setters.Add(setterpoint3);
                    var ser3 = new AreaSeries
                    {
                        ItemsSource          = dataValues,
                        DependentValuePath   = "Layer3",
                        IndependentValuePath = "Distance",
                        Title = "Слой №1"
                    };
                    ser3.DataPointStyle = style3;

                    chart = new Chart()
                    {
                        Background = new SolidColorBrush(Color.FromRgb(3, 94, 129)),
                        Title      = "Толщина слоёв",
                    };

                    var setterlegendcollor      = new Setter();
                    var setterlegendborder      = new Setter();
                    setterlegendcollor.Property = BackgroundProperty;
                    setterlegendcollor.Value    = new SolidColorBrush(Color.FromRgb(3, 94, 129));
                    setterlegendborder.Property = BorderBrushProperty;
                    setterlegendborder.Value    = new SolidColorBrush(Color.FromRgb(3, 94, 129));
                    legendStyle            = new Style();
                    control                = new Control();
                    legendStyle.TargetType = control.GetType();
                    legendStyle.Setters.Add(setterlegendcollor);
                    legendStyle.Setters.Add(setterlegendborder);
                    chart.LegendStyle = legendStyle;



                    chart.Axes.Add(linerAxx);
                    chart.Axes.Add(linerAxy);
                    chart.MouseLeftButtonDown += MouseLeftButtonDownGrid;

                    chart.Series.Add(ser3);
                    chart.Series.Add(ser2);
                    chart.Series.Add(ser1);


                    LayoutRoot.Children.Add(chart);

                    break;


                case "Plotnost":
                    Plotnost = new List <double>();
                    Distance = new List <float>();
                    foreach (var count in message[0])
                    {
                        Plotnost.Add(Convert.ToByte(count));
                    }
                    foreach (var distance in message[1])
                    {
                        Distance.Add(Convert.ToSingle(distance));
                    }

                    dataValues = new List <Graphics>();
                    max        = Convert.ToInt16(Plotnost[0]);
                    for (var i = 0; i < Plotnost.Count - 1; i++)
                    {
                        var graph         = new Graphics();
                        graph.IntensityN1 = Plotnost[i];
                        graph.Distance    = Distance[i];
                        dataValues.Add(graph);
                        if (Plotnost[i] > max)
                        {
                            max = Convert.ToInt16(Plotnost[i]);
                        }
                    }
                    linerAxx               = new LinearAxis();
                    linerAxx.Orientation   = AxisOrientation.X;
                    linerAxx.ShowGridLines = true;
                    linerAxx.Title         = "Расстояние, [м]";
                    linerAxy               = new LinearAxis();
                    linerAxy.Orientation   = AxisOrientation.Y;
                    linerAxy.ShowGridLines = true;
                    linerAxy.Title         = "[кг/м^3]";
                    linerAxy.Minimum       = 0;
                    linerAxy.Maximum       = max + 2;

                    setter               = new Setter();
                    setterpoint          = new Setter();
                    setterpoint.Property = OpacityProperty;
                    setterpoint.Value    = (double)0;
                    setter.Property      = BackgroundProperty;
                    setter.Value         = Brushes.OliveDrab;
                    style            = new Style();
                    lineDataPoint    = new LineDataPoint();
                    style.TargetType = lineDataPoint.GetType();
                    style.Setters.Add(setter);
                    style.Setters.Add(setterpoint);
                    LS = new LineSeries()
                    {
                        ItemsSource          = dataValues,
                        DependentValuePath   = "IntensityN1",
                        IndependentValuePath = "Distance"
                    };
                    LS.DataPointStyle = style;



                    chart = new Chart()
                    {
                        Background = new SolidColorBrush(Color.FromRgb(3, 94, 129)),
                        Title      = "Плотность",
                    };

                    legendSetterw          = new Setter();
                    legendSetterl          = new Setter();
                    legendStyle            = new Style();
                    control                = new Control();
                    legendSetterw.Property = WidthProperty;
                    legendSetterw.Value    = (double)0;
                    legendSetterl.Property = HeightProperty;
                    legendSetterl.Value    = (double)0;
                    legendStyle.TargetType = control.GetType();
                    legendStyle.Setters.Add(legendSetterl);
                    legendStyle.Setters.Add(legendSetterw);
                    chart.LegendStyle = legendStyle;


                    chart.Axes.Add(linerAxx);
                    chart.Axes.Add(linerAxy);
                    chart.MouseLeftButtonDown += MouseLeftButtonDownGrid;

                    chart.Series.Add(LS);
                    LayoutRoot.Children.Add(chart);

                    break;

                case "GeneralGraff":
                    CountGener = new List <byte>();
                    Distance   = new List <float>();
                    foreach (var count in message[0])
                    {
                        CountGener.Add(Convert.ToByte(count));
                    }
                    foreach (var distance in message[1])
                    {
                        Distance.Add(Convert.ToSingle(distance));
                    }

                    var dataValues1 = new ObservableCollection <Graphics>();

                    for (var i = 0; i < CountGener.Count - 1; i++)
                    {
                        var graph          = new Graphics();
                        graph.GeneralState = CountGener[i];
                        graph.Distance     = Distance[i];
                        dataValues1.Add(graph);
                    }

                    Gridnorm = new Grid();
                    Gridd    = new Graff();

                    Gridd.DrawGraphic(dataValues1, collor = false);
                    Gridd.Width                     = 1111;
                    Gridd.Height                    = 234;
                    var text1                       = new TextBlock();
                    var text2                       = new TextBlock();
                    var collor1                     = new TextBlock();
                    var collor2                     = new TextBlock();
                    var collortext1                 = new TextBlock();
                    var collortext2                 = new TextBlock();
                    collor1.Background              = Brushes.Red;
                    collor2.Background              = Brushes.Green;
                    collor1.Width                   = 50;
                    collor1.Height                  = 50;
                    collor2.Width                   = 50;
                    collor2.Height                  = 50;
                    collor1.HorizontalAlignment     = HorizontalAlignment.Left;
                    collor1.VerticalAlignment       = VerticalAlignment.Top;
                    collor2.HorizontalAlignment     = HorizontalAlignment.Left;
                    collor2.VerticalAlignment       = VerticalAlignment.Top;
                    collor1.Margin                  = new Thickness(370, 650, 0, 0);
                    collor2.Margin                  = new Thickness(690, 650, 0, 0);
                    collortext1.Text                = "- не соответствует";
                    collortext2.Text                = "- соответствует";
                    collortext1.FontSize            = 19;
                    collortext2.FontSize            = 19;
                    collortext1.HorizontalAlignment = HorizontalAlignment.Left;
                    collortext1.VerticalAlignment   = VerticalAlignment.Top;
                    collortext2.HorizontalAlignment = HorizontalAlignment.Left;
                    collortext2.VerticalAlignment   = VerticalAlignment.Top;
                    collortext1.Margin              = new Thickness(440, 657, 0, 0);
                    collortext2.Margin              = new Thickness(760, 657, 0, 0);
                    text1.Text                      = "Общее состояние дорожного покрытия";
                    text2.Text                      = "Расстояние, [м]";
                    text2.FontStyle                 = FontStyles.Italic;
                    text1.FontSize                  = 22;
                    text2.FontSize                  = 19;
                    text1.HorizontalAlignment       = HorizontalAlignment.Left;
                    text1.VerticalAlignment         = VerticalAlignment.Top;
                    text2.HorizontalAlignment       = HorizontalAlignment.Left;
                    text2.VerticalAlignment         = VerticalAlignment.Top;
                    text1.Margin                    = new Thickness(440, 350, 0, 0);
                    text2.Margin                    = new Thickness(570, 530, 0, 0);
                    Gridnorm.Children.Add(collortext1);
                    Gridnorm.Children.Add(collortext2);
                    Gridnorm.Children.Add(collor1);
                    Gridnorm.Children.Add(collor2);
                    Gridnorm.Children.Add(text1);
                    Gridnorm.Children.Add(text2);
                    Gridnorm.Children.Add(Gridd);
                    Gridnorm.Background = new SolidColorBrush(Color.FromRgb(3, 94, 129));
                    LayoutRoot.Children.Add(Gridnorm);

                    Gridnorm.MouseLeftButtonDown += MouseLeftButtonDownGrid1;
                    Gridd.MouseLeftButtonDown    += MouseLeftButtonDownGrid1;

                    break;
                }
            });
        }
Пример #3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.LayoutRoot = ((System.Windows.Controls.Grid)(target));
                return;

            case 2:
                this.GridRut = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.BorderRt = ((System.Windows.Controls.Border)(target));
                return;

            case 4:
                this.ChartRt = ((System.Windows.Controls.DataVisualization.Charting.Chart)(target));
                return;

            case 5:
                this.TextBlockdRt = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 6:
                this.TextBlockvRt = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 7:
                this.RutScrollViewer = ((System.Windows.Controls.ScrollViewer)(target));

            #line 103 "..\..\..\View\MainWindow.xaml"
                this.RutScrollViewer.ScrollChanged += new System.Windows.Controls.ScrollChangedEventHandler(this.ScrollChanged);

            #line default
            #line hidden
                return;

            case 8:
                this.Rut = ((System.Windows.Controls.DataVisualization.Charting.Chart)(target));

            #line 104 "..\..\..\View\MainWindow.xaml"
                this.Rut.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.MouseLeftButtonDown);

            #line default
            #line hidden

            #line 106 "..\..\..\View\MainWindow.xaml"
                this.Rut.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.MouseWheel);

            #line default
            #line hidden
                return;

            case 9:
                this.GridCount = ((System.Windows.Controls.Grid)(target));
                return;

            case 10:
                this.BorderC = ((System.Windows.Controls.Border)(target));
                return;

            case 11:
                this.TextBlockvC = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 12:
                this.TextBlockdC = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 13:
                this.ScrollViewerCount = ((System.Windows.Controls.ScrollViewer)(target));

            #line 140 "..\..\..\View\MainWindow.xaml"
                this.ScrollViewerCount.ScrollChanged += new System.Windows.Controls.ScrollChangedEventHandler(this.ScrollChanged);

            #line default
            #line hidden
                return;

            case 14:
                this.CountChart = ((System.Windows.Controls.DataVisualization.Charting.Chart)(target));

            #line 142 "..\..\..\View\MainWindow.xaml"
                this.CountChart.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.MouseLeftButtonDown);

            #line default
            #line hidden

            #line 143 "..\..\..\View\MainWindow.xaml"
                this.CountChart.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.MouseWheel);

            #line default
            #line hidden
                return;

            case 15:
                this.ChartC = ((System.Windows.Controls.DataVisualization.Charting.Chart)(target));
                return;

            case 16:
                this.GridAll = ((System.Windows.Controls.Grid)(target));
                return;

            case 17:
                this.BorderAll = ((System.Windows.Controls.Border)(target));
                return;

            case 18:
                this.TextBlock1 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 19:
                this.TextBlock2 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 20:
                this.TextBlock3 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 21:
                this.TextBlockdAll = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 22:
                this.TextBlockvAll = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 23:
                this.HeightScrollViewerAll = ((System.Windows.Controls.ScrollViewer)(target));

            #line 212 "..\..\..\View\MainWindow.xaml"
                this.HeightScrollViewerAll.ScrollChanged += new System.Windows.Controls.ScrollChangedEventHandler(this.ScrollChanged);

            #line default
            #line hidden
                return;

            case 24:
                this.ChartAll = ((System.Windows.Controls.DataVisualization.Charting.Chart)(target));

            #line 213 "..\..\..\View\MainWindow.xaml"
                this.ChartAll.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.MouseLeftButtonDown);

            #line default
            #line hidden

            #line 214 "..\..\..\View\MainWindow.xaml"
                this.ChartAll.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.MouseWheel);

            #line default
            #line hidden
                return;

            case 25:
                this.ChartAl = ((System.Windows.Controls.DataVisualization.Charting.Chart)(target));
                return;

            case 26:
                this.GridPlotn = ((System.Windows.Controls.Grid)(target));
                return;

            case 27:
                this.BorderPl = ((System.Windows.Controls.Border)(target));
                return;

            case 28:
                this.ChartPl = ((System.Windows.Controls.DataVisualization.Charting.Chart)(target));
                return;

            case 29:
                this.TextBlockdPl = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 30:
                this.TextBlockvPl = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 31:
                this.DensityScrollViewer = ((System.Windows.Controls.ScrollViewer)(target));

            #line 337 "..\..\..\View\MainWindow.xaml"
                this.DensityScrollViewer.ScrollChanged += new System.Windows.Controls.ScrollChangedEventHandler(this.ScrollChanged);

            #line default
            #line hidden
                return;

            case 32:
                this.Plotnost = ((System.Windows.Controls.DataVisualization.Charting.Chart)(target));

            #line 338 "..\..\..\View\MainWindow.xaml"
                this.Plotnost.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.MouseLeftButtonDown);

            #line default
            #line hidden

            #line 341 "..\..\..\View\MainWindow.xaml"
                this.Plotnost.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.MouseWheel);

            #line default
            #line hidden
                return;

            case 33:
                this.GridGen = ((System.Windows.Controls.Grid)(target));
                return;

            case 34:
                this.ScrollViewerGeneral = ((System.Windows.Controls.ScrollViewer)(target));

            #line 373 "..\..\..\View\MainWindow.xaml"
                this.ScrollViewerGeneral.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.MouseWheel);

            #line default
            #line hidden

            #line 373 "..\..\..\View\MainWindow.xaml"
                this.ScrollViewerGeneral.ScrollChanged += new System.Windows.Controls.ScrollChangedEventHandler(this.ScrollChanged);

            #line default
            #line hidden
                return;

            case 35:
                this.GeneralGraff = ((CondorVisualizator.View.Graff)(target));
                return;

            case 36:
                this.BorderG = ((System.Windows.Controls.Border)(target));
                return;

            case 37:
                this.TextBlockvG = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 38:
                this.TextBlockdG = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 39:
                this.TextBlock1G = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 40:
                this.TextBlock2G = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 41:
                this.TimeBlock = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 42:
                this.GridLay3 = ((System.Windows.Controls.Grid)(target));
                return;

            case 43:
                this.BorderL3 = ((System.Windows.Controls.Border)(target));
                return;

            case 44:
                this.TextBlockvL3 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 45:
                this.TextBlockdL3 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 46:
                this.ScrollViewerLayer3 = ((System.Windows.Controls.ScrollViewer)(target));

            #line 414 "..\..\..\View\MainWindow.xaml"
                this.ScrollViewerLayer3.ScrollChanged += new System.Windows.Controls.ScrollChangedEventHandler(this.ScrollChanged);

            #line default
            #line hidden
                return;

            case 47:
                this.ChartLayer3 = ((System.Windows.Controls.DataVisualization.Charting.Chart)(target));

            #line 416 "..\..\..\View\MainWindow.xaml"
                this.ChartLayer3.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.MouseLeftButtonDown);

            #line default
            #line hidden

            #line 416 "..\..\..\View\MainWindow.xaml"
                this.ChartLayer3.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.MouseWheel);

            #line default
            #line hidden
                return;

            case 48:
                this.ChartL3 = ((System.Windows.Controls.DataVisualization.Charting.Chart)(target));
                return;

            case 49:
                this.Combobox = ((System.Windows.Controls.ComboBox)(target));

            #line 485 "..\..\..\View\MainWindow.xaml"
                this.Combobox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.Combobox_OnSelectionChanged);

            #line default
            #line hidden
                return;

            case 50:
                this.Band = ((System.Windows.Controls.Button)(target));
                return;

            case 51:
                this.DataGrid = ((System.Windows.Controls.DataGrid)(target));
                return;

            case 52:
                this.Column = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 53:
                this.ReportButton = ((System.Windows.Controls.Button)(target));
                return;

            case 54:
                this.GridLay1 = ((System.Windows.Controls.Grid)(target));
                return;

            case 55:
                this.BorderL1 = ((System.Windows.Controls.Border)(target));
                return;

            case 56:
                this.ChartL1 = ((System.Windows.Controls.DataVisualization.Charting.Chart)(target));
                return;

            case 57:
                this.TextBlockvL1 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 58:
                this.TextBlockdL1 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 59:
                this.ScrollViewerLayer1 = ((System.Windows.Controls.ScrollViewer)(target));

            #line 569 "..\..\..\View\MainWindow.xaml"
                this.ScrollViewerLayer1.ScrollChanged += new System.Windows.Controls.ScrollChangedEventHandler(this.ScrollChanged);

            #line default
            #line hidden
                return;

            case 60:
                this.ChartLayer1 = ((System.Windows.Controls.DataVisualization.Charting.Chart)(target));

            #line 570 "..\..\..\View\MainWindow.xaml"
                this.ChartLayer1.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.MouseLeftButtonDown);

            #line default
            #line hidden

            #line 572 "..\..\..\View\MainWindow.xaml"
                this.ChartLayer1.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.MouseWheel);

            #line default
            #line hidden
                return;

            case 61:
                this.GridLay2 = ((System.Windows.Controls.Grid)(target));
                return;

            case 62:
                this.BorderL2 = ((System.Windows.Controls.Border)(target));
                return;

            case 63:
                this.TextBlockdL2 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 64:
                this.TextBlockvL2 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 65:
                this.ScrollViewerLayer2 = ((System.Windows.Controls.ScrollViewer)(target));

            #line 612 "..\..\..\View\MainWindow.xaml"
                this.ScrollViewerLayer2.ScrollChanged += new System.Windows.Controls.ScrollChangedEventHandler(this.ScrollChanged);

            #line default
            #line hidden
                return;

            case 66:
                this.ChartLayer2 = ((System.Windows.Controls.DataVisualization.Charting.Chart)(target));

            #line 613 "..\..\..\View\MainWindow.xaml"
                this.ChartLayer2.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.MouseLeftButtonDown);

            #line default
            #line hidden

            #line 615 "..\..\..\View\MainWindow.xaml"
                this.ChartLayer2.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.MouseWheel);

            #line default
            #line hidden
                return;

            case 67:
                this.ChartL2 = ((System.Windows.Controls.DataVisualization.Charting.Chart)(target));
                return;
            }
            this._contentLoaded = true;
        }