public bool Pile_Read_Grid_Data() { double PL = MyList.StringToDouble(txt_PL.Text, 0.0); double sum_thk = 0; try { pile.pft_list.Clear(); PileFoundationTable pft = null; for (int i = 0; i < dgv.RowCount; i++) { pft = new PileFoundationTable(); pft.Layers = MyList.StringToInt(dgv[1, i].Value.ToString(), 0); pft.Depth = MyList.StringToDouble(dgv[2, i].Value.ToString(), 0); pft.Thickness = double.Parse(dgv[3, i].Value.ToString()); sum_thk += pft.Thickness; if (sum_thk > PL) { pft.Thickness = pft.Thickness - (sum_thk - PL); dgv[3, i].Value = pft.Thickness.ToString("f3"); dgv.Rows[i].DefaultCellStyle.BackColor = Color.Red; } pft.Phi = double.Parse(dgv[4, i].Value.ToString()); pft.Alpha = double.Parse(dgv[5, i].Value.ToString()); pft.Cohesion = double.Parse(dgv[6, i].Value.ToString()); pft.GammaSub = double.Parse(dgv[7, i].Value.ToString()); pile.pft_list.Add(pft); dgv.Rows[i].DefaultCellStyle.BackColor = Color.LightGreen; if (sum_thk >= PL) { break; } } } catch (Exception ex) { } if (sum_thk < PL) { MessageBox.Show("Total thickness ( " + sum_thk.ToString("f3") + " m ) of Layer in Sub Soil data is\n\n less than Length of Pile ( " + PL.ToString("f3") + " m ) .......\n\n" + "Process Terminated......", "ASTRA", MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } return(true); }
public void Pile_Read_User_Input() { #region USER DATA INPUT DATA List <string> lst_content = new List <string>(File.ReadAllLines(pile.user_input_file)); string kStr = ""; MyList mList = null; string VarName = ""; bool table_data_find = false; pile.pft_list.Clear(); try { for (int i = 0; i < lst_content.Count; i++) { kStr = MyList.RemoveAllSpaces(lst_content[i]); mList = new MyList(kStr, '='); VarName = MyList.RemoveAllSpaces(mList.StringList[0]); if (table_data_find) { pile.pft_list.Add(PileFoundationTable.Parse(lst_content[i])); } #region SWITCH switch (VarName) { case "D": txt_D.Text = mList.StringList[1].Trim(); break; case "P": txt_P.Text = mList.StringList[1].Trim(); break; case "K": txt_K.Text = mList.StringList[1].Trim(); break; case "AM": txt_AM.Text = mList.StringList[1].Trim(); break; //case "N_gamma": // txt_N_gamma.Text = mList.StringList[1].Trim(); // break; //case "Nq": // txt_Nq.Text = mList.StringList[1].Trim(); // break; //case "Nc": // txt_Nc.Text = mList.StringList[1].Trim(); // break; case "FS": txt_FS.Text = mList.StringList[1].Trim(); break; case "PCBL": txt_PCBL.Text = mList.StringList[1].Trim(); break; case "SL": txt_SL.Text = mList.StringList[1].Trim(); break; case "FL": txt_FL.Text = mList.StringList[1].Trim(); break; case "sigma_ck": //txt_sigma_ck.Text = mList.StringList[1].Trim(); break; case "fy": //txt_fy.Text = mList.StringList[1].Trim(); break; case "gamma_c": txt_gamma_c.Text = mList.StringList[1].Trim(); break; case "Np": txt_Np.Text = mList.StringList[1].Trim(); break; case "N": txt_N.Text = mList.StringList[1].Trim(); break; //case "gamma_sub": // txt_gamma_sub.Text = mList.StringList[1].Trim(); // break; case "cap_sigma_ck": //txt_cap_sigma_ck.Text = mList.StringList[1].Trim(); break; case "cap_fy": //txt_cap_fy.Text = mList.StringList[1].Trim(); break; case "sigma_cbc": //txt_sigma_cbc.Text = mList.StringList[1].Trim(); break; case "sigma_st": //txt_sigma_st.Text = mList.StringList[1].Trim(); break; case "m": txt_m.Text = mList.StringList[1].Trim(); break; case "F": txt_F.Text = mList.StringList[1].Trim(); break; case "d1": txt_d1.Text = mList.StringList[1].Trim(); break; case "d2": txt_d2.Text = mList.StringList[1].Trim(); break; case "d3": txt_d3.Text = mList.StringList[1].Trim(); break; case "LPC": txt_LPC.Text = mList.StringList[1].Trim(); break; case "BPC": txt_BPC.Text = mList.StringList[1].Trim(); break; case "LPr": txt_LPr.Text = mList.StringList[1].Trim(); break; case "BPr": txt_BPr.Text = mList.StringList[1].Trim(); break; case "DPC": txt_DPC.Text = mList.StringList[1].Trim(); break; case "L1": txt_L1.Text = mList.StringList[1].Trim(); break; case "L2": txt_L2.Text = mList.StringList[1].Trim(); break; case "L3": txt_L3.Text = mList.StringList[1].Trim(); break; case "TABLE": table_data_find = true; break; } #endregion } dgv.Rows.Clear(); for (int i = 0; i < pile.pft_list.Count; i++) { dgv.Rows.Add(i + 1, pile.pft_list[i].Layers, pile.pft_list[i].Thickness, pile.pft_list[i].Phi, pile.pft_list[i].Alpha, pile.pft_list[i].Cohesion, pile.pft_list[i].GammaSub); } Pile_Checked_Grid(); } catch (Exception ex) { } lst_content.Clear(); #endregion }
public void Pile_Foundation_Load() { cmb_pcap_fck.SelectedIndex = 3; cmb_pcap_fy.SelectedIndex = 2; cmb_pile_fck.SelectedIndex = 3; cmb_pile_fy.SelectedIndex = 2; pile.pft_list = new PileFoundationTableCollection(1); PileFoundationTable pft = null; pft = new PileFoundationTable(); pft.SL_No = 1; pft.Layers = 1; pft.Cohesion = 0.15; pft.Phi = 24.0; pft.GammaSub = 1.81; pft.Alpha = 0.5; pft.Depth = 2.0; pile.pft_list.Add(pft); pft = new PileFoundationTable(); pft.SL_No = 2; pft.Layers = 2; pft.Cohesion = 0.10; pft.Phi = 28.0; pft.GammaSub = 1.86; pft.Alpha = 0.5; pft.Depth = 5.0; pile.pft_list.Add(pft); pft = new PileFoundationTable(); pft.SL_No = 3; pft.Layers = 3; pft.Cohesion = 0.15; pft.Phi = 24.0; pft.GammaSub = 1.91; pft.Alpha = 0.5; pft.Depth = 7.0; pile.pft_list.Add(pft); pft = new PileFoundationTable(); pft.SL_No = 4; pft.Layers = 4; pft.Cohesion = 0.15; pft.Phi = 24.0; pft.GammaSub = 1.90; pft.Alpha = 0.5; pft.Depth = 10.0; pile.pft_list.Add(pft); pft = new PileFoundationTable(); pft.SL_No = 5; pft.Layers = 5; pft.Cohesion = 0.35; pft.Phi = 24.0; pft.GammaSub = 1.91; pft.Alpha = 0.5; pft.Depth = 12.5; pile.pft_list.Add(pft); pft = new PileFoundationTable(); pft.SL_No = 6; pft.Layers = 6; pft.Cohesion = 0.30; pft.Phi = 26.0; pft.GammaSub = 1.92; pft.Alpha = 0.5; pft.Depth = 14.5; pile.pft_list.Add(pft); pft = new PileFoundationTable(); pft.SL_No = 7; pft.Layers = 7; pft.Cohesion = 0.10; pft.Phi = 30.0; pft.GammaSub = 1.92; pft.Alpha = 0.5; pft.Depth = 20.0; pile.pft_list.Add(pft); pft = new PileFoundationTable(); pft.SL_No = 8; pft.Layers = 8; pft.Cohesion = 0.05; pft.Phi = 32.0; pft.GammaSub = 1.92; pft.Alpha = 0.5; pft.Depth = 25.0; pile.pft_list.Add(pft); pft = new PileFoundationTable(); pft.SL_No = 9; pft.Layers = 9; pft.Cohesion = 0.05; pft.Phi = 33.0; pft.GammaSub = 1.92; pft.Alpha = 0.5; pft.Depth = 30.0; pile.pft_list.Add(pft); foreach (var item in pile.pft_list) { dgv.Rows.Add(item.SL_No, item.Layers, item.Depth, item.Thickness, item.Phi, item.Alpha, item.Cohesion, item.GammaSub); } Pile_Checked_Grid(); }