|
|
|
@ -147,7 +147,7 @@ class ToggleSwitch(QWidget):
|
|
|
|
class ControlStationUI(QMainWindow):
|
|
|
|
class ControlStationUI(QMainWindow):
|
|
|
|
planning_finished = pyqtSignal(object)
|
|
|
|
planning_finished = pyqtSignal(object)
|
|
|
|
|
|
|
|
|
|
|
|
VERSION = '2.8.0'
|
|
|
|
VERSION = '2.8.2'
|
|
|
|
FONT_SCALE_MIN = 70
|
|
|
|
FONT_SCALE_MIN = 70
|
|
|
|
FONT_SCALE_MAX = 180
|
|
|
|
FONT_SCALE_MAX = 180
|
|
|
|
FONT_SCALE_DEFAULT = 100
|
|
|
|
FONT_SCALE_DEFAULT = 100
|
|
|
|
@ -1596,6 +1596,8 @@ class ControlStationUI(QMainWindow):
|
|
|
|
group.planned_waypoints = None
|
|
|
|
group.planned_waypoints = None
|
|
|
|
group.mission_target = None
|
|
|
|
group.mission_target = None
|
|
|
|
self.drone_map.clear_mission_plan_for_group(group_id)
|
|
|
|
self.drone_map.clear_mission_plan_for_group(group_id)
|
|
|
|
|
|
|
|
self.drone_map.clear_grid_sweep_area_for_group(
|
|
|
|
|
|
|
|
group_id, restart_selection=(group.mission_type == 'GRID_SWEEP'))
|
|
|
|
panel = self.group_panels.get(group_id)
|
|
|
|
panel = self.group_panels.get(group_id)
|
|
|
|
if panel:
|
|
|
|
if panel:
|
|
|
|
panel.update_status()
|
|
|
|
panel.update_status()
|
|
|
|
@ -1876,6 +1878,7 @@ class ControlStationUI(QMainWindow):
|
|
|
|
if group.executor:
|
|
|
|
if group.executor:
|
|
|
|
group.executor.stop()
|
|
|
|
group.executor.stop()
|
|
|
|
self.drone_map.clear_mission_plan_for_group(group_id)
|
|
|
|
self.drone_map.clear_mission_plan_for_group(group_id)
|
|
|
|
|
|
|
|
self.drone_map.clear_grid_sweep_area_for_group(group_id)
|
|
|
|
|
|
|
|
|
|
|
|
# 只有當操作目標組是 active 組時,才更新 UI
|
|
|
|
# 只有當操作目標組是 active 組時,才更新 UI
|
|
|
|
if group_id == self.active_group_id:
|
|
|
|
if group_id == self.active_group_id:
|
|
|
|
@ -1910,6 +1913,7 @@ class ControlStationUI(QMainWindow):
|
|
|
|
|
|
|
|
|
|
|
|
# 移除地圖上的任務計畫
|
|
|
|
# 移除地圖上的任務計畫
|
|
|
|
self.drone_map.clear_mission_plan_for_group(group_id)
|
|
|
|
self.drone_map.clear_mission_plan_for_group(group_id)
|
|
|
|
|
|
|
|
self.drone_map.clear_grid_sweep_area_for_group(group_id)
|
|
|
|
|
|
|
|
|
|
|
|
# 移除 tab
|
|
|
|
# 移除 tab
|
|
|
|
for i in range(self.group_tab_widget.count()):
|
|
|
|
for i in range(self.group_tab_widget.count()):
|
|
|
|
@ -2256,10 +2260,14 @@ class ControlStationUI(QMainWindow):
|
|
|
|
center_lat, center_lon, _ = center_origin
|
|
|
|
center_lat, center_lon, _ = center_origin
|
|
|
|
target_lat, target_lon = context['draw_target']
|
|
|
|
target_lat, target_lon = context['draw_target']
|
|
|
|
group.mission_target = (float(target_lat), float(target_lon))
|
|
|
|
group.mission_target = (float(target_lat), float(target_lon))
|
|
|
|
self.drone_map.draw_mission_plan_for_group(
|
|
|
|
if expected_mission_type == 'GRID_SWEEP':
|
|
|
|
group_id, group.color,
|
|
|
|
# Grid Sweep 的範圍已由矩形圖層表示,不另外顯示中心/目標點。
|
|
|
|
center_lat, center_lon, target_lat, target_lon
|
|
|
|
self.drone_map.clear_mission_plan_for_group(group_id)
|
|
|
|
)
|
|
|
|
else:
|
|
|
|
|
|
|
|
self.drone_map.draw_mission_plan_for_group(
|
|
|
|
|
|
|
|
group_id, group.color,
|
|
|
|
|
|
|
|
center_lat, center_lon, target_lat, target_lon
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
self._launch_verification(
|
|
|
|
self._launch_verification(
|
|
|
|
context['verification_type'], drone_gps_positions, selected_drones,
|
|
|
|
context['verification_type'], drone_gps_positions, selected_drones,
|
|
|
|
@ -2351,6 +2359,10 @@ class ControlStationUI(QMainWindow):
|
|
|
|
self.statusBar().showMessage("矩形座標解析失敗", 3000)
|
|
|
|
self.statusBar().showMessage("矩形座標解析失敗", 3000)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 將確認後的框選範圍存入群組專屬圖層,供停止任務時精準清除。
|
|
|
|
|
|
|
|
self.drone_map.draw_grid_sweep_area_for_group(
|
|
|
|
|
|
|
|
group.group_id, group.color, rect_corners)
|
|
|
|
|
|
|
|
|
|
|
|
panel = self.group_panels.get(group.group_id)
|
|
|
|
panel = self.group_panels.get(group.group_id)
|
|
|
|
params = panel.get_mission_params() if panel else {}
|
|
|
|
params = panel.get_mission_params() if panel else {}
|
|
|
|
base_alt = params.get('altitude', 10.0)
|
|
|
|
base_alt = params.get('altitude', 10.0)
|
|
|
|
|