Example #1
0
        // Culcボタン
        private void button4_Click(object sender, EventArgs e)
        {
            //SortedWingSectionsはdataGridView1_validCellで定義
            Airfoils Airfoilstest = new Airfoils();

            //if (SortedWingSections.Count > 2)
            //{
            Airfoilstest.Transration(ref SelectedProp, SortedWingSections);
            //}
            //Props.Add(new Prop());
            SelectedProp.Name      = textBox1.Text;
            SelectedProp.Blade     = (double)numericUpDown1.Value;
            SelectedProp.Uinf      = (double)numericUpDown2.Value;
            SelectedProp.Rpm       = (double)numericUpDown3.Value;
            SelectedProp.Radius    = (double)numericUpDown4.Value;
            SelectedProp.Radius_in = (double)numericUpDown5.Value;
            //SelectedProp.Lambda = (double)numericUpDown5.Value;
            SelectedProp.Power = (double)numericUpDown6.Value;
            SelectedProp.Rho   = (double)numericUpDown7.Value;
            SelectedProp.Nu    = (double)numericUpDown8.Value;

            //半径より内側半径が大きい時はエラー
            if (SelectedProp.Radius <= SelectedProp.Radius_in)
            {
                MessageBox.Show("Radius must be larger than Radius_INNER", "Error",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            SelectedProp.Show = true;

            if (radioButton1.Checked == true)   //Harada
            {
                button4.Text    = "Now Calcurating...";
                button4.Enabled = false;
                backgroundWorker1.RunWorkerAsync();
            }
            if (radioButton2.Checked == true)   //Larrabee
            {
                SelectedProp.CulcLarrabee();
                label13.Text = SelectedProp.T_.ToString("F2") + "[N]";
                label14.Text = SelectedProp.P_.ToString("F2") + "[W]";
                label15.Text = SelectedProp.Efficiency.ToString("F2") + "%";

                //ShowPlot(SelectedProp);
                ShowPlot2();
            }
            if (radioButton3.Checked == true)   //BEM
            {
                SelectedProp.CulcBEM();
                label13.Text = SelectedProp.T_.ToString("F2") + "[N]";
                label14.Text = SelectedProp.P_.ToString("F2") + "[W]";
                label15.Text = SelectedProp.Efficiency.ToString("F2") + "%";

                ShowPlot2();
            }
            updata_dataGridView2();
            PlotDetect();
        }
Example #2
0
        public MainForm()
        {
            InitializeComponent();
            InitializedataGridView1();
            InitializedataGridView2();
            InitializePlot();

            //TEST
            Airfoils           Airfoilstest = new Airfoils();
            List <WingSection> WingSection1 = new List <WingSection>();

            //List<Airfoil> Airfoil2 = new List<Airfoil>();
            WingSection1.Add(new WingSection(0.0)); WingSection1.Add(new WingSection(1.0));
            //Prop Proptest = Airfoilstest.Transration(WingSection1);
        }