public cApoyo(string Nombre, cSeccion Seccion, cNervio NervioOrigen) { this.Nombre = Nombre; seccion = Seccion; this.NervioOrigen = NervioOrigen; Longitud = seccion.B * cConversiones.Dimension_cm_to_m; }
public static void PegarRefuerzos(cNervio Nervio) { Refuerzos.ForEach(BC => { cBarra BarraClonada = cFunctionsProgram.DeepCloneFast(BC); if (SaberSiEstaPorFueraLaBarra(BarraClonada, Nervio)) { if (BarraClonada.UbicacionRefuerzo == eUbicacionRefuerzo.Inferior) { int IDF = 0; cTendencia Tendencia = Nervio.Tendencia_Refuerzos.TInfeSelect; if (Nervio.Tendencia_Refuerzos.TInfeSelect.Barras.Count > 0) { IDF = Nervio.Tendencia_Refuerzos.TInfeSelect.Barras.Max(y => y.ID) + 1; Tendencia = Nervio.Tendencia_Refuerzos.TInfeSelect; } BarraClonada.ID = IDF; BarraClonada.TendenciaOrigen = Tendencia; Nervio.Tendencia_Refuerzos.TInfeSelect.AgregarBarra(BarraClonada); } else { int IDF = 0; cTendencia Tendencia = Nervio.Tendencia_Refuerzos.TSupeSelect; if (Nervio.Tendencia_Refuerzos.TSupeSelect.Barras.Count > 0) { IDF = Nervio.Tendencia_Refuerzos.TSupeSelect.Barras.Max(y => y.ID) + 1; Tendencia = Nervio.Tendencia_Refuerzos.TSupeSelect.Barras.Last().TendenciaOrigen; } BarraClonada.ID = IDF; BarraClonada.TendenciaOrigen = Tendencia; Nervio.Tendencia_Refuerzos.TSupeSelect.AgregarBarra(BarraClonada); } } }); }
private void ConfirmarSimilitudes(DataGridView data) { List <string> MensajeAlerta = new List <string>(); Nervios.ForEach(x => { x.SimilitudNervioGeometria.Similares_List_SimilarA = null; x.SimilitudNervioGeometria.BoolSoySimiarA = false; }); foreach (DataGridViewRow row in data.Rows) { string NombreNervio = row.Cells[C_NombreNervio.Index].Value.ToString(); bool IsMaestro = (bool)row.Cells[C_Maestro.Index].Value; string SoySimilarA = ""; if (row.Cells[C_Similara.Index].Value != null) { SoySimilarA = row.Cells[C_Similara.Index].Value.ToString(); } cNervio NervioMaestro = Nervios.Find(x => x.Nombre == SoySimilarA); cNervio NervioSimilar = Nervios.Find(x => x.Nombre == NombreNervio); cFunctionsProgram.AsignarSimilitud(NervioMaestro, NervioSimilar, ref MensajeAlerta); } List <cNervio> NerviosOrganizados = Nervios.OrderBy(y => !y.SimilitudNervioCompleto.IsMaestro).ToList(); NerviosOrganizados.ForEach(y => y.CrearEnvolvente()); RB_Alerta.Clear(); RB_Alerta.Lines = MensajeAlerta.ToArray(); if (MensajeAlerta.Count == 0) { Close(); } }
private float YInicial() { cNervio Nervio = TendenciaOrigen.Tendencia_Refuerzo_Origen.NervioOrigen; List <IElemento> ElementosContenedores = new List <IElemento>(); List <int> Enteros = new List <int>(); PointF Punto1 = new PointF(xi, 0f); PointF Punto2 = new PointF(xf, 0f); Nervio.Lista_Elementos.ForEach(Elemento => { if (cFunctionsProgram.IsPuntoInSeccion(Elemento, Punto1)) { Enteros.Add(Elemento.Indice); } if (cFunctionsProgram.IsPuntoInSeccion(Elemento, Punto2)) { Enteros.Add(Elemento.Indice); } }); ElementosContenedores = Nervio.Lista_Elementos.GetRange(Enteros.First(), Enteros.Last() - Enteros.First() + 1); if (UbicacionRefuerzo == eUbicacionRefuerzo.Inferior) { return(ElementosContenedores.Select(x => x.Vistas.Perfil_AutoCAD.Reales.Min(y => y.Y)).Max() + cVariables.DeltaNivel * nivel + subNivel * cVariables.DeltaSubNivel); } else { return(ElementosContenedores.Select(x => x.Vistas.Perfil_AutoCAD.Reales.Max(y => y.Y)).Min() - cVariables.DeltaNivel * nivel - subNivel * cVariables.DeltaSubNivel); } }
public static void Copiar(cNervio nervio) { Elementos.Clear(); nervio.Lista_Elementos.ForEach(elemento => { Elementos.Add(elemento); }); }
private void BT_Aceptar_Click(object sender, EventArgs e) { AceptarINFO(DGV_Info); Close(); cNervio nervio = EditSelectNervio == eEditarSelectNervio.Diseno?Nervios.Find(y => y.Propiedades.Diseno): Nervios.Find(y => y.Propiedades.DibujoAutoCAD); Aceptar = nervio != null; }
public cTramo(int ID, List <cObjeto> Lista_Objetos, cNervio NervioOrigen) { this.ID = ID; Nombre = "Tramo " + (ID + 1); this.Lista_Objetos = Lista_Objetos; this.NervioOrigen = NervioOrigen; CrearSubTramos(); CalcularLongitud(); }
private static bool SaberSiEstaPorFueraLaBarra(cBarra barra, cNervio nervio) { IElemento ElementoFirst = nervio.Lista_Elementos.First(); IElemento ElementoLast = nervio.Lista_Elementos.Last(); float Izquierda = ElementoFirst.Vistas.Perfil_AutoCAD.Reales.Min(y => y.X) + cVariables.RExtremoIzquierdo; float Derecha = ElementoLast.Vistas.Perfil_AutoCAD.Reales.Max(z => z.X) - cVariables.RExtremoDerecho; return(Izquierda <= (float)Math.Round(barra.XI, cVariables.CifrasDeciLongBarra) && (float)Math.Round(barra.XF, cVariables.CifrasDeciLongBarra) <= Derecha); }
private void CrearEnvolventeConSimilitud() { cNervio NervioOrigen = CalculosOrigen.SubtramoOrigen.TramoOrigen.NervioOrigen; cEstacion EstacionOrigen = CalculosOrigen.EstacionOrigen; List <cSolicitacion> Lista_Solici2 = new List <cSolicitacion>(); Lista_Solici2.AddRange(lista_solicitaciones); if (NervioOrigen.SimilitudNervioCompleto.IsMaestro) { foreach (cNervio N in NervioOrigen.SimilitudNervioCompleto.NerviosSimilares) { cSubTramo SubTramo = (cSubTramo)N.Lista_Elementos.Find(y => y.Indice == CalculosOrigen.SubtramoOrigen.Indice); cEstacion EstacionFind = EstacionOrigen.EstacionMasCercana(SubTramo.Estaciones); Lista_Solici2.AddRange(EstacionFind.Lista_Solicitaciones); } } else if (NervioOrigen.SimilitudNervioCompleto.BoolSoySimiarA) { cNervio NervioQueEs = NervioOrigen.SimilitudNervioCompleto.SoySimiarA.FindNervio(); cSubTramo SubTramo = (cSubTramo)NervioQueEs.Lista_Elementos.Find(y => y.Indice == CalculosOrigen.SubtramoOrigen.Indice); cEstacion EstacionFind = EstacionOrigen.EstacionMasCercana(SubTramo.Estaciones); cSolicitacion cSolicitacion1 = new cSolicitacion("ENV", 0, -EstacionFind.Calculos.Envolvente.V2[0], 0, 0, EstacionFind.Calculos.Envolvente.M3[0], 0); cSolicitacion cSolicitacion2 = new cSolicitacion("ENV2", 0, -EstacionFind.Calculos.Envolvente.V2[1], 0, 0, EstacionFind.Calculos.Envolvente.M3[1], 0); Lista_Solici2.Add(cSolicitacion1); Lista_Solici2.Add(cSolicitacion2); } float M3MaxPositivo = Lista_Solici2.FindAll(x => x.SelectEnvolvente).Max(x => x.M3); float M3MaxNegativo = Lista_Solici2.FindAll(x => x.SelectEnvolvente).Min(x => x.M3); float V2MaxPositivo = Lista_Solici2.FindAll(x => x.SelectEnvolvente).Max(x => x.V2); float V2MaxNegativo = Lista_Solici2.FindAll(x => x.SelectEnvolvente).Min(x => x.V2); if (M3MaxPositivo < 0) { M3MaxPositivo = 0; } if (M3MaxNegativo > 0) { M3MaxNegativo = 0; } if (V2MaxPositivo < 0) { V2MaxPositivo = 0; } if (V2MaxNegativo > 0) { V2MaxNegativo = 0; } M3 = new float[] { M3MaxPositivo, M3MaxNegativo }; V2 = new float[] { -V2MaxPositivo, -V2MaxNegativo }; Envolvente_CambioCrearEnvolvente(); }
public static void CopiarBarras(cNervio Nervio) { Refuerzos.Clear(); Nervio.Tendencia_Refuerzos.TSupeSelect.Barras.ForEach(Barra => { Refuerzos.Add(Barra); }); Nervio.Tendencia_Refuerzos.TInfeSelect.Barras.ForEach(Barra => { Refuerzos.Add(Barra); }); }
private void GL_Control1_MouseMove(object sender, MouseEventArgs e) { cNervio FindNervio = PisoSelect.Nervios.Find(y => y.MouseDownSelectSimilar(new Point(e.X, GL_Control1.Height - e.Y), false)); if (FindNervio != null) { LB_Nervio.Text = FindNervio.Nombre; } else { LB_Nervio.Text = ""; } }
public void SelectNervioChanged(Point Location, bool MouseDown, string NombreABuscar = "") { cNervio NervioSelectMouse = null; if (F_Base.Proyecto.Edificio.PisoSelect.Nervios != null && F_Base.Proyecto.Edificio.PisoSelect.Nervios.Count > 0) { if (NombreABuscar != "") { F_Base.Proyecto.Edificio.PisoSelect.NervioSelect = F_Base.Proyecto.Edificio.PisoSelect.Nervios.Find(x => x.Nombre == NombreABuscar); F_Base.Proyecto.Edificio.PisoSelect.NervioSelect.Select = true; } else if (MouseDown) { NervioSelectMouse = F_Base.Proyecto.Edificio.PisoSelect.Nervios.Find(x => x.MouseDownSelect(Location)); if (NervioSelectMouse != null) { F_Base.Proyecto.Edificio.PisoSelect.NervioSelect = NervioSelectMouse; LV_Nervios.SelectedItems.Clear(); } } } if (F_Base.Proyecto.Edificio.PisoSelect.NervioSelect != null) { F_Base.Proyecto.Edificio.PisoSelect.Nervios.FindAll(x => x.Nombre != F_Base.Proyecto.Edificio.PisoSelect.NervioSelect.Nombre).ForEach(x => { x.Select = false; x.ChangeSelect(); }); F_Base.Proyecto.Edificio.PisoSelect.NervioSelect.Select = true; F_Base.Proyecto.Edificio.PisoSelect.NervioSelect.ChangeSelect(); ListViewItem LVI = FindListViewItem(F_Base.Proyecto.Edificio.PisoSelect.NervioSelect.Nombre, LV_Nervios); if (LVI != null) { LVI.Selected = true; } GB_Propiedades.Text = $" {F_Base.Proyecto.Edificio.PisoSelect.NervioSelect.Nombre} | {F_Base.Proyecto.Edificio.PisoSelect.Nombre}"; Text = $"Selección de Nervios | {F_Base.Proyecto.Edificio.PisoSelect.NervioSelect.Nombre} | {F_Base.Proyecto.Edificio.PisoSelect.Nombre} "; ChangeComboBox(); CB_SeccionAltura.SelectedItem = F_Base.Proyecto.Edificio.PisoSelect.NervioSelect.CambioenAltura.ToString(); CB_SeccionAncho.SelectedItem = F_Base.Proyecto.Edificio.PisoSelect.NervioSelect.CambioenAncho.ToString(); TB_r1.Text = string.Format("{0:0.00}", F_Base.Proyecto.Edificio.PisoSelect.NervioSelect.r1); TB_r2.Text = string.Format("{0:0.00}", F_Base.Proyecto.Edificio.PisoSelect.NervioSelect.r2); Habilitar_DeshabilitarNevioBorde(); } else { Text = $"Selección de Nervios"; GB_Propiedades.Text = ""; } F_Base.ActualizarVentanaF_NervioEnPerfilLongitudinal(); F_Base.ActualizarVentanaF_VentanaDiseno(); F_Base.F_PlantaNervios.Invalidate(); }
private IElemento ObtenerElementoContenedorEscalado(PointF Punto) { cNervio Nervio = TendenciaOrigen.Tendencia_Refuerzo_Origen.NervioOrigen; IElemento Eleme = null; Nervio.Lista_Elementos.ForEach(Elemento => { if (cFunctionsProgram.IsPuntoInSeccion(Elemento, Punto, false)) { Eleme = Elemento; } }); return(Eleme); }
private void AceptarINFO(DataGridView data) { foreach (DataGridViewRow row in data.Rows) { cNervio N = Nervios.Find(y => y.Nombre == row.Cells[C_NombreNervio.Index].Value.ToString()); switch (EditSelectNervio) { case eEditarSelectNervio.AutoCAD: N.Propiedades.DibujoAutoCAD = (bool)row.Cells[C_Seleccionar.Index].Value; break; default: N.Propiedades.Diseno = (bool)row.Cells[C_Seleccionar.Index].Value; break; } } }
private void CreaNervios(string Prefijo, List <cLine> LineasConCondiciones, string NombreNervio = "") { List <List <cLine> > LineasParaCrearNervios = cFunctionsProgram.LineasParaCrearNervios(LineasConCondiciones); List <cNervio> NerviosPisoSelect = F_Base.Proyecto.Edificio.Lista_Pisos.Find(x => x.Nombre == F_Base.Proyecto.DatosEtabs.PisoSelect.Nombre).Nervios; int IndiceNervio = 1; if (NerviosPisoSelect == null || NerviosPisoSelect.Count == 0) { NerviosPisoSelect = new List <cNervio>(); } else { IndiceNervio = NerviosPisoSelect.Last().ID + 1; } var NerviosFind = NerviosPisoSelect.Find(y => y.Nombre == NombreNervio); if (NerviosFind == null) { foreach (List <cLine> lines in LineasParaCrearNervios) { cNervio Nervio = cFunctionsProgram.CrearNervio(Prefijo, IndiceNervio, lines, F_Base.Proyecto.DatosEtabs.PisoSelect.Lista_Lines, F_Base.Proyecto.Edificio.Lista_Grids, F_Base.Proyecto.DatosEtabs.PisoSelect, WidthPB_NOENUMERADOS, Height_NOENUMERADOS, NombreNervio); if (Nervio != null) { Nervio.Lista_Tramos.ForEach(x => x.Lista_Objetos.ForEach(y => y.Line.Select = false)); NerviosPisoSelect.Add(Nervio); IndiceNervio = NerviosPisoSelect.Last().ID + 1; } } F_Base.Proyecto.Edificio.Lista_Pisos.Find(x => x.Nombre == F_Base.Proyecto.DatosEtabs.PisoSelect.Nombre).Nervios = NerviosPisoSelect; cNervio NervioMenorListaObjetosMenoraCero = NerviosPisoSelect.Find(x => x.CantApoyos == 0); if (NervioMenorListaObjetosMenoraCero != null) { MensajeDeAlerta(); } else { cFunctionsProgram.RenombrarNervios(F_Base.Proyecto.Edificio.PisoSelect.Nervios, F_Base.Proyecto.Nomenclatura_Hztal, F_Base.Proyecto.Nomenclatura_Vert); } } else { cFunctionsProgram.VentanaEmergenteExclamacion("El Nervio ya existe, asigne otro nombre."); } }
public static void PegarEstribos(cNervio nervio) { Estribos.ForEach(E => { if (SaberSiBloqueEstribosEstaPorFuera(E, nervio)) { int IDF = 0; var BloquEstribosClone = cFunctionsProgram.DeepCloneFast(E); if (nervio.Tendencia_Refuerzos.TEstriboSelect.BloqueEstribos.Count > 0) { IDF = nervio.Tendencia_Refuerzos.TEstriboSelect.BloqueEstribos.Max(y => y.ID) + 1; } BloquEstribosClone.ID = IDF; BloquEstribosClone.Tendencia_Estribo_Origen = nervio.Tendencia_Refuerzos.TEstriboSelect; nervio.Tendencia_Refuerzos.TEstriboSelect.AgregarBloqueEstribos(BloquEstribosClone, false); } }); }
private void HabilitarMaestroSimilarA() { cNervio Nervio = F_Base.Proyecto.Edificio.PisoSelect.NervioSelect; LB_NervioSimilarA.Text = ""; GB_Similitud.Text = "Similitud"; if (Nervio.SimilitudNervioGeometria.IsMaestro | Nervio.SimilitudNervioGeometria.BoolSoySimiarA) { GB_Similitud.Text = "Similitud por Geometría"; LB_NervioSimilarA.Text = Nervio.SimilitudNervioGeometria.SoySimiarA.ToString(Nervio.PisoOrigen.Nombre); } else if (Nervio.SimilitudNervioCompleto.IsMaestro | Nervio.SimilitudNervioCompleto.BoolSoySimiarA) { GB_Similitud.Text = "Similitud de Todo"; LB_NervioSimilarA.Text = Nervio.SimilitudNervioCompleto.SoySimiarA.ToString(Nervio.PisoOrigen.Nombre); } CKB_Maestro.Checked = F_Base.Proyecto.Edificio.PisoSelect.NervioSelect.SimilitudNervioGeometria.IsMaestro | F_Base.Proyecto.Edificio.PisoSelect.NervioSelect.SimilitudNervioCompleto.IsMaestro; }
public static void Pegar(cNervio nervio) { if (cFunctionsProgram.AplicarSimilitud(((cSubTramo)Elementos.Find(y => y is cSubTramo)).TramoOrigen.NervioOrigen, nervio)) { int C = 0; Elementos.ForEach(elemento => { cSeccion Seccion = nervio.Lista_Elementos[C].Seccion; Seccion.B = elemento.Seccion.B; Seccion.H = elemento.Seccion.H; nervio.Lista_Elementos[C].Seccion = Seccion; nervio.Lista_Elementos[C].Longitud = elemento.Longitud; C++; }); } else { cFunctionsProgram.VentanaEmergenteExclamacion("No se puede copiar esta geometría en el nervio."); } }
private void CambiosTimer() { if (F_Base.Proyecto.DatosEtabs.PisoSelect == null) { F_Base.Proyecto.DatosEtabs.PisoSelect = F_Base.Proyecto.DatosEtabs.Lista_Pisos[F_Base.Proyecto.DatosEtabs.Lista_Pisos.Count - 1]; } if (ContainsFocus) { Text = $"Enumeración de Elementos | {F_Base.Proyecto.DatosEtabs.PisoSelect.Nombre}"; cLine ElementSelect = F_Base.Proyecto.DatosEtabs.PisoSelect.Lista_Lines.Find(x => x.Select == true); if (ElementSelect != null) { TB_Prefijo.Enabled = true; BT_Enumerar.Enabled = true; TB_Nombre.Enabled = true; } else { TB_Prefijo.Enabled = false; BT_Enumerar.Enabled = false; TB_Nombre.Enabled = false; } if (F_Base.Proyecto.Edificio.PisoSelect.Nervios != null) { cNervio NervioSelect = F_Base.Proyecto.Edificio.PisoSelect.Nervios.Find(x => x.SelectPlantaEnumeracion == true); if (NervioSelect != null) { BT_Regresar.Enabled = true; } else { BT_Regresar.Enabled = false; } } else { BT_Regresar.Enabled = false; } } }
private void GL_Control1_MouseDown2(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { NervioSelect = PisoSelect.Nervios.Find(y => y.MouseDownSelectSimilar(new Point(e.X, GL_Control1.Height - e.Y), false)); if (NervioSelect != null) { if (NervioSelect.SimilitudNervioCompleto.BoolSoySimiarA | NervioSelect.SimilitudNervioCompleto.IsMaestro | NervioSelect.SimilitudNervioGeometria.BoolSoySimiarA | NervioSelect.SimilitudNervioGeometria.IsMaestro) { GL_Control1.ContextMenuStrip = CMS_1; } else { GL_Control1.ContextMenuStrip = null; } } else { GL_Control1.ContextMenuStrip = null; } } }
private void ConfirmarSimilitudes(DataGridView data) { bool IsGeometria = CKB_Geometria.Checked; List <string> MensajeAlerta = new List <string>(); NerviosaAgrupar.ForEach(x => { x.SimilitudNervioGeometria.Similares_List_SimilarA = null; x.SimilitudNervioGeometria.BoolSoySimiarA = false; }); foreach (DataGridViewRow row in data.Rows) { string NombreNervio = row.Cells[C_NombreNervio.Index].Value.ToString(); string NombrePiso = row.Cells[C_Piso.Index].Value.ToString(); bool IsMaestro = (bool)row.Cells[C_Maestro.Index].Value; string SoySimilarANombreNervio = ""; string SoySimilarANombrePiso = ""; if (row.Cells[C_Similara.Index].Value != null && row.Cells[C_Similara.Index].Value.ToString() != "") { string[] Separate = row.Cells[C_Similara.Index].Value.ToString().Split(new string[] { "|", " " }, StringSplitOptions.RemoveEmptyEntries); SoySimilarANombreNervio = Separate[0]; SoySimilarANombrePiso = Separate[1]; } cNervio NervioMaestro = NerviosaAgrupar.Find(x => x.Nombre == SoySimilarANombreNervio && x.PisoOrigen.Nombre == SoySimilarANombrePiso); cNervio NervioSimilar = NerviosaAgrupar.Find(x => x.Nombre == NombreNervio && x.PisoOrigen.Nombre == NombrePiso); cFunctionsProgram.AsignarSimilitud(NervioMaestro, NervioSimilar, ref MensajeAlerta, IsGeometria); } List <cNervio> NerviosOrganizados = IsGeometria ? NerviosaAgrupar.OrderBy(y => !y.SimilitudNervioGeometria.IsMaestro).ToList() : NerviosaAgrupar.OrderBy(y => !y.SimilitudNervioCompleto.IsMaestro).ToList(); NerviosOrganizados.ForEach(y => y.CrearEnvolvente()); NerviosOrganizados.ForEach(y => y.BloquearNervio = y.SimilitudNervioCompleto.BoolSoySimiarA); RB_Alerta.Clear(); RB_Alerta.Lines = MensajeAlerta.ToArray(); NerviosaAgrupar.ForEach(y => y.SelectSimilar = false); if (MensajeAlerta.Count == 0) { Close(); } }
private float YInicial() { cNervio Nervio = Tendencia_Estribo_Origen.Tendencia_Refuerzo_Origen.NervioOrigen; List <IElemento> ElementosContenedores = new List <IElemento>(); List <int> Enteros = new List <int>(); PointF Punto1 = new PointF(xi, 0f); PointF Punto2 = new PointF(xf, 0f); Nervio.Lista_Elementos.ForEach(Elemento => { if (cFunctionsProgram.IsPuntoInSeccion(Elemento, Punto1)) { Enteros.Add(Elemento.Indice); } if (cFunctionsProgram.IsPuntoInSeccion(Elemento, Punto2)) { Enteros.Add(Elemento.Indice); } }); ElementosContenedores = Nervio.Lista_Elementos.GetRange(Enteros.First(), Enteros.Last() - Enteros.First() + 1); float ymin = ElementosContenedores.Select(x => x.Vistas.Perfil_AutoCAD.Reales.Min(y => y.Y)).Max(); float ymax = ElementosContenedores.Select(x => x.Vistas.Perfil_AutoCAD.Reales.Max(y => y.Y)).Min(); return(ymin + (ymax - ymin) / 2f); }
private static bool SaberSiBloqueEstribosEstaPorFuera(cBloqueEstribos bloqueEstribos, cNervio nervio) { IElemento ElementoFirst = nervio.Lista_Elementos.First(); IElemento ElementoLast = nervio.Lista_Elementos.Last(); float Izquierda = ElementoFirst.Vistas.Perfil_AutoCAD.Reales.Min(y => y.X) + cVariables.d_CaraApoyo; float Derecha = ElementoLast.Vistas.Perfil_AutoCAD.Reales.Max(z => z.X) - cVariables.d_CaraApoyo; return(Izquierda <= (float)Math.Round(bloqueEstribos.XI, cVariables.CifrasDeciLongBarra) && (float)Math.Round(bloqueEstribos.XF, cVariables.CifrasDeciLongBarra) <= Derecha); }
private void AsignarNervioOrigen() { nervioOrigen = F_Base.Proyecto.Edificio.PisoSelect.NervioSelect; }
public static void CopiarEstribos(cNervio nervio) { Estribos.Clear(); nervio.Tendencia_Refuerzos.TEstriboSelect.BloqueEstribos.ForEach(B => Estribos.Add(B)); }
public static List <PdfPTable> CrearTablasNervio(cNervio nervio) { List <PdfPTable> Tablas = new List <PdfPTable>(); List <cSubTramo> Subtramos = nervio.Lista_Elementos.FindAll(y => y is cSubTramo).ConvertAll(new Converter <IElemento, cSubTramo>(cFunctionsProgram.ElementoASubtramo)); int Cantidad = Subtramos.Count; if (Cantidad >= 3) { int Contador = 0; for (int i = 0; i <= Cantidad / 3; i += 3) { PdfPTable Tabla2 = new PdfPTable(9); string Text1 = $"Sección (BXH) {Subtramos[i].Seccion.B}x{Subtramos[i].Seccion.H} L={Subtramos[i].Longitud}m"; string Text2 = $"Sección (BXH) {Subtramos[i + 1].Seccion.B}x{Subtramos[i + 1].Seccion.H} L={Subtramos[i + 1].Longitud}m"; string Text3 = $"Sección (BXH) {Subtramos[i + 2].Seccion.B}x{Subtramos[i + 2].Seccion.H} L={Subtramos[i + 2].Longitud}m"; if (i == 0) { Tabla2.AddCell(Vcell($"{nervio.Nombre} - {nervio.PisoOrigen.Nombre}", BordAb: 0, Colspan: 9, IsBold: true)); } Tabla2.AddCell(Vcell(Text1, BordeD: 0, Colspan: 3)); Tabla2.AddCell(Vcell(Text2, BordeD: 0, Colspan: 3)); Tabla2.AddCell(Vcell(Text3, Colspan: 3)); object[][][] DatosResumidos1 = cFunctionsProgram.EstacionesResumidas(Subtramos[i].Estaciones); object[][][] DatosResumidos2 = cFunctionsProgram.EstacionesResumidas(Subtramos[i + 1].Estaciones); object[][][] DatosResumidos3 = cFunctionsProgram.EstacionesResumidas(Subtramos[i + 2].Estaciones); #region Parte Negativa Tabla2.AddCell(Vcell($"Mu-={string.Format("{0:0.00}", DatosResumidos1[1][1][0])}", 1, 0, 0, 0)); Tabla2.AddCell(Vcell($" ", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Mu-={string.Format("{0:0.00}", DatosResumidos1[1][1][1])}", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Mu-={string.Format("{0:0.00}", DatosResumidos2[1][1][0])}", 1, 0, 0, 0)); Tabla2.AddCell(Vcell($" ", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Mu-={string.Format("{0:0.00}", DatosResumidos2[1][1][1])}", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Mu-={string.Format("{0:0.00}", DatosResumidos3[1][1][0])}", 1, 0, 0, 0)); Tabla2.AddCell(Vcell($" ", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Mu-={string.Format("{0:0.00}", DatosResumidos3[1][1][1])}", 0, 1, 0, 0)); Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos1[1][2][0])}", 1, 0, 0, 0)); Tabla2.AddCell(Vcell($" ", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos1[1][2][1])}", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos2[1][2][0])}", 1, 0, 0, 0)); Tabla2.AddCell(Vcell($" ", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos2[1][2][1])}", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos3[1][2][0])}", 1, 0, 0, 0)); Tabla2.AddCell(Vcell($" ", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos3[1][2][1])}", 0, 1, 0, 0)); Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos1[1][0][0])}", 1, 0, 0, 0.5f)); Tabla2.AddCell(Vcell($" ", 0, 0, 0, 0.5f)); Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos1[1][0][1])}", 0, 0, 0, 0.5f)); Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos2[1][0][0])}", 1, 0, 0, 0.5f)); Tabla2.AddCell(Vcell($" ", 0, 0, 0, 0.5f)); Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos2[1][0][1])}", 0, 0, 0, 0.5f)); Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos3[1][0][0])}", 1, 0, 0, 0.5f)); Tabla2.AddCell(Vcell($" ", 0, 0, 0, 0.5f)); Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos3[1][0][1])}", 0, 1, 0, 0.5f)); #endregion #region PartePositiva Tabla2.AddCell(Vcell($"Mu+={string.Format("{0:0.00}", DatosResumidos1[0][1][0])}", 1, 0, 0, 0)); Tabla2.AddCell(Vcell($"Mu+={string.Format("{0:0.00}", DatosResumidos1[0][1][1])}", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Mu+={string.Format("{0:0.00}", DatosResumidos1[0][1][2])}", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Mu+={string.Format("{0:0.00}", DatosResumidos2[0][1][0])}", 1, 0, 0, 0)); Tabla2.AddCell(Vcell($"Mu+={string.Format("{0:0.00}", DatosResumidos2[0][1][1])}", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Mu+={string.Format("{0:0.00}", DatosResumidos2[0][1][2])}", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Mu+={string.Format("{0:0.00}", DatosResumidos3[0][1][0])}", 1, 0, 0, 0)); Tabla2.AddCell(Vcell($"Mu+={string.Format("{0:0.00}", DatosResumidos3[0][1][1])}", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Mu+={string.Format("{0:0.00}", DatosResumidos3[0][1][2])}", 0, 1, 0, 0)); Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos1[0][2][0])}", 1, 0, 0, 0)); Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos1[0][2][1])}", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos1[0][2][2])}", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos2[0][2][0])}", 1, 0, 0, 0)); Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos2[0][2][1])}", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos2[0][2][2])}", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos3[0][2][0])}", 1, 0, 0, 0)); Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos3[0][2][1])}", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos3[0][2][2])}", 0, 1, 0, 0)); Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos1[0][0][0])}", 1, 0, 0, 0.5f)); Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos1[0][0][1])}", 0, 0, 0, 0.5f)); Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos1[0][0][2])}", 0, 0, 0, 0.5f)); Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos2[0][0][0])}", 1, 0, 0, 0.5f)); Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos2[0][0][1])}", 0, 0, 0, 0.5f)); Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos2[0][0][2])}", 0, 0, 0, 0.5f)); Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos3[0][0][0])}", 1, 0, 0, 0.5f)); Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos3[0][0][1])}", 0, 0, 0, 0.5f)); Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos3[0][0][2])}", 0, 1, 0, 0.5f)); #endregion #region Estribos Tabla2.AddCell(Vcell($"V+={string.Format("{0:0.00}", DatosResumidos1[2][0][0])}", 1, 0, 0, 0)); Tabla2.AddCell(Vcell($" ", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"V-={string.Format("{0:0.00}", DatosResumidos1[2][0][1])}", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"V+={string.Format("{0:0.00}", DatosResumidos2[2][0][0])}", 1, 0, 0, 0)); Tabla2.AddCell(Vcell($" ", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"V-={string.Format("{0:0.00}", DatosResumidos2[2][0][1])}", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"V+={string.Format("{0:0.00}", DatosResumidos3[2][0][0])}", 1, 0, 0, 0)); Tabla2.AddCell(Vcell($" ", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"V-={string.Format("{0:0.00}", DatosResumidos3[2][0][1])}", 0, 1, 0, 0)); //Primer Tramo if (DatosResumidos1[2][1][0].ToString() != string.Empty && DatosResumidos1[2][1][1].ToString() != string.Empty) { Tabla2.AddCell(Vcell($"{DatosResumidos1[2][1][0]}", 1, 0, 0, 1)); Tabla2.AddCell(Vcell($" ", 0, 0, 0, 1)); Tabla2.AddCell(Vcell($"{DatosResumidos1[2][1][1]}", 0, 0, 0, 1)); } else if (DatosResumidos1[2][1][0].ToString() != string.Empty) { Tabla2.AddCell(Vcell($"{DatosResumidos1[2][1][0]}", 1, 0, 0, 1, 3)); } else if (DatosResumidos1[2][1][1].ToString() != string.Empty) { Tabla2.AddCell(Vcell($"{DatosResumidos1[2][1][1]}", 1, 0, 0, 1, 3)); } else { Tabla2.AddCell(Vcell($" ", 1, 0, 0, 1, 3)); } //Segundo Tramo if (DatosResumidos2[2][1][0].ToString() != string.Empty && DatosResumidos2[2][1][1].ToString() != string.Empty) { Tabla2.AddCell(Vcell($"{DatosResumidos2[2][1][0]}", 1, 0, 0, 1)); Tabla2.AddCell(Vcell($" ", 0, 0, 0, 1)); Tabla2.AddCell(Vcell($"{DatosResumidos2[2][1][1]}", 0, 0, 0, 1)); } else if (DatosResumidos2[2][1][0].ToString() != string.Empty) { Tabla2.AddCell(Vcell($"{DatosResumidos2[2][1][0]}", 1, 0, 0, 1, 3)); } else if (DatosResumidos2[2][1][0].ToString() != string.Empty) { Tabla2.AddCell(Vcell($"{DatosResumidos2[2][1][0]}", 1, 0, 0, 1, 3)); } else if (DatosResumidos2[2][1][1].ToString() != string.Empty) { Tabla2.AddCell(Vcell($"{DatosResumidos2[2][1][1]}", 1, 0, 0, 1, 3)); } else { Tabla2.AddCell(Vcell($" ", 1, 0, 0, 1, 3)); } //Tercera Tramo if (DatosResumidos3[2][1][0].ToString() != string.Empty && DatosResumidos3[2][1][1].ToString() != string.Empty) { Tabla2.AddCell(Vcell($"{DatosResumidos3[2][1][0]}", 1, 0, 0, 1)); Tabla2.AddCell(Vcell($" ", 0, 0, 0, 1)); Tabla2.AddCell(Vcell($"{DatosResumidos3[2][1][1]}", 0, 1, 0, 1)); } else if (DatosResumidos3[2][1][0].ToString() != string.Empty) { Tabla2.AddCell(Vcell($"{DatosResumidos3[2][1][0]}", 1, 1, 0, 1, 3)); } else if (DatosResumidos3[2][1][1].ToString() != string.Empty) { Tabla2.AddCell(Vcell($"{DatosResumidos3[2][1][1]}", 1, 1, 0, 1, 3)); } else { Tabla2.AddCell(Vcell($" ", 1, 1, 0, 1, 3)); } Tabla2.AddCell(Vcell($" ", 0, 0, 0, 0, 9)); Tablas.Add(Tabla2); #endregion Contador += 1; } int Restante = Cantidad - 3 * Contador; if (Restante == 2) { ParaDosSubTramos(ref Tablas, Subtramos[Restante - 2], Subtramos.Last()); } else if (Restante == 1) { ParaUnTramo(ref Tablas, Subtramos.Last()); } } else if (Cantidad == 2) { ParaDosSubTramos(ref Tablas, Subtramos.First(), Subtramos.Last(), nervio); } else if (Cantidad == 1) { ParaUnTramo(ref Tablas, Subtramos.First(), nervio); } return(Tablas); }
private static void ParaUnTramo(ref List <PdfPTable> Tablas, cSubTramo S1, cNervio nervio = null) { PdfPTable Tabla2 = new PdfPTable(9); string Text1 = $"Sección (BXH) {S1.Seccion.B}x{S1.Seccion.H} L={S1.Longitud}m"; if (nervio != null) { Tabla2.AddCell(Vcell($"{nervio.Nombre} - {nervio.PisoOrigen.Nombre}", BordAb: 0, Colspan: 3, IsBold: true)); Tabla2.AddCell(Vcell("", 0, 0, 0, 0, 6)); } Tabla2.AddCell(Vcell(Text1, Colspan: 3)); Tabla2.AddCell(Vcell("", 0, 0, 0, 0, 6, 9)); object[][][] DatosResumidos1 = cFunctionsProgram.EstacionesResumidas(S1.Estaciones); #region Parte Negativa Tabla2.AddCell(Vcell($"Mu-={string.Format("{0:0.00}", DatosResumidos1[1][1][0])}", 1, 0, 0, 0)); Tabla2.AddCell(Vcell($" ", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Mu-={string.Format("{0:0.00}", DatosResumidos1[1][1][1])}", 0, 1, 0, 0)); Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos1[1][2][0])}", 1, 0, 0, 0)); Tabla2.AddCell(Vcell($" ", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos1[1][2][1])}", 0, 1, 0, 0)); Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos1[1][0][0])}", 1, 0, 0, 0.5f)); Tabla2.AddCell(Vcell($" ", 0, 0, 0, 0.5f)); Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos1[1][0][1])}", 0, 1, 0, 0.5f)); #endregion #region PartePositiva Tabla2.AddCell(Vcell($"Mu+={string.Format("{0:0.00}", DatosResumidos1[0][1][0])}", 1, 0, 0, 0)); Tabla2.AddCell(Vcell($"Mu+={string.Format("{0:0.00}", DatosResumidos1[0][1][1])}", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Mu+={string.Format("{0:0.00}", DatosResumidos1[0][1][2])}", 0, 1, 0, 0)); Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos1[0][2][0])}", 1, 0, 0, 0)); Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos1[0][2][1])}", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos1[0][2][2])}", 0, 1, 0, 0)); Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos1[0][0][0])}", 1, 0, 0, 0.5f)); Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos1[0][0][1])}", 0, 0, 0, 0.5f)); Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos1[0][0][2])}", 0, 1, 0, 0.5f)); #endregion #region Estribos Tabla2.AddCell(Vcell($"V+={string.Format("{0:0.00}", DatosResumidos1[2][0][0])}", 1, 0, 0, 0)); Tabla2.AddCell(Vcell($" ", 0, 0, 0, 0)); Tabla2.AddCell(Vcell($"V-={string.Format("{0:0.00}", DatosResumidos1[2][0][1])}", 0, 1, 0, 0)); //Primer Tramo if (DatosResumidos1[2][1][0].ToString() != string.Empty && DatosResumidos1[2][1][1].ToString() != string.Empty) { Tabla2.AddCell(Vcell($"{DatosResumidos1[2][1][0]}", 1, 0, 0, 1)); Tabla2.AddCell(Vcell($" ", 0, 0, 0, 1)); Tabla2.AddCell(Vcell($"{DatosResumidos1[2][1][1]}", 0, 1, 0, 1)); } else if (DatosResumidos1[2][1][0].ToString() != string.Empty) { Tabla2.AddCell(Vcell($"{DatosResumidos1[2][1][0]}", 1, 1, 0, 1, 3)); } else if (DatosResumidos1[2][1][1].ToString() != string.Empty) { Tabla2.AddCell(Vcell($"{DatosResumidos1[2][1][1]}", 1, 1, 0, 1, 3)); } else { Tabla2.AddCell(Vcell($" ", 1, 1, 0, 1, 3)); } Tabla2.AddCell(Vcell($" ", 0, 0, 0, 0, 9)); Tablas.Add(Tabla2); #endregion }
public static void CargarNuevasSolicitacionesANevio(List <cEstacion> EstacionesNuevas, cNervio nervio) { if (ComprobarAsignacionEstacionesEnNervio(EstacionesNuevas, nervio)) { List <cEstacion> EstacionesNuevas1 = EstacionesNuevas.FindAll(z => nervio.PisoOrigen.Nombre == z.StoryLinea); List <cEstacion> Estaciones = new List <cEstacion>(); nervio.Lista_Elementos.ForEach(elemento => { if (elemento is cSubTramo) { cSubTramo subtramo = (cSubTramo)elemento; Estaciones.AddRange(subtramo.Estaciones); } }); EstacionesNuevas1.ForEach(EstacionN => { Estaciones.ForEach(EstacionA => { if (EstacionA.Equals(EstacionN)) { EstacionN.Lista_Solicitaciones.ForEach(Solic => { AsignacionNombreCombinacionRepetida(Solic.Nombre, Solic, EstacionA.Lista_Solicitaciones, 1); EstacionA.Lista_Solicitaciones.Add(Solic); }); } }); }); } else { cFunctionsProgram.VentanaEmergenteError($"No se puede agregar las nuevas solicitaciones en el nervio {nervio.Nombre}."); } }
private static bool ComprobarAsignacionEstacionesEnNervio(List <cEstacion> EstacionesNuevas, cNervio nervio) { List <cEstacion> Estaciones = new List <cEstacion>(); List <cEstacion> EstacionesNuevas1 = EstacionesNuevas.FindAll(z => nervio.PisoOrigen.Nombre == z.StoryLinea); nervio.Lista_Elementos.ForEach(elemento => { if (elemento is cSubTramo) { cSubTramo subtramo = (cSubTramo)elemento; Estaciones.AddRange(subtramo.Estaciones); } }); int CantEstacionEquals = 0; EstacionesNuevas1.ForEach(EstacionN => { Estaciones.ForEach(EstacionA => { if (EstacionA.Equals(EstacionN)) { CantEstacionEquals++; } }); }); return(CantEstacionEquals == Estaciones.Count); }