- Milling Plugin - will update the UI form on object change with the data from its last tool
- Drilling Plugin - will update the UI form on object selection on canvas
This commit is contained in:
@@ -7,6 +7,11 @@ CHANGELOG for FlatCAM beta
|
|||||||
|
|
||||||
=================================================
|
=================================================
|
||||||
|
|
||||||
|
22.03.2021
|
||||||
|
|
||||||
|
- Milling Plugin - will update the UI form on object change with the data from its last tool
|
||||||
|
- Drilling Plugin - will update the UI form on object selection on canvas
|
||||||
|
|
||||||
21.03.2021
|
21.03.2021
|
||||||
|
|
||||||
- fixed a small issue in Film Plugin (the object selection the plugin UI is not updated with the selected object in Project Tab)
|
- fixed a small issue in Film Plugin (the object selection the plugin UI is not updated with the selected object in Project Tab)
|
||||||
|
|||||||
@@ -958,8 +958,22 @@ class ToolDrilling(AppTool, Excellon):
|
|||||||
else:
|
else:
|
||||||
self.ui.generate_cnc_button.setDisabled(False)
|
self.ui.generate_cnc_button.setDisabled(False)
|
||||||
|
|
||||||
|
def on_object_selection_changed(self, current, previous):
|
||||||
|
try:
|
||||||
|
sel_obj = current.indexes()[0].internalPointer().obj
|
||||||
|
name = sel_obj.options['name']
|
||||||
|
kind = sel_obj.kind
|
||||||
|
if kind in ['geometry', 'excellon']:
|
||||||
|
self.ui.object_combo.set_value(name)
|
||||||
|
except IndexError:
|
||||||
|
pass
|
||||||
|
|
||||||
def ui_connect(self):
|
def ui_connect(self):
|
||||||
|
|
||||||
|
# When object selection on canvas change
|
||||||
|
# self.app.collection.view.selectionModel().selectionChanged.connect(self.on_object_selection_changed)
|
||||||
|
self.app.proj_selection_changed.connect(self.on_object_selection_changed)
|
||||||
|
|
||||||
# Area Exception - exclusion shape added signal
|
# Area Exception - exclusion shape added signal
|
||||||
# first disconnect it from any other object
|
# first disconnect it from any other object
|
||||||
try:
|
try:
|
||||||
@@ -1010,6 +1024,13 @@ class ToolDrilling(AppTool, Excellon):
|
|||||||
self.ui.exclusion_table.itemChanged.connect(self.on_exclusion_table_overz)
|
self.ui.exclusion_table.itemChanged.connect(self.on_exclusion_table_overz)
|
||||||
|
|
||||||
def ui_disconnect(self):
|
def ui_disconnect(self):
|
||||||
|
# When object selection on canvas change
|
||||||
|
# self.app.collection.view.selectionModel().selectionChanged.disconnect()
|
||||||
|
try:
|
||||||
|
self.app.proj_selection_changed.disconnect()
|
||||||
|
except (TypeError, AttributeError):
|
||||||
|
pass
|
||||||
|
|
||||||
# rows selected
|
# rows selected
|
||||||
try:
|
try:
|
||||||
self.ui.tools_table.clicked.disconnect(self.on_row_selection_change)
|
self.ui.tools_table.clicked.disconnect(self.on_row_selection_change)
|
||||||
|
|||||||
@@ -1311,6 +1311,12 @@ class ToolMilling(AppTool, Excellon):
|
|||||||
self.app.collection.set_active(self.obj_name)
|
self.app.collection.set_active(self.obj_name)
|
||||||
self.build_ui()
|
self.build_ui()
|
||||||
|
|
||||||
|
# new object that is now selected
|
||||||
|
obj = self.app.collection.get_by_name(self.obj_name)
|
||||||
|
if obj is not None:
|
||||||
|
last_key = list(obj.tools.keys())[-1]
|
||||||
|
self.to_form(storage=obj.tools[last_key]['data'])
|
||||||
|
|
||||||
def on_object_changed(self):
|
def on_object_changed(self):
|
||||||
if not self.app.ui.notebook.tabText(2) != _("Milling Tool"):
|
if not self.app.ui.notebook.tabText(2) != _("Milling Tool"):
|
||||||
return
|
return
|
||||||
@@ -1342,6 +1348,10 @@ class ToolMilling(AppTool, Excellon):
|
|||||||
self.app.collection.set_active(self.obj_name)
|
self.app.collection.set_active(self.obj_name)
|
||||||
self.build_ui()
|
self.build_ui()
|
||||||
|
|
||||||
|
if self.target_obj is not None:
|
||||||
|
last_key = list(self.target_obj.tools.keys())[-1]
|
||||||
|
self.to_form(storage=self.target_obj.tools[last_key]['data'])
|
||||||
|
|
||||||
def on_object_selection_changed(self, current, previous):
|
def on_object_selection_changed(self, current, previous):
|
||||||
try:
|
try:
|
||||||
sel_obj = current.indexes()[0].internalPointer().obj
|
sel_obj = current.indexes()[0].internalPointer().obj
|
||||||
|
|||||||
Reference in New Issue
Block a user