Пример #1
0
        private void frmJoints_Load(object sender, EventArgs e)
        {
            if (ASTRA_Data.Count > 0)
            {
                string kStr = ASTRA_Data[0];


                MyStrings mlist = new MyStrings(MyStrings.RemoveAllSpaces(kStr), ' ');


                int r = MyStrings.StringToInt(kStr, -1);
                if (r == -1)
                {
                    r = DGV.CurrentCell.RowIndex;
                    btn_jnt_add.Text      = "Insert";
                    txt_jnt_start_no.Text = DGV[0, r].Value.ToString();
                }
                else
                {
                    txt_jnt_start_no.Text = DGV[0, r].Value.ToString();
                    txt_jnt_start_x.Text  = DGV[1, r].Value.ToString();
                    txt_jnt_start_y.Text  = DGV[2, r].Value.ToString();
                    txt_jnt_start_z.Text  = DGV[3, r].Value.ToString();
                    btn_jnt_add.Text      = "Change";
                }
            }
            else
            {
                txt_jnt_start_no.Text = DGV.RowCount + 1 + "";

                txt_jnt_start_x.Text = "0.0";
                txt_jnt_start_y.Text = "0.0";
                txt_jnt_start_z.Text = "0.0";
            }
        }
Пример #2
0
        private void frmTempLoad_Load(object sender, EventArgs e)
        {
            if (ASTRA_Data.Count > 0)
            {
                string kStr = ASTRA_Data[0];

                MyStrings mlist = new MyStrings(MyStrings.RemoveAllSpaces(kStr), ' ');

                int r = -1;
                for (int i = 0; i < mlist.Count; i++)
                {
                    if (r == -1)
                    {
                        if (mlist.StringList[i] == "TEMP")
                        {
                            r = i;
                            txt_joint_number.Text = mlist.GetString(0, r - 1);
                            txt_init_temp.Text    = mlist.StringList[i + 1];
                            if (mlist.Count > (i + 2))
                            {
                                txt_final_temp.Text = mlist.StringList[i + 2];
                            }
                        }
                    }
                }

                btn_jload_add.Text = "Change";
                ASTRA_Data.Clear();
            }
            else
            {
                txt_joint_number.Text = iACad.GetSelectedJointsInText();
            }
        }
Пример #3
0
        private void frmElementLoad_Load(object sender, EventArgs e)
        {
            if (ASTRA_Data.Count > 0)
            {
                string kStr = ASTRA_Data[0];

                MyStrings mlist = new MyStrings(MyStrings.RemoveAllSpaces(kStr), ' ');

                int r = -1;
                for (int i = 0; i < mlist.Count; i++)
                {
                    if (r == -1)
                    {
                        if (mlist.StringList[i] == "PRESSURE")
                        {
                            r                  = i;
                            txt_mnos.Text      = mlist.GetString(0, r - 1);
                            txt_aload_val.Text = mlist.StringList[i + 1];
                        }
                    }
                }


                btn_aload_add.Text = "Change";
                ASTRA_Data.Clear();
            }
            else
            {
                //txt_mnos.Text = iACad.GetSelectedMembersInText();
            }
        }
Пример #4
0
        public static SurveyData Parse(string line)
        {
            string     kStr  = MyStrings.RemoveAllSpaces(line.Replace(",", " "));
            MyStrings  mlist = new MyStrings(kStr, ' ');
            SurveyData sdata = new SurveyData();

            if (mlist.Count == 5)
            {
                sdata.SerialNo    = mlist.GetInt(0);
                sdata.X           = mlist.GetDouble(1);
                sdata.Y           = mlist.GetDouble(2);
                sdata.Z           = mlist.GetDouble(3);
                sdata.FeatureCode = mlist.StringList[4];
            }
            else if (mlist.Count == 4)
            {
                sdata.SerialNo    = mlist.GetInt(0);
                sdata.X           = mlist.GetDouble(1);
                sdata.Y           = mlist.GetDouble(2);
                sdata.Z           = mlist.GetDouble(3);
                sdata.FeatureCode = "OGL";
            }
            else if (mlist.Count == 3)
            {
                //sdata.SerialNo = mlist.GetInt(0);
                sdata.X           = mlist.GetDouble(0);
                sdata.Y           = mlist.GetDouble(1);
                sdata.Z           = mlist.GetDouble(2);
                sdata.FeatureCode = "P0";
            }
            return(sdata);
        }
Пример #5
0
        public static LoadData Parse(string txt)
        {
            //TYPE 2 -48.750 0 0.500 XINC 0.2

            txt = txt.ToUpper().Replace("TYPE", "");
            txt = txt.Replace(",", " ");
            txt = MyStrings.RemoveAllSpaces(txt);
            MyStrings mlist = new MyStrings(txt, ' ');
            LoadData  ld    = new LoadData();

            ld.TypeNo = "TYPE " + mlist.GetInt(0);
            ld.X      = mlist.GetDouble(1);
            ld.Y      = mlist.GetDouble(2);
            ld.Z      = mlist.GetDouble(3);

            if (mlist.StringList[4] == "XINC")
            {
                ld.XINC = mlist.GetDouble(5);
            }
            if (mlist.StringList[4] == "YINC")
            {
                ld.YINC = mlist.GetDouble(5);
            }
            if (mlist.StringList[4] == "ZINC")
            {
                ld.ZINC = mlist.GetDouble(5);
            }

            return(ld);
        }
Пример #6
0
        private void frmSupportDisplacements_Load(object sender, EventArgs e)
        {
            if (ASTRA_Data.Count > 0)
            {
                string kStr = ASTRA_Data[0];

                MyStrings mlist = new MyStrings(MyStrings.RemoveAllSpaces(kStr), ' ');

                int r = -1;
                for (int i = 0; i < mlist.Count; i++)
                {
                    if (r == -1)
                    {
                        if (mlist.StringList[i] == "FX" || mlist.StringList[i] == "FY" || mlist.StringList[i] == "FZ" ||
                            mlist.StringList[i] == "MX" || mlist.StringList[i] == "MY" || mlist.StringList[i] == "MZ")
                        {
                            r = i;
                        }
                    }

                    if (mlist.StringList[i] == "FX")
                    {
                        txt_fx.Text = mlist.StringList[i + 1];
                    }
                    else if (mlist.StringList[i] == "FY")
                    {
                        txt_fy.Text = mlist.StringList[i + 1];
                    }
                    else if (mlist.StringList[i] == "FZ")
                    {
                        txt_fz.Text = mlist.StringList[i + 1];
                    }
                    else if (mlist.StringList[i] == "MX")
                    {
                        txt_mx.Text = mlist.StringList[i + 1];
                    }
                    else if (mlist.StringList[i] == "MY")
                    {
                        txt_my.Text = mlist.StringList[i + 1];
                    }
                    else if (mlist.StringList[i] == "MZ")
                    {
                        txt_mz.Text = mlist.StringList[i + 1];
                    }
                }

                if (r != -1)
                {
                    txt_joint_number.Text = mlist.GetString(0, r - 1);
                }
                btn_jload_add.Text = "Change";
                ASTRA_Data.Clear();
            }
            else
            {
                txt_joint_number.Text = iACad.GetSelectedJointsInText();
            }
        }
