FEM: Migrate older result objects FemResultMechanical due to renaming property "StressValues" to "vonMises"
This commit is contained in:
@@ -141,7 +141,7 @@ class _FemResultMechanical():
|
||||
"App::PropertyFloatList",
|
||||
"vonMises",
|
||||
"NodeData",
|
||||
"",
|
||||
"List of von Mises equivalent stresses",
|
||||
True
|
||||
)
|
||||
obj.addProperty(
|
||||
@@ -301,6 +301,20 @@ class _FemResultMechanical():
|
||||
def onChanged(self, obj, prop):
|
||||
return
|
||||
|
||||
def onDocumentRestored(self, obj):
|
||||
# migrate old result objects, because property "StressValues"
|
||||
# was renamed to "vonMises"
|
||||
if hasattr(obj, "StressValues") == True:
|
||||
obj.addProperty(
|
||||
"App::PropertyFloatList",
|
||||
"vonMises",
|
||||
"NodeData",
|
||||
"List of von Mises equivalent stresses",
|
||||
True
|
||||
)
|
||||
obj.vonMises = obj.StressValues
|
||||
obj.removeProperty("StressValues")
|
||||
|
||||
def __getstate__(self):
|
||||
return self.Type
|
||||
|
||||
|
||||
Reference in New Issue
Block a user