- Milling Tool - fixed the situation when launching the Tool but there is no object loaded
This commit is contained in:
@@ -18,6 +18,7 @@ CHANGELOG for FlatCAM beta
|
|||||||
- fixed an error in the Follow Tool
|
- fixed an error in the Follow Tool
|
||||||
- started to work in Milling Tool - designing the Tool UI
|
- started to work in Milling Tool - designing the Tool UI
|
||||||
- Milling Tool - finished the UI and also the button handlers in the Geometry and Excellon objects Properties UI
|
- Milling Tool - finished the UI and also the button handlers in the Geometry and Excellon objects Properties UI
|
||||||
|
- Milling Tool - fixed the situation when launching the Tool but there is no object loaded
|
||||||
|
|
||||||
12.11.2020
|
12.11.2020
|
||||||
|
|
||||||
|
|||||||
@@ -493,12 +493,20 @@ class ToolMilling(AppTool, Excellon):
|
|||||||
|
|
||||||
self.units = self.app.defaults['units']
|
self.units = self.app.defaults['units']
|
||||||
|
|
||||||
|
if self.target_obj:
|
||||||
|
self.ui.param_frame.setDisabled(False)
|
||||||
|
|
||||||
|
tools_dict = self.target_obj.tools
|
||||||
|
|
||||||
|
else:
|
||||||
|
tools_dict = {}
|
||||||
|
|
||||||
row_idx = 0
|
row_idx = 0
|
||||||
|
|
||||||
n = len(self.target_obj.tools)
|
n = len(tools_dict)
|
||||||
self.ui.geo_tools_table.setRowCount(n)
|
self.ui.geo_tools_table.setRowCount(n)
|
||||||
|
|
||||||
for tooluid_key, tooluid_value in self.target_obj.tools.items():
|
for tooluid_key, tooluid_value in tools_dict.items():
|
||||||
|
|
||||||
# -------------------- ID ------------------------------------------ #
|
# -------------------- ID ------------------------------------------ #
|
||||||
tool_id = QtWidgets.QTableWidgetItem('%d' % int(row_idx + 1))
|
tool_id = QtWidgets.QTableWidgetItem('%d' % int(row_idx + 1))
|
||||||
@@ -602,10 +610,10 @@ class ToolMilling(AppTool, Excellon):
|
|||||||
|
|
||||||
# disable the Plot column in Tool Table if the geometry is SingleGeo as it is not needed
|
# disable the Plot column in Tool Table if the geometry is SingleGeo as it is not needed
|
||||||
# and can create some problems
|
# and can create some problems
|
||||||
if self.target_obj.multigeo is False:
|
if self.target_obj and self.target_obj.multigeo is True:
|
||||||
self.ui.geo_tools_table.setColumnHidden(4, True)
|
|
||||||
else:
|
|
||||||
self.ui.geo_tools_table.setColumnHidden(4, False)
|
self.ui.geo_tools_table.setColumnHidden(4, False)
|
||||||
|
else:
|
||||||
|
self.ui.geo_tools_table.setColumnHidden(4, True)
|
||||||
|
|
||||||
self.ui_connect()
|
self.ui_connect()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user