Пример #7
0
        public void SetPostProcessForMovingLoad()
        {
            string memberForceFile = Path.GetDirectoryName(astDoc.FileName);

            memberForceFile = Path.Combine(memberForceFile, "Memberforce.FIL");

            if (!File.Exists(memberForceFile))
            {
                return;
            }

            List <string> lstStr = new List <string>(File.ReadAllLines(memberForceFile));


            // MemberForce.FIL
            // 0    1       2       3       4       5       6       7       8
            //MNO  LDCS     Node    R1      R2      R3      M1      M2      M3
            //  1   1        1       0.000   0.000   1.016   -0.157  -0.025  0.000
            //               2       0.000   0.000  -1.016    0.157  -1.029  0.000

            MyStrings       mList = null;
            BeamForceMoment bfm   = null;

            for (int i = 0; i < lstStr.Count; i++)
            {
                mList = new MyStrings(MyStrings.RemoveAllSpaces(lstStr[i]), ' ');
                if (mList.Count == 9)
                {
                    bfm = new BeamForceMoment();
                    bfm.Member.MemberNo     = mList.GetInt(0);
                    bfm.LoadCase            = mList.GetInt(1);
                    bfm.StartForceMoment.R1 = mList.GetDouble(3);
                    bfm.StartForceMoment.R2 = mList.GetDouble(4);
                    bfm.StartForceMoment.R3 = mList.GetDouble(5);
                    bfm.StartForceMoment.M1 = mList.GetDouble(6);
                    bfm.StartForceMoment.M2 = mList.GetDouble(7);
                    bfm.StartForceMoment.M3 = mList.GetDouble(8);
                }
                else if (mList.Count == 7)
                {
                    //bfm = new BeamForceMoment();
                    //bfm.Member.MemberNo = mList.GetInt(0);
                    //bfm.LoadCase = mList.GetInt(1);
                    bfm.EndForceMoment.R1 = mList.GetDouble(1);
                    bfm.EndForceMoment.R2 = mList.GetDouble(2);
                    bfm.EndForceMoment.R3 = mList.GetDouble(3);
                    bfm.EndForceMoment.M1 = mList.GetDouble(4);
                    bfm.EndForceMoment.M2 = mList.GetDouble(5);
                    bfm.EndForceMoment.M3 = mList.GetDouble(6);
                    beamMomentCol.Add(bfm);
                }
            }
        }
Пример #8
0
        void SetGrid()
        {
            kStr = iACad.GetSelectedJointsInText();

            if (kStr == "")
            {
                kStr = "ALL";
            }
            MyStrings mList = null;

            if (kStr == "ALL")
            {
                for (int i = 0; i < iACad.AstraDocument.Joints.Count; i++)
                {
                    dgvNodeGrid.Rows.Add(iACad.AstraDocument.Joints[i].NodeNo,
                                         iACad.AstraDocument.Joints[i].Point.x,
                                         iACad.AstraDocument.Joints[i].Point.y,
                                         iACad.AstraDocument.Joints[i].Point.z, "");
                }
            }
            else if (kStr.Contains("TO"))
            {
                mList = new MyStrings(MyStrings.RemoveAllSpaces(kStr), ' ');
                int indx = -1;
                for (int i = mList.GetInt(0); i <= mList.GetInt(2); i++)
                {
                    indx = iACad.AstraDocument.Joints.IndexOf(i);

                    dgvNodeGrid.Rows.Add(iACad.AstraDocument.Joints[indx].NodeNo,
                                         iACad.AstraDocument.Joints[indx].Point.x,
                                         iACad.AstraDocument.Joints[indx].Point.y,
                                         iACad.AstraDocument.Joints[indx].Point.z, "");
                }
            }
            else
            {
                //kStr =
                mList = new MyStrings(MyStrings.RemoveAllSpaces(kStr), ',');
                int indx = -1;
                for (int i = 0; i < mList.Count; i++)
                {
                    indx = iACad.AstraDocument.Joints.IndexOf(mList.GetInt(i));
                    dgvNodeGrid.Rows.Add(iACad.AstraDocument.Joints[indx].NodeNo,
                                         iACad.AstraDocument.Joints[indx].Point.x,
                                         iACad.AstraDocument.Joints[indx].Point.y,
                                         iACad.AstraDocument.Joints[indx].Point.z, "");
                }
            }
        }
Пример #9
0
        void FillGrid()
        {
            //StreamReader sr = new StreamReader(new FileStream(txt_select_file.Text, FileMode.Open));
            List <string> list_con = new List <string>(File.ReadAllLines(txt_select_file.Text));
            string        kStr     = "";
            MyStrings     mlist    = null;

            try
            {
                dataGridView2.Rows.Clear();
                lbl_moredata.Visible = true;
                for (int i = 0; i < 20; i++)
                {
                    kStr = list_con[i];

                    kStr = MyStrings.RemoveAllSpaces(kStr).Replace(",", " ");

                    mlist = new MyStrings(kStr, ' ');

                    dataGridView2.Rows.Add(mlist.StringList.ToArray());
                    if (i == 0)
                    {
                        int indx = mlist.StringList.IndexOf("Serial");
                        try
                        {
                            //dataGridView1[0, indx].Value = "Point Nos.";
                            //indx = mlist.StringList.IndexOf("Easting");
                            //dataGridView1[1, indx].Value = "X";
                            //indx = mlist.StringList.IndexOf("Northing");
                            //dataGridView1[2, indx].Value = "Y";
                            //indx = mlist.StringList.IndexOf("Elevation");
                            //dataGridView1[3, indx].Value = "Z";
                            //indx = mlist.StringList.IndexOf("Feature");
                            //dataGridView1[4, indx].Value = "Label";

                            dataGridView1.Rows.Add("Point Nos.", "X", "Y", "Z", "Label");
                        }
                        catch (Exception ex) { }
                    }
                }
            }
            catch (Exception ex) { }
            finally
            {
                lbl_moredata.Visible = (list_con.Count > 20);
                list_con.Clear();
                list_con = null;
            }
        }
