Пример #1
0
    public static string TrsfData(string name, Plane plane)
    {
        var    values = RobotCellStaubli.PlaneToEuler(plane);
        string value  = $@"x=""{values[0]:0.###}"" y=""{values[1]:0.###}"" z=""{values[2]:0.###}"" rx=""{values[3]:0.####}"" ry=""{values[4]:0.####}"" rz=""{values[5]:0.####}""";

        return(Data(name, "trsf", value));
    }
Пример #2
0
    internal VAL3PostProcessor(RobotCellStaubli robotCell, Program program)
    {
        _cell    = robotCell;
        _program = program;
        Code     = new List <List <List <string> > >();

        int groupCount = _cell.MechanicalGroups.Count;

        if (groupCount > 1)
        {
            _program.Errors.Add("Coordinated robots not supported on Staubli.");
            return;
        }

        if (!CheckNames())
        {
            return;
        }

        for (int i = 0; i < _cell.MechanicalGroups.Count; i++)
        {
            //var group = _cell.MechanicalGroups[i];
            //var name = $"{_program.Name}_{group.Name}";
            var name   = $"{_program.Name}";
            var mdescs = CreateMdescs(i);

            var groupCode = new List <List <string> >
            {
                Program(name),
                DataList(i, mdescs, out var indices),
                Start(name),
                Stop(name),
            };

            for (int j = 0; j < program.MultiFileIndices.Count; j++)
            {
                groupCode.Add(SubModule(j, i, mdescs, indices, name));
            }

            Code.Add(groupCode);
        }
    }