80 lines
2.6 KiB
Python
80 lines
2.6 KiB
Python
"""
|
|
启动器 - 选择启动配置界面或主程序
|
|
"""
|
|
import tkinter as tk
|
|
from tkinter import ttk
|
|
import subprocess
|
|
import sys
|
|
|
|
def start_config_gui():
|
|
"""启动配置界面"""
|
|
subprocess.Popen([sys.executable, "gui_config.py"])
|
|
|
|
def start_preview():
|
|
"""启动预览窗口"""
|
|
subprocess.Popen([sys.executable, "preview.py"])
|
|
|
|
def start_main_program():
|
|
"""启动主程序"""
|
|
subprocess.Popen([sys.executable, "main.py"])
|
|
|
|
def create_launcher():
|
|
"""创建启动器界面"""
|
|
root = tk.Tk()
|
|
root.title("火炬之光自动化 - 启动器")
|
|
root.geometry("400x380")
|
|
root.resizable(False, False)
|
|
|
|
# 标题
|
|
title_frame = tk.Frame(root)
|
|
title_frame.pack(fill=tk.X, pady=20)
|
|
|
|
tk.Label(title_frame, text="火炬之光自动化脚本", font=('Arial', 16, 'bold')).pack()
|
|
tk.Label(title_frame, text="请选择要启动的功能", font=('Arial', 10)).pack()
|
|
|
|
# 按钮区域
|
|
button_frame = tk.Frame(root)
|
|
button_frame.pack(fill=tk.BOTH, expand=True, padx=40, pady=20)
|
|
|
|
# 配置界面按钮
|
|
config_btn = tk.Button(button_frame, text="⚙️ 配置管理",
|
|
command=start_config_gui,
|
|
width=30, height=3, font=('Arial', 12))
|
|
config_btn.pack(pady=10)
|
|
|
|
# 预览窗口按钮
|
|
preview_btn = tk.Button(button_frame, text="👁️ 采集卡预览",
|
|
command=start_preview,
|
|
width=30, height=3, font=('Arial', 12))
|
|
preview_btn.pack(pady=10)
|
|
|
|
# 主程序按钮
|
|
main_btn = tk.Button(button_frame, text="🚀 启动单个配置组",
|
|
command=start_main_program,
|
|
width=30, height=2, font=('Arial', 11))
|
|
main_btn.pack(pady=5)
|
|
|
|
def start_multi_program():
|
|
"""启动多配置组程序"""
|
|
subprocess.Popen([sys.executable, "main_multi.py"],
|
|
creationflags=subprocess.CREATE_NEW_CONSOLE if sys.platform == 'win32' else 0)
|
|
|
|
# 多配置组启动按钮
|
|
multi_btn = tk.Button(button_frame, text="🔥 启动多个配置组",
|
|
command=start_multi_program,
|
|
width=30, height=2, font=('Arial', 11))
|
|
multi_btn.pack(pady=5)
|
|
|
|
# 说明
|
|
info_label = tk.Label(root,
|
|
text="提示:首次使用请先点击配置管理设置参数",
|
|
font=('Arial', 9),
|
|
fg='gray')
|
|
info_label.pack(side=tk.BOTTOM, pady=10)
|
|
|
|
root.mainloop()
|
|
|
|
if __name__ == "__main__":
|
|
create_launcher()
|
|
|