예제 #1
0
 private void showForm6ToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     Form6 objektForm6 = new Form6();
     objektForm6.Show();
 }
예제 #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     Form6 form6 = new Form6(textBox1.Text);
     form6.Show();
 }
예제 #3
0
파일: Form3.cs 프로젝트: sami-lab/QuizApp
        private void button1_Click(object sender, EventArgs e)
        {
            //Enabling Everthing we Disabled in label event
            pictureBox1.Enabled = true;
            pictureBox2.Enabled = true;
            pictureBox3.Enabled = true;
            label3.Enabled      = true;
            label4.Enabled      = true;
            label5.Enabled      = true;
            label6.Enabled      = true;
            pictureBox4.Visible = false;
            pictureBox5.Visible = false;
            correctop.Stop();
            questionscreen.Play();
            qid++;
button1:
            if (qid <= 10)
            {
                Random r = new Random();
                count = r.Next(0, 22);
                s     = search(x, count);

                if (s == true)
                {
                    goto button1;
                }
                else
                {
                    check++;
                    x[check] = count;
                    //MessageBox.Show("ques id " + qid + " count " + count + " int value " + x[check] + "check value " + check);
                    questioncheck();
                    Cash.Text = "Your Score is : " + Form3.score;
                }
            }
            //lifeline 1 control
            if (fifty == true)
            {
                pictureBox1.Enabled = false;
                pictureBox1.Image   = Image.FromFile(@"Resources\fif.jpg");
                label3.Show();
                label4.Show();
                label5.Show();
                label6.Show();
            }
            //lifeline 2 control
            if (qchange == true)
            {
                pictureBox2.Enabled = false;
                pictureBox2.Image   = Image.FromFile(@"Resources\111KBC1 copy.jpg");
            }
            //Audience Poll Lifeline control
            if (Aud == true)
            {
                chart1.Visible      = false;
                pictureBox3.Enabled = false;
                pictureBox3.Image   = Image.FromFile(@"Resources\images1.png");
            }

            //after all answer correct
            if (qid == 11)
            {
                questionscreen.Stop();
                score10.BackColor = Color.Transparent;
                this.Hide();
                Form6 f6 = new Form6();
                f6.Show();
            }
        }
