From 7c2cd14b1f6834cdf07dd1798d286dbd04253a02 Mon Sep 17 00:00:00 2001 From: Alexander Borg Date: Mon, 18 Aug 2025 06:04:28 +0200 Subject: [PATCH] Fix jwt-token --- test_drone_data.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test_drone_data.py b/test_drone_data.py index 26437a0..f340825 100644 --- a/test_drone_data.py +++ b/test_drone_data.py @@ -273,6 +273,13 @@ def simulate_realistic_scenario(duration_minutes=10): start_time = time.time() end_time = start_time + (duration_minutes * 60) + # Force create initial drone for testing + if len(DEVICES) > 0: + device = DEVICES[0] # Use first device + initial_drone = simulator.create_new_drone(device) + simulator.active_drones[initial_drone["id"]] = initial_drone + print(f"🎯 Test drone created: {DRONE_TYPES[initial_drone['type']]['name']} near {device['name']}") + detection_count = 0 last_update = start_time @@ -289,6 +296,10 @@ def simulate_realistic_scenario(duration_minutes=10): simulator.active_drones[new_drone["id"]] = new_drone print(f"🆕 New {DRONE_TYPES[new_drone['type']]['name']} spawned near {device['name']}") + # Debug: Print active drones count + if len(simulator.active_drones) == 0: + print("⚠️ No active drones - waiting for spawns...") + # Update all active drones drones_to_remove = [] for drone_id, drone in simulator.active_drones.items(): @@ -300,10 +311,15 @@ def simulate_realistic_scenario(duration_minutes=10): drones_to_remove.append(drone_id) continue + # Debug: Print drone position + print(f"🔍 Checking drone {drone_id} at ({drone['lat']:.4f}, {drone['lon']:.4f})") + # Check detection for each device for device in DEVICES: should_detect, distance = simulator.should_detect_drone(drone, device) + print(f" 📡 Device {device['name']}: distance={distance:.2f}km, should_detect={should_detect}") + if should_detect: detection = simulator.generate_detection(drone, device, distance) detection["_distance"] = f"{distance:.1f}" # For logging only