FEM: results, initialize Stats with the appropriate lenght on obj. creation
This commit is contained in:
committed by
Yorik van Havre
parent
16ee138017
commit
5ba7942660
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user