update gui

This commit is contained in:
2026-02-04 03:46:31 +08:00
parent 44d63979b5
commit 8fdbbbc5dc
5 changed files with 491 additions and 31 deletions
+30 -3
View File
@@ -5,11 +5,38 @@ from PyQt6.QtCore import Qt
class OverviewTable(QTableWidget):
"""總覽表格,顯示所有無人機的狀態資訊"""
def __init__(self, info_types, info_type_map, parent=None):
# 默認的資訊類型和映射
DEFAULT_INFO_TYPES = ["模式", "ARM", "電壓", "經度", "緯度", "高度", "Local", "Velocity", "地速", "航向",
"空速", "油門", "HUD高", "爬升率", "Roll", "Pitch", "Yaw", "丟包", "延遲"]
DEFAULT_INFO_TYPE_MAP = {
"mode": 0,
"armed": 1,
"battery": 2,
"longitude": 3,
"latitude": 4,
"altitude": 5,
"local": 6,
"velocity": 7,
"groundspeed": 8,
"heading": 9,
"airspeed": 10,
"throttle": 11,
"hud_alt": 12,
"climb": 13,
"roll": 14,
"pitch": 15,
"yaw": 16,
"loss_rate": 17,
"ping": 18
}
def __init__(self, info_types=None, info_type_map=None, parent=None):
super().__init__(parent)
self.info_types = info_types
self.info_type_map = info_type_map
# 使用提供的或默認的資訊類型
self.info_types = info_types if info_types is not None else self.DEFAULT_INFO_TYPES
self.info_type_map = info_type_map if info_type_map is not None else self.DEFAULT_INFO_TYPE_MAP
self.drones = {} # 存儲無人機面板的引用
# 初始化表格