- added a function to read the parameters from ToolChange macro Text Box (I need to move it from CNCJob to Excellon and Geometry)

This commit is contained in:
Marius Stanciu
2019-02-26 02:24:56 +02:00
committed by Marius S
parent 386c3408ca
commit 74ecbabf1f
4 changed files with 33 additions and 234 deletions

View File

@@ -1343,6 +1343,9 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
self.multigeo = True
# search for toolchange parameters in the Toolchange Custom Code
self.re_toolchange_custom = re.compile(r'^.*%([a-zA-Z0-9]+)%.*')
# Attributes to be included in serialization
# Always append to it because it carries contents
# from predecessors.
@@ -2253,6 +2256,17 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
self.ui.feedrate_probe_entry.setVisible(False)
self.ui.feedrate_probe_label.hide()
def parse_custom_toolchange_code(self, data):
toolchange_gcode = ''
lines = StringIO(data)
for line in lines:
match = self.re_toolchange_custom.search(line)
if match:
command = match.group(1)
print(globals()[command])
def on_create_cncjob_button_click(self, *args):
self.app.report_usage("excellon_on_create_cncjob_button")
self.read_form()
@@ -2745,6 +2759,9 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
# the default value is False
self.multigeo = False
# search for toolchange parameters in the Toolchange Custom Code
self.re_toolchange_custom = re.compile(r'^.*%([a-zA-Z0-9]+)%.*')
# flag to store if the geometry is part of a special group of geometries that can't be processed by the default
# engine of FlatCAM. Most likely are generated by some of tools and are special cases of geometries.
self. special_group = None
@@ -3849,6 +3866,17 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
self.ui.feedrate_probe_entry.setVisible(False)
self.ui.feedrate_probe_label.hide()
def parse_custom_toolchange_code(self, data):
toolchange_gcode = ''
lines = StringIO(data)
for line in lines:
match = self.re_toolchange_custom.search(line)
if match:
command = match.group(1)
print(globals()[command])
def on_generatecnc_button_click(self, *args):
self.app.report_usage("geometry_on_generatecnc_button")