Пример #10
0
        private void frmElements_Load(object sender, EventArgs e)
        {
            if (ASTRA_Data.Count > 0)
            {
                string kStr = ASTRA_Data[0];


                MyStrings mlist = new MyStrings(MyStrings.RemoveAllSpaces(kStr), ' ');


                int r = MyStrings.StringToInt(kStr, -1);
                if (r == -1)
                {
                    r = DGV.CurrentCell.RowIndex;
                    btn_elmt_add.Text = "Insert";
                    txt_elmt_no.Text  = DGV[0, r].Value.ToString();
                }
                else
                {
                    txt_elmt_no.Text    = DGV[0, r].Value.ToString();
                    txt_elmt_node1.Text = DGV[1, r].Value.ToString();
                    txt_elmt_node2.Text = DGV[2, r].Value.ToString();
                    txt_elmt_node3.Text = DGV[3, r].Value.ToString();
                    txt_elmt_node4.Text = DGV[4, r].Value.ToString();
                    btn_elmt_add.Text   = "Change";
                }
            }
            else
            {
                txt_elmt_no.Text = DGV.RowCount + 1 + "";

                List <int> joints = MyStrings.Get_Array_Intiger(iACad.GetSelectedJointsInText());

                if (joints.Count > 3)
                {
                    txt_elmt_node1.Text = joints[0].ToString();
                    txt_elmt_node2.Text = joints[1].ToString();
                    txt_elmt_node3.Text = joints[2].ToString();
                    txt_elmt_node4.Text = joints[3].ToString();
                }

                //txt_elmt_node1.Text = "0";
                //txt_elmt_node2.Text = "0.0";
                //txt_jnt_start_z.Text = "0.0";
            }
        }
Пример #11
0
        private void frmJointWeight_Load(object sender, EventArgs e)
        {
            if (ASTRA_Data.Count > 0)
            {
                string kStr = ASTRA_Data[0];

                MyStrings mlist = new MyStrings(MyStrings.RemoveAllSpaces(kStr), ' ');

                int r = -1;
                for (int i = 0; i < mlist.Count; i++)
                {
                    if (r == -1)
                    {
                        if (mlist.StringList[i].StartsWith("WEI"))
                        {
                            r = i;
                        }
                    }
                    if (mlist.StringList[i].StartsWith("WEI"))
                    {
                        txt_fy.Text = mlist.StringList[i + 1];
                    }
                }

                if (r != -1)
                {
                    txt_joint_number.Text = mlist.GetString(0, r - 1);
                }
                btn_jload_add.Text = "Change";
                ASTRA_Data.Clear();

                this.Height       = 140;
                groupBox1.Visible = false;
            }
            else
            {
                txt_joint_number.Text = iACad.GetSelectedJointsInText();

                this.Height = 447;
            }
        }
Пример #12
0
        private void frmWindLoad_Load(object sender, EventArgs e)
        {
            if (ASTRA_Data.Count > 0)
            {
                string kStr = ASTRA_Data[0];

                MyStrings mlist = new MyStrings(MyStrings.RemoveAllSpaces(kStr), ' ');

                int r = -1;
                for (int i = 0; i < mlist.Count; i++)
                {
                    if (r == -1)
                    {
                        if (mlist.StringList[i] == "FX" || mlist.StringList[i] == "FY" || mlist.StringList[i] == "FZ" ||
                            mlist.StringList[i] == "MX" || mlist.StringList[i] == "MY" || mlist.StringList[i] == "MZ")
                        {
                            r = i;
                        }
                    }

                    if (mlist.StringList[i] == "FX")
                    {
                        rbtn_fx_positive.Checked = true;
                    }
                    else if (mlist.StringList[i] == "FZ")
                    {
                        rbtn_fz_positive.Checked = true;
                    }
                }

                //if (r != -1)
                //{
                //    txt_sc.Text = mlist.GetString(1, r - 1).Trim().TrimEnd().TrimStart();
                //}
                btn_add.Text = "Change";
                ASTRA_Data.Clear();
            }
            //else
            //    txt_joint_number.Text = iACad.GetSelectedJointsInText();
        }
Пример #13
0
        private void frmElementProp_Load(object sender, EventArgs e)
        {
            txt_DEN_val.Text = "";
            txt_EXX_val.Text = "";
            txt_EXY_val.Text = "";
            txt_EXG_val.Text = "";
            txt_EYY_val.Text = "";
            txt_EYG_val.Text = "";
            txt_GXY_val.Text = "";

            if (ASTRA_Data.Count > 0)
            {
                string kStr = ASTRA_Data[0].ToUpper();

                MyStrings mlist = new MyStrings(MyStrings.RemoveAllSpaces(kStr), ' ');

                int r = -1;
                for (int i = 0; i < mlist.Count; i++)
                {
                    if (r == -1)
                    {
                        if (mlist.StringList[i].StartsWith("TH"))
                        {
                            r                = i;
                            txt_mnos.Text    = mlist.GetString(0, r - 1);
                            txt_thk_val.Text = mlist.StringList[i + 1];
                        }
                    }
                    else
                    {
                        if (mlist.StringList[i].StartsWith("DEN"))
                        {
                            //1 TO 234 TH 0.07 DEN 0.0 EXX 3.00934E6  EXY 531061  EXG 0.0  EYY 3.00934E6  EYG 0.0  GXY 1.23913E6
                            //r = i;
                            //txt_mnos.Text = mlist.GetString(0, r - 1);
                            txt_DEN_val.Text = mlist.StringList[i + 1];
                        }
                        if (mlist.StringList[i].StartsWith("EXX"))
                        {
                            txt_EXX_val.Text = mlist.StringList[i + 1];
                        }
                        if (mlist.StringList[i].StartsWith("EXY"))
                        {
                            txt_EXY_val.Text = mlist.StringList[i + 1];
                        }
                        if (mlist.StringList[i].StartsWith("EXG"))
                        {
                            txt_EXG_val.Text = mlist.StringList[i + 1];
                        }
                        if (mlist.StringList[i].StartsWith("EYY"))
                        {
                            txt_EYY_val.Text = mlist.StringList[i + 1];
                        }
                        if (mlist.StringList[i].StartsWith("EYG"))
                        {
                            txt_EYG_val.Text = mlist.StringList[i + 1];
                        }
                        if (mlist.StringList[i].StartsWith("GXY"))
                        {
                            txt_GXY_val.Text = mlist.StringList[i + 1];
                        }
                    }
                }


                btn_aload_add.Text = "Change";
                //ASTRA_Data.Clear();
            }
            else
            {
                //txt_mnos.Text = iACad.GetSelectedE();
            }
        }
