Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
 private void buttonRobotProgramPositionConfirm_Click(object sender, RoutedEventArgs e)
 {
     int taskIndex = comboBoxRobotProgramTask.SelectedIndex;
     Routine.Command command = new Routine.Command((Routine.Task)taskIndex, new IRob.Geometry.Position(controlProgramX.Value, controlProgramY.Value, controlProgramZ.Value, controlProgramA.Value, controlProgramB.Value, controlProgramC.Value));
     if (controlRobot.Value == 1)
     {
         roboteam.Robot1.Program.RemoveCommand(selecetedCommand);
         roboteam.Robot1.Program.InsertCommand(selecetedCommand, command);
     }
     else if (controlRobot.Value == 2)
     {
         roboteam.Robot2.Program.RemoveCommand(selecetedCommand);
         roboteam.Robot2.Program.InsertCommand(selecetedCommand, command);
     }
     selecetedCommand = -1;
 }