Beispiel #1
0
 public void AddPoint(double trainingVal, double validationVal, TimeSpan elapsed)
 {
     TrainingError.Points.Add(new DataPoint(elapsed.TotalSeconds, trainingVal));
     ValidationError.Points.Add(new DataPoint(elapsed.TotalSeconds, validationVal));
     xAxis.Maximum = elapsed.TotalSeconds + Offset;
     yAxis.Minimum = Math.Min(TrainingError.Points.Min(x => x.Y) / 1.1, ValidationError.Points.Min(x => x.Y) / 1.1);
     yAxis.Maximum = Math.Max(TrainingError.Points.Max(x => x.Y) * 1.1, ValidationError.Points.Max(x => x.Y) * 1.1);
     Plot.Model.ResetAllAxes();
     Plot.Invalidate();
 }
Beispiel #2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            txtSerialStatus.Text = serialStatus;


            if (!lerSerial())
            {
                return;
            }

            setPoint = trbTemperaturaControle.Value;

            e_anterior = e_atual;
            e_atual    = setPoint - temperatura;

            u_anterior = u_atual;
            u_atual    = (u_anterior + Kp * e_atual - Kp * (1 - T / Ti) * e_anterior);

            this.y.Points.Add(new DataPoint(a, temperatura));
            this.r.Points.Add(new DataPoint(a, setPoint));
            this.e.Points.Add(new DataPoint(a, e_atual));
            this.uPP.Points.Add(new DataPoint(a, u_atual));

            temperaturaPlot.Invalidate();
            controlePlot.Invalidate();
            erroPlot.Invalidate();

            a += 1;
        }
		protected override void OnElementChanged (ElementChangedEventArgs<View> e)
		{
			base.OnElementChanged (e);

			var plotView = new PlotView (Context);

			NativeElement.OnInvalidateDisplay = (s,ea) => {
				plotView.Invalidate();
			};

			SetNativeControl (plotView);

			NativeControl.Model = NativeElement.Model;

			NativeControl.SetBackgroundColor (NativeElement.BackgroundColor.ToAndroid ());
		}
        protected override void OnElementChanged(ElementChangedEventArgs <View> e)
        {
            base.OnElementChanged(e);

            var plotView = new PlotView(Context);

            NativeElement.OnInvalidateDisplay = (s, ea) => {
                plotView.Invalidate();
            };

            SetNativeControl(plotView);

            NativeControl.Model = NativeElement.Model;

            NativeControl.SetBackgroundColor(NativeElement.BackgroundColor.ToAndroid());
        }
Beispiel #5
0
        private void ButtonGetLastBP_Click(object sender, EventArgs e)
        {
            var Data = DatabaseAdapter.GetBloodData().Result;

            if (Data == null)
            {
                Toast.MakeText(ApplicationContext, "This is your actual blood picture", ToastLength.Long).Show();
            }
            else
            {
                Analyze();
                BloodPictureGraph.Model = CalculateBP();
                BloodPictureGraph.Invalidate();

                Toast.MakeText(ApplicationContext, "Your blood picture has beed updated", ToastLength.Long).Show();
            }
        }
        private void timer1_Tick(object sender, EventArgs e)
        {
            double erro = b - trbTemperaturaControle.Value;

            this.y.Points.Add(new DataPoint(a, lerTemperatura()));
            this.u.Points.Add(new DataPoint(a, trbTemperaturaControle.Value));
            this.e.Points.Add(new DataPoint(a, erro));
            this.uPP.Points.Add(new DataPoint(a, (erro / 60) * 100));

            if (this.y.Points.Count > 200)
            {
                this.y.Points.RemoveRange(0, 100);
            }

            temperaturaPlot.Invalidate();
            erroPlot.Invalidate();
            controlePlot.Invalidate();

            a += 1;
            b  = trbTemperaturaControle.Value + 0.4 * trbTemperaturaControle.Value * r.NextDouble();
        }
Beispiel #7
0
 public void Update()
 {
     Plot.Invalidate();
 }