- fixed errors in the Roland preprocessors
- fixed CNCJob plot scaling when using Roland preprocessors - in Roland preprocessors added the use of spindlespeed - made sure that the preprocessors that don't use the gcode_header still use the start gcode
This commit is contained in:
@@ -7,6 +7,14 @@ CHANGELOG for FlatCAM beta
|
|||||||
|
|
||||||
=================================================
|
=================================================
|
||||||
|
|
||||||
|
23.07.2021
|
||||||
|
|
||||||
|
- fixed errors in the Roland preprocessors
|
||||||
|
- fixed CNCJob plot scaling when using Roland preprocessors
|
||||||
|
- in Roland preprocessors added the use of spindlespeed
|
||||||
|
- made sure that the preprocessors that don't use the gcode_header still use the start gcode
|
||||||
|
|
||||||
|
|
||||||
21.07.2021
|
21.07.2021
|
||||||
|
|
||||||
- when using the NCCAD9 preprocessor (for Kosy machines) at GCode save the .knc extension will be automatically preselected
|
- when using the NCCAD9 preprocessor (for Kosy machines) at GCode save the .knc extension will be automatically preselected
|
||||||
|
|||||||
@@ -1014,21 +1014,18 @@ class CNCJobObject(FlatCAMObj, CNCjob):
|
|||||||
else:
|
else:
|
||||||
gcode += self.gcode
|
gcode += self.gcode
|
||||||
|
|
||||||
g = preamble + '\n' + gcode + '\n' + postamble
|
# g = self.gc_start + '\n' + preamble + '\n' + gcode + '\n' + postamble
|
||||||
|
g = ''
|
||||||
|
end_gcode = self.gcode_footer() if self.app.defaults['cncjob_footer'] is True else ''
|
||||||
|
if preamble != '' and postamble != '':
|
||||||
|
g = self.gc_start + '\n' + preamble + '\n' + gcode + '\n' + postamble + '\n' + end_gcode
|
||||||
|
if preamble == '':
|
||||||
|
g = self.gc_start + '\n' + gcode + '\n' + postamble + '\n' + end_gcode
|
||||||
|
if postamble == '':
|
||||||
|
g = self.gc_start + '\n' + preamble + '\n' + gcode + '\n' + end_gcode
|
||||||
|
if preamble == '' and postamble == '':
|
||||||
|
g = self.gc_start + '\n' + gcode + '\n' + end_gcode
|
||||||
else:
|
else:
|
||||||
# search for the GCode beginning which is usually a G20 or G21
|
|
||||||
# fix so the preamble gets inserted in between the comments header and the actual start of GCODE
|
|
||||||
# g_idx = gcode.rfind('G20')
|
|
||||||
#
|
|
||||||
# # if it did not find 'G20' then search for 'G21'
|
|
||||||
# if g_idx == -1:
|
|
||||||
# g_idx = gcode.rfind('G21')
|
|
||||||
#
|
|
||||||
# # if it did not find 'G20' and it did not find 'G21' then there is an error and return
|
|
||||||
# if g_idx == -1:
|
|
||||||
# self.app.inform.emit('[ERROR_NOTCL] %s' % _("G-code does not have a units code: either G20 or G21"))
|
|
||||||
# return
|
|
||||||
|
|
||||||
# detect if using multi-tool and make the Gcode summation correctly for each case
|
# detect if using multi-tool and make the Gcode summation correctly for each case
|
||||||
if self.multitool is True:
|
if self.multitool is True:
|
||||||
# for the case that self.tools is empty: old projects
|
# for the case that self.tools is empty: old projects
|
||||||
|
|||||||
@@ -6324,8 +6324,8 @@ class CNCjob(Geometry):
|
|||||||
match_z = re.search(r"^Z(\s*-?\d+\.\d+?),(\s*\s*-?\d+\.\d+?),(\s*\s*-?\d+\.\d+?)*;$", gline)
|
match_z = re.search(r"^Z(\s*-?\d+\.\d+?),(\s*\s*-?\d+\.\d+?),(\s*\s*-?\d+\.\d+?)*;$", gline)
|
||||||
if match_z:
|
if match_z:
|
||||||
command['G'] = 0
|
command['G'] = 0
|
||||||
command['X'] = float(match_z.group(1).replace(" ", "")) * 0.025
|
command['X'] = float(match_z.group(1).replace(" ", "")) * 0.01
|
||||||
command['Y'] = float(match_z.group(2).replace(" ", "")) * 0.025
|
command['Y'] = float(match_z.group(2).replace(" ", "")) * 0.01
|
||||||
command['Z'] = float(match_z.group(3).replace(" ", "")) * 0.025
|
command['Z'] = float(match_z.group(3).replace(" ", "")) * 0.025
|
||||||
|
|
||||||
elif 'hpgl' in self.pp_excellon_name or 'hpgl' in self.pp_geometry_name:
|
elif 'hpgl' in self.pp_excellon_name or 'hpgl' in self.pp_geometry_name:
|
||||||
|
|||||||
@@ -74,9 +74,9 @@ class Roland_MDX_20(PreProc):
|
|||||||
|
|
||||||
def linear_code(self, p):
|
def linear_code(self, p):
|
||||||
if p.units.upper() == 'IN':
|
if p.units.upper() == 'IN':
|
||||||
z = p.z / 25.4
|
z = p.z_cut / 25.4
|
||||||
else:
|
else:
|
||||||
z = p.z
|
z = p.z_cut
|
||||||
gcode = self.feedrate_code(p) + '\n'
|
gcode = self.feedrate_code(p) + '\n'
|
||||||
gcode += self.position_code(p).format(**p) + ',' + str(float(z * 40.0)) + ';'
|
gcode += self.position_code(p).format(**p) + ',' + str(float(z * 40.0)) + ';'
|
||||||
return gcode
|
return gcode
|
||||||
@@ -121,10 +121,18 @@ class Roland_MDX_20(PreProc):
|
|||||||
return 'V' + str(self.feedrate_format % fr_sec) + ';'
|
return 'V' + str(self.feedrate_format % fr_sec) + ';'
|
||||||
|
|
||||||
def spindle_code(self, p):
|
def spindle_code(self, p):
|
||||||
return '!MC1'
|
speed = int(p.spindlespeed)
|
||||||
|
if speed > 8388607:
|
||||||
|
speed = 8388607
|
||||||
|
if speed < 0:
|
||||||
|
speed = 0
|
||||||
|
|
||||||
|
gcode = '!MC1;\n'
|
||||||
|
gcode += '!RC%d;' % speed
|
||||||
|
return gcode
|
||||||
|
|
||||||
def dwell_code(self, p):
|
def dwell_code(self, p):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def spindle_stop_code(self, p):
|
def spindle_stop_code(self, p):
|
||||||
return '!MC0'
|
return '!MC0;'
|
||||||
|
|||||||
@@ -72,9 +72,9 @@ class Roland_MDX_540(PreProc):
|
|||||||
|
|
||||||
def linear_code(self, p):
|
def linear_code(self, p):
|
||||||
if p.units.upper() == 'IN':
|
if p.units.upper() == 'IN':
|
||||||
z = p.z / 25.4
|
z = p.z_cut / 25.4
|
||||||
else:
|
else:
|
||||||
z = p.z
|
z = p.z_cut
|
||||||
gcode = self.feedrate_code(p) + '\n'
|
gcode = self.feedrate_code(p) + '\n'
|
||||||
gcode += self.position_code(p).format(**p) + ',' + str(float(z * 100.0)) + ';'
|
gcode += self.position_code(p).format(**p) + ',' + str(float(z * 100.0)) + ';'
|
||||||
return gcode
|
return gcode
|
||||||
@@ -119,10 +119,18 @@ class Roland_MDX_540(PreProc):
|
|||||||
return 'V' + str(self.feedrate_format % fr_sec) + ';'
|
return 'V' + str(self.feedrate_format % fr_sec) + ';'
|
||||||
|
|
||||||
def spindle_code(self, p):
|
def spindle_code(self, p):
|
||||||
return '!MC1'
|
speed = int(p.spindlespeed)
|
||||||
|
if speed > 8388607:
|
||||||
|
speed = 8388607
|
||||||
|
if speed < 0:
|
||||||
|
speed = 0
|
||||||
|
|
||||||
|
gcode = '!MC1;\n'
|
||||||
|
gcode += '!RC%d;' % speed
|
||||||
|
return gcode
|
||||||
|
|
||||||
def dwell_code(self, p):
|
def dwell_code(self, p):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def spindle_stop_code(self, p):
|
def spindle_stop_code(self, p):
|
||||||
return '!MC0'
|
return '!MC0;'
|
||||||
|
|||||||
Reference in New Issue
Block a user