Le Code Du Programme
Le Code Du Programme
def to_radian(degrees):
def click_submit():
cohesion = float(cohesion_input.get())
surcharge = float(surcharge_input.get())
gamma = float(gamma_input.get())
gamma_b = float(gamma_b_input.get())
phi = float(phi_input.get())
height = float(height_input.get())
width = float(width_input.get())
phi_b = float(phi_b_input.get())
q_adm = float(q_adm_input.get())
F1 = sigma_h0 * z / 2
y1 = height - z / 3
F2 = sigma_h * (height - z) / 2
y2 = (height - z) / 3
y3 = width / 2
if shape.get() == 2:
M_s = W * y3
M_m = F1 * y1 + F2 * y2
e0 = M_r / W
e_c = width / 2 - e0
q = (3 * sigma_max + sigma_min) / 4
if FS1 >= 1.5 and FS2 >= 1.5 and q <= q_adm and sigma_max <= q_adm and sigma_min >= 0:
else:
B_max = 0
if shape.get() == 1:
B2 = 2 * (F1 * y1 + F2 * y2) / W
messagebox.showinfo(title="Information",
message=f"Pour que le mur soit stable il faut que la base du mur soit supérieure à
{B_max} m")
elif shape.get() == 2:
messagebox.showinfo(title="Information",
message=f"Pour que le mur soit stable il faut que la grande base du mur soit
supérieure à {B_max} m et la petite base à {b_max} m")
if value_if_allowed:
try:
float(value_if_allowed)
return True
except ValueError:
return False
else:
return False
base = Tk()
base.geometry('700x700')
base.title("Mur de soutènement")
vcmd = (base.register(validate_float),
labl_0.place(x=90, y=0)
shape = IntVar(None, 1)
Label(base,
text="Forme du mur",
justify=LEFT,
padx=20).place(x=90, y=60)
def set_shape():
# rectangle
if shape.get() == 1:
small_base_input.place_forget()
small_baseLabel.place_forget()
elif shape.get() == 2:
small_baseLabel.place(x=80, y=490)
small_base_input.place(x=240, y=490)
Radiobutton(base,
text="Rectangle",
padx=20,
variable=shape,
value=1,
command=set_shape).place(x=90, y=80)
Radiobutton(base,
text="Trapèze",
padx=20,
variable=shape,
value=2,
command=set_shape).place(x=90, y=100)
cohesionLabel.place(x=80, y=130)
cohesion_input.place(x=240, y=130)
surcharge_input.place(x=240, y=170)
gammaLabel.place(x=0, y=210)
gamma_input.place(x=240, y=210)
gamma_bLabel.place(x=0, y=250)
gamma_b_input.place(x=240, y=250)
phiLabel.place(x=0, y=290)
phi_input.place(x=240, y=290)
heightLabel.place(x=80, y=330)
height_input.place(x=240, y=330)
widthLabel.place(x=80, y=370)
width_input.place(x=240, y=370)
phi_bLabel = Label(base, text="Frottement entre sol et béton en degré", width=30, font=("bold", 10))
phi_bLabel.place(x=0, y=410)
phi_b_input.place(x=240, y=410)
q_admLabel.place(x=80, y=450)
q_adm_input.place(x=240, y=450)
if shape.get() == 2:
small_baseLabel.place(x=80, y=490)
small_base_input.place(x=240, y=490)
def run(name):
base.mainloop()
if _name_ == '_main_':
run('PyCharm')