- editing a multi geometry will no longer pop-up a Tcl window

- solved issue #292 where a new geometry renamed with many underscores failed to store the name in a saved project
- the name for the saved projects are updated to the current time and not to the time of the app startup
- some PEP8 changes related to comments starting with only one '#' symbol
This commit is contained in:
Marius Stanciu
2019-05-30 21:05:12 +03:00
parent ad7222a768
commit 8ee516ec14
55 changed files with 695 additions and 684 deletions

View File

@@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
############################################################
# ########################################################## ##
import copy
import inspect # TODO: For debugging only.
@@ -35,9 +35,9 @@ class ValidationError(Exception):
self.errors = errors
# #######################################
# # FlatCAMObj ##
# #######################################
# ##################################### ##
# # FlatCAMObj # ##
# ##################################### ##
class FlatCAMObj(QtCore.QObject):
@@ -2342,7 +2342,7 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
"Initializer expected a FlatCAMGeometry, got %s" % type(geo_obj)
app_obj.progress.emit(20)
### Add properties to the object
# ## Add properties to the object
# get the tool_table items in a list of row items
tool_table_items = self.get_selected_tools_table_items()
@@ -2436,7 +2436,7 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
"Initializer expected a FlatCAMGeometry, got %s" % type(geo_obj)
app_obj.progress.emit(20)
### Add properties to the object
# ## Add properties to the object
# get the tool_table items in a list of row items
tool_table_items = self.get_selected_tools_table_items()
@@ -2561,7 +2561,7 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
# insert an information only element in the front
tool_table_items.insert(0, [_("Tool_nr"), _("Diameter"), _("Drills_Nr"), _("Slots_Nr")])
### Add properties to the object
# ## Add properties to the object
job_obj.origin_kind = 'excellon'
@@ -2932,18 +2932,18 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
"""
pts = []
## Iterable: descend into each item.
# Iterable: descend into each item.
try:
for subo in o:
pts += FlatCAMGeometry.get_pts(subo)
## Non-iterable
# Non-iterable
except TypeError:
if o is not None:
if type(o) == MultiPolygon:
for poly in o:
pts += FlatCAMGeometry.get_pts(poly)
## Descend into .exerior and .interiors
# ## Descend into .exerior and .interiors
elif type(o) == Polygon:
pts += FlatCAMGeometry.get_pts(o.exterior)
for i in o.interiors:
@@ -2951,7 +2951,7 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
elif type(o) == MultiLineString:
for line in o:
pts += FlatCAMGeometry.get_pts(line)
## Has .coords: list them.
# ## Has .coords: list them.
else:
pts += list(o.coords)
else:
@@ -3033,6 +3033,9 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
# engine of FlatCAM. Most likely are generated by some of tools and are special cases of geometries.
self. special_group = None
self.old_pp_state = ''
self.old_toolchangeg_state = ''
# Attributes to be included in serialization
# Always append to it because it carries contents
# from predecessors.
@@ -3101,7 +3104,7 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
self.ui.geo_tools_table.setCellWidget(row_no, 3, type_item)
self.ui.geo_tools_table.setCellWidget(row_no, 4, tool_type_item)
### REMEMBER: THIS COLUMN IS HIDDEN IN OBJECTUI.PY ###
# ## REMEMBER: THIS COLUMN IS HIDDEN IN OBJECTUI.PY # ##
self.ui.geo_tools_table.setItem(row_no, 5, tool_uid_item) # Tool unique ID
self.ui.geo_tools_table.setCellWidget(row_no, 6, plot_item)
@@ -5379,7 +5382,7 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
self.ui.cnc_tools_table.setItem(row_no, 3, type_item) # Toolpath Type
self.ui.cnc_tools_table.setItem(row_no, 4, tool_type_item) # Tool Type
### REMEMBER: THIS COLUMN IS HIDDEN IN OBJECTUI.PY ###
# ## REMEMBER: THIS COLUMN IS HIDDEN IN OBJECTUI.PY # ##
self.ui.cnc_tools_table.setItem(row_no, 5, tool_uid_item) # Tool unique ID)
self.ui.cnc_tools_table.setCellWidget(row_no, 6, plot_item)