mirror of
https://github.com/arcan1s/moldyn.git
synced 2025-07-13 13:55:52 +00:00
Edited start_events
This commit is contained in:
@ -254,7 +254,7 @@ void Start_events::start_statgen(QString mm_statgen_path)
|
||||
delete errorwin;
|
||||
}
|
||||
|
||||
void Start_events::stat_envir(QString mm_envir_path)
|
||||
void Start_events::start_envir(QString mm_envir_path)
|
||||
{
|
||||
errorwin = new ErrorWindow(parent);
|
||||
parent->ui->statusBar->showMessage(QApplication::translate("Start_events", "Processing 'envir'..."));
|
||||
@ -352,7 +352,7 @@ void Start_events::stat_envir(QString mm_envir_path)
|
||||
delete errorwin;
|
||||
}
|
||||
|
||||
void Start_events::stat_radf(QString mm_radf_path)
|
||||
void Start_events::start_radf(QString mm_radf_path)
|
||||
{
|
||||
errorwin = new ErrorWindow(parent);
|
||||
parent->ui->statusBar->showMessage(QApplication::translate("Start_events", "Processing 'radf'..."));
|
||||
@ -484,8 +484,131 @@ void Start_events::stat_radf(QString mm_radf_path)
|
||||
command.append(" -l " + QFileInfo(QDir(workDir), log).absoluteFilePath());
|
||||
command.append(" -q");
|
||||
|
||||
// system(command.toStdString().c_str());
|
||||
printf("%s\n", command.toStdString().c_str());
|
||||
system(command.toStdString().c_str());
|
||||
parent->ui->tabWidget->setEnabled(true);
|
||||
parent->ui->statusBar->showMessage(QApplication::translate("Start_events", "Done"));
|
||||
delete errorwin;
|
||||
}
|
||||
|
||||
void Start_events::start_pdb(QString mm_pdb_path)
|
||||
{
|
||||
errorwin = new ErrorWindow(parent);
|
||||
if (parent->ui->pdb_comboBox_mode->currentIndex() == 0)
|
||||
{
|
||||
parent->ui->statusBar->showMessage(QApplication::translate("Start_events", "Processing 'agl'..."));
|
||||
parent->ui->statusBar->showMessage(QApplication::translate("Start_events", "Processing 'agl'..."));
|
||||
}
|
||||
else if (parent->ui->pdb_comboBox_mode->currentIndex() == 1)
|
||||
{
|
||||
parent->ui->statusBar->showMessage(QApplication::translate("Start_events", "Processing 'trj2pdb'..."));
|
||||
parent->ui->statusBar->showMessage(QApplication::translate("Start_events", "Processing 'trj2pdb'..."));
|
||||
}
|
||||
|
||||
// read variables
|
||||
QString workDir = parent->ui->pdb_lineEdit_workDir->text();
|
||||
QString input = parent->ui->pdb_lineEdit_input->text();
|
||||
QString agl, cellX, cellY, cellZ;
|
||||
if (parent->ui->pdb_comboBox_mode->currentIndex() == 0)
|
||||
{
|
||||
agl = parent->ui->pdb_lineEdit_agl->text();
|
||||
cellX.setNum(parent->ui->pdb_doubleSpinBox_cellX->value(), 'f', 4);
|
||||
cellY.setNum(parent->ui->pdb_doubleSpinBox_cellY->value(), 'f', 4);
|
||||
cellZ.setNum(parent->ui->pdb_doubleSpinBox_cellZ->value(), 'f', 4);
|
||||
}
|
||||
QString output = parent->ui->pdb_lineEdit_output->text();
|
||||
QString log;
|
||||
if (parent->ui->pdb_checkBox_log->checkState() == 2)
|
||||
log = parent->ui->pdb_lineEdit_log->text();
|
||||
|
||||
// error check
|
||||
if ((workDir == "") || (!QDir(workDir).exists()))
|
||||
{
|
||||
errorwin->set_message(0);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
if (input == "")
|
||||
{
|
||||
errorwin->set_message(1);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
if ((parent->ui->pdb_comboBox_mode->currentIndex() == 0) && (agl == ""))
|
||||
{
|
||||
errorwin->set_message(1);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
if (output == "")
|
||||
{
|
||||
errorwin->set_message(4);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
if ((parent->ui->pdb_checkBox_log->checkState() == 2) && (log == ""))
|
||||
{
|
||||
errorwin->set_message(6);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
if (!QFile(mm_pdb_path).exists())
|
||||
{
|
||||
errorwin->set_message(7);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
|
||||
// exec
|
||||
parent->ui->tabWidget->setDisabled(true);
|
||||
QString command;
|
||||
command.append(mm_pdb_path);
|
||||
if (parent->ui->pdb_comboBox_mode->currentIndex() == 0)
|
||||
#ifdef _WIN32
|
||||
if (agl.contains("\\"))
|
||||
#elif __linux
|
||||
if (agl.contains("/"))
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
command.append(" -a " + QFileInfo(agl).absoluteFilePath());
|
||||
else
|
||||
command.append(" -a " + QFileInfo(QDir(workDir), agl).absoluteFilePath());
|
||||
#ifdef _WIN32
|
||||
if (input.contains("\\"))
|
||||
#elif __linux
|
||||
if (input.contains("/"))
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
command.append(" -i " + QFileInfo(input).absoluteFilePath());
|
||||
else
|
||||
command.append(" -i " + QFileInfo(QDir(workDir), input).absoluteFilePath());
|
||||
if (parent->ui->pdb_comboBox_mode->currentIndex() == 0)
|
||||
command.append(" -c " + cellX + "," + cellY + "," + cellZ);
|
||||
#ifdef _WIN32
|
||||
if (output.contains("\\"))
|
||||
#elif __linux
|
||||
if (output.contains("/"))
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
command.append(" -o " + QFileInfo(output).absoluteFilePath());
|
||||
else
|
||||
command.append(" -o " + QFileInfo(QDir(workDir), output).absoluteFilePath());
|
||||
#ifdef _WIN32
|
||||
if (log.contains("\\"))
|
||||
#elif __linux
|
||||
if (log.contains("/"))
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
command.append(" -l " + QFileInfo(log).absoluteFilePath());
|
||||
else
|
||||
command.append(" -l " + QFileInfo(QDir(workDir), log).absoluteFilePath());
|
||||
command.append(" -q");
|
||||
|
||||
// system(command.toStdString().c_str());
|
||||
printf ("%s\n", command.toStdString().c_str());
|
||||
parent->ui->tabWidget->setEnabled(true);
|
||||
parent->ui->statusBar->showMessage(QApplication::translate("Start_events", "Done"));
|
||||
delete errorwin;
|
||||
|
Reference in New Issue
Block a user