Пример #14
0
        private void frmSupport_Load(object sender, EventArgs e)
        {
            if (ASTRA_Data != "")
            {
                chk_fx.Checked = false;
                chk_mx.Checked = false;

                chk_fy.Checked = false;
                chk_my.Checked = false;

                chk_fz.Checked = false;
                chk_mz.Checked = false;


                MyStrings mlist = new MyStrings(MyStrings.RemoveAllSpaces(ASTRA_Data), ' ');

                string kStr = "";
                int    r    = -1;
                for (int i = 0; i < mlist.Count; i++)
                {
                    if (mlist.StringList[i].StartsWith("FIXED"))
                    {
                        r = i;

                        cmb_support_type.SelectedIndex = 0;
                    }
                    else if (mlist.StringList[i].StartsWith("PINNED"))
                    {
                        r = i;
                        cmb_support_type.SelectedIndex = 1;
                        //break;
                    }
                    else if (mlist.StringList[i].StartsWith("FX"))
                    {
                        chk_fx.Checked = true;
                    }
                    else if (mlist.StringList[i].StartsWith("FY"))
                    {
                        chk_fy.Checked = true;
                    }
                    else if (mlist.StringList[i].StartsWith("FZ"))
                    {
                        chk_fz.Checked = true;
                    }
                    else if (mlist.StringList[i].StartsWith("MX"))
                    {
                        chk_mx.Checked = true;
                    }
                    else if (mlist.StringList[i].StartsWith("MY"))
                    {
                        chk_my.Checked = true;
                    }
                    else if (mlist.StringList[i].StartsWith("MZ"))
                    {
                        chk_mz.Checked = true;
                    }
                    //Chiranjit [2014 10 13]
                    else if (mlist.StringList[i].StartsWith("KFX"))
                    {
                        rbtn_kFX.Checked = true;
                        txt_kVal.Text    = mlist.StringList[i + 1];
                    }
                    else if (mlist.StringList[i].StartsWith("KFY"))
                    {
                        rbtn_kFY.Checked = true;
                        txt_kVal.Text    = mlist.StringList[i + 1];
                    }
                    else if (mlist.StringList[i].StartsWith("KFZ"))
                    {
                        rbtn_kFZ.Checked = true;
                        txt_kVal.Text    = mlist.StringList[i + 1];
                    }
                }

                if (r != -1)
                {
                    txt_joint_nos.Text = mlist.GetString(0, r - 1).Trim();
                }
                btnAddData.Text = "Change";
            }
            else
            {
                cmb_support_type.SelectedIndex = 0;
                txt_joint_nos.Text             = iACad.GetSelectedJointsInText();
            }
        }
Пример #15
0
        public void Read_User_Input()
        {
            #region USER DATA INPUT DATA

            List <string> lst_content = new List <string>(File.ReadAllLines(user_input_file));
            string        kStr        = "";
            MyStrings     mList       = null;
            string        VarName     = "";

            int indx = -1;

            bool chk = false;
            try
            {
                for (int i = 0; i < lst_content.Count; i++)
                {
                    kStr    = MyStrings.RemoveAllSpaces(lst_content[i]);
                    mList   = new MyStrings(kStr, '=');
                    VarName = MyStrings.RemoveAllSpaces(mList.StringList[0]);

                    if (VarName.ToUpper() == "DISTANCE REDUCE_LEVEL")
                    {
                        VarName = "DISTANCE REDUCE_LEVEL";
                        dgvRiver.Rows.Clear();
                        chk = true;
                        continue;
                    }

                    if (chk)
                    {
                        VarName = "DISTANCE REDUCE_LEVEL";
                        mList   = new MyStrings(kStr, ' ');
                    }
                    #region SWITCH
                    switch (VarName)
                    {
                    case "HFL":
                        txt_HFL.Text = mList.StringList[1].Trim();
                        break;

                    case "LWL":
                        txt_LWL.Text = mList.StringList[1].Trim();
                        break;

                    case "LBL":
                        txt_LBL.Text = mList.StringList[1].Trim();
                        break;

                    case "SDO":
                        txt_SDO.Text = mList.StringList[1].Trim();
                        break;

                    case "V1":
                        txt_V1.Text = mList.StringList[1].Trim();
                        break;

                    case "S":
                        txt_S.Text = mList.StringList[1].Trim();
                        break;

                    case "n":
                        txt_n.Text = mList.StringList[1].Trim();
                        break;

                    case "F1":
                        txt_F1.Text = mList.StringList[1].Trim();
                        break;

                    case "L":
                        txt_L.Text = mList.StringList[1].Trim();
                        break;

                    case "Ksb":
                        txt_Ksb.Text = mList.StringList[1].Trim();
                        break;

                    case "F2":
                        txt_F2.Text = mList.StringList[1].Trim();
                        break;

                    case "DISTANCE REDUCE_LEVEL":
                        dgvRiver.Rows.Add(dgvRiver.Rows.Count + 1, mList.GetDouble(0), mList.GetDouble(1));
                        break;
                    }
                    #endregion
                }
            }
            catch (Exception ex)
            {
            }
            chk = false;
            Check_Grid();
            lst_content.Clear();
            #endregion
        }
