#!/usr/bin/env python3
"""
MBARI CSEM Triggerbox - Main Entry Point

This is the main entry point for the CSEM Triggerbox application.
It initializes the GUI and starts the application.
"""

import tkinter as tk
import sys
import os
import traceback

# Add current directory to path for imports
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))

from gui import GPSApp

def main():
    """Main application entry point"""
    try:
        # Create the main window
        root = tk.Tk()
        
        # Initialize the application
        app = GPSApp(root)
        
        # Start the GUI event loop
        root.mainloop()
        
    except KeyboardInterrupt:
        print("\n[MAIN] Application interrupted by user")
        sys.exit(0)
    except Exception as e:
        print(f"[MAIN] Fatal error: {e}")
        print(f"[MAIN] Traceback:")
        traceback.print_exc()
        sys.exit(1)

if __name__ == "__main__":
    main()