Exemplo n.º 1
0
        public void SetXRestriction(double xlow, double xhigh)
        {
            ViewportAxesRangeRestriction restr = new ViewportAxesRangeRestriction();

            restr.XRange = new DisplayRange(xlow, xhigh);
            chart.Viewport.Restrictions.Add(restr);
        }
Exemplo n.º 2
0
        public void SetYRestriction(double ylow, double yhigh)
        {
            ViewportAxesRangeRestriction restr = new ViewportAxesRangeRestriction();

            restr.YRange = new DisplayRange(ylow, yhigh);
            chart.Viewport.Restrictions.Add(restr);
        }
Exemplo n.º 3
0
        internal BvtPage()
        {
            Parameters = new Types.BVT.TestParameters {
                IsEnabled = true
            };
            ClampParameters = new Types.Clamping.TestParameters
            {
                StandardForce          = Types.Clamping.ClampingForceInternal.Custom,
                CustomForce            = 5,
                IsHeightMeasureEnabled = false
            };
            CommType    = Settings.Default.SinglePositionModuleMode ? Types.Commutation.ModuleCommutationType.Direct : Types.Commutation.ModuleCommutationType.MT3;
            Temperature = RoomTemp;
            InitializeComponent();

            m_XRed   = (SolidColorBrush)FindResource("xRed1");
            m_XGreen = (SolidColorBrush)FindResource("xGreen3");

            ClearStatus();

            ViewportAxesRangeRestriction restr = new ViewportAxesRangeRestriction {
                YRange = new DisplayRange(-7, 7)
            };

            chartPlotter.Viewport.Restrictions.Add(restr);
        }
Exemplo n.º 4
0
        private void PlotYX(string LineName, Color LineColor, ICollection <short> UxPoints, IEnumerable <short> UyPoints)
        {
            var crop = UxPoints.Count - DATA_LENGTH;

            var dataI = UxPoints.Skip(crop).Select(I => (Math.Abs(I) <= 2 ? (short)0 : I));
            var dataV = UyPoints.Skip(crop);

            if (dataI.Any() && (dataI.Min() < -7 * 10 || Math.Abs(dataI.Max()) > 7 * 10) || wasCurrentMore)
            {
                wasCurrentMore = true;
                chartPlotter.Viewport.Restrictions.Clear();
            }
            else
            {
                chartPlotter.Viewport.Restrictions.Clear();
                var restr = new ViewportAxesRangeRestriction {
                    YRange = new DisplayRange(-7, 7)
                };
                chartPlotter.Viewport.Restrictions.Add(restr);
            }

            var points =
                dataI.Zip(dataV, (I, V) => new PointF(V, I / 10.0f))
                .Select((P => (Math.Abs(P.X) < 200 ? new PointF(P.X, 0) : P)));

            var dataSource = new EnumerableDataSource <PointF>(points);

            dataSource.SetXMapping(P => P.X);
            dataSource.SetYMapping(P => P.Y);

            chartPlotter.AddLineGraph(dataSource, LineColor, 3, LineName);

            chartPlotter.FitToView();
        }
Exemplo n.º 5
0
        private void createChangeOfRGraphic_Fitting(MyPointCollection fittingChangeOfR)
        {
            try
            {
                deleteChangeOfRGraphic_Fitting();

                int maxPoints = 300000;
                pointsChangeOfRFitting = new MyPointCollection(maxPoints);
                pointsChangeOfRFitting.Clear();
                pointsChangeOfRFitting = fittingChangeOfR;

                var ds = new EnumerableDataSource <MyPoint>(pointsChangeOfRFitting);
                ds.SetXMapping(x => x.XAxisValue);
                ds.SetYMapping(y => y.YAxisValue);


                plotterChangeOfR.AddLineGraph(ds, Colors.Blue, 2, "Promena fitovanog R-a"); // to use this method you need "using Microsoft.Research.DynamicDataDisplay;"
                plotterChangeOfR.LegendVisible = false;


                if (OptionsInOnlineModeChangeOfRAndE.isManualCheckedChangeR == true)
                {
                    plotterChangeOfR.Viewport.AutoFitToView = true;
                    ViewportAxesRangeRestriction restr = new ViewportAxesRangeRestriction();
                    restr.YRange = new DisplayRange(-0.5, OptionsInOnlineModeChangeOfRAndE.yRangeChangeR);
                    restr.XRange = new DisplayRange(-0.5, OptionsInOnlineModeChangeOfRAndE.xRangeChangeR);

                    plotterChangeOfR.Viewport.Restrictions.Add(restr);
                }

                if (OptionsInOnlineModeChangeOfRAndE.isAutoCheckedChangeR == true)
                {
                    plotterChangeOfR.FitToView();
                    plotterChangeOfR.Viewport.Restrictions.Clear();
                }
            }
            catch (Exception ex)
            {
                Logger.WriteNode(ex.Message.ToString() + "[VelocityOfChangeParametersXY.xaml.cs] {private void createChangeOfRGraphic_Fitting(MyPointCollection fittingChangeOfR)}", System.DateTime.Now);
            }
        }
