From: Xavier L. <Ba...@us...> - 2011-04-12 15:03:43
|
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 ea122f2120a515a92164b114a030ece3485da728 (commit) via ae777de7a4849b774636e041ee4735f89b857610 (commit) from 81ad433ad4992f4c336e5bcf236cb4c3edf49ac5 (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 ea122f2120a515a92164b114a030ece3485da728 Author: Xavier Lagorce <Xav...@cr...> Date: Tue Apr 12 17:02:47 2011 +0200 [info] Added menu items to manage normal/HIL mode. This menu items react to CAN message to allow setting the mode in a collaborative manner between viewers and other programs (like krobot-hil-simulator). commit ae777de7a4849b774636e041ee4735f89b857610 Author: Xavier Lagorce <Xav...@cr...> Date: Tue Apr 12 14:56:13 2011 +0200 [info] Re-enabling automatic passage in HIL mode when starting krobot-hil-simulator ----------------------------------------------------------------------- Changes: diff --git a/info/control2011/src/tools/krobot_hil_simulator.ml b/info/control2011/src/tools/krobot_hil_simulator.ml index 57e9105..10881c0 100644 --- a/info/control2011/src/tools/krobot_hil_simulator.ml +++ b/info/control2011/src/tools/krobot_hil_simulator.ml @@ -122,7 +122,7 @@ lwt () = return ()) (Krobot_message.recv bus)); -(* lwt () = Krobot_message.send bus (Unix.gettimeofday (), Set_controller_mode true) in*) + lwt () = Krobot_message.send bus (Unix.gettimeofday (), Set_controller_mode true) in while_lwt true do let time = Unix.gettimeofday () in diff --git a/info/control2011/src/tools/krobot_viewer.ml b/info/control2011/src/tools/krobot_viewer.ml index 7406bc0..91ac856 100644 --- a/info/control2011/src/tools/krobot_viewer.ml +++ b/info/control2011/src/tools/krobot_viewer.ml @@ -641,6 +641,11 @@ module Board = struct board.ui#beacon_period#set_text (string_of_float period); queue_draw board end + | Set_controller_mode (hil) -> + if hil then + board.ui#menu_mode_hil#set_active true + else + board.ui#menu_mode_normal#set_active true | _ -> ()) (Krobot_message.recv bus) @@ -771,6 +776,28 @@ lwt () = end; false)); + ignore + (ui#menu_mode_normal#event#connect#button_release + (fun ev -> + if GdkEvent.Button.button ev = 1 then + ignore_result ( + Krobot_message.send bus + (Unix.gettimeofday (), + Set_controller_mode false) + ); + false)); + + ignore + (ui#menu_mode_hil#event#connect#button_release + (fun ev -> + if GdkEvent.Button.button ev = 1 then + ignore_result ( + Krobot_message.send bus + (Unix.gettimeofday (), + Set_controller_mode true) + ); + false)); + pick [ waiter; (* Sends motor status request continously. *) diff --git a/info/control2011/src/tools/krobot_viewer_ui.glade b/info/control2011/src/tools/krobot_viewer_ui.glade index 485278d..c1cf4e5 100644 --- a/info/control2011/src/tools/krobot_viewer_ui.glade +++ b/info/control2011/src/tools/krobot_viewer_ui.glade @@ -121,6 +121,37 @@ </widget> </child> <child> + <widget class="GtkMenuItem" id="menu_mode"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Mode</property> + <property name="use_underline">True</property> + <child> + <widget class="GtkMenu" id="menu4"> + <property name="visible">True</property> + <child> + <widget class="GtkRadioMenuItem" id="menu_mode_normal"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Normal</property> + <property name="use_underline">True</property> + <property name="active">True</property> + <property name="draw_as_radio">True</property> + <property name="group">menu_mode_hil</property> + </widget> + </child> + <child> + <widget class="GtkRadioMenuItem" id="menu_mode_hil"> + <property name="visible">True</property> + <property name="label" translatable="yes">_HIL</property> + <property name="use_underline">True</property> + <property name="draw_as_radio">True</property> + <property name="group">menu_mode_normal</property> + </widget> + </child> + </widget> + </child> + </widget> + </child> + <child> <widget class="GtkMenuItem" id="menuitem4"> <property name="visible">True</property> <property name="label" translatable="yes">Aid_e</property> hooks/post-receive -- krobot |