FEM: Replace duplicated code with print_mat_data function
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
This commit is contained in:
parent
8de8b991a5
commit
56bf10afef
|
@ -134,6 +134,15 @@ class _MechanicalMaterialTaskPanel:
|
||||||
|
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
|
def print_mat_data(self, matmap):
|
||||||
|
print 'material data:'
|
||||||
|
if 'General_name' in matmap:
|
||||||
|
print ' Name = ', matmap['General_name']
|
||||||
|
if 'Mechanical_youngsmodulus' in matmap:
|
||||||
|
print ' YM = ', matmap['Mechanical_youngsmodulus']
|
||||||
|
if 'FEM_poissonratio' in matmap:
|
||||||
|
print ' PR = ', matmap['FEM_poissonratio']
|
||||||
|
|
||||||
def transferTo(self):
|
def transferTo(self):
|
||||||
"Transfer from the dialog to the object"
|
"Transfer from the dialog to the object"
|
||||||
|
|
||||||
|
@ -144,13 +153,7 @@ class _MechanicalMaterialTaskPanel:
|
||||||
print self.form.comboBox_MaterialsInDir.currentText()
|
print self.form.comboBox_MaterialsInDir.currentText()
|
||||||
|
|
||||||
self.obj.Material = matmap
|
self.obj.Material = matmap
|
||||||
print 'material data:'
|
self.print_mat_data(matmap)
|
||||||
if 'General_name' in matmap:
|
|
||||||
print ' Name = ', matmap['General_name']
|
|
||||||
if 'Mechanical_youngsmodulus' in matmap:
|
|
||||||
print ' YM = ', matmap['Mechanical_youngsmodulus']
|
|
||||||
if 'FEM_poissonratio' in matmap:
|
|
||||||
print ' PR = ', matmap['FEM_poissonratio']
|
|
||||||
|
|
||||||
def transferFrom(self):
|
def transferFrom(self):
|
||||||
"Transfer from the object to the dialog"
|
"Transfer from the object to the dialog"
|
||||||
|
@ -189,13 +192,7 @@ class _MechanicalMaterialTaskPanel:
|
||||||
def reject(self):
|
def reject(self):
|
||||||
#print 'reject(self)'
|
#print 'reject(self)'
|
||||||
matmap = self.obj.Material
|
matmap = self.obj.Material
|
||||||
print 'material data:'
|
self.print_mat_data(matmap)
|
||||||
if 'General_name' in matmap:
|
|
||||||
print ' Name = ', matmap['General_name']
|
|
||||||
if 'Mechanical_youngsmodulus' in matmap:
|
|
||||||
print ' YM = ', matmap['Mechanical_youngsmodulus']
|
|
||||||
if 'FEM_poissonratio' in matmap:
|
|
||||||
print ' PR = ', matmap['FEM_poissonratio']
|
|
||||||
FreeCADGui.ActiveDocument.resetEdit()
|
FreeCADGui.ActiveDocument.resetEdit()
|
||||||
|
|
||||||
def saveMat(self):
|
def saveMat(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user