From: Jérémie D. <Ba...@us...> - 2010-03-08 23:17:37
|
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 d1bc3f760c9bcaabdb89b83a2d757777a262448d (commit) from bba0433fac2aeb548186bb883b0016fa3583f8c1 (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 d1bc3f760c9bcaabdb89b83a2d757777a262448d Author: Jérémie Dimino <je...@di...> Date: Tue Mar 9 00:16:27 2010 +0100 add the monitoring card to clients ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/clients/controller.ml b/PC_Mainboard/clients/controller.ml index cd91d27..6025ad8 100644 --- a/PC_Mainboard/clients/controller.ml +++ b/PC_Mainboard/clients/controller.ml @@ -191,6 +191,8 @@ let rec draw krobot = fg line_color; text " ]─┬─[ "; fg name_color; text "Services"; fg line_color; text " ]─┬─[ "; + fg name_color; text "Cards"; + fg line_color; text " ]─┬─[ "; fg name_color; text "Status"; fg line_color; text " ]─"]; points.(9).(0) <- { line with char = "├" }; @@ -201,9 +203,10 @@ let rec draw krobot = for i = 1 to 8 do points.(i).(20) <- { line with char = "│" }; points.(i).(40) <- { line with char = "│" }; - points.(i).(55) <- { line with char = "│" } + points.(i).(55) <- { line with char = "│" }; + points.(i).(67) <- { line with char = "│" } done; - Draw.textc screen 1 9 [fg line_color; text "───────────────────┴───────────────────┴──────────────┴"]; + Draw.textc screen 1 9 [fg line_color; text "───────────────────┴───────────────────┴──────────────┴───────────┴"]; let zone = Zone.inner screen in @@ -231,18 +234,20 @@ let rec draw krobot = loop 0 (TextSet.elements (React.S.value services)); let x = 55 in + let text_of_state name = function + | `Absent -> [fg lred; text name] + | `Present -> [text name] + in + Draw.textc zone x 0 (text_of_state "interface" (React.S.value (Krobot.Card.state (krobot, `Interface)))); + Draw.textc zone x 1 (text_of_state "sensor" (React.S.value (Krobot.Card.state (krobot, `Sensor)))); + Draw.textc zone x 2 (text_of_state "motor" (React.S.value (Krobot.Card.state (krobot, `Motor)))); + Draw.textc zone x 3 (text_of_state "monitoring" (React.S.value (Krobot.Card.state (krobot, `Monitoring)))); + let x = x + 12 in Draw.textf zone x 0 "team = %s" (match React.S.value (Krobot.team krobot) with | Krobot.Team_red -> "red" | Krobot.Team_green -> "green"); Draw.textf zone x 1 "jack = %s" (if React.S.value (Krobot.jack krobot) then "present" else "absent"); Draw.textf zone x 2 "compass = %d" (React.S.value (Krobot.compass krobot)); - let text_of_state name = function - | `Absent -> [fg lred; textf "%s card is absent" name] - | `Present -> [textf "%s card is present" name] - in - Draw.textc zone x 3 (text_of_state "interface" (React.S.value (Krobot.Card.state (krobot, `Interface)))); - Draw.textc zone x 4 (text_of_state "sensor" (React.S.value (Krobot.Card.state (krobot, `Sensor)))); - Draw.textc zone x 5 (text_of_state "motor" (React.S.value (Krobot.Card.state (krobot, `Motor)))); let date = Unix.gettimeofday () in let text_of_motor_state mode until = if date < until then @@ -250,8 +255,8 @@ let rec draw krobot = else [text mode; text "OK"] in - Draw.textc zone x 6 (text_of_motor_state "move forward: " (React.S.value (Krobot.inhibited_forward_until krobot))); - Draw.textc zone x 7 (text_of_motor_state "move backward: " (React.S.value (Krobot.inhibited_backward_until krobot))); + Draw.textc zone x 3 (text_of_motor_state "move forward: " (React.S.value (Krobot.inhibited_forward_until krobot))); + Draw.textc zone x 4 (text_of_motor_state "move backward: " (React.S.value (Krobot.inhibited_backward_until krobot))); (* ===== History ===== *) diff --git a/PC_Mainboard/clients/info.ml b/PC_Mainboard/clients/info.ml index 7efb03a..f2e8501 100644 --- a/PC_Mainboard/clients/info.ml +++ b/PC_Mainboard/clients/info.ml @@ -32,4 +32,5 @@ lwt () = lwt () = print_card krobot `Interface in lwt () = print_card krobot `Sensor in lwt () = print_card krobot `Motor in + lwt () = print_card krobot `Monitoring in return () hooks/post-receive -- krobot |