Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code
This commit is contained in:
commit
bccd10a9ea
|
@ -362,6 +362,8 @@ void ViewProviderFemMesh::updateData(const App::Property* prop)
|
||||||
{
|
{
|
||||||
if (prop->isDerivedFrom(Fem::PropertyFemMesh::getClassTypeId())) {
|
if (prop->isDerivedFrom(Fem::PropertyFemMesh::getClassTypeId())) {
|
||||||
ViewProviderFEMMeshBuilder builder;
|
ViewProviderFEMMeshBuilder builder;
|
||||||
|
resetColorByNodeId();
|
||||||
|
resetDisplacementByNodeId();
|
||||||
builder.createMesh(prop, pcCoords, pcFaces, pcLines,vFaceElementIdx,vNodeElementIdx, ShowInner.getValue());
|
builder.createMesh(prop, pcCoords, pcFaces, pcLines,vFaceElementIdx,vNodeElementIdx, ShowInner.getValue());
|
||||||
}
|
}
|
||||||
Gui::ViewProviderGeometryObject::updateData(prop);
|
Gui::ViewProviderGeometryObject::updateData(prop);
|
||||||
|
|
|
@ -27,6 +27,8 @@ if FreeCAD.GuiUp:
|
||||||
import FreeCADGui,FemGui
|
import FreeCADGui,FemGui
|
||||||
from FreeCAD import Vector
|
from FreeCAD import Vector
|
||||||
from PySide import QtCore, QtGui
|
from PySide import QtCore, QtGui
|
||||||
|
from PyQt4.QtCore import Qt
|
||||||
|
from PyQt4.QtGui import QApplication, QCursor
|
||||||
from pivy import coin
|
from pivy import coin
|
||||||
from FreeCADGui import PySideUic as uic
|
from FreeCADGui import PySideUic as uic
|
||||||
|
|
||||||
|
@ -221,14 +223,35 @@ class _JobControlTaskPanel:
|
||||||
self.form = QtGui.QWidget()
|
self.form = QtGui.QWidget()
|
||||||
self.formUi.setupUi(self.form)
|
self.formUi.setupUi(self.form)
|
||||||
#self.params = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem")
|
#self.params = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem")
|
||||||
|
self.Calculix = QtCore.QProcess()
|
||||||
|
|
||||||
#Connect Signals and Slots
|
#Connect Signals and Slots
|
||||||
QtCore.QObject.connect(self.formUi.toolButton_chooseOutputDir, QtCore.SIGNAL("clicked()"), self.chooseOutputDir)
|
QtCore.QObject.connect(self.formUi.toolButton_chooseOutputDir, QtCore.SIGNAL("clicked()"), self.chooseOutputDir)
|
||||||
QtCore.QObject.connect(self.formUi.pushButton_generate, QtCore.SIGNAL("clicked()"), self.run)
|
QtCore.QObject.connect(self.formUi.pushButton_generate, QtCore.SIGNAL("clicked()"), self.run)
|
||||||
|
|
||||||
|
QtCore.QObject.connect(self.Calculix, QtCore.SIGNAL("started()"), self.calculixStarted)
|
||||||
|
QtCore.QObject.connect(self.Calculix, QtCore.SIGNAL("finished(int)"), self.calculixFinished)
|
||||||
|
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
|
|
||||||
|
def calculixError(self,error):
|
||||||
|
print "Error()",error
|
||||||
|
|
||||||
|
def calculixStarted(self):
|
||||||
|
print "calculixStarted()"
|
||||||
|
print self.Calculix.state()
|
||||||
|
self.formUi.pushButton_generate.setText("Break Calculix")
|
||||||
|
|
||||||
|
|
||||||
|
def calculixFinished(self,exitCode):
|
||||||
|
print "calculixFinished()",exitCode
|
||||||
|
print self.Calculix.state()
|
||||||
|
self.formUi.pushButton_generate.setText("Re-run Calculix")
|
||||||
|
print "Loading results...."
|
||||||
|
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
|
||||||
|
CalculixLib.importFrd('c:/users/jriegel/appdata/local/temp/Pocket_Mesh.frd',FemGui.getActiveAnalysis() )
|
||||||
|
QApplication.restoreOverrideCursor()
|
||||||
|
|
||||||
def getStandardButtons(self):
|
def getStandardButtons(self):
|
||||||
return int(QtGui.QDialogButtonBox.Close)
|
return int(QtGui.QDialogButtonBox.Close)
|
||||||
|
@ -253,6 +276,7 @@ class _JobControlTaskPanel:
|
||||||
self.formUi.lineEdit_outputDir.setText(dirname)
|
self.formUi.lineEdit_outputDir.setText(dirname)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
||||||
dirName = self.formUi.lineEdit_outputDir.text()
|
dirName = self.formUi.lineEdit_outputDir.text()
|
||||||
print 'run() dir:',dirName
|
print 'run() dir:',dirName
|
||||||
|
|
||||||
|
@ -294,6 +318,7 @@ class _JobControlTaskPanel:
|
||||||
QtGui.QMessageBox.critical(None, "Missing prerequisit","No force-constraint nodes defined in the Analysis")
|
QtGui.QMessageBox.critical(None, "Missing prerequisit","No force-constraint nodes defined in the Analysis")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
|
||||||
|
|
||||||
filename = dirName + '/' + MeshObject.Name + '.inp'
|
filename = dirName + '/' + MeshObject.Name + '.inp'
|
||||||
|
|
||||||
|
@ -367,7 +392,11 @@ class _JobControlTaskPanel:
|
||||||
inpfile.write('*END STEP \n')
|
inpfile.write('*END STEP \n')
|
||||||
|
|
||||||
# run Claculix
|
# run Claculix
|
||||||
import subprocess,FreeCADGui
|
self.Calculix.start('C:/Tools/Calculix4Win/c4w/programs/ccx/ccx.exe', ['-i','c:/users/jriegel/appdata/local/temp/Pocket_Mesh'])
|
||||||
|
|
||||||
|
|
||||||
|
QApplication.restoreOverrideCursor()
|
||||||
|
#import subprocess,FreeCADGui
|
||||||
#FreeCADGui.updateGui()
|
#FreeCADGui.updateGui()
|
||||||
#p1 = subprocess.Popen(['C:/Tools/Calculix4Win/c4w/programs/ccx/ccx.exe', '-i','c:/users/jriegel/appdata/local/temp/Pocket_Mesh'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
#p1 = subprocess.Popen(['C:/Tools/Calculix4Win/c4w/programs/ccx/ccx.exe', '-i','c:/users/jriegel/appdata/local/temp/Pocket_Mesh'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
#ret = None
|
#ret = None
|
||||||
|
@ -376,12 +405,12 @@ class _JobControlTaskPanel:
|
||||||
# FreeCADGui.updateGui()
|
# FreeCADGui.updateGui()
|
||||||
# ret = p1.poll()
|
# ret = p1.poll()
|
||||||
|
|
||||||
ret = subprocess.call(['C:/Tools/Calculix4Win/c4w/programs/ccx/ccx.exe', '-i','c:/users/jriegel/appdata/local/temp/Pocket_Mesh'],shell=True)
|
#ret = subprocess.call(['C:/Tools/Calculix4Win/c4w/programs/ccx/ccx.exe', '-i','c:/users/jriegel/appdata/local/temp/Pocket_Mesh'],shell=True)
|
||||||
print "Calculix terminated with code:" , str(ret)
|
#print "Calculix terminated with code:" , str(ret)
|
||||||
print "Read Result:"
|
#print "Read Result:"
|
||||||
#FreeCADGui.updateGui()
|
#FreeCADGui.updateGui()
|
||||||
|
|
||||||
CalculixLib.importFrd('c:/users/jriegel/appdata/local/temp/Pocket_Mesh.frd',FemGui.getActiveAnalysis() )
|
#CalculixLib.importFrd('c:/users/jriegel/appdata/local/temp/Pocket_Mesh.frd',FemGui.getActiveAnalysis() )
|
||||||
|
|
||||||
class _ResultControlTaskPanel:
|
class _ResultControlTaskPanel:
|
||||||
'''The control for the displacement post-processing'''
|
'''The control for the displacement post-processing'''
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pushButton_generate">
|
<widget class="QPushButton" name="pushButton_generate">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Run</string>
|
<string>Run Calculix</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user