GUI.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:alignment_calculator 作者: andersas 项目源码 文件源码
def calculate(self):
        inputs = self.validate_input();
        if (inputs is not False):
            Jmax,Kmax,Mmax = inputs;
            self.setEnabled(False);
            self.update();
            QMessageBox.information(self,'Responsiveness','This user interface will be irresponsive while the calculation is carried out.\n\nSorry about that!');
            try:
                U2dcalc.set_num_threads(multiprocessing.cpu_count());
                U2dcalc.precalculate_matrix_elements(Jmax,Kmax,Mmax);
                self.update_available();
                QMessageBox.information(self,'Success!','Calculation done.');
                self.close();
            except BaseException as e:
                QMessageBox.critical(self,'Failed to calculate matrix elements',str(e));
                self.setEnabled(True);
        else:
            QMessageBox.critical(self,'Validation error',"Invalid input");
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号