예제 #1
0
        public Form1()
        {
            InitializeComponent();
            grsXt = new List <MathGraphic>();
            grsVt = new List <MathGraphic>();
            grsVx = new List <MathGraphic>();
            x0    = 1;
            v0    = 3;
            k     = 1.8;
            w     = 2.1;
            n     = 0.0025;
            P     = 20;
            T0    = 0;
            Tmax  = 300;
            dx    = pictureBox1.Width / 3f;
            dy    = pictureBox1.Height / 2f;

            textBoxX0.Text = x0.ToString();
            textBoxV0.Text = v0.ToString();
            textBoxK.Text  = k.ToString();
            textBoxW.Text  = w.ToString();
            textBoxN.Text  = n.ToString();
            textBoxP.Text  = P.ToString();
            textBoxT0.Text = T0.ToString();
            textBoxT1.Text = Tmax.ToString();
        }
예제 #2
0
        private void buttonGO_Click(object sender, EventArgs e)
        {
            MathGraphic m;

            try
            {
                x0   = double.Parse(textBoxX0.Text);
                v0   = double.Parse(textBoxV0.Text);
                k    = double.Parse(textBoxK.Text);
                w    = double.Parse(textBoxW.Text);
                n    = double.Parse(textBoxN.Text);
                P    = double.Parse(textBoxP.Text);
                T0   = float.Parse(textBoxT0.Text);
                Tmax = float.Parse(textBoxT1.Text);
            }
            catch (FormatException) {
                MessageBox.Show("Wrong number format");

                textBoxX0.Text = x0.ToString();
                textBoxV0.Text = v0.ToString();
                textBoxK.Text  = k.ToString();
                textBoxW.Text  = w.ToString();
                textBoxN.Text  = n.ToString();
                textBoxP.Text  = P.ToString();
                textBoxT0.Text = T0.ToString();
                textBoxT1.Text = Tmax.ToString();

                return;
            }

            Compute();
            if (radioXT.Checked)
            {
                grsXt.Clear();

                m = new MathGraphic(Color.Green, DrawModes.DrawLines,
                                    fx, T0, Tmax, 1e-2f);
                grsXt.Add(m);
            }
            if (radioVT.Checked)
            {
                grsVt.Clear();

                m = new MathGraphic(Color.Green, DrawModes.DrawLines,
                                    fv, T0, Tmax, 1e-2f);
                grsVt.Add(m);
            }
            if (radioVX.Checked)
            {
                AddGraphicVX();
            }

            pictureBox1.Refresh();
        }
예제 #3
0
 public override ParamData GetParamData()
 {
     try
     {
         ParamData pd = new ParamExtrusionData(xFunction, yFunction, zFunction, xPrimeFunction, yPrimeFunction, Smin.ToString(), Smax.ToString(),
                                               Tmin.ToString(), Tmax.ToString(), NumFacetS, NumFacetT, colorString, null);
         pd.BackColorString      = backColorString;
         pd.Opaque               = !translucent;
         pd.ImageSource          = imageSource;
         pd.ImageTiled           = imageTiled;
         pd.ImageTransformMatrix = imageTransformMatrix;
         pd.TransformMatrix      = transformMatrix;
         if (Children != null && Children.Count > 0)
         {
             foreach (ParameterObjectData p in Children)
             {
                 pd.Children.Add(p.GetParamData());
             }
         }
         return(pd);
     }
     catch { return(null); }
 }
예제 #4
0
파일: Form1.cs 프로젝트: a-27m/vssdb
        public Form1()
        {
            InitializeComponent();
            grsN1T  = new List <MathGraphic>();
            grsN2T  = new List <MathGraphic>();
            grsN1N2 = new List <MathGraphic>();

            Y0 = new double[2];

            h   = 1e-2;
            b11 = 1.1;
            b12 = 1.1;
            b21 = 1.1;
            b22 = 1.1;
            C2  = 0.2;

            Y0[0] = 1;  // n1(0)
            Y0[1] = 1;  // n2(0);

            T0   = 0;
            Tmax = 5;


            dx = pictureBox1.Width / 3f;
            dy = pictureBox1.Height / 2f;

            textBoxH.Text    = h.ToString();
            textBoxB11.Text  = b11.ToString();
            textBoxB12.Text  = b12.ToString();
            textBoxB21.Text  = b21.ToString();
            textBoxN1_0.Text = Y0[0].ToString();
            textBoxN2_0.Text = Y0[1].ToString();
            textBoxB22.Text  = b22.ToString();
            textBoxC2.Text   = C2.ToString();
            textBoxT1.Text   = T0.ToString();
            textBoxT2.Text   = Tmax.ToString();
        }
