2026-05-14 10:06:04 +02:00
|
|
|
import subprocess
|
|
|
|
|
import sys
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
BASE = Path(__file__).parent
|
|
|
|
|
|
2026-05-14 10:27:26 +02:00
|
|
|
|
|
|
|
|
def build_menu() -> list[tuple[str, Path]]:
|
|
|
|
|
menu = [
|
|
|
|
|
("Calcola T ambiente", BASE / "start" / "calcola_t_amb.py"),
|
|
|
|
|
("Plot dati raw", BASE / "start" / "plot_temperatura.py"),
|
|
|
|
|
]
|
|
|
|
|
for folder in sorted(BASE.glob("induttore*/")):
|
|
|
|
|
for script in sorted(folder.glob("app*.py")):
|
|
|
|
|
menu.append((f"{folder.name} — {script.name}", script))
|
|
|
|
|
menu.append(("Report completo (PDF + LaTeX)", BASE / "report_completo.py"))
|
|
|
|
|
return menu
|
|
|
|
|
|
2026-05-14 10:06:04 +02:00
|
|
|
|
|
|
|
|
def main():
|
2026-05-14 10:08:41 +02:00
|
|
|
while True:
|
2026-05-14 10:27:26 +02:00
|
|
|
menu = build_menu()
|
2026-05-14 10:08:41 +02:00
|
|
|
print("\n=== Analisi Termica Forno ===\n")
|
2026-05-14 10:27:26 +02:00
|
|
|
for i, (label, _) in enumerate(menu, 1):
|
2026-05-14 10:08:41 +02:00
|
|
|
print(f" {i}. {label}")
|
|
|
|
|
print(" 0. Esci\n")
|
2026-05-14 10:06:04 +02:00
|
|
|
|
2026-05-14 10:08:41 +02:00
|
|
|
scelta = input("Scegli: ").strip()
|
|
|
|
|
if scelta == "0":
|
|
|
|
|
break
|
2026-05-14 10:27:26 +02:00
|
|
|
if not scelta.isdigit() or not (1 <= int(scelta) <= len(menu)):
|
2026-05-14 10:08:41 +02:00
|
|
|
print("Scelta non valida.")
|
|
|
|
|
continue
|
2026-05-14 10:06:04 +02:00
|
|
|
|
2026-05-14 10:27:26 +02:00
|
|
|
_, script = menu[int(scelta) - 1]
|
2026-05-14 10:08:41 +02:00
|
|
|
subprocess.run([sys.executable, str(script)])
|
2026-05-14 10:06:04 +02:00
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
main()
|