//protected override void CreateCodeFromAction(ArcMoveAction programAction, ref StringBuilder code) //{ // code.AppendLine(); // SetMoveType(programAction.MoveType, ref code); // var codeX = "X"; // var codeY = "Y"; // if (G112Activated) // { // codeY = "C"; // } // if (programAction.X.HasValue) // code.Append(codeX + FormatCoordinate(programAction.X.Value)); // if (programAction.Y.HasValue) // code.Append(codeY + FormatCoordinate(programAction.Y.Value)); // if (programAction.Z.HasValue) // code.Append("Z" + FormatCoordinate(programAction.Z.Value)); // code.Append("R" + FormatCoordinate(programAction.Radius)); // if (programAction.Feed != CurrentFeed) // SetFeed(programAction.Feed, ref code); //} //protected override void CreateCodeFromAction(LinearMoveAction programAction, ref StringBuilder code) //{ // code.AppendLine(); // SetMoveType(programAction.MoveType, ref code); // var codeX = "X"; // var codeY = "Y"; // if (G112Activated) // { // codeY = "C"; // } // if (programAction.X.HasValue) // code.Append(codeX + FormatCoordinate(programAction.X.Value)); // if (programAction.Y.HasValue) // code.Append(codeY + FormatCoordinate(programAction.Y.Value)); // if (programAction.Z.HasValue) // code.Append("Z" + FormatCoordinate(programAction.Z.Value)); // if (programAction.Feed != CurrentFeed) // SetFeed(programAction.Feed, ref code); //} private void WriteToolParameter(double speed, SpindleRotation spindleRotation, ref StringBuilder code) { //var speedCode = PostProcessor.GetSpeedCode(speed); var speedFormated = FormatSpeed(speed); var speedCode = NumericControl.GetSpeedCode(speedFormated); string spindleRotationCode; switch (spindleRotation) { case SpindleRotation.Cw: { spindleRotationCode = NumericControl.CmdRotaryToolCw; } break; case SpindleRotation.Ccw: default: { spindleRotationCode = NumericControl.CmdRotaryToolCcw; } break; } code.AppendLine(speedCode + spindleRotationCode); }
private void WriteToolParameter(ModalitaVelocita modalitaVelocita, double speed, SpindleRotation spindleRotation, ref StringBuilder code) { string speedTypeCode; switch (modalitaVelocita) { case ModalitaVelocita.VelocitaTaglio: { speedTypeCode = NumericControl.CMDG_SpeedSync; } break; case ModalitaVelocita.GiriFissi: default: { speedTypeCode = NumericControl.CMDG_SpeedASync; } break; } var formatedSpeed = FormatSpeed(speed); var speedCode = NumericControl.GetSpeedCode(formatedSpeed); string spindleRotationCode; switch (spindleRotation) { case SpindleRotation.Cw: { spindleRotationCode = NumericControl.CMDM_SpindleCW; } break; case SpindleRotation.Ccw: default: { spindleRotationCode = NumericControl.CMDM_SpindleCCW; } break; } code.AppendLine(speedTypeCode + speedCode + spindleRotationCode); }