Ejemplo n.º 1
0
        private void button4_Click(object sender, EventArgs e)
        {
            label16.Visible             = false; bodyPartsComboBox3.Visible = false;
            createWeb.Visible           = false; material.Visible = false;
            groupBox5.Visible           = false;
            researchBodyButton3.Visible = true; startResearch.Visible = false; deleteResearch3.Visible = false;

            research.deleteStudy(); research = null;
        }
Ejemplo n.º 2
0
        private void button8_Click(object sender, EventArgs e)
        {
            startResearch4.Visible = true; deleteResearch4.Visible = false;
            diagramButton.Visible  = false;
            logTextBox4.Clear();

            if (researchLoop != null)
            {
                researchLoop.deleteStudy(); researchLoop = null;
            }
            cellsDrawer.deleteCells();
            checkBox1.Checked = false;
        }
Ejemplo n.º 3
0
        private void researchBodyButton3_Click(object sender, EventArgs e)
        {
            label16.Visible             = true; bodyPartsComboBox3.Visible = true;
            createWeb.Visible           = true; material.Visible = true;
            groupBox5.Visible           = true;
            researchBodyButton3.Visible = false; startResearch.Visible = true; deleteResearch3.Visible = true;

            research = new Research(application, body.GetFaces());
            research.CreateStudy();
            bodyPartsComboBox3.Items.Clear();

            for (int i = 0; i < body.GetFaces().Length; i++)
            {
                bodyPartsComboBox3.Items.Add(String.Join(", ", body.GetFaces().GetValue(i).ToString()));
            }
        }
Ejemplo n.º 4
0
        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox1.Checked)
            {
                groupBox6.Visible = true;
                researchLoop      = new Research(application, bodyDrawer.GetFacesArray());

                bodyPartsComboBox4.Items.Clear();

                for (int i = 0; i < bodyDrawer.GetFacesArray().Length; i++)
                {
                    bodyPartsComboBox4.Items.Add(String.Join(", ", bodyDrawer.GetFacesArray().GetValue(i).ToString()));
                }

                action = new List <object[]>();
            }
            else
            {
                groupBox6.Visible = false;
                researchLoop      = null;
                action            = null;
            }
        }
Ejemplo n.º 5
0
        private void button6_Click(object sender, EventArgs e)
        {
            startResearch4.Visible = false; deleteResearch4.Visible = true;
            diagramButton.Visible  = true;

            dataStress       = null;  dataStress = new List <object[]>();
            dataDisplacement = null; dataDisplacement = new List <object[]>();

            if (!loopRadioButton2.Checked)
            {
                MessageBox.Show("Для циклического исследования необходимо выбрать \"Циклическое построение\"" +
                                " в разделе \"Вычисление и конструирование\"");
                return;
            }

            // подготовка объекта cells
            preparationCalculation(accuracyTextBox2, iterationTextBox2, multiplierRadioButton2,
                                   multiplierTextBox2, denominatorTextBox2);

            cellsDrawer = new CellsDrawer(application, body, bodyDrawer);

            int start, end, step;

            start = Convert.ToInt16(iterationTextBox2.Text); end = Convert.ToInt16(rowTextBox2.Text);
            //Проверка шага
            if (columnTextBox2.Text == "" || columnTextBox2.Text == "0" || Convert.ToInt16(columnTextBox2.Text) < 0)
            { //шаг по умолчанию ( 1 )
                step = 1;
            }
            else
            { //заданный шаг
                step = Convert.ToInt16(columnTextBox2.Text);
            }

            for (int i = start; i <= end; i = i + step)
            {
                //рисуем ячейки
                cells.SetIterationNumber(i); cells.KCalculation();
                cellsDrawer.SetCells(cells); cellsDrawer.drawCells();

                //создаём исследование
                researchLoop = new Research(application, bodyDrawer.GetFacesArray());
                researchLoop.CreateStudy();

                //прикладываем силы или фиксируем грани
                foreach (object[] act in action)
                {
                    if (act[0].Equals("fix"))
                    {
                        researchLoop.BodyParts_Select((int)act[1]);
                        researchLoop.FixFace();
                    }
                    else if (act[0].Equals("force"))
                    {
                        researchLoop.BodyParts_Select((int)act[1]);
                        researchLoop.CreateLoad((double)act[2]);
                    }
                }

                researchLoop.CreateMesh(); researchLoop.MaterialSet();
                researchLoop.RunAnalysis();

                double stress = researchLoop.GetStress(), displacement = researchLoop.GetDisplacement();

                object[] buff1 = new object[2]; //[кол-во ячеек, напряжение]
                buff1[0] = Math.Pow(2, i); buff1[1] = stress;
                dataStress.Add(buff1);

                object[] buff2 = new object[2]; //[кол-во ячеек, перемещение]
                buff2[0] = Math.Pow(2, i); buff2[1] = displacement;
                dataDisplacement.Add(buff2);

                //
                //
                //
                //
                //
                //Create ResearchResult AND Add in DataBase
                ResearchResult researchResult = new ResearchResult(detail.Id, logTextBox4.Text, i, stress, displacement);
                data.AddNewResearchResultAndUpdateDetails(researchResult);
                //Create ResearchResult AND Add in DataBase
                //
                //
                //
                //
                //


                logTextBox4.Text += Environment.NewLine;
                logTextBox4.Text += "Итерация: " + i.ToString(); logTextBox4.Text += Environment.NewLine;
                logTextBox4.Text += "Напряжение(ksi): " + stress.ToString(); logTextBox4.Text += Environment.NewLine;
                logTextBox4.Text += "Смещение(mk): " + displacement.ToString(); logTextBox4.Text += Environment.NewLine;

                // задержка
                Thread.Sleep(2500);

                // Очищаем
                researchLoop.deleteStudy(); researchLoop = null;
                application.swModel.ClearSelection2(true);

                if (i != end)
                {
                    cellsDrawer.deleteCells();
                }
            }
        }