Пример #16
0
        private void frmFloorLoad_Load(object sender, EventArgs e)
        {
            if (ASTRA_Data.Count > 0)
            {
                string kStr = ASTRA_Data[0];

                MyStrings mlist = new MyStrings(MyStrings.RemoveAllSpaces(kStr), ' ');

                int r = -1;
                for (int i = 0; i < mlist.Count; i++)
                {
                    if (i == 0)
                    {
                        if (mlist.StringList[i].StartsWith("XR") ||
                            mlist.StringList[i].StartsWith("XL"))
                        {
                            rbtn_XLimit.Checked = true;
                        }
                        if (mlist.StringList[i].StartsWith("YR") ||
                            mlist.StringList[i].StartsWith("YL"))
                        {
                            rbtn_YLimit.Checked = true;
                        }
                        if (mlist.StringList[i].StartsWith("ZR") ||
                            mlist.StringList[i].StartsWith("ZL"))
                        {
                            rbtn_ZLimit.Checked = true;
                        }
                    }
                    if (mlist.StringList[i].StartsWith("FL"))
                    {
                        txt_pressure.Text = mlist.StringList[++i];
                        chk_One.Checked   = false;
                    }

                    if (mlist.StringList[i].StartsWith("ON"))
                    {
                        txt_pressure.Text = mlist.StringList[++i];
                        chk_One.Checked   = true;
                    }
                    if (mlist.StringList[i].StartsWith("GX"))
                    {
                        rbtn_GX.Checked = true;
                    }
                    if (mlist.StringList[i].StartsWith("GY"))
                    {
                        rbtn_GY.Checked = true;
                    }
                    if (mlist.StringList[i].StartsWith("GZ"))
                    {
                        rbtn_GZ.Checked = true;
                    }

                    if (mlist.StringList[i].StartsWith("XR") ||
                        mlist.StringList[i].StartsWith("XL"))
                    {
                        //rbtn_XLimit.Checked = true;
                        txt_X_min.Text = mlist.StringList[++i];
                        txt_X_max.Text = mlist.StringList[++i];
                    }
                    else if (mlist.StringList[i].StartsWith("YR") ||
                             mlist.StringList[i].StartsWith("YL"))
                    {
                        //rbtn_YLimit.Checked = true;
                        txt_Y_min.Text = mlist.StringList[++i];
                        txt_Y_max.Text = mlist.StringList[++i];
                    }
                    else if (mlist.StringList[i].StartsWith("ZR") ||
                             mlist.StringList[i].StartsWith("ZL"))
                    {
                        //rbtn_ZLimit.Checked = true;
                        txt_Z_min.Text = mlist.StringList[++i];
                        txt_Z_max.Text = mlist.StringList[++i];
                    }
                }


                btn_fload_add.Text = "Change";
                ASTRA_Data.Clear();
            }
            else
            {
                //txt_mnos.Text = iACad.GetSelectedMembersInText();
            }
        }
Пример #17
0
        private void frmMemberLoad_Load(object sender, EventArgs e)
        {
            if (ASTRA_Data.Count > 0)
            {
                string kStr = ASTRA_Data[0];

                MyStrings mlist = new MyStrings(MyStrings.RemoveAllSpaces(kStr), ' ');

                int r = -1;

                bool Is_LINEAR = kStr.Contains("LIN");



                for (int i = 0; i < mlist.Count; i++)
                {
                    if (Is_LINEAR)
                    {
                        #region LINEAR Load
                        if (r == -1)
                        {
                            if (mlist.StringList[i] == "LIN")
                            {
                                r = i;
                            }
                        }
                        if (mlist.StringList[i] == "X")
                        {
                            cmb_lload_dir.SelectedItem = mlist.StringList[i];
                            txt_lload_start.Text       = mlist.StringList[i + 1];
                        }
                        else if (mlist.StringList[i] == "Y")
                        {
                            cmb_lload_dir.SelectedItem = mlist.StringList[i];
                            txt_lload_start.Text       = mlist.StringList[i + 1];
                        }
                        else if (mlist.StringList[i] == "Z")
                        {
                            cmb_lload_dir.SelectedItem = mlist.StringList[i];
                            txt_lload_start.Text       = mlist.StringList[i + 1];
                        }
                        else if (mlist.StringList[i] == "GX")
                        {
                            cmb_lload_dir.SelectedItem = mlist.StringList[i];
                            txt_lload_start.Text       = mlist.StringList[i + 1];
                        }
                        else if (mlist.StringList[i] == "GY")
                        {
                            cmb_lload_dir.SelectedItem = mlist.StringList[i];
                            txt_lload_start.Text       = mlist.StringList[i + 1];
                        }
                        else if (mlist.StringList[i] == "GX")
                        {
                            cmb_lload_dir.SelectedItem = mlist.StringList[i];
                            txt_lload_start.Text       = mlist.StringList[i + 1];
                        }


                        if (mlist.StringList[i] == "X" ||
                            mlist.StringList[i] == "Y" ||
                            mlist.StringList[i] == "Z" ||
                            mlist.StringList[i] == "GX" ||
                            mlist.StringList[i] == "GY" ||
                            mlist.StringList[i] == "GZ")
                        {
                            if (mlist.Count > (i + 2))
                            {
                                txt_lload_end.Text = mlist.StringList[i + 2];
                            }
                        }
                        #endregion LINEAR Load
                    }
                    else
                    {
                        #region Member Load
                        if (r == -1)
                        {
                            if (mlist.StringList[i] == "UNI" || mlist.StringList[i].StartsWith("CON") ||
                                mlist.StringList[i].StartsWith("UMOM") || mlist.StringList[i].StartsWith("CMOM"))
                            {
                                r = i;

                                cmb_mload_type.SelectedItem = mlist.StringList[i];
                                continue;
                            }
                        }
                        if (mlist.StringList[i] == "X")
                        {
                            cmb_mload_dir.SelectedItem = mlist.StringList[i];
                            txt_mload_val.Text         = mlist.StringList[i + 1];
                        }
                        else if (mlist.StringList[i] == "Y")
                        {
                            cmb_mload_dir.SelectedItem = mlist.StringList[i];
                            txt_mload_val.Text         = mlist.StringList[i + 1];
                        }
                        else if (mlist.StringList[i] == "Z")
                        {
                            cmb_mload_dir.SelectedItem = mlist.StringList[i];
                            txt_mload_val.Text         = mlist.StringList[i + 1];
                        }
                        else if (mlist.StringList[i] == "GX")
                        {
                            cmb_mload_dir.SelectedItem = mlist.StringList[i];
                            txt_mload_val.Text         = mlist.StringList[i + 1];
                        }
                        else if (mlist.StringList[i] == "GY")
                        {
                            cmb_mload_dir.SelectedItem = mlist.StringList[i];
                            txt_mload_val.Text         = mlist.StringList[i + 1];
                        }
                        else if (mlist.StringList[i] == "GX")
                        {
                            cmb_mload_dir.SelectedItem = mlist.StringList[i];
                            txt_mload_val.Text         = mlist.StringList[i + 1];
                        }
                        else if (mlist.StringList[i] == "PX")
                        {
                            cmb_mload_dir.SelectedItem = mlist.StringList[i];
                            txt_mload_val.Text         = mlist.StringList[i + 1];
                        }
                        else if (mlist.StringList[i] == "PY")
                        {
                            cmb_mload_dir.SelectedItem = mlist.StringList[i];
                            txt_mload_val.Text         = mlist.StringList[i + 1];
                        }
                        else if (mlist.StringList[i] == "PZ")
                        {
                            cmb_mload_dir.SelectedItem = mlist.StringList[i];
                            txt_mload_val.Text         = mlist.StringList[i + 1];
                        }

                        if (mlist.StringList[i] == "X" ||
                            mlist.StringList[i] == "Y" ||
                            mlist.StringList[i] == "Z" ||
                            mlist.StringList[i] == "PX" ||
                            mlist.StringList[i] == "PY" ||
                            mlist.StringList[i] == "PZ" ||
                            mlist.StringList[i] == "GX" ||
                            mlist.StringList[i] == "GY" ||
                            mlist.StringList[i] == "GZ")
                        {
                            if (mlist.Count > (i + 2))
                            {
                                txt_mload_d1.Text = mlist.StringList[i + 2];
                            }
                            if (mlist.Count > (i + 3))
                            {
                                txt_mload_d2.Text = mlist.StringList[i + 3];
                            }
                        }
                        #endregion Member Load
                    }
                }

                if (r != -1)
                {
                    if (Is_LINEAR)
                    {
                        txt_mnos_lin.Text       = mlist.GetString(0, r - 1);
                        btn_lload_add.Text      = "Change";
                        tabControl1.SelectedTab = tab_LIN;
                    }
                    else
                    {
                        txt_mnos_uni.Text  = mlist.GetString(0, r - 1);
                        btn_mload_add.Text = "Change";
                    }
                }
                ASTRA_Data.Clear();
            }
            else
            {
                txt_mnos_uni.Text = iACad.GetSelectedMembersInText();
                txt_mnos_lin.Text = iACad.GetSelectedMembersInText();

                cmb_lload_dir.SelectedIndex  = 1;
                cmb_mload_type.SelectedIndex = 0;
                cmb_mload_dir.SelectedIndex  = 4;
            }
        }
