From e106a08cf5e6a93fd920468ccf79ea920fbc6644 Mon Sep 17 00:00:00 2001 From: VALLONGOL Date: Wed, 15 Oct 2025 10:17:17 +0200 Subject: [PATCH] sistemata la legenda sulla mappa ppi --- settings.json | 2 +- target_simulator/gui/ppi_display.py | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/settings.json b/settings.json index e101638..73b14a7 100644 --- a/settings.json +++ b/settings.json @@ -3,7 +3,7 @@ "scan_limit": 60, "max_range": 100, "geometry": "1200x1024+463+195", - "last_selected_scenario": "scenario1", + "last_selected_scenario": "scenario2", "connection": { "target": { "type": "tftp", diff --git a/target_simulator/gui/ppi_display.py b/target_simulator/gui/ppi_display.py index e5c736e..03382f6 100644 --- a/target_simulator/gui/ppi_display.py +++ b/target_simulator/gui/ppi_display.py @@ -68,7 +68,19 @@ class PPIDisplay(ttk.Frame): self.ax.set_ylim(0, self.range_var.get()) angles = np.arange(0, 360, 30) - labels = [f"{angle}°" for angle in angles] + # --- MODIFICATION START --- + # Logic to format labels as 0, +30, ..., +/-180, ..., -30 + labels = [] + for angle in angles: + if angle == 0: + labels.append("0°") + elif 0 < angle < 180: + labels.append(f"+{angle}°") + elif angle == 180: + labels.append("±180°") + else: # angle > 180 + labels.append(f"-{360 - angle}°") + # --- MODIFICATION END --- self.ax.set_thetagrids(angles, labels) self.ax.tick_params(axis='x', colors='white', labelsize=8)