예제 #5
0
파일: Form1.cs 프로젝트: a-27m/vssdb
        private void buttonGO_Click(object sender, EventArgs e)
        {
            MathGraphic m;

            #region in/out
            try
            {
                h     = double.Parse(textBoxH.Text);
                b11   = double.Parse(textBoxB11.Text);
                b12   = double.Parse(textBoxB12.Text);
                b21   = double.Parse(textBoxB21.Text);
                b22   = double.Parse(textBoxB22.Text);
                C2    = double.Parse(textBoxC2.Text);
                Y0[0] = double.Parse(textBoxN1_0.Text);
                Y0[1] = double.Parse(textBoxN2_0.Text);
                T0    = double.Parse(textBoxT1.Text);
                Tmax  = double.Parse(textBoxT2.Text);
            }
            catch (FormatException)
            {
                MessageBox.Show("Wrong number format");

                textBoxH.Text    = h.ToString();
                textBoxB11.Text  = b11.ToString();
                textBoxB12.Text  = b12.ToString();
                textBoxB21.Text  = b21.ToString();
                textBoxN1_0.Text = Y0[0].ToString();
                textBoxN2_0.Text = Y0[1].ToString();
                textBoxB22.Text  = b22.ToString();
                textBoxC2.Text   = C2.ToString();
                textBoxT1.Text   = T0.ToString();
                textBoxT2.Text   = Tmax.ToString();

                return;
            }
            #endregion

            Compute();

            if (radioN1T.Checked)
            {
                grsN1T.Clear();

                m = new MathGraphic(Color.Green, DrawModes.DrawLines,
                                    ft, fN1, 0, n - 1, 1);
                grsN1T.Add(m);
            }
            if (radioN2T.Checked)
            {
                grsN2T.Clear();

                m = new MathGraphic(Color.Green, DrawModes.DrawLines,
                                    ft, fN2, 0, n - 1, 1);
                grsN2T.Add(m);
            }
            if (radioN1N2.Checked)
            {
                grsN1N2.Clear();

                grsN1N2.Add(new MathGraphic(Color.Green, DrawModes.DrawLines,
                                            fN1, fN2, 0, n - 1, 1));
                grsN1N2.Add(new MathGraphic(Color.BlueViolet, DrawModes.DrawLines,
                                            fAsympt, 0, pictureBox1.Width / zoom, (float)h));
            }

            pictureBox1.Refresh();
        }
예제 #6
0
        private void Calc()
        {
            double Pk, L, Ti, Tm, Gp, Tp, Var_A, Var_B, D1, k, k_Qnpp, Tmin, Tmax;
            int    n, Qz, Qnpp;

            ClearResult();

            if (kToolStripMenuItem.Checked == true)
            {
                k_Qnpp = 0.7;
            }
            else
            {
                k_Qnpp = 1;
            }

            try
            {
                Pk   = Convert.ToDouble(txtPk.Text);
                L    = Convert.ToDouble(txtL.Text);
                n    = Convert.ToInt16(txtn.Text);
                Qz   = Convert.ToInt16(txtQz.Text);
                Ti   = Convert.ToDouble(txtT1.Text);
                Qnpp = Convert.ToInt16(txtQnpp.Text);

                Qz   = Qz * 1000;
                Qnpp = Qnpp * 1000;

                Tm = Ti / 60;

                Gp = 4 * Pk * L * n;

                Tp = 3600 * Gp / Qz;

                Var_A = Qz * Tm - 60 * Gp;

                //Var_B = 0.7 * Qnpp;
                Var_B = k_Qnpp * Qnpp;

                D1 = Var_A / (Var_B * Tm) * 100;

                k = Tp / Ti;

                Tmin = (6 * 60 * Gp) / (100 * Qz / 1000 - k_Qnpp * Qnpp / 1000);
                Tmax = (6 * 60 * Gp) / (k_Qnpp * Qnpp / 1000 + 100 * Qz / 1000);


                label1.Text = label1.Text + " " + Gp.ToString("0.###") + " кг";
                label4.Text = label4.Text + " " + Tp.ToString("0.###") + " c";

                label5.Text = label5.Text + " " + Tmax.ToString("0.###") + " c";
                label7.Text = label7.Text + " " + Tmin.ToString("0.###") + " c";

                label6.Text = label6.Text + " " + k.ToString("0.###");
                label3.Text = label3.Text + " " + D1.ToString("0.##") + " %";



                if (D1 > 1 || D1 < -1)
                {
                    lblError.Visible = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Проверьте введенные данные!", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            // MessageBox.Show(Pk.ToString("0.##"));
        }