0dbc2a4518
- Estructura completa de carpetas (236 módulos stub + implementados) - pyproject.toml, requirements, .gitignore, LICENSE (propietario) - core/project.py: serialización .arsd (ZIP con JSON) - core/units.py: conversiones SI <-> imperial completas - ui/main_window.py: layout DELFTship-style con todos los paneles - Árbol de proyecto (dock izquierda) - Tabs de módulos (centro) - Panel de propiedades (dock derecha) - Panel hidrostáticos en vivo (inferior, fijo) - ui/i18n: español e inglés - ui/themes: tema claro y oscuro - utils/logger.py, settings.py, validation.py - data/liquids.json: 15 líquidos navales - data/stability_criteria.json: IMO IS Code 2008, A.749(18), USCG - tests/test_startup.py: 12 tests, todos PASSED - Módulo scantling/ ISO 12215 (stubs Sprint 2.5) - Módulo fabrication/molds/ para moldes FRP (stubs Sprint 13B) - Módulo fabrication/ para CNC plasma/router/laser (stubs Sprint 13)
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("AlvaroRodriguez")
|
|
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())
|