diff --git a/conf/messages.xml b/conf/messages.xml index 958892bb02..c20ced569c 100644 --- a/conf/messages.xml +++ b/conf/messages.xml @@ -269,7 +269,7 @@ - + diff --git a/sw/ground_segment/cockpit/cockpit.pl b/sw/ground_segment/cockpit/cockpit.pl index d0f2458c0e..b5106aa230 100755 --- a/sw/ground_segment/cockpit/cockpit.pl +++ b/sw/ground_segment/cockpit/cockpit.pl @@ -123,7 +123,7 @@ sub on_foo { sub ivy_on_selected { my ($sender_name, $msg_class, $msg_name, $fields, $self) = @_; print "in ivy_on_selected\n"; # if (COCKPIT_DEBUG); - my $ac_id = $fields->{aicraft_id}; + my $ac_id = $fields->{aircraft_id}; if (defined $self->{aircrafts_manager}->get_aircraft_by_id($ac_id)) { $self->select_ac($ac_id); } @@ -135,7 +135,7 @@ sub ivy_on_selected { sub on_aircraft_selection { my ($self, $_sp, $what, $new_selected_ac ) = @_; $self->select_ac($new_selected_ac); - Paparazzi::IvyProtocol::send_msg('ground', 'SELECTED', { aicraft_id => $new_selected_ac }); + Paparazzi::IvyProtocol::send_msg('ground', 'SELECTED', { aircraft_id => $new_selected_ac }); } sub select_ac { diff --git a/sw/ground_segment/cockpit/map2d.ml b/sw/ground_segment/cockpit/map2d.ml index 88105bcc76..07f4fdbbb9 100644 --- a/sw/ground_segment/cockpit/map2d.ml +++ b/sw/ground_segment/cockpit/map2d.ml @@ -239,6 +239,13 @@ let one_new_ac = fun (geomap:MapCanvas.widget) ac -> ignore (ac_menu_fact#add_item "Resize Track" ~callback:(fun () -> resize_track ac track)); let cam = ac_menu_fact#add_check_item "Cam Display" ~active:false in ignore (cam#connect#toggled (fun () -> track#set_cam_state cam#active)); + let event_ac = fun e -> + match e with + `BUTTON_PRESS _ | `BUTTON_RELEASE _ -> + Ground_Pprz.message_send "ground" "SELECTED" ["aircraft_id", Pprz.String ac]; + true + | _ -> false in + ignore (track#aircraft#connect#event event_ac); Hashtbl.add live_aircrafts ac { track = track; color = color; fp_group = None } end