From: Jérémie D. <Ba...@us...> - 2010-02-18 11:53:29
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "krobot". The branch, master has been updated via 992d372526a6fc373535550469f66096caf4ee99 (commit) from 58105fc8cf98aaca1722ae26afa74968879c4b46 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 992d372526a6fc373535550469f66096caf4ee99 Author: Jérémie Dimino <je...@di...> Date: Thu Feb 18 12:51:45 2010 +0100 [controllet] limit the frame rate to avoid Out_of_memory ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/_tags b/PC_Mainboard/_tags index 818fd97..6d352b3 100644 --- a/PC_Mainboard/_tags +++ b/PC_Mainboard/_tags @@ -55,6 +55,8 @@ <tools/forward_dbus.ml>: syntax_camlp4o, pkg_lwt.syntax, pkg_lwt.syntax.log, pkg_obus.syntax <tools/forward_dbus.*>: pkg_obus +<tools/flood.ml>: syntax_camlp4o, pkg_lwt.syntax, pkg_lwt.syntax.log, pkg_obus.syntax +<tools/flood.*>: pkg_obus # +------------------------------------------------------------------+ # | Tests | diff --git a/PC_Mainboard/clients/controller.ml b/PC_Mainboard/clients/controller.ml index 27b1d3f..32791c9 100644 --- a/PC_Mainboard/clients/controller.ml +++ b/PC_Mainboard/clients/controller.ml @@ -23,11 +23,12 @@ module TextSet = Set.Make(Text) let drawer_mutex = Lwt_mutex.create () (* Draw the whole screen *) -let rec draw size - (compass, logic_sensors, range_finders, team, jack) - (inhibited_forward_until, inhibited_backward_until) - (engine_state, box, logs) - (state_interface, state_sensor, state_motor) = +let rec draw + (size, + (engine_state, box, logs), + ((compass, logic_sensors, range_finders, team, jack), + (inhibited_forward_until, inhibited_backward_until), + (state_interface, state_sensor, state_motor))) = Lwt_mutex.with_lock drawer_mutex begin fun () -> if Lwt_mutex.is_empty drawer_mutex then begin (* Redraw the screen only if there is no other thread waiting to @@ -306,25 +307,28 @@ lwt () = in redirect_stderr (); let signal = - React.S.l5 draw - Lwt_term.size - (React.S.l5 (fun a b c d e -> (a, b, c, d, e)) - (Krobot.compass krobot) - (Krobot.logic_sensors krobot) - (Krobot.range_finders krobot) - (Krobot.team krobot) - (Krobot.jack krobot)) - (React.S.l2 (fun a b -> (a, b)) - (Krobot.inhibited_forward_until krobot) - (Krobot.inhibited_backward_until krobot)) + React.S.map draw (React.S.l3 (fun a b c -> (a, b, c)) - engine_state - box - logs) - (React.S.l3 (fun a b c -> (a, b, c)) - (Krobot.Card.state krobot `Interface) - (Krobot.Card.state krobot `Sensor) - (Krobot.Card.state krobot `Motor)) + Lwt_term.size + (React.S.l3 (fun a b c -> (a, b, c)) + engine_state + box + logs) + (Lwt_signal.limit (fun () -> Lwt_unix.sleep 0.1) + (React.S.l3 (fun a b c -> (a, b, c)) + (React.S.l5 (fun a b c d e -> (a, b, c, d, e)) + (Krobot.compass krobot) + (Krobot.logic_sensors krobot) + (Krobot.range_finders krobot) + (Krobot.team krobot) + (Krobot.jack krobot)) + (React.S.l2 (fun a b -> (a, b)) + (Krobot.inhibited_forward_until krobot) + (Krobot.inhibited_backward_until krobot)) + (React.S.l3 (fun a b c -> (a, b, c)) + (Krobot.Card.state krobot `Interface) + (Krobot.Card.state krobot `Sensor) + (Krobot.Card.state krobot `Motor))))) in lwt history = Lwt_read_line.load_history history_file_name in set_engine_state (Engine.init history); diff --git a/PC_Mainboard/myocamlbuild.ml b/PC_Mainboard/myocamlbuild.ml index b23d4cf..a6a42a2 100644 --- a/PC_Mainboard/myocamlbuild.ml +++ b/PC_Mainboard/myocamlbuild.ml @@ -66,6 +66,7 @@ let targets = List.filter_opt (function (true, target) -> Some target | (false, (* Tools *) (have_lwt_unix && have_obus, "tools/forward_dbus.best"); + (have_lwt_unix && have_obus, "tools/flood.best"); (* Clients *) (have_lwt_unix && have_obus, "clients/info.best"); hooks/post-receive -- krobot |