sistemata la legenda sulla mappa ppi

This commit is contained in:
VALLONGOL 2025-10-15 10:17:17 +02:00
parent 1575c1b38a
commit e106a08cf5
2 changed files with 14 additions and 2 deletions

View File

@ -3,7 +3,7 @@
"scan_limit": 60, "scan_limit": 60,
"max_range": 100, "max_range": 100,
"geometry": "1200x1024+463+195", "geometry": "1200x1024+463+195",
"last_selected_scenario": "scenario1", "last_selected_scenario": "scenario2",
"connection": { "connection": {
"target": { "target": {
"type": "tftp", "type": "tftp",

View File

@ -68,7 +68,19 @@ class PPIDisplay(ttk.Frame):
self.ax.set_ylim(0, self.range_var.get()) self.ax.set_ylim(0, self.range_var.get())
angles = np.arange(0, 360, 30) 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("")
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.set_thetagrids(angles, labels)
self.ax.tick_params(axis='x', colors='white', labelsize=8) self.ax.tick_params(axis='x', colors='white', labelsize=8)