Exemplo n.º 1
0
        private void AddSpectrumLines()
        {
            /*
             * var pv0 = new CustomDraggablePoint(new Point(0, 1));
             * var pv1 = new CustomDraggablePoint(new Point(0.1, 2.5));
             * var pv2 = new CustomDraggablePoint(new Point(0.5, 2.5));
             *
             * Canvas.SetZIndex(pv0, 10000 + 1);
             * Canvas.SetZIndex(pv1, 10000 + 2);
             * Canvas.SetZIndex(pv2, 10000 + 3);
             *
             * pv0.PositionChanged += OnDraggablePointPositionChanged;
             * pv1.PositionChanged += OnDraggablePointPositionChanged;
             * pv2.PositionChanged += OnDraggablePointPositionChanged;
             *
             * VelocityCharts.Children.Add(pv0);
             * VelocityCharts.Children.Add(pv1);
             * VelocityCharts.Children.Add(pv2);
             *
             *
             *
             *
             * var pd0 = new CustomDraggablePoint(new Point(0, 1));
             * var pd1 = new CustomDraggablePoint(new Point(.1, 2.5));
             * var pd2 = new CustomDraggablePoint(new Point(.5, 2.5));
             *
             * Canvas.SetZIndex(pd0, 10000 + 1);
             * Canvas.SetZIndex(pd1, 10000 + 2);
             * Canvas.SetZIndex(pd2, 10000 + 3);
             *
             * pd0.PositionChanged += OnDraggablePointPositionChanged;
             * pd1.PositionChanged += OnDraggablePointPositionChanged;
             * pd2.PositionChanged += OnDraggablePointPositionChanged;
             *
             *
             * DisplacementCharts.Children.Add(pd0);
             * DisplacementCharts.Children.Add(pd1);
             * DisplacementCharts.Children.Add(pd2);
             *
             *
             */

            var pa0 = new CustomDraggablePoint(new Point(0, 1));
            var pa1 = new CustomDraggablePoint(new Point(.1, 2.5));
            var pa2 = new CustomDraggablePoint(new Point(.5, 2.5));

            Canvas.SetZIndex(pa0, 1000 - 1);
            Canvas.SetZIndex(pa1, 1000 - 2);
            Canvas.SetZIndex(pa2, 1000 - 3);

            pa0.PositionChanged += OnDraggablePointPositionChanged;
            pa1.PositionChanged += OnDraggablePointPositionChanged;
            pa2.PositionChanged += OnDraggablePointPositionChanged;

            AccelerationCharts.Children.Add(pa0);
            AccelerationCharts.Children.Add(pa1);
            AccelerationCharts.Children.Add(pa2);
        }
Exemplo n.º 2
0
 private void CreateDraggablePoints(List <IPlotterElement> collection)
 {
     for (int i = 0; i < Polyline.Points.Count; i++)
     {
         DraggablePoint point = new DraggablePoint();
         point.SetBinding(DraggablePoint.PositionProperty, new Binding
         {
             Source = Polyline,
             Path   = new PropertyPath("Points[" + i + "]"),
             Mode   = BindingMode.TwoWay
         });
         collection.Add(point);
     }
 }
Exemplo n.º 3
0
		private void GetDraggablePoints(List<IPlotterElement> collection)
		{
			for (int i = 0; i < polyline.Points.Count; i++)
			{
				DraggablePoint point = new DraggablePoint();
				point.SetBinding(DraggablePoint.PositionProperty, new Binding
				{
					Source = polyline,
					Path = new PropertyPath("Points[" + i + "]"),
					Mode = BindingMode.TwoWay
				});
				collection.Add(point);
			}
		}
