[PATH] Fix bug with spindle not restarting

if output is split by operation spindle should restart when next file is loaded
This commit is contained in:
sliptonic
2021-03-12 13:12:09 -06:00
parent db16029c6a
commit c1b471588b
2 changed files with 19 additions and 20 deletions

View File

@@ -296,6 +296,18 @@ class ObjectJob:
obj.addProperty("App::PropertyString", "CycleTime", "Path", QtCore.QT_TRANSLATE_NOOP("PathOp", "Operations Cycle Time Estimation"))
obj.setEditorMode('CycleTime', 1) # read-only
if not hasattr(obj, "Fixtures"):
obj.addProperty("App::PropertyStringList", "Fixtures", "WCS", QtCore.QT_TRANSLATE_NOOP("PathJob", "The Work Coordinate Systems for the Job"))
obj.Fixtures = ['G54']
if not hasattr(obj, "OrderOutputBy"):
obj.addProperty("App::PropertyEnumeration", "OrderOutputBy", "WCS", QtCore.QT_TRANSLATE_NOOP("PathJob", "If multiple WCS, order the output this way"))
obj.OrderOutputBy = ['Fixture', 'Tool', 'Operation']
if not hasattr(obj, "SplitOutput"):
obj.addProperty("App::PropertyBool", "SplitOutput", "Output", QtCore.QT_TRANSLATE_NOOP("PathJob", "Split output into multiple gcode files"))
obj.SplitOutput = False
def onChanged(self, obj, prop):
if prop == "PostProcessor" and obj.PostProcessor:
processor = PostProcessor.load(obj.PostProcessor)

View File

@@ -236,7 +236,7 @@ class CommandPathPost:
elif hasattr(sel, "Path"):
try:
job = PathUtils.findParentJob(sel)
except Exception: # pylint: disable=broad-except
except Exception:
job = None
else:
job = None
@@ -261,22 +261,9 @@ class CommandPathPost:
PathLog.debug("about to postprocess job: {}".format(job.Name))
# Build up an ordered list of operations and tool changes.
# Then post-the ordered list
if hasattr(job, "Fixtures"):
wcslist = job.Fixtures
else:
wcslist = ['G54']
if hasattr(job, "OrderOutputBy"):
orderby = job.OrderOutputBy
else:
orderby = "Operation"
if hasattr(job, "SplitOutput"):
split = job.SplitOutput
else:
split = False
wcslist = job.Fixtures
orderby = job.OrderOutputBy
split = job.SplitOutput
postlist = []
@@ -332,7 +319,7 @@ class CommandPathPost:
for idx, obj in enumerate(job.Operations.Group):
# check if the operation is active
active = PathUtil.opProperty(obj, 'Active')
active = PathUtil.opProperty(obj, 'Active')
tc = PathUtil.toolControllerForOp(obj)
if tc is None or tc.ToolNumber == currTool and active:
@@ -380,14 +367,14 @@ class CommandPathPost:
firstFixture = False
tc = PathUtil.toolControllerForOp(obj)
if tc is not None:
if tc.ToolNumber != currTool:
if job.SplitOutput or (tc.ToolNumber != currTool):
sublist.append(tc)
currTool = tc.ToolNumber
sublist.append(obj)
postlist.append(sublist)
fail = True
rc = '' # pylint: disable=unused-variable
rc = ''
if split:
for slist in postlist:
(fail, rc, filename) = self.exportObjectsWith(slist, job)