FEM: ResultMechanical add migration code f0r old result objects
Stats containing (min, avg, max) converted to (min, max) Add Messagebox if histogram requested, but not available
This commit is contained in:
@@ -442,7 +442,13 @@ class _TaskPanelFemResultShow:
|
||||
self.none_selected(True)
|
||||
|
||||
def show_histogram_clicked(self):
|
||||
plt.show()
|
||||
if len(plt.get_fignums()) > 0:
|
||||
plt.show()
|
||||
else:
|
||||
QtGui.QMessageBox.information(None,
|
||||
self.result_obj.Label + " - Information",
|
||||
"No histogram available.\nPlease select a result type first."
|
||||
)
|
||||
|
||||
def user_defined_text(self, equation):
|
||||
FreeCAD.FEM_dialog["results_type"] = "user"
|
||||
|
||||
@@ -286,7 +286,7 @@ class _FemResultMechanical():
|
||||
|
||||
# initialize the Stats with the appropriate count of items
|
||||
# see fill_femresult_stats in femresult/resulttools.py
|
||||
zero_list = 39 * [0]
|
||||
zero_list = 26 * [0]
|
||||
obj.Stats = zero_list
|
||||
|
||||
# standard Feature methods
|
||||
@@ -315,6 +315,14 @@ class _FemResultMechanical():
|
||||
obj.vonMises = obj.StressValues
|
||||
obj.removeProperty("StressValues")
|
||||
|
||||
# migrate old result objects, because property "Stats"
|
||||
# consisting of min, avg, max values was reduced to min, max in commit ???????
|
||||
if len(obj.Stats) == 39:
|
||||
temp = obj.Stats
|
||||
for i in range(12, -1, -1):
|
||||
del temp [3 * i + 1]
|
||||
obj.Stats = temp
|
||||
|
||||
def __getstate__(self):
|
||||
return self.Type
|
||||
|
||||
|
||||
Reference in New Issue
Block a user