Пример #18
0
        void SetGrid()
        {
            kStr = iACad.GetSelectedMembersInText();

            if (kStr == "")
            {
                kStr = "ALL";
            }
            MyStrings mList = null;

            if (kStr == "ALL")
            {
                for (int i = 0; i < iACad.AstraDocument.Members.Count; i++)
                {
                    dgvMemberGrid.Rows.Add(iACad.AstraDocument.Members[i].MemberNo,
                                           "BEAM",
                                           iACad.AstraDocument.Members[i].StartNode.NodeNo,
                                           iACad.AstraDocument.Members[i].EndNode.NodeNo,
                                           "",
                                           "",
                                           "",
                                           "",
                                           "",
                                           "",
                                           "",
                                           "",
                                           "",
                                           "",
                                           "");
                }
            }
            else if (kStr.Contains("TO"))
            {
                mList = new MyStrings(MyStrings.RemoveAllSpaces(kStr), ' ');
                int indx = -1;

                for (int i = mList.GetInt(0); i <= mList.GetInt(2); i++)
                {
                    indx = iACad.AstraDocument.Members.IndexOf(i);
                    dgvMemberGrid.Rows.Add(iACad.AstraDocument.Members[indx].MemberNo,
                                           "BEAM",
                                           iACad.AstraDocument.Members[indx].StartNode.NodeNo,
                                           iACad.AstraDocument.Members[indx].EndNode.NodeNo,
                                           "",
                                           "",
                                           "",
                                           "",
                                           "",
                                           "",
                                           "",
                                           "",
                                           "",
                                           "",
                                           "");
                }
            }
            else
            {
                kStr = kStr.Replace(',', ' ');

                mList = new MyStrings(MyStrings.RemoveAllSpaces(kStr), ' ');
                int indx = -1;

                for (int i = 0; i < mList.Count; i++)
                {
                    indx = iACad.AstraDocument.Members.IndexOf(mList.GetInt(i));

                    dgvMemberGrid.Rows.Add(iACad.AstraDocument.Members[indx].MemberNo,
                                           "BEAM",
                                           iACad.AstraDocument.Members[indx].StartNode.NodeNo,
                                           iACad.AstraDocument.Members[indx].EndNode.NodeNo,
                                           "",
                                           "",
                                           "",
                                           "",
                                           "",
                                           "",
                                           "",
                                           "",
                                           "",
                                           "",
                                           "");
                }
            }
        }
Пример #19
0
        private void frmMemberRelease_Load(object sender, EventArgs e)
        {
            if (ASTRA_Data != "")
            {
                chk_Fx.Checked = false;
                chk_Mx.Checked = false;

                chk_Fy.Checked = false;
                chk_My.Checked = false;

                chk_Fz.Checked = false;
                chk_Mz.Checked = false;


                MyStrings mlist = new MyStrings(MyStrings.RemoveAllSpaces(ASTRA_Data), ' ');

                string kStr = "";
                int    r    = -1;
                for (int i = 0; i < mlist.Count; i++)
                {
                    if (mlist.StringList[i].StartsWith("START"))
                    {
                        r = i;

                        cmb_node.SelectedIndex = 0;
                    }
                    else if (mlist.StringList[i].StartsWith("END"))
                    {
                        r = i;
                        cmb_node.SelectedIndex = 1;
                        //break;
                    }
                    else if (mlist.StringList[i].StartsWith("FX"))
                    {
                        chk_Fx.Checked = true;
                    }
                    else if (mlist.StringList[i].StartsWith("FY"))
                    {
                        chk_Fy.Checked = true;
                    }
                    else if (mlist.StringList[i].StartsWith("FZ"))
                    {
                        chk_Fz.Checked = true;
                    }
                    else if (mlist.StringList[i].StartsWith("MX"))
                    {
                        chk_Mx.Checked = true;
                    }
                    else if (mlist.StringList[i].StartsWith("MY"))
                    {
                        chk_My.Checked = true;
                    }
                    else if (mlist.StringList[i].StartsWith("MZ"))
                    {
                        chk_Mz.Checked = true;
                    }
                }

                if (r != -1)
                {
                    txt_mem_nos.Text = mlist.GetString(0, r - 1).Trim();
                }
                btn_add_data.Text = "Change";
            }
            else
            {
                cmb_node.SelectedIndex = 0;
                txt_mem_nos.Text       = iACad.GetSelectedMembersInText();
            }
        }
