diff --git a/Signal Generator/MainWindow.xaml.cs b/Signal Generator/MainWindow.xaml.cs index 5477699..88e4a84 100644 --- a/Signal Generator/MainWindow.xaml.cs +++ b/Signal Generator/MainWindow.xaml.cs @@ -22,7 +22,7 @@ namespace Signal_Generator public partial class MainWindow : Window { AddSignalWindow addSignalWindow_Instance; - TaskWindow taskWindow_Instance = new TaskWindow(); + TaskWindow taskWindow_Instance; ObservableCollection signalCollection; public MainWindow() @@ -52,11 +52,18 @@ namespace Signal_Generator private void startProcedure_Button_Click(object sender, RoutedEventArgs e) { + MultiSignal ms = new MultiSignal(); + foreach (IAnalogSignal item in signalCollection) + { + ms.add(item); + } + taskWindow_Instance = new TaskWindow(ms); taskWindow_Instance.Show(); } private void removeSignal_Button_Click(object sender, RoutedEventArgs e) { + if (signals_ListBox.SelectedIndex == -1) return; signalCollection.RemoveAt(signals_ListBox.SelectedIndex); } } diff --git a/Signal Generator/Signal/FmSignal.cs b/Signal Generator/Signal/FmSignal.cs index de3265a..74e4611 100644 --- a/Signal Generator/Signal/FmSignal.cs +++ b/Signal Generator/Signal/FmSignal.cs @@ -32,7 +32,7 @@ namespace Signal_Generator public double currentAmplitude(double t) { var c = paramsCollection.ToArray(); - return c[0].value * Math.Sin(2 * Math.PI * c[1].value* t + c[2].value * Math.Sin(t)); + return c[0].value * Math.Sin(2 * 3.14 * c[1].value* t + c[2].value * Math.Sin(t)); } } } diff --git a/Signal Generator/Signal/MultiSignal.cs b/Signal Generator/Signal/MultiSignal.cs index 85ff49f..03c826b 100644 --- a/Signal Generator/Signal/MultiSignal.cs +++ b/Signal Generator/Signal/MultiSignal.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; namespace Signal_Generator { - class MultiSignal : IAnalogSignal + public class MultiSignal : IAnalogSignal { private List signals { get; set; } @@ -16,12 +16,12 @@ namespace Signal_Generator signals = new List(); } - public void add(IAnalogSignal signal) + internal void add(IAnalogSignal signal) { signals.Add(signal); } - public void remove(IAnalogSignal signal) + internal void remove(IAnalogSignal signal) { signals.Remove(signal); } diff --git a/Signal Generator/Signal/SinusoidalSignal.cs b/Signal Generator/Signal/SinusoidalSignal.cs index 992bfd4..2ac6047 100644 --- a/Signal Generator/Signal/SinusoidalSignal.cs +++ b/Signal Generator/Signal/SinusoidalSignal.cs @@ -32,7 +32,7 @@ namespace Signal_Generator public double currentAmplitude(double t) { var c = paramsCollection.ToArray(); - return c[0].value * Math.Sin(2 * Math.PI * c[1].value * t + c[2].value); + return c[0].value * Math.Sin(2.0 * 3.14 * c[1].value * t + c[2].value); } } } diff --git a/Signal Generator/TaskWindow.xaml b/Signal Generator/TaskWindow.xaml index bd51cf1..dc0a050 100644 --- a/Signal Generator/TaskWindow.xaml +++ b/Signal Generator/TaskWindow.xaml @@ -20,13 +20,13 @@ - - + + Время выполения: Текущий сигнал: -