[link] index of single link is called "single"

and speech text is shorter
see #1098
This commit is contained in:
Gautier Hattenberger
2015-03-03 14:53:55 +01:00
committed by Felix Ruess
parent f1309a0f34
commit 4e378b340b
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -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
@@ -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
+2 -2
View File
@@ -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 *)
@@ -491,7 +491,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