- made all TclCommands not to be plotted automatically

- made sure that all TclCommands are not threaded
This commit is contained in:
Marius Stanciu
2019-09-16 01:39:11 +03:00
committed by Marius
parent 2f553c9005
commit 8cba74647f
25 changed files with 100 additions and 65 deletions

View File

@@ -178,7 +178,7 @@ class TclCommandAlignDrill(TclCommandSignaled):
obj.app.new_object("excellon",
name + "_aligndrill",
alligndrill_init_me)
alligndrill_init_me, plot=False)
except Exception as e:
return "Operation failed: %s" % str(e)
@@ -194,8 +194,8 @@ class TclCommandAlignDrill(TclCommandSignaled):
try:
px = 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:
return "Operation failed: %s" % str(e)
return 'Ok'
return 'Ok. Align Drills Excelon object created'

View File

@@ -102,4 +102,4 @@ class TclCommandAlignDrillGrid(TclCommandSignaled):
init_obj.create_geometry()
# 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)

View File

@@ -90,6 +90,6 @@ class TclCommandBbox(TclCommand):
bounding_box = bounding_box.envelope
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:
return "Operation failed: %s" % str(e)

View File

@@ -143,7 +143,7 @@ class TclCommandCncjob(TclCommandSignaled):
obj.options['multidepth'] = False
if not obj.multigeo:
obj.generatecncjob(use_thread=False, **args)
obj.generatecncjob(use_thread=False, plot=False, **args)
else:
# Update the local_tools_dict values with the args value
local_tools_dict = deepcopy(obj.tools)
@@ -171,5 +171,6 @@ class TclCommandCncjob(TclCommandSignaled):
outname=args['outname'],
tools_dict=local_tools_dict,
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')

View File

@@ -226,6 +226,7 @@ class TclCommandCopperClear(TclCommand):
contour=contour,
rest=rest,
tools_storage=ncc_tools,
plot=False,
run_threaded=False)
return
@@ -259,6 +260,7 @@ class TclCommandCopperClear(TclCommand):
contour=contour,
rest=rest,
tools_storage=ncc_tools,
plot=False,
run_threaded=False)
return
else:

View File

@@ -123,7 +123,7 @@ class TclCommandCutout(TclCommand):
geo_obj.solid_geometry = cascaded_union([LineString(segment) for segment in cuts])
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.")
except Exception as e:
return "Operation failed: %s" % str(e)

View File

@@ -181,4 +181,4 @@ class TclCommandDrillcncjob(TclCommandSignaled):
job_obj.gcode_parse()
job_obj.create_geometry()
self.app.new_object("cncjob", args['outname'], job_init)
self.app.new_object("cncjob", args['outname'], job_init, plot=False)

View File

@@ -61,4 +61,4 @@ class TclCommandExteriors(TclCommandSignaled):
geo_obj.solid_geometry = obj_exteriors
obj_exteriors = obj.get_exteriors()
self.app.new_object('geometry', outname, geo_init)
self.app.new_object('geometry', outname, geo_init, plot=False)

View File

@@ -279,7 +279,7 @@ class TclCommandGeoCutout(TclCommandSignaled):
app_obj.inform.emit("[success] Any-form Cutout operation finished.")
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()
# 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.")
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)
else:

View File

@@ -71,7 +71,7 @@ class TclCommandImportSvg(TclCommandSignaled):
with self.app.proc_container.new("Import SVG"):
# 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
self.app.file_opened.emit("svg", filename)

View File

@@ -85,4 +85,4 @@ class TclCommandIsolate(TclCommandSignaled):
self.raise_tcl_error('Expected FlatCAMGerber, got %s %s.' % (name, type(obj)))
del args['name']
obj.isolate(**args)
obj.isolate(plot=False, **args)

View File

@@ -61,4 +61,4 @@ class TclCommandJoinExcellon(TclCommand):
FlatCAMExcellon.merge(objs, obj_)
if objs is not None:
self.app.new_object("excellon", outname, initialize)
self.app.new_object("excellon", outname, initialize, plot=False)

View File

@@ -61,4 +61,4 @@ class TclCommandJoinGeometry(TclCommand):
FlatCAMGeometry.merge(objs, obj_)
if objs is not None:
self.app.new_object("geometry", outname, initialize)
self.app.new_object("geometry", outname, initialize, plot=False)

View File

@@ -128,7 +128,7 @@ class TclCommandMillDrills(TclCommandSignaled):
del args['name']
# 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:
success = None
msg = None

View File

@@ -127,7 +127,7 @@ class TclCommandMillSlots(TclCommandSignaled):
del args['name']
# 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:
success = None

View File

@@ -103,6 +103,5 @@ class TclCommandMirror(TclCommandSignaled):
try:
obj.mirror(axis, [dist, dist])
obj.plot()
except Exception as e:
return "Operation failed: %s" % str(e)

View File

@@ -46,4 +46,4 @@ class TclCommandNewGeometry(TclCommandSignaled):
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)

View File

@@ -89,7 +89,7 @@ class TclCommandNregions(TclCommand):
non_copper = bounding_box.difference(geo)
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:
return "Operation failed: %s" % str(e)

View File

@@ -201,7 +201,9 @@ class TclCommandPaint(TclCommand):
outname=outname,
connect=connect,
contour=contour,
tools_storage=paint_tools)
tools_storage=paint_tools,
plot=False,
run_threaded=False)
return
# Paint single polygon in the painted object
@@ -222,7 +224,9 @@ class TclCommandPaint(TclCommand):
outname=outname,
connect=connect,
contour=contour,
tools_storage=paint_tools)
tools_storage=paint_tools,
plot=False,
run_threaded=False)
return
# Paint all polygons found within the box object from the the painted object
@@ -250,7 +254,9 @@ class TclCommandPaint(TclCommand):
outname=outname,
connect=connect,
contour=contour,
tools_storage=paint_tools)
tools_storage=paint_tools,
plot=False,
run_threaded=False)
return
else:

View File

@@ -90,7 +90,7 @@ class TclCommandPanelize(TclCommand):
if 'threaded' in args:
threaded = args['threaded']
else:
threaded = 1
threaded = 0
if 'spacing_columns' in args:
spacing_columns = args['spacing_columns']
@@ -265,10 +265,10 @@ class TclCommandPanelize(TclCommand):
if isinstance(obj, FlatCAMExcellon):
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:
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:
proc = self.app.proc_container.new("Generating panel ... Please wait.")