- fixed unreliable work of Gerber Editor and optimized the App.editor2object() method
This commit is contained in:
parent
8165c797a4
commit
a6bdf04937
|
@ -3342,9 +3342,11 @@ class FlatCAMExcEditor(QtCore.QObject):
|
|||
filename=None,
|
||||
use_thread=False)
|
||||
except Exception as e:
|
||||
self.deactivate()
|
||||
log.error("Error on Edited object creation: %s" % str(e))
|
||||
return
|
||||
|
||||
self.deactivate()
|
||||
self.app.inform.emit('[success] %s' % _("Excellon editing finished."))
|
||||
|
||||
def on_tool_select(self, tool):
|
||||
|
|
|
@ -4770,6 +4770,8 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
|||
new_geo = linemerge(new_geo)
|
||||
fcgeometry.solid_geometry.append(new_geo)
|
||||
|
||||
self.deactivate()
|
||||
|
||||
def update_options(self, obj):
|
||||
if self.paint_tooldia:
|
||||
obj.options['cnctooldia'] = deepcopy(str(self.paint_tooldia))
|
||||
|
|
|
@ -1198,7 +1198,6 @@ class FCTrack(FCRegion):
|
|||
self.complete = True
|
||||
|
||||
self.draw_app.app.jump_signal.disconnect()
|
||||
|
||||
self.draw_app.app.inform.emit('[success] %s' % _("Done."))
|
||||
|
||||
def clean_up(self):
|
||||
|
@ -1221,12 +1220,10 @@ class FCTrack(FCRegion):
|
|||
new_geo_el = {}
|
||||
|
||||
if len(self.temp_points) == 1:
|
||||
new_geo_el['solid'] = Point(self.temp_points).buffer(self.buf_val,
|
||||
resolution=int(self.steps_per_circle / 4))
|
||||
new_geo_el['solid'] = Point(self.temp_points).buffer(self.buf_val, int(self.steps_per_circle / 4))
|
||||
new_geo_el['follow'] = Point(self.temp_points)
|
||||
else:
|
||||
new_geo_el['solid'] = LineString(self.temp_points).buffer(self.buf_val,
|
||||
resolution=int(self.steps_per_circle / 4))
|
||||
new_geo_el['solid'] = LineString(self.temp_points).buffer(self.buf_val, int(self.steps_per_circle / 4))
|
||||
new_geo_el['follow'] = LineString(self.temp_points)
|
||||
|
||||
self.draw_app.add_gerber_shape(DrawToolShape(new_geo_el),
|
||||
|
@ -4219,6 +4216,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
|||
new_grb_name = self.edited_obj_name + "_edit"
|
||||
|
||||
self.app.worker_task.emit({'fcn': self.new_edited_gerber, 'params': [new_grb_name, self.storage_dict]})
|
||||
# self.new_edited_gerber(new_grb_name, self.storage_dict)
|
||||
|
||||
@staticmethod
|
||||
def update_options(obj):
|
||||
|
@ -4243,6 +4241,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
|||
:param outname: Name of the resulting object. None causes the name to be that of the file.
|
||||
:type outname: str
|
||||
:param aperture_storage: a dictionary that holds all the objects geometry
|
||||
:type aperture_storage: dict
|
||||
:return: None
|
||||
"""
|
||||
|
||||
|
@ -4334,11 +4333,11 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
|||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("There are no Aperture definitions in the file. Aborting Gerber creation."))
|
||||
except Exception:
|
||||
msg = '[ERROR] %s' % \
|
||||
_("An internal error has occurred. See shell.\n")
|
||||
msg = '[ERROR] %s' % _("An internal error has occurred. See shell.\n")
|
||||
msg += traceback.format_exc()
|
||||
app_obj.inform.emit(msg)
|
||||
raise
|
||||
|
||||
grb_obj.source_file = self.app.export_gerber(obj_name=out_name, filename=None,
|
||||
local_use=grb_obj, use_thread=False)
|
||||
|
||||
|
@ -4351,9 +4350,10 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
|||
self.results = []
|
||||
return
|
||||
|
||||
self.app.inform.emit('[success] %s' % _("Done. Gerber editing finished."))
|
||||
# make sure to clean the previous results
|
||||
self.results = []
|
||||
self.deactivate_grb_editor()
|
||||
self.app.inform.emit('[success] %s' % _("Done. Gerber editing finished."))
|
||||
|
||||
def on_tool_select(self, tool):
|
||||
"""
|
||||
|
|
17
App_Main.py
17
App_Main.py
|
@ -2214,12 +2214,9 @@ class App(QtCore.QObject):
|
|||
|
||||
if isinstance(edited_obj, GeometryObject):
|
||||
obj_type = "Geometry"
|
||||
if cleanup is None:
|
||||
self.geo_editor.update_fcgeometry(edited_obj)
|
||||
# self.geo_editor.update_options(edited_obj)
|
||||
|
||||
self.geo_editor.deactivate()
|
||||
|
||||
# restore GUI to the Selected TAB
|
||||
# Remove anything else in the AppGUI
|
||||
self.ui.tool_scroll_area.takeWidget()
|
||||
|
@ -2240,17 +2237,14 @@ class App(QtCore.QObject):
|
|||
|
||||
elif isinstance(edited_obj, GerberObject):
|
||||
obj_type = "Gerber"
|
||||
if cleanup is None:
|
||||
self.grb_editor.update_fcgerber()
|
||||
self.grb_editor.update_options(edited_obj)
|
||||
self.grb_editor.deactivate_grb_editor()
|
||||
# self.grb_editor.update_options(edited_obj)
|
||||
|
||||
# delete the old object (the source object) if it was an empty one
|
||||
try:
|
||||
if len(edited_obj.solid_geometry) == 0:
|
||||
old_name = edited_obj.options['name']
|
||||
self.collection.set_active(old_name)
|
||||
self.collection.delete_active()
|
||||
self.collection.delete_by_name(old_name)
|
||||
except TypeError:
|
||||
# if the solid_geometry is a single Polygon the len() will not work
|
||||
# in any case, falling here means that we have something in the solid_geometry, even if only
|
||||
|
@ -2265,12 +2259,9 @@ class App(QtCore.QObject):
|
|||
|
||||
elif isinstance(edited_obj, ExcellonObject):
|
||||
obj_type = "Excellon"
|
||||
if cleanup is None:
|
||||
self.exc_editor.update_fcexcellon(edited_obj)
|
||||
# self.exc_editor.update_options(edited_obj)
|
||||
|
||||
self.exc_editor.deactivate()
|
||||
|
||||
# restore GUI to the Selected TAB
|
||||
# Remove anything else in the AppGUI
|
||||
self.ui.tool_scroll_area.takeWidget()
|
||||
|
@ -2314,7 +2305,7 @@ class App(QtCore.QObject):
|
|||
# edited_obj.set_ui(edited_obj.ui_type(decimals=self.decimals))
|
||||
# edited_obj.build_ui()
|
||||
# Switch notebook to Selected page
|
||||
self.ui.notebook.setCurrentWidget(self.ui.selected_tab)
|
||||
# self.ui.notebook.setCurrentWidget(self.ui.selected_tab)
|
||||
else:
|
||||
if isinstance(edited_obj, GeometryObject):
|
||||
self.geo_editor.deactivate()
|
||||
|
@ -2334,7 +2325,7 @@ class App(QtCore.QObject):
|
|||
# restore the call_source to app
|
||||
self.call_source = 'app'
|
||||
|
||||
edited_obj.plot()
|
||||
# edited_obj.plot()
|
||||
self.ui.plot_tab_area.setTabText(0, "Plot Area")
|
||||
self.ui.plot_tab_area.protectTab(0)
|
||||
|
||||
|
|
|
@ -12,6 +12,8 @@ CHANGELOG for FlatCAM beta
|
|||
- changes some icons
|
||||
- added a new GUI element which is a evaluated LineEdit that accepts only float numbers and /,*,+,-,% chars
|
||||
- finished the Etch Compensation Tool
|
||||
- fixed unreliable work of Gerber Editor and optimized the App.editor2object() method
|
||||
|
||||
|
||||
23.05.2020
|
||||
|
||||
|
|
Loading…
Reference in New Issue