public void Set_Refuerzo_Seccion(int[] Refuerzos_temp, double Recubrimiento) { double Long_arco = 0; double Theta = 0; double Radio_interno = 0; double Perimetro_interno = 0; double[] Coord = new double[2]; int id = 0; CRefuerzo refuerzoi = null; Refuerzos.Clear(); Radio_interno = ((2 * radio * 100) - 2 * Recubrimiento - 2) / 2; Perimetro_interno = 2 * Math.PI * Radio_interno; Long_arco = Perimetro_interno / Refuerzos_temp.Count(); foreach (int Diametroi in Refuerzos_temp) { Coord[0] = Radio_interno * Math.Cos((Math.PI / 2) - Theta); Coord[1] = Radio_interno * Math.Sin((Math.PI / 2) - Theta); refuerzoi = FunctionsProject.DeepClone(new CRefuerzo(id, "#" + Diametroi, Coord, TipodeRefuerzo.longitudinal)); refuerzoi.Alzado = 1; Refuerzos.Add(refuerzoi); id++; Theta += Long_arco / Radio_interno; } }
public static List <CRefuerzo> Set_Refuerzo_Seccion(int[] Diametros_Seccion, int CapasX, int CapasY, int CapasXw, int CapasYw, float b, float h, float Tw, float tf) { double posx, posy; int ContX, ContY, id; double r = 6; //1 es el espesor del estribo #3 double[] Coord_ref = new double[2]; double DeltaX1, DeltaY1, DeltaX2, DeltaY2; CRefuerzo refuerzoi; List <CRefuerzo> Refuerzos_Seccion = new List <CRefuerzo>(); DeltaX1 = (b - 2 * r) / (CapasX - 1); DeltaY1 = (h - 2 * r) / (CapasY - 1); DeltaX2 = (Tw - 2 * r) / (CapasXw - 1); DeltaY2 = (tf - 2 * r) / (CapasYw - 1); posx = -(b / 2) + r; posy = (h / 2) - r; ContX = CapasX - 2; ContY = CapasY; id = 1; for (int i = 0; i < Diametros_Seccion.Length; i++) { Coord_ref[0] = posx; Coord_ref[1] = posy; refuerzoi = new CRefuerzo(id, "#" + Diametros_Seccion[i], pcoord: new double[] { posx, posy }, ptipo: TipodeRefuerzo.longitudinal); Refuerzos_Seccion.Add(refuerzoi); posy -= DeltaY1; ContY--; if (ContY == 0 & ContX > 0) { posx += DeltaX1; posy = (h / 2) - r; ContY = 2; DeltaY1 = (h - 2 * r) / (ContY - 1); ContX--; } if (ContX == 0 & ContY == 0) { ContY = CapasY; DeltaY1 = (h - 2 * r) / (ContY - 1); posx = (b / 2) - r; posy = (h / 2) - r; } id++; } return(Refuerzos_Seccion); }
private void Reload_Seccion() { CRefuerzo refuerzo; DataGridViewComboBoxCell boxCell; string diametro; int id, indice; double x, y; double[] coord; Seccion.Refuerzos.Clear(); for (int i = 0; i < dataGridView1.Rows.Count; i++) { boxCell = (DataGridViewComboBoxCell)dataGridView1.Rows[i].Cells[2]; id = Convert.ToInt32(dataGridView1.Rows[i].Cells[0].Value); diametro = boxCell.Value.ToString(); try { int EnteroDiametro = Convert.ToInt32(diametro.Substring(1)); FunctionsProject.Find_As(EnteroDiametro); if (EnteroDiametro > 10 | EnteroDiametro < 0) { diametro = "#4"; } else { diametro = "#" + EnteroDiametro; } } catch { diametro = "#4"; } x = Convert.ToDouble(dataGridView1.Rows[i].Cells[3].Value); y = Convert.ToDouble(dataGridView1.Rows[i].Cells[4].Value); coord = new double[] { x, y }; refuerzo = new CRefuerzo(id, diametro, coord, TipodeRefuerzo.longitudinal); refuerzo.Alzado = Convert.ToInt32(dataGridView1.Rows[i].Cells[1].Value); Seccion.Refuerzos.Add(refuerzo); } Seccion.Acero_Long = Seccion.Refuerzos.Sum(x1 => x1.As_Long); Seccion.Editado = true; if (FInterfaz_.edicion == Tipo_Edicion.Secciones_modelo) { indice = Form1.Proyecto_.ColumnaSelect.Seccions.FindIndex(x1 => x1.Item2 == piso); Form1.Proyecto_.ColumnaSelect.Seccions[indice] = new Tuple <ISeccion, string>(Seccion, piso); } }
private void Reload_Seccion() { CRefuerzo refuerzo; string diametro; int Alzado = 0; double x, y; double[] coord; int indice = 0; diametro = cbDiametros.Text; Alzado = Convert.ToInt32(tbAlzado.Text); x = Convert.ToDouble(tbXc.Text); y = Convert.ToDouble(tbYc.Text); coord = new double[] { x, y }; refuerzo = new CRefuerzo(Seccion.Refuerzos[index].id, diametro, coord, TipodeRefuerzo.longitudinal); refuerzo.Alzado = Alzado; Seccion.Refuerzos[index] = FunctionsProject.DeepClone(refuerzo); Seccion.Editado = true; if (FInterfaz_.edicion == Tipo_Edicion.Secciones_modelo) { indice = Form1.Proyecto_.ColumnaSelect.Seccions.FindIndex(x1 => x1.Item2 == piso); Form1.Proyecto_.ColumnaSelect.Seccions[indice] = new Tuple <ISeccion, string>(Seccion, piso); } if (FInterfaz_.edicion == Tipo_Edicion.Secciones_predef & GDE == GDE.DMO) { indice = Form1.secciones_predef.Secciones_DMO.FindIndex(x1 => x1.ToString() == Seccion.ToString()); Form1.secciones_predef.Secciones_DMO[indice] = Seccion; } if (FInterfaz_.edicion == Tipo_Edicion.Secciones_predef & GDE == GDE.DES) { indice = Form1.secciones_predef.Secciones_DES.FindIndex(x1 => x1.ToString() == Seccion.ToString()); Form1.secciones_predef.Secciones_DES[indice] = Seccion; } }
private void Reload_Seccion() { CRefuerzo refuerzo; DataGridViewComboBoxCell boxCell; string diametro; int id, indice; double x, y; double[] coord; Seccion.Refuerzos.Clear(); for (int i = 0; i < dataGridView1.Rows.Count; i++) { boxCell = (DataGridViewComboBoxCell)dataGridView1.Rows[i].Cells[1]; id = Convert.ToInt32(dataGridView1.Rows[i].Cells[0].Value); diametro = boxCell.Value.ToString(); x = Convert.ToDouble(dataGridView1.Rows[i].Cells[2].Value); y = Convert.ToDouble(dataGridView1.Rows[i].Cells[3].Value); coord = new double[] { x, y }; refuerzo = new CRefuerzo(id, diametro, coord, TipodeRefuerzo.longitudinal); Seccion.Refuerzos.Add(refuerzo); } Seccion.Acero_Long = Seccion.Refuerzos.Sum(x1 => x1.As_Long); Seccion.Editado = true; if (FInterfaz_.edicion == Tipo_Edicion.Secciones_modelo) { indice = Form1.Proyecto_.ColumnaSelect.Seccions.FindIndex(x1 => x1.Item2 == piso); Form1.Proyecto_.ColumnaSelect.Seccions[indice] = new Tuple <ISeccion, string>(Seccion, piso); } if (FInterfaz_.edicion == Tipo_Edicion.Secciones_predef) { //indice = Form1.secciones_predef.Secciones.FindIndex(x1 => x1.ToString() == Seccion.ToString()); //Form1.secciones_predef.Secciones[indice] = Seccion; } }
private void Reload_Seccion() { CRefuerzo refuerzo; DataGridViewComboBoxCell boxCell; string diametro; int id, indice; double x, y; double[] coord; Seccion.Refuerzos.Clear(); for (int i = 0; i < dataGridView1.Rows.Count; i++) { boxCell = (DataGridViewComboBoxCell)dataGridView1.Rows[i].Cells[1]; id = Convert.ToInt32(dataGridView1.Rows[i].Cells[0].Value); diametro = boxCell.Value.ToString(); x = Convert.ToDouble(dataGridView1.Rows[i].Cells[2].Value); y = Convert.ToDouble(dataGridView1.Rows[i].Cells[3].Value); coord = new double[] { x, y }; refuerzo = new CRefuerzo(id, diametro, coord, TipodeRefuerzo.longitudinal); Seccion.Refuerzos.Add(refuerzo); } Seccion.Acero_Long = Seccion.Refuerzos.Sum(x1 => x1.As_Long); Seccion.Editado = true; if (gde == GDE.DES) { indice = Form1.secciones_predef.Secciones_DES.FindIndex(x1 => x1.ToString() == Seccion.ToString()); Form1.secciones_predef.Secciones_DES[indice] = Seccion; } else { indice = Form1.secciones_predef.Secciones_DMO.FindIndex(x1 => x1.ToString() == Seccion.ToString()); Form1.secciones_predef.Secciones_DMO[indice] = Seccion; } }