private void button3_Copy_Click(object sender, RoutedEventArgs e) { var vm = DataContext as MainViewModel; vm.Model1.Series.Clear(); var fuz = new FuzzySignal(20, 19) { GenerateNewHzFunct = false }; fuz.SetSinImpulse(); for (int i = 0; i < 2; i++) { fuz.Amplitude = 1d / (i + 1); fuz.Reset(); var ser = new LineSeries(); foreach (var point in fuz.GetInterpSignal(0, 1, nPoints:1000).Points()) { ser.Points.Add(new DataPoint(point.X, point.Y)); } vm.Model1.Series.Add(ser); var ser2 = new LineSeries(); ser2.Points.AddRange(fuz.InterpHz.DataPoints(y => y / 100)); vm.Model1.Series.Add(ser2); } vm.Model1.InvalidatePlot(false); }
private void button8_Click(object sender, RoutedEventArgs e) { try { var lst = new List <FuzzySignal>(4); double hz0, dhz0, t1; Double.TryParse(tbHz0.Text, out hz0); Double.TryParse(tbdHz0.Text, out dhz0); Double.TryParse(tbT0.Text, out t1); var s1 = new FuzzySignal(hz0, dhz0, "Signal_1"); s1.SetRectangleImpulse(t1); lst.Add(s1); Double.TryParse(tbHz1.Text, out hz0); Double.TryParse(tbdHz1.Text, out dhz0); Double.TryParse(tbT1.Text, out t1); s1 = new FuzzySignal(hz0, dhz0, "Signal_2"); s1.SetRectangleImpulse(t1); lst.Add(s1); Double.TryParse(tbHz2.Text, out hz0); Double.TryParse(tbdHz2.Text, out dhz0); Double.TryParse(tbT2.Text, out t1); s1 = new FuzzySignal(hz0, dhz0, "Signal_3"); s1.SetRectangleImpulse(t1); lst.Add(s1); Double.TryParse(tbHz3.Text, out hz0); Double.TryParse(tbdHz3.Text, out dhz0); Double.TryParse(tbT3.Text, out t1); s1 = new FuzzySignal(hz0, dhz0, "Signal_4"); s1.SetRectangleImpulse(t1); lst.Add(s1); var vm = DataContext as MainViewModel; vm.Signals = lst; vm.RedrawModel3(); } catch (Exception) { throw; } }