Merged in marius_stanciu/flatcam_beta/Beta (pull request #293)
Beta - NCC Tool MAY NOT work
This commit is contained in:
commit
5a2ae4877c
|
@ -1631,7 +1631,7 @@ class App(QtCore.QObject):
|
||||||
self.toggle_units_ignore = False
|
self.toggle_units_ignore = False
|
||||||
|
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
# ########################## LOAD POSTPROCESSORS ##############################
|
# ########################## LOAD PREPROCESSORS ###############################
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
|
|
||||||
# a dictionary that have as keys the name of the preprocessor files and the value is the class from
|
# a dictionary that have as keys the name of the preprocessor files and the value is the class from
|
||||||
|
@ -1846,7 +1846,7 @@ class App(QtCore.QObject):
|
||||||
# signal to be called when the app is quiting
|
# signal to be called when the app is quiting
|
||||||
self.app_quit.connect(self.quit_application, type=Qt.QueuedConnection)
|
self.app_quit.connect(self.quit_application, type=Qt.QueuedConnection)
|
||||||
self.message.connect(self.message_dialog)
|
self.message.connect(self.message_dialog)
|
||||||
self.progress.connect(self.set_progress_bar)
|
# self.progress.connect(self.set_progress_bar)
|
||||||
|
|
||||||
# signals that are emitted when object state changes
|
# signals that are emitted when object state changes
|
||||||
self.object_created.connect(self.on_object_created)
|
self.object_created.connect(self.on_object_created)
|
||||||
|
@ -2464,7 +2464,10 @@ class App(QtCore.QObject):
|
||||||
self.fiducial_tool = None
|
self.fiducial_tool = None
|
||||||
|
|
||||||
# always install tools only after the shell is initialized because the self.inform.emit() depends on shell
|
# always install tools only after the shell is initialized because the self.inform.emit() depends on shell
|
||||||
|
try:
|
||||||
self.install_tools()
|
self.install_tools()
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
# ##################################################################################
|
# ##################################################################################
|
||||||
# ########################### SETUP RECENT ITEMS ###################################
|
# ########################### SETUP RECENT ITEMS ###################################
|
||||||
|
@ -2628,7 +2631,10 @@ class App(QtCore.QObject):
|
||||||
# Storage for shapes, storage that can be used by FlatCAm tools for utility geometry
|
# Storage for shapes, storage that can be used by FlatCAm tools for utility geometry
|
||||||
# VisPy visuals
|
# VisPy visuals
|
||||||
if self.is_legacy is False:
|
if self.is_legacy is False:
|
||||||
|
try:
|
||||||
self.tool_shapes = ShapeCollection(parent=self.plotcanvas.view.scene, layers=1)
|
self.tool_shapes = ShapeCollection(parent=self.plotcanvas.view.scene, layers=1)
|
||||||
|
except AttributeError:
|
||||||
|
self.tool_shapes = None
|
||||||
else:
|
else:
|
||||||
from flatcamGUI.PlotCanvasLegacy import ShapeCollectionLegacy
|
from flatcamGUI.PlotCanvasLegacy import ShapeCollectionLegacy
|
||||||
self.tool_shapes = ShapeCollectionLegacy(obj=self, app=self, name="tool")
|
self.tool_shapes = ShapeCollectionLegacy(obj=self, app=self, name="tool")
|
||||||
|
@ -2639,9 +2645,20 @@ class App(QtCore.QObject):
|
||||||
|
|
||||||
# watch out for the position of the editors instantiation ... if it is done before a save of the default values
|
# watch out for the position of the editors instantiation ... if it is done before a save of the default values
|
||||||
# at the first launch of the App , the editors will not be functional.
|
# at the first launch of the App , the editors will not be functional.
|
||||||
|
try:
|
||||||
self.geo_editor = FlatCAMGeoEditor(self, disabled=True)
|
self.geo_editor = FlatCAMGeoEditor(self, disabled=True)
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
self.exc_editor = FlatCAMExcEditor(self)
|
self.exc_editor = FlatCAMExcEditor(self)
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
self.grb_editor = FlatCAMGrbEditor(self)
|
self.grb_editor = FlatCAMGrbEditor(self)
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
self.log.debug("Finished adding FlatCAM Editor's.")
|
self.log.debug("Finished adding FlatCAM Editor's.")
|
||||||
|
|
||||||
self.set_ui_title(name=_("New Project - Not saved"))
|
self.set_ui_title(name=_("New Project - Not saved"))
|
||||||
|
@ -3136,7 +3153,11 @@ class App(QtCore.QObject):
|
||||||
self.ui.menutoolshell.triggered.connect(self.on_toggle_shell)
|
self.ui.menutoolshell.triggered.connect(self.on_toggle_shell)
|
||||||
|
|
||||||
# third install all of them
|
# third install all of them
|
||||||
|
try:
|
||||||
self.install_tools()
|
self.install_tools()
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
self.log.debug("Tools are initialized.")
|
self.log.debug("Tools are initialized.")
|
||||||
|
|
||||||
# def parse_system_fonts(self):
|
# def parse_system_fonts(self):
|
||||||
|
@ -6625,7 +6646,7 @@ class App(QtCore.QObject):
|
||||||
self.plotcanvas.draw_workspace(workspace_size=self.defaults['global_workspaceT'])
|
self.plotcanvas.draw_workspace(workspace_size=self.defaults['global_workspaceT'])
|
||||||
|
|
||||||
def on_workspace(self):
|
def on_workspace(self):
|
||||||
if self.ui.general_defaults_form.general_gui_group.workspace_cb.get_value():
|
if self.ui.general_defaults_form.general_app_set_group.workspace_cb.get_value():
|
||||||
self.plotcanvas.draw_workspace(workspace_size=self.defaults['global_workspaceT'])
|
self.plotcanvas.draw_workspace(workspace_size=self.defaults['global_workspaceT'])
|
||||||
else:
|
else:
|
||||||
self.plotcanvas.delete_workspace()
|
self.plotcanvas.delete_workspace()
|
||||||
|
@ -6633,13 +6654,13 @@ class App(QtCore.QObject):
|
||||||
# self.save_defaults(silent=True)
|
# self.save_defaults(silent=True)
|
||||||
|
|
||||||
def on_workspace_toggle(self):
|
def on_workspace_toggle(self):
|
||||||
state = False if self.ui.general_defaults_form.general_gui_group.workspace_cb.get_value() else True
|
state = False if self.ui.general_defaults_form.general_app_set_group.workspace_cb.get_value() else True
|
||||||
try:
|
try:
|
||||||
self.ui.general_defaults_form.general_gui_group.workspace_cb.stateChanged.disconnect(self.on_workspace)
|
self.ui.general_defaults_form.general_app_set_group.workspace_cb.stateChanged.disconnect(self.on_workspace)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
pass
|
pass
|
||||||
self.ui.general_defaults_form.general_gui_group.workspace_cb.set_value(state)
|
self.ui.general_defaults_form.general_app_set_group.workspace_cb.set_value(state)
|
||||||
self.ui.general_defaults_form.general_gui_group.workspace_cb.stateChanged.connect(self.on_workspace)
|
self.ui.general_defaults_form.general_app_set_group.workspace_cb.stateChanged.connect(self.on_workspace)
|
||||||
self.on_workspace()
|
self.on_workspace()
|
||||||
|
|
||||||
def on_layout(self, index=None, lay=None):
|
def on_layout(self, index=None, lay=None):
|
||||||
|
@ -10874,13 +10895,11 @@ class App(QtCore.QObject):
|
||||||
name = outname or filename.split('/')[-1].split('\\')[-1]
|
name = outname or filename.split('/')[-1].split('\\')[-1]
|
||||||
|
|
||||||
self.new_object(obj_type, name, obj_init, autoselected=False)
|
self.new_object(obj_type, name, obj_init, autoselected=False)
|
||||||
self.progress.emit(20)
|
|
||||||
# Register recent file
|
# Register recent file
|
||||||
self.file_opened.emit("dxf", filename)
|
self.file_opened.emit("dxf", filename)
|
||||||
|
|
||||||
# GUI feedback
|
# GUI feedback
|
||||||
self.inform.emit('[success] %s: %s' % (_("Opened"), filename))
|
self.inform.emit('[success] %s: %s' % (_("Opened"), filename))
|
||||||
self.progress.emit(100)
|
|
||||||
|
|
||||||
def open_gerber(self, filename, outname=None):
|
def open_gerber(self, filename, outname=None):
|
||||||
"""
|
"""
|
||||||
|
@ -10956,7 +10975,6 @@ class App(QtCore.QObject):
|
||||||
|
|
||||||
# How the object should be initialized
|
# How the object should be initialized
|
||||||
def obj_init(excellon_obj, app_obj):
|
def obj_init(excellon_obj, app_obj):
|
||||||
# self.progress.emit(20)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ret = excellon_obj.parse_file(filename=filename)
|
ret = excellon_obj.parse_file(filename=filename)
|
||||||
|
@ -10969,7 +10987,6 @@ class App(QtCore.QObject):
|
||||||
app_obj.inform.emit('[ERROR_NOTCL] %s: %s' %
|
app_obj.inform.emit('[ERROR_NOTCL] %s: %s' %
|
||||||
(_("Cannot open file"), filename))
|
(_("Cannot open file"), filename))
|
||||||
log.debug("Could not open Excellon object.")
|
log.debug("Could not open Excellon object.")
|
||||||
self.progress.emit(0) # TODO: self and app_bjj mixed
|
|
||||||
return "fail"
|
return "fail"
|
||||||
except Exception:
|
except Exception:
|
||||||
msg = '[ERROR_NOTCL] %s' % \
|
msg = '[ERROR_NOTCL] %s' % \
|
||||||
|
@ -11611,6 +11628,11 @@ class App(QtCore.QObject):
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
|
image_opener = self.image_tool.import_image
|
||||||
|
except AttributeError:
|
||||||
|
image_opener = None
|
||||||
|
|
||||||
openers = {
|
openers = {
|
||||||
'gerber': lambda fname: self.worker_task.emit({'fcn': self.open_gerber, 'params': [fname]}),
|
'gerber': lambda fname: self.worker_task.emit({'fcn': self.open_gerber, 'params': [fname]}),
|
||||||
'excellon': lambda fname: self.worker_task.emit({'fcn': self.open_excellon, 'params': [fname]}),
|
'excellon': lambda fname: self.worker_task.emit({'fcn': self.open_excellon, 'params': [fname]}),
|
||||||
|
@ -11621,7 +11643,7 @@ class App(QtCore.QObject):
|
||||||
'project': self.open_project,
|
'project': self.open_project,
|
||||||
'svg': self.import_svg,
|
'svg': self.import_svg,
|
||||||
'dxf': self.import_dxf,
|
'dxf': self.import_dxf,
|
||||||
'image': self.image_tool.import_image,
|
'image': image_opener,
|
||||||
'pdf': lambda fname: self.worker_task.emit({'fcn': self.pdf_tool.open_pdf, 'params': [fname]})
|
'pdf': lambda fname: self.worker_task.emit({'fcn': self.pdf_tool.open_pdf, 'params': [fname]})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11950,7 +11972,7 @@ class App(QtCore.QObject):
|
||||||
|
|
||||||
def on_plotcanvas_setup(self, container=None):
|
def on_plotcanvas_setup(self, container=None):
|
||||||
"""
|
"""
|
||||||
This is doing the setup for the plot area (VisPy canvas)
|
This is doing the setup for the plot area (canvas)
|
||||||
|
|
||||||
:param container: widget where to install the canvas
|
:param container: widget where to install the canvas
|
||||||
:return: None
|
:return: None
|
||||||
|
@ -11961,7 +11983,18 @@ class App(QtCore.QObject):
|
||||||
plot_container = self.ui.right_layout
|
plot_container = self.ui.right_layout
|
||||||
|
|
||||||
if self.is_legacy is False:
|
if self.is_legacy is False:
|
||||||
|
try:
|
||||||
self.plotcanvas = PlotCanvas(plot_container, self)
|
self.plotcanvas = PlotCanvas(plot_container, self)
|
||||||
|
except Exception as er:
|
||||||
|
msg_txt = traceback.format_exc()
|
||||||
|
log.debug("App.on_plotcanvas_setup() failed -> %s" % str(er))
|
||||||
|
log.debug("OpenGL canvas initialization failed with the following error.\n" + msg_txt)
|
||||||
|
msg = '[ERROR_NOTCL] %s' % _("An internal error has occurred. See shell.\n")
|
||||||
|
msg += _("OpenGL canvas initialization failed. HW or HW configuration not supported."
|
||||||
|
"Change the graphic engine to Legacy(2D) in Edit -> Preferences -> General tab.\n\n")
|
||||||
|
msg += msg_txt
|
||||||
|
self.inform.emit(msg)
|
||||||
|
return 'fail'
|
||||||
else:
|
else:
|
||||||
self.plotcanvas = PlotCanvasLegacy(plot_container, self)
|
self.plotcanvas = PlotCanvasLegacy(plot_container, self)
|
||||||
|
|
||||||
|
@ -12044,8 +12077,7 @@ class App(QtCore.QObject):
|
||||||
log.debug("App.on_enable_sel_plot()")
|
log.debug("App.on_enable_sel_plot()")
|
||||||
object_list = self.collection.get_selected()
|
object_list = self.collection.get_selected()
|
||||||
self.enable_plots(objects=object_list)
|
self.enable_plots(objects=object_list)
|
||||||
self.inform.emit('[success] %s' %
|
self.inform.emit('[success] %s' % _("Selected plots enabled..."))
|
||||||
_("Selected plots enabled..."))
|
|
||||||
|
|
||||||
def on_disable_sel_plots(self):
|
def on_disable_sel_plots(self):
|
||||||
log.debug("App.on_disable_sel_plot()")
|
log.debug("App.on_disable_sel_plot()")
|
||||||
|
@ -12053,8 +12085,7 @@ class App(QtCore.QObject):
|
||||||
# self.inform.emit(_("Disabling plots ..."))
|
# self.inform.emit(_("Disabling plots ..."))
|
||||||
object_list = self.collection.get_selected()
|
object_list = self.collection.get_selected()
|
||||||
self.disable_plots(objects=object_list)
|
self.disable_plots(objects=object_list)
|
||||||
self.inform.emit('[success] %s' %
|
self.inform.emit('[success] %s' % _("Selected plots disabled..."))
|
||||||
_("Selected plots disabled..."))
|
|
||||||
|
|
||||||
def enable_plots(self, objects):
|
def enable_plots(self, objects):
|
||||||
"""
|
"""
|
||||||
|
@ -12070,6 +12101,20 @@ class App(QtCore.QObject):
|
||||||
if obj.options['plot'] is False:
|
if obj.options['plot'] is False:
|
||||||
obj.options.set_change_callback(lambda x: None)
|
obj.options.set_change_callback(lambda x: None)
|
||||||
obj.options['plot'] = True
|
obj.options['plot'] = True
|
||||||
|
try:
|
||||||
|
# only the Gerber obj has on_plot_cb_click() method
|
||||||
|
obj.ui.plot_cb.stateChanged.disconnect(obj.on_plot_cb_click)
|
||||||
|
# disable this cb while disconnected,
|
||||||
|
# in case the operation takes time the user is not allowed to change it
|
||||||
|
obj.ui.plot_cb.setDisabled(True)
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
obj.set_form_item("plot")
|
||||||
|
try:
|
||||||
|
obj.ui.plot_cb.stateChanged.connect(obj.on_plot_cb_click)
|
||||||
|
obj.ui.plot_cb.setDisabled(False)
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
obj.options.set_change_callback(obj.on_options_change)
|
obj.options.set_change_callback(obj.on_options_change)
|
||||||
|
|
||||||
def worker_task(objs):
|
def worker_task(objs):
|
||||||
|
@ -12104,6 +12149,18 @@ class App(QtCore.QObject):
|
||||||
if obj.options['plot'] is True:
|
if obj.options['plot'] is True:
|
||||||
obj.options.set_change_callback(lambda x: None)
|
obj.options.set_change_callback(lambda x: None)
|
||||||
obj.options['plot'] = False
|
obj.options['plot'] = False
|
||||||
|
try:
|
||||||
|
# only the Gerber obj has on_plot_cb_click() method
|
||||||
|
obj.ui.plot_cb.stateChanged.disconnect(obj.on_plot_cb_click)
|
||||||
|
obj.ui.plot_cb.setDisabled(True)
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
obj.set_form_item("plot")
|
||||||
|
try:
|
||||||
|
obj.ui.plot_cb.stateChanged.connect(obj.on_plot_cb_click)
|
||||||
|
obj.ui.plot_cb.setDisabled(False)
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
obj.options.set_change_callback(obj.on_options_change)
|
obj.options.set_change_callback(obj.on_options_change)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -12242,7 +12299,7 @@ class App(QtCore.QObject):
|
||||||
try:
|
try:
|
||||||
self.collection.get_active().read_form()
|
self.collection.get_active().read_form()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.log.debug("There was no active object. %s" % str(e))
|
self.log.debug("save_project() --> There was no active object. Skipping read_form. %s" % str(e))
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Serialize the whole project
|
# Serialize the whole project
|
||||||
|
|
|
@ -1811,7 +1811,6 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
|
||||||
visibility = kwargs['visible']
|
visibility = kwargs['visible']
|
||||||
|
|
||||||
with self.app.proc_container.new(_("Plotting Apertures")):
|
with self.app.proc_container.new(_("Plotting Apertures")):
|
||||||
self.app.progress.emit(30)
|
|
||||||
|
|
||||||
def job_thread(app_obj):
|
def job_thread(app_obj):
|
||||||
try:
|
try:
|
||||||
|
@ -3080,7 +3079,6 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
|
||||||
def geo_init(geo_obj, app_obj):
|
def geo_init(geo_obj, app_obj):
|
||||||
assert isinstance(geo_obj, FlatCAMGeometry), \
|
assert isinstance(geo_obj, FlatCAMGeometry), \
|
||||||
"Initializer expected a FlatCAMGeometry, got %s" % type(geo_obj)
|
"Initializer expected a FlatCAMGeometry, got %s" % type(geo_obj)
|
||||||
app_obj.progress.emit(20)
|
|
||||||
|
|
||||||
# ## Add properties to the object
|
# ## Add properties to the object
|
||||||
|
|
||||||
|
@ -3110,7 +3108,6 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
|
||||||
if use_thread:
|
if use_thread:
|
||||||
def geo_thread(app_obj):
|
def geo_thread(app_obj):
|
||||||
app_obj.new_object("geometry", outname, geo_init, plot=plot)
|
app_obj.new_object("geometry", outname, geo_init, plot=plot)
|
||||||
app_obj.progress.emit(100)
|
|
||||||
|
|
||||||
# Create a promise with the new name
|
# Create a promise with the new name
|
||||||
self.app.collection.promise(outname)
|
self.app.collection.promise(outname)
|
||||||
|
@ -3173,7 +3170,6 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
|
||||||
def geo_init(geo_obj, app_obj):
|
def geo_init(geo_obj, app_obj):
|
||||||
assert isinstance(geo_obj, FlatCAMGeometry), \
|
assert isinstance(geo_obj, FlatCAMGeometry), \
|
||||||
"Initializer expected a FlatCAMGeometry, got %s" % type(geo_obj)
|
"Initializer expected a FlatCAMGeometry, got %s" % type(geo_obj)
|
||||||
app_obj.progress.emit(20)
|
|
||||||
|
|
||||||
# ## Add properties to the object
|
# ## Add properties to the object
|
||||||
|
|
||||||
|
@ -3217,7 +3213,6 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
|
||||||
if use_thread:
|
if use_thread:
|
||||||
def geo_thread(app_obj):
|
def geo_thread(app_obj):
|
||||||
app_obj.new_object("geometry", outname + '_slot', geo_init, plot=plot)
|
app_obj.new_object("geometry", outname + '_slot', geo_init, plot=plot)
|
||||||
app_obj.progress.emit(100)
|
|
||||||
|
|
||||||
# Create a promise with the new name
|
# Create a promise with the new name
|
||||||
self.app.collection.promise(outname)
|
self.app.collection.promise(outname)
|
||||||
|
@ -3358,7 +3353,6 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
|
||||||
def job_thread(app_obj):
|
def job_thread(app_obj):
|
||||||
with self.app.proc_container.new(_("Generating CNC Code")):
|
with self.app.proc_container.new(_("Generating CNC Code")):
|
||||||
app_obj.new_object("cncjob", job_name, job_init)
|
app_obj.new_object("cncjob", job_name, job_init)
|
||||||
app_obj.progress.emit(100)
|
|
||||||
|
|
||||||
# Create promise for the new name.
|
# Create promise for the new name.
|
||||||
self.app.collection.promise(job_name)
|
self.app.collection.promise(job_name)
|
||||||
|
@ -5425,11 +5419,8 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
|
||||||
# Propagate options
|
# Propagate options
|
||||||
job_obj.options["tooldia"] = tooldia
|
job_obj.options["tooldia"] = tooldia
|
||||||
|
|
||||||
app_obj.progress.emit(20)
|
|
||||||
|
|
||||||
job_obj.coords_decimals = self.app.defaults["cncjob_coords_decimals"]
|
job_obj.coords_decimals = self.app.defaults["cncjob_coords_decimals"]
|
||||||
job_obj.fr_decimals = self.app.defaults["cncjob_fr_decimals"]
|
job_obj.fr_decimals = self.app.defaults["cncjob_fr_decimals"]
|
||||||
app_obj.progress.emit(40)
|
|
||||||
|
|
||||||
job_obj.options['type'] = 'Geometry'
|
job_obj.options['type'] = 'Geometry'
|
||||||
job_obj.options['tool_dia'] = tooldia
|
job_obj.options['tool_dia'] = tooldia
|
||||||
|
@ -5459,24 +5450,18 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
|
||||||
pp_geometry_name=ppname_g
|
pp_geometry_name=ppname_g
|
||||||
)
|
)
|
||||||
|
|
||||||
app_obj.progress.emit(50)
|
|
||||||
# tell gcode_parse from which point to start drawing the lines depending on what kind of object is the
|
# tell gcode_parse from which point to start drawing the lines depending on what kind of object is the
|
||||||
# source of gcode
|
# source of gcode
|
||||||
job_obj.toolchange_xy_type = "geometry"
|
job_obj.toolchange_xy_type = "geometry"
|
||||||
job_obj.gcode_parse()
|
job_obj.gcode_parse()
|
||||||
self.app.inform.emit('[success] %s' %
|
self.app.inform.emit('[success] %s' % _("Finished G-Code processing..."))
|
||||||
_("Finished G-Code processing..."))
|
|
||||||
|
|
||||||
app_obj.progress.emit(80)
|
|
||||||
|
|
||||||
if use_thread:
|
if use_thread:
|
||||||
# To be run in separate thread
|
# To be run in separate thread
|
||||||
def job_thread(app_obj):
|
def job_thread(app_obj):
|
||||||
with self.app.proc_container.new(_("Generating CNC Code")):
|
with self.app.proc_container.new(_("Generating CNC Code")):
|
||||||
app_obj.new_object("cncjob", outname, job_init, plot=plot)
|
app_obj.new_object("cncjob", outname, job_init, plot=plot)
|
||||||
app_obj.inform.emit('[success] %s: %s' %
|
app_obj.inform.emit('[success] %s: %s' % (_("CNCjob created")), outname)
|
||||||
(_("CNCjob created")), outname)
|
|
||||||
app_obj.progress.emit(100)
|
|
||||||
|
|
||||||
# Create a promise with the name
|
# Create a promise with the name
|
||||||
self.app.collection.promise(outname)
|
self.app.collection.promise(outname)
|
||||||
|
|
18
README.md
18
README.md
|
@ -9,11 +9,29 @@ CAD program, and create G-Code for Isolation routing.
|
||||||
|
|
||||||
=================================================
|
=================================================
|
||||||
|
|
||||||
|
8.01.2019
|
||||||
|
|
||||||
|
- working in NCC Tool
|
||||||
|
- selected rows in the Tools Tables will stay colored in blue after loosing focus instead of the default gray
|
||||||
|
- in NCC Tool the Tool name in the Parameters section will be the Tool ID in the Tool Table
|
||||||
|
- added an exception catch in case the plotcanvas init failed for the OpenGL graphic engine and warn user about what happened
|
||||||
|
|
||||||
|
7.01.2019
|
||||||
|
|
||||||
|
- solved issue #368 - when using the Enable/Disable prj context menu entries the plotted status is not updated in the object properties
|
||||||
|
- updates in NCC Tool
|
||||||
|
|
||||||
|
6.01.2019
|
||||||
|
|
||||||
|
- working on new NCC Tool
|
||||||
|
|
||||||
2.01.2020
|
2.01.2020
|
||||||
|
|
||||||
- started to rework the NCC Tool GUI in preparation for adding a Tool DB feature
|
- started to rework the NCC Tool GUI in preparation for adding a Tool DB feature
|
||||||
- for auto-completer, now clicking an entry in the completer popup will select that entry and insert it
|
- for auto-completer, now clicking an entry in the completer popup will select that entry and insert it
|
||||||
- made available only for Linux and Windows (not OSX) the starting of the thread that checks if another instance of FlatCAM is already running at the launch of FLatCAM
|
- made available only for Linux and Windows (not OSX) the starting of the thread that checks if another instance of FlatCAM is already running at the launch of FLatCAM
|
||||||
|
- modified Toggle Workspace function to work in the new Preferences UI configuration
|
||||||
|
- cleaned the app from progress signal usage since it is not used anymore
|
||||||
|
|
||||||
1.01.2020
|
1.01.2020
|
||||||
|
|
||||||
|
|
|
@ -3305,7 +3305,6 @@ class FlatCAMExcEditor(QtCore.QObject):
|
||||||
# How the object should be initialized
|
# How the object should be initialized
|
||||||
def obj_init(excellon_obj, app_obj):
|
def obj_init(excellon_obj, app_obj):
|
||||||
|
|
||||||
# self.progress.emit(20)
|
|
||||||
excellon_obj.drills = deepcopy(new_drills)
|
excellon_obj.drills = deepcopy(new_drills)
|
||||||
excellon_obj.tools = deepcopy(new_tools)
|
excellon_obj.tools = deepcopy(new_tools)
|
||||||
excellon_obj.slots = deepcopy(new_slots)
|
excellon_obj.slots = deepcopy(new_slots)
|
||||||
|
@ -3335,12 +3334,9 @@ class FlatCAMExcEditor(QtCore.QObject):
|
||||||
use_thread=False)
|
use_thread=False)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error("Error on Edited object creation: %s" % str(e))
|
log.error("Error on Edited object creation: %s" % str(e))
|
||||||
self.app.progress.emit(100)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
self.app.inform.emit('[success] %s' %
|
self.app.inform.emit('[success] %s' % _("Excellon editing finished."))
|
||||||
_("Excellon editing finished."))
|
|
||||||
# self.progress.emit(100)
|
|
||||||
|
|
||||||
def on_tool_select(self, tool):
|
def on_tool_select(self, tool):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1272,8 +1272,6 @@ class TransformEditorTool(FlatCAMTool):
|
||||||
xmaximal = max(xmaxlist)
|
xmaximal = max(xmaxlist)
|
||||||
ymaximal = max(ymaxlist)
|
ymaximal = max(ymaxlist)
|
||||||
|
|
||||||
self.app.progress.emit(20)
|
|
||||||
|
|
||||||
for sel_sha in shape_list:
|
for sel_sha in shape_list:
|
||||||
px = 0.5 * (xminimal + xmaximal)
|
px = 0.5 * (xminimal + xmaximal)
|
||||||
py = 0.5 * (yminimal + ymaximal)
|
py = 0.5 * (yminimal + ymaximal)
|
||||||
|
@ -1284,11 +1282,7 @@ class TransformEditorTool(FlatCAMTool):
|
||||||
|
|
||||||
# self.draw_app.transform_complete.emit()
|
# self.draw_app.transform_complete.emit()
|
||||||
|
|
||||||
self.app.inform.emit('[success] %s' %
|
self.app.inform.emit('[success] %s' % _("Done. Rotate completed."))
|
||||||
_("Done. Rotate completed."))
|
|
||||||
|
|
||||||
self.app.progress.emit(100)
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Rotation action was not executed"), str(e)))
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Rotation action was not executed"), str(e)))
|
||||||
return
|
return
|
||||||
|
@ -1329,8 +1323,6 @@ class TransformEditorTool(FlatCAMTool):
|
||||||
px = 0.5 * (xminimal + xmaximal)
|
px = 0.5 * (xminimal + xmaximal)
|
||||||
py = 0.5 * (yminimal + ymaximal)
|
py = 0.5 * (yminimal + ymaximal)
|
||||||
|
|
||||||
self.app.progress.emit(20)
|
|
||||||
|
|
||||||
# execute mirroring
|
# execute mirroring
|
||||||
for sha in shape_list:
|
for sha in shape_list:
|
||||||
if axis is 'X':
|
if axis is 'X':
|
||||||
|
@ -1347,8 +1339,6 @@ class TransformEditorTool(FlatCAMTool):
|
||||||
#
|
#
|
||||||
# self.draw_app.transform_complete.emit()
|
# self.draw_app.transform_complete.emit()
|
||||||
|
|
||||||
self.app.progress.emit(100)
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Flip action was not executed"), str(e)))
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Flip action was not executed"), str(e)))
|
||||||
return
|
return
|
||||||
|
@ -1375,8 +1365,6 @@ class TransformEditorTool(FlatCAMTool):
|
||||||
xminimal = min(xminlist)
|
xminimal = min(xminlist)
|
||||||
yminimal = min(yminlist)
|
yminimal = min(yminlist)
|
||||||
|
|
||||||
self.app.progress.emit(20)
|
|
||||||
|
|
||||||
for sha in shape_list:
|
for sha in shape_list:
|
||||||
if axis is 'X':
|
if axis is 'X':
|
||||||
sha.skew(num, 0, point=(xminimal, yminimal))
|
sha.skew(num, 0, point=(xminimal, yminimal))
|
||||||
|
@ -1388,12 +1376,9 @@ class TransformEditorTool(FlatCAMTool):
|
||||||
#
|
#
|
||||||
# self.draw_app.transform_complete.emit()
|
# self.draw_app.transform_complete.emit()
|
||||||
if axis == 'X':
|
if axis == 'X':
|
||||||
self.app.inform.emit('[success] %s...' %
|
self.app.inform.emit('[success] %s...' % _('Skew on the X axis done'))
|
||||||
_('Skew on the X axis done'))
|
|
||||||
else:
|
else:
|
||||||
self.app.inform.emit('[success] %s...' %
|
self.app.inform.emit('[success] %s...' % _('Skew on the Y axis done'))
|
||||||
_('Skew on the Y axis done'))
|
|
||||||
self.app.progress.emit(100)
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Skew action was not executed"), str(e)))
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Skew action was not executed"), str(e)))
|
||||||
|
@ -1407,8 +1392,7 @@ class TransformEditorTool(FlatCAMTool):
|
||||||
ymaxlist = []
|
ymaxlist = []
|
||||||
|
|
||||||
if not shape_list:
|
if not shape_list:
|
||||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("No shape selected. Please Select a shape to scale!"))
|
||||||
_("No shape selected. Please Select a shape to scale!"))
|
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
with self.app.proc_container.new(_("Applying Scale")):
|
with self.app.proc_container.new(_("Applying Scale")):
|
||||||
|
@ -1427,8 +1411,6 @@ class TransformEditorTool(FlatCAMTool):
|
||||||
xmaximal = max(xmaxlist)
|
xmaximal = max(xmaxlist)
|
||||||
ymaximal = max(ymaxlist)
|
ymaximal = max(ymaxlist)
|
||||||
|
|
||||||
self.app.progress.emit(20)
|
|
||||||
|
|
||||||
if point is None:
|
if point is None:
|
||||||
px = 0.5 * (xminimal + xmaximal)
|
px = 0.5 * (xminimal + xmaximal)
|
||||||
py = 0.5 * (yminimal + ymaximal)
|
py = 0.5 * (yminimal + ymaximal)
|
||||||
|
@ -1445,12 +1427,9 @@ class TransformEditorTool(FlatCAMTool):
|
||||||
# self.draw_app.transform_complete.emit()
|
# self.draw_app.transform_complete.emit()
|
||||||
|
|
||||||
if str(axis) == 'X':
|
if str(axis) == 'X':
|
||||||
self.app.inform.emit('[success] %s...' %
|
self.app.inform.emit('[success] %s...' % _('Scale on the X axis done'))
|
||||||
_('Scale on the X axis done'))
|
|
||||||
else:
|
else:
|
||||||
self.app.inform.emit('[success] %s...' %
|
self.app.inform.emit('[success] %s...' % _('Scale on the Y axis done'))
|
||||||
_('Scale on the Y axis done'))
|
|
||||||
self.app.progress.emit(100)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Scale action was not executed"), str(e)))
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Scale action was not executed"), str(e)))
|
||||||
return
|
return
|
||||||
|
@ -1467,8 +1446,6 @@ class TransformEditorTool(FlatCAMTool):
|
||||||
else:
|
else:
|
||||||
with self.app.proc_container.new(_("Applying Offset")):
|
with self.app.proc_container.new(_("Applying Offset")):
|
||||||
try:
|
try:
|
||||||
self.app.progress.emit(20)
|
|
||||||
|
|
||||||
for sha in shape_list:
|
for sha in shape_list:
|
||||||
if axis is 'X':
|
if axis is 'X':
|
||||||
sha.offset((num, 0))
|
sha.offset((num, 0))
|
||||||
|
@ -1477,12 +1454,9 @@ class TransformEditorTool(FlatCAMTool):
|
||||||
self.draw_app.replot()
|
self.draw_app.replot()
|
||||||
|
|
||||||
if axis == 'X':
|
if axis == 'X':
|
||||||
self.app.inform.emit('[success] %s...' %
|
self.app.inform.emit('[success] %s...' % _('Offset on the X axis done'))
|
||||||
_('Offset on the X axis done'))
|
|
||||||
else:
|
else:
|
||||||
self.app.inform.emit('[success] %s...' %
|
self.app.inform.emit('[success] %s...' % _('Offset on the Y axis done'))
|
||||||
_('Offset on the Y axis done'))
|
|
||||||
self.app.progress.emit(100)
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Offset action was not executed"), str(e)))
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Offset action was not executed"), str(e)))
|
||||||
|
|
|
@ -5761,7 +5761,6 @@ class TransformEditorTool(FlatCAMTool):
|
||||||
xmaximal = max(xmaxlist)
|
xmaximal = max(xmaxlist)
|
||||||
ymaximal = max(ymaxlist)
|
ymaximal = max(ymaxlist)
|
||||||
|
|
||||||
self.app.progress.emit(20)
|
|
||||||
px = 0.5 * (xminimal + xmaximal)
|
px = 0.5 * (xminimal + xmaximal)
|
||||||
py = 0.5 * (yminimal + ymaximal)
|
py = 0.5 * (yminimal + ymaximal)
|
||||||
|
|
||||||
|
@ -5775,12 +5774,9 @@ class TransformEditorTool(FlatCAMTool):
|
||||||
sel_el['clear'] = affinity.rotate(sel_el['clear'], angle=-num, origin=(px, py))
|
sel_el['clear'] = affinity.rotate(sel_el['clear'], angle=-num, origin=(px, py))
|
||||||
self.draw_app.plot_all()
|
self.draw_app.plot_all()
|
||||||
|
|
||||||
self.app.inform.emit('[success] %s' %
|
self.app.inform.emit('[success] %s' % _("Done. Rotate completed."))
|
||||||
_("Done. Rotate completed."))
|
|
||||||
self.app.progress.emit(100)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Rotation action was not executed."), str(e)))
|
||||||
(_("Rotation action was not executed."), str(e)))
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def on_flip(self, axis):
|
def on_flip(self, axis):
|
||||||
|
@ -5827,8 +5823,6 @@ class TransformEditorTool(FlatCAMTool):
|
||||||
px = 0.5 * (xminimal + xmaximal)
|
px = 0.5 * (xminimal + xmaximal)
|
||||||
py = 0.5 * (yminimal + ymaximal)
|
py = 0.5 * (yminimal + ymaximal)
|
||||||
|
|
||||||
self.app.progress.emit(20)
|
|
||||||
|
|
||||||
# execute mirroring
|
# execute mirroring
|
||||||
for sel_el_shape in elem_list:
|
for sel_el_shape in elem_list:
|
||||||
sel_el = sel_el_shape.geo
|
sel_el = sel_el_shape.geo
|
||||||
|
@ -5851,8 +5845,6 @@ class TransformEditorTool(FlatCAMTool):
|
||||||
self.app.inform.emit('[success] %s...' %
|
self.app.inform.emit('[success] %s...' %
|
||||||
_('Flip on the X axis done'))
|
_('Flip on the X axis done'))
|
||||||
self.draw_app.plot_all()
|
self.draw_app.plot_all()
|
||||||
self.app.progress.emit(100)
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
|
||||||
(_("Flip action was not executed."), str(e)))
|
(_("Flip action was not executed."), str(e)))
|
||||||
|
@ -5889,8 +5881,6 @@ class TransformEditorTool(FlatCAMTool):
|
||||||
xminimal = min(xminlist)
|
xminimal = min(xminlist)
|
||||||
yminimal = min(yminlist)
|
yminimal = min(yminlist)
|
||||||
|
|
||||||
self.app.progress.emit(20)
|
|
||||||
|
|
||||||
for sel_el_shape in elem_list:
|
for sel_el_shape in elem_list:
|
||||||
sel_el = sel_el_shape.geo
|
sel_el = sel_el_shape.geo
|
||||||
if axis is 'X':
|
if axis is 'X':
|
||||||
|
@ -5913,8 +5903,6 @@ class TransformEditorTool(FlatCAMTool):
|
||||||
self.app.inform.emit('[success] %s...' % _('Skew on the X axis done'))
|
self.app.inform.emit('[success] %s...' % _('Skew on the X axis done'))
|
||||||
else:
|
else:
|
||||||
self.app.inform.emit('[success] %s...' % _('Skew on the Y axis done'))
|
self.app.inform.emit('[success] %s...' % _('Skew on the Y axis done'))
|
||||||
self.app.progress.emit(100)
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Skew action was not executed."), str(e)))
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Skew action was not executed."), str(e)))
|
||||||
return
|
return
|
||||||
|
@ -5958,8 +5946,6 @@ class TransformEditorTool(FlatCAMTool):
|
||||||
xmaximal = max(xmaxlist)
|
xmaximal = max(xmaxlist)
|
||||||
ymaximal = max(ymaxlist)
|
ymaximal = max(ymaxlist)
|
||||||
|
|
||||||
self.app.progress.emit(20)
|
|
||||||
|
|
||||||
if point is None:
|
if point is None:
|
||||||
px = 0.5 * (xminimal + xmaximal)
|
px = 0.5 * (xminimal + xmaximal)
|
||||||
py = 0.5 * (yminimal + ymaximal)
|
py = 0.5 * (yminimal + ymaximal)
|
||||||
|
|
|
@ -2221,9 +2221,9 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||||
self.infobar.addWidget(self.units_label)
|
self.infobar.addWidget(self.units_label)
|
||||||
|
|
||||||
# disabled
|
# disabled
|
||||||
self.progress_bar = QtWidgets.QProgressBar()
|
# self.progress_bar = QtWidgets.QProgressBar()
|
||||||
self.progress_bar.setMinimum(0)
|
# self.progress_bar.setMinimum(0)
|
||||||
self.progress_bar.setMaximum(100)
|
# self.progress_bar.setMaximum(100)
|
||||||
# infobar.addWidget(self.progress_bar)
|
# infobar.addWidget(self.progress_bar)
|
||||||
|
|
||||||
# ########################################################################
|
# ########################################################################
|
||||||
|
@ -2262,6 +2262,10 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||||
self.grb_editor_cmenu.menuAction().setVisible(False)
|
self.grb_editor_cmenu.menuAction().setVisible(False)
|
||||||
self.e_editor_cmenu.menuAction().setVisible(False)
|
self.e_editor_cmenu.menuAction().setVisible(False)
|
||||||
|
|
||||||
|
# ########################################################################
|
||||||
|
# ######################## BUILD PREFERENCES #############################
|
||||||
|
# ########################################################################
|
||||||
|
|
||||||
self.general_defaults_form = GeneralPreferencesUI(decimals=self.decimals)
|
self.general_defaults_form = GeneralPreferencesUI(decimals=self.decimals)
|
||||||
self.gerber_defaults_form = GerberPreferencesUI(decimals=self.decimals)
|
self.gerber_defaults_form = GerberPreferencesUI(decimals=self.decimals)
|
||||||
self.excellon_defaults_form = ExcellonPreferencesUI(decimals=self.decimals)
|
self.excellon_defaults_form = ExcellonPreferencesUI(decimals=self.decimals)
|
||||||
|
@ -2358,7 +2362,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||||
:param event: QT event to filter
|
:param event: QT event to filter
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
if self.general_defaults_form.general_app_set_group.toggle_tooltips_cb.get_value() is False:
|
if self.app.defaults["global_toggle_tooltips"] is False:
|
||||||
if event.type() == QtCore.QEvent.ToolTip:
|
if event.type() == QtCore.QEvent.ToolTip:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -2006,6 +2006,11 @@ class FCTable(QtWidgets.QTableWidget):
|
||||||
def __init__(self, drag_drop=False, protected_rows=None, parent=None):
|
def __init__(self, drag_drop=False, protected_rows=None, parent=None):
|
||||||
super(FCTable, self).__init__(parent)
|
super(FCTable, self).__init__(parent)
|
||||||
|
|
||||||
|
palette = QtGui.QPalette()
|
||||||
|
palette.setColor(QtGui.QPalette.Inactive, QtGui.QPalette.Highlight,
|
||||||
|
palette.color(QtGui.QPalette.Active, QtGui.QPalette.Highlight))
|
||||||
|
self.setPalette(palette)
|
||||||
|
|
||||||
if drag_drop:
|
if drag_drop:
|
||||||
self.setDragEnabled(True)
|
self.setDragEnabled(True)
|
||||||
self.setAcceptDrops(True)
|
self.setAcceptDrops(True)
|
||||||
|
|
|
@ -1661,18 +1661,13 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
|
||||||
separator_line = QtWidgets.QFrame()
|
separator_line = QtWidgets.QFrame()
|
||||||
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||||
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||||
self.layout.addWidget(separator_line)
|
grid0.addWidget(separator_line, 31, 0, 1, 2)
|
||||||
|
|
||||||
grid1 = QtWidgets.QGridLayout()
|
|
||||||
self.layout.addLayout(grid1)
|
|
||||||
grid1.setColumnStretch(0, 0)
|
|
||||||
grid1.setColumnStretch(1, 1)
|
|
||||||
|
|
||||||
self.pdf_param_label = QtWidgets.QLabel('<B>%s:</b>' % _("Text to PDF parameters"))
|
self.pdf_param_label = QtWidgets.QLabel('<B>%s:</b>' % _("Text to PDF parameters"))
|
||||||
self.pdf_param_label.setToolTip(
|
self.pdf_param_label.setToolTip(
|
||||||
_("Used when saving text in Code Editor or in FlatCAM Document objects.")
|
_("Used when saving text in Code Editor or in FlatCAM Document objects.")
|
||||||
)
|
)
|
||||||
grid1.addWidget(self.pdf_param_label, 0, 0, 1, 2)
|
grid0.addWidget(self.pdf_param_label, 32, 0, 1, 2)
|
||||||
|
|
||||||
# Top Margin value
|
# Top Margin value
|
||||||
self.tmargin_entry = FCDoubleSpinner()
|
self.tmargin_entry = FCDoubleSpinner()
|
||||||
|
@ -1684,8 +1679,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
|
||||||
_("Distance between text body and the top of the PDF file.")
|
_("Distance between text body and the top of the PDF file.")
|
||||||
)
|
)
|
||||||
|
|
||||||
grid1.addWidget(self.tmargin_label, 1, 0)
|
grid0.addWidget(self.tmargin_label, 33, 0)
|
||||||
grid1.addWidget(self.tmargin_entry, 1, 1)
|
grid0.addWidget(self.tmargin_entry, 33, 1)
|
||||||
|
|
||||||
# Bottom Margin value
|
# Bottom Margin value
|
||||||
self.bmargin_entry = FCDoubleSpinner()
|
self.bmargin_entry = FCDoubleSpinner()
|
||||||
|
@ -1697,8 +1692,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
|
||||||
_("Distance between text body and the bottom of the PDF file.")
|
_("Distance between text body and the bottom of the PDF file.")
|
||||||
)
|
)
|
||||||
|
|
||||||
grid1.addWidget(self.bmargin_label, 2, 0)
|
grid0.addWidget(self.bmargin_label, 34, 0)
|
||||||
grid1.addWidget(self.bmargin_entry, 2, 1)
|
grid0.addWidget(self.bmargin_entry, 34, 1)
|
||||||
|
|
||||||
# Left Margin value
|
# Left Margin value
|
||||||
self.lmargin_entry = FCDoubleSpinner()
|
self.lmargin_entry = FCDoubleSpinner()
|
||||||
|
@ -1710,8 +1705,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
|
||||||
_("Distance between text body and the left of the PDF file.")
|
_("Distance between text body and the left of the PDF file.")
|
||||||
)
|
)
|
||||||
|
|
||||||
grid1.addWidget(self.lmargin_label, 3, 0)
|
grid0.addWidget(self.lmargin_label, 35, 0)
|
||||||
grid1.addWidget(self.lmargin_entry, 3, 1)
|
grid0.addWidget(self.lmargin_entry, 35, 1)
|
||||||
|
|
||||||
# Right Margin value
|
# Right Margin value
|
||||||
self.rmargin_entry = FCDoubleSpinner()
|
self.rmargin_entry = FCDoubleSpinner()
|
||||||
|
@ -1723,8 +1718,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
|
||||||
_("Distance between text body and the right of the PDF file.")
|
_("Distance between text body and the right of the PDF file.")
|
||||||
)
|
)
|
||||||
|
|
||||||
grid1.addWidget(self.rmargin_label, 4, 0)
|
grid0.addWidget(self.rmargin_label, 36, 0)
|
||||||
grid1.addWidget(self.rmargin_entry, 4, 1)
|
grid0.addWidget(self.rmargin_entry, 36, 1)
|
||||||
|
|
||||||
self.layout.addStretch()
|
self.layout.addStretch()
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -484,11 +484,8 @@ class Panelize(FlatCAMTool):
|
||||||
if panel_obj is not None:
|
if panel_obj is not None:
|
||||||
self.app.inform.emit(_("Generating panel ... "))
|
self.app.inform.emit(_("Generating panel ... "))
|
||||||
|
|
||||||
self.app.progress.emit(0)
|
|
||||||
|
|
||||||
def job_init_excellon(obj_fin, app_obj):
|
def job_init_excellon(obj_fin, app_obj):
|
||||||
currenty = 0.0
|
currenty = 0.0
|
||||||
self.app.progress.emit(10)
|
|
||||||
obj_fin.tools = copied_tools
|
obj_fin.tools = copied_tools
|
||||||
obj_fin.drills = []
|
obj_fin.drills = []
|
||||||
obj_fin.slots = []
|
obj_fin.slots = []
|
||||||
|
|
|
@ -417,8 +417,6 @@ class PcbWizard(FlatCAMTool):
|
||||||
|
|
||||||
# How the object should be initialized
|
# How the object should be initialized
|
||||||
def obj_init(excellon_obj, app_obj):
|
def obj_init(excellon_obj, app_obj):
|
||||||
# self.progress.emit(20)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ret = excellon_obj.parse_file(file_obj=excellon_fileobj)
|
ret = excellon_obj.parse_file(file_obj=excellon_fileobj)
|
||||||
if ret == "fail":
|
if ret == "fail":
|
||||||
|
@ -427,10 +425,8 @@ class PcbWizard(FlatCAMTool):
|
||||||
_("This is not Excellon file."))
|
_("This is not Excellon file."))
|
||||||
return "fail"
|
return "fail"
|
||||||
except IOError:
|
except IOError:
|
||||||
app_obj.inform.emit('[ERROR_NOTCL] %s: %s' % (
|
app_obj.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Cannot parse file"), self.outname))
|
||||||
_("Cannot parse file"), self.outname))
|
|
||||||
app_obj.log.debug("Could not import Excellon object.")
|
app_obj.log.debug("Could not import Excellon object.")
|
||||||
app_obj.progress.emit(0)
|
|
||||||
return "fail"
|
return "fail"
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
app_obj.log.debug("PcbWizard.on_import_excellon().obj_init() %s" % str(e))
|
app_obj.log.debug("PcbWizard.on_import_excellon().obj_init() %s" % str(e))
|
||||||
|
@ -443,7 +439,7 @@ class PcbWizard(FlatCAMTool):
|
||||||
if ret == 'fail':
|
if ret == 'fail':
|
||||||
app_obj.log.debug("Could not create geometry for Excellon object.")
|
app_obj.log.debug("Could not create geometry for Excellon object.")
|
||||||
return "fail"
|
return "fail"
|
||||||
app_obj.progress.emit(100)
|
|
||||||
for tool in excellon_obj.tools:
|
for tool in excellon_obj.tools:
|
||||||
if excellon_obj.tools[tool]['solid_geometry']:
|
if excellon_obj.tools[tool]['solid_geometry']:
|
||||||
return
|
return
|
||||||
|
|
|
@ -1348,8 +1348,6 @@ class SolderPaste(FlatCAMTool):
|
||||||
job_obj.options['ymax'] = ymax
|
job_obj.options['ymax'] = ymax
|
||||||
|
|
||||||
for tooluid_key, tooluid_value in obj.tools.items():
|
for tooluid_key, tooluid_value in obj.tools.items():
|
||||||
app_obj.progress.emit(20)
|
|
||||||
|
|
||||||
# find the tool_dia associated with the tooluid_key
|
# find the tool_dia associated with the tooluid_key
|
||||||
tool_dia = tooluid_value['tooldia']
|
tool_dia = tooluid_value['tooldia']
|
||||||
tool_cnc_dict = deepcopy(tooluid_value)
|
tool_cnc_dict = deepcopy(tooluid_value)
|
||||||
|
@ -1380,8 +1378,6 @@ class SolderPaste(FlatCAMTool):
|
||||||
# tell gcode_parse from which point to start drawing the lines depending on what kind of
|
# tell gcode_parse from which point to start drawing the lines depending on what kind of
|
||||||
# object is the source of gcode
|
# object is the source of gcode
|
||||||
job_obj.toolchange_xy_type = "geometry"
|
job_obj.toolchange_xy_type = "geometry"
|
||||||
app_obj.progress.emit(80)
|
|
||||||
|
|
||||||
job_obj.cnc_tools.update({
|
job_obj.cnc_tools.update({
|
||||||
tooluid_key: deepcopy(tool_cnc_dict)
|
tooluid_key: deepcopy(tool_cnc_dict)
|
||||||
})
|
})
|
||||||
|
@ -1394,8 +1390,6 @@ class SolderPaste(FlatCAMTool):
|
||||||
if app_obj.new_object("cncjob", name, job_init) != 'fail':
|
if app_obj.new_object("cncjob", name, job_init) != 'fail':
|
||||||
app_obj.inform.emit('[success] [success] %s: %s' %
|
app_obj.inform.emit('[success] [success] %s: %s' %
|
||||||
(_("ToolSolderPaste CNCjob created"), name))
|
(_("ToolSolderPaste CNCjob created"), name))
|
||||||
app_obj.progress.emit(100)
|
|
||||||
|
|
||||||
# Create a promise with the name
|
# Create a promise with the name
|
||||||
self.app.collection.promise(name)
|
self.app.collection.promise(name)
|
||||||
# Send to worker
|
# Send to worker
|
||||||
|
|
|
@ -682,8 +682,6 @@ class ToolTransform(FlatCAMTool):
|
||||||
xmaximal = max(xmaxlist)
|
xmaximal = max(xmaxlist)
|
||||||
ymaximal = max(ymaxlist)
|
ymaximal = max(ymaxlist)
|
||||||
|
|
||||||
self.app.progress.emit(20)
|
|
||||||
|
|
||||||
px = 0.5 * (xminimal + xmaximal)
|
px = 0.5 * (xminimal + xmaximal)
|
||||||
py = 0.5 * (yminimal + ymaximal)
|
py = 0.5 * (yminimal + ymaximal)
|
||||||
for sel_obj in obj_list:
|
for sel_obj in obj_list:
|
||||||
|
@ -697,8 +695,6 @@ class ToolTransform(FlatCAMTool):
|
||||||
sel_obj.options['rotate'] = num
|
sel_obj.options['rotate'] = num
|
||||||
sel_obj.plot()
|
sel_obj.plot()
|
||||||
self.app.inform.emit('[success] %s...' % _('Rotate done'))
|
self.app.inform.emit('[success] %s...' % _('Rotate done'))
|
||||||
self.app.progress.emit(100)
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit('[ERROR_NOTCL] %s %s, %s.' %
|
self.app.inform.emit('[ERROR_NOTCL] %s %s, %s.' %
|
||||||
(_("Due of"), str(e), _("action was not executed.")))
|
(_("Due of"), str(e), _("action was not executed.")))
|
||||||
|
@ -743,8 +739,6 @@ class ToolTransform(FlatCAMTool):
|
||||||
px = 0.5 * (xminimal + xmaximal)
|
px = 0.5 * (xminimal + xmaximal)
|
||||||
py = 0.5 * (yminimal + ymaximal)
|
py = 0.5 * (yminimal + ymaximal)
|
||||||
|
|
||||||
self.app.progress.emit(20)
|
|
||||||
|
|
||||||
# execute mirroring
|
# execute mirroring
|
||||||
for sel_obj in obj_list:
|
for sel_obj in obj_list:
|
||||||
if isinstance(sel_obj, FlatCAMCNCjob):
|
if isinstance(sel_obj, FlatCAMCNCjob):
|
||||||
|
@ -768,12 +762,9 @@ class ToolTransform(FlatCAMTool):
|
||||||
sel_obj.options['mirror_x'] = not sel_obj.options['mirror_x']
|
sel_obj.options['mirror_x'] = not sel_obj.options['mirror_x']
|
||||||
else:
|
else:
|
||||||
sel_obj.options['mirror_x'] = True
|
sel_obj.options['mirror_x'] = True
|
||||||
self.app.inform.emit('[success] %s...' %
|
self.app.inform.emit('[success] %s...' % _('Flip on the X axis done'))
|
||||||
_('Flip on the X axis done'))
|
|
||||||
self.app.object_changed.emit(sel_obj)
|
self.app.object_changed.emit(sel_obj)
|
||||||
sel_obj.plot()
|
sel_obj.plot()
|
||||||
self.app.progress.emit(100)
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit('[ERROR_NOTCL] %s %s, %s.' %
|
self.app.inform.emit('[ERROR_NOTCL] %s %s, %s.' %
|
||||||
(_("Due of"), str(e), _("action was not executed.")))
|
(_("Due of"), str(e), _("action was not executed.")))
|
||||||
|
@ -809,8 +800,6 @@ class ToolTransform(FlatCAMTool):
|
||||||
xminimal = min(xminlist)
|
xminimal = min(xminlist)
|
||||||
yminimal = min(yminlist)
|
yminimal = min(yminlist)
|
||||||
|
|
||||||
self.app.progress.emit(20)
|
|
||||||
|
|
||||||
for sel_obj in obj_list:
|
for sel_obj in obj_list:
|
||||||
if isinstance(sel_obj, FlatCAMCNCjob):
|
if isinstance(sel_obj, FlatCAMCNCjob):
|
||||||
self.app.inform.emit(_("CNCJob objects can't be skewed."))
|
self.app.inform.emit(_("CNCJob objects can't be skewed."))
|
||||||
|
@ -825,10 +814,7 @@ class ToolTransform(FlatCAMTool):
|
||||||
sel_obj.options['skew_y'] = num
|
sel_obj.options['skew_y'] = num
|
||||||
self.app.object_changed.emit(sel_obj)
|
self.app.object_changed.emit(sel_obj)
|
||||||
sel_obj.plot()
|
sel_obj.plot()
|
||||||
self.app.inform.emit('[success] %s %s %s...' %
|
self.app.inform.emit('[success] %s %s %s...' % (_('Skew on the'), str(axis), _("axis done")))
|
||||||
(_('Skew on the'), str(axis), _("axis done")))
|
|
||||||
self.app.progress.emit(100)
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit('[ERROR_NOTCL] %s %s, %s.' %
|
self.app.inform.emit('[ERROR_NOTCL] %s %s, %s.' %
|
||||||
(_("Due of"), str(e), _("action was not executed.")))
|
(_("Due of"), str(e), _("action was not executed.")))
|
||||||
|
@ -865,8 +851,6 @@ class ToolTransform(FlatCAMTool):
|
||||||
xmaximal = max(xmaxlist)
|
xmaximal = max(xmaxlist)
|
||||||
ymaximal = max(ymaxlist)
|
ymaximal = max(ymaxlist)
|
||||||
|
|
||||||
self.app.progress.emit(20)
|
|
||||||
|
|
||||||
if point is None:
|
if point is None:
|
||||||
px = 0.5 * (xminimal + xmaximal)
|
px = 0.5 * (xminimal + xmaximal)
|
||||||
py = 0.5 * (yminimal + ymaximal)
|
py = 0.5 * (yminimal + ymaximal)
|
||||||
|
@ -887,7 +871,6 @@ class ToolTransform(FlatCAMTool):
|
||||||
|
|
||||||
self.app.inform.emit('[success] %s %s %s...' %
|
self.app.inform.emit('[success] %s %s %s...' %
|
||||||
(_('Scale on the'), str(axis), _('axis done')))
|
(_('Scale on the'), str(axis), _('axis done')))
|
||||||
self.app.progress.emit(100)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit('[ERROR_NOTCL] %s %s, %s.' %
|
self.app.inform.emit('[ERROR_NOTCL] %s %s, %s.' %
|
||||||
(_("Due of"), str(e), _("action was not executed.")))
|
(_("Due of"), str(e), _("action was not executed.")))
|
||||||
|
@ -903,8 +886,6 @@ class ToolTransform(FlatCAMTool):
|
||||||
else:
|
else:
|
||||||
with self.app.proc_container.new(_("Applying Offset")):
|
with self.app.proc_container.new(_("Applying Offset")):
|
||||||
try:
|
try:
|
||||||
self.app.progress.emit(20)
|
|
||||||
|
|
||||||
for sel_obj in obj_list:
|
for sel_obj in obj_list:
|
||||||
if isinstance(sel_obj, FlatCAMCNCjob):
|
if isinstance(sel_obj, FlatCAMCNCjob):
|
||||||
self.app.inform.emit(_("CNCJob objects can't be offset."))
|
self.app.inform.emit(_("CNCJob objects can't be offset."))
|
||||||
|
@ -922,8 +903,6 @@ class ToolTransform(FlatCAMTool):
|
||||||
|
|
||||||
self.app.inform.emit('[success] %s %s %s...' %
|
self.app.inform.emit('[success] %s %s %s...' %
|
||||||
(_('Offset on the'), str(axis), _('axis done')))
|
(_('Offset on the'), str(axis), _('axis done')))
|
||||||
self.app.progress.emit(100)
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit('[ERROR_NOTCL] %s %s, %s.' %
|
self.app.inform.emit('[ERROR_NOTCL] %s %s, %s.' %
|
||||||
(_("Due of"), str(e), _("action was not executed.")))
|
(_("Due of"), str(e), _("action was not executed.")))
|
||||||
|
|
|
@ -219,7 +219,7 @@ class TclCommandCopperClear(TclCommand):
|
||||||
|
|
||||||
# Non-Copper clear all polygons in the non-copper clear object
|
# Non-Copper clear all polygons in the non-copper clear object
|
||||||
if 'all' in args and bool(args['all']):
|
if 'all' in args and bool(args['all']):
|
||||||
self.app.ncclear_tool.clear_copper(ncc_obj=obj,
|
self.app.ncclear_tool.clear_copper_tcl(ncc_obj=obj,
|
||||||
select_method='itself',
|
select_method='itself',
|
||||||
ncctooldia=tooldia,
|
ncctooldia=tooldia,
|
||||||
overlap=overlap,
|
overlap=overlap,
|
||||||
|
@ -252,7 +252,7 @@ class TclCommandCopperClear(TclCommand):
|
||||||
self.raise_tcl_error("%s: %s" % (_("Could not retrieve box object"), name))
|
self.raise_tcl_error("%s: %s" % (_("Could not retrieve box object"), name))
|
||||||
return "Could not retrieve object: %s" % name
|
return "Could not retrieve object: %s" % name
|
||||||
|
|
||||||
self.app.ncclear_tool.clear_copper(ncc_obj=obj,
|
self.app.ncclear_tool.clear_copper_tcl(ncc_obj=obj,
|
||||||
sel_obj=box_obj,
|
sel_obj=box_obj,
|
||||||
select_method='box',
|
select_method='box',
|
||||||
ncctooldia=tooldia,
|
ncctooldia=tooldia,
|
||||||
|
|
|
@ -177,11 +177,8 @@ class TclCommandPanelize(TclCommand):
|
||||||
if obj is not None:
|
if obj is not None:
|
||||||
self.app.inform.emit("Generating panel ... Please wait.")
|
self.app.inform.emit("Generating panel ... Please wait.")
|
||||||
|
|
||||||
self.app.progress.emit(0)
|
|
||||||
|
|
||||||
def job_init_excellon(obj_fin, app_obj):
|
def job_init_excellon(obj_fin, app_obj):
|
||||||
currenty = 0.0
|
currenty = 0.0
|
||||||
self.app.progress.emit(10)
|
|
||||||
obj_fin.tools = obj.tools.copy()
|
obj_fin.tools = obj.tools.copy()
|
||||||
obj_fin.drills = []
|
obj_fin.drills = []
|
||||||
obj_fin.slots = []
|
obj_fin.slots = []
|
||||||
|
@ -247,7 +244,6 @@ class TclCommandPanelize(TclCommand):
|
||||||
for tool in obj.tools:
|
for tool in obj.tools:
|
||||||
obj_fin.tools[tool]['solid_geometry'][:] = []
|
obj_fin.tools[tool]['solid_geometry'][:] = []
|
||||||
|
|
||||||
self.app.progress.emit(0)
|
|
||||||
for row in range(rows):
|
for row in range(rows):
|
||||||
currentx = 0.0
|
currentx = 0.0
|
||||||
|
|
||||||
|
@ -271,10 +267,8 @@ class TclCommandPanelize(TclCommand):
|
||||||
currenty += lenghty
|
currenty += lenghty
|
||||||
|
|
||||||
if isinstance(obj, FlatCAMExcellon):
|
if isinstance(obj, FlatCAMExcellon):
|
||||||
self.app.progress.emit(50)
|
|
||||||
self.app.new_object("excellon", outname, job_init_excellon, plot=False, autoselected=True)
|
self.app.new_object("excellon", outname, job_init_excellon, plot=False, autoselected=True)
|
||||||
else:
|
else:
|
||||||
self.app.progress.emit(50)
|
|
||||||
self.app.new_object("geometry", outname, job_init_geometry, plot=False, autoselected=True)
|
self.app.new_object("geometry", outname, job_init_geometry, plot=False, autoselected=True)
|
||||||
|
|
||||||
if threaded is True:
|
if threaded is True:
|
||||||
|
|
Loading…
Reference in New Issue