|
|
@@ -363,7 +363,11 @@ def crear_validar_combinaciones(restricciones_df, compatibilidades_df):
|
|
|
return combinaciones_validas, patrones
|
|
|
|
|
|
|
|
|
-def limpiar_combos(combos, mascara, coef_comp):
|
|
|
+def limpiar_combos(combos, mascara, coef_comp, restricciones_df):
|
|
|
+ num_permanentes = 0
|
|
|
+ for i, _ in enumerate(restricciones_df.loc[:,"Tipo"]):
|
|
|
+ if restricciones_df.loc[i,"Tipo"] == "No constante":
|
|
|
+ num_permanentes += 1
|
|
|
combos_limpios = []
|
|
|
for combo in combos:
|
|
|
peligro = 0
|
|
|
@@ -371,7 +375,7 @@ def limpiar_combos(combos, mascara, coef_comp):
|
|
|
for i, _ in enumerate(combo_masc):
|
|
|
if combo_masc[i] == coef_comp:
|
|
|
peligro += 1
|
|
|
- if peligro < 2:
|
|
|
+ if peligro < 2 + num_permanentes:
|
|
|
combos_limpios.append(combo)
|
|
|
return np.array(combos_limpios)
|
|
|
|
|
|
@@ -428,7 +432,7 @@ def generar_combinaciones_norma_IAPF(combinaciones_validas, restricciones_df, no
|
|
|
coeficientes_ELSC[i] = normas["IAPF"]["ELS"]["Favorable"]["Persistente"]["Cte"]
|
|
|
coeficientes_ELSF[i] = normas["IAPF"]["ELS"]["Favorable"]["Persistente"]["Cte"]
|
|
|
coeficientes_ELSCP[i] = normas["IAPF"]["ELS"]["Favorable"]["Persistente"]["Cte"]
|
|
|
- elif restricciones_df.loc[i,"Tipo"] == "No Constante":
|
|
|
+ elif restricciones_df.loc[i,"Tipo"] == "No constante":
|
|
|
if restricciones_df.loc[i,"Direccion"] == "Desfavorable":
|
|
|
#ELU
|
|
|
coeficientes_ELUP[i] = normas["IAPF"]["ELU"]["Desfavorable"]["Persistente"]["NoCte"]
|
|
|
@@ -616,10 +620,10 @@ def generar_combinaciones_norma_IAPF(combinaciones_validas, restricciones_df, no
|
|
|
mascara = np.multiply(np.ones(len(restricciones_array)), (restricciones_array == "Variable").astype(int))
|
|
|
|
|
|
|
|
|
- combos_ELUP = limpiar_combos(combos_ELUP, mascara, 1.5)
|
|
|
- combos_ELSC = limpiar_combos(combos_ELSC, mascara, 1)
|
|
|
- combos_ELSF = limpiar_combos(combos_ELSF, mascara, 1)
|
|
|
- combos_ELSCP = limpiar_combos(combos_ELSCP, mascara, 1)
|
|
|
+ combos_ELUP = limpiar_combos(combos_ELUP, mascara, 1.5, restricciones_df)
|
|
|
+ combos_ELSC = limpiar_combos(combos_ELSC, mascara, 1, restricciones_df)
|
|
|
+ combos_ELSF = limpiar_combos(combos_ELSF, mascara, 1, restricciones_df)
|
|
|
+ combos_ELSCP = limpiar_combos(combos_ELSCP, mascara, 1, restricciones_df)
|
|
|
|
|
|
return combos_ELUP, combos_ELUA, combos_ELUS, combos_ELSC, combos_ELSF, combos_ELSCP
|
|
|
|
|
|
@@ -663,8 +667,8 @@ def main(ruta_excel, norma_proyecto, vias_cargadas):
|
|
|
acum_c = agregar_combinaciones_carga(combos_ELUP, "ELU_P", tot_combos, patrones, 0)
|
|
|
acum_c += agregar_combinaciones_carga(combos_ELUA, "ELU_ACC", tot_combos, patrones, acum_c)
|
|
|
acum_c += agregar_combinaciones_carga(combos_ELUS, "ELU_SIS", tot_combos, patrones, acum_c)
|
|
|
- acum_c += agregar_combinaciones_carga(combos_ELSC, "ELS_C_", tot_combos, patrones, acum_c)
|
|
|
- acum_c += agregar_combinaciones_carga(combos_ELSF, "ELS_F_", tot_combos, patrones, acum_c)
|
|
|
+ acum_c += agregar_combinaciones_carga(combos_ELSC, "ELS_C", tot_combos, patrones, acum_c)
|
|
|
+ acum_c += agregar_combinaciones_carga(combos_ELSF, "ELS_F", tot_combos, patrones, acum_c)
|
|
|
_ = agregar_combinaciones_carga(combos_ELSCP, "ELS_CP", tot_combos, patrones, acum_c)
|
|
|
print("")
|
|
|
total_envolventes = 0
|
|
|
@@ -674,8 +678,8 @@ def main(ruta_excel, norma_proyecto, vias_cargadas):
|
|
|
acum = crear_combo_envolvente("1. ENV ELU P", "ELU_P", total_envolventes, 0)
|
|
|
acum += crear_combo_envolvente("2. ENV ELU ACC", "ELU_ACC", total_envolventes, acum)
|
|
|
acum += crear_combo_envolvente("3. ENV ELU SIS", "ELU_SIS", total_envolventes, acum)
|
|
|
- acum += crear_combo_envolvente("4. ENV ELS C", "ELS_C_", total_envolventes, acum)
|
|
|
- acum += crear_combo_envolvente("5. ENV ELS F", "ELS_F_", total_envolventes, acum)
|
|
|
+ acum += crear_combo_envolvente("4. ENV ELS C", "ELS_C", total_envolventes, acum)
|
|
|
+ acum += crear_combo_envolvente("5. ENV ELS F", "ELS_F", total_envolventes, acum)
|
|
|
_ = crear_combo_envolvente("6. ENV ELS CP", "ELS_CP", total_envolventes, acum)
|
|
|
|
|
|
|
|
|
@@ -695,12 +699,12 @@ def crear_ventana_configuracion():
|
|
|
titulo.pack(pady=10)
|
|
|
|
|
|
# Checkbox 1: Borrar combinaciones
|
|
|
- var_combos = tk.BooleanVar(value=True)
|
|
|
+ var_combos = tk.BooleanVar(value=False)
|
|
|
check_combos = tk.Checkbutton(ventana, text="Borrar combinaciones existentes", variable=var_combos, font=("Arial", 10))
|
|
|
check_combos.pack(anchor=tk.W, padx=20, pady=5)
|
|
|
|
|
|
# Checkbox 2: Borrar cargas
|
|
|
- var_cargas = tk.BooleanVar(value=True)
|
|
|
+ var_cargas = tk.BooleanVar(value=False)
|
|
|
check_cargas = tk.Checkbutton(ventana, text="Borrar cargas existentes", variable=var_cargas, font=("Arial", 10))
|
|
|
check_cargas.pack(anchor=tk.W, padx=20, pady=5)
|
|
|
|