- fixed the Marlin postprocessor detection in GCode header

- the version date in GCode header is now the one set in FlatCAMApp.App.version_date
- fixed bug in postprocessor files: number of drills is now calculated only for the Excellon objects in toolchange function (only Excellon objects have drills)
This commit is contained in:
Marius Stanciu
2019-01-07 02:56:55 +02:00
committed by Marius S
parent 954bd9097a
commit c7db9aa566
6 changed files with 43 additions and 23 deletions

View File

@@ -87,7 +87,7 @@ class App(QtCore.QObject):
log.addHandler(handler) log.addHandler(handler)
# Version # Version
version = 8.6 version = 9.0
version_date = "2019/01/06" version_date = "2019/01/06"
beta = True beta = True

View File

@@ -2775,6 +2775,21 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
return dwg return dwg
def get_selected_tools_table_items(self):
"""
Returns a list of lists, each list in the list is made out of row elements
:return: List of table_tools items.
:rtype: list
"""
table_tools_items = []
for x in self.ui.geo_tools_table.selectedItems():
table_tools_items.append([self.ui.geo_tools_table.item(x.row(), column).text()
for column in range(0, self.ui.geo_tools_table.columnCount())])
for item in table_tools_items:
item[0] = str(item[0])
return table_tools_items
def on_generatecnc_button_click(self, *args): def on_generatecnc_button_click(self, *args):
self.app.report_usage("geometry_on_generatecnc_button") self.app.report_usage("geometry_on_generatecnc_button")
@@ -2838,6 +2853,8 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
job_obj.cnc_tools.clear() job_obj.cnc_tools.clear()
# job_obj.create_geometry() # job_obj.create_geometry()
job_obj.options['Tools_in_use'] = self.get_selected_tools_table_items()
for tooluid_key in self.sel_tools: for tooluid_key in self.sel_tools:
tool_cnt += 1 tool_cnt += 1
app_obj.progress.emit(20) app_obj.progress.emit(20)
@@ -3796,25 +3813,26 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
self.app.ui.show() self.app.ui.show()
def gcode_header(self): def gcode_header(self):
log.debug("FlatCAMCNCJob.gcode_header()")
time_str = "{:%A, %d %B %Y at %H:%M}".format(datetime.now()) time_str = "{:%A, %d %B %Y at %H:%M}".format(datetime.now())
marlin = False marlin = False
try: try:
for key in self.cnc_tools[0]: for key in self.cnc_tools:
if self.cnc_tools[0][key]['data']['ppname_g'] == 'marlin': if self.cnc_tools[key]['data']['ppname_g'] == 'marlin':
marlin = True marlin = True
break break
except: except Exception as e:
log.debug("FlatCAMCNCJob.gcode_header() error: --> %s" % str(e))
try: try:
for key in self.cnc_tools[0]: for key in self.cnc_tools:
if self.cnc_tools[0][key]['data']['ppname_e'] == 'marlin': if self.cnc_tools[key]['data']['ppname_e'] == 'marlin':
marlin = True marlin = True
break break
except: except:
pass pass
if marlin is False: if marlin is False:
gcode = '(G-CODE GENERATED BY FLATCAM - www.flatcam.org %s)\n' % str(self.app.version_date) + '\n'
gcode = '(G-CODE GENERATED BY FLATCAM - www.flatcam.org 2018)\n' + '\n'
gcode += '(Name: ' + str(self.options['name']) + ')\n' gcode += '(Name: ' + str(self.options['name']) + ')\n'
gcode += '(Type: ' + "G-code from " + str(self.options['type']) + ')\n' gcode += '(Type: ' + "G-code from " + str(self.options['type']) + ')\n'
@@ -3826,10 +3844,10 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
gcode += '(Created on ' + time_str + ')\n' + '\n' gcode += '(Created on ' + time_str + ')\n' + '\n'
else: else:
gcode = ';G-CODE GENERATED BY FLATCAM - www.flatcam.org 2018\n' + '\n' gcode = ';G-CODE GENERATED BY FLATCAM - www.flatcam.org %s\n' % str(self.app.version_date) + '\n'
gcode += ';Name: ' + str(self.options['name']) + '\n' gcode += ';Name: ' + str(self.options['name']) + '\n'
gcode += ';Type: ' + "G-code from " + str(p['options']['type']) + '\n' gcode += ';Type: ' + "G-code from " + str(self.options['type']) + '\n'
# if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': # if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry':
# gcode += '(Tools in use: ' + str(p['options']['Tools_in_use']) + ')\n' # gcode += '(Tools in use: ' + str(p['options']['Tools_in_use']) + ')\n'

