|
@ -21,44 +21,50 @@ namespace Signal_Generator |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public partial class MainWindow : Window |
|
|
public partial class MainWindow : Window |
|
|
{ |
|
|
{ |
|
|
AddSignalWindow addSignalWindow_Instance = new AddSignalWindow(); |
|
|
AddSignalWindow addSignalWindow_Instance; |
|
|
TaskWindow taskWindow_Instance = new TaskWindow(); |
|
|
TaskWindow taskWindow_Instance; |
|
|
ObservableCollection<IAnalogSignal> s; |
|
|
ObservableCollection<IAnalogSignal> signalCollection; |
|
|
ObservableCollection<IAnalogSignal> typesOfSignal = new ObservableCollection<IAnalogSignal>(); |
|
|
|
|
|
|
|
|
|
|
|
public MainWindow() |
|
|
public MainWindow() |
|
|
{ |
|
|
{ |
|
|
InitializeComponent(); |
|
|
InitializeComponent(); |
|
|
|
|
|
signalCollection = new ObservableCollection<IAnalogSignal>(); |
|
|
typesOfSignal.Add(new SinusoidalSignal(0, 0)); |
|
|
|
|
|
typesOfSignal.Add(new FmSignal(0, 0, 0)); |
|
|
|
|
|
addSignalWindow_Instance.signalType_ComboBox.ItemsSource = typesOfSignal; |
|
|
|
|
|
|
|
|
|
|
|
s = new ObservableCollection<IAnalogSignal>(); |
|
|
|
|
|
signals_ListBox.Items.Clear(); |
|
|
signals_ListBox.Items.Clear(); |
|
|
signals_ListBox.ItemsSource = s; |
|
|
signals_ListBox.ItemsSource = signalCollection; |
|
|
addSignalWindow_Instance.Closed += addSignalWindow_Instance_Closed; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void addSignalWindow_Instance_Closed(object sender, EventArgs e) |
|
|
private void addSignal_Button_Click(object sender, RoutedEventArgs e) |
|
|
{ |
|
|
{ |
|
|
|
|
|
addSignalWindow_Instance = new AddSignalWindow(); |
|
|
|
|
|
addSignalWindow_Instance.createItem_Button.Click += addSignalWindow_Instance_Closing; |
|
|
|
|
|
addSignalWindow_Instance.Show(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void addSomeExtra() |
|
|
private void addSignalWindow_Instance_Closing(object sender, EventArgs e) |
|
|
{ |
|
|
{ |
|
|
SinusoidalSignal s1 = new SinusoidalSignal(1, 50); |
|
|
var signal = null as IAnalogSignal; |
|
|
s.Add(s1); |
|
|
signal = (IAnalogSignal) addSignalWindow_Instance.signalType_ComboBox.SelectedItem; |
|
|
|
|
|
if (addSignalWindow_Instance.signalType_ComboBox.SelectedItem == null) return; |
|
|
|
|
|
signalCollection.Add(signal); |
|
|
|
|
|
addSignalWindow_Instance.Close(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void addSignal_Button_Click(object sender, RoutedEventArgs e) |
|
|
private void startProcedure_Button_Click(object sender, RoutedEventArgs e) |
|
|
{ |
|
|
{ |
|
|
addSignalWindow_Instance.Show(); |
|
|
MultiSignal ms = new MultiSignal(); |
|
|
|
|
|
foreach (IAnalogSignal item in signalCollection) |
|
|
|
|
|
{ |
|
|
|
|
|
ms.add(item); |
|
|
|
|
|
} |
|
|
|
|
|
taskWindow_Instance = new TaskWindow(ms); |
|
|
|
|
|
taskWindow_Instance.Show(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void startProcedure_Button_Click(object sender, RoutedEventArgs e) |
|
|
private void removeSignal_Button_Click(object sender, RoutedEventArgs e) |
|
|
{ |
|
|
{ |
|
|
taskWindow_Instance.Show(); |
|
|
if (signals_ListBox.SelectedIndex == -1) return; |
|
|
|
|
|
signalCollection.RemoveAt(signals_ListBox.SelectedIndex); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|