/// <summary> /// Transform Text to Filter Coefficients b /// replace in Schematic and plot the graph /// </summary> /// <param name="sender">sender</param> /// <param name="e">Arguments</param> private void textbox_b_TextChanged(object sender, TextChangedEventArgs e) { float[] help = new float[] { }; if (split_text2float(textbox_b.Text, ref help)) { _b = help; Transferfunction _Tf = new Transferfunction(_a, _b); if (_Simulator != null) _Simulator.replace_in_Schematic_at_pos(3, _Tf); plot_graph(); } }
/// <summary> /// When the Selection Changed, it will calculate the new possible loops. /// Ans replace the loop in the Schematic /// </summary> /// <param name="sender">sender</param> /// <param name="e">Arguments</param> private void TabControl_Strecke_SelectionChanged(object sender, SelectionChangedEventArgs e) { TabItem lbi = ((sender as TabControl).SelectedItem as TabItem); if (lbi.Name == "tab_Strecke_PT1") { tab_Regler_P.IsEnabled = false; tab_Regler_I.IsEnabled = true; tab_Regler_PI.IsEnabled = false; tab_Regler_PID.IsEnabled = false; TabControl_Regler.SelectedIndex = 0; enable_all_optimizations(); _Simulator.replace_in_Schematic_at_pos(1, _I); _Simulator.replace_in_Schematic_at_pos(3, _PT1); } else if (lbi.Name == "tab_Strecke_IT1") { tab_Regler_P.IsEnabled = true; tab_Regler_I.IsEnabled = false; tab_Regler_PI.IsEnabled = true; tab_Regler_PID.IsEnabled = false; enable_all_optimizations(); check_optimization_for_IT1(); if (tab_Regler_PI.IsSelected == false) { TabControl_Regler.SelectedIndex = 1; _Simulator.replace_in_Schematic_at_pos(1, _P); } _Simulator.replace_in_Schematic_at_pos(3, _IT1); } else if (lbi.Name == "tab_Strecke_PT2_wdb1") { tab_Regler_P.IsEnabled = true; tab_Regler_I.IsEnabled = false; tab_Regler_PI.IsEnabled = true; tab_Regler_PID.IsEnabled = false; enable_all_optimizations(); check_optimization_for_PT2_wdb1(); if (tab_Regler_PI.IsSelected == false) { TabControl_Regler.SelectedIndex = 1; _Simulator.replace_in_Schematic_at_pos(1, _P); } _Simulator.replace_in_Schematic_at_pos(3, _PT2_wdb1); } else if (lbi.Name == "tab_Strecke_PT2_wdse1") { tab_Regler_P.IsEnabled = false; tab_Regler_I.IsEnabled = true; tab_Regler_PI.IsEnabled = true; tab_Regler_PID.IsEnabled = false; enable_all_optimizations(); check_optimization_for_PT2_wdse1(); if (tab_Regler_PI.IsSelected == false) { TabControl_Regler.SelectedIndex = 0; _Simulator.replace_in_Schematic_at_pos(1, _I); } _Simulator.replace_in_Schematic_at_pos(3, _PT2_wdse1); } else if (lbi.Name == "tab_Strecke_Beliebig") { tab_Regler_P.IsEnabled = true; tab_Regler_I.IsEnabled = true; tab_Regler_PI.IsEnabled = true; tab_Regler_PID.IsEnabled = true; butten_auslegen_I.IsEnabled = false; butten_auslegen_P.IsEnabled = false; butten_auslegen_PI.IsEnabled = false; Transferfunction _Tf = new Transferfunction(_a, _b); _Simulator.replace_in_Schematic_at_pos(3, _Tf); } plot_graph(); }