public Roboteam() { Robot1 = new Robot(); Robot2 = new Robot(); }
public Roboteam(Robot robot1, Robot robot2) { Robot1 = robot1; Robot2 = robot2; }
private void ViewRobotProgramPosition(Robot robot) { comboBoxRobotProgramTask.SelectedIndex = (int)robot.Program.Commands[selecetedCommand].Task; controlProgramX.SetValue(robot.Program.Commands[selecetedCommand].Values.X); controlProgramY.SetValue(robot.Program.Commands[selecetedCommand].Values.Y); controlProgramZ.SetValue(robot.Program.Commands[selecetedCommand].Values.Z); controlProgramA.SetValue(robot.Program.Commands[selecetedCommand].Values.A); controlProgramB.SetValue(robot.Program.Commands[selecetedCommand].Values.B); controlProgramC.SetValue(robot.Program.Commands[selecetedCommand].Values.C); buttonRobotProgramPositionConfirm.Visibility = System.Windows.Visibility.Visible; lineRobotProgramPosition.Visibility = System.Windows.Visibility.Visible; groupBoxRobotProgramPosition.Height = Double.NaN; }
private void buttonRobotProgramPositionAdd_Click(object sender, RoutedEventArgs e) { Robot robot = new Robot(); if (controlRobot.Value == 1) robot = roboteam.Robot1; else if (controlRobot.Value == 2) robot = roboteam.Robot2; Routine.Command command = new Routine.Command(Routine.Task.PTP, new IRob.Geometry.Position(0, 0, 0, 0, 0, 0)); if (selecetedCommand != -1) { robot.Program.InsertCommand(selecetedCommand, command); ViewRobotProgramPosition(robot); } else { robot.Program.AddCommand(command); selecetedCommand = robot.Program.Commands.Count() - 1; ViewRobotProgramPosition(robot); } }
private void ViewRobotData(Roboteam robotteam, uint index) { //Get selected robot Robot robot = new Robot(); if (index == 1) robot = roboteam.Robot1; else if (index == 2) robot = roboteam.Robot2; //Connection and Position if (robot.Status == Robot.ConnectionStatus.Connected) { buttonRobotConnect.SetStatus(UserControlConnectionButton.Status.Connected); labelRobotVelocity.Content = "Velocity: " + robot.Vel; } else if (robot.Status == Robot.ConnectionStatus.Connecting) { buttonRobotConnect.SetStatus(UserControlConnectionButton.Status.Connecting); } else { buttonRobotConnect.SetStatus(UserControlConnectionButton.Status.Disconnected); } //Position if (radioButtonRobotControlCartesian.IsChecked == true) { controlX.SetValue(robot.TPos.X); controlY.SetValue(robot.TPos.Y); controlZ.SetValue(robot.TPos.Z); controlA.SetValue(robot.TPos.A); controlB.SetValue(robot.TPos.B); controlC.SetValue(robot.TPos.C); } else if (radioButtonRobotControlAxis.IsChecked == true) { controlX.SetValue(robot.TAxs.X); controlY.SetValue(robot.TAxs.Y); controlZ.SetValue(robot.TAxs.Z); controlA.SetValue(robot.TAxs.A); controlB.SetValue(robot.TAxs.B); controlC.SetValue(robot.TAxs.C); } //Program List<string> itemCollectionRobotProgram = new List<string>(); foreach (Routine.Command command in robot.Program.Commands) { itemCollectionRobotProgram.Add(command.Task.ToString() + " X " + command.Values.X.ToString("0.00") + ", Y " + command.Values.Y.ToString("0.00") + ", Z " + command.Values.Z.ToString("0.00") + ", A " + command.Values.A.ToString("0.00") + ", B " + command.Values.B.ToString("0.00") + ", C " + command.Values.C.ToString("0.00")); } listBoxRobotProgram.ItemsSource = itemCollectionRobotProgram; listBoxRobotProgram.SelectedIndex = selecetedCommand; if (robot.Program.Commands.Count() == 0) { buttonRobotProgramPlay.IsEnabled = false; play = false; } else buttonRobotProgramPlay.IsEnabled = true; if (play) { imageRobotProgramPlay.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/pauseicon.png")); buttonRobotProgramOpen.IsEnabled = false; buttonRobotProgramSave.IsEnabled = false; buttonRobotProgramClose.IsEnabled = false; buttonRobotProgramPositionAdd.IsEnabled = false; buttonRobotProgramPositionCopy.IsEnabled = false; buttonRobotProgramPositionUp.IsEnabled = false; buttonRobotProgramPositionDown.IsEnabled = false; buttonRobotProgramPositionDelete.IsEnabled = false; buttonRobotProgramPositionConfirm.Visibility = System.Windows.Visibility.Collapsed; lineRobotProgramPosition.Visibility = System.Windows.Visibility.Collapsed; groupBoxRobotProgramPosition.Height = 0; } else { imageRobotProgramPlay.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/playicon.png")); buttonRobotProgramOpen.IsEnabled = true; buttonRobotProgramSave.IsEnabled = true; buttonRobotProgramClose.IsEnabled = true; buttonRobotProgramPositionAdd.IsEnabled = true; buttonRobotProgramPositionCopy.IsEnabled = true; buttonRobotProgramPositionUp.IsEnabled = true; buttonRobotProgramPositionDown.IsEnabled = true; buttonRobotProgramPositionDelete.IsEnabled = true; } }
private void controlC_ValueChanged(object sender, RoutedEventArgs e) { Robot robot = new Robot(); if (controlRobot.Value == 1) robot = roboteam.Robot1; else if (controlRobot.Value == 2) robot = roboteam.Robot2; if (robot.Action == Routine.Task.AXS) robot.TAxs.C = controlC.Value; else robot.TPos.C = controlC.Value; }
private void buttonRobotConnect_Click(object sender, RoutedEventArgs e) { Robot robot = new Robot(); if (controlRobot.Value == 1) robot = roboteam.Robot1; else if (controlRobot.Value == 2) robot = roboteam.Robot2; if (robot.Status == Robot.ConnectionStatus.Disconnected) robot.Connect(Properties.Settings.Default.Port, Properties.Settings.Default.CardIndex); else robot.Disconnect(); }