98ff57ed08
Fixes Module 1 UI: - wizard_cruiser/sailing/planing: perfiles sin^n calibrados por Cm, V-bottom con ángulo de astilla, corrección zona sobre chine planeador - viewer_3d: buffer hull pendiente para eliminar race condition 500ms - viewer_lines: reescritura completa — waterlines visibles, control points interactivos (drag DelftShip-style), señal offsets_edited - main_window: conecta offsets_edited → slot _on_offsets_edited_from_viewer que propaga cambios a todos los visores, editor, 3D y barra hidrostática Módulo 2 — motor HydrostaticCurves (Task 13): - integrator.py: integrate() (Simpson+trapz), waterplane_strips(), section_areas() - upright.py: UprightHydrostatics (19 campos), compute_upright() single-pass - curves_of_form.py: HydrostaticCurves.compute(), at_draft(), to_csv_lines(), to_dict() - tests/test_module2_hydrostatics.py: 83 tests — Wigley V&V, monotonicidad, CSV export, IACS Rec.34 §4.3–4.5; todos los 224 tests pasan Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
68 lines
1.8 KiB
Python
68 lines
1.8 KiB
Python
"""
|
|
AR-ShipDesign — Punto de entrada principal.
|
|
|
|
Uso:
|
|
python main.py
|
|
"""
|
|
|
|
import sys
|
|
import os
|
|
from pathlib import Path
|
|
|
|
|
|
def main() -> int:
|
|
# Asegurar que el directorio raíz del proyecto está en el path
|
|
project_root = Path(__file__).parent
|
|
if str(project_root) not in sys.path:
|
|
sys.path.insert(0, str(project_root))
|
|
|
|
# Configurar logging antes de importar Qt
|
|
from arshipdesign.utils.logger import setup_logging
|
|
from arshipdesign.utils.settings import get_log_level
|
|
setup_logging(get_log_level())
|
|
|
|
from arshipdesign.utils.logger import get_logger
|
|
logger = get_logger("main")
|
|
logger.info("Iniciando AR-ShipDesign v0.1.0")
|
|
|
|
# Importar Qt
|
|
try:
|
|
from PySide6.QtWidgets import QApplication
|
|
from PySide6.QtCore import Qt
|
|
from PySide6.QtGui import QFont
|
|
except ImportError as e:
|
|
print(f"ERROR: No se puede importar PySide6: {e}")
|
|
print("Instala las dependencias con: pip install -r requirements.txt")
|
|
return 1
|
|
|
|
# High DPI
|
|
os.environ.setdefault("QT_AUTO_SCREEN_SCALE_FACTOR", "1")
|
|
|
|
app = QApplication(sys.argv)
|
|
app.setApplicationName("AR-ShipDesign")
|
|
app.setOrganizationName("AlvaroRomero")
|
|
app.setApplicationVersion("0.1.0")
|
|
|
|
# Fuente por defecto
|
|
font = QFont("Segoe UI", 10)
|
|
app.setFont(font)
|
|
|
|
# Aplicar tema
|
|
from arshipdesign.utils.settings import get_theme
|
|
theme = get_theme()
|
|
theme_path = Path(__file__).parent / "arshipdesign" / "ui" / "themes" / f"{theme}.qss"
|
|
if theme_path.exists():
|
|
app.setStyleSheet(theme_path.read_text(encoding="utf-8"))
|
|
|
|
# Ventana principal
|
|
from arshipdesign.ui.main_window import MainWindow
|
|
window = MainWindow()
|
|
window.show()
|
|
|
|
logger.info("Ventana principal lista")
|
|
return app.exec()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|