Exemplo n.º 4
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 5 "..\..\..\MainWindow.xaml"
                ((sportsCare.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.groupBox2 = ((System.Windows.Controls.GroupBox)(target));
                return;

            case 3:
                this.dockPanel1 = ((System.Windows.Controls.DockPanel)(target));
                return;

            case 4:
                this.menu1 = ((System.Windows.Controls.Menu)(target));
                return;

            case 5:
                this.@new = ((System.Windows.Controls.MenuItem)(target));

            #line 16 "..\..\..\MainWindow.xaml"
                [email protected] += new System.Windows.RoutedEventHandler(this.new_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.open_excel = ((System.Windows.Controls.MenuItem)(target));

            #line 17 "..\..\..\MainWindow.xaml"
                this.open_excel.Click += new System.Windows.RoutedEventHandler(this.open_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.save_as_excel = ((System.Windows.Controls.MenuItem)(target));

            #line 18 "..\..\..\MainWindow.xaml"
                this.save_as_excel.Click += new System.Windows.RoutedEventHandler(this.save_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.showTable = ((System.Windows.Controls.MenuItem)(target));

            #line 20 "..\..\..\MainWindow.xaml"
                this.showTable.Click += new System.Windows.RoutedEventHandler(this.showTable_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.exit = ((System.Windows.Controls.MenuItem)(target));

            #line 22 "..\..\..\MainWindow.xaml"
                this.exit.Click += new System.Windows.RoutedEventHandler(this.exit_Click);

            #line default
            #line hidden
                return;

            case 10:
                this.beginWork = ((System.Windows.Controls.MenuItem)(target));

            #line 25 "..\..\..\MainWindow.xaml"
                this.beginWork.Click += new System.Windows.RoutedEventHandler(this.beginWork_Click);

            #line default
            #line hidden
                return;

            case 11:
                this.stop_work = ((System.Windows.Controls.MenuItem)(target));

            #line 26 "..\..\..\MainWindow.xaml"
                this.stop_work.Click += new System.Windows.RoutedEventHandler(this.stopWork_Click);

            #line default
            #line hidden
                return;

            case 12:
                this.showInstruConn = ((System.Windows.Controls.MenuItem)(target));

            #line 27 "..\..\..\MainWindow.xaml"
                this.showInstruConn.Click += new System.Windows.RoutedEventHandler(this.showInstruConn_Click);

            #line default
            #line hidden
                return;

            case 13:
                this.asciiCode = ((System.Windows.Controls.MenuItem)(target));

            #line 29 "..\..\..\MainWindow.xaml"
                this.asciiCode.Click += new System.Windows.RoutedEventHandler(this.asciiCode_Click_1);

            #line default
            #line hidden
                return;

            case 14:
                this.notAscii = ((System.Windows.Controls.MenuItem)(target));

            #line 30 "..\..\..\MainWindow.xaml"
                this.notAscii.Click += new System.Windows.RoutedEventHandler(this.notAscii_Click_1);

            #line default
            #line hidden
                return;

            case 15:
                this.dataAnalyse = ((System.Windows.Controls.MenuItem)(target));

            #line 33 "..\..\..\MainWindow.xaml"
                this.dataAnalyse.Click += new System.Windows.RoutedEventHandler(this.dataAnalyse_Click);

            #line default
            #line hidden
                return;

            case 16:
                this.toolBar1 = ((System.Windows.Controls.ToolBar)(target));
                return;

            case 17:

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

            #line default
            #line hidden
                return;

            case 18:

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

            #line default
            #line hidden
                return;

            case 19:

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

            #line default
            #line hidden
                return;

            case 20:

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

            #line default
            #line hidden
                return;

            case 21:

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

            #line default
            #line hidden
                return;

            case 22:

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

            #line default
            #line hidden
                return;

            case 23:

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

            #line default
            #line hidden
                return;

            case 24:

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

            #line default
            #line hidden
                return;

            case 25:

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

            #line default
            #line hidden
                return;

            case 26:
                this.plotter = ((Microsoft.Research.DynamicDataDisplay.ChartPlotter)(target));
                return;

            case 27:
                this.timeAxis = ((Microsoft.Research.DynamicDataDisplay.Charts.Axes.HorizontalIntegerAxis)(target));
                return;

            case 28:
                this.dataAxis = ((Microsoft.Research.DynamicDataDisplay.Charts.Axes.VerticalIntegerAxis)(target));
                return;

            case 29:
                this.dp = ((Microsoft.Research.DynamicDataDisplay.Charts.Shapes.DraggablePoint)(target));

            #line 76 "..\..\..\MainWindow.xaml"
                this.dp.MouseMove += new System.Windows.Input.MouseEventHandler(this.dp_MouseMove);

            #line default
            #line hidden

            #line 76 "..\..\..\MainWindow.xaml"
                this.dp.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.dp_MouseUp);

            #line default
            #line hidden
                return;

            case 30:
                this.vl = ((Microsoft.Research.DynamicDataDisplay.Charts.VerticalLine)(target));
                return;

            case 31:
                this.groupBox1 = ((System.Windows.Controls.GroupBox)(target));
                return;

            case 32:
                this.label1 = ((System.Windows.Controls.Label)(target));
                return;

            case 33:
                this.rSO2Txt = ((System.Windows.Controls.TextBox)(target));
                return;

            case 34:
                this.label3 = ((System.Windows.Controls.Label)(target));
                return;

            case 35:
                this.pulseTxt = ((System.Windows.Controls.TextBox)(target));
                return;

            case 36:
                this.label2 = ((System.Windows.Controls.Label)(target));
                return;

            case 37:
                this.collectDataTime = ((System.Windows.Controls.Label)(target));
                return;

            case 38:
                this.label5 = ((System.Windows.Controls.Label)(target));
                return;

            case 39:
                this.label6 = ((System.Windows.Controls.Label)(target));
                return;

            case 40:
                this.pulseAnalyse = ((System.Windows.Controls.TextBox)(target));
                return;

            case 41:
                this.rSO2Analyse = ((System.Windows.Controls.TextBox)(target));
                return;

            case 42:
                this.groupBox2_Copy = ((System.Windows.Controls.GroupBox)(target));
                return;

            case 43:
                this.label5_Copy = ((System.Windows.Controls.Label)(target));
                return;

            case 44:
                this.label6_Copy = ((System.Windows.Controls.Label)(target));
                return;

            case 45:
                this.UserAge = ((System.Windows.Controls.TextBox)(target));
                return;

            case 46:
                this.UserStablePul = ((System.Windows.Controls.TextBox)(target));
                return;

            case 47:
                this.ageChanged = ((System.Windows.Controls.Button)(target));

            #line 116 "..\..\..\MainWindow.xaml"
                this.ageChanged.Click += new System.Windows.RoutedEventHandler(this.ageChanged_Click_1);

            #line default
            #line hidden
                return;

            case 48:
                this.stablePulChanged = ((System.Windows.Controls.Button)(target));

            #line 117 "..\..\..\MainWindow.xaml"
                this.stablePulChanged.Click += new System.Windows.RoutedEventHandler(this.stablePulChanged_Click_1);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //plotter.DataTransform = new Log10Transform();
            
            // Create first source
            sourcecurrent = new ObservableDataSource<Tuple<double, double>>();
            sourcecurrent.SetXYMapping(z =>
            {
                Point p = new Point(z.Item1, z.Item2);
                return p;
            });

            //plotter.DataTransform = new Log10Transform();
            //HorizontalAxis xAxis = new HorizontalAxis
            //{
            //    TicksProvider = new NumericTicksProvider(),
            //    LabelProvider = new ExponentialLabelProvider()
            //};
            //plotter.MainHorizontalAxis = xAxis;
            //VerticalAxis yAxis = new VerticalAxis
            //{
            //    //TicksProvider = new LogarithmNumericTicksProvider(10),
            //    TicksProvider = new NumericTicksProvider(),
            //    LabelProvider = new ExponentialLabelProvider()
            //};
            //plotter.MainVerticalAxis = yAxis;

            HorizontalAxis axis = (HorizontalAxis)plotter.MainHorizontalAxis;
            //axis.LabelProvider.SetCustomFormatter(info => info.Tick.ToString("#.######E+0"));
            axis.LabelProvider.SetCustomFormatter(info => StringUtils.CodeString(info.Tick));

            VerticalAxis axisv = (VerticalAxis)plotter.MainVerticalAxis;
            //String.Format(new TelephoneFormatter(), "{0}", 0)
            axisv.LabelProvider.SetCustomFormatter(info => info.Tick.ToString("#.######E+0"));

            sourcevoltage = new ObservableDataSource<Tuple<double, double>>();
            sourcevoltage.SetXYMapping(z =>
            {
                Point p = new Point(z.Item1, z.Item2);
                return p;
            });

            //otherPlotter.DataTransform = new Log10Transform();
            //xAxis = new HorizontalAxis
            //{
            //    TicksProvider = new LogarithmNumericTicksProvider(10),
            //    LabelProvider = new UnroundingLabelProvider()
            //};
            //otherPlotter.MainHorizontalAxis = xAxis;
            //yAxis = new VerticalAxis
            //{
            //    TicksProvider = new LogarithmNumericTicksProvider(10),
            //    LabelProvider = new UnroundingLabelProvider()
            //};
            //otherPlotter.MainVerticalAxis = yAxis;



            //List<Point> list = new List<Point>();

            Random rnd = new Random();
            for (int i = 10; i < 300; i++)
            {
                sourcecurrent.Collection.Add(new Tuple<double, double>(i, 20000 + rnd.Next(10000)));
                sourcevoltage.Collection.Add(new Tuple<double, double>(i, 30 + rnd.Next(20)));
                //list.Add(new Point(i, rnd.Next(50)));
            }
            //plotter1.VerticalAxis.LabelProvider = new ExponentialLabelProvider();
            //LineGraph line = new LineGraph(source1);
            //line.AddToPlotter(plotter);
            // plotter.Children.Add(line);

            //otherPlotter.MainVerticalAxis.

            linegraph.DataSource = sourcevoltage ;
            linephase.DataSource = sourcecurrent;
            //axis = new VerticalAxisTitle();
            //linegraph = new Microsoft.Research.DynamicDataDisplay.LineGraph(
            // Creating the new DraggablePoint
            if (false)
            {
                int x1 = 10, y1 = 10;
                Point q = new Point(x1, y1);
                var globalPoint = new DraggablePoint(q);

                globalPoint.PositionChanged += (s, r) =>
                {
                    globalPoint.Position = q;
                };
                plotter.Children.Add(globalPoint);

            }
            
            // Set the point on the map

           
        }
Exemplo n.º 6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PivotSegmentEditor"/> class.
        /// </summary>
        public PivotSegmentEditor()
        {
            ResourceDictionary resources = new ResourceDictionary
            {
                Source = new Uri("/DynamicDataDisplay;component/Charts/Shapes/PivotSegmentEditor.xaml", UriKind.Relative)
            };

            panel.BeginBatchAdd();

            ControlTemplate segmentTemplate = (ControlTemplate)resources["segment"];

            segment             = (Segment)segmentTemplate.LoadContent();
            segment.DataContext = this;

            ControlTemplate startThumbTemplate = (ControlTemplate)resources["leftThumb"];

            startThumb             = (DraggablePoint)startThumbTemplate.LoadContent();
            startThumb.DataContext = this;

            ControlTemplate endThumbTemplate = (ControlTemplate)resources["rightThumb"];

            endThumb             = (DraggablePoint)endThumbTemplate.LoadContent();
            endThumb.DataContext = this;

            ControlTemplate leftRayTemplate = (ControlTemplate)resources["leftRay"];

            leftRay             = (ViewportRay)leftRayTemplate.LoadContent();
            leftRay.DataContext = this;

            ControlTemplate rightRayTemplate = (ControlTemplate)resources["rightRay"];

            rightRay             = (ViewportRay)rightRayTemplate.LoadContent();
            rightRay.DataContext = this;

            ControlTemplate mTextTemplate = (ControlTemplate)resources["mText"];
            TextBlock       mText         = (TextBlock)mTextTemplate.LoadContent();

            panel.Children.Add(mText);
            mText.DataContext = this;

            ControlTemplate leftPointGridTemplate = (ControlTemplate)resources["leftPointGrid"];
            Panel           leftPointGrid         = (Panel)leftPointGridTemplate.LoadContent();

            panel.Children.Add(leftPointGrid);
            leftPointGrid.DataContext = this;

            ControlTemplate rightPointGridTemplate = (ControlTemplate)resources["rightPointGrid"];
            Panel           rightPointGrid         = (Panel)rightPointGridTemplate.LoadContent();

            panel.Children.Add(rightPointGrid);
            rightPointGrid.DataContext = this;

            ControlTemplate  leftTextTemplate = (ControlTemplate)resources["leftText"];
            FrameworkElement leftBorder       = (FrameworkElement)leftTextTemplate.LoadContent();

            panel.Children.Add(leftBorder);
            leftBorder.DataContext = this;

            ControlTemplate  rightTextTemplate = (ControlTemplate)resources["rightText"];
            FrameworkElement rightBorder       = (FrameworkElement)rightTextTemplate.LoadContent();

            panel.Children.Add(rightBorder);
            rightBorder.DataContext = this;
        }