Navigation Menu

Skip to content

Commit

Permalink
FEM: Show displacement/stress nicely formatted and with proper units
Browse files Browse the repository at this point in the history
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
  • Loading branch information
PrzemoF authored and wwmayer committed Apr 23, 2015
1 parent bf1ffb6 commit 31a263e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/Mod/Fem/MechanicalAnalysis.py
Expand Up @@ -669,13 +669,18 @@ def typeChanged(self, index):
if self.DisplacementObject:
if selected[0] in ("U1", "U2", "U3", "Uabs"):
(minm, maxm, avg) = self.MeshObject.ViewObject.setNodeColorByResult(self.DisplacementObject, selected[1])
unit = "mm"
if self.StressObject:
if selected[0] in ("Sabs"):
(minm, maxm, avg) = self.MeshObject.ViewObject.setNodeColorByResult(self.StressObject)

self.form.lineEdit_Max.setText(str(maxm))
self.form.lineEdit_Min.setText(str(minm))
self.form.lineEdit_Avg.setText(str(avg))
unit = "MPa"

self.form.lineEdit_Max.setProperty("unit", unit)
self.form.lineEdit_Max.setText("{:.6} {}".format(maxm, unit))
self.form.lineEdit_Min.setProperty("unit", unit)
self.form.lineEdit_Min.setText("{:.6} {}".format(minm, unit))
self.form.lineEdit_Avg.setProperty("unit", unit)
self.form.lineEdit_Avg.setText("{:.6} {}".format(avg, unit))

QtGui.qApp.restoreOverrideCursor()

Expand Down

0 comments on commit 31a263e

Please sign in to comment.