本文整理汇总了Python中FemTools.FemTools.check_prerequisites方法的典型用法代码示例。如果您正苦于以下问题:Python FemTools.check_prerequisites方法的具体用法?Python FemTools.check_prerequisites怎么用?Python FemTools.check_prerequisites使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FemTools.FemTools
的用法示例。
在下文中一共展示了FemTools.check_prerequisites方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GetResources
# 需要导入模块: from FemTools import FemTools [as 别名]
# 或者: from FemTools.FemTools import check_prerequisites [as 别名]
class _CommandFrequencyAnalysis:
def GetResources(self):
return {'Pixmap': 'fem-frequency-analysis',
'MenuText': QtCore.QT_TRANSLATE_NOOP("Fem_Frequency_Analysis", "Run frequency analysis with CalculiX ccx"),
'Accel': "R, F",
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Fem_Frequency_Analysis", "Write .inp file and run frequency analysis with CalculiX ccx")}
def Activated(self):
def load_results(ret_code):
if ret_code == 0:
self.fea.load_results()
else:
print "CalculiX failed ccx finished with error {}".format(ret_code)
self.fea = FemTools()
self.fea.reset_all()
self.fea.set_analysis_type('frequency')
message = self.fea.check_prerequisites()
if message:
QtGui.QMessageBox.critical(None, "Missing prerequisite", message)
return
self.fea.finished.connect(load_results)
QtCore.QThreadPool.globalInstance().start(self.fea)
def IsActive(self):
return FreeCADGui.ActiveDocument is not None and FemGui.getActiveAnalysis() is not None
示例2: GetResources
# 需要导入模块: from FemTools import FemTools [as 别名]
# 或者: from FemTools.FemTools import check_prerequisites [as 别名]
class _CommandQuickAnalysis:
def GetResources(self):
return {'Pixmap': 'fem-quick-analysis',
'MenuText': QtCore.QT_TRANSLATE_NOOP("Fem_Quick_Analysis", "Run CalculiX ccx"),
'Accel': "R, C",
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Fem_Quick_Analysis", "Write .inp file and run CalculiX ccx")}
def Activated(self):
def load_results(ret_code):
if ret_code == 0:
self.fea.load_results()
self.show_results_on_mesh()
else:
print "CalculiX failed ccx finished with error {}".format(ret_code)
self.fea = FemTools()
self.fea.reset_all()
message = self.fea.check_prerequisites()
if message:
QtGui.QMessageBox.critical(None, "Missing prerequisite", message)
return
self.fea.finished.connect(load_results)
QtCore.QThreadPool.globalInstance().start(self.fea)
def show_results_on_mesh(self):
#FIXME proprer mesh refreshing as per FreeCAD.FEM_dialog settings required
# or confirmation that it's safe to call restore_result_dialog
tp = _ResultControlTaskPanel()
tp.restore_result_dialog()
def IsActive(self):
return FreeCADGui.ActiveDocument is not None and FemGui.getActiveAnalysis() is not None
示例3: _CommandQuickAnalysis
# 需要导入模块: from FemTools import FemTools [as 别名]
# 或者: from FemTools.FemTools import check_prerequisites [as 别名]
class _CommandQuickAnalysis(FemCommands):
def __init__(self):
super(_CommandQuickAnalysis, self).__init__()
self.resources = {'Pixmap': 'fem-quick-analysis',
'MenuText': QtCore.QT_TRANSLATE_NOOP("Fem_Quick_Analysis", "Run CalculiX ccx"),
'Accel': "R, C",
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Fem_Quick_Analysis", "Write .inp file and run CalculiX ccx")}
self.is_active = 'with_solver'
def Activated(self):
def load_results(ret_code):
if ret_code == 0:
self.fea.load_results()
self.show_results_on_mesh()
self.hide_parts_constraints_show_meshes()
else:
print ("CalculiX failed ccx finished with error {}".format(ret_code))
self.fea = FemTools()
self.fea.reset_all()
message = self.fea.check_prerequisites()
if message:
QtGui.QMessageBox.critical(None, "Missing prerequisite", message)
return
self.fea.finished.connect(load_results)
QtCore.QThreadPool.globalInstance().start(self.fea)
def show_results_on_mesh(self):
#FIXME proprer mesh refreshing as per FreeCAD.FEM_dialog settings required
# or confirmation that it's safe to call restore_result_dialog
import _TaskPanelResultControl
tp = _TaskPanelResultControl._TaskPanelResultControl()
tp.restore_result_dialog()
示例4: check_prerequisites_helper
# 需要导入模块: from FemTools import FemTools [as 别名]
# 或者: from FemTools.FemTools import check_prerequisites [as 别名]
def check_prerequisites_helper(self):
self.Start = time.time()
self.femConsoleMessage("Check dependencies...")
self.form.label_Time.setText('Time: {0:4.1f}: '.format(time.time() - self.Start))
fea = FemTools()
fea.update_objects()
message = fea.check_prerequisites()
if message != "":
QtGui.QMessageBox.critical(None, "Missing prerequisit(s)", message)
return False
return True