mirror of
https://github.com/arcan1s/moldyn.git
synced 2025-07-03 00:55:48 +00:00
Deleted start_events from friend class
This commit is contained in:
@ -3,7 +3,6 @@
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
#include "errorwindow.h"
|
||||
#include "statgengraphwindow.h"
|
||||
|
||||
#include "start_events.h"
|
||||
|
||||
@ -13,7 +12,7 @@ Start_events::Start_events(MainWindow *wid) :
|
||||
|
||||
}
|
||||
|
||||
void Start_events::start_trj(QString mm_trj_path,
|
||||
bool Start_events::start_trj(QString mm_trj_path,
|
||||
QString workDir,
|
||||
QString input,
|
||||
QString type,
|
||||
@ -23,68 +22,45 @@ void Start_events::start_trj(QString mm_trj_path,
|
||||
QString totalTypes,
|
||||
QString log)
|
||||
{
|
||||
errorwin = new ErrorWindow(parent);
|
||||
parent->ui->statusBar->showMessage(QApplication::translate("Start_events", "Processing 'trj'..."));
|
||||
parent->ui->statusBar->showMessage(QApplication::translate("Start_events", "Processing 'trj'..."));
|
||||
|
||||
// read variables
|
||||
QString workDir = parent->ui->trj_lineEdit_workDir->text();
|
||||
QString input = parent->ui->trj_lineEdit_input->text();
|
||||
QString type;
|
||||
switch (parent->ui->trj_comboBox_type->currentIndex())
|
||||
{
|
||||
case 0:
|
||||
type = QString("gmx");
|
||||
break;
|
||||
case 1:
|
||||
type = QString("puma");
|
||||
break;
|
||||
}
|
||||
QString steps = QString::number(parent->ui->trj_spinBox_steps->value());
|
||||
QString atomType = parent->ui->trj_lineEdit_atoms->text();
|
||||
QString mask = parent->ui->trj_lineEdit_output->text();
|
||||
QString totalTypes = QString::number(parent->ui->trj_spinBox_totalTypes->value());
|
||||
QString log;
|
||||
if (parent->ui->trj_checkBox_log->checkState() == 2)
|
||||
log = parent->ui->trj_lineEdit_log->text();
|
||||
|
||||
// error check
|
||||
errorwin = new ErrorWindow(parent);
|
||||
if ((workDir == "") || (!QDir(workDir).exists()))
|
||||
{
|
||||
errorwin->set_message(0);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if ((input == "") || (!QFile(input).exists()))
|
||||
{
|
||||
errorwin->set_message(1);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if ((atomType == "") || (!QFile(atomType).exists()))
|
||||
{
|
||||
errorwin->set_message(3);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (mask == "")
|
||||
{
|
||||
errorwin->set_message(4);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if ((parent->ui->trj_checkBox_log->checkState() == 2) && (log == ""))
|
||||
if ((log != QString("#")) && (log == ""))
|
||||
{
|
||||
errorwin->set_message(6);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (!QFile(mm_trj_path).exists())
|
||||
{
|
||||
errorwin->set_message(7);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
delete errorwin;
|
||||
|
||||
// exec
|
||||
QString command;
|
||||
@ -101,7 +77,7 @@ void Start_events::start_trj(QString mm_trj_path,
|
||||
command.append(" -a " + QFileInfo(QDir(workDir), atomType).absoluteFilePath());
|
||||
command.append(" -o " + QFileInfo(QDir(workDir), mask).absoluteFilePath());
|
||||
command.append(" -tt " + totalTypes);
|
||||
if (parent->ui->trj_checkBox_log->checkState() == 2)
|
||||
if (log != QString("#"))
|
||||
{
|
||||
if (log.contains(QDir::separator()))
|
||||
command.append(" -l " + QFileInfo(log).absoluteFilePath());
|
||||
@ -111,81 +87,60 @@ void Start_events::start_trj(QString mm_trj_path,
|
||||
command.append(" -q");
|
||||
|
||||
system(command.toStdString().c_str());
|
||||
parent->ui->statusBar->showMessage(QApplication::translate("Start_events", "Done"));
|
||||
delete errorwin;
|
||||
return true;
|
||||
}
|
||||
|
||||
void Start_events::start_statgen(QString mm_statgen_path)
|
||||
bool Start_events::start_statgen(QString mm_statgen_path,
|
||||
QString workDir,
|
||||
QString mask,
|
||||
QString firstStep,
|
||||
QString lastStep,
|
||||
QString cellX, QString cellY, QString cellZ,
|
||||
QString atom0, QString atom1, QString atom2, QString atom3,
|
||||
QString inter,
|
||||
QString output,
|
||||
QString depth,
|
||||
QString log)
|
||||
{
|
||||
errorwin = new ErrorWindow(parent);
|
||||
parent->ui->statusBar->showMessage(QApplication::translate("Start_events", "Processing 'statgen'..."));
|
||||
parent->ui->statusBar->showMessage(QApplication::translate("Start_events", "Processing 'statgen'..."));
|
||||
|
||||
// read variables
|
||||
QString workDir = parent->ui->statgen_lineEdit_workDir->text();
|
||||
QString mask = parent->ui->statgen_lineEdit_input->text();
|
||||
QString firstStep = QString::number(parent->ui->statgen_spinBox_stepsFirst->value());
|
||||
QString lastStep = QString::number(parent->ui->statgen_spinBox_stepsLast->value());
|
||||
QString cellX, cellY, cellZ;
|
||||
cellX.setNum(parent->ui->statgen_doubleSpinBox_cellX->value(), 'f', 4);
|
||||
cellY.setNum(parent->ui->statgen_doubleSpinBox_cellY->value(), 'f', 4);
|
||||
cellZ.setNum(parent->ui->statgen_doubleSpinBox_cellZ->value(), 'f', 4);
|
||||
QString atom0 = QString::number(parent->ui->statgen_spinBox_atoms0->value());
|
||||
QString atom1, atom2, atom3;
|
||||
if (parent->ui->statgen_checkBox_atoms1->checkState() == 2)
|
||||
atom1.setNum(parent->ui->statgen_spinBox_atoms1->value());
|
||||
if (parent->ui->statgen_checkBox_atoms2->checkState() == 2)
|
||||
atom2.setNum(parent->ui->statgen_spinBox_atoms2->value());
|
||||
if (parent->ui->statgen_checkBox_atoms3->checkState() == 2)
|
||||
atom3.setNum(parent->ui->statgen_spinBox_atoms3->value());
|
||||
QString inter;
|
||||
for (int i=0; i<parent->ui->statgen_listWidget_int->count(); i++)
|
||||
inter.append(" -r " + parent->ui->statgen_listWidget_int->item(i)->text());
|
||||
QString output = parent->ui->statgen_lineEdit_output->text();
|
||||
QString depth;
|
||||
if (parent->ui->statgen_checkBox_depth->checkState() == 2)
|
||||
depth.setNum(parent->ui->statgen_spinBox_depth->value());
|
||||
QString log;
|
||||
if (parent->ui->statgen_checkBox_log->checkState() == 2)
|
||||
log = parent->ui->statgen_lineEdit_log->text();
|
||||
|
||||
// error check
|
||||
errorwin = new ErrorWindow(parent);
|
||||
if ((workDir == "") || (!QDir(workDir).exists()))
|
||||
{
|
||||
errorwin->set_message(0);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (mask == "")
|
||||
{
|
||||
errorwin->set_message(1);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (parent->ui->statgen_listWidget_int->count() == 0)
|
||||
if (inter == "")
|
||||
{
|
||||
errorwin->set_message(10);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (output == "")
|
||||
{
|
||||
errorwin->set_message(4);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if ((parent->ui->statgen_checkBox_log->checkState() == 2) && (log == ""))
|
||||
if ((log != QString("#")) && (log == ""))
|
||||
{
|
||||
errorwin->set_message(6);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (!QFile(mm_statgen_path).exists())
|
||||
{
|
||||
errorwin->set_message(7);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
delete errorwin;
|
||||
|
||||
// exec
|
||||
QString command;
|
||||
@ -197,20 +152,20 @@ void Start_events::start_statgen(QString mm_statgen_path)
|
||||
command.append(" -s " + firstStep + "," + lastStep);
|
||||
command.append(" -c " + cellX + "," + cellY + "," + cellZ);
|
||||
command.append(" -a " + atom0);
|
||||
if (parent->ui->statgen_checkBox_atoms1->checkState() == 2)
|
||||
if (atom1 != QString("#"))
|
||||
command.append("," + atom1);
|
||||
if (parent->ui->statgen_checkBox_atoms2->checkState() == 2)
|
||||
if (atom2 != QString("#"))
|
||||
command.append("," + atom2);
|
||||
if (parent->ui->statgen_checkBox_atoms3->checkState() == 2)
|
||||
if (atom3 != QString("#"))
|
||||
command.append("," + atom3);
|
||||
command.append(inter);
|
||||
if (output.contains(QDir::separator()))
|
||||
command.append(" -o " + QFileInfo(output).absoluteFilePath());
|
||||
else
|
||||
command.append(" -o " + QFileInfo(QDir(workDir), output).absoluteFilePath());
|
||||
if (parent->ui->statgen_checkBox_depth->checkState() == 2)
|
||||
if (depth != QString("#"))
|
||||
command.append(" -g " + depth);
|
||||
if (parent->ui->statgen_checkBox_log->checkState() == 2)
|
||||
if (log != QString("#"))
|
||||
{
|
||||
if (log.contains(QDir::separator()))
|
||||
command.append(" -l " + QFileInfo(log).absoluteFilePath());
|
||||
@ -220,72 +175,53 @@ void Start_events::start_statgen(QString mm_statgen_path)
|
||||
command.append(" -q");
|
||||
|
||||
system(command.toStdString().c_str());
|
||||
parent->ui->statusBar->showMessage(QApplication::translate("Start_events", "Done"));
|
||||
delete errorwin;
|
||||
if (parent->ui->statgen_checkBox_graph->checkState() == 2)
|
||||
{
|
||||
QString filename = output;
|
||||
if (!filename.contains(QDir::separator()))
|
||||
filename = QFileInfo(QDir(workDir), filename).absoluteFilePath();
|
||||
StatgenGraphWindow *graphwin;
|
||||
graphwin = new StatgenGraphWindow(parent, filename);
|
||||
graphwin->show();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void Start_events::start_envir(QString mm_envir_path)
|
||||
bool Start_events::start_envir(QString mm_envir_path,
|
||||
QString workDir,
|
||||
QString input,
|
||||
QString cellX, QString cellY, QString cellZ,
|
||||
QString output,
|
||||
QString molecule,
|
||||
QString radius,
|
||||
QString log)
|
||||
{
|
||||
errorwin = new ErrorWindow(parent);
|
||||
parent->ui->statusBar->showMessage(QApplication::translate("Start_events", "Processing 'envir'..."));
|
||||
parent->ui->statusBar->showMessage(QApplication::translate("Start_events", "Processing 'envir'..."));
|
||||
|
||||
// read variables
|
||||
QString workDir = parent->ui->envir_lineEdit_workDir->text();
|
||||
QString input = parent->ui->envir_lineEdit_input->text();
|
||||
QString cellX, cellY, cellZ;
|
||||
cellX.setNum(parent->ui->envir_doubleSpinBox_cellX->value(), 'f', 4);
|
||||
cellY.setNum(parent->ui->envir_doubleSpinBox_cellY->value(), 'f', 4);
|
||||
cellZ.setNum(parent->ui->envir_doubleSpinBox_cellZ->value(), 'f', 4);
|
||||
QString output = parent->ui->envir_lineEdit_output->text();
|
||||
QString molecule = QString::number(parent->ui->envir_spinBox_molecule->value());
|
||||
QString radius;
|
||||
radius.setNum(parent->ui->envir_doubleSpinBox_radius->value(), 'f', 4);
|
||||
QString log;
|
||||
if (parent->ui->envir_checkBox_log->checkState() == 2)
|
||||
log = parent->ui->envir_lineEdit_log->text();
|
||||
|
||||
// error check
|
||||
errorwin = new ErrorWindow(parent);
|
||||
if ((workDir == "") || (!QDir(workDir).exists()))
|
||||
{
|
||||
errorwin->set_message(0);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (input == "")
|
||||
{
|
||||
errorwin->set_message(1);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (output == "")
|
||||
{
|
||||
errorwin->set_message(4);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if ((parent->ui->envir_checkBox_log->checkState() == 2) && (log == ""))
|
||||
if ((log != QString("#")) && (log == ""))
|
||||
{
|
||||
errorwin->set_message(6);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (!QFile(mm_envir_path).exists())
|
||||
{
|
||||
errorwin->set_message(7);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
delete errorwin;
|
||||
|
||||
// exec
|
||||
QString command;
|
||||
command.append(mm_envir_path);
|
||||
if (input.contains(QDir::separator()))
|
||||
@ -299,7 +235,7 @@ void Start_events::start_envir(QString mm_envir_path)
|
||||
command.append(" -o " + QFileInfo(QDir(workDir), output).absoluteFilePath());
|
||||
command.append(" -n " + molecule);
|
||||
command.append(" -r " + radius);
|
||||
if (parent->ui->statgen_checkBox_log->checkState() == 2)
|
||||
if (log != QString("#"))
|
||||
{
|
||||
if (log.contains(QDir::separator()))
|
||||
command.append(" -l " + QFileInfo(log).absoluteFilePath());
|
||||
@ -309,89 +245,63 @@ void Start_events::start_envir(QString mm_envir_path)
|
||||
command.append(" -q");
|
||||
|
||||
system(command.toStdString().c_str());
|
||||
parent->ui->statusBar->showMessage(QApplication::translate("Start_events", "Done"));
|
||||
delete errorwin;
|
||||
return true;
|
||||
}
|
||||
|
||||
void Start_events::start_radf(QString mm_radf_path)
|
||||
bool Start_events::start_radf(QString mm_radf_path,
|
||||
QString workDir,
|
||||
QString mask,
|
||||
QString firstStep,
|
||||
QString lastStep,
|
||||
QString cellX, QString cellY, QString cellZ,
|
||||
QString output,
|
||||
QString atom0, QString atom1, QString atom2,
|
||||
QString atom3, QString atom4, QString atom5,
|
||||
QString radMin, QString radMax, QString radStep,
|
||||
QString angMin, QString angMax, QString angStep,
|
||||
QString log, int matrix)
|
||||
{
|
||||
errorwin = new ErrorWindow(parent);
|
||||
parent->ui->statusBar->showMessage(QApplication::translate("Start_events", "Processing 'radf'..."));
|
||||
parent->ui->statusBar->showMessage(QApplication::translate("Start_events", "Processing 'radf'..."));
|
||||
|
||||
// read variables
|
||||
QString workDir = parent->ui->radf_lineEdit_workDir->text();
|
||||
QString mask = parent->ui->radf_lineEdit_input->text();
|
||||
QString firstStep = QString::number(parent->ui->radf_spinBox_stepsFirst->value());
|
||||
QString lastStep = QString::number(parent->ui->radf_spinBox_stepsLast->value());
|
||||
QString cellX, cellY, cellZ;
|
||||
cellX.setNum(parent->ui->radf_doubleSpinBox_cellX->value(), 'f', 4);
|
||||
cellY.setNum(parent->ui->radf_doubleSpinBox_cellY->value(), 'f', 4);
|
||||
cellZ.setNum(parent->ui->radf_doubleSpinBox_cellZ->value(), 'f', 4);
|
||||
QString output = parent->ui->radf_lineEdit_output->text();
|
||||
QString atom0 = QString::number(parent->ui->radf_spinBox_atoms0->value());
|
||||
QString atom3 = QString::number(parent->ui->radf_spinBox_atoms3->value());
|
||||
QString atom1, atom2, atom4, atom5;
|
||||
if (parent->ui->radf_comboBox_atom->currentIndex() == 1)
|
||||
{
|
||||
atom1 = QString::number(parent->ui->radf_spinBox_atoms1->value());
|
||||
atom2 = QString::number(parent->ui->radf_spinBox_atoms1->value());
|
||||
atom4 = QString::number(parent->ui->radf_spinBox_atoms1->value());
|
||||
atom5 = QString::number(parent->ui->radf_spinBox_atoms1->value());
|
||||
}
|
||||
QString radMin, radMax, radStep, angMin, angMax, angStep;
|
||||
radMin.setNum(parent->ui->radf_doubleSpinBox_radMin->value(), 'f', 3);
|
||||
radMax.setNum(parent->ui->radf_doubleSpinBox_radMax->value(), 'f', 3);
|
||||
radStep.setNum(parent->ui->radf_doubleSpinBox_radStep->value(), 'f', 3);
|
||||
if (parent->ui->radf_checkBox_ang->checkState() == 2)
|
||||
{
|
||||
angMin.setNum(parent->ui->radf_doubleSpinBox_angMin->value(), 'f', 2);
|
||||
angMax.setNum(parent->ui->radf_doubleSpinBox_angMax->value(), 'f', 2);
|
||||
angStep.setNum(parent->ui->radf_doubleSpinBox_angStep->value(), 'f', 2);
|
||||
}
|
||||
QString log;
|
||||
if (parent->ui->radf_checkBox_log->checkState() == 2)
|
||||
log = parent->ui->radf_lineEdit_log->text();
|
||||
|
||||
// error check
|
||||
errorwin = new ErrorWindow(parent);
|
||||
if ((workDir == "") || (!QDir(workDir).exists()))
|
||||
{
|
||||
errorwin->set_message(0);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (mask == "")
|
||||
{
|
||||
errorwin->set_message(1);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (output == "")
|
||||
{
|
||||
errorwin->set_message(4);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (parent->ui->radf_comboBox_atom->currentIndex() == 1)
|
||||
if (atom1 != QString("#"))
|
||||
if ((atom0 == atom1) || (atom0 == atom2) || (atom1 == atom2) ||
|
||||
(atom3 == atom4) || (atom3 == atom5) || (atom4 == atom5))
|
||||
{
|
||||
errorwin->set_message(2);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if ((parent->ui->radf_checkBox_log->checkState() == 2) && (log == ""))
|
||||
if ((log != QString("#")) && (log == ""))
|
||||
{
|
||||
errorwin->set_message(6);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (!QFile(mm_radf_path).exists())
|
||||
{
|
||||
errorwin->set_message(7);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
delete errorwin;
|
||||
|
||||
// exec
|
||||
QString command;
|
||||
@ -402,9 +312,9 @@ void Start_events::start_radf(QString mm_radf_path)
|
||||
command.append(" -i " + QFileInfo(QDir(workDir), mask).absoluteFilePath());
|
||||
command.append(" -s " + firstStep + "," + lastStep);
|
||||
command.append(" -c " + cellX + "," + cellY + "," + cellZ);
|
||||
if (parent->ui->radf_comboBox_atom->currentIndex() == 0)
|
||||
if (atom1 == QString("#"))
|
||||
command.append(" -at " + atom0 + "-" + atom3);
|
||||
else if (parent->ui->radf_comboBox_atom->currentIndex() == 1)
|
||||
else
|
||||
command.append(" -at " + atom0 + "," + atom1 + "," + atom2 +
|
||||
"-" + atom3 + "," + atom4 + "," + atom5);
|
||||
if (output.contains(QDir::separator()))
|
||||
@ -413,14 +323,14 @@ void Start_events::start_radf(QString mm_radf_path)
|
||||
command.append(" -o " + QFileInfo(QDir(workDir), output).absoluteFilePath());
|
||||
command.append(" -r " + radMin + "," + radMax);
|
||||
command.append(" -rs " + radStep);
|
||||
if (parent->ui->radf_checkBox_ang->checkState() == 2)
|
||||
if (angStep != QString("#"))
|
||||
{
|
||||
command.append(" -a " + angMin + "," + angMax);
|
||||
command.append(" -as " + angStep);
|
||||
}
|
||||
if (parent->ui->radf_checkBox_matrix->checkState() == 2)
|
||||
if (matrix == 1)
|
||||
command.append(" -m ");
|
||||
if (parent->ui->radf_checkBox_log->checkState() == 2)
|
||||
if (log != QString("#"))
|
||||
{
|
||||
if (log.contains(QDir::separator()))
|
||||
command.append(" -l " + QFileInfo(log).absoluteFilePath());
|
||||
@ -430,91 +340,61 @@ void Start_events::start_radf(QString mm_radf_path)
|
||||
command.append(" -q");
|
||||
|
||||
system(command.toStdString().c_str());
|
||||
parent->ui->statusBar->showMessage(QApplication::translate("Start_events", "Done"));
|
||||
delete errorwin;
|
||||
if (parent->ui->radf_checkBox_graph->checkState() == 2)
|
||||
{
|
||||
QString filename = output;
|
||||
if (!filename.contains(QDir::separator()))
|
||||
filename = QFileInfo(QDir(workDir), filename).absoluteFilePath();
|
||||
StatgenGraphWindow *graphwin;
|
||||
graphwin = new StatgenGraphWindow(parent, filename);
|
||||
graphwin->show();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void Start_events::start_pdb(QString mm_pdb_path)
|
||||
bool Start_events::start_pdb(QString mm_pdb_path,
|
||||
QString workDir,
|
||||
QString input,
|
||||
QString agl,
|
||||
QString cellX, QString cellY, QString cellZ,
|
||||
QString output,
|
||||
QString log)
|
||||
{
|
||||
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
|
||||
errorwin = new ErrorWindow(parent);
|
||||
if ((workDir == "") || (!QDir(workDir).exists()))
|
||||
{
|
||||
errorwin->set_message(0);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (input == "")
|
||||
{
|
||||
errorwin->set_message(1);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if ((parent->ui->pdb_comboBox_mode->currentIndex() == 0) && (agl == ""))
|
||||
if ((agl != QString("#")) && (agl == ""))
|
||||
{
|
||||
errorwin->set_message(1);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (output == "")
|
||||
{
|
||||
errorwin->set_message(4);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if ((parent->ui->pdb_checkBox_log->checkState() == 2) && (log == ""))
|
||||
if ((log != QString("#")) && (log == ""))
|
||||
{
|
||||
errorwin->set_message(6);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (!QFile(mm_pdb_path).exists())
|
||||
{
|
||||
errorwin->set_message(7);
|
||||
errorwin->show();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
delete errorwin;
|
||||
|
||||
// exec
|
||||
QString command;
|
||||
command.append(mm_pdb_path);
|
||||
if (parent->ui->pdb_comboBox_mode->currentIndex() == 0)
|
||||
if (agl != QString("#"))
|
||||
{
|
||||
if (agl.contains(QDir::separator()))
|
||||
command.append(" -a " + QFileInfo(agl).absoluteFilePath());
|
||||
@ -525,13 +405,13 @@ void Start_events::start_pdb(QString mm_pdb_path)
|
||||
command.append(" -i " + QFileInfo(input).absoluteFilePath());
|
||||
else
|
||||
command.append(" -i " + QFileInfo(QDir(workDir), input).absoluteFilePath());
|
||||
if (parent->ui->pdb_comboBox_mode->currentIndex() == 0)
|
||||
if (agl != QString("#"))
|
||||
command.append(" -c " + cellX + "," + cellY + "," + cellZ);
|
||||
if (output.contains(QDir::separator()))
|
||||
command.append(" -o " + QFileInfo(output).absoluteFilePath());
|
||||
else
|
||||
command.append(" -o " + QFileInfo(QDir(workDir), output).absoluteFilePath());
|
||||
if (parent->ui->statgen_checkBox_log->checkState() == 2)
|
||||
if (log != QString("#"))
|
||||
{
|
||||
if (log.contains(QDir::separator()))
|
||||
command.append(" -l " + QFileInfo(log).absoluteFilePath());
|
||||
@ -541,6 +421,5 @@ void Start_events::start_pdb(QString mm_pdb_path)
|
||||
command.append(" -q");
|
||||
|
||||
system(command.toStdString().c_str());
|
||||
parent->ui->statusBar->showMessage(QApplication::translate("Start_events", "Done"));
|
||||
delete errorwin;
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user