private void calculateLmatch_btn_Click(object sender, EventArgs e) { //. Complex ZA = MenialOperations.ComplexFromString(CalculateLMatch_ZA_tb.Text); Complex ZB = MenialOperations.ComplexFromString(CalculateLMatch_ZB_tb.Text); bool isLP = lowpass_rb.Checked; double freq = Convert.ToDouble(CalculateLmatch_frequency_tb.Text); double Zo = Convert.ToDouble(CalculateLMatch_Zo_tb.Text); //Calculate. double L; double C; bool seriesNextToLoad = OnePortNetwork.Lmatch(ZA, ZB, isLP, freq, Zo, out L, out C); //Show. ThreadSafe.SetControlTextThreadSafe_f(this, CalculateLmatch_Output_tb, L.ToString() + " H, " + Environment.NewLine + ((seriesNextToLoad == isLP) ? "Next to ZA, " : "Next to ZB, ") + Environment.NewLine + //Series next to load XOR isLP. (isLP ? "Series, " : "Shunt, ") + Environment.NewLine ); ThreadSafe.SetControlTextThreadSafe_f(this, CalculateLmatch_Output_tb, C.ToString() + " F," + Environment.NewLine + ((seriesNextToLoad != isLP) ? "Next to ZA, " : "Next to ZB, ") + Environment.NewLine + //Series next to load XNOR isLP. (!isLP ? "Series, " : "Shunt, ") ); //Draw ind and cap connected on screen. }
public void Lmatch(OnePortNetwork otherOnePortNetwork, bool isLP, double freq, out double L, out double C) { OnePortNetwork.Lmatch(this.Z, otherOnePortNetwork.Z, isLP, freq, this.Zo, out L, out C); }