- PEP8 changes
This commit is contained in:
parent
3d39916b5f
commit
280eb1dc3a
@ -13,6 +13,7 @@ CAD program, and create G-Code for Isolation routing.
|
|||||||
|
|
||||||
- updated the SVG parser to take into consideration the 'Close' svg element and paths that are made from a single line (we may need to switch to svgpathtools module)
|
- updated the SVG parser to take into consideration the 'Close' svg element and paths that are made from a single line (we may need to switch to svgpathtools module)
|
||||||
- minor changes to increase compatibility with Python 3.8
|
- minor changes to increase compatibility with Python 3.8
|
||||||
|
- PEP8 changes
|
||||||
|
|
||||||
30.03.2020
|
30.03.2020
|
||||||
|
|
||||||
|
@ -398,7 +398,7 @@ class FCSlot(FCShapeTool):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
QtGui.QGuiApplication.restoreOverrideCursor()
|
QtGui.QGuiApplication.restoreOverrideCursor()
|
||||||
except Exception as e:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_slot.png'))
|
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_slot.png'))
|
||||||
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
|
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
|
||||||
@ -538,7 +538,7 @@ class FCSlot(FCShapeTool):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
QtGui.QGuiApplication.restoreOverrideCursor()
|
QtGui.QGuiApplication.restoreOverrideCursor()
|
||||||
except Exception as e:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -600,7 +600,7 @@ class FCSlotArray(FCShapeTool):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
QtGui.QGuiApplication.restoreOverrideCursor()
|
QtGui.QGuiApplication.restoreOverrideCursor()
|
||||||
except Exception as e:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_array.png'))
|
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_array.png'))
|
||||||
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
|
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
|
||||||
@ -677,9 +677,8 @@ class FCSlotArray(FCShapeTool):
|
|||||||
self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' %
|
self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
_("The value is not Float. Check for comma instead of dot separator."))
|
_("The value is not Float. Check for comma instead of dot separator."))
|
||||||
return
|
return
|
||||||
except Exception as e:
|
except Exception:
|
||||||
self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' %
|
self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' % _("The value is mistyped. Check the value."))
|
||||||
_("The value is mistyped. Check the value."))
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.slot_array == 'Linear':
|
if self.slot_array == 'Linear':
|
||||||
@ -829,7 +828,7 @@ class FCSlotArray(FCShapeTool):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
QtGui.QGuiApplication.restoreOverrideCursor()
|
QtGui.QGuiApplication.restoreOverrideCursor()
|
||||||
except Exception as e:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# add the point to slots if the diameter is a key in the dict, if not, create it add the drill location
|
# add the point to slots if the diameter is a key in the dict, if not, create it add the drill location
|
||||||
@ -1340,7 +1339,7 @@ class FCDrillSelect(DrawTool):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
QtGui.QGuiApplication.restoreOverrideCursor()
|
QtGui.QGuiApplication.restoreOverrideCursor()
|
||||||
except Exception as e:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
self.exc_editor_app = draw_app
|
self.exc_editor_app = draw_app
|
||||||
@ -1739,7 +1738,7 @@ class FlatCAMExcEditor(QtCore.QObject):
|
|||||||
self.linear_box.addLayout(self.linear_form)
|
self.linear_box.addLayout(self.linear_form)
|
||||||
|
|
||||||
# Linear Drill Array direction
|
# Linear Drill Array direction
|
||||||
self.drill_axis_label = QtWidgets.QLabel('%s:'% _('Direction'))
|
self.drill_axis_label = QtWidgets.QLabel('%s:' % _('Direction'))
|
||||||
self.drill_axis_label.setToolTip(
|
self.drill_axis_label.setToolTip(
|
||||||
_("Direction on which the linear array is oriented:\n"
|
_("Direction on which the linear array is oriented:\n"
|
||||||
"- 'X' - horizontal axis \n"
|
"- 'X' - horizontal axis \n"
|
||||||
@ -2037,22 +2036,14 @@ class FlatCAMExcEditor(QtCore.QObject):
|
|||||||
|
|
||||||
# ## Toolbar events and properties
|
# ## Toolbar events and properties
|
||||||
self.tools_exc = {
|
self.tools_exc = {
|
||||||
"drill_select": {"button": self.app.ui.select_drill_btn,
|
"drill_select": {"button": self.app.ui.select_drill_btn, "constructor": FCDrillSelect},
|
||||||
"constructor": FCDrillSelect},
|
"drill_add": {"button": self.app.ui.add_drill_btn, "constructor": FCDrillAdd},
|
||||||
"drill_add": {"button": self.app.ui.add_drill_btn,
|
"drill_array": {"button": self.app.ui.add_drill_array_btn, "constructor": FCDrillArray},
|
||||||
"constructor": FCDrillAdd},
|
"slot_add": {"button": self.app.ui.add_slot_btn, "constructor": FCSlot},
|
||||||
"drill_array": {"button": self.app.ui.add_drill_array_btn,
|
"slot_array": {"button": self.app.ui.add_slot_array_btn, "constructor": FCSlotArray},
|
||||||
"constructor": FCDrillArray},
|
"drill_resize": {"button": self.app.ui.resize_drill_btn, "constructor": FCDrillResize},
|
||||||
"slot_add": {"button": self.app.ui.add_slot_btn,
|
"drill_copy": {"button": self.app.ui.copy_drill_btn, "constructor": FCDrillCopy},
|
||||||
"constructor": FCSlot},
|
"drill_move": {"button": self.app.ui.move_drill_btn, "constructor": FCDrillMove},
|
||||||
"slot_array": {"button": self.app.ui.add_slot_array_btn,
|
|
||||||
"constructor": FCSlotArray},
|
|
||||||
"drill_resize": {"button": self.app.ui.resize_drill_btn,
|
|
||||||
"constructor": FCDrillResize},
|
|
||||||
"drill_copy": {"button": self.app.ui.copy_drill_btn,
|
|
||||||
"constructor": FCDrillCopy},
|
|
||||||
"drill_move": {"button": self.app.ui.move_drill_btn,
|
|
||||||
"constructor": FCDrillMove},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# ## Data
|
# ## Data
|
||||||
@ -2192,7 +2183,7 @@ class FlatCAMExcEditor(QtCore.QObject):
|
|||||||
"operation": self.app.defaults["excellon_operation"],
|
"operation": self.app.defaults["excellon_operation"],
|
||||||
"milling_type": self.app.defaults["excellon_milling_type"],
|
"milling_type": self.app.defaults["excellon_milling_type"],
|
||||||
|
|
||||||
"milling_dia":self.app.defaults["excellon_milling_dia"],
|
"milling_dia": self.app.defaults["excellon_milling_dia"],
|
||||||
|
|
||||||
"cutz": self.app.defaults["excellon_cutz"],
|
"cutz": self.app.defaults["excellon_cutz"],
|
||||||
"multidepth": self.app.defaults["excellon_multidepth"],
|
"multidepth": self.app.defaults["excellon_multidepth"],
|
||||||
@ -2579,8 +2570,7 @@ class FlatCAMExcEditor(QtCore.QObject):
|
|||||||
# each time a tool diameter is edited or added
|
# each time a tool diameter is edited or added
|
||||||
self.olddia_newdia[tool_dia] = tool_dia
|
self.olddia_newdia[tool_dia] = tool_dia
|
||||||
else:
|
else:
|
||||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Tool already in the original or actual tool list.\n"
|
||||||
_("Tool already in the original or actual tool list.\n"
|
|
||||||
"Save and reedit Excellon if you need to add this tool. "))
|
"Save and reedit Excellon if you need to add this tool. "))
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -2621,9 +2611,8 @@ class FlatCAMExcEditor(QtCore.QObject):
|
|||||||
deleted_tool_dia_list.append(float('%.*f' % (self.decimals, dd)))
|
deleted_tool_dia_list.append(float('%.*f' % (self.decimals, dd)))
|
||||||
else:
|
else:
|
||||||
deleted_tool_dia_list.append(float('%.*f' % (self.decimals, dia)))
|
deleted_tool_dia_list.append(float('%.*f' % (self.decimals, dia)))
|
||||||
except Exception as e:
|
except Exception:
|
||||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Select a tool in Tool Table"))
|
||||||
_("Select a tool in Tool Table"))
|
|
||||||
return
|
return
|
||||||
|
|
||||||
for deleted_tool_dia in deleted_tool_dia_list:
|
for deleted_tool_dia in deleted_tool_dia_list:
|
||||||
@ -2871,7 +2860,7 @@ class FlatCAMExcEditor(QtCore.QObject):
|
|||||||
def deactivate(self):
|
def deactivate(self):
|
||||||
try:
|
try:
|
||||||
QtGui.QGuiApplication.restoreOverrideCursor()
|
QtGui.QGuiApplication.restoreOverrideCursor()
|
||||||
except Exception as e:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# adjust the status of the menu entries related to the editor
|
# adjust the status of the menu entries related to the editor
|
||||||
@ -3468,7 +3457,7 @@ class FlatCAMExcEditor(QtCore.QObject):
|
|||||||
|
|
||||||
self.pos = self.canvas.translate_coords(event_pos)
|
self.pos = self.canvas.translate_coords(event_pos)
|
||||||
|
|
||||||
if self.app.grid_status() == True:
|
if self.app.grid_status():
|
||||||
self.pos = self.app.geo_editor.snap(self.pos[0], self.pos[1])
|
self.pos = self.app.geo_editor.snap(self.pos[0], self.pos[1])
|
||||||
else:
|
else:
|
||||||
self.pos = (self.pos[0], self.pos[1])
|
self.pos = (self.pos[0], self.pos[1])
|
||||||
@ -3613,7 +3602,7 @@ class FlatCAMExcEditor(QtCore.QObject):
|
|||||||
|
|
||||||
pos_canvas = self.canvas.translate_coords(event_pos)
|
pos_canvas = self.canvas.translate_coords(event_pos)
|
||||||
|
|
||||||
if self.app.grid_status() == True:
|
if self.app.grid_status():
|
||||||
pos = self.app.geo_editor.snap(pos_canvas[0], pos_canvas[1])
|
pos = self.app.geo_editor.snap(pos_canvas[0], pos_canvas[1])
|
||||||
else:
|
else:
|
||||||
pos = (pos_canvas[0], pos_canvas[1])
|
pos = (pos_canvas[0], pos_canvas[1])
|
||||||
@ -3625,7 +3614,7 @@ class FlatCAMExcEditor(QtCore.QObject):
|
|||||||
if self.app.ui.popMenu.mouse_is_panning is False:
|
if self.app.ui.popMenu.mouse_is_panning is False:
|
||||||
try:
|
try:
|
||||||
QtGui.QGuiApplication.restoreOverrideCursor()
|
QtGui.QGuiApplication.restoreOverrideCursor()
|
||||||
except Exception as e:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
if self.active_tool.complete is False and not isinstance(self.active_tool, FCDrillSelect):
|
if self.active_tool.complete is False and not isinstance(self.active_tool, FCDrillSelect):
|
||||||
self.active_tool.complete = True
|
self.active_tool.complete = True
|
||||||
@ -3724,7 +3713,7 @@ class FlatCAMExcEditor(QtCore.QObject):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
self.tools_table_exc.cellPressed.disconnect()
|
self.tools_table_exc.cellPressed.disconnect()
|
||||||
except Exception as e:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# first deselect all rows (tools) in the Tools Table
|
# first deselect all rows (tools) in the Tools Table
|
||||||
@ -3801,7 +3790,7 @@ class FlatCAMExcEditor(QtCore.QObject):
|
|||||||
return
|
return
|
||||||
|
|
||||||
# ## Snap coordinates
|
# ## Snap coordinates
|
||||||
if self.app.grid_status() == True:
|
if self.app.grid_status():
|
||||||
x, y = self.app.geo_editor.snap(x, y)
|
x, y = self.app.geo_editor.snap(x, y)
|
||||||
|
|
||||||
# Update cursor
|
# Update cursor
|
||||||
|
@ -3264,34 +3264,20 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
|||||||
|
|
||||||
# ## Toolbar events and properties
|
# ## Toolbar events and properties
|
||||||
self.tools = {
|
self.tools = {
|
||||||
"select": {"button": self.app.ui.geo_select_btn,
|
"select": {"button": self.app.ui.geo_select_btn, "constructor": FCSelect},
|
||||||
"constructor": FCSelect},
|
"arc": {"button": self.app.ui.geo_add_arc_btn, "constructor": FCArc},
|
||||||
"arc": {"button": self.app.ui.geo_add_arc_btn,
|
"circle": {"button": self.app.ui.geo_add_circle_btn, "constructor": FCCircle},
|
||||||
"constructor": FCArc},
|
"path": {"button": self.app.ui.geo_add_path_btn, "constructor": FCPath},
|
||||||
"circle": {"button": self.app.ui.geo_add_circle_btn,
|
"rectangle": {"button": self.app.ui.geo_add_rectangle_btn, "constructor": FCRectangle},
|
||||||
"constructor": FCCircle},
|
"polygon": {"button": self.app.ui.geo_add_polygon_btn, "constructor": FCPolygon},
|
||||||
"path": {"button": self.app.ui.geo_add_path_btn,
|
"text": {"button": self.app.ui.geo_add_text_btn, "constructor": FCText},
|
||||||
"constructor": FCPath},
|
"buffer": {"button": self.app.ui.geo_add_buffer_btn, "constructor": FCBuffer},
|
||||||
"rectangle": {"button": self.app.ui.geo_add_rectangle_btn,
|
"paint": {"button": self.app.ui.geo_add_paint_btn, "constructor": FCPaint},
|
||||||
"constructor": FCRectangle},
|
"eraser": {"button": self.app.ui.geo_eraser_btn, "constructor": FCEraser},
|
||||||
"polygon": {"button": self.app.ui.geo_add_polygon_btn,
|
"move": {"button": self.app.ui.geo_move_btn, "constructor": FCMove},
|
||||||
"constructor": FCPolygon},
|
"transform": {"button": self.app.ui.geo_transform_btn, "constructor": FCTransform},
|
||||||
"text": {"button": self.app.ui.geo_add_text_btn,
|
"copy": {"button": self.app.ui.geo_copy_btn, "constructor": FCCopy},
|
||||||
"constructor": FCText},
|
"explode": {"button": self.app.ui.geo_explode_btn, "constructor": FCExplode}
|
||||||
"buffer": {"button": self.app.ui.geo_add_buffer_btn,
|
|
||||||
"constructor": FCBuffer},
|
|
||||||
"paint": {"button": self.app.ui.geo_add_paint_btn,
|
|
||||||
"constructor": FCPaint},
|
|
||||||
"eraser": {"button": self.app.ui.geo_eraser_btn,
|
|
||||||
"constructor": FCEraser},
|
|
||||||
"move": {"button": self.app.ui.geo_move_btn,
|
|
||||||
"constructor": FCMove},
|
|
||||||
"transform": {"button": self.app.ui.geo_transform_btn,
|
|
||||||
"constructor": FCTransform},
|
|
||||||
"copy": {"button": self.app.ui.geo_copy_btn,
|
|
||||||
"constructor": FCCopy},
|
|
||||||
"explode": {"button": self.app.ui.geo_explode_btn,
|
|
||||||
"constructor": FCExplode}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# # ## Data
|
# # ## Data
|
||||||
@ -3343,6 +3329,8 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
|||||||
# signal that there is an action active like polygon or path
|
# signal that there is an action active like polygon or path
|
||||||
self.in_action = False
|
self.in_action = False
|
||||||
|
|
||||||
|
self.units = None
|
||||||
|
|
||||||
# this will flag if the Editor "tools" are launched from key shortcuts (True) or from menu toolbar (False)
|
# this will flag if the Editor "tools" are launched from key shortcuts (True) or from menu toolbar (False)
|
||||||
self.launched_from_shortcuts = False
|
self.launched_from_shortcuts = False
|
||||||
|
|
||||||
|
@ -423,7 +423,7 @@ class FCPadArray(FCShapeTool):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
QtGui.QGuiApplication.restoreOverrideCursor()
|
QtGui.QGuiApplication.restoreOverrideCursor()
|
||||||
except Exception as e:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_array.png'))
|
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_array.png'))
|
||||||
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
|
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
|
||||||
@ -515,9 +515,8 @@ class FCPadArray(FCShapeTool):
|
|||||||
self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' %
|
self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
_("The value is not Float. Check for comma instead of dot separator."))
|
_("The value is not Float. Check for comma instead of dot separator."))
|
||||||
return
|
return
|
||||||
except Exception as e:
|
except Exception:
|
||||||
self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' %
|
self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' % _("The value is mistyped. Check the value."))
|
||||||
_("The value is mistyped. Check the value."))
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.pad_array == 'Linear':
|
if self.pad_array == 'Linear':
|
||||||
@ -3103,6 +3102,10 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
|||||||
|
|
||||||
self.conversion_factor = 1
|
self.conversion_factor = 1
|
||||||
|
|
||||||
|
self.apertures_row = 0
|
||||||
|
|
||||||
|
self.complete = True
|
||||||
|
|
||||||
self.set_ui()
|
self.set_ui()
|
||||||
log.debug("Initialization of the FlatCAM Gerber Editor is finished ...")
|
log.debug("Initialization of the FlatCAM Gerber Editor is finished ...")
|
||||||
|
|
||||||
@ -3332,8 +3335,8 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
|||||||
|
|
||||||
self.storage_dict[ap_id]['geometry'] = []
|
self.storage_dict[ap_id]['geometry'] = []
|
||||||
|
|
||||||
# self.olddia_newdia dict keeps the evidence on current aperture codes as keys and gets updated on values
|
# self.olddia_newdia dict keeps the evidence on current aperture codes as keys and
|
||||||
# each time a aperture code is edited or added
|
# gets updated on values each time a aperture code is edited or added
|
||||||
self.olddia_newdia[ap_id] = ap_id
|
self.olddia_newdia[ap_id] = ap_id
|
||||||
else:
|
else:
|
||||||
if ap_id not in self.olddia_newdia:
|
if ap_id not in self.olddia_newdia:
|
||||||
@ -3945,9 +3948,9 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def worker_job(app_obj):
|
def worker_job(app_obj):
|
||||||
with app_obj.app.proc_container.new('%s ...' % _("Loading Gerber into Editor")):
|
with app_obj.app.proc_container.new('%s ...' % _("Loading Gerber into Editor")):
|
||||||
# ############################################################# ##
|
# ###############################################################
|
||||||
# APPLY CLEAR_GEOMETRY on the SOLID_GEOMETRY
|
# APPLY CLEAR_GEOMETRY on the SOLID_GEOMETRY
|
||||||
# ############################################################# ##
|
# ###############################################################
|
||||||
|
|
||||||
# list of clear geos that are to be applied to the entire file
|
# list of clear geos that are to be applied to the entire file
|
||||||
global_clear_geo = []
|
global_clear_geo = []
|
||||||
@ -3968,9 +3971,9 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
|||||||
|
|
||||||
# we subtract the big "negative" (clear) geometry from each solid polygon but only the part of
|
# we subtract the big "negative" (clear) geometry from each solid polygon but only the part of
|
||||||
# clear geometry that fits inside the solid. otherwise we may loose the solid
|
# clear geometry that fits inside the solid. otherwise we may loose the solid
|
||||||
for apid in app_obj.gerber_obj.apertures:
|
for ap_id in app_obj.gerber_obj.apertures:
|
||||||
temp_solid_geometry = []
|
temp_solid_geometry = []
|
||||||
if 'geometry' in app_obj.gerber_obj.apertures[apid]:
|
if 'geometry' in app_obj.gerber_obj.apertures[ap_id]:
|
||||||
# for elem in self.gerber_obj.apertures[apid]['geometry']:
|
# for elem in self.gerber_obj.apertures[apid]['geometry']:
|
||||||
# if 'solid' in elem:
|
# if 'solid' in elem:
|
||||||
# solid_geo = elem['solid']
|
# solid_geo = elem['solid']
|
||||||
@ -3998,7 +4001,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
|||||||
# if 'follow' in elem:
|
# if 'follow' in elem:
|
||||||
# new_elem['follow'] = solid_geo
|
# new_elem['follow'] = solid_geo
|
||||||
# temp_elem.append(deepcopy(new_elem))
|
# temp_elem.append(deepcopy(new_elem))
|
||||||
for elem in app_obj.gerber_obj.apertures[apid]['geometry']:
|
for elem in app_obj.gerber_obj.apertures[ap_id]['geometry']:
|
||||||
new_elem = {}
|
new_elem = {}
|
||||||
if 'solid' in elem:
|
if 'solid' in elem:
|
||||||
solid_geo = elem['solid']
|
solid_geo = elem['solid']
|
||||||
@ -4019,7 +4022,8 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
|||||||
new_elem['follow'] = elem['follow']
|
new_elem['follow'] = elem['follow']
|
||||||
temp_solid_geometry.append(deepcopy(new_elem))
|
temp_solid_geometry.append(deepcopy(new_elem))
|
||||||
|
|
||||||
app_obj.gerber_obj.apertures[apid]['geometry'] = deepcopy(temp_solid_geometry)
|
app_obj.gerber_obj.apertures[ap_id]['geometry'] = deepcopy(temp_solid_geometry)
|
||||||
|
|
||||||
log.warning("Polygon difference done for %d apertures." % len(app_obj.gerber_obj.apertures))
|
log.warning("Polygon difference done for %d apertures." % len(app_obj.gerber_obj.apertures))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -4028,9 +4032,9 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
|||||||
app_obj.results.append(
|
app_obj.results.append(
|
||||||
app_obj.pool.apply_async(app_obj.add_apertures, args=(ap_id, ap_dict))
|
app_obj.pool.apply_async(app_obj.add_apertures, args=(ap_id, ap_dict))
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as ee:
|
||||||
log.debug(
|
log.debug(
|
||||||
"FlatCAMGrbEditor.edit_fcgerber.worker_job() Adding processes to pool --> %s" % str(e))
|
"FlatCAMGrbEditor.edit_fcgerber.worker_job() Adding processes to pool --> %s" % str(ee))
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
||||||
output = []
|
output = []
|
||||||
@ -4222,7 +4226,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
_("There are no Aperture definitions in the file. Aborting Gerber creation."))
|
_("There are no Aperture definitions in the file. Aborting Gerber creation."))
|
||||||
except Exception as e:
|
except Exception:
|
||||||
msg = '[ERROR] %s' % \
|
msg = '[ERROR] %s' % \
|
||||||
_("An internal error has occurred. See shell.\n")
|
_("An internal error has occurred. See shell.\n")
|
||||||
msg += traceback.format_exc()
|
msg += traceback.format_exc()
|
||||||
@ -4395,7 +4399,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
|||||||
|
|
||||||
self.pos = self.canvas.translate_coords(event_pos)
|
self.pos = self.canvas.translate_coords(event_pos)
|
||||||
|
|
||||||
if self.app.grid_status() == True:
|
if self.app.grid_status():
|
||||||
self.pos = self.app.geo_editor.snap(self.pos[0], self.pos[1])
|
self.pos = self.app.geo_editor.snap(self.pos[0], self.pos[1])
|
||||||
else:
|
else:
|
||||||
self.pos = (self.pos[0], self.pos[1])
|
self.pos = (self.pos[0], self.pos[1])
|
||||||
@ -4462,7 +4466,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
|||||||
right_button = 3
|
right_button = 3
|
||||||
|
|
||||||
pos_canvas = self.canvas.translate_coords(event_pos)
|
pos_canvas = self.canvas.translate_coords(event_pos)
|
||||||
if self.app.grid_status() == True:
|
if self.app.grid_status():
|
||||||
pos = self.app.geo_editor.snap(pos_canvas[0], pos_canvas[1])
|
pos = self.app.geo_editor.snap(pos_canvas[0], pos_canvas[1])
|
||||||
else:
|
else:
|
||||||
pos = (pos_canvas[0], pos_canvas[1])
|
pos = (pos_canvas[0], pos_canvas[1])
|
||||||
@ -4625,7 +4629,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
|||||||
return
|
return
|
||||||
|
|
||||||
# # ## Snap coordinates
|
# # ## Snap coordinates
|
||||||
if self.app.grid_status() == True:
|
if self.app.grid_status():
|
||||||
x, y = self.app.geo_editor.snap(x, y)
|
x, y = self.app.geo_editor.snap(x, y)
|
||||||
|
|
||||||
# Update cursor
|
# Update cursor
|
||||||
@ -4755,7 +4759,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
self.shapes.add(shape=geometry.geo, color=color, face_color=color, layer=0, tolerance=self.tolerance)
|
self.shapes.add(shape=geometry.geo, color=color, face_color=color, layer=0, tolerance=self.tolerance)
|
||||||
except AttributeError as e:
|
except AttributeError:
|
||||||
if type(geometry) == Point:
|
if type(geometry) == Point:
|
||||||
return
|
return
|
||||||
if len(color) == 9:
|
if len(color) == 9:
|
||||||
@ -5069,12 +5073,12 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
|||||||
area = geo_el.geo['solid'].area
|
area = geo_el.geo['solid'].area
|
||||||
try:
|
try:
|
||||||
upper_threshold_val = self.ma_upper_threshold_entry.get_value()
|
upper_threshold_val = self.ma_upper_threshold_entry.get_value()
|
||||||
except Exception as e:
|
except Exception:
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
lower_threshold_val = self.ma_lower_threshold_entry.get_value()
|
lower_threshold_val = self.ma_lower_threshold_entry.get_value()
|
||||||
except Exception as e:
|
except Exception:
|
||||||
lower_threshold_val = 0.0
|
lower_threshold_val = 0.0
|
||||||
|
|
||||||
if float(upper_threshold_val) > area > float(lower_threshold_val):
|
if float(upper_threshold_val) > area > float(lower_threshold_val):
|
||||||
|
Loading…
Reference in New Issue
Block a user