def __init__ (self, robot_class, *args):
     TestSimu.__init__ (self, robot_class, *args,
             color_switch_set_pos = True)
     self.io = self.robots[0].io
     self.asserv = self.robots[0].asserv
     self.mimot = self.robots[0].mimot
     self.robot_model = self.robots[0].model
 def create_widgets (self):
     TestSimu.create_widgets (self)
     self.control_frame = Frame (self)
     self.control_frame.pack (side = 'left', before = self.table_view,
             fill = 'y')
     self.clamp_var = IntVar ()
     self.clamp_button = Checkbutton (self.control_frame, text = 'Clamp',
             indicatoron = False,
             variable = self.clamp_var, command = self.clamp_command)
     self.clamp_button.pack ()
     self.elevator_var = IntVar ()
     self.elevator_button = Checkbutton (self.control_frame,
             text = 'Elevator', indicatoron = False,
             variable = self.elevator_var, command = self.elevator_command)
     self.elevator_button.pack ()
     self.gate_var = IntVar ()
     self.gate_button = Checkbutton (self.control_frame,
             text = 'Gate', indicatoron = False,
             variable = self.gate_var, command = self.gate_command)
     self.gate_button.pack ()
     self.loader_up_button = Button (self.control_frame,
             text = 'Loader up', padx = 0, pady = 0,
             command = self.loader_up_command)
     self.loader_up_button.pack ()
     self.loader_down_button = Button (self.control_frame,
             text = 'Loader down', padx = 0, pady = 0,
             command = self.loader_down_command)
     self.loader_down_button.pack ()
     self.table_view.bind ('<1>', self.move)
     self.table_view.bind ('<3>', self.orient)
 def __init__ (self, robot_class, *args):
     TestSimu.__init__ (self, robot_class, *args,
             color_switch_set_pos = True)
     self.io = self.robots[0].io
     self.asserv = self.robots[0].asserv
     self.robot_model = self.robots[0].model
     self.io.output (io_hub.apbirthday.output_mask (
         'cake_arm_in', 'cake_push_far_in', 'cake_push_near_in',
         'cherry_plate_down'), 'toggle')
 def __init__ (self, robot_class, *args):
     TestSimu.__init__ (self, robot_class, *args,
             color_switch_set_pos = True)
     self.io = self.robots[0].io
     self.asserv = self.robots[0].asserv
     self.mimot = self.robots[0].mimot
     self.robot_model = self.robots[0].model
     self.io.output (1 << defs.OUTPUT_UPPER_CLAMP_UP, 'toggle')
     self.io.output (1 << defs.OUTPUT_UPPER_CLAMP_IN, 'toggle')
     self.io.output (1 << defs.OUTPUT_DOOR_CLOSE, 'toggle')
 def create_widgets (self):
     TestSimu.create_widgets (self)
     self.control_frame = Frame (self)
     self.control_frame.pack (side = 'left', before = self.table_view,
             fill = 'y')
     Button (self.control_frame, text = 'FSM step', padx = 0, pady = 0,
             command = self.fsm_debug).pack ()
     Button (self.control_frame, text = 'Asserv block', padx = 0, pady = 0,
             command = self.asserv_block).pack ()
     def out_button (name, *toggle):
         def command ():
             self.io.output (io_hub.apbirthday.output_mask (*toggle),
                     'toggle')
         button = Button (self.control_frame, text = name,
                 padx = 0, pady = 0, command = command)
         button.pack ()
     out_button ('Arm in/out', 'cake_arm_in', 'cake_arm_out')
     out_button ('Push far in/out', 'cake_push_far_in', 'cake_push_far_out')
     out_button ('Push near in/out', 'cake_push_near_in', 'cake_push_near_out')
     out_button ('Plate arm up/down', 'cherry_plate_up', 'cherry_plate_down')
     out_button ('Plate clamp', 'cherry_plate_clamp')
     cannon_var = IntVar ()
     def cannon_cmd ():
         self.io.potentiometer (0, 256 if cannon_var.get () else 0)
     Checkbutton (self.control_frame, text = 'Fire!', indicatoron = 0,
             variable = cannon_var, command = cannon_cmd).pack ()
     self.backward_var = IntVar ()
     self.backward_button = Checkbutton (self.control_frame,
             text = 'Backward', variable = self.backward_var)
     self.backward_button.pack ()
     self.goto_var = IntVar ()
     self.goto_button = Checkbutton (self.control_frame,
             text = 'Goto FSM', variable = self.goto_var)
     self.goto_button.pack ()
     self.table_view.bind ('<1>', self.move)
     self.table_view.bind ('<3>', self.orient)
 def create_widgets (self):
     TestSimu.create_widgets (self)
     self.control_frame = Frame (self)
     self.control_frame.pack (side = 'left', before = self.table_view,
             fill = 'y')
     self.clamp_var = IntVar ()
     self.clamp_var.set (1)
     self.clamp_button = Checkbutton (self.control_frame, text = 'Clamp',
             indicatoron = False,
             variable = self.clamp_var, command = self.clamp_command)
     self.clamp_button.pack ()
     self.doors_var = IntVar ()
     self.doors_var.set (1)
     self.doors_button = Checkbutton (self.control_frame, text = 'Doors',
             indicatoron = False,
             variable = self.doors_var, command = self.doors_command)
     self.doors_button.pack ()
     self.elevation_up_button = Button (self.control_frame,
             text = 'Elevation up', padx = 0, pady = 0,
             command = self.elevation_up_command)
     self.elevation_up_button.pack ()
     self.elevation_down_button = Button (self.control_frame,
             text = 'Elevation down', padx = 0, pady = 0,
             command = self.elevation_down_command)
     self.elevation_down_button.pack ()
     self.rotation_cw_button = Button (self.control_frame,
             text = 'Rotation cw', padx = 0, pady = 0,
             command = self.rotation_cw_command)
     self.rotation_cw_button.pack ()
     self.rotation_ccw_button = Button (self.control_frame,
             text = 'Rotation ccw', padx = 0, pady = 0,
             command = self.rotation_ccw_command)
     self.rotation_ccw_button.pack ()
     self.clamp_pos_scale = Scale (self.control_frame, orient = HORIZONTAL,
             from_ = 0, to = 6)
     self.clamp_pos_scale.pack ()
     self.clamp_move_button = Button (self.control_frame,
             text = 'Move clamp', padx = 0, pady = 0,
             command = self.clamp_move_command)
     self.clamp_move_button.pack ()
     self.clamp_to_scale = Scale (self.control_frame, orient = HORIZONTAL,
             from_ = 0, to = 6)
     self.clamp_to_scale.pack ()
     self.clamp_element_move_button = Button (self.control_frame,
             text = 'Move element', padx = 0, pady = 0,
             command = self.clamp_move_element_command)
     self.clamp_element_move_button.pack ()
     self.drop_var = IntVar ()
     self.drop_button = Checkbutton (self.control_frame, text = 'Drop',
             indicatoron = False,
             variable = self.drop_var, command = self.drop_command)
     self.drop_button.pack ()
     self.backward_var = IntVar ()
     self.backward_button = Checkbutton (self.control_frame,
             text = 'Backward', variable = self.backward_var)
     self.backward_button.pack ()
     self.goto_var = IntVar ()
     self.goto_button = Checkbutton (self.control_frame,
             text = 'Goto FSM', variable = self.goto_var)
     self.goto_button.pack ()
     self.table_view.bind ('<1>', self.move)
     self.table_view.bind ('<3>', self.orient)
 def create_widgets (self):
     TestSimu.create_widgets (self)
     self.control_frame = Frame (self)
     self.control_frame.pack (side = 'left', before = self.table_view,
             fill = 'y')
     Button (self.control_frame, text = 'FSM step', padx = 0, pady = 0,
             command = self.fsm_debug).pack ()
     Button (self.control_frame, text = 'Asserv block', padx = 0, pady = 0,
             command = self.asserv_block).pack ()
     Button (self.control_frame, text = 'Clamp block', padx = 0, pady = 0,
             command = self.clamp_block).pack ()
     def out_button (name, toggle):
         def command ():
             self.io.output (toggle, 'toggle')
         button = Button (self.control_frame, text = name,
                 padx = 0, pady = 0, command = command)
         button.pack ()
     out_button ('LClamp 1 open',
             1 << defs.OUTPUT_LOWER_CLAMP_1_CLOSE)
     out_button ('LClamp 2 open',
             1 << defs.OUTPUT_LOWER_CLAMP_2_CLOSE)
     self.lower_clamp_rotate_button = Button (self.control_frame,
             text = 'LClamp rotate', padx = 0, pady = 0,
             command = self.lower_clamp_rotate_command)
     self.lower_clamp_rotate_button.pack ()
     out_button ('UClamp up/down',
             1 << defs.OUTPUT_UPPER_CLAMP_UP
             | 1 << defs.OUTPUT_UPPER_CLAMP_DOWN)
     out_button ('UClamp in/out',
             1 << defs.OUTPUT_UPPER_CLAMP_IN
             | 1 << defs.OUTPUT_UPPER_CLAMP_OUT)
     out_button ('UClamp open',
             1 << defs.OUTPUT_UPPER_CLAMP_OPEN)
     out_button ('Door open',
             1 << defs.OUTPUT_DOOR_OPEN
             | 1 << defs.OUTPUT_DOOR_CLOSE)
     self.tree_detected_button = Button (self.control_frame,
             text = 'Tree Detected', padx = 0, pady = 0,
             command = self.tree_detected)
     self.tree_detected_button.pack()
     self.stop_tree_approach_button = Button (self.control_frame,
             text = 'Stop tree approach', padx = 0, pady = 0,
             command = self.stop_tree_approach)
     self.stop_tree_approach_button.pack()
     self.empty_tree_button = Button (self.control_frame,
             text = 'Empty Tree', padx = 0, pady = 0,
             command = self.empty_tree)
     self.empty_tree_button.pack()
     self.robot_is_back_button = Button (self.control_frame,
             text = 'Robot is back', padx = 0, pady = 0,
             command = self.robot_is_back)
     self.robot_is_back_button.pack()
     self.unblock_button = Button (self.control_frame,
             text = 'unblock bottom clamp', padx = 0, pady = 0,
             command = self.unblock_bottom_clamp)
     self.unblock_button.pack()
     self.backward_var = IntVar ()
     self.backward_button = Checkbutton (self.control_frame,
             text = 'Backward', variable = self.backward_var)
     self.backward_button.pack ()
     self.goto_var = IntVar ()
     self.goto_button = Checkbutton (self.control_frame,
             text = 'Goto FSM', variable = self.goto_var)
     self.goto_button.pack ()
     self.table_view.bind ('<1>', self.move)
     self.table_view.bind ('<3>', self.orient)