Пример #20
0
        public static bool ReadLineCoordinates(string fileName, vdDocument doc)
        {
            //vdArray<vdLine> line_arr = new vdArray<vdLine>();
            List <string> lstStr = new List <string>(File.ReadAllLines(fileName));
            string        kStr = "";
            string        option = "";
            string        SP, EP, TEXT, IP, Height;

            SP = EP = IP = TEXT = Height = "";

            MyStrings mList = null;

            for (int i = 0; i < lstStr.Count; i++)
            {
                kStr = lstStr[i].Trim().TrimEnd().TrimStart();
                if (kStr == "VD_LINE")
                {
                    option = "VD_LINE"; i++;
                    SP     = lstStr[i].Replace("SP=", ""); i++;
                    EP     = lstStr[i].Replace("EP=", "");
                }
                else if (kStr == "VD_TEXT")
                {
                    option = "VD_TEXT"; i++;
                    IP     = lstStr[i].Replace("IP=", ""); i++;
                    TEXT   = lstStr[i].Replace("TEXT=", ""); i++;
                    Height = lstStr[i].Replace("HEIGHT=", "");
                }
                switch (option)
                {
                case "VD_LINE":
                    mList = new MyStrings(MyStrings.RemoveAllSpaces(SP), ',');
                    vdLine ln = new vdLine();
                    ln.SetUnRegisterDocument(doc);
                    ln.setDocumentDefaults();
                    ln.StartPoint.x = mList.GetDouble(0);
                    ln.StartPoint.y = mList.GetDouble(1);
                    ln.StartPoint.z = mList.GetDouble(2);
                    mList           = new MyStrings(MyStrings.RemoveAllSpaces(EP), ',');
                    ln.EndPoint.x   = mList.GetDouble(0);
                    ln.EndPoint.y   = mList.GetDouble(1);
                    ln.EndPoint.z   = mList.GetDouble(2);
                    doc.ActiveLayOut.Entities.AddItem(ln);

                    break;

                case "VD_TEXT":

                    mList = new MyStrings(MyStrings.RemoveAllSpaces(IP), ',');
                    vdText txt = new vdText();
                    txt.SetUnRegisterDocument(doc);
                    txt.setDocumentDefaults();
                    txt.InsertionPoint.x = mList.GetDouble(0);
                    txt.InsertionPoint.y = mList.GetDouble(1);
                    txt.InsertionPoint.z = mList.GetDouble(2);
                    txt.TextString       = TEXT;
                    txt.Height           = MyStrings.StringToDouble(Height, 0.01);
                    doc.ActiveLayOut.Entities.AddItem(txt);
                    break;
                }
            }
            lstStr.Clear();
            //doc.ShowUCSAxis = false;
            //VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_VTop(doc);
            //doc.Redraw(true);
            return(true);
        }
Пример #21
0
        private void frmSectionProperties_Load(object sender, EventArgs e)
        {
            //cmb_mass_unit.SelectedIndex = 0;
            //cmb_length_unit.SelectedIndex = 1;
            if (DGV_Joints == null ||
                DGV_Members == null)
            {
                gb1.Visible = false;
            }
            if (MGC != null)
            {
                foreach (var item in MGC)
                {
                    cmb_range.Items.Add(item.GroupName);
                }
            }
            if (ASTRA_Data.Count > 0)
            {
                MyStrings mlist = new MyStrings(MyStrings.RemoveAllSpaces(ASTRA_Data[0]), ' ');

                //kStr
                int r = -1;
                for (int i = 0; i < mlist.Count; i++)
                {
                    if (mlist.StringList[i].StartsWith("PR"))
                    {
                        r = i;
                        //break;
                    }
                    else if (mlist.StringList[i].StartsWith("YD"))
                    {
                        txt_YD.Text            = mlist.StringList[i + 1];
                        rbtn_dimension.Checked = true;
                    }
                    else if (mlist.StringList[i].StartsWith("ZD"))
                    {
                        txt_ZD.Text            = mlist.StringList[i + 1];
                        rbtn_dimension.Checked = true;
                    }
                    else if (mlist.StringList[i].StartsWith("YB"))
                    {
                        txt_YB.Text            = mlist.StringList[i + 1];
                        rbtn_dimension.Checked = true;
                    }
                    else if (mlist.StringList[i].StartsWith("ZB"))
                    {
                        txt_ZB.Text            = mlist.StringList[i + 1];
                        rbtn_dimension.Checked = true;
                    }
                    else if (mlist.StringList[i].StartsWith("AX"))
                    {
                        if (r == -1)
                        {
                            r = i;
                        }
                        txt_AX.Text = mlist.StringList[i + 1];
                        rbtn_calculated_values.Checked = true;
                    }
                    else if (mlist.StringList[i].StartsWith("A"))
                    {
                        if (r == -1)
                        {
                            r = i;
                        }
                        txt_AX.Text = mlist.StringList[i + 1];
                        rbtn_calculated_values.Checked = true;
                    }
                    else if (mlist.StringList[i].StartsWith("IX"))
                    {
                        txt_IX.Text = mlist.StringList[i + 1];
                        rbtn_calculated_values.Checked = true;
                    }
                    else if (mlist.StringList[i].StartsWith("IY"))
                    {
                        txt_IY.Text = mlist.StringList[i + 1];
                        rbtn_calculated_values.Checked = true;
                    }
                    else if (mlist.StringList[i].StartsWith("IZ"))
                    {
                        txt_IZ.Text = mlist.StringList[i + 1];
                        rbtn_calculated_values.Checked = true;
                    }
                }

                if (r != -1)
                {
                    kStr = mlist.GetString(0, r - 1).Trim();
                    if (cmb_range.Items.Contains(kStr))
                    {
                        cmb_range.SelectedItem = kStr;
                    }
                    else
                    {
                        cmb_range.SelectedIndex = 1;
                        txt_member_nos.Text     = kStr;
                    }
                }

                btn_add_data.Text = "Change";
            }
            else
            {
                //cmb_mass_unit.SelectedIndex = (int)iACad.MassUnit;
                //cmb_length_unit.SelectedIndex = (int)iACad.LengthUnit; ;
                rbtn_dimension.Checked = true;

                kStr = iACad.GetSelectedMembersInText();

                rbtn_member_select.Checked = true;

                if (kStr == "ALL")
                {
                    cmb_range.SelectedIndex = 0;
                }
                else
                {
                    cmb_range.SelectedIndex = 1;
                }


                txt_member_nos.Text = kStr;
            }
            Load_Floor_Levels();
        }
