当前位置: 首页>>代码示例>>Python>>正文


Python FemTools.reset_all方法代码示例

本文整理汇总了Python中FemTools.FemTools.reset_all方法的典型用法代码示例。如果您正苦于以下问题:Python FemTools.reset_all方法的具体用法?Python FemTools.reset_all怎么用?Python FemTools.reset_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FemTools.FemTools的用法示例。


在下文中一共展示了FemTools.reset_all方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: calculixFinished

# 需要导入模块: from FemTools import FemTools [as 别名]
# 或者: from FemTools.FemTools import reset_all [as 别名]
    def calculixFinished(self, exitCode):
        print "calculixFinished()", exitCode
        print self.Calculix.state()

        # Restore previous cwd
        QtCore.QDir.setCurrent(self.cwd)

        self.printCalculiXstdout()
        self.Timer.stop()

        self.femConsoleMessage("Calculix done!", "#00AA00")

        self.form.pushButton_generate.setText("Re-run Calculix")
        print "Loading results...."
        self.femConsoleMessage("Loading result sets...")
        self.form.label_Time.setText('Time: {0:4.1f}: '.format(time.time() - self.Start))
        fea = FemTools()
        fea.reset_all()
        frd_result_file = os.path.splitext(self.inp_file_name)[0] + '.frd'
        if os.path.isfile(frd_result_file):
            QApplication.setOverrideCursor(Qt.WaitCursor)
            ccxFrdReader.importFrd(frd_result_file, FemGui.getActiveAnalysis())
            QApplication.restoreOverrideCursor()
            self.femConsoleMessage("Loading results done!", "#00AA00")
        else:
            self.femConsoleMessage("Loading results failed! Results file doesn\'t exist", "#FF0000")
        self.form.label_Time.setText('Time: {0:4.1f}: '.format(time.time() - self.Start))
开发者ID:minglingge,项目名称:FreeCAD,代码行数:29,代码来源:MechanicalAnalysis.py

示例2: GetResources

# 需要导入模块: from FemTools import FemTools [as 别名]
# 或者: from FemTools.FemTools import reset_all [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
开发者ID:zhouyunpeng,项目名称:FreeCAD,代码行数:28,代码来源:_CommandFrequencyAnalysis.py

示例3: GetResources

# 需要导入模块: from FemTools import FemTools [as 别名]
# 或者: from FemTools.FemTools import reset_all [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
开发者ID:minglingge,项目名称:FreeCAD,代码行数:34,代码来源:MechanicalAnalysis.py

示例4: _CommandQuickAnalysis

# 需要导入模块: from FemTools import FemTools [as 别名]
# 或者: from FemTools.FemTools import reset_all [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()
开发者ID:AllenBootung,项目名称:FreeCAD,代码行数:36,代码来源:_CommandQuickAnalysis.py

示例5: calculixFinished

# 需要导入模块: from FemTools import FemTools [as 别名]
# 或者: from FemTools.FemTools import reset_all [as 别名]
    def calculixFinished(self, exitCode):
        print ("calculixFinished() {}".format(exitCode))
        print (self.Calculix.state())

        # Restore previous cwd
        QtCore.QDir.setCurrent(self.cwd)

        self.printCalculiXstdout()
        self.Timer.stop()

        self.femConsoleMessage("CalculiX done!", "#00AA00")

        self.form.pb_run_ccx.setText("Re-run CalculiX")
        self.femConsoleMessage("Loading result sets...")
        self.form.l_time.setText('Time: {0:4.1f}: '.format(time.time() - self.Start))
        fea = FemTools()
        fea.reset_all()
        fea.inp_file_name = self.inp_file_name
        QApplication.setOverrideCursor(Qt.WaitCursor)
        fea.load_results()
        QApplication.restoreOverrideCursor()
        self.form.l_time.setText('Time: {0:4.1f}: '.format(time.time() - self.Start))
开发者ID:AllenBootung,项目名称:FreeCAD,代码行数:24,代码来源:_TaskPanelFemSolverCalculix.py

示例6: Activated

# 需要导入模块: from FemTools import FemTools [as 别名]
# 或者: from FemTools.FemTools import reset_all [as 别名]
 def Activated(self):
     fea = FemTools()
     fea.reset_all()
开发者ID:minglingge,项目名称:FreeCAD,代码行数:5,代码来源:MechanicalAnalysis.py

示例7: Activated

# 需要导入模块: from FemTools import FemTools [as 别名]
# 或者: from FemTools.FemTools import reset_all [as 别名]
    def Activated(self):
        fea = FemTools()
        fea.reset_all()

        self.hide_meshes_show_parts_constraints()
开发者ID:AllenBootung,项目名称:FreeCAD,代码行数:7,代码来源:_CommandPurgeFemResults.py


注:本文中的FemTools.FemTools.reset_all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。