예제 #4
0
        public Form1()
        {
            InitializeComponent();
            chart1.Images.Add(new System.Windows.Forms.DataVisualization.Charting.NamedImage("watermark", Properties.Resources.watermark));
            chart1.ChartAreas[0].BackImage = "watermark";
            chart2.Images.Add(new System.Windows.Forms.DataVisualization.Charting.NamedImage("watermark", Properties.Resources.watermark));
            chart2.ChartAreas[0].BackImage = "watermark";

            update_opt_dt();
            toggle = false;
            //chart1
            chart1.Series[0].Points.Clear();
            chart1.Series[1].Points.Clear();
            numericUpDown1.Enabled = false;
            //chart2
            chart2.Series[0].Points.Clear();
            chart2.Series[1].Points.Clear();
            numericUpDown2.Enabled = false;
            //hotdog properties
            r0      = 0.0;
            density = 0.0;
            k       = 0.0;
            c       = 0.0;
            alpha   = 0.0;
            e2      = 0.0;
            T_init  = 0.0;
            //charcoal properties
            Tc          = 0.0;
            Ta          = 0.0;
            T_inf       = 0.0;
            T_film_free = 0.0;
            D_coal      = 0.0;
            e1          = 0.0;
            //simulation setting
            dr        = 0.0;
            M         = 0;
            M_double  = 0.0;
            t_total   = 0.0;
            dt        = 0.0;
            N         = 0;
            N_double  = 0.0;
            F         = 0.0;
            L         = 0.0;
            h_anl     = 0.0;
            z         = new double[1];
            C         = new double[1];
            T_center  = 0.0;
            T_surface = 0.0;
            term      = 1;
            theta     = 0.0;
            //view factors
            F12 = 0.0;
            F21 = 0.0;
            //free convection around charcoal
            B        = 0.0;
            rho_free = 0.0;
            miu_free = 0.0;
            Gr       = 0.0;
            V        = 0.0;

            //temperature profile
            T = new double[1, 1];

            //convection profile
            hc = new double[1];
            qc = new double[1];

            //radiation profile
            hr = new double[1];
            qr = new double[1];

            //background thread
            bool cancel = false;

            bw = new BackgroundWorker();
            bw.WorkerReportsProgress      = true;
            bw.WorkerSupportsCancellation = true;
            bw.DoWork += new DoWorkEventHandler(
                delegate(object o, DoWorkEventArgs args)
            {
                BackgroundWorker b = o as BackgroundWorker;
                cancel             = false;
                //hotdog properties
                r0      = double.Parse(r_text.Text) / 100.0;
                density = double.Parse(rho_text.Text);
                k       = double.Parse(k_text.Text);
                c       = double.Parse(c_text.Text);
                alpha   = k / density / c;
                e2      = double.Parse(e2_text.Text);
                T_init  = double.Parse(T_init_text.Text) + 273.0;
                L       = double.Parse(L_text.Text) / 100.0;

                //charcoal properties
                Tc          = double.Parse(Tc_text.Text) + 273.0;
                Ta          = double.Parse(Ta_text.Text) + 273.0;
                T_inf       = double.Parse(T_text.Text) + 273.0;
                T_film_free = (Tc + Ta) / 2.0;
                D_coal      = double.Parse(D_coal_text.Text) / 100.0;
                e1          = double.Parse(e1_text.Text);

                //simulation setting
                dr        = double.Parse(dr_text.Text) / 100.0;
                M         = System.Convert.ToInt32(r0 / dr + 1.0);
                M_double  = System.Convert.ToDouble(M);
                t_total   = double.Parse(t_tot_text.Text);
                dt        = double.Parse(dt_text.Text);
                N         = System.Convert.ToInt32(t_total / dt + 1.0);
                N_double  = System.Convert.ToDouble(N);
                F         = alpha * dt / dr / dr;
                h_anl     = double.Parse(h_text.Text);
                T_center  = double.Parse(T_center_text.Text);
                T_surface = double.Parse(T_surface_text.Text);
                term      = (int)numericUpDown3.Value;
                z         = new double[term];
                C         = new double[term];

                //view factors
                F12 = r0 / 0.35 * (Math.Atan(0.175 / L) - Math.Atan(-0.175 / L));
                F21 = 0.35 / Math.PI / 2.0 / r0 * F12;

                //free convection around charcoal
                B        = 1.0 / T_film_free;
                rho_free = 101000.0 / (287.0 * T_film_free);
                miu_free = 0.00001716 * Math.Pow(T_film_free / 273.0, 1.5) * 384.0 / (T_film_free + 111.0);
                Gr       = g * B * (Tc - Ta) * Math.Pow(D_coal, 3.0) / Math.Pow(miu_free / rho_free, 2.0);
                V        = Math.Sqrt(Gr) * miu_free / rho_free / D_coal / 2.0;

                //temperature profile
                try
                {
                    T = new double[M, N];
                }
                catch
                {
                    cancel = true;
                }
                if (!cancel)
                {
                    for (int i = 0; i < M; ++i)
                    {
                        T[i, 0] = T_init;
                    }

                    //convection profile
                    hc = new double[N - 1];
                    qc = new double[N - 1];

                    //radiation profile
                    hr = new double[N - 1];
                    qr = new double[N - 1];

                    for (int i = 0; i < term; ++i)
                    {
                        z[i] = solve(System.Convert.ToDouble(i) * Math.PI, (System.Convert.ToDouble(i) + 1) * Math.PI);
                        C[i] = 2 * besselJ(1, z[i]) / z[i] / (Math.Pow(besselJ(0, z[i]), 2.0) + Math.Pow(besselJ(1, z[i]), 2.0));
                    }

                    for (int i = 0; i < N - 1; ++i)
                    {
                        //forced convection
                        T_film_forced = (T[M - 1, i] + T_inf) / 2.0;
                        cp            = 0.000352 * Math.Pow(T_film_forced, 2.0) - 0.161 * T_film_forced + 1021.48;
                        rho_forced    = 101000.0 / (287.0 * T_film_forced);
                        miu_forced    = 0.00001716 * Math.Pow(T_film_forced / 273.0, 1.5) * 384.0 / (T_film_forced + 111.0);
                        k_forced      = 0.0241 * Math.Pow(T_film_forced / 273.0, 1.5) * 467.0 / (T_film_forced + 194.0);
                        Re            = V * r0 * 2.0 / miu_forced * rho_forced;
                        Pr            = cp * miu_forced / k_forced;
                        Nu            = 0.3 + 0.62 * Math.Pow(Re, 0.5) * Math.Pow(Pr, 1.0 / 3.0) / Math.Pow((1.0 + Math.Pow(0.4 / Pr, 2.0 / 3.0)), 0.25) * Math.Pow((1.0 + Math.Pow(Re / 282000.0, 0.625)), 0.8);
                        hc[i]         = Nu * k_forced / 2.0 / r0;
                        qc[i]         = -hc[i] * (T[M - 1, i] - T_inf);

                        //radiation
                        T2_   = T[M - 1, i] / Math.Pow(System.Convert.ToDouble(e1 * F21), 0.25);
                        hr[i] = e1 * e2 * F21 * sigma * (Tc + T2_) * (Tc * Tc + T2_ * T2_);
                        qr[i] = -hr[i] * (T[M - 1, i] - T_inf);

                        //total
                        h_tot = hc[i] + hr[i];
                        if (opt1.Checked)
                        {
                            Bi = h_tot * dr / k;
                        }
                        if (opt2.Checked)
                        {
                            Bi = h_anl * dr / k;
                        }

                        //nodal equations
                        T[0, i + 1] = (1.0 - 4.0 * F) * T[0, i] + 4.0 * F * T[1, i];
                        for (int m = 1; m < M - 1; ++m)
                        {
                            T[m, i + 1] = F * (1.0 - 1.0 / 2.0 / (m + 1.0)) * T[m - 1, i] + F * (1.0 + 1.0 / 2.0 / (m + 1.0)) * T[m + 1, i] + (1.0 - 2.0 * F) * T[m, i];
                        }
                        T[M - 1, i + 1] = 2.0 * F * (1.0 - 1.0 / 2.0 / (M - 1.0)) * T[M - 2, i] + (1.0 + 2.0 * F * (1.0 / 2.0 / (M - 1.0) - 1.0 - Bi)) * T[M - 1, i] + 2.0 * F * Bi * T_inf;
                        double i_double = System.Convert.ToDouble(i);
                        progress        = (i_double * M_double + M_double) / (N_double * M_double - M_double) * 100.0;
                        b.ReportProgress((int)progress);
                    }
                }
                b.ReportProgress(100);
            });

            bw.ProgressChanged += new ProgressChangedEventHandler(
                delegate(object o, ProgressChangedEventArgs args)
            {
                progressBar.Value = args.ProgressPercentage;
                if (cancel)
                {
                    mallocerr.Close();
                    mallocerr = new Form6();
                    mallocerr.Show();
                }
            });

            bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(
                delegate(object o, RunWorkerCompletedEventArgs args)
            {
                button1.Enabled = true;
                if (!cancel)
                {
                    pictureBox1.Enabled = true;
                    button4.Enabled     = true;
                    //find solution
                    int opt_n = 0;
                    while ((opt_n < N - 1) && (T[0, opt_n] < T_center + 273))
                    {
                        opt_n++;
                    }
                    if (opt_n < N - 1)
                    {
                        result.Text = String.Format("Optimal cooking duration: \n{0:0.##} minutes", System.Convert.ToDouble(opt_n) * dt / 60.0);
                        if (T[M - 1, opt_n] > T_surface + 273)
                        {
                            comment.Text = String.Format("Warning -- Burnt surface!\nSurface temperature: \n{0:0.##} °C", T[M - 1, opt_n] - 273.0);
                        }
                    }
                    else
                    {
                        comment.Text = "Undercooked -- Try \nincreasing t_tot :)";
                    }
                    pictureBox1.Enabled = true;
                    //plot1
                    chart1.ChartAreas["ChartArea1"].AxisX.Maximum  = r0 * 100.0;
                    chart1.ChartAreas["ChartArea1"].AxisX.Interval = r0 * 20.0;
                    chart1.ChartAreas["ChartArea1"].AxisY.Maximum  = 110.0;
                    chart1.ChartAreas["ChartArea1"].AxisY.Interval = 10.0;
                    numericUpDown1.Value     = 0;
                    numericUpDown1.Increment = System.Convert.ToDecimal((N - 1) / 50 * dt);
                    numericUpDown1.Maximum   = System.Convert.ToDecimal(t_total);
                    makePlot1(T);
                    numericUpDown1.Enabled = true;

                    //plot2
                    chart2.ChartAreas["ChartArea1"].AxisX.Maximum  = t_total;
                    chart2.ChartAreas["ChartArea1"].AxisX.Interval = t_total / 5.0;
                    chart2.ChartAreas["ChartArea1"].AxisY.Maximum  = 110.0;
                    chart2.ChartAreas["ChartArea1"].AxisY.Interval = 10.0;
                    numericUpDown2.Value     = 0;
                    numericUpDown2.Increment = System.Convert.ToDecimal((M - 1) / 50 * dr * 100);
                    numericUpDown2.Maximum   = System.Convert.ToDecimal(r0 * 100);
                    makePlot2(T);
                    numericUpDown2.Enabled = true;
                }
            });
        }
