- updated the preprocessor files

This commit is contained in:
Marius Stanciu
2019-12-16 19:24:50 +02:00
committed by Marius
parent d256c99385
commit 6744d9ae07
16 changed files with 177 additions and 172 deletions

View File

@@ -1,10 +1,10 @@
# ########################################################## ##
# ##########################################################
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
# ########################################################## ##
# ##########################################################
from FlatCAMPostProc import *
@@ -85,11 +85,13 @@ class Toolchange_manual(FlatCAMPostProc):
z_toolchange = p.z_toolchange
toolchangexy = p.xy_toolchange
f_plunge = p.f_plunge
gcode = ''
if toolchangexy is not None:
x_toolchange = toolchangexy[0]
y_toolchange = toolchangexy[1]
else:
x_toolchange = 0.0
y_toolchange = 0.0
no_drills = 1
@@ -117,9 +119,9 @@ M0
G00 Z{z_toolchange}
(MSG, Now the tool can be tightened more securely.)
M0
""".format(x_toolchange=self.coordinate_format%(p.coords_decimals, x_toolchange),
y_toolchange=self.coordinate_format%(p.coords_decimals, y_toolchange),
z_toolchange=self.coordinate_format%(p.coords_decimals, z_toolchange),
""".format(x_toolchange=self.coordinate_format % (p.coords_decimals, x_toolchange),
y_toolchange=self.coordinate_format % (p.coords_decimals, y_toolchange),
z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
tool=int(p.tool),
t_drills=no_drills,
toolC=toolC_formatted)
@@ -138,7 +140,7 @@ G00 Z{z_toolchange}
(MSG, Now the tool can be tightened more securely.)
M0
""".format(
z_toolchange=self.coordinate_format%(p.coords_decimals, z_toolchange),
z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
tool=int(p.tool),
t_drills=no_drills,
toolC=toolC_formatted)
@@ -162,9 +164,9 @@ M0
G00 Z{z_toolchange}
(MSG, Now the tool can be tightened more securely.)
M0
""".format(x_toolchange=self.coordinate_format%(p.coords_decimals, x_toolchange),
y_toolchange=self.coordinate_format%(p.coords_decimals, y_toolchange),
z_toolchange=self.coordinate_format%(p.coords_decimals, z_toolchange),
""".format(x_toolchange=self.coordinate_format % (p.coords_decimals, x_toolchange),
y_toolchange=self.coordinate_format % (p.coords_decimals, y_toolchange),
z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
tool=int(p.tool),
toolC=toolC_formatted)
else:
@@ -180,8 +182,7 @@ M0
G00 Z{z_toolchange}
(MSG, Now the tool can be tightened more securely.)
M0
""".format(z_toolchange=self.coordinate_format%(p.coords_decimals, z_toolchange),
tool=int(p.tool),
""".format(z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange), tool=int(p.tool),
toolC=toolC_formatted)
if f_plunge is True:
@@ -203,7 +204,7 @@ M0
def end_code(self, p):
coords_xy = p['xy_toolchange']
gcode = ('G00 Z' + self.feedrate_format %(p.fr_decimals, p.z_end) + "\n")
gcode = ('G00 Z' + self.feedrate_format % (p.fr_decimals, p.z_end) + "\n")
if coords_xy is not None:
gcode += 'G00 X{x} Y{y}'.format(x=coords_xy[0], y=coords_xy[1]) + "\n"
else:
@@ -211,10 +212,10 @@ M0
return gcode
def feedrate_code(self, p):
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.feedrate))
return 'G01 F' + str(self.feedrate_format % (p.fr_decimals, p.feedrate))
def z_feedrate_code(self, p):
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.z_feedrate))
return 'G01 F' + str(self.feedrate_format % (p.fr_decimals, p.z_feedrate))
def spindle_code(self, p):
sdir = {'CW': 'M03', 'CCW': 'M04'}[p.spindledir]
@@ -227,5 +228,5 @@ M0
if p.dwelltime:
return 'G4 P' + str(p.dwelltime)
def spindle_stop_code(self,p):
def spindle_stop_code(self, p):
return 'M05'