|
|
|
|
@ -147,7 +147,7 @@ class ToggleSwitch(QWidget):
|
|
|
|
|
class ControlStationUI(QMainWindow):
|
|
|
|
|
planning_finished = pyqtSignal(object)
|
|
|
|
|
|
|
|
|
|
VERSION = '2.3.1'
|
|
|
|
|
VERSION = '2.4.0'
|
|
|
|
|
FONT_SCALE_MIN = 70
|
|
|
|
|
FONT_SCALE_MAX = 180
|
|
|
|
|
FONT_SCALE_DEFAULT = 100
|
|
|
|
|
@ -414,7 +414,7 @@ class ControlStationUI(QMainWindow):
|
|
|
|
|
self.right_vertical_splitter.setChildrenCollapsible(False)
|
|
|
|
|
self.right_vertical_splitter.setStretchFactor(0, 0)
|
|
|
|
|
self.right_vertical_splitter.setStretchFactor(1, 1)
|
|
|
|
|
self.right_vertical_splitter.setSizes([170, 700])
|
|
|
|
|
self.right_vertical_splitter.setSizes([180, 640])
|
|
|
|
|
right_layout.addWidget(self.right_vertical_splitter)
|
|
|
|
|
|
|
|
|
|
# 添加地圖
|
|
|
|
|
@ -1072,7 +1072,7 @@ class ControlStationUI(QMainWindow):
|
|
|
|
|
self.group_tab_widget.show()
|
|
|
|
|
if hasattr(self, 'right_vertical_splitter'):
|
|
|
|
|
total = sum(self.right_vertical_splitter.sizes()) or self.height()
|
|
|
|
|
group_height = getattr(self, '_last_group_panel_height', 170)
|
|
|
|
|
group_height = getattr(self, '_last_group_panel_height', 230)
|
|
|
|
|
group_height = min(max(group_height, 120), max(120, total - 120))
|
|
|
|
|
self.right_vertical_splitter.setSizes([group_height, max(1, total - group_height)])
|
|
|
|
|
self.toggle_group_btn.setText("▼")
|
|
|
|
|
@ -2144,6 +2144,22 @@ class ControlStationUI(QMainWindow):
|
|
|
|
|
if isinstance(panel, DronePanel):
|
|
|
|
|
panel.update_field(field, text, color)
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
def _format_gnss_fix_type(fix_type):
|
|
|
|
|
fix_labels = {
|
|
|
|
|
0: "No GPS",
|
|
|
|
|
1: "No GPS",
|
|
|
|
|
2: "2D Fix",
|
|
|
|
|
3: "3D Fix",
|
|
|
|
|
4: "DGPS",
|
|
|
|
|
5: "RTK Float",
|
|
|
|
|
6: "RTK Fixed",
|
|
|
|
|
}
|
|
|
|
|
try:
|
|
|
|
|
return fix_labels.get(int(fix_type), f"Fix {fix_type}")
|
|
|
|
|
except (TypeError, ValueError):
|
|
|
|
|
return "--"
|
|
|
|
|
|
|
|
|
|
def update_overview_table(self, drone_id=None, field=None, value=None):
|
|
|
|
|
if not hasattr(self, 'overview_table') or self.overview_table is None: return
|
|
|
|
|
self.overview_table.set_drones(self.drones)
|
|
|
|
|
@ -2309,9 +2325,36 @@ class ControlStationUI(QMainWindow):
|
|
|
|
|
alt = gps_data.get('alt', 0)
|
|
|
|
|
if not hasattr(self.monitor, 'drone_gps'):
|
|
|
|
|
self.monitor.drone_gps = {}
|
|
|
|
|
self.monitor.drone_gps[drone_id] = {'lat': lat, 'lon': lon, 'alt': alt}
|
|
|
|
|
self.monitor.drone_gps[drone_id] = gps_data.copy()
|
|
|
|
|
self.queue_overview_update(drone_id, 'latitude', f"{lat:.6f}°")
|
|
|
|
|
self.queue_overview_update(drone_id, 'longitude', f"{lon:.6f}°")
|
|
|
|
|
fix_type = gps_data.get('fix_type')
|
|
|
|
|
satellites_visible = gps_data.get('satellites_visible')
|
|
|
|
|
eph = gps_data.get('eph')
|
|
|
|
|
epv = gps_data.get('epv')
|
|
|
|
|
fix_text = self._format_gnss_fix_type(fix_type)
|
|
|
|
|
self.update_field(panel, drone_id, 'fix_type_label', fix_text)
|
|
|
|
|
if isinstance(eph, (int, float)) and isinstance(epv, (int, float)):
|
|
|
|
|
error_text = f"{eph:.1f}/{epv:.1f}"
|
|
|
|
|
else:
|
|
|
|
|
error_text = "--"
|
|
|
|
|
self.update_field(panel, drone_id, 'gnss_error', error_text)
|
|
|
|
|
self.queue_overview_update(
|
|
|
|
|
drone_id, 'fix_type',
|
|
|
|
|
fix_text
|
|
|
|
|
)
|
|
|
|
|
self.queue_overview_update(
|
|
|
|
|
drone_id, 'satellites_visible',
|
|
|
|
|
str(satellites_visible) if satellites_visible is not None else "--"
|
|
|
|
|
)
|
|
|
|
|
self.queue_overview_update(
|
|
|
|
|
drone_id, 'eph',
|
|
|
|
|
f"{eph:.2f}" if isinstance(eph, (int, float)) else "--"
|
|
|
|
|
)
|
|
|
|
|
self.queue_overview_update(
|
|
|
|
|
drone_id, 'epv',
|
|
|
|
|
f"{epv:.2f}" if isinstance(epv, (int, float)) else "--"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
elif msg_type == 'hud':
|
|
|
|
|
hud_data = data
|
|
|
|
|
|