Fixed error msg about unsupported stock type.

This commit is contained in:
Markus Lampert
2017-10-08 18:48:05 -07:00
parent 0e1fb178c5
commit fa523e087c
2 changed files with 7 additions and 5 deletions

View File

@@ -152,12 +152,13 @@ class PathWorkbench (Workbench):
if len(FreeCADGui.Selection.getSelection()) == 1:
obj = FreeCADGui.Selection.getSelection()[0]
if obj.isDerivedFrom("Path::Feature"):
self.appendContextMenu("", "Separator")
self.appendContextMenu("", ["Path_Inspect"])
selectedName = obj.Name
if "Job" in selectedName:
self.appendContextMenu("", ["Path_ExportTemplate"])
if "Remote" in selectedName:
self.appendContextMenu("", ["Refresh_Path"])
if "Job" in selectedName:
self.appendContextMenu("", ["Path_ExportTemplate"])
if isinstance (obj.Proxy, PathScripts.PathOp.ObjectOp):
self.appendContextMenu("", ["Path_OperationCopy"])
if obj.isDerivedFrom("Path::Feature"):

View File

@@ -143,12 +143,13 @@ class DlgJobTemplateExport:
self.dialog.postProcessingGroup.setChecked(False)
if job.Stock and not PathJob.isResourceClone(job, 'Stock', 'Stock'):
if hasattr(job.Stock, 'ExtXNeg'):
stockType = PathStock.StockType.FromStock(job.Stock)
if stockType == PathStock.StockType.FromBase:
seHint = translate('PathJob', "Base -/+ %.2f/%.2f %.2f/%.2f %.2f/%.2f") % (job.Stock.ExtXneg, job.Stock.ExtXpos, job.Stock.ExtYneg, job.Stock.ExtYpos, job.Stock.ExtZneg, job.Stock.ExtZpos)
self.dialog.stockPlacement.setChecked(False)
elif hasattr(job.Stock, 'Length') and hasattr(job.Stock, 'Width'):
elif stockType == PathStock.StockType.CreateBox:
seHint = translate('PathJob', "Box: %.2f x %.2f x %.2f") % (job.Stock.Length, job.Stock.Width, job.Stock.Height)
elif hasattr(job.Stock, 'Radius'):
elif stockType == PathStock.StockType.CreateCylinder:
seHint = translate('PathJob', "Cylinder: %.2f x %.2f") % (job.Stock.Radius, job.Stock.Height)
else:
seHint = '-'