# main.py

import sys
sys.path.append("C:\\Users\\promerogomb\\Desktop\\Proyectos UNAV\\LaunchSim\\src")

import os
import tkinter as tk
from tkinter import ttk

# Importamos las distintas pestañas
from tabs.tab_simulator import TabSimulator
from tabs.tab_search import TabSearch
from tabs.tab_drag import TabDrag
from tabs.tab_coil import TabCoil
from tabs.tab_electrical import TabElectrical

class MainApp:
    def __init__(self, master):
        self.master = master
        self.master.title("LaunchSim")

        # Intento de cargar icono (opcional)
        icon_path = os.path.join(os.path.dirname(__file__), "static", "icon.ico")
        if os.path.exists(icon_path):
            self.master.iconbitmap(icon_path)
        else:
            print(f"Advertencia: Icono no encontrado en {icon_path}")

        self.notebook = ttk.Notebook(master)
        self.notebook.pack(fill="both", expand=True)

        # Pestaña 1: Simulador
        self.tab_sim = TabSimulator(self.notebook)
        self.notebook.add(self.tab_sim.frame, text="Simulador Trayectoria")

        # Pestaña 2: Rozamiento
        self.tab_drag = TabDrag(self.notebook, self.tab_sim)
        self.notebook.add(self.tab_drag.frame, text="Rozamiento")

        # Pestaña 3: Optimización
        self.tab_search = TabSearch(self.notebook, self.tab_sim)
        self.notebook.add(self.tab_search.frame, text="Optimización")

        # Pestaña 4: Bobinas
        self.tab_coil = TabCoil(self.notebook, self.tab_sim)
        self.notebook.add(self.tab_coil.frame, text="Bobinas")

        # Pestaña 5: Eléctrico
        self.tab_elec = TabElectrical(self.notebook, self.tab_sim, self.tab_coil)
        self.notebook.add(self.tab_elec.frame, text="Eléctrico")

if __name__ == "__main__":
    root = tk.Tk()
    app = MainApp(root)
    root.mainloop()
