Пример #1
0
        private void button7_Click(object sender, EventArgs e)
        {
            ITxRoboticLocationOperation ro = txObjEditBoxCtrl1.Object as ITxRoboticLocationOperation;
            ITxTypeFilter objFilter        = new TxTypeFilter(typeof(ITxRoboticLocationOperation));
            TxObjectList  obj = ro.ParentRoboticOperation.GetAllDescendants(objFilter);

            try
            {
                for (int i = 0; i < obj.Count; i++)
                {
                    if (obj[i + 1] is TxWeldLocationOperation)
                    {
                        string str = ";-- " + obj[i + 1].Name + " --";
                        ITxRoboticOperation rop = obj[i] as ITxRoboticOperation;
                        if (rop.Commands.Count == 0)
                        {
                            rop.CreateCommand(new TxRoboticCommandCreationData(str));
                        }
                        else
                        {
                            TxRoboticCommand rc = rop.Commands[rop.Commands.Count - 1] as TxRoboticCommand;
                            if (!rc.Text.Contains("_ps_"))
                            {
                                rop.CreateCommand(new TxRoboticCommandCreationData(str));
                            }
                        }
                    }
                }
            }
            catch (System.Exception ex)
            {
            }
        }
Пример #2
0
        /// <summary>
        /// Get the joint values of the robot assigned to a location
        /// </summary>
        /// <param name="location">The location from which to get the joint values</param>
        /// <returns>The joint values</returns>
        private ArrayList GetRobotPoseDataFromLocation(ITxRoboticLocationOperation location)
        {
            ITxRobot robot = location.ParentRoboticOperation.Robot;

            if (robot != null)
            {
                TxPoseData pose = robot.GetPoseAtLocation(location);
                if (pose != null)
                {
                    return(pose.JointValues);
                }
            }
            return(null);
        }