internal RapidPostProcessor(RobotCellAbb robotCell, Program program) { this.cell = robotCell; this.program = program; this.Code = new List <List <List <string> > >(); for (int i = 0; i < cell.MechanicalGroups.Count; i++) { var groupCode = new List <List <string> >(); groupCode.Add(MainModule(i)); for (int j = 0; j < program.MultiFileIndices.Count; j++) { groupCode.Add(SubModule(j, i)); } Code.Add(groupCode); } }
internal RemoteAbb(RobotCellAbb cell) { _cell = cell; }
internal static Mechanism Create(XElement element) { var modelName = element.Attribute(XName.Get("model")).Value; var manufacturer = (Manufacturers)Enum.Parse(typeof(Manufacturers), element.Attribute(XName.Get("manufacturer")).Value); string fullName = $"{element.Name.LocalName}.{manufacturer.ToString()}.{modelName}"; bool movesRobot = false; var movesRobotAttribute = element.Attribute(XName.Get("movesRobot")); if (movesRobotAttribute != null) movesRobot = XmlConvert.ToBoolean(movesRobotAttribute.Value); var meshes = GetMeshes(fullName); double payload = Convert.ToDouble(element.Attribute(XName.Get("payload")).Value); var baseMesh = meshes[0].DuplicateMesh(); XElement baseElement = element.Element(XName.Get("Base")); double x = XmlConvert.ToDouble(baseElement.Attribute(XName.Get("x")).Value); double y = XmlConvert.ToDouble(baseElement.Attribute(XName.Get("y")).Value); double z = XmlConvert.ToDouble(baseElement.Attribute(XName.Get("z")).Value); double q1 = XmlConvert.ToDouble(baseElement.Attribute(XName.Get("q1")).Value); double q2 = XmlConvert.ToDouble(baseElement.Attribute(XName.Get("q2")).Value); double q3 = XmlConvert.ToDouble(baseElement.Attribute(XName.Get("q3")).Value); double q4 = XmlConvert.ToDouble(baseElement.Attribute(XName.Get("q4")).Value); var basePlane = RobotCellAbb.QuaternionToPlane(x, y, z, q1, q2, q3, q4); var jointElements = element.Element(XName.Get("Joints")).Descendants().ToArray(); Joint[] joints = new Joint[jointElements.Length]; for (int i = 0; i < jointElements.Length; i++) { var jointElement = jointElements[i]; double a = XmlConvert.ToDouble(jointElement.Attribute(XName.Get("a")).Value); double d = XmlConvert.ToDouble(jointElement.Attribute(XName.Get("d")).Value); string text = jointElement.Attribute(XName.Get("minrange")).Value; double minRange = XmlConvert.ToDouble(text); double maxRange = XmlConvert.ToDouble(jointElement.Attribute(XName.Get("maxrange")).Value); Interval range = new Interval(minRange, maxRange); double maxSpeed = XmlConvert.ToDouble(jointElement.Attribute(XName.Get("maxspeed")).Value); Mesh mesh = meshes[i + 1].DuplicateMesh(); int number = XmlConvert.ToInt32(jointElement.Attribute(XName.Get("number")).Value) - 1; if (jointElement.Name == "Revolute") joints[i] = new RevoluteJoint() { Index = i, Number = number, A = a, D = d, Range = range, MaxSpeed = maxSpeed.ToRadians(), Mesh = mesh }; else if (jointElement.Name == "Prismatic") joints[i] = new PrismaticJoint() { Index = i, Number = number, A = a, D = d, Range = range, MaxSpeed = maxSpeed, Mesh = mesh }; } switch (element.Name.ToString()) { case ("RobotArm"): { switch (manufacturer) { case (Manufacturers.ABB): return new RobotAbb(modelName, payload, basePlane, baseMesh, joints); case (Manufacturers.KUKA): return new RobotKuka(modelName, payload, basePlane, baseMesh, joints); case (Manufacturers.UR): return new RobotUR(modelName, payload, basePlane, baseMesh, joints); default: return null; } } case ("Positioner"): return new Positioner(modelName, manufacturer, payload, basePlane, baseMesh, joints, movesRobot); case ("Track"): return new Track(modelName, manufacturer, payload, basePlane, baseMesh, joints, movesRobot); case ("Custom"): return new Custom(modelName, manufacturer, payload, basePlane, baseMesh, joints, movesRobot); default: return null; } }
internal RapidPostProcessor(RobotCellAbb robotCell, Program program) { this.cell = robotCell; this.program = program; this.Code = new List<List<List<string>>>(); for (int i = 0; i < cell.MechanicalGroups.Count; i++) { var groupCode = new List<List<string>>(); groupCode.Add(MainModule(i)); for (int j = 0; j < program.MultiFileIndices.Count; j++) groupCode.Add(SubModule(j, i)); Code.Add(groupCode); } }