|
|
@ -23,14 +23,13 @@ namespace Signal_Generator |
|
|
|
{ |
|
|
|
AddSignalWindow addSignalWindow_Instance; |
|
|
|
TaskWindow taskWindow_Instance; |
|
|
|
ObservableCollection<IAnalogSignal> signalCollection; |
|
|
|
MultiSignal multiSignal = MultiSignal.getInstance(); |
|
|
|
|
|
|
|
public MainWindow() |
|
|
|
{ |
|
|
|
InitializeComponent(); |
|
|
|
signalCollection = new ObservableCollection<IAnalogSignal>(); |
|
|
|
signals_ListBox.Items.Clear(); |
|
|
|
signals_ListBox.ItemsSource = signalCollection; |
|
|
|
signals_ListBox.ItemsSource = multiSignal.signals; |
|
|
|
} |
|
|
|
|
|
|
|
private void addSignal_Button_Click(object sender, RoutedEventArgs e) |
|
|
@ -52,18 +51,13 @@ namespace Signal_Generator |
|
|
|
var signal = null as IAnalogSignal; |
|
|
|
signal = (IAnalogSignal) addSignalWindow_Instance.signalType_ComboBox.SelectedItem; |
|
|
|
if (addSignalWindow_Instance.signalType_ComboBox.SelectedItem == null) return; |
|
|
|
signalCollection.Add(signal); |
|
|
|
multiSignal.Add(signal); |
|
|
|
addSignalWindow_Instance.Close(); |
|
|
|
} |
|
|
|
|
|
|
|
private void startProcedure_Button_Click(object sender, RoutedEventArgs e) |
|
|
|
{ |
|
|
|
IsEnabled = false; |
|
|
|
MultiSignal ms = MultiSignal.getInstance(); |
|
|
|
foreach (IAnalogSignal item in signalCollection) |
|
|
|
{ |
|
|
|
ms.add(item); |
|
|
|
} |
|
|
|
taskWindow_Instance = new TaskWindow(); |
|
|
|
taskWindow_Instance.Show(); |
|
|
|
taskWindow_Instance.Closed += enableMainWindow; |
|
|
@ -71,8 +65,9 @@ namespace Signal_Generator |
|
|
|
|
|
|
|
private void removeSignal_Button_Click(object sender, RoutedEventArgs e) |
|
|
|
{ |
|
|
|
if (signals_ListBox.SelectedIndex == -1) return; |
|
|
|
signalCollection.RemoveAt(signals_ListBox.SelectedIndex); |
|
|
|
if (signals_ListBox.SelectedItem == null) return; |
|
|
|
var x = signals_ListBox.SelectedItem as IAnalogSignal; |
|
|
|
multiSignal.Remove(x); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|