- Milling Tool - finished the UI and also the button handlers in the Geometry and Excellon objects Properties UI

This commit is contained in:
Marius Stanciu
2020-11-13 17:38:41 +02:00
parent 60b2c4b04f
commit c4b04ef0e5
5 changed files with 555 additions and 102 deletions

View File

@@ -181,8 +181,7 @@ class ExcellonObject(FlatCAMObj, Excellon):
self.calculations_finished.connect(self.update_area_chull)
self.ui.drill_button.clicked.connect(lambda: self.app.drilling_tool.run(toggle=True))
# FIXME will uncomment when Milling Tool is ready
# self.ui.milling_button.clicked.connect(lambda: self.app.milling_tool.run(toggle=True))
self.ui.milling_button.clicked.connect(self.on_milling_button_clicked)
# UTILITIES
self.ui.util_button.clicked.connect(lambda st: self.ui.util_frame.show() if st else self.ui.util_frame.hide())
@@ -632,6 +631,12 @@ class ExcellonObject(FlatCAMObj, Excellon):
# make sure that the FCTree widget columns are resized to content
self.ui.treeWidget.resize_sig.emit()
def on_milling_button_clicked(self):
self.app.milling_tool.run(toggle=False)
self.app.milling_tool.ui.target_radio.set_value('exc')
current_obj = self.app.collection.get_active()
self.app.milling_tool.ui.object_combo.set_value(current_obj.options['name'])
def export_excellon(self, whole, fract, e_zeros=None, form='dec', factor=1, slot_type='routing'):
"""
Returns two values, first is a boolean , if 1 then the file has slots and second contain the Excellon code

View File

@@ -657,6 +657,7 @@ class GeometryObject(FlatCAMObj, Geometry):
self.ui.generate_cnc_button.clicked.connect(self.on_generatecnc_button_click)
self.ui.paint_tool_button.clicked.connect(lambda: self.app.paint_tool.run(toggle=False))
self.ui.generate_ncc_button.clicked.connect(lambda: self.app.ncclear_tool.run(toggle=False))
self.ui.milling_button.clicked.connect(self.on_milling_button_clicked)
# Postprocessor change
self.ui.pp_geometry_name_cb.activated.connect(self.on_pp_changed)
@@ -698,6 +699,12 @@ class GeometryObject(FlatCAMObj, Geometry):
# make sure that the FCTree widget columns are resized to content
self.ui.treeWidget.resize_sig.emit()
def on_milling_button_clicked(self):
self.app.milling_tool.run(toggle=False)
self.app.milling_tool.ui.target_radio.set_value('geo')
current_obj = self.app.collection.get_active()
self.app.milling_tool.ui.object_combo.set_value(current_obj.options['name'])
def on_rebuild_ui(self):
# read the table tools uid
current_uid_list = []