Exemplo n.º 6
0
        public void createChangeOfEGraphicFitting()
        {
            try
            {
                deleteChangeOfEGraphic();

                int maxPoints = 300000;
                pointsChangeOfE = new MyPointCollection(maxPoints);
                pointsChangeOfE.Clear();

                var ds = new EnumerableDataSource <MyPoint>(pointsChangeOfEFitting);
                ds.SetXMapping(x => x.XAxisValue);
                ds.SetYMapping(y => y.YAxisValue);


                plotterChangeOfE.AddLineGraph(ds, Colors.Blue, 2, "Promena e-a"); // to use this method you need "using Microsoft.Research.DynamicDataDisplay;"
                plotterChangeOfE.LegendVisible = false;

                //if (OptionsInOnlineModeChangeOfRAndE.isManualCheckedChangeElongation == true)
                //{
                plotterChangeOfE.Viewport.AutoFitToView = true;
                ViewportAxesRangeRestriction restr = new ViewportAxesRangeRestriction();
                restr.YRange = new DisplayRange(0.0, /*OptionsInOnlineModeChangeOfRAndE.yRangeChangeElongation*/ pointsChangeOfEFitting.Last().YAxisValue + 0.1 * pointsChangeOfEFitting.Last().YAxisValue);
                restr.XRange = new DisplayRange(0.0, /*OptionsInOnlineModeChangeOfRAndE.xRangeChangeElongation*/ pointsChangeOfEFitting.Last().XAxisValue + 0.1 * pointsChangeOfEFitting.Last().XAxisValue);

                plotterChangeOfE.Viewport.Restrictions.Add(restr);
                //}

                //if (OptionsInOnlineModeChangeOfRAndE.isAutoCheckedChangeElongation == true)
                //{
                //plotterChangeOfE.FitToView();
                //plotterChangeOfE.Viewport.Restrictions.Clear();
                //}
            }
            catch (Exception ex)
            {
                Logger.WriteNode(ex.Message.ToString() + "[VelocityOfChangeParametersXY.xaml.cs] {public void createChangeOfEGraphicFitting()}", System.DateTime.Now);
            }
        }
        private void InitializePlotter()
        {
            try
            {
                EnumerableDataSource<IncubatorData> receivedGraph = new EnumerableDataSource<IncubatorData>(_incubatorManager.IncubatorData);
                receivedGraph.SetXMapping(x => temperatureTimeAxis.ConvertToDouble(x.Time));
                receivedGraph.SetYMapping(y => y.Temperature);
                plotterTemperature.AddLineGraph(receivedGraph, (Color)ColorConverter.ConvertFromString("#FF40B0E0"), 2, "Température");

                ViewportAxesRangeRestriction resT = new ViewportAxesRangeRestriction();
                resT.YRange = new DisplayRange(19.5, 40.5);
                plotterTemperature.Viewport.Restrictions.Add(resT);
                plotterTemperature.HorizontalAxis.Remove();

                plotterTemperature.Children.RemoveAll(typeof(Legend));

                ///////////////////////////

                receivedGraph = new EnumerableDataSource<IncubatorData>(_incubatorManager.IncubatorData);
                receivedGraph.SetXMapping(x => relativeHumidityTimeAxis.ConvertToDouble(x.Time));
                receivedGraph.SetYMapping(y => y.RelativeHumidity);
                plotterRelativeHumidity.AddLineGraph(receivedGraph, (Color)ColorConverter.ConvertFromString("#FF40B0E0"), 2, "Humitidé Relative");

                ViewportAxesRangeRestriction restrRH = new ViewportAxesRangeRestriction();
                restrRH.YRange = new DisplayRange(-5, 105);
                plotterRelativeHumidity.Viewport.Restrictions.Add(restrRH);
                plotterRelativeHumidity.HorizontalAxis.Remove();

                plotterRelativeHumidity.Children.RemoveAll(typeof(Legend));

                ///////////////////////////

                receivedGraph = new EnumerableDataSource<IncubatorData>(_incubatorManager.IncubatorData);
                receivedGraph.SetXMapping(x => CO2TimeAxis.ConvertToDouble(x.Time));
                receivedGraph.SetYMapping(y => y.CO2);
                plotterCO2.AddLineGraph(receivedGraph, (Color)ColorConverter.ConvertFromString("#FF40B0E0"), 2, "CO2");

                ViewportAxesRangeRestriction restrCO2 = new ViewportAxesRangeRestriction();
                restrCO2.YRange = new DisplayRange(300, 2200);
                plotterCO2.Viewport.Restrictions.Add(restrCO2);
                plotterCO2.HorizontalAxis.Remove();

                plotterCO2.Children.RemoveAll(typeof(Legend));
            }
            catch (Exception ex)
            {
              Console.Write(ex.ToString());
            }
        }
 public void SetYRestriction(double ylow, double yhigh)
 {
     ViewportAxesRangeRestriction restr = new ViewportAxesRangeRestriction();
     restr.YRange = new DisplayRange(ylow, yhigh);
     chart.Viewport.Restrictions.Add(restr);
 }
 public void SetXRestriction(double xlow, double xhigh)
 {
     ViewportAxesRangeRestriction restr = new ViewportAxesRangeRestriction();
     restr.XRange = new DisplayRange(xlow, xhigh);
     chart.Viewport.Restrictions.Add(restr);
 }