diff --git a/CHANGELOG.md b/CHANGELOG.md index b0d6bdb4..66b50c65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ CHANGELOG for FlatCAM beta ================================================= +20.07.2021 + +- in ParseDXF file fixed import of module due of changes in the latest version of ezdxf module +- changes in Milling Plugin in the selection in the Tools Table +- some updates of milling data structure +- changes in handling the tool shape due of moving the parameter from the tool table in the tool parameters section + 18.07.2021 - modified the Geometry UI tools table. Replaced the comboboxes with labels. diff --git a/appDatabase.py b/appDatabase.py index cb0f9260..898c9d1f 100644 --- a/appDatabase.py +++ b/appDatabase.py @@ -25,7 +25,7 @@ class ToolsDB2UI: self.app = app self.decimals = self.app.decimals - self.offset_item_options = ["Path", "In", "Out", "Custom"] + self.offset_item_options = [_("Path"), _("In"), _("Out"), _("Custom")] self.job_item_options = [_('Roughing'), _('Finishing'), _('Isolation'), _('Polishing')] self.tool_job_options = ["C1", "C2", "C3", "C4", "B", "V"] @@ -1419,7 +1419,7 @@ class ToolsDB2(QtWidgets.QWidget): "tooldia": self.ui.dia_entry, # Milling - "tools_mill_shape": self.ui.mill_shape_combo, + "tools_mill_tool_shape": self.ui.mill_shape_combo, "tools_mill_cutz": self.ui.mill_cutz_entry, "tools_mill_multidepth": self.ui.mill_multidepth_cb, "tools_mill_depthperpass": self.ui.mill_multidepth_entry, @@ -1502,7 +1502,7 @@ class ToolsDB2(QtWidgets.QWidget): "gdb_dia": "tooldia", # Milling - "gdb_shape": "tools_mill_shape", + "gdb_shape": "tools_mill_tool_shape", "gdb_cutz": "tools_mill_cutz", "gdb_multidepth": "tools_mill_multidepth", "gdb_multidepth_entry": "tools_mill_depthperpass", @@ -1923,7 +1923,7 @@ class ToolsDB2(QtWidgets.QWidget): "tol_max": 0.0, # Milling - "tools_mill_shape": self.app.defaults["tools_mill_shape"], + "tools_mill_tool_shape": self.app.defaults["tools_mill_tool_shape"], "tools_mill_job_type": self.app.defaults["tools_mill_job_type"], "tools_mill_offset_type": self.app.defaults["tools_mill_offset_type"], "tools_mill_offset_value": float(self.app.defaults["tools_mill_offset_value"]), @@ -2514,7 +2514,7 @@ class ToolsDB2(QtWidgets.QWidget): elif wdg_name == "gdb_job": self.db_tool_dict[tool_id]['data']['job'] = val elif wdg_name == "gdb_shape": - self.db_tool_dict[tool_id]['data']['tools_mill_shape'] = val + self.db_tool_dict[tool_id]['data']['tools_mill_tool_shape'] = val else: # Milling Tool if wdg_name == "gdb_tool_target": @@ -3101,7 +3101,7 @@ class ToolsDB2(QtWidgets.QWidget): # tshape_item = FCComboBox() # for item in self.tool_type_item_options: # tshape_item.addItem(item) -# tshape_item.set_value(tooldict['data']['tools_mill_shape']) +# tshape_item.set_value(tooldict['data']['tools_mill_tool_shape']) # widget.setCellWidget(row, 6, tshape_item) # # cutz_item = FCDoubleSpinner() @@ -3281,7 +3281,7 @@ class ToolsDB2(QtWidgets.QWidget): # dict_elem['offset'] = 'Path' # dict_elem['offset_value'] = 0.0 # dict_elem['type'] = 'Rough' -# dict_elem['data']['tools_mill_shape'] = 'C1' +# dict_elem['data']['tools_mill_tool_shape'] = 'C1' # dict_elem['data'] = default_data # # new_toolid = len(self.db_tool_dict) + 1 @@ -3531,7 +3531,7 @@ class ToolsDB2(QtWidgets.QWidget): # elif column_header_text == _('Tool Type'): # dict_elem['type'] = self.table_widget.cellWidget(row, col).get_value() # elif column_header_text == _('Tool Shape'): -# dict_elem['data']['tools_mill_shape'] = self.table_widget.cellWidget(row, col).get_value() +# dict_elem['data']['tools_mill_tool_shape'] = self.table_widget.cellWidget(row, col).get_value() # else: # if column_header_text == _('Cut Z'): # default_data['cutz'] = self.table_widget.cellWidget(row, col).get_value() diff --git a/appEditors/appGCodeEditor.py b/appEditors/appGCodeEditor.py index e1bd1d99..ddb1ab16 100644 --- a/appEditors/appGCodeEditor.py +++ b/appEditors/appGCodeEditor.py @@ -199,9 +199,9 @@ class AppGCodeEditor(QtCore.QObject): # -------------------- TOOL SHAPE ------------------------------------- # tool_type_item_options = ["C1", "C2", "C3", "C4", "B", "V"] try: - tool_shape_item_txt = tool_type_item_options[dia_value['data']['tools_mill_shape']] + tool_shape_item_txt = tool_type_item_options[dia_value['data']['tools_mill_tool_shape']] except TypeError: - tool_shape_item_txt = dia_value['data']['tools_mill_shape'] + tool_shape_item_txt = dia_value['data']['tools_mill_tool_shape'] tool_shape_item = QtWidgets.QTableWidgetItem(tool_shape_item_txt) t_id.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) diff --git a/appObjects/FlatCAMCNCJob.py b/appObjects/FlatCAMCNCJob.py index d61cf526..ca27a7a2 100644 --- a/appObjects/FlatCAMCNCJob.py +++ b/appObjects/FlatCAMCNCJob.py @@ -240,9 +240,9 @@ class CNCJobObject(FlatCAMObj, CNCjob): job_item = QtWidgets.QTableWidgetItem(job_item_txt) try: - tool_shape_item_txt = tool_shape_options[dia_value['data']['tools_mill_shape']] + tool_shape_item_txt = tool_shape_options[dia_value['data']['tools_mill_tool_shape']] except TypeError: - tool_shape_item_txt = dia_value['data']['tools_mill_shape'] + tool_shape_item_txt = dia_value['data']['tools_mill_tool_shape'] tool_shape_item = QtWidgets.QTableWidgetItem(tool_shape_item_txt) t_id.setFlags(QtCore.Qt.ItemIsEnabled) diff --git a/appObjects/FlatCAMGeometry.py b/appObjects/FlatCAMGeometry.py index dabf39d9..f7469ebf 100644 --- a/appObjects/FlatCAMGeometry.py +++ b/appObjects/FlatCAMGeometry.py @@ -226,9 +226,9 @@ class GeometryObject(FlatCAMObj, Geometry): # -------------------- TOOL SHAPE ------------------------------------- # try: - tool_shape_item_txt = self.tool_type_item_options[tooluid_value['data']['tools_mill_shape']] + tool_shape_item_txt = self.tool_type_item_options[tooluid_value['data']['tools_mill_tool_shape']] except TypeError: - tool_shape_item_txt = tooluid_value['data']['tools_mill_shape'] + tool_shape_item_txt = tooluid_value['data']['tools_mill_tool_shape'] tool_shape_item = QtWidgets.QTableWidgetItem(tool_shape_item_txt) tool_shape_item.setFlags(QtCore.Qt.ItemIsEnabled) self.ui.geo_tools_table.setItem(row_idx, 4, tool_shape_item) # Tool Shape @@ -1272,7 +1272,7 @@ class GeometryObject(FlatCAMObj, Geometry): last_data = self.tools[max_uid]['data'] # last_offset = self.tools[max_uid]['offset'] # last_offset_value = self.tools[max_uid]['offset_value'] - # last_tool_type = self.tools[max_uid]['data']['tools_mill_shape'] + # last_tool_type = self.tools[max_uid]['data']['tools_mill_tool_shape'] last_solid_geometry = self.tools[max_uid]['solid_geometry'] if new_geo is None else new_geo @@ -1680,7 +1680,7 @@ class GeometryObject(FlatCAMObj, Geometry): else: tooluid_value['data']['tools_mill_job_type'] = cb_txt elif cw_col == 4: - tooluid_value['data']['data']['tools_mill_shape'] = cb_txt + tooluid_value['data']['data']['tools_mill_tool_shape'] = cb_txt # if the tool_type selected is V-Shape then autoselect the toolpath type as Iso if cb_txt == 'V': diff --git a/appParsers/ParseDXF.py b/appParsers/ParseDXF.py index 3337f83f..576e1d02 100644 --- a/appParsers/ParseDXF.py +++ b/appParsers/ParseDXF.py @@ -7,7 +7,8 @@ from shapely.geometry import LineString, Point from shapely.affinity import rotate -from ezdxf.math import Vector as ezdxf_vector +# from ezdxf.math import Vector as ezdxf_vector +from ezdxf.math import Vec3 as ezdxf_vector from appParsers.ParseFont import * from appParsers.ParseDXF_Spline import * diff --git a/appPlugins/ToolIsolation.py b/appPlugins/ToolIsolation.py index dc4c21fd..a4c8172d 100644 --- a/appPlugins/ToolIsolation.py +++ b/appPlugins/ToolIsolation.py @@ -289,8 +289,8 @@ class ToolIsolation(AppTool, Gerber): if selected_obj.kind == 'gerber': current_name = selected_obj.options['name'] self.ui.object_combo.set_value(current_name) - except Exception: - pass + except Exception as ee: + self.app.log.debug("ToolIsolation.set_tool_ui() Select Gerber object -> %s" % str(ee)) # Show/Hide Advanced Options app_mode = self.app.defaults["global_app_level"] @@ -592,7 +592,7 @@ class ToolIsolation(AppTool, Gerber): # Tool Type tool_type_item = FCComboBox() tool_type_item.addItems(self.tool_type_item_options) - idx = int(tooluid_value['data']['tools_mill_shape']) + idx = int(tooluid_value['data']['tools_mill_tool_shape']) tool_type_item.setCurrentIndex(idx) self.ui.tools_table.setCellWidget(row_no, 2, tool_type_item) @@ -1702,6 +1702,8 @@ class ToolIsolation(AppTool, Gerber): self.iso_tools[tool_iso][key]["tools_iso_isoexcept"] = self.ui.except_cb.get_value() self.iso_tools[tool_iso][key]["tools_iso_selection"] = self.ui.select_combo.get_value() self.iso_tools[tool_iso][key]["tools_iso_area_shape"] = self.ui.area_shape_radio.get_value() + self.iso_tools[tool_iso][key]["tools_mill_job_type"] = 2 # _("Isolation") + self.iso_tools[tool_iso][key]["tools_mill_tool_shape"] = 5 # "V" if combine: if self.ui.rest_cb.get_value(): @@ -1737,7 +1739,7 @@ class ToolIsolation(AppTool, Gerber): tool_dia = tools_storage[tool]['tooldia'] for i in range(passes): - tool_type = tools_storage[tool]['data']['tools_mill_shape'] + tool_type = tools_storage[tool]['data']['tools_mill_tool_shape'] iso_offset = tool_dia * ((2 * i + 1) / 2.0000001) - (i * overlap * tool_dia) if negative_dia: @@ -1911,7 +1913,7 @@ class ToolIsolation(AppTool, Gerber): if float('%.*f' % (self.decimals, tools_storage[tool]['tooldia'])) == sorted_tool: tool_dia = tools_storage[tool]['tooldia'] - tool_type = tools_storage[tool]['data']['tools_mill_shape'] + tool_type = tools_storage[tool]['data']['tools_mill_tool_shape'] tool_data = tools_storage[tool]['data'] passes = tool_data['tools_iso_passes'] @@ -2086,7 +2088,7 @@ class ToolIsolation(AppTool, Gerber): tool_dia = tools_storage[tool]['tooldia'] tool_has_offset = tools_storage[tool]['data']['tools_mill_offset_type'] tool_offset_value = tools_storage[tool]['data']['tools_mill_offset_value'] - tool_type = tools_storage[tool]['data']['tools_mill_shape'] + tool_type = tools_storage[tool]['data']['tools_mill_tool_shape'] tool_data = tools_storage[tool]['data'] work_geo = geometry diff --git a/appPlugins/ToolMilling.py b/appPlugins/ToolMilling.py index dbd07359..30e513a8 100644 --- a/appPlugins/ToolMilling.py +++ b/appPlugins/ToolMilling.py @@ -220,8 +220,8 @@ class ToolMilling(AppTool, Excellon): self.ui.pp_geo_name_cb.activated.connect(self.on_pp_changed) # V tool shape params changed - self.ui.tipdia_entry.valueChanged.connect(self.on_update_cutz) - self.ui.tipangle_entry.valueChanged.connect(self.on_update_cutz) + self.ui.tipdia_entry.valueChanged.connect(lambda: self.on_update_cutz()) + self.ui.tipangle_entry.valueChanged.connect(lambda: self.on_update_cutz()) self.ui.apply_param_to_all.clicked.connect(self.on_apply_param_to_all_clicked) self.ui.tools_table.drag_drop_sig.connect(self.on_exc_rebuild_ui) @@ -446,7 +446,7 @@ class ToolMilling(AppTool, Excellon): "tools_mill_offset_type": self.ui.offset_type_combo, "tools_mill_offset_value": self.ui.offset_entry, - "tools_mill_tool_type": self.ui.tool_shape_combo, + "tools_mill_tool_shape": self.ui.tool_shape_combo, "tools_mill_job_type": self.ui.job_type_combo, "tools_mill_polish_margin": self.ui.polish_margin_entry, "tools_mill_polish_overlap": self.ui.polish_over_entry, @@ -498,7 +498,7 @@ class ToolMilling(AppTool, Excellon): "mill_offset_type": "tools_mill_offset_type", "mill_offset": "tools_mill_offset_value", - "mill_tool_type": "tools_mill_tool_type", + "mill_tool_shape": "tools_mill_tool_shape", "mill_job_type": "tools_mill_job_type", "mill_polish_margin": "tools_mill_polish_margin", @@ -745,7 +745,7 @@ class ToolMilling(AppTool, Excellon): for tool in self.target_obj.tools: tool_data = self.target_obj.tools[tool]['data'] - tool_data['tools_mill_offset_type'] = 'Path' + tool_data['tools_mill_offset_type'] = 0 # 'Path' tool_data['tools_mill_offset_value'] = 0.0 tool_data['tools_mill_job_type'] = 0 #_('Roughing') @@ -1593,119 +1593,79 @@ class ToolMilling(AppTool, Excellon): :return: """ + self.ui_disconnect() + if self.ui.target_radio.get_value() == 'exc': - # ######################################################################################################### - # Excellon Tool Table - # ######################################################################################################### - sel_model = self.ui.tools_table.selectionModel() - sel_indexes = sel_model.selectedIndexes() - - # it will iterate over all indexes which means all items in all columns too but I'm interested only on rows - sel_rows = set() - for idx in sel_indexes: - sel_rows.add(idx.row()) - - if len(sel_rows) == self.ui.tools_table.rowCount(): - self.ui.tools_table.clearSelection() - self.ui.tool_data_label.setText( - "%s: %s" % (_('Parameters for'), _("No Tool Selected")) - ) - else: - self.ui.tools_table.selectAll() - self.ui.tool_data_label.setText( - "%s: %s" % (_('Parameters for'), _("Multiple Tools")) - ) + plugin_table = self.ui.tools_table else: - # ######################################################################################################### - # Geometry Tool Table - # ######################################################################################################### - sel_model = self.ui.geo_tools_table.selectionModel() - sel_indexes = sel_model.selectedIndexes() + plugin_table = self.ui.geo_tools_table - # it will iterate over all indexes which means all items in all columns too but I'm interested only on rows - sel_rows = set() - for idx in sel_indexes: - sel_rows.add(idx.row()) + # ######################################################################################################### + # Tool Table + # ######################################################################################################### + sel_model = plugin_table.selectionModel() + sel_rows_index_list = sel_model.selectedRows() + sel_rows = [r.row() for r in sel_rows_index_list] - if len(sel_rows) == self.ui.geo_tools_table.rowCount(): - self.ui.geo_tools_table.clearSelection() + if len(sel_rows) == plugin_table.rowCount(): + plugin_table.clearSelection() + self.ui.tool_data_label.setText( + "%s: %s" % (_('Parameters for'), _("No Tool Selected")) + ) + else: + plugin_table.selectAll() + if plugin_table.rowCount() == 1: + # update the QLabel that shows for which Tool we have the parameters in the UI form + tooluid = int(plugin_table.item(0, 3).text()) self.ui.tool_data_label.setText( - "%s: %s" % (_('Parameters for'), _("No Tool Selected")) + "%s: %s %d" % (_('Parameters for'), _("Tool"), tooluid) ) else: - self.ui.geo_tools_table.selectAll() self.ui.tool_data_label.setText( "%s: %s" % (_('Parameters for'), _("Multiple Tools")) ) - if not sel_rows or len(sel_rows) == 0: + sel_rows_index_list = sel_model.selectedRows() + sel_rows = [r.row() for r in sel_rows_index_list] + if sel_rows and len(sel_rows) > 0: self.ui.param_frame.setDisabled(False) self.ui.generate_cnc_button.setDisabled(False) else: self.ui.param_frame.setDisabled(True) self.ui.generate_cnc_button.setDisabled(True) + self.ui_connect() + def on_row_selection_change(self): - if self.ui.target_radio.get_value() == 'exc': - # ######################################################################################################### - # Excellon Tool Table - # ######################################################################################################## - sel_model = self.ui.tools_table.selectionModel() - sel_indexes = sel_model.selectedIndexes() - - # it will iterate over all indexes which means all items in all columns too but I'm interested only on rows - sel_rows = set() - for idx in sel_indexes: - sel_rows.add(idx.row()) - - # update UI only if only one row is selected otherwise having multiple rows selected will deform information - # for the rows other that the current one (first selected) - if len(sel_rows) <= 1: - self.update_ui() - else: - # ######################################################################################################### - # Geometry Tool Table - # ######################################################################################################### - sel_model = self.ui.geo_tools_table.selectionModel() - sel_indexes = sel_model.selectedIndexes() - - # it will iterate over all indexes which means all items in all columns too but I'm interested only on rows - sel_rows = set() - for idx in sel_indexes: - sel_rows.add(idx.row()) - - # update UI only if only one row is selected otherwise having multiple rows selected will deform information - # for the rows other that the current one (first selected) - if len(sel_rows) <= 1: - self.update_ui() - - # synchronize selection in the Geometry Milling Tool Table with the selection in the Geometry UI Tool Table - # self.target_obj.ui.geo_tools_table.clearSelection() - # current_selection_mode = self.target_obj.ui.geo_tools_table.selectionMode() - # self.target_obj.ui.geo_tools_table.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection) - # for row in range(self.target_obj.ui.geo_tools_table.rowCount()): - # if row in sel_rows: - # self.target_obj.ui.geo_tools_table.selectRow(row) - # self.target_obj.ui.geo_tools_table.setSelectionMode(current_selection_mode) - - # mode = QtCore.QItemSelectionModel.Select | QtCore.QItemSelectionModel.Rows - # for index in sel_indexes: - # sel_model.select(index, mode) - - def update_ui(self): - self.ui_disconnect() - - sel_rows = set() if self.ui.target_radio.get_value() == 'exc': plugin_table = self.ui.tools_table else: plugin_table = self.ui.geo_tools_table - table_items = plugin_table.selectedItems() - if table_items: - for it in table_items: - sel_rows.add(it.row()) - # sel_rows = sorted(set(index.row() for index in self.ui.tools_table.selectedIndexes())) + self.update_ui() + + sel_model = plugin_table.selectionModel() + sel_rows_index_list = sel_model.selectedRows() + sel_rows = [r.row() for r in sel_rows_index_list] + + if sel_rows and len(sel_rows) > 0: + self.ui.param_frame.setDisabled(False) + self.ui.generate_cnc_button.setDisabled(False) + else: + self.ui.param_frame.setDisabled(True) + self.ui.generate_cnc_button.setDisabled(True) + + def update_ui(self): + self.ui_disconnect() + + if self.ui.target_radio.get_value() == 'exc': + plugin_table = self.ui.tools_table + else: + plugin_table = self.ui.geo_tools_table + + sel_model = plugin_table.selectionModel() + sel_rows_index_list = sel_model.selectedRows() + sel_rows = [r.row() for r in sel_rows_index_list] if not sel_rows or len(sel_rows) == 0: self.ui.generate_cnc_button.setDisabled(True) @@ -1728,19 +1688,13 @@ class ToolMilling(AppTool, Excellon): self.ui.tool_data_label.setText( "%s: %s" % (_('Parameters for'), _("Multiple Tools")) ) + # update UI only if only one row is selected otherwise having multiple rows selected will deform information + # for the rows other that the current one (first selected) + self.ui_connect() + return if self.ui.target_radio.get_value() == 'geo': - # sel_model = self.ui.geo_tools_table.selectionModel() - # sel_indexes = sel_model.selectedIndexes() - # - # it will iterate over all indexes which means all items in all columns too but I'm interested only on rows - # sel_rows = set() - # for idx in sel_indexes: - # sel_rows.add(idx.row()) - # sel_rows = list(sel_rows) - # the last selected row is the current row - sel_rows = list(sel_rows) current_row = sel_rows[-1] # ######################################################################################################### @@ -1748,7 +1702,7 @@ class ToolMilling(AppTool, Excellon): # also modify the Cut Z form entry to reflect the calculated Cut Z from values got from V-Shape Fields # ######################################################################################################### try: - item = self.ui.geo_tools_table.cellWidget(current_row, 2) + item = self.ui.tool_shape_combo if item is not None: tool_type_txt = item.currentText() self.ui_update_v_shape(tool_type_txt=tool_type_txt) @@ -1776,6 +1730,7 @@ class ToolMilling(AppTool, Excellon): self.app.log.error("Tool missing. Add a tool in the Tool Table. %s" % str(e)) self.ui_connect() return + self.ui_connect() def to_form(self, storage=None): @@ -1834,20 +1789,14 @@ class ToolMilling(AppTool, Excellon): ["tools_mill_toolchange", "tools_mill_toolchangez", "tools_mill_endxy", "tools_mill_endz", "tools_mill_ppname_g", "tools_mill_area_exclusion", "tools_mill_area_shape", "tools_mill_area_strategy", "tools_mill_area_overz"]: + try: - # widgets in the tools table - if storage_key == 'tools_mill_tool_type': - # print(dict_storage['tools_mill_tool_type']) - form_val = self.ui.geo_tools_table.cellWidget(self.current_row, 2) - form_val.set_value(dict_storage['tools_mill_tool_type']) - else: - self.form_fields[storage_key].set_value(dict_storage[storage_key]) + self.form_fields[storage_key].set_value(dict_storage[storage_key]) except Exception as e: self.app.log.error( - "ToolDrilling.storage_to_form() for key: %s with value: %s--> %s" % + "ToolMilling.storage_to_form() for key: %s with value: %s--> %s" % (str(storage_key), str(dict_storage[storage_key]), str(e)) ) - pass def form_to_storage(self): """ @@ -1937,6 +1886,7 @@ class ToolMilling(AppTool, Excellon): "- Tool Dia -> 'Dia' column found in the Tool Table\n" "NB: a value of zero means that Tool Dia = 'V-tip Dia'") ) + self.ui.job_type_combo.set_value(2) # 'Isolation' self.on_update_cutz() else: self.ui.tipdialabel.hide() @@ -1948,6 +1898,7 @@ class ToolMilling(AppTool, Excellon): "below the copper surface.") ) self.ui.cutz_entry.setToolTip('') + self.ui.job_type_combo.set_value(0) # 'Roughing' def on_update_cutz(self): vdia = float(self.ui.tipdia_entry.get_value()) @@ -1976,7 +1927,7 @@ class ToolMilling(AppTool, Excellon): # store the new CutZ value into storage (self.tools) for tooluid_key, tooluid_value in self.target_obj.tools.items(): if int(tooluid_key) == tool_uid: - tooluid_value['data']['cutz'] = new_cutz + tooluid_value['data']['tools_mill_cutz'] = new_cutz def get_selected_tools_list(self): """ @@ -2316,7 +2267,7 @@ class ToolMilling(AppTool, Excellon): self.target_obj.tools[tooluid]['data']['tools_mill_tooldia'] = deepcopy(tool_dia) # update Cut Z if the tool has a V shape tool - if self.ui.geo_tools_table.cellWidget(current_row, 2).get_value() == 'V': + if self.ui.tool_shape_combo.get_value() == 5: # 'V' self.on_update_cutz() try: @@ -3957,11 +3908,11 @@ class MillingUI: "V = v-shape milling tool") ) - self.tool_shape_combo = FCComboBox(policy=False) - self.tool_shape_combo.setObjectName('mill_tool_type') + self.tool_shape_combo = FCComboBox2(policy=False) + self.tool_shape_combo.setObjectName('mill_tool_shape') self.tool_shape_combo.addItems(["C1", "C2", "C3", "C4", "B", "V"]) - idx = int(self.app.defaults['tools_mill_shape']) + idx = int(self.app.defaults['tools_mill_tool_shape']) # protection against having this translated or loading a project with translated values if idx == -1: self.tool_shape_combo.setCurrentIndex(0) diff --git a/appPlugins/ToolNCC.py b/appPlugins/ToolNCC.py index 1fa1d611..4c26e793 100644 --- a/appPlugins/ToolNCC.py +++ b/appPlugins/ToolNCC.py @@ -851,7 +851,7 @@ class NonCopperClear(AppTool, Gerber): # ------------------------ Tool Shape ------------------------------------------------------------- tool_type_item = FCComboBox() tool_type_item.addItems(self.tool_type_item_options) - idx = int(tooluid_value['data']['tools_mill_shape']) + idx = int(tooluid_value['data']['tools_mill_tool_shape']) tool_type_item.setCurrentIndex(idx) self.ui.tools_table.setCellWidget(row_no, 2, tool_type_item) diff --git a/appPlugins/ToolPaint.py b/appPlugins/ToolPaint.py index 4d1de43c..5dd0a30a 100644 --- a/appPlugins/ToolPaint.py +++ b/appPlugins/ToolPaint.py @@ -776,7 +776,7 @@ class ToolPaint(AppTool, Gerber): for item in self.tool_type_item_options: tool_type_item.addItem(item) # tool_type_item.setStyleSheet('background-color: rgb(255,255,255)') - idx = int(tooluid_value['data']['tools_mill_shape']) + idx = int(tooluid_value['data']['tools_mill_tool_shape']) tool_type_item.setCurrentIndex(idx) tool_uid_item = QtWidgets.QTableWidgetItem(str(int(tooluid_key))) diff --git a/appPlugins/ToolSolderPaste.py b/appPlugins/ToolSolderPaste.py index 3574a19c..b72cd1e9 100644 --- a/appPlugins/ToolSolderPaste.py +++ b/appPlugins/ToolSolderPaste.py @@ -800,7 +800,7 @@ class SolderPaste(AppTool): geo_obj.tools[tooluid]['data']['tools_mill_offset_type']= 0 # 'Path' geo_obj.tools[tooluid]['data']['tools_mill_offset_value'] = 0.0 geo_obj.tools[tooluid]['data']['tools_mill_job_type'] = 'SP' #' - geo_obj.tools[tooluid]['data']['tools_mill_shape'] = 'DN' # 'DN' + geo_obj.tools[tooluid]['data']['tools_mill_tool_shape'] = 'DN' # 'DN' # self.flat_geometry is a list of LinearRings produced by flatten() from the exteriors of the Polygons # We get possible issues if we try to directly use the Polygons, due of possible the interiors, diff --git a/defaults.py b/defaults.py index d23c6184..21968208 100644 --- a/defaults.py +++ b/defaults.py @@ -416,7 +416,7 @@ class FlatCAMDefaults: "tools_mill_offset_type": 0, # _('Path') "tools_mill_offset_value": 0.0, "tools_mill_job_type": 0, # 'Roughing' - "tools_mill_shape": 0, # 'C1' + "tools_mill_tool_shape": 0, # 'C1' "tools_mill_cutz": -2.4, "tools_mill_vtipdia": 0.1, diff --git a/setup_ubuntu.sh b/setup_ubuntu.sh index 1ca8905c..3d446989 100644 --- a/setup_ubuntu.sh +++ b/setup_ubuntu.sh @@ -46,7 +46,6 @@ sudo -H python3 -m pip install --upgrade \ reportlab \ svglib \ pyserial \ - testresources \ pikepdf \ foronoi \ networkx