*** empty log message ***

This commit is contained in:
Pascal Brisset
2006-05-05 09:10:26 +00:00
parent 5ad699c0dd
commit a56cc1e0f8
4 changed files with 38 additions and 14 deletions
+6
View File
@@ -11,6 +11,12 @@
<setting VAR="pitch_of_vz" RANGE=".1" RC="gain_1_up" TYPE="float"/> <setting VAR="pitch_of_vz" RANGE=".1" RC="gain_1_up" TYPE="float"/>
</mode> </mode>
</rc_control> </rc_control>
<dl_settings>
<dl_setting var="ir_roll_neutral" min="-0.2" max="0.2" step="0.01"/>
<dl_setting var="course_pgain" min="-1" max="-0.1" step="0.05"/>
</dl_settings>
<waypoints utm_x0="360284.8" utm_y0="4813595.5"> <waypoints utm_x0="360284.8" utm_y0="4813595.5">
<waypoint name="HOME" x="0.0" y="120.0" alt="250."/> <waypoint name="HOME" x="0.0" y="120.0" alt="250."/>
</waypoints> </waypoints>
+1 -1
View File
@@ -29,7 +29,7 @@
#ifndef TI_H #ifndef TI_H
#define TI_H #define TI_H
#define NB_ACS 4 #define NB_ACS 8
struct ac_info_ { struct ac_info_ {
float east; /* m */ float east; /* m */
+15 -6
View File
@@ -713,8 +713,8 @@ let button_press = fun (geomap:G.widget) ev ->
Ground_Pprz.message_send "map2d" "SEND_EVENT" Ground_Pprz.message_send "map2d" "SEND_EVENT"
["ac_id", Pprz.String ac; "event_id", Pprz.Int e] ["ac_id", Pprz.String ac; "event_id", Pprz.Int e]
let dl_settings = fun ac_id xml -> let dl_settings = fun ac_id ac_name xml ->
let window = GWindow.window ~title:("Datalink settings ") () in let window = GWindow.window ~title:(sprintf "Datalink settings %s" ac_name) () in
let quit = fun () -> GMain.Main.quit (); exit 0 in let quit = fun () -> GMain.Main.quit (); exit 0 in
ignore (window#connect#destroy ~callback:quit); ignore (window#connect#destroy ~callback:quit);
let vbox = GPack.vbox ~packing:window#add () in let vbox = GPack.vbox ~packing:window#add () in
@@ -734,13 +734,22 @@ let button_press = fun (geomap:G.widget) ev ->
let value = (lower +. upper) /. 2. in let value = (lower +. upper) /. 2. in
let text = ExtXml.attrib s "var" in let text = ExtXml.attrib s "var" in
let adj = GData.adjustment ~value ~lower ~upper:(upper+.10.) ~step_incr () in let adj = GData.adjustment ~value ~lower ~upper:(upper+.10.) ~step_incr () in
let hbox = GPack.hbox ~width:400 ~packing:vbox#add () in let hbox = GPack.hbox ~width:500 ~packing:vbox#add () in
let _l = GMisc.label ~width:100 ~text ~packing:hbox#pack () in let _l = GMisc.label ~width:100 ~text ~packing:hbox#pack () in
let _v = GMisc.label ~width:50 ~text:"N/A" ~packing:hbox#pack () in
let _scale = GRange.scale `HORIZONTAL ~digits:2 ~adjustment:adj ~packing:hbox#add () in let _scale = GRange.scale `HORIZONTAL ~digits:2 ~adjustment:adj ~packing:hbox#add () in
let ii = !i in let ii = !i in
let b = GButton.button ~label:"Update" ~stock:`REFRESH ~packing:hbox#pack () in (*** let b = GButton.button ~label:"Update" ~stock:`REFRESH ~packing:hbox#pack () in
let update = fun () -> adj#set_value current_values.(ii) in let update = fun () -> adj#set_value current_values.(ii) in
ignore (b#connect#clicked ~callback:update); ignore (b#connect#clicked ~callback:update); ***)
let update_current_value = fun _ ->
let s = string_of_float current_values.(ii) in
if _v#text <> s then
_v#set_text s;
true in
ignore (Glib.Timeout.add 500 update_current_value);
let callback = fun () -> let callback = fun () ->
let vs = ["ac_id", Pprz.String ac_id; "index", Pprz.Int ii;"value", Pprz.Float adj#value] in let vs = ["ac_id", Pprz.String ac_id; "index", Pprz.Int ii;"value", Pprz.Float adj#value] in
@@ -835,7 +844,7 @@ let create_ac = fun (geomap:G.widget) ac_id config ->
let fp_xml = ExtXml.child fp_xml_dump "flight_plan" in let fp_xml = ExtXml.child fp_xml_dump "flight_plan" in
let ds_window, ds_adjs = dl_settings ac_id fp_xml in let ds_window, ds_adjs = dl_settings ac_id name fp_xml in
let fp = load_mission color geomap fp_xml in let fp = load_mission color geomap fp_xml in
fp#hide (); fp#hide ();
+16 -7
View File
@@ -125,15 +125,18 @@ module Wc = struct
done; done;
b.(buffer_size-1) <- null_buffer_entry b.(buffer_size-1) <- null_buffer_entry
let rec flush = fun () -> let rec repeat_send = fun fd cmd n ->
W.send fd cmd;
timer := Some (GMain.Timeout.add 300 (fun _ -> Debug.trace 'b' (sprintf "Retry %d" n); repeat_send fd cmd (n+1); false))
let rec flush = fun n ->
let status, b = buffer in let status, b = buffer in
if !status = Ready then if !status = Ready then
let (priority, fd, cmd) = b.(0) in let (priority, fd, cmd) = b.(0) in
if priority <> Null then begin if priority <> Null then begin
Debug.trace 'w' (sprintf "%.2f send" (Unix.gettimeofday ())); shift_buffer b;
W.send fd cmd;
status := Busy; status := Busy;
timer := Some (GMain.Timeout.add 300 (fun _ -> Debug.trace 'b' "Retry"; flush (); false)) repeat_send fd cmd 0
end end
let buffer_ready = fun () -> let buffer_ready = fun () ->
@@ -155,6 +158,7 @@ module Wc = struct
for j = i + 1 to buffer_size - 1 do (** Shift *) for j = i + 1 to buffer_size - 1 do (** Shift *)
b.(j) <- b.(j-1) b.(j) <- b.(j-1)
done; done;
Debug.trace 'b' (sprintf "Set in %d" i);
b.(i) <- (priority, fd, cmd) b.(i) <- (priority, fd, cmd)
end end
else else
@@ -174,15 +178,19 @@ module Wc = struct
match com with match com with
W.RECEIVED_FRAME -> W.RECEIVED_FRAME ->
use_tele_message (Serial.payload_of_string data) use_tele_message (Serial.payload_of_string data)
| W.RES_SEND_FRAME ->
Debug.trace 'b' "RES_SEND_FRAME";
ignore (GMain.Timeout.add 100 (fun _ -> buffer_ready (); false))
| W.RES_READ_REMOTE_RSSI -> | W.RES_READ_REMOTE_RSSI ->
Tm_Pprz.message_send "link" "WC_RSSI" ["raw_level", Pprz.Int (Char.code data.[0])]; Tm_Pprz.message_send "link" "WC_RSSI" ["raw_level", Pprz.Int (Char.code data.[0])];
Debug.call 'w' (fun f -> fprintf f "%.2f wv remote RSSI %d\n" (Unix.gettimeofday ()) (Char.code data.[0])); Debug.call 'w' (fun f -> fprintf f "%.2f wv remote RSSI %d\n" (Unix.gettimeofday ()) (Char.code data.[0]));
ignore (GMain.Timeout.add 100 (fun _ -> buffer_ready (); false))
| W.RES_READ_RADIO_PARAM -> | W.RES_READ_RADIO_PARAM ->
Ivy.send (sprintf "WC_ADDR %s" data); Ivy.send (sprintf "WC_ADDR %s" data);
Debug.call 'w' (fun f -> fprintf f "wv local addr : %s\n" (Debug.xprint data)); Debug.call 'w' (fun f -> fprintf f "wv local addr : %s\n" (Debug.xprint data));
| W.ACK -> | W.ACK ->
Debug.trace 'w' (sprintf "%.2f wv ACK" (Unix.gettimeofday ())); Debug.trace 'w' (sprintf "%.2f wv ACK" (Unix.gettimeofday ()))
buffer_ready ()
| _ -> | _ ->
Debug.call 'w' (fun f -> fprintf f "wv receiving: %02x %s\n" (W.code_of_cmd com) (Debug.xprint data)); Debug.call 'w' (fun f -> fprintf f "wv receiving: %02x %s\n" (W.code_of_cmd com) (Debug.xprint data));
() ()
@@ -221,6 +229,7 @@ let get_fp = fun device _sender vs ->
(fun (dest_id, _) -> (fun (dest_id, _) ->
if dest_id <> ac_id then (** Do not send to itself *) if dest_id <> ac_id then (** Do not send to itself *)
try try
Debug.trace 'b' (sprintf "ACINFO %d for %d" ac_id dest_id);
let ac_device = airborne_device dest_id airframes device.transport in let ac_device = airborne_device dest_id airframes device.transport in
let f = fun a -> Pprz.float_assoc a vs in let f = fun a -> Pprz.float_assoc a vs in
let lat = (Deg>>Rad) (f "lat") let lat = (Deg>>Rad) (f "lat")