private void Clear_Click(object sender, RoutedEventArgs e) { if (!_loaded) { return; } SimpleMinterm.Text = ""; IMintermTable mintermatble = null; switch (InputMode.SelectedIndex) { case 0: foreach (var i in McuTools.Interfaces.WPF.WpfHelpers.FindChildren <RadioButton>(VarButtons)) { if (i.IsChecked == true) { RadioButton_Checked(i, null); break; } } break; case 1: mintermatble = Minterm2x; break; case 2: mintermatble = Minterm3x; break; case 3: mintermatble = Minterm4x; break; case 4: mintermatble = Minterm5x; break; } if (mintermatble != null) { mintermatble.ClearInput(); if (LsbBit.IsChecked == true || reversed) { mintermatble.SwapVarnames(); reversed = !reversed; } } }
private void Button_Minimize_Click(object sender, RoutedEventArgs e) { if (!_loaded) { return; } //string simple = null; IMintermTable mintermatble = null; switch (InputMode.SelectedIndex) { case 0: SimpleMinterm.Text = QuineMcclusky.GetSimplified(_items, _variables, (bool)HazardSafe.IsChecked, (bool)LsbBit.IsChecked, false); SimpleMaxterm.Text = QuineMcclusky.GetSimplified(_items, _variables, (bool)HazardSafe.IsChecked, (bool)LsbBit.IsChecked, true); break; case 1: mintermatble = Minterm2x; _variables = 2; break; case 2: mintermatble = Minterm3x; _variables = 3; break; case 3: mintermatble = Minterm4x; _variables = 4; break; case 4: mintermatble = Minterm5x; _variables = 5; break; case 5: InputByNumbers(); break; } if (mintermatble != null) { SimpleMinterm.Text = QuineMcclusky.GetSimplified(mintermatble.Selected, _variables, (bool)HazardSafe.IsChecked, (bool)LsbBit.IsChecked, false); SimpleMaxterm.Text = QuineMcclusky.GetSimplified(mintermatble.Selected, _variables, (bool)HazardSafe.IsChecked, (bool)LsbBit.IsChecked, true); } }