ezgo 0.0.3__py3-none-any.whl → 0.0.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ezgo/ui.py ADDED
@@ -0,0 +1,77 @@
1
+ import tkinter as tk
2
+ import platform
3
+ import os
4
+
5
+
6
+ if platform.system() == "Linux":
7
+ os.environ["DISPLAY"] = ":0"
8
+
9
+ class APP(tk.Tk):
10
+ def __init__(self, title="APP", width=480, height=800):
11
+ super().__init__()
12
+ self.title_text = title
13
+ self.title(self.title_text)
14
+ self.geometry(f"{width}x{height}")
15
+
16
+ if platform.system() == "Linux":
17
+ self.resizable(False, False) # 固定窗口大小
18
+ self.attributes('-fullscreen', True) # 全屏
19
+ self.config(cursor="none") # 隐藏鼠标
20
+ self.update_idletasks() # 强制立即应用全屏,避免闪烁/延迟
21
+
22
+ # 显示图像和文字的全局变量
23
+ self.image = None # 显示的图像
24
+ self.text = "" # 显示的文字
25
+
26
+ self.is_running = True # 程序运行状态
27
+
28
+ # 初始化组件
29
+ self.create_widgets()
30
+ # 绑定窗口关闭事件
31
+ self.protocol("WM_DELETE_WINDOW", self.on_close)
32
+
33
+ def create_widgets(self):
34
+ # 标题
35
+ title_label = tk.Label(self, text=self.title_text, font=("SimHei", 18))
36
+ title_label.pack(pady=5)
37
+
38
+ # 图像显示区域
39
+ self.frame1 = tk.LabelFrame(self, text="图像", width=480, height=480, font=("SimHei", 10))
40
+ self.frame1.pack_propagate(False)
41
+ self.frame1.pack(fill=tk.X, pady=5)
42
+ self.image_label = tk.Label(self.frame1)
43
+ self.image_label.pack(pady=5, fill=tk.BOTH, expand=True, anchor=tk.CENTER)
44
+
45
+ # 文字显示区域
46
+ self.frame2 = tk.LabelFrame(self, text="结果", width=480, height=200, font=("SimHei", 10))
47
+ self.frame2.pack_propagate(False)
48
+ self.frame2.pack(fill=tk.X, pady=5)
49
+ self.text_label = tk.Label(self.frame2,
50
+ text="文本显示",
51
+ font=("SimHei", 14),
52
+ wraplength=450,
53
+ justify=tk.CENTER,)
54
+ self.text_label.pack(pady=5, fill=tk.BOTH, expand=True, anchor=tk.CENTER)
55
+
56
+
57
+ # 退出按钮
58
+ self.exit_btn = tk.Button(self, text="退出", command=self.on_close, font=("SimHei", 16))
59
+ self.exit_btn.pack(pady=10)
60
+
61
+
62
+ def set_image(self, image):
63
+ """设置显示的图像"""
64
+ self.image = image
65
+ self.image_label.config(image=self.image)
66
+
67
+ def set_text(self, text):
68
+ """设置显示的文字"""
69
+ self.text = text
70
+ self.text_label.config(text=self.text)
71
+
72
+ def on_close(self):
73
+ """窗口关闭/退出按钮回调"""
74
+ self.is_running = False
75
+ self.quit() # 退出主循环
76
+ self.destroy() # 销毁窗口
77
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ezgo
3
- Version: 0.0.3
3
+ Version: 0.0.5
4
4
  Summary: 宇树Go2机器狗Python控制库
5
5
  Author-email: ezgo <noreply@example.com>
6
6
  License: MIT
@@ -0,0 +1,11 @@
1
+ ezgo/__init__.py,sha256=6OsmnWvKm2s_BqjwPGTqeYpYt4XUybSAOnvOdDJzCLw,1978
2
+ ezgo/camera.py,sha256=Vsr44vFtaop4LE0DlWyOHyvxF-jHnVO8iMPUwp5mbsE,2538
3
+ ezgo/go2.py,sha256=lSZwpYRAljcV4bAalkZXvs9X-qMaEGcuaHSNegGcX6M,31610
4
+ ezgo/go2_camera.py,sha256=nawUSLyvqTNiVRQ2sM-UdoJzqwZcySltLbCfUb0G9Qc,8614
5
+ ezgo/go2_vui.py,sha256=52I4Y8uqGkW9muDEnDzQ236HqVVTIgNIN_2gW5RTC48,10161
6
+ ezgo/ui.py,sha256=jUik6maaoemI2vsBM92OLZfJfskg54W7hwMls_gxppg,2777
7
+ ezgo-0.0.5.dist-info/LICENSE,sha256=Zk4eZBT3KaBhqM3LB_xN7QquwnoWsEHAoA6eLdE6W5M,1060
8
+ ezgo-0.0.5.dist-info/METADATA,sha256=Mooo_ZwJzl44ylJkPQHgsFUdV0nwCf0HZaxMuyKvsso,6869
9
+ ezgo-0.0.5.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
10
+ ezgo-0.0.5.dist-info/top_level.txt,sha256=BdCFEVD5V_4FxUtvH0BVlZKgxYnp7EKNsYs5OyFxj-g,5
11
+ ezgo-0.0.5.dist-info/RECORD,,
@@ -0,0 +1 @@
1
+ ezgo
@@ -1,5 +0,0 @@
1
- ezgo-0.0.3.dist-info/LICENSE,sha256=Zk4eZBT3KaBhqM3LB_xN7QquwnoWsEHAoA6eLdE6W5M,1060
2
- ezgo-0.0.3.dist-info/METADATA,sha256=qEtfbg05-bsvBAB_mQ1tpxFarb7go-SUOPTPw7p7NKI,6869
3
- ezgo-0.0.3.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
4
- ezgo-0.0.3.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
5
- ezgo-0.0.3.dist-info/RECORD,,
@@ -1 +0,0 @@
1
-
File without changes
File without changes