Fix jwt-token
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user