#title title = myfont.render("PiAware Radar", 1, GREEN) screen.blit(title, TITLEPOS) sac = myfont.render("stuffaboutcode.com", 1, GREEN) screen.blit(sac, (TITLEPOS[0], TITLEPOS[1] + LINESPACE)) #flight data timer flight_data_timer = None #get the home position home_x, home_y = lat_lon_to_x_y(args.lat, args.lon) #startup the radar radar = Radar(screen, RADARRECT, radar_pos = (home_x, home_y), scale = scale, back_col = BLACK, radar_col = GREEN) radar.start() #get the flight data myflights = FlightData(data_url = piaware_url) done = False next_refresh = pygame.time.get_ticks() while not done: #should the flights be refreshed if pygame.time.get_ticks() > next_refresh: #keep a track of the last aircraft we saw lastaircraftseen = deepcopy(myflights.aircraft) #loop through all the flights and update them
screen.blit(sac, (TITLEPOS[0], TITLEPOS[1] + LINESPACE)) #flight data timer flight_data_timer = None #get the home position home_x, home_y = lat_lon_to_x_y(args.lat, args.lon) #startup the radar radar = Radar(screen, RADARRECT, radar_pos=(home_x, home_y), scale=scale, back_col=BLACK, radar_col=GREEN) radar.start() #get the flight data myflights = FlightData(data_url=piaware_url) done = False next_refresh = pygame.time.get_ticks() while not done: #should the flights be refreshed if pygame.time.get_ticks() > next_refresh: #keep a track of the last aircraft we saw lastaircraftseen = deepcopy(myflights.aircraft) #loop through all the flights and update them
drone_ready = 2; # Drone on his spot and operational drone_flying = 3; # Drone in mission flying through the target drone_back = 4; # Drone back of a mission ready for inspection drone_destroyed = 5; # Drone destroyed during a mission drone_detected = 6; # Drone ennemi dedetected p = 30 utils = Utils(thread_list); Win = Window(utils, thread_list); utils.canvas = Win.get_canvas(); utils.label_list = Win.get_label_list(); utils.win = Win; radar = Radar(utils, thread_list, Win.get_canvas(), Win.get_label_list(), Win.get_repare_b()); thread_list.append(radar); print ("---- Drones 1 to "+str(g.NUMBER_DRONE)+" initialization ----"); for i in range(g.NUMBER_DRONE): print ("Drone : "+ str(i+1)); X = ((Win.get_width_zone() - g.NUMBER_DRONE * p) / 2 + p * i + p/2) * g.DIMENSION_COEFFICIENT; Y = Win.get_origine_Y() - 20 * g.DIMENSION_COEFFICIENT; Z = 0; drone = Drone(utils, Win.get_canvas(), i, X, Y, Z, thread_list, Win.get_label_list()[i]); thread_list.append(drone); radar.start(); Win.get_window().mainloop();