- made all TclCommands not to be plotted automatically
- made sure that all TclCommands are not threaded
This commit is contained in:
parent
2f553c9005
commit
8cba74647f
@ -5948,15 +5948,14 @@ class App(QtCore.QObject):
|
|||||||
except tk.TclError as e:
|
except tk.TclError as e:
|
||||||
log.debug("App.handleRunCode() --> %s" % str(e))
|
log.debug("App.handleRunCode() --> %s" % str(e))
|
||||||
old_line = old_line + tcl_command_line + '\n'
|
old_line = old_line + tcl_command_line + '\n'
|
||||||
|
except Exception as e:
|
||||||
|
log.debug("App.handleRunCode() --> %s" % str(e))
|
||||||
|
|
||||||
if old_line != '':
|
if old_line != '':
|
||||||
# it means that the script finished with an error
|
# it means that the script finished with an error
|
||||||
result = self.tcl.eval("set errorInfo")
|
result = self.tcl.eval("set errorInfo")
|
||||||
self.log.error("Exec command Exception: %s" % (result + '\n'))
|
self.log.error("Exec command Exception: %s" % (result + '\n'))
|
||||||
self.shell.append_error('ERROR: ' + result + '\n')
|
self.shell.append_error('ERROR: ' + result + '\n')
|
||||||
else:
|
|
||||||
# success! plot all objects
|
|
||||||
self.plot_all()
|
|
||||||
|
|
||||||
self.shell.close_proccessing()
|
self.shell.close_proccessing()
|
||||||
|
|
||||||
@ -8310,6 +8309,10 @@ class App(QtCore.QObject):
|
|||||||
self.ui.buttonOpen.clicked.connect(lambda: self.handleOpen(filt=flt))
|
self.ui.buttonOpen.clicked.connect(lambda: self.handleOpen(filt=flt))
|
||||||
self.ui.buttonSave.clicked.connect(lambda: self.handleSaveGCode(filt=flt))
|
self.ui.buttonSave.clicked.connect(lambda: self.handleSaveGCode(filt=flt))
|
||||||
self.ui.buttonRun.show()
|
self.ui.buttonRun.show()
|
||||||
|
try:
|
||||||
|
self.ui.buttonRun.clicked.disconnect(self.handleRunCode)
|
||||||
|
except TypeError:
|
||||||
|
pass
|
||||||
self.ui.buttonRun.clicked.connect(self.handleRunCode)
|
self.ui.buttonRun.clicked.connect(self.handleRunCode)
|
||||||
|
|
||||||
self.handleTextChanged()
|
self.handleTextChanged()
|
||||||
|
@ -924,7 +924,7 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
|
|||||||
return "Operation failed: %s" % str(e)
|
return "Operation failed: %s" % str(e)
|
||||||
|
|
||||||
def isolate(self, iso_type=None, dia=None, passes=None, overlap=None, outname=None, combine=None,
|
def isolate(self, iso_type=None, dia=None, passes=None, overlap=None, outname=None, combine=None,
|
||||||
milling_type=None, follow=None):
|
milling_type=None, follow=None, plot=True):
|
||||||
"""
|
"""
|
||||||
Creates an isolation routing geometry object in the project.
|
Creates an isolation routing geometry object in the project.
|
||||||
|
|
||||||
@ -1164,7 +1164,7 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
|
|||||||
geo_obj.solid_geometry = area_subtraction(geo_obj.solid_geometry)
|
geo_obj.solid_geometry = area_subtraction(geo_obj.solid_geometry)
|
||||||
|
|
||||||
# TODO: Do something if this is None. Offer changing name?
|
# TODO: Do something if this is None. Offer changing name?
|
||||||
self.app.new_object("geometry", iso_name, iso_init)
|
self.app.new_object("geometry", iso_name, iso_init, plot=plot)
|
||||||
else:
|
else:
|
||||||
for i in range(passes):
|
for i in range(passes):
|
||||||
|
|
||||||
@ -1239,7 +1239,7 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
|
|||||||
geo_obj.solid_geometry = area_subtraction(geo_obj.solid_geometry)
|
geo_obj.solid_geometry = area_subtraction(geo_obj.solid_geometry)
|
||||||
|
|
||||||
# TODO: Do something if this is None. Offer changing name?
|
# TODO: Do something if this is None. Offer changing name?
|
||||||
self.app.new_object("geometry", iso_name, iso_init)
|
self.app.new_object("geometry", iso_name, iso_init, plot=plot)
|
||||||
|
|
||||||
def on_plot_cb_click(self, *args):
|
def on_plot_cb_click(self, *args):
|
||||||
if self.muted_ui:
|
if self.muted_ui:
|
||||||
@ -2604,7 +2604,7 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
|
|||||||
|
|
||||||
return has_slots, excellon_code
|
return has_slots, excellon_code
|
||||||
|
|
||||||
def generate_milling_drills(self, tools=None, outname=None, tooldia=None, use_thread=False):
|
def generate_milling_drills(self, tools=None, outname=None, tooldia=None, plot=False, use_thread=False):
|
||||||
"""
|
"""
|
||||||
Note: This method is a good template for generic operations as
|
Note: This method is a good template for generic operations as
|
||||||
it takes it's options from parameters or otherwise from the
|
it takes it's options from parameters or otherwise from the
|
||||||
@ -2683,7 +2683,7 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
|
|||||||
Point(hole['point']).buffer(buffer_value).exterior)
|
Point(hole['point']).buffer(buffer_value).exterior)
|
||||||
if use_thread:
|
if use_thread:
|
||||||
def geo_thread(app_obj):
|
def geo_thread(app_obj):
|
||||||
app_obj.new_object("geometry", outname, geo_init)
|
app_obj.new_object("geometry", outname, geo_init, plot=plot)
|
||||||
app_obj.progress.emit(100)
|
app_obj.progress.emit(100)
|
||||||
|
|
||||||
# Create a promise with the new name
|
# Create a promise with the new name
|
||||||
@ -2692,11 +2692,11 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
|
|||||||
# Send to worker
|
# Send to worker
|
||||||
self.app.worker_task.emit({'fcn': geo_thread, 'params': [self.app]})
|
self.app.worker_task.emit({'fcn': geo_thread, 'params': [self.app]})
|
||||||
else:
|
else:
|
||||||
self.app.new_object("geometry", outname, geo_init)
|
self.app.new_object("geometry", outname, geo_init, plot=plot)
|
||||||
|
|
||||||
return True, ""
|
return True, ""
|
||||||
|
|
||||||
def generate_milling_slots(self, tools=None, outname=None, tooldia=None, use_thread=False):
|
def generate_milling_slots(self, tools=None, outname=None, tooldia=None, plot=True, use_thread=False):
|
||||||
"""
|
"""
|
||||||
Note: This method is a good template for generic operations as
|
Note: This method is a good template for generic operations as
|
||||||
it takes it's options from parameters or otherwise from the
|
it takes it's options from parameters or otherwise from the
|
||||||
@ -2790,7 +2790,7 @@ 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)
|
app_obj.new_object("geometry", outname + '_slot', geo_init, plot=plot)
|
||||||
app_obj.progress.emit(100)
|
app_obj.progress.emit(100)
|
||||||
|
|
||||||
# Create a promise with the new name
|
# Create a promise with the new name
|
||||||
@ -2799,7 +2799,7 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
|
|||||||
# Send to worker
|
# Send to worker
|
||||||
self.app.worker_task.emit({'fcn': geo_thread, 'params': [self.app]})
|
self.app.worker_task.emit({'fcn': geo_thread, 'params': [self.app]})
|
||||||
else:
|
else:
|
||||||
self.app.new_object("geometry", outname + '_slot', geo_init)
|
self.app.new_object("geometry", outname + '_slot', geo_init, plot=plot)
|
||||||
|
|
||||||
return True, ""
|
return True, ""
|
||||||
|
|
||||||
@ -4527,7 +4527,8 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
|
|||||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
_("Failed. No tool selected in the tool table ..."))
|
_("Failed. No tool selected in the tool table ..."))
|
||||||
|
|
||||||
def mtool_gen_cncjob(self, outname=None, tools_dict=None, tools_in_use=None, segx=None, segy=None, use_thread=True):
|
def mtool_gen_cncjob(self, outname=None, tools_dict=None, tools_in_use=None, segx=None, segy=None,
|
||||||
|
plot=True, use_thread=True):
|
||||||
"""
|
"""
|
||||||
Creates a multi-tool CNCJob out of this Geometry object.
|
Creates a multi-tool CNCJob out of this Geometry object.
|
||||||
The actual work is done by the target FlatCAMCNCjob object's
|
The actual work is done by the target FlatCAMCNCjob object's
|
||||||
@ -4884,7 +4885,7 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
|
|||||||
def job_thread(app_obj):
|
def job_thread(app_obj):
|
||||||
if self.solid_geometry:
|
if self.solid_geometry:
|
||||||
with self.app.proc_container.new(_("Generating CNC Code")):
|
with self.app.proc_container.new(_("Generating CNC Code")):
|
||||||
if app_obj.new_object("cncjob", outname, job_init_single_geometry) != 'fail':
|
if app_obj.new_object("cncjob", outname, job_init_single_geometry, plot=plot) != 'fail':
|
||||||
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)
|
app_obj.progress.emit(100)
|
||||||
@ -4901,9 +4902,9 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
|
|||||||
self.app.worker_task.emit({'fcn': job_thread, 'params': [self.app]})
|
self.app.worker_task.emit({'fcn': job_thread, 'params': [self.app]})
|
||||||
else:
|
else:
|
||||||
if self.solid_geometry:
|
if self.solid_geometry:
|
||||||
self.app.new_object("cncjob", outname, job_init_single_geometry)
|
self.app.new_object("cncjob", outname, job_init_single_geometry, plot=plot)
|
||||||
else:
|
else:
|
||||||
self.app.new_object("cncjob", outname, job_init_multi_geometry)
|
self.app.new_object("cncjob", outname, job_init_multi_geometry, plot=plot)
|
||||||
|
|
||||||
def generatecncjob(
|
def generatecncjob(
|
||||||
self, outname=None,
|
self, outname=None,
|
||||||
@ -4916,7 +4917,8 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
|
|||||||
extracut=None, startz=None, endz=None,
|
extracut=None, startz=None, endz=None,
|
||||||
ppname_g=None,
|
ppname_g=None,
|
||||||
segx=None, segy=None,
|
segx=None, segy=None,
|
||||||
use_thread=True):
|
use_thread=True,
|
||||||
|
plot=True):
|
||||||
"""
|
"""
|
||||||
Only used for TCL Command.
|
Only used for TCL Command.
|
||||||
Creates a CNCJob out of this Geometry object. The actual
|
Creates a CNCJob out of this Geometry object. The actual
|
||||||
@ -5043,7 +5045,7 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
|
|||||||
# 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)
|
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)
|
app_obj.progress.emit(100)
|
||||||
@ -5053,7 +5055,7 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
|
|||||||
# Send to worker
|
# Send to worker
|
||||||
self.app.worker_task.emit({'fcn': job_thread, 'params': [self.app]})
|
self.app.worker_task.emit({'fcn': job_thread, 'params': [self.app]})
|
||||||
else:
|
else:
|
||||||
self.app.new_object("cncjob", outname, job_init)
|
self.app.new_object("cncjob", outname, job_init, plot=plot)
|
||||||
|
|
||||||
# def on_plot_cb_click(self, *args): # TODO: args not needed
|
# def on_plot_cb_click(self, *args): # TODO: args not needed
|
||||||
# if self.muted_ui:
|
# if self.muted_ui:
|
||||||
|
@ -23,7 +23,9 @@ CAD program, and create G-Code for Isolation routing.
|
|||||||
- added possibility to see the GCode when right clicking on the Project tab on a CNCJob object and then clicking View Source
|
- added possibility to see the GCode when right clicking on the Project tab on a CNCJob object and then clicking View Source
|
||||||
- added a new TclCommand named PlotObjects which will plot a list of FlatCAM objects
|
- added a new TclCommand named PlotObjects which will plot a list of FlatCAM objects
|
||||||
- made that after opening an object in FlatCAM it is not automatically plotted. If the user wants to plot it can use the TclCommands PlotAll or PlotObjects
|
- made that after opening an object in FlatCAM it is not automatically plotted. If the user wants to plot it can use the TclCommands PlotAll or PlotObjects
|
||||||
- modified the TclCommands that open files to not plot the opened files automatically
|
- modified the TclCommands so that open files do not plot the opened files automatically
|
||||||
|
- made all TclCommands not to be plotted automatically
|
||||||
|
- made sure that all TclCommands are not threaded
|
||||||
|
|
||||||
14.09.2019
|
14.09.2019
|
||||||
|
|
||||||
|
@ -1292,6 +1292,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
method=None,
|
method=None,
|
||||||
rest=None,
|
rest=None,
|
||||||
tools_storage=None,
|
tools_storage=None,
|
||||||
|
plot=True,
|
||||||
run_threaded=True):
|
run_threaded=True):
|
||||||
"""
|
"""
|
||||||
Clear the excess copper from the entire object.
|
Clear the excess copper from the entire object.
|
||||||
@ -2189,9 +2190,9 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
def job_thread(app_obj):
|
def job_thread(app_obj):
|
||||||
try:
|
try:
|
||||||
if rest_machining_choice is True:
|
if rest_machining_choice is True:
|
||||||
app_obj.new_object("geometry", name, gen_clear_area_rest)
|
app_obj.new_object("geometry", name, gen_clear_area_rest, plot=plot)
|
||||||
else:
|
else:
|
||||||
app_obj.new_object("geometry", name, gen_clear_area)
|
app_obj.new_object("geometry", name, gen_clear_area, plot=plot)
|
||||||
except FlatCAMApp.GracefulException:
|
except FlatCAMApp.GracefulException:
|
||||||
proc.done()
|
proc.done()
|
||||||
return
|
return
|
||||||
|
@ -1168,7 +1168,9 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
outname=None,
|
outname=None,
|
||||||
connect=None,
|
connect=None,
|
||||||
contour=None,
|
contour=None,
|
||||||
tools_storage=None):
|
tools_storage=None,
|
||||||
|
plot=True,
|
||||||
|
run_threaded=True):
|
||||||
"""
|
"""
|
||||||
Paints a polygon selected by clicking on its interior or by having a point coordinates given
|
Paints a polygon selected by clicking on its interior or by having a point coordinates given
|
||||||
|
|
||||||
@ -1432,7 +1434,7 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
|
|
||||||
def job_thread(app_obj):
|
def job_thread(app_obj):
|
||||||
try:
|
try:
|
||||||
app_obj.new_object("geometry", name, gen_paintarea)
|
app_obj.new_object("geometry", name, gen_paintarea, plot=plot)
|
||||||
except FlatCAMApp.GracefulException:
|
except FlatCAMApp.GracefulException:
|
||||||
proc.done()
|
proc.done()
|
||||||
return
|
return
|
||||||
@ -1451,8 +1453,11 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
# Promise object with the new name
|
# Promise object with the new name
|
||||||
self.app.collection.promise(name)
|
self.app.collection.promise(name)
|
||||||
|
|
||||||
# Background
|
if run_threaded:
|
||||||
self.app.worker_task.emit({'fcn': job_thread, 'params': [self.app]})
|
# Background
|
||||||
|
self.app.worker_task.emit({'fcn': job_thread, 'params': [self.app]})
|
||||||
|
else:
|
||||||
|
job_thread(app_obj=self.app)
|
||||||
|
|
||||||
def paint_poly_all(self, obj,
|
def paint_poly_all(self, obj,
|
||||||
tooldia=None,
|
tooldia=None,
|
||||||
@ -1463,7 +1468,9 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
outname=None,
|
outname=None,
|
||||||
connect=None,
|
connect=None,
|
||||||
contour=None,
|
contour=None,
|
||||||
tools_storage=None):
|
tools_storage=None,
|
||||||
|
plot=True,
|
||||||
|
run_threaded=True):
|
||||||
"""
|
"""
|
||||||
Paints all polygons in this object.
|
Paints all polygons in this object.
|
||||||
|
|
||||||
@ -1901,9 +1908,9 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
def job_thread(app_obj):
|
def job_thread(app_obj):
|
||||||
try:
|
try:
|
||||||
if self.rest_cb.isChecked():
|
if self.rest_cb.isChecked():
|
||||||
app_obj.new_object("geometry", name, gen_paintarea_rest_machining)
|
app_obj.new_object("geometry", name, gen_paintarea_rest_machining, plot=plot)
|
||||||
else:
|
else:
|
||||||
app_obj.new_object("geometry", name, gen_paintarea)
|
app_obj.new_object("geometry", name, gen_paintarea, plot=plot)
|
||||||
except FlatCAMApp.GracefulException:
|
except FlatCAMApp.GracefulException:
|
||||||
proc.done()
|
proc.done()
|
||||||
return
|
return
|
||||||
@ -1920,8 +1927,11 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
# Promise object with the new name
|
# Promise object with the new name
|
||||||
self.app.collection.promise(name)
|
self.app.collection.promise(name)
|
||||||
|
|
||||||
# Background
|
if run_threaded:
|
||||||
self.app.worker_task.emit({'fcn': job_thread, 'params': [self.app]})
|
# Background
|
||||||
|
self.app.worker_task.emit({'fcn': job_thread, 'params': [self.app]})
|
||||||
|
else:
|
||||||
|
job_thread(app_obj=self.app)
|
||||||
|
|
||||||
def paint_poly_area(self, obj, sel_obj,
|
def paint_poly_area(self, obj, sel_obj,
|
||||||
tooldia=None,
|
tooldia=None,
|
||||||
@ -1932,7 +1942,9 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
outname=None,
|
outname=None,
|
||||||
connect=None,
|
connect=None,
|
||||||
contour=None,
|
contour=None,
|
||||||
tools_storage=None):
|
tools_storage=None,
|
||||||
|
plot=True,
|
||||||
|
run_threaded=True):
|
||||||
"""
|
"""
|
||||||
Paints all polygons in this object that are within the sel_obj object
|
Paints all polygons in this object that are within the sel_obj object
|
||||||
|
|
||||||
@ -2366,9 +2378,9 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
def job_thread(app_obj):
|
def job_thread(app_obj):
|
||||||
try:
|
try:
|
||||||
if self.rest_cb.isChecked():
|
if self.rest_cb.isChecked():
|
||||||
app_obj.new_object("geometry", name, gen_paintarea_rest_machining)
|
app_obj.new_object("geometry", name, gen_paintarea_rest_machining, plot=plot)
|
||||||
else:
|
else:
|
||||||
app_obj.new_object("geometry", name, gen_paintarea)
|
app_obj.new_object("geometry", name, gen_paintarea, plot=plot)
|
||||||
except FlatCAMApp.GracefulException:
|
except FlatCAMApp.GracefulException:
|
||||||
proc.done()
|
proc.done()
|
||||||
return
|
return
|
||||||
@ -2385,8 +2397,11 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
# Promise object with the new name
|
# Promise object with the new name
|
||||||
self.app.collection.promise(name)
|
self.app.collection.promise(name)
|
||||||
|
|
||||||
# Background
|
if run_threaded:
|
||||||
self.app.worker_task.emit({'fcn': job_thread, 'params': [self.app]})
|
# Background
|
||||||
|
self.app.worker_task.emit({'fcn': job_thread, 'params': [self.app]})
|
||||||
|
else:
|
||||||
|
job_thread(app_obj=self.app)
|
||||||
|
|
||||||
def paint_poly_ref(self, obj, sel_obj,
|
def paint_poly_ref(self, obj, sel_obj,
|
||||||
tooldia=None,
|
tooldia=None,
|
||||||
@ -2397,7 +2412,9 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
outname=None,
|
outname=None,
|
||||||
connect=None,
|
connect=None,
|
||||||
contour=None,
|
contour=None,
|
||||||
tools_storage=None):
|
tools_storage=None,
|
||||||
|
plot=True,
|
||||||
|
run_threaded=True):
|
||||||
"""
|
"""
|
||||||
Paints all polygons in this object that are within the sel_obj object
|
Paints all polygons in this object that are within the sel_obj object
|
||||||
|
|
||||||
@ -2441,7 +2458,9 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
outname=outname,
|
outname=outname,
|
||||||
connect=connect,
|
connect=connect,
|
||||||
contour=contour,
|
contour=contour,
|
||||||
tools_storage=tools_storage)
|
tools_storage=tools_storage,
|
||||||
|
plot=plot,
|
||||||
|
run_threaded=run_threaded)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def paint_bounds(geometry):
|
def paint_bounds(geometry):
|
||||||
|
@ -178,7 +178,7 @@ class TclCommandAlignDrill(TclCommandSignaled):
|
|||||||
|
|
||||||
obj.app.new_object("excellon",
|
obj.app.new_object("excellon",
|
||||||
name + "_aligndrill",
|
name + "_aligndrill",
|
||||||
alligndrill_init_me)
|
alligndrill_init_me, plot=False)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return "Operation failed: %s" % str(e)
|
return "Operation failed: %s" % str(e)
|
||||||
@ -194,8 +194,8 @@ class TclCommandAlignDrill(TclCommandSignaled):
|
|||||||
try:
|
try:
|
||||||
px = dist
|
px = dist
|
||||||
py = dist
|
py = dist
|
||||||
obj.app.new_object("excellon", name + "_alligndrill", alligndrill_init_me)
|
obj.app.new_object("excellon", name + "_alligndrill", alligndrill_init_me, plot=False)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return "Operation failed: %s" % str(e)
|
return "Operation failed: %s" % str(e)
|
||||||
|
|
||||||
return 'Ok'
|
return 'Ok. Align Drills Excelon object created'
|
||||||
|
@ -102,4 +102,4 @@ class TclCommandAlignDrillGrid(TclCommandSignaled):
|
|||||||
init_obj.create_geometry()
|
init_obj.create_geometry()
|
||||||
|
|
||||||
# Create the new object
|
# Create the new object
|
||||||
self.app.new_object("excellon", args['outname'], aligndrillgrid_init_me)
|
self.app.new_object("excellon", args['outname'], aligndrillgrid_init_me, plot=False)
|
||||||
|
@ -90,6 +90,6 @@ class TclCommandBbox(TclCommand):
|
|||||||
bounding_box = bounding_box.envelope
|
bounding_box = bounding_box.envelope
|
||||||
geo_obj.solid_geometry = bounding_box
|
geo_obj.solid_geometry = bounding_box
|
||||||
|
|
||||||
self.app.new_object("geometry", args['outname'], geo_init)
|
self.app.new_object("geometry", args['outname'], geo_init, plot=False)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return "Operation failed: %s" % str(e)
|
return "Operation failed: %s" % str(e)
|
||||||
|
@ -143,7 +143,7 @@ class TclCommandCncjob(TclCommandSignaled):
|
|||||||
obj.options['multidepth'] = False
|
obj.options['multidepth'] = False
|
||||||
|
|
||||||
if not obj.multigeo:
|
if not obj.multigeo:
|
||||||
obj.generatecncjob(use_thread=False, **args)
|
obj.generatecncjob(use_thread=False, plot=False, **args)
|
||||||
else:
|
else:
|
||||||
# Update the local_tools_dict values with the args value
|
# Update the local_tools_dict values with the args value
|
||||||
local_tools_dict = deepcopy(obj.tools)
|
local_tools_dict = deepcopy(obj.tools)
|
||||||
@ -171,5 +171,6 @@ class TclCommandCncjob(TclCommandSignaled):
|
|||||||
outname=args['outname'],
|
outname=args['outname'],
|
||||||
tools_dict=local_tools_dict,
|
tools_dict=local_tools_dict,
|
||||||
tools_in_use=[],
|
tools_in_use=[],
|
||||||
use_thread=False)
|
use_thread=False,
|
||||||
|
plot=False)
|
||||||
# self.raise_tcl_error('The object is a multi-geo geometry which is not supported in cncjob Tcl Command')
|
# self.raise_tcl_error('The object is a multi-geo geometry which is not supported in cncjob Tcl Command')
|
||||||
|
@ -226,6 +226,7 @@ class TclCommandCopperClear(TclCommand):
|
|||||||
contour=contour,
|
contour=contour,
|
||||||
rest=rest,
|
rest=rest,
|
||||||
tools_storage=ncc_tools,
|
tools_storage=ncc_tools,
|
||||||
|
plot=False,
|
||||||
run_threaded=False)
|
run_threaded=False)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -259,6 +260,7 @@ class TclCommandCopperClear(TclCommand):
|
|||||||
contour=contour,
|
contour=contour,
|
||||||
rest=rest,
|
rest=rest,
|
||||||
tools_storage=ncc_tools,
|
tools_storage=ncc_tools,
|
||||||
|
plot=False,
|
||||||
run_threaded=False)
|
run_threaded=False)
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
|
@ -123,7 +123,7 @@ class TclCommandCutout(TclCommand):
|
|||||||
geo_obj.solid_geometry = cascaded_union([LineString(segment) for segment in cuts])
|
geo_obj.solid_geometry = cascaded_union([LineString(segment) for segment in cuts])
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.app.new_object("geometry", name + "_cutout", geo_init_me)
|
self.app.new_object("geometry", name + "_cutout", geo_init_me, plot=False)
|
||||||
self.app.inform.emit("[success] Rectangular-form Cutout operation finished.")
|
self.app.inform.emit("[success] Rectangular-form Cutout operation finished.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return "Operation failed: %s" % str(e)
|
return "Operation failed: %s" % str(e)
|
||||||
|
@ -181,4 +181,4 @@ class TclCommandDrillcncjob(TclCommandSignaled):
|
|||||||
job_obj.gcode_parse()
|
job_obj.gcode_parse()
|
||||||
job_obj.create_geometry()
|
job_obj.create_geometry()
|
||||||
|
|
||||||
self.app.new_object("cncjob", args['outname'], job_init)
|
self.app.new_object("cncjob", args['outname'], job_init, plot=False)
|
||||||
|
@ -61,4 +61,4 @@ class TclCommandExteriors(TclCommandSignaled):
|
|||||||
geo_obj.solid_geometry = obj_exteriors
|
geo_obj.solid_geometry = obj_exteriors
|
||||||
|
|
||||||
obj_exteriors = obj.get_exteriors()
|
obj_exteriors = obj.get_exteriors()
|
||||||
self.app.new_object('geometry', outname, geo_init)
|
self.app.new_object('geometry', outname, geo_init, plot=False)
|
||||||
|
@ -279,7 +279,7 @@ class TclCommandGeoCutout(TclCommandSignaled):
|
|||||||
app_obj.inform.emit("[success] Any-form Cutout operation finished.")
|
app_obj.inform.emit("[success] Any-form Cutout operation finished.")
|
||||||
|
|
||||||
outname = cutout_obj.options["name"] + "_cutout"
|
outname = cutout_obj.options["name"] + "_cutout"
|
||||||
self.app.new_object('geometry', outname, geo_init)
|
self.app.new_object('geometry', outname, geo_init, plot=False)
|
||||||
|
|
||||||
# cutout_obj.plot()
|
# cutout_obj.plot()
|
||||||
# self.app.inform.emit("[success] Any-form Cutout operation finished.")
|
# self.app.inform.emit("[success] Any-form Cutout operation finished.")
|
||||||
@ -338,7 +338,7 @@ class TclCommandGeoCutout(TclCommandSignaled):
|
|||||||
app_obj.inform.emit("[success] Any-form Cutout operation finished.")
|
app_obj.inform.emit("[success] Any-form Cutout operation finished.")
|
||||||
|
|
||||||
outname = cutout_obj.options["name"] + "_cutout"
|
outname = cutout_obj.options["name"] + "_cutout"
|
||||||
self.app.new_object('geometry', outname, geo_init)
|
self.app.new_object('geometry', outname, geo_init, plot=False)
|
||||||
|
|
||||||
cutout_obj = self.app.collection.get_by_name(outname)
|
cutout_obj = self.app.collection.get_by_name(outname)
|
||||||
else:
|
else:
|
||||||
|
@ -71,7 +71,7 @@ class TclCommandImportSvg(TclCommandSignaled):
|
|||||||
with self.app.proc_container.new("Import SVG"):
|
with self.app.proc_container.new("Import SVG"):
|
||||||
|
|
||||||
# Object creation
|
# Object creation
|
||||||
self.app.new_object(obj_type, outname, obj_init)
|
self.app.new_object(obj_type, outname, obj_init, plot=False)
|
||||||
|
|
||||||
# Register recent file
|
# Register recent file
|
||||||
self.app.file_opened.emit("svg", filename)
|
self.app.file_opened.emit("svg", filename)
|
||||||
|
@ -85,4 +85,4 @@ class TclCommandIsolate(TclCommandSignaled):
|
|||||||
self.raise_tcl_error('Expected FlatCAMGerber, got %s %s.' % (name, type(obj)))
|
self.raise_tcl_error('Expected FlatCAMGerber, got %s %s.' % (name, type(obj)))
|
||||||
|
|
||||||
del args['name']
|
del args['name']
|
||||||
obj.isolate(**args)
|
obj.isolate(plot=False, **args)
|
||||||
|
@ -61,4 +61,4 @@ class TclCommandJoinExcellon(TclCommand):
|
|||||||
FlatCAMExcellon.merge(objs, obj_)
|
FlatCAMExcellon.merge(objs, obj_)
|
||||||
|
|
||||||
if objs is not None:
|
if objs is not None:
|
||||||
self.app.new_object("excellon", outname, initialize)
|
self.app.new_object("excellon", outname, initialize, plot=False)
|
||||||
|
@ -61,4 +61,4 @@ class TclCommandJoinGeometry(TclCommand):
|
|||||||
FlatCAMGeometry.merge(objs, obj_)
|
FlatCAMGeometry.merge(objs, obj_)
|
||||||
|
|
||||||
if objs is not None:
|
if objs is not None:
|
||||||
self.app.new_object("geometry", outname, initialize)
|
self.app.new_object("geometry", outname, initialize, plot=False)
|
||||||
|
@ -128,7 +128,7 @@ class TclCommandMillDrills(TclCommandSignaled):
|
|||||||
del args['name']
|
del args['name']
|
||||||
|
|
||||||
# This runs in the background... Is blocking handled?
|
# This runs in the background... Is blocking handled?
|
||||||
success, msg = obj.generate_milling_drills(**args)
|
success, msg = obj.generate_milling_drills(plot=False, **args)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
success = None
|
success = None
|
||||||
msg = None
|
msg = None
|
||||||
|
@ -127,7 +127,7 @@ class TclCommandMillSlots(TclCommandSignaled):
|
|||||||
del args['name']
|
del args['name']
|
||||||
|
|
||||||
# This runs in the background... Is blocking handled?
|
# This runs in the background... Is blocking handled?
|
||||||
success, msg = obj.generate_milling_slots(**args)
|
success, msg = obj.generate_milling_slots(plot=False, **args)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
success = None
|
success = None
|
||||||
|
@ -103,6 +103,5 @@ class TclCommandMirror(TclCommandSignaled):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
obj.mirror(axis, [dist, dist])
|
obj.mirror(axis, [dist, dist])
|
||||||
obj.plot()
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return "Operation failed: %s" % str(e)
|
return "Operation failed: %s" % str(e)
|
||||||
|
@ -46,4 +46,4 @@ class TclCommandNewGeometry(TclCommandSignaled):
|
|||||||
|
|
||||||
name = args['name']
|
name = args['name']
|
||||||
|
|
||||||
self.app.new_object('geometry', str(name), lambda x, y: None)
|
self.app.new_object('geometry', str(name), lambda x, y: None, plot=False)
|
||||||
|
@ -89,7 +89,7 @@ class TclCommandNregions(TclCommand):
|
|||||||
non_copper = bounding_box.difference(geo)
|
non_copper = bounding_box.difference(geo)
|
||||||
geo_obj.solid_geometry = non_copper
|
geo_obj.solid_geometry = non_copper
|
||||||
|
|
||||||
self.app.new_object("geometry", args['outname'], geo_init)
|
self.app.new_object("geometry", args['outname'], geo_init, plot=False)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return "Operation failed: %s" % str(e)
|
return "Operation failed: %s" % str(e)
|
||||||
|
|
||||||
|
@ -201,7 +201,9 @@ class TclCommandPaint(TclCommand):
|
|||||||
outname=outname,
|
outname=outname,
|
||||||
connect=connect,
|
connect=connect,
|
||||||
contour=contour,
|
contour=contour,
|
||||||
tools_storage=paint_tools)
|
tools_storage=paint_tools,
|
||||||
|
plot=False,
|
||||||
|
run_threaded=False)
|
||||||
return
|
return
|
||||||
|
|
||||||
# Paint single polygon in the painted object
|
# Paint single polygon in the painted object
|
||||||
@ -222,7 +224,9 @@ class TclCommandPaint(TclCommand):
|
|||||||
outname=outname,
|
outname=outname,
|
||||||
connect=connect,
|
connect=connect,
|
||||||
contour=contour,
|
contour=contour,
|
||||||
tools_storage=paint_tools)
|
tools_storage=paint_tools,
|
||||||
|
plot=False,
|
||||||
|
run_threaded=False)
|
||||||
return
|
return
|
||||||
|
|
||||||
# Paint all polygons found within the box object from the the painted object
|
# Paint all polygons found within the box object from the the painted object
|
||||||
@ -250,7 +254,9 @@ class TclCommandPaint(TclCommand):
|
|||||||
outname=outname,
|
outname=outname,
|
||||||
connect=connect,
|
connect=connect,
|
||||||
contour=contour,
|
contour=contour,
|
||||||
tools_storage=paint_tools)
|
tools_storage=paint_tools,
|
||||||
|
plot=False,
|
||||||
|
run_threaded=False)
|
||||||
return
|
return
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -90,7 +90,7 @@ class TclCommandPanelize(TclCommand):
|
|||||||
if 'threaded' in args:
|
if 'threaded' in args:
|
||||||
threaded = args['threaded']
|
threaded = args['threaded']
|
||||||
else:
|
else:
|
||||||
threaded = 1
|
threaded = 0
|
||||||
|
|
||||||
if 'spacing_columns' in args:
|
if 'spacing_columns' in args:
|
||||||
spacing_columns = args['spacing_columns']
|
spacing_columns = args['spacing_columns']
|
||||||
@ -265,10 +265,10 @@ class TclCommandPanelize(TclCommand):
|
|||||||
|
|
||||||
if isinstance(obj, FlatCAMExcellon):
|
if isinstance(obj, FlatCAMExcellon):
|
||||||
self.app.progress.emit(50)
|
self.app.progress.emit(50)
|
||||||
self.app.new_object("excellon", outname, job_init_excellon, plot=True, autoselected=True)
|
self.app.new_object("excellon", outname, job_init_excellon, plot=False, autoselected=True)
|
||||||
else:
|
else:
|
||||||
self.app.progress.emit(50)
|
self.app.progress.emit(50)
|
||||||
self.app.new_object("geometry", outname, job_init_geometry, plot=True, autoselected=True)
|
self.app.new_object("geometry", outname, job_init_geometry, plot=False, autoselected=True)
|
||||||
|
|
||||||
if threaded == 1:
|
if threaded == 1:
|
||||||
proc = self.app.proc_container.new("Generating panel ... Please wait.")
|
proc = self.app.proc_container.new("Generating panel ... Please wait.")
|
||||||
|
Loading…
Reference in New Issue
Block a user