Example #1
0
 void val2tb()
 {
     tbP.Text   = P.ToString(System.Globalization.CultureInfo.InvariantCulture);
     tbRth.Text = Rth.ToString(System.Globalization.CultureInfo.InvariantCulture);
     tbTj.Text  = Tj.ToString(System.Globalization.CultureInfo.InvariantCulture);
 }
Example #2
0
 /// <summary>
 /// For Bar Sizes check BarSize class
 /// For durations check Duration class
 /// </summary>
 public void GetHistoricalData(int reqId, Contract contract, string duration, string barSize, WhatToShow whatToShow, Rth rth, bool keepUpToDate)
 {
     _historicalData.Add(reqId, new List <Bar>());
     ClientSocket.reqHistoricalData(reqId, contract, string.Empty, duration, barSize, whatToShow.ToString(), (int)rth, 1, keepUpToDate, null);
     Notify($"Historical data for symbol {contract.Symbol} requested");
 }
Example #3
0
        private void button6_Click(object sender, EventArgs e)
        {
            double Ie, Ic, Ib, Vth, Rth, Rc, Re, Vcc, Vce, Vbe, Imax, vmax, beta, R1, R2;

            try
            {
                Rc   = Convert.ToDouble(txtgerilimbölücüpolarmarc.Text) * 1000;
                R1   = Convert.ToDouble(txtgerilimbölücüpolarmaR1.Text) * 1000;
                R2   = Convert.ToDouble(txtgerilimbölücüpolarmaR2.Text) * 1000;
                Re   = Convert.ToDouble(txtgerilimbölücüpolarmare.Text) * 1000;
                Vcc  = Convert.ToDouble(txtgerilimbölücüpolarmavcc.Text);
                beta = Convert.ToDouble(txtgerilimbölücüpolarmabeta.Text);
                Vbe  = Convert.ToDouble(txtgerilimbölücüpolarmavbe.Text);

                if (Rc > 0 & R1 > 0 & R2 > 0 & Re > 0)
                {
                    Imax = (1000 * Vcc) / (Rc + Re);
                    Vth  = R2 * Vcc / (R1 + R2);
                    Rth  = R2 * R1 / (R1 + R2);
                    Ib   = (Vth - Vbe) / (Rth + (beta + 1) * Re);
                    Ie   = (beta + 1) * Ib;
                    Ic   = Ie - Ib;
                    Vce  = Vcc - Ic * Rc - Ie * Re;
                    vmax = Vcc;

                    lblgerilimbölücüpolarmaıb.Text   = " = " + (Math.Pow(10, 6) * Ib).ToString() + "μA";
                    lblgerilimbölücüpolarmaıc.Text   = " = " + (1000 * Ic).ToString() + "mA";
                    lblgerilimbölücüpolarmaıe.Text   = " = " + (1000 * Ie).ToString() + "mA";
                    lblgerilimbölücüpolarmaImax.Text = " = " + Imax.ToString() + "mA";
                    lblgerilimbölücüpolarmavth.Text  = Vth.ToString() + "Volt";
                    lblgerilimbölücüpolarmarth.Text  = Rth.ToString();
                    lblgerilimbölücüpolarmavce.Text  = Vce.ToString() + "Volt";
                    Ic = Ic * 1000;


                    ZedGraph.ZedGraphControl g = new ZedGraph.ZedGraphControl();
                    g.Size = new Size(panel4.Width - 2, panel4.Height - 2);
                    ZedGraph.GraphPane myGraphPane = g.GraphPane;
                    myGraphPane.Title.Text       = "Dc yük eğrisi ";
                    myGraphPane.XAxis.Title.Text = "Volt (V)";
                    myGraphPane.YAxis.Title.Text = "Akım(ma)";
                    PointPairList list1 = new PointPairList();
                    myGraphPane.AddCurve("", new double[] { 0, vmax }, new double[] { Imax, 0 }, Color.Blue, ZedGraph.SymbolType.None);
                    myGraphPane.AddCurve("", new double[] { 0, Vce }, new double[] { Ic, Ic }, Color.Blue, ZedGraph.SymbolType.None);
                    myGraphPane.AddCurve("", new double[] { Vce, Vce }, new double[] { Ic, 0 }, Color.Blue, ZedGraph.SymbolType.None);

                    myGraphPane.Chart.Fill = new ZedGraph.Fill(Color.White, Color.Red, 3.0f);

                    g.AxisChange();

                    panel4.Controls.Add(g);
                }
                else
                {
                    MessageBox.Show("Direnc Degerlerini yanlış girdiniz:");
                }
            }
            catch (Exception)
            {
                Form1.HataMesaji();
            }
        }