FEM: results, initialize Stats with the appropriate lenght on obj. creation

This commit is contained in:
Bernd Hahnebach
2018-11-27 10:52:20 +01:00
committed by Yorik van Havre
parent 16ee138017
commit 5ba7942660
2 changed files with 7 additions and 1 deletions

View File

@@ -408,7 +408,9 @@ def fill_femresult_stats(results):
npress_min, npress_avg, npress_max]
# stat_types = ["U1", "U2", "U3", "Uabs", "Sabs", "MaxPrin", "MidPrin", "MinPrin", "MaxShear", "Peeq", "Temp", "MFlow", "NPress"]
# len(stat_types) == 13*3 == 39
# do not forget to adapt the def get_stats in the following code:
# do not forget to adapt initialization of all Stats items in modules:
# - module femobjects/_FemResultMechanical.py
# do not forget to adapt the def get_stats in:
# - module femresult/resulttools.py
# - module femtest/testccxtools.py
# TODO: all stats stuff should be reimplemented, ma be a dictionary would be far more robust than a list

View File

@@ -62,6 +62,10 @@ class _FemResultMechanical():
obj.addProperty("App::PropertyFloatList", "UserDefined", "NodeData", "User Defined Results", True)
obj.addProperty("App::PropertyFloatList", "Temperature", "NodeData", "Temperature field", True)
# initialize the Stats with the appropriate count of items (see fill_femresult_stats in feminout/importToolsFem.py)
zero_list = 39 * [0]
obj.Stats = zero_list
# standard Feature methods
def execute(self, obj):
""""this method is executed on object creation and whenever the document is recomputed"