View File

@@ -9,6 +9,12 @@ CAD program, and create G-Code for Isolation routing.
================================================= =================================================
6.01.2019
- fixed the Marlin postprocessor detection in GCode header
- the version date in GCode header is now the one set in FlatCAMApp.App.version_date
- fixed bug in postprocessor files: number of drills is now calculated only for the Excellon objects in toolchange function (only Excellon objects have drills)
5.01.2019 5.01.2019
- fixed cncjob TclCommand - it used the default values for parameters - fixed cncjob TclCommand - it used the default values for parameters
@@ -18,7 +24,6 @@ CAD program, and create G-Code for Isolation routing.
- added a new name (mine: for good and/or bad) to the contributors list - added a new name (mine: for good and/or bad) to the contributors list
- fixed the Join function to work on Gerber and Excellon, Gerber and Gerber, Excellon and Excelon combination of objects. The merged property is the solid_geometry and the result is a FlatCAMGeometry object. - fixed the Join function to work on Gerber and Excellon, Gerber and Gerber, Excellon and Excelon combination of objects. The merged property is the solid_geometry and the result is a FlatCAMGeometry object.
3.01.2019 3.01.2019
- initial merge into FlatCAM regular - initial merge into FlatCAM regular

View File

@@ -71,11 +71,10 @@ class grbl_11(FlatCAMPostProc):
else: else:
toolC_formatted = format(p.toolC, '.4f') toolC_formatted = format(p.toolC, '.4f')
for i in p['options']['Tools_in_use']:
if i[0] == p.tool:
no_drills = i[2]
if str(p['options']['type']) == 'Excellon': if str(p['options']['type']) == 'Excellon':
for i in p['options']['Tools_in_use']:
if i[0] == p.tool:
no_drills = i[2]
return """G00 Z{toolchangez} return """G00 Z{toolchangez}
T{tool} T{tool}
M5 M5

View File

@@ -75,11 +75,10 @@ class manual_toolchange(FlatCAMPostProc):
else: else:
toolC_formatted = format(p.toolC, '.4f') toolC_formatted = format(p.toolC, '.4f')
for i in p['options']['Tools_in_use']:
if i[0] == p.tool:
no_drills = i[2]
if str(p['options']['type']) == 'Excellon': if str(p['options']['type']) == 'Excellon':
for i in p['options']['Tools_in_use']:
if i[0] == p.tool:
no_drills = i[2]
return """G00 Z{toolchangez} return """G00 Z{toolchangez}
T{tool} T{tool}
M5 M5

View File

@@ -69,11 +69,10 @@ class marlin(FlatCAMPostProc):
else: else:
toolC_formatted = format(p.toolC, '.4f') toolC_formatted = format(p.toolC, '.4f')
for i in p['options']['Tools_in_use']:
if i[0] == p.tool:
no_drills = i[2]
if str(p['options']['type']) == 'Excellon': if str(p['options']['type']) == 'Excellon':
for i in p['options']['Tools_in_use']:
if i[0] == p.tool:
no_drills = i[2]
return """G0 Z{toolchangez} return """G0 Z{toolchangez}
M5 M5
M0 Change to Tool Dia = {toolC}, Total drills for current tool = {t_drills} M0 Change to Tool Dia = {toolC}, Total drills for current tool = {t_drills}