diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d936789..74d89148 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ CHANGELOG for FlatCAM beta - added a new color in the Object Colors ("indigo") - now the object color transparency is preserved if a new color is chosen - the Proprties tab UI is now populated with the object UI only when the Properties tab is selected and not on object selection like it was done previously +- make sure that if the Properties Tab is selected then the Object UI is updated (built) on object selection on canvas +- code cleanup 5.10.2021 diff --git a/appObjects/ObjectCollection.py b/appObjects/ObjectCollection.py index 76c67419..2abcd5c5 100644 --- a/appObjects/ObjectCollection.py +++ b/appObjects/ObjectCollection.py @@ -995,11 +995,8 @@ class ObjectCollection(QtCore.QAbstractItemModel): self.app.setup_default_properties_tab() return - # if obj: - # try: - # obj.build_ui() - # except RuntimeError: - # pass + # make sure that if the Properties Tab is selected then the Object UI is updated (built) + self.app.on_notebook_tab_changed() # don't emit the signal if there more than one objects selected # this signal is intended to be emitted for a single selection in the collection view diff --git a/appPlugins/ToolIsolation.py b/appPlugins/ToolIsolation.py index 26ffc2ba..b667fc82 100644 --- a/appPlugins/ToolIsolation.py +++ b/appPlugins/ToolIsolation.py @@ -338,11 +338,11 @@ class ToolIsolation(AppTool, Gerber): self.ui.new_tooldia_entry.set_value(self.app.defaults["tools_iso_newdia"]) - loaded_obj = self.app.collection.get_by_name(self.ui.object_combo.get_value()) - if loaded_obj: - outname = loaded_obj.options['name'] - else: - outname = '' + # loaded_obj = self.app.collection.get_by_name(self.ui.object_combo.get_value()) + # if loaded_obj: + # outname = loaded_obj.options['name'] + # else: + # outname = '' # init the working variables self.default_data.clear() @@ -604,7 +604,9 @@ class ToolIsolation(AppTool, Gerber): # make the diameter column editable for row in range(tool_id): self.ui.tools_table.item(row, 1).setFlags( - QtCore.Qt.ItemFlag.ItemIsEditable | QtCore.Qt.ItemFlag.ItemIsSelectable | QtCore.Qt.ItemFlag.ItemIsEnabled) + QtCore.Qt.ItemFlag.ItemIsEditable | + QtCore.Qt.ItemFlag.ItemIsSelectable | + QtCore.Qt.ItemFlag.ItemIsEnabled) # all the tools are selected by default self.ui.tools_table.selectColumn(0) @@ -986,7 +988,7 @@ class ToolIsolation(AppTool, Gerber): # disable rest-machining for area painting self.ui.rest_cb.setDisabled(False) - def on_order_changed(self, order): + def on_order_changed(self): self.build_ui() def on_rest_machining_check(self, state): @@ -1958,8 +1960,8 @@ class ToolIsolation(AppTool, Gerber): if len(tools_storage) > 1: geo_obj.multigeo = True else: - for ky in tools_storage.keys(): - passes_no = float(tools_storage[ky]['data']['tools_iso_passes']) + for __ in tools_storage.keys(): + # passes_no = float(tools_storage[ky]['data']['tools_iso_passes']) geo_obj.multigeo = True break @@ -2141,9 +2143,9 @@ class ToolIsolation(AppTool, Gerber): if len(tools_storage) > 1: geo_obj.multigeo = True else: - passes_no = 1 - for ky in tools_storage.keys(): - passes_no = float(tools_storage[ky]['data']['tools_iso_passes']) + # passes_no = 1 + for __ in tools_storage.keys(): + # passes_no = float(tools_storage[ky]['data']['tools_iso_passes']) geo_obj.multigeo = True break geo_obj.multigeo = True @@ -2649,7 +2651,7 @@ class ToolIsolation(AppTool, Gerber): # "%.4f    " % (self.app.dx, self.app.dy)) self.app.ui.update_location_labels(self.app.dx, self.app.dy, curr_pos[0], curr_pos[1]) - units = self.app.app_units.lower() + # units = self.app.app_units.lower() # self.app.plotcanvas.text_hud.text = \ # 'Dx:\t{:<.4f} [{:s}]\nDy:\t{:<.4f} [{:s}]\n\nX: \t{:<.4f} [{:s}]\nY: \t{:<.4f} [{:s}]'.format( # self.app.dx, units, self.app.dy, units, curr_pos[0], units, curr_pos[1], units) @@ -2829,6 +2831,7 @@ class ToolIsolation(AppTool, Gerber): self.ui.tools_table.selectRow(row) break + return True # if self.ui.tools_table.rowCount() != 0: # self.param_frame.setDisabled(False) diff --git a/defaults.py b/defaults.py index a45888c7..9b52a1f8 100644 --- a/defaults.py +++ b/defaults.py @@ -3,7 +3,7 @@ import stat import sys from copy import deepcopy from appCommon.Common import LoudDict -from camlib import to_dict, CNCjob, Geometry +from camlib import to_dict, Geometry import simplejson import logging import gettext diff --git a/requirements.txt b/requirements.txt index 2d5e24b8..9785ecca 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # This file contains python only requirements to be installed with pip -# Python packages that cannot be installed with pip (e.g. PyQt5, GDAL) are not included. +# Python packages that cannot be installed with pip (e.g. GDAL, Rasterio) are not included. # For Windows GDAL wheel can be found here: https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal # Usage: pip3 install -r requirements.txt