84 lines
2.1 KiB
Python
84 lines
2.1 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
测试GUI导入
|
|
"""
|
|
|
|
import sys
|
|
import traceback
|
|
|
|
try:
|
|
print("开始导入...")
|
|
|
|
print("1. 导入customtkinter...")
|
|
import customtkinter as ctk
|
|
print(" 成功!")
|
|
|
|
print("2. 导入matplotlib...")
|
|
import matplotlib
|
|
matplotlib.use('TkAgg') # 使用TkAgg后端
|
|
import matplotlib.pyplot as plt
|
|
print(" 成功!")
|
|
|
|
print("3. 导入encoder...")
|
|
from core.encoder import BitFieldEncoder
|
|
print(" 成功!")
|
|
|
|
print("4. 导入simulator...")
|
|
from core.simulator import EventSimulatorV4
|
|
print(" 成功!")
|
|
|
|
print("5. 导入data_writer...")
|
|
from core.data_writer import DataWriterV4
|
|
print(" 成功!")
|
|
|
|
print("6. 导入config_manager...")
|
|
from config.config_manager import ConfigManager
|
|
print(" 成功!")
|
|
|
|
print("7. 导入status_bar...")
|
|
from gui.widgets.status_bar import StatusBar
|
|
print(" 成功!")
|
|
|
|
print("8. 导入quick_config...")
|
|
from gui.tabs.quick_config import QuickConfigTab
|
|
print(" 成功!")
|
|
|
|
print("9. 导入detector_config...")
|
|
from gui.tabs.detector_config import DetectorConfigTab
|
|
print(" 成功!")
|
|
|
|
print("10. 导入advanced_config...")
|
|
from gui.tabs.advanced_config import AdvancedConfigTab
|
|
print(" 成功!")
|
|
|
|
print("11. 导入hardware_control...")
|
|
from gui.tabs.hardware_control import HardwareControlTab
|
|
print(" 成功!")
|
|
|
|
print("12. 导入result_preview...")
|
|
from gui.tabs.result_preview import ResultPreviewTab
|
|
print(" 成功!")
|
|
|
|
print("13. 导入main_window...")
|
|
from gui.main_window import MainWindow
|
|
print(" 成功!")
|
|
|
|
print("\n所有导入成功!")
|
|
|
|
# 尝试创建主窗口
|
|
print("\n尝试创建主窗口...")
|
|
ctk.set_appearance_mode("dark")
|
|
ctk.set_default_color_theme("blue")
|
|
|
|
app = MainWindow()
|
|
print("主窗口创建成功!")
|
|
|
|
# 运行主循环
|
|
print("启动主循环...")
|
|
app.mainloop()
|
|
|
|
except Exception as e:
|
|
print(f"\n错误: {e}")
|
|
traceback.print_exc()
|
|
sys.exit(1)
|