[FEM] fix subsequent histogram plot call

fixes #6975
This commit is contained in:
Uwe
2022-06-06 16:56:47 +02:00
parent 4223e5d84d
commit 9156d591c9

View File

@@ -382,11 +382,19 @@ class _TaskPanel:
if len(plt.get_fignums()) > 0:
plt.show()
else:
QtGui.QMessageBox.information(
None,
self.result_obj.Label + " - " + translate("FEM","Information"),
translate("FEM","No histogram available.\nPlease select a result type first.")
)
# if the plot was closed and subsequently the Histogram button was pressed again
# we have valid settings, but must restore the dialog to refill the plot content
# see https://github.com/FreeCAD/FreeCAD/issues/6975
if FreeCAD.FEM_dialog["results_type"] != "None":
self.restore_result_dialog()
if len(plt.get_fignums()) > 0:
plt.show()
else:
QtGui.QMessageBox.information(
None,
self.result_obj.Label + " - " + translate("FEM","Information"),
translate("FEM","No histogram available.\nPlease select a result type first.")
)
def user_defined_text(self, equation):
FreeCAD.FEM_dialog["results_type"] = "user"