예제 #5
0
        public void Afisare_Forma(string Text_Forma, Form frn, string Close_or_Hide)
        {
            Form f = new Form();

            switch (Text_Forma)
            {
            case "MENIU": f = new Form1(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "LECTII": f = new Form2(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "CONGRUENTA INTRODUCERE1":
                f = new Form3(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "CONGRUENTA INTRODUCERE2":
                f = new Form4(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "CONGRUENTA INTRODUCERE3":
                f = new Form5(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "CONGRUENTA CAZURI1":
                f = new Form6(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "CONGRUENTA CAZURI2":
                f = new Form7(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "CONGRUENTA CAZURI3":
                f = new Form8(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "CONGRUENTA CAZURI4":
                f = new Form9(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "CONGRUENTA CAZURI5":
                f = new Form10(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "CONGRUENTA CAZURI6":
                f = new Form11(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "CONGRUENTA DREPTUNGHICE":
                f = new Form12(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "TESTE":
                f = new Form16(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "TEST USOR":
                f = new Test_Usor_Pagina_1(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "TEST MEDIU":
                f = new Test_Mediu(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "TEST GREU":
                f = new Test_Greu(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;
            }
        }
        private void chk_Tick(object sender, EventArgs e) //判斷終點
        {
            if (pictureBox1.Location.X > 1200)            //怪物1到達終點
            {
                m1.Enabled  = false;
                tmr.Enabled = false;
                if (sp > sp2 && sp > sp3 && sp > sp4)
                {
                    result_rank = sp;
                }
                if (Form5.mon == 1)
                {
                    if (sp > sp2 && sp > sp3 && sp > sp4)
                    {
                        player_rank = sp;
                    }
                    else
                    {
                        get_money    = 0;
                        Form1.money += get_money;
                    }
                }
            }

            if (pictureBox2.Location.X > 1200) //怪物2到達終點
            {
                m2.Enabled   = false;
                tmr2.Enabled = false;
                if (sp2 > sp && sp2 > sp3 && sp2 > sp4)
                {
                    result_rank = sp2;
                }
                if (Form5.mon == 2)
                {
                    if (sp2 > sp && sp2 > sp3 && sp2 > sp4)
                    {
                        player_rank = sp2;
                    }
                    else
                    {
                        get_money    = 0;
                        Form1.money += get_money;
                    }
                }
            }

            if (pictureBox3.Location.X > 1200) //怪物3到達終點
            {
                m3.Enabled   = false;
                tmr3.Enabled = false;
                if (sp3 > sp && sp3 > sp2 && sp3 > sp4)
                {
                    result_rank = sp3;
                }
                if (Form5.mon == 3)
                {
                    if (sp3 > sp && sp3 > sp2 && sp3 > sp4)
                    {
                        player_rank = sp3;
                    }
                    else
                    {
                        get_money    = 0;
                        Form1.money += get_money;
                    }
                }
            }

            if (pictureBox4.Location.X > 1200) //怪物4到達終點
            {
                m4.Enabled   = false;
                tmr4.Enabled = false;
                if (sp4 > sp && sp4 > sp2 && sp4 > sp3) //電腦判斷SP4第一
                {
                    result_rank = sp4;
                }
                if (Form5.mon == 4)
                {
                    if (sp4 > sp && sp4 > sp2 && sp4 > sp3)
                    {
                        player_rank = sp4;
                    }
                    else
                    {
                        get_money    = 0;
                        Form1.money += get_money;
                    }
                }
            }

            //當怪物1~4皆到達終點
            if (pictureBox1.Location.X > 1200 && pictureBox2.Location.X > 1200 && pictureBox3.Location.X > 1200 && pictureBox4.Location.X > 1200)
            {
                chk.Enabled     = false;
                button1.Enabled = true; //拉霸畫面按鈕啟用
                Form6 fm6 = new Form6();
                fm6.Show();
            }
        }
예제 #7
0
        private void button10_Click(object sender, EventArgs e)         //“调度命令查询”按钮
        {
            Form6 form6 = new Form6();

            form6.Show();
        }
예제 #8
0
 private void button1_Click(object sender, EventArgs e)
 {
     this.Visible = false;
     Form6 connectionMode = new Form6();
     connectionMode.Show();
 }
예제 #9
0
        private void button8_Click(object sender, EventArgs e)
        {
            Form6 f6 = new Form6();

            f6.Show(); this.Hide();
        }
예제 #10
0
        private void button3_Click(object sender, EventArgs e)
        {
            Form6 a = new Form6();

            a.Show(this);
        }
예제 #11
0
        private void button5_Click(object sender, EventArgs e)
        {
            Form6 form = new Form6(); //ดึง form มาใช้

            form.Show();              //แสดง from ที่ดึงมา
        }
예제 #12
0
파일: Form1.cs 프로젝트: jofeew/CRJR_703
 private void ordenDeTrabajoToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Form6 form6 = new Form6();
     form6.MdiParent = this;
     form6.Show();
 }