|
|
@ -21,44 +21,43 @@ namespace Signal_Generator |
|
|
|
/// </summary>
|
|
|
|
public partial class MainWindow : Window |
|
|
|
{ |
|
|
|
AddSignalWindow addSignalWindow_Instance = new AddSignalWindow(); |
|
|
|
AddSignalWindow addSignalWindow_Instance; |
|
|
|
TaskWindow taskWindow_Instance = new TaskWindow(); |
|
|
|
ObservableCollection<IAnalogSignal> s; |
|
|
|
ObservableCollection<IAnalogSignal> typesOfSignal = new ObservableCollection<IAnalogSignal>(); |
|
|
|
ObservableCollection<IAnalogSignal> signalCollection; |
|
|
|
|
|
|
|
public MainWindow() |
|
|
|
{ |
|
|
|
InitializeComponent(); |
|
|
|
|
|
|
|
typesOfSignal.Add(new SinusoidalSignal(0, 0)); |
|
|
|
typesOfSignal.Add(new FmSignal(0, 0, 0)); |
|
|
|
addSignalWindow_Instance.signalType_ComboBox.ItemsSource = typesOfSignal; |
|
|
|
|
|
|
|
s = new ObservableCollection<IAnalogSignal>(); |
|
|
|
signalCollection = new ObservableCollection<IAnalogSignal>(); |
|
|
|
signals_ListBox.Items.Clear(); |
|
|
|
signals_ListBox.ItemsSource = s; |
|
|
|
addSignalWindow_Instance.Closed += addSignalWindow_Instance_Closed; |
|
|
|
signals_ListBox.ItemsSource = signalCollection; |
|
|
|
} |
|
|
|
|
|
|
|
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); |
|
|
|
s.Add(s1); |
|
|
|
var signal = null as IAnalogSignal; |
|
|
|
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(); |
|
|
|
taskWindow_Instance.Show(); |
|
|
|
} |
|
|
|
|
|
|
|
private void startProcedure_Button_Click(object sender, RoutedEventArgs e) |
|
|
|
private void removeSignal_Button_Click(object sender, RoutedEventArgs e) |
|
|
|
{ |
|
|
|
taskWindow_Instance.Show(); |
|
|
|
signalCollection.RemoveAt(signals_ListBox.SelectedIndex); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|