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; }
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); }
public override void Bind(Beagle robot, Joystick joystick) { base.Bind(robot, joystick); joystick.MainAxisChanged += Joystick_MainAxisChanged; }
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; }