public void fillForm(Corbel corbel, LoadCase lc)
 {
     labelfckv.Text     = numToString(corbel.Fck, units.MPa, 1);
     labelgammacv.Text  = numToString(corbel.Gammac, units.none, 2);
     labelaccv.Text     = numToString(corbel.acc, units.none, 2);
     labelfcdv.Text     = numToString(corbel.Fcd, units.MPa, 1);
     labelgammasv.Text  = numToString(corbel.Gammas, units.none, 2);
     labelfykv.Text     = numToString(corbel.Fyk, units.MPa, 1);
     labelfydv.Text     = numToString(corbel.Fyd, units.MPa, 1);
     labelasv.Text      = numToString(corbel.SteelArea, units.mm2, 0);
     labelfcd1v.Text    = numToString(lc.fcd1, units.MPa, 1);
     labelx1v.Text      = numToString(lc.x1, units.mm, 0);
     labelcv.Text       = numToString(lc.c, units.mm, 0);
     labeldv.Text       = numToString(lc.d, units.mm, 0);
     labelh1v.Text      = numToString(lc.h1, units.mm, 0);
     labelmedsv.Text    = numToString(lc.M_Eds, units.kNm, 1);
     labela0v.Text      = numToString(lc.a0, units.mm, 0);
     labelzv.Text       = numToString(lc.z, units.mm, 0);
     labela4v.Text      = numToString(lc.a4, units.mm, 0);
     labelfc0v.Text     = numToString(lc.Fc0, units.kN, 1);
     labelsigmac0v.Text = numToString(lc.sigmac0, units.MPa, 1);
     labelkac1v.Text    = numToString(lc.KA_c1, units.none, 2);
     labelanglev.Text   = numToString(lc.angle, units.none, 1);
     labelfcv.Text      = numToString(lc.Fc, units.kN, 1);
     labelfcd2v.Text    = numToString(lc.fcd2, units.MPa, 1);
     labelsigmac5v.Text = numToString(lc.sigmac5, units.MPa, 1);
     labelkac2v.Text    = numToString(lc.KA_c2, units.none, 2);
     labeluv.Text       = numToString(lc.u, units.mm, 1);
     labela2v.Text      = numToString(lc.a2, units.mm, 0);
     labelsigmac4v.Text = numToString(lc.sigmac4, units.MPa, 1);
     labelkac3v.Text    = numToString(lc.KA_c3, units.none, 2);
     labelftv.Text      = numToString(lc.F_t, units.kN, 1);
     labelkacv.Text     = numToString(lc.KA_c, units.none, 2);
     labelasvaadv.Text  = numToString(lc.A_svaad, units.mm2, 0);
     labelkasv.Text     = numToString(lc.KA_s, units.none, 2);
 }
Esempio n. 2
0
        //Checks through all the load cases. Did some of the values in the datagridview change to different
        //value compared to the value in the current corbel. If did, then make the changes into the current corbel
        //and update the chart
        private void checkAllLoadCases()
        {
            for (int i = 0; i < dataGridViewLoadcases.Rows.Count; i++)
            {
                if (currentCorbel != null)
                {
                    if (currentCorbel.loadCases.Find(e => e.Name == (i + 1).ToString()) != null)
                    {
                        LoadCase lcModify = currentCorbel.loadCases.Find(e => e.Name == (i + 1).ToString());


                        if (chartStrength.Series.IndexOf((i + 1).ToString()) == -1)
                        {
                            createNewPointChart((i + 1).ToString());
                            chartStrength.Series[(i + 1).ToString()].Points.Clear();
                            chartStrength.Series[(i + 1).ToString()].Points.AddXY(lcModify.H_Ed * 0.001,
                                                                                  lcModify.F_Ed * 0.001);
                        }

                        //If the loadcase excists change loadcase values and chart values
                        if (((string)dataGridViewLoadcases.Rows[i].Cells[1].Value != null &&
                             (string)dataGridViewLoadcases.Rows[i].Cells[2].Value != null))
                        {
                            if ((lcModify.F_Ed * 0.001).ToString() != (string)dataGridViewLoadcases.Rows[i].Cells[1].Value ||
                                (lcModify.H_Ed * 0.001).ToString() != (string)dataGridViewLoadcases.Rows[i].Cells[2].Value)
                            {
                                lcModify.F_Ed = convertToDouble((string)dataGridViewLoadcases.Rows[i].Cells[1].Value) * 1000;
                                lcModify.H_Ed = convertToDouble((string)dataGridViewLoadcases.Rows[i].Cells[2].Value) * 1000;
                                dataGridViewLoadcases.Rows[i].Cells[3].Value = lcModify.KA_max;

                                chartStrength.Series[(i + 1).ToString()].Points.Clear();
                                chartStrength.Series[(i + 1).ToString()].Points.AddXY(lcModify.H_Ed * 0.001,
                                                                                      lcModify.F_Ed * 0.001);
                            }
                        }
                        else
                        {
                            chartStrength.Series.Remove(chartStrength.Series.FindByName((i + 1).ToString()));
                        }
                    }

                    //else create new loadcase and add it to the chart
                    else
                    {
                        if ((string)dataGridViewLoadcases.Rows[i].Cells[1].Value != null &&
                            (string)dataGridViewLoadcases.Rows[i].Cells[2].Value != null)
                        {
                            currentCorbel.loadCases.Add(new LoadCase(
                                                            convertToDouble((string)dataGridViewLoadcases.Rows[i].Cells[1].Value) * 1000,
                                                            convertToDouble((string)dataGridViewLoadcases.Rows[i].Cells[1].Value) * 1000,
                                                            currentCorbel, (i + 1).ToString()));

                            createNewPointChart((i + 1).ToString());

                            chartStrength.Series[(i + 1).ToString()].Points.AddXY(currentCorbel.loadCases[i].H_Ed * 0.001,
                                                                                  currentCorbel.loadCases[i].F_Ed * 0.001);
                            dataGridViewLoadcases.Rows[i].Cells[3].Value = currentCorbel.loadCases[i].KA_max;
                        }
                    }
                }
            }
        }