protected override void CreateCodeFromAction(MacroLongitudinalTurningAction programAction, ref StringBuilder code)
        {
            /*
             * crea codice per macro sgrossatura esterna
             * - punto attacco , prende punto più alto profilo o altro se fatto override
             */
            var attacPnt = programAction.PuntoAttacco;

            code.AppendLine(NumericControl.CmdMoveRapid + "X" + attacPnt.Y + "Z" + attacPnt.X);

            code.AppendLine("G71U" + programAction.ProfonditaPassata + "R1");
            code.AppendLine("G71P100Q101");
            code.AppendLine("N100");

            var profile = programAction.Profile.Source;

            if (profile == null || profile.Count <= 0)
            {
                return;
            }

            var firstElement = profile.First();

            var firstPnt = firstElement.GetFirstPnt();

            code.AppendLine(NumericControl.CmdMoveRapid + "X" + firstPnt.Y + "Z" + firstPnt.X);

            foreach (var entity2D in programAction.Profile.Source)
            {
                if (entity2D is Line2D)
                {
                    var line = entity2D as Line2D;

                    MoveLineWork(line.End, ref code);
                }
                else if (entity2D is Arc2D)
                {
                    var arc = entity2D as Arc2D;

                    MoveArcWork(arc, ref code);
                }
            }
            code.AppendLine("N101");

            CurrentMoveType = MoveType.Rapid;

            code.AppendLine(NumericControl.CmdMoveRapid + "X" + attacPnt.Y + "Z" + attacPnt.X);

            code.AppendLine("G53X0Z0");
        }
示例#2
0
        internal static void GetRoughingTurnProgram(ProgramOperation programOperation, MoveActionCollection moveCollection, Profile2D profile2D, double profPassata, double avvicinamento, double stacco, Tornitura.TipoTornitura tipoTornitura, bool useMacro, double sovraX, double sovraZ)
        {
            // assumo che sia diametro esterno.

            if (CheckValueHelper.GreatherThanZero(new[] { profPassata, }))
            {
                return;
            }

            if (profile2D == null)
            {
                return;
            }

            if (useMacro)
            {
                var turnMacro = new MacroLongitudinalTurningAction(programOperation)
                {
                    SovraMetalloX        = sovraX,
                    SovraMetalloZ        = sovraZ,
                    Profile              = profile2D,
                    ProfonditaPassata    = profPassata,
                    Distacco             = stacco,
                    TipologiaLavorazione = tipoTornitura,
                };
            }

            switch (tipoTornitura)
            {
            case Tornitura.TipoTornitura.Esterna:
            {
                GetSgrossaturaEsterna(programOperation, moveCollection, profile2D, profPassata, avvicinamento, stacco);
            } break;

            case Tornitura.TipoTornitura.Interna:
            {
                GetSgrossaturaInterna(moveCollection, profile2D, profPassata, avvicinamento, stacco, useMacro);
            } break;
            }
        }
示例#3
0
 protected virtual void CreateCodeFromAction(MacroLongitudinalTurningAction programAction, ref StringBuilder code)
 {
 }