Path: Extend Job integrity check to GUI side, issue #6207 [Bug]

This commit adds a simple `_jobIntegrityCheck()` method to verify that a model and tool exists within the Job object, when interacting with the Task Panel.  If either is missing, the appropriate tab is activated in the task window, and the appropriate edit window is opened for the user, with messages printed in the report view window.

Add check for existence of `SetupSheet` property of empty Job object.

These changes improve upon fixes in PR #5008 and related bug fixes.
This commit is contained in:
Russell Johnson
2022-03-12 20:36:41 -06:00
parent aa4ba37a6c
commit e4286139db
2 changed files with 24 additions and 10 deletions

View File

@@ -284,7 +284,7 @@ class ObjectJob:
# ops = FreeCAD.ActiveDocument.addObject(
# "Path::FeatureCompoundPython", "Operations"
# )
ops = FreeCAD.ActiveDocument.addObject("App::DocumentObjectGroup","Operations")
ops = FreeCAD.ActiveDocument.addObject("App::DocumentObjectGroup", "Operations")
if ops.ViewObject:
# ops.ViewObject.Proxy = 0
ops.ViewObject.Visibility = True
@@ -295,14 +295,15 @@ class ObjectJob:
def setupSetupSheet(self, obj):
if not getattr(obj, "SetupSheet", None):
obj.addProperty(
"App::PropertyLink",
"SetupSheet",
"Base",
QT_TRANSLATE_NOOP(
"App::Property", "SetupSheet holding the settings for this job"
),
)
if not hasattr(obj, "SetupSheet"):
obj.addProperty(
"App::PropertyLink",
"SetupSheet",
"Base",
QT_TRANSLATE_NOOP(
"App::Property", "SetupSheet holding the settings for this job"
),
)
obj.SetupSheet = PathSetupSheet.Create()
if obj.SetupSheet.ViewObject:
import PathScripts.PathIconViewProvider
@@ -659,7 +660,7 @@ class ObjectJob:
def execute(self, obj):
if getattr(obj, "Operations", None):
#obj.Path = obj.Operations.Path
# obj.Path = obj.Operations.Path
self.getCycleTime()
def getCycleTime(self):