public CoordinatesVisualizer(LeapListener leapListener, TextBox coordTextBox, MainWindow mainWindow) { _leapListener = leapListener; _readingThread = new Thread(GetInfoFromLeap); _readingThread.Start(); this.mainWindow = mainWindow; this.coordinatesTextBox = coordTextBox; }
private void Connect_Click(object sender, EventArgs e) { var device = groupBox1.Controls.OfType<RadioButton>().FirstOrDefault(n => n.Checked); leapListener = new LeapListener(); robotController = new RobotController(leapListener, device != null ? (Device)device.Tag : Device.Platform); coordinatesVisualizer = new CoordinatesVisualizer(leapListener, coordinatesTextBox, this); ConnectedLabel.Visible = true; }
private void Connect_Click(object sender, EventArgs e) { var device = groupBox1.Controls.OfType <RadioButton>().FirstOrDefault(n => n.Checked); leapListener = new LeapListener(); robotController = new RobotController(leapListener, device != null ? (Device)device.Tag : Device.Platform); coordinatesVisualizer = new CoordinatesVisualizer(leapListener, coordinatesTextBox, this); ConnectedLabel.Visible = true; }
public RobotController(LeapListener leapListener, Device device) { Console.WriteLine(device.ToString()); _leapListener = leapListener; switch (device) { case Device.Platform: deviceController = new PlatformController(); break; case Device.ArmBigger: deviceController = new ArmBiggerController(); break; case Device.ArmSmaller: deviceController = new ArmSmallerController(); break; } _controlThread = new Thread(controlRobot); _controlThread.Start(); }