Skip to content

Commit

Permalink
[link] index of single link is called "single"
Browse files Browse the repository at this point in the history
and speech text is shorter
see paparazzi#1098
  • Loading branch information
gautierhattenberger authored and flixr committed Mar 16, 2015
1 parent 3e4169c commit 80cc06b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion sw/ground_segment/cockpit/live.ml
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,7 @@ let get_fbw_msg = fun alarm _sender vs ->
let get_telemetry_status = fun alarm _sender vs ->
let ac = get_ac vs in
let link_id = Pprz.string_assoc "link_id" vs in
let link_id = try if int_of_string link_id = -1 then "single" else link_id with _ -> link_id in
(* Update color and lost time in the strip *)
let time_lost = Pprz.float_assoc "time_since_last_msg" vs in
let (links_up, total_links) = ac.link_page#links_ratio () in
Expand All @@ -864,7 +865,7 @@ let get_telemetry_status = fun alarm _sender vs ->
let ping_time = Pprz.float_assoc "ping_time" vs in
if (not (ac.link_page#link_exists link_id)) then begin
ac.link_page#add_link link_id;
log_and_say alarm ac.ac_name (sprintf "%s, new link detected: %s" ac.ac_speech_name link_id)
log_and_say alarm ac.ac_name (sprintf "%s, link %s detected" ac.ac_speech_name link_id)
end;
let link_changed = ac.link_page#update_link link_id time_lost ping_time rx_msgs_rate downlink_bytes_rate uplink_lost_time in
let (links_up, _) = ac.link_page#links_ratio () in
Expand Down
4 changes: 2 additions & 2 deletions sw/ground_segment/tmtc/link.ml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type ground_device = {
let my_id = 0

(* Here we set the default id of the link*)
let link_id = ref 0
let link_id = ref (-1)
let red_link = ref false

(* enable broadcast messages by default *)
Expand Down Expand Up @@ -492,7 +492,7 @@ let () =
Ivy.init "Link" "READY" (fun _ _ -> ());
Ivy.start !ivy_bus;

if (!link_id <> 0) && (not !red_link) then
if (!link_id <> -1) && (not !red_link) then
fprintf stderr "\nLINK WARNING: The link id was set to %i but the -redlink flag wasn't set. To use this link as a redundant link, set the -redlink flag.%!" !link_id;

try
Expand Down

0 comments on commit 80cc06b

Please sign in to comment.