Пример #22
0
        public static List <LoadData> GetLiveLoads(string file_path)
        {
            if (!File.Exists(file_path))
            {
                return(null);
            }

            //TYPE1 IRCCLASSA
            //68 68 68 68 114 114 114 27
            //3.00 3.00 3.00 4.30 1.20 3.20 1.10
            //1.80
            List <LoadData> LL_list      = new List <LoadData>();
            List <string>   file_content = new List <string>(File.ReadAllLines(file_path));
            MyStrings       mlist        = null;
            string          kStr         = "";

            int icount = 0;

            for (int i = 0; i < file_content.Count; i++)
            {
                kStr  = MyStrings.RemoveAllSpaces(file_content[i]);
                kStr  = kStr.Replace(',', ' ');
                kStr  = MyStrings.RemoveAllSpaces(kStr);
                mlist = new MyStrings(kStr, ' ');

                if (mlist.StringList[0].Contains("TYPE"))
                {
                    LoadData ld = new LoadData();
                    if (mlist.Count == 2)
                    {
                        kStr      = mlist.StringList[0].Replace("TYPE", "");
                        ld.TypeNo = "TYPE " + kStr;
                        ld.Code   = mlist.StringList[1];
                        LL_list.Add(ld);
                    }
                    else if (mlist.Count == 3)
                    {
                        ld.TypeNo = "TYPE " + mlist.StringList[1];
                        ld.Code   = mlist.StringList[2];
                        LL_list.Add(ld);
                    }
                    if ((i + 3) < file_content.Count)
                    {
                        ld.Loads     = new MyStrings(MyStrings.RemoveAllSpaces(file_content[i + 1].Replace(",", " ")), ' ');
                        ld.Distances = new MyStrings(MyStrings.RemoveAllSpaces(file_content[i + 2].Replace(",", " ")), ' ');
                        ld.LoadWidth = MyStrings.StringToDouble(file_content[i + 3], 0.0);
                    }
                }
            }
            return(LL_list);

            //TYPE 2 IRCCLASSB
            //20.5 20.5 20.5 20.5 34.0 34.0 8.0 8.0
            //3.00 3.00 3.00 4.30 1.20 3.20 1.10
            //1.80

            //TYPE 3 IRC70RTRACK
            //70 70 70 70 70 70 70 70 70 70
            //0.457 0.457 0.457 0.457 0.457 0.457 0.457 0.457 0.457
            //0.84

            //TYPE 4 IRC70RWHEEL
            //85 85 85 85 60 60 40
            //1.37 3.05 1.37 2.13 1.52 3.96
            //0.450 1.480 0.450

            //TYPE 5 IRCCLASSAATRACK
            //70 70 70 70 70 70 70 70 70 70
            //0.360 0.360 0.360 0.360 0.360 0.360 0.360 0.360 0.360
            //0.85

            //TYPE 6 IRC24RTRACK
            //62.5 62.5 62.5 62.5 62.5 62.5 62.5 62.5 62.5 62.5
            //0.366 0.366 0.366 0.366 0.366 0.366 0.366 0.366 0.366
            //0.36
        }
Пример #23
0
        public void ReadFromFilFile(string flName)
        {
            //SLAB DESIGN
            //L = 3000.00 mm; B = 1000 m; D = 110.00 mm
            //h1 = 15.00 mm; h2 = 15.00 mm
            //ENFORCEMENT BAR
            //B1 = 250.00 mm; SPACING = 200.00 mm
            //END

            bool          IsSlabFind = false;
            List <string> lstStr     = new List <string>(File.ReadAllLines(flName));
            string        kStr       = "";

            MyStrings mList = null;

            for (int i = 0; i < lstStr.Count; i++)
            {
                kStr = MyStrings.RemoveAllSpaces(lstStr[i].Trim().TrimEnd().TrimStart().ToUpper());
                if (kStr == "SLAB DESIGN")
                {
                    IsSlabFind = true;
                    continue;
                }
                else if (kStr == "END")
                {
                    IsSlabFind = false;
                }

                if (IsSlabFind)
                {
                    mList = new MyStrings(MyStrings.RemoveAllSpaces(kStr), ' ');
                    for (int j = 0; j < mList.Count; j++)
                    {
                        switch (mList.StringList[j].Trim())
                        {
                        case "L":
                            totalLength = mList.GetDouble(j + 2);
                            break;

                        case "B":
                            d_B = mList.GetDouble(j + 2);
                            break;

                        case "D":
                            D = mList.GetDouble(j + 2);
                            break;

                        case "H1":
                            h1 = mList.GetDouble(j + 2);
                            break;

                        case "H2":
                            h2 = mList.GetDouble(j + 2);
                            break;

                        case "B1":
                            B1 = mList.GetDouble(j + 2);
                            break;

                        case "MAIN SPACING":
                            s1 = mList.GetDouble(j + 1);
                            break;

                        case "DIST SPACING":
                            s2 = mList.GetDouble(j + 1);
                            break;
                        }
                    }
                }
            }
        }
Пример #24
0
        private void frmMembers_Load(object sender, EventArgs e)
        {
            cmb_memtype.SelectedIndex = 0;

            if (ASTRA_Data.Count > 0)
            {
                string kStr = ASTRA_Data[0];

                if (kStr == "INSERT")
                {
                    int r = DGV.CurrentCell.RowIndex;

                    txt_mbr_start_no.Text = DGV[0, r].Value.ToString();

                    if (DGV[1, r].Value.ToString().StartsWith("C"))
                    {
                        cmb_memtype.SelectedIndex = 2;
                    }
                    else if (DGV[1, r].Value.ToString().StartsWith("T"))
                    {
                        cmb_memtype.SelectedIndex = 1;
                    }
                    else
                    {
                        cmb_memtype.SelectedIndex = 0;
                    }

                    txt_mbr_start_jnt.Text = DGV[2, r].Value.ToString();
                    txt_mbr_end_jnt.Text   = DGV[3, r].Value.ToString();

                    btn_add_mem.Text = "Insert";
                }
                else
                {
                    MyStrings mlist = new MyStrings(MyStrings.RemoveAllSpaces(kStr), ' ');

                    int r = MyStrings.StringToInt(kStr, 0);

                    txt_mbr_start_no.Text = DGV[0, r].Value.ToString();
                    if (DGV[1, r].Value.ToString().StartsWith("C"))
                    {
                        cmb_memtype.SelectedIndex = 2;
                    }
                    else if (DGV[1, r].Value.ToString().StartsWith("T"))
                    {
                        cmb_memtype.SelectedIndex = 1;
                    }
                    else
                    {
                        cmb_memtype.SelectedIndex = 0;
                    }

                    txt_mbr_start_jnt.Text = DGV[2, r].Value.ToString();
                    txt_mbr_end_jnt.Text   = DGV[3, r].Value.ToString();

                    btn_add_mem.Text = "Change";
                }
            }
            else
            {
                txt_mbr_start_no.Text = (DGV.RowCount + 1) + "";
                if (DGV.RowCount == 0)
                {
                    txt_mbr_start_jnt.Text  = "1";
                    txt_mbr_end_jnt.Text    = "2";
                    txt_incr_start_no.Text  = "1";
                    txt_incr_start_jnt.Text = "1";
                    txt_incr_end_jnt.Text   = "1";
                }
            }
        }