- finished preprocessor file for Kosy CNC machine (NCCAD9)
- fixed the gcode header export to work with the new data structure
This commit is contained in:
@@ -167,7 +167,7 @@ class CNCJobObject(FlatCAMObj, CNCjob):
|
||||
|
||||
self.prepend_snippet = ''
|
||||
self.append_snippet = ''
|
||||
self.gc_header = self.gcode_header()
|
||||
self.gc_header = ''
|
||||
self.gc_start = ''
|
||||
self.gc_end = ''
|
||||
|
||||
@@ -473,7 +473,6 @@ class CNCJobObject(FlatCAMObj, CNCjob):
|
||||
# #############################################################################################################
|
||||
# ##################################### SIGNALS CONNECTIONS ###################################################
|
||||
# #############################################################################################################
|
||||
|
||||
self.ui.level.toggled.connect(self.on_level_changed)
|
||||
|
||||
# annotation signal
|
||||
@@ -525,6 +524,8 @@ class CNCJobObject(FlatCAMObj, CNCjob):
|
||||
if self.append_snippet != '' or self.prepend_snippet != '':
|
||||
preamble = self.prepend_snippet
|
||||
postamble = self.append_snippet
|
||||
|
||||
self.gc_header = self.gcode_header()
|
||||
gc = self.export_gcode(preamble=preamble, postamble=postamble, to_file=True)
|
||||
|
||||
# set the Source File attribute with the calculated GCode
|
||||
@@ -820,15 +821,17 @@ class CNCJobObject(FlatCAMObj, CNCjob):
|
||||
marlin = False
|
||||
hpgl = False
|
||||
probe_pp = False
|
||||
nccad_pp = False
|
||||
|
||||
gcode = ''
|
||||
|
||||
start_comment = comment_start_symbol if comment_start_symbol is not None else '('
|
||||
stop_comment = comment_stop_symbol if comment_stop_symbol is not None else ')'
|
||||
|
||||
if self.options['type'] == 'geometry':
|
||||
if self.options['type'].lower() == 'geometry':
|
||||
try:
|
||||
for key in self.tools:
|
||||
ppg = self.tools[key]['data']['ppname_g']
|
||||
ppg = self.tools[key]['data']['tools_mill_ppname_g']
|
||||
if 'marlin' in ppg.lower() or 'repetier' in ppg.lower():
|
||||
marlin = True
|
||||
break
|
||||
@@ -838,24 +841,33 @@ class CNCJobObject(FlatCAMObj, CNCjob):
|
||||
if "toolchange_probe" in ppg.lower():
|
||||
probe_pp = True
|
||||
break
|
||||
except KeyError:
|
||||
# self.app.log.debug("FlatCAMCNCJob.gcode_header() error: --> %s" % str(e))
|
||||
if "nccad" in ppg.lower():
|
||||
nccad_pp = True
|
||||
except Exception as e:
|
||||
self.app.log.debug("FlatCAMCNCJob.gcode_header() error: --> %s" % str(e))
|
||||
pass
|
||||
|
||||
try:
|
||||
if 'marlin' in self.options['ppname_e'].lower() or 'repetier' in self.options['ppname_e'].lower():
|
||||
if 'marlin' in self.options['tools_drill_ppname_e'].lower() or \
|
||||
'repetier' in self.options['tools_drill_ppname_e'].lower():
|
||||
marlin = True
|
||||
except KeyError:
|
||||
# self.app.log.debug("FlatCAMCNCJob.gcode_header(): --> There is no such self.option: %s" % str(e))
|
||||
pass
|
||||
|
||||
try:
|
||||
if "toolchange_probe" in self.options['ppname_e'].lower():
|
||||
if "toolchange_probe" in self.options['tools_drill_ppname_e'].lower():
|
||||
probe_pp = True
|
||||
except KeyError:
|
||||
# self.app.log.debug("FlatCAMCNCJob.gcode_header(): --> There is no such self.option: %s" % str(e))
|
||||
pass
|
||||
|
||||
try:
|
||||
if 'nccad' in self.options['tools_drill_ppname_e'].lower():
|
||||
nccad_pp = True
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
if marlin is True:
|
||||
gcode += ';Marlin(Repetier) G-CODE GENERATED BY FLATCAM v%s - www.flatcam.org - Version Date: %s\n' % \
|
||||
(str(self.app.version), str(self.app.version_date)) + '\n'
|
||||
@@ -889,6 +901,15 @@ class CNCJobObject(FlatCAMObj, CNCjob):
|
||||
|
||||
gcode += '(Units: ' + self.units.upper() + ')\n' + "\n"
|
||||
gcode += '(Created on ' + time_str + ')\n' + '\n'
|
||||
elif nccad_pp is True:
|
||||
gcode += ';NCCAD9 G-CODE GENERATED BY FLATCAM v%s - www.flatcam.org - Version Date: %s\n' % \
|
||||
(str(self.app.version), str(self.app.version_date)) + '\n'
|
||||
|
||||
gcode += ';Name: ' + str(self.options['name']) + '\n'
|
||||
gcode += ';Type: ' + "G-code from " + str(self.options['type']) + '\n'
|
||||
|
||||
gcode += ';Units: ' + self.units.upper() + '\n' + "\n"
|
||||
gcode += ';Created on ' + time_str + '\n' + '\n'
|
||||
else:
|
||||
gcode += '%sG-CODE GENERATED BY FLATCAM v%s - www.flatcam.org - Version Date: %s%s\n' % \
|
||||
(start_comment, str(self.app.version), str(self.app.version_date), stop_comment) + '\n'
|
||||
|
||||
Reference in New Issue
Block a user