Exemplo n.º 1
0
 public virtual void Bind(Beagle robot, Joystick joystick)
 {
     if (robot == null) throw new ArgumentNullException("robot");
     if (joystick == null) throw new ArgumentNullException("joystick");
     _robot = robot;
     _joystick = joystick;
 }
Exemplo n.º 2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (_robot == null) throw new ApplicationException("The Robot property has not been set.");

            MyTraceListener traceListener = new MyTraceListener();
            traceListener.NewMessage += OnNewMessage;
            Debug.Listeners.Add(traceListener);

            _joystick = new Joystick();
            _joystick.Initialize();
            if (_joystick.IsConnected) _joystick.StartPolling();

            _motorController.Bind(_robot, _joystick);
            _motorVisualizer.Bind(_robot, _joystick);
            _batteryStatusVisualizer.Bind(_robot, _joystick);
            _servoController.Bind(_robot, _joystick);
            _ultrasonicRangeFinderVisualizer.Bind(_robot, _joystick);
            _compassVisualizer.Bind(_robot, _joystick);
            _camera.Bind(_robot, _joystick);
        }
Exemplo n.º 3
0
 public override void Bind(Beagle robot, Joystick joystick)
 {
     base.Bind(robot, joystick);
     joystick.MainAxisChanged += Joystick_MainAxisChanged;
 }
Exemplo n.º 4
0
 public override void Bind(Beagle robot, Joystick joystick)
 {
     base.Bind(robot, joystick);
     if (Joystick != null) joystick.PointOfViewPressed += joystick_PointOfViewChanged;
     DataContext = robot.ServoController;
 }
 public override void Bind(Beagle robot, Joystick joystick)
 {
     base.Bind(robot, joystick);
     joystick.TriggerPressed += joystick_TriggerClicked;
     DataContext = robot.UltrasonicRangeFinder;
 }
 public override void Bind(Beagle robot, Joystick joystick)
 {
     base.Bind(robot, joystick);
     DataContext = robot;
 }