mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-07 17:49:49 +08:00
*** empty log message ***
This commit is contained in:
@@ -40,6 +40,7 @@ type value =
|
||||
type field = {
|
||||
_type : _type;
|
||||
fformat : format;
|
||||
alt_unit_coef : string option
|
||||
}
|
||||
|
||||
type link_mode = Forwarded | Broadcasted
|
||||
@@ -156,7 +157,8 @@ let field_of_xml = fun xml ->
|
||||
let t = ExtXml.attrib xml "type" in
|
||||
let t = if is_array_type t then ArrayType (type_of_array_type t) else Scalar t in
|
||||
let f = try Xml.attrib xml "format" with _ -> default_format t in
|
||||
(String.lowercase (ExtXml.attrib xml "name"), { _type = t; fformat = f })
|
||||
let auc = try Some (Xml.attrib xml "alt_unit_coef") with _ -> None in
|
||||
(String.lowercase (ExtXml.attrib xml "name"), { _type = t; fformat = f; alt_unit_coef = auc })
|
||||
|
||||
let string_of_values = fun vs ->
|
||||
String.concat " " (List.map (fun (a,v) -> sprintf "%s=%s" a (string_of_value v)) vs)
|
||||
|
||||
@@ -36,7 +36,11 @@ type _type =
|
||||
type value =
|
||||
Int of int | Float of float | String of string | Int32 of int32
|
||||
| Array of value array
|
||||
type field = { _type : _type; fformat : format; }
|
||||
type field = {
|
||||
_type : _type;
|
||||
fformat : format;
|
||||
alt_unit_coef : string option
|
||||
}
|
||||
type link_mode = Forwarded | Broadcasted
|
||||
type message = {
|
||||
name : string;
|
||||
|
||||
+13
-8
@@ -453,14 +453,18 @@ let load_log = fun ?factor (plot:plot) (menubar:GMenu.menu_shell GMenu.factory)
|
||||
Hashtbl.iter
|
||||
(fun f v -> if not (List.mem f !l) then l := f :: !l)
|
||||
fields;
|
||||
let l = List.map (fun f ->
|
||||
let values = Hashtbl.find_all fields f in
|
||||
let values = List.map (fun (t, v) -> (t, pprz_float v)) values in
|
||||
let values = Array.of_list values in
|
||||
Array.sort compare values;
|
||||
(f, values))
|
||||
(List.sort compare !l) in
|
||||
(msg.Pprz.name, l))
|
||||
let sorted_fields = List.sort compare !l in
|
||||
|
||||
let field_values_assoc =
|
||||
List.map
|
||||
(fun f ->
|
||||
let values = Hashtbl.find_all fields f in
|
||||
let values = List.map (fun (t, v) -> (t, pprz_float v)) values in
|
||||
let values = Array.of_list values in
|
||||
Array.sort compare values;
|
||||
(f, values))
|
||||
sorted_fields in
|
||||
(msg.Pprz.name, field_values_assoc))
|
||||
msgs in
|
||||
|
||||
(* Store data for other windows *)
|
||||
@@ -508,6 +512,7 @@ let screenshot = fun frame ->
|
||||
end
|
||||
|
||||
|
||||
(*****************************************************************************)
|
||||
let rec plot_window = fun init ->
|
||||
let plotter = GWindow.window ~allow_shrink:true ~title:"Log Plotter" () in
|
||||
plotter#set_icon (Some (GdkPixbuf.from_file Env.icon_file));
|
||||
|
||||
Reference in New Issue
Block a user