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");
评论列表
文章目录