[gcs] remember version per aircraft

This commit is contained in:
Felix Ruess
2014-12-21 04:34:45 +01:00
parent 2c3cfc3689
commit 548f315faf
2 changed files with 10 additions and 7 deletions
+8 -6
View File
@@ -104,7 +104,8 @@ type aircraft = {
mutable last_dist_to_wp : float;
mutable dl_values : string option array;
mutable last_unix_time : float;
mutable airspeed : float
mutable airspeed : float;
mutable version : string;
}
let aircrafts = Hashtbl.create 3
@@ -681,7 +682,8 @@ let create_ac = fun alert (geomap:G.widget) (acs_notebook:GPack.notebook) (ac_id
notebook_label = _label;
got_track_status_timer = 1000;
dl_values = [||]; last_unix_time = 0.;
airspeed = 0.
airspeed = 0.;
version = ""
} in
Hashtbl.add aircrafts ac_id ac;
select_ac acs_notebook ac_id;
@@ -1389,13 +1391,13 @@ let listen_info_msg = fun a ->
tele_bind "INFO_MSG" (get_msg a)
let listen_autopilot_version_msg = fun a ->
let got_version = ref false in
let get_msg = fun a _sender vs ->
let ac = find_ac _sender in
let desc_array = Pprz.assoc "desc" vs in
if !got_version = false then
log a ac.ac_name (sprintf "%s version:\n%s" ac.ac_name (Pprz.string_of_value desc_array));
got_version := true in
let version = Pprz.string_of_value desc_array in
if ac.version <> version then
log a ac.ac_name (sprintf "%s version:\n%s" ac.ac_name version);
ac.version <- version in
tele_bind "AUTOPILOT_VERSION" (get_msg a)
let listen_tcas = fun a ->
+2 -1
View File
@@ -61,7 +61,8 @@ type aircraft = private {
mutable last_dist_to_wp : float;
mutable dl_values : string option array;
mutable last_unix_time : float;
mutable airspeed : float
mutable airspeed : float;
mutable version : string
}
val aircrafts : (string, aircraft) Hashtbl.t