You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
"""
无人机决策系统 - 主程序入口
作者:刘宇杰
日期: 2025-07-13
功能说明:
本文件为系统入口,负责初始化配置、加载主界面、启动应用。
"""
import os
from gui . login_window import LoginWindow
from gui . main_window import MainWindow
from config . settings import settings
from utils . file_utils import FileUtils
def main ( ) :
"""
应用程序入口点。
负责初始化并启动登录窗口,登录成功后进入主界面。
"""
# 确保必要的目录存在
# 如果uploads是文件, 先删除
if os . path . exists ( settings . UPLOAD_FOLDER ) and os . path . isfile ( settings . UPLOAD_FOLDER ) :
os . remove ( settings . UPLOAD_FOLDER )
FileUtils . create_secure_upload_dir ( settings . UPLOAD_FOLDER )
def on_login_success ( user ) :
"""
登录成功后的回调函数。
参数:
user (dict): 当前登录的用户信息。
"""
# 打开主窗口
MainWindow ( user )
# 显示登录窗口
LoginWindow ( on_login_success )
if __name__ == " __main__ " :
main ( )