mirror of
https://github.com/arcan1s/moldyn.git
synced 2025-06-28 06:41:42 +00:00
Deleted start_events from friend class
This commit is contained in:
@ -8,6 +8,7 @@
|
||||
#include "settingswindow.h"
|
||||
#include "clear_items.h"
|
||||
#include "start_events.h"
|
||||
#include "statgengraphwindow.h"
|
||||
#include "update_fields.h"
|
||||
|
||||
#include "mainwindow.h"
|
||||
@ -17,7 +18,6 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::MainWindow),
|
||||
clear_items(new Clear_items(this)),
|
||||
start_events(new Start_events(this)),
|
||||
update_fields(new Update_fields(this))
|
||||
{
|
||||
ui->setupUi(this);
|
||||
@ -578,10 +578,10 @@ void MainWindow::on_stagen_pushButton_intRem_clicked()
|
||||
// start signals
|
||||
void MainWindow::on_trj_pushButton_start_clicked()
|
||||
{
|
||||
QString workDir = parent->ui->trj_lineEdit_workDir->text();
|
||||
QString input = parent->ui->trj_lineEdit_input->text();
|
||||
QString workDir = ui->trj_lineEdit_workDir->text();
|
||||
QString input = ui->trj_lineEdit_input->text();
|
||||
QString type;
|
||||
switch (parent->ui->trj_comboBox_type->currentIndex())
|
||||
switch (ui->trj_comboBox_type->currentIndex())
|
||||
{
|
||||
case 0:
|
||||
type = QString("gmx");
|
||||
@ -590,59 +590,259 @@ void MainWindow::on_trj_pushButton_start_clicked()
|
||||
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 steps = QString::number(ui->trj_spinBox_steps->value());
|
||||
QString atomType = ui->trj_lineEdit_atoms->text();
|
||||
QString mask = ui->trj_lineEdit_output->text();
|
||||
QString totalTypes = QString::number(ui->trj_spinBox_totalTypes->value());
|
||||
QString log;
|
||||
if (parent->ui->trj_checkBox_log->checkState() == 2)
|
||||
log = parent->ui->trj_lineEdit_log->text();
|
||||
if (ui->trj_checkBox_log->checkState() == 2)
|
||||
log = ui->trj_lineEdit_log->text();
|
||||
else
|
||||
log = QString("#");
|
||||
|
||||
ui->centralWidget->setDisabled(true);
|
||||
Start_events *start_events;
|
||||
start_events = new Start_events;
|
||||
start_events->start_trj(mm_trj_path,
|
||||
workDir,
|
||||
input,
|
||||
type,
|
||||
steps,
|
||||
atomType,
|
||||
mask,
|
||||
totalTypes,
|
||||
log);
|
||||
delete start_events
|
||||
ui->centralWidget->setEnabled(true);
|
||||
ui->tabWidget->setDisabled(true);
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Processing 'trj'..."));
|
||||
start_events = new Start_events(this);
|
||||
bool check = start_events->start_trj(mm_trj_path,
|
||||
workDir,
|
||||
input,
|
||||
type,
|
||||
steps,
|
||||
atomType,
|
||||
mask,
|
||||
totalTypes,
|
||||
log);
|
||||
delete start_events;
|
||||
ui->tabWidget->setEnabled(true);
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Done"));
|
||||
}
|
||||
|
||||
void MainWindow::on_statgen_pushButton_start_clicked()
|
||||
{
|
||||
ui->centralWidget->setDisabled(true);
|
||||
start_events->start_statgen(mm_statgen_path);
|
||||
ui->centralWidget->setEnabled(true);
|
||||
QString workDir = ui->statgen_lineEdit_workDir->text();
|
||||
QString mask = ui->statgen_lineEdit_input->text();
|
||||
QString firstStep = QString::number(ui->statgen_spinBox_stepsFirst->value());
|
||||
QString lastStep = QString::number(ui->statgen_spinBox_stepsLast->value());
|
||||
QString cellX, cellY, cellZ;
|
||||
cellX.setNum(ui->statgen_doubleSpinBox_cellX->value(), 'f', 4);
|
||||
cellY.setNum(ui->statgen_doubleSpinBox_cellY->value(), 'f', 4);
|
||||
cellZ.setNum(ui->statgen_doubleSpinBox_cellZ->value(), 'f', 4);
|
||||
QString atom0 = QString::number(ui->statgen_spinBox_atoms0->value());
|
||||
QString atom1, atom2, atom3;
|
||||
if (ui->statgen_checkBox_atoms1->checkState() == 2)
|
||||
atom1.setNum(ui->statgen_spinBox_atoms1->value());
|
||||
else
|
||||
atom1 = QString("#");
|
||||
if (ui->statgen_checkBox_atoms2->checkState() == 2)
|
||||
atom2.setNum(ui->statgen_spinBox_atoms2->value());
|
||||
else
|
||||
atom2 = QString("#");
|
||||
if (ui->statgen_checkBox_atoms3->checkState() == 2)
|
||||
atom3.setNum(ui->statgen_spinBox_atoms3->value());
|
||||
else
|
||||
atom3 = QString("#");
|
||||
QString inter;
|
||||
inter = QString("");
|
||||
for (int i=0; i<ui->statgen_listWidget_int->count(); i++)
|
||||
inter.append(" -r " + ui->statgen_listWidget_int->item(i)->text());
|
||||
QString output = ui->statgen_lineEdit_output->text();
|
||||
QString depth;
|
||||
if (ui->statgen_checkBox_depth->checkState() == 2)
|
||||
depth.setNum(ui->statgen_spinBox_depth->value());
|
||||
else
|
||||
depth = QString("#");
|
||||
QString log;
|
||||
if (ui->statgen_checkBox_log->checkState() == 2)
|
||||
log = ui->statgen_lineEdit_log->text();
|
||||
else
|
||||
log = QString("#");
|
||||
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Processing 'statgen'..."));
|
||||
ui->tabWidget->setDisabled(true);
|
||||
start_events = new Start_events(this);
|
||||
bool check = start_events->start_statgen(mm_statgen_path,
|
||||
workDir,
|
||||
mask,
|
||||
firstStep,
|
||||
lastStep,
|
||||
cellX, cellY, cellZ,
|
||||
atom0, atom1, atom2, atom3,
|
||||
inter,
|
||||
output,
|
||||
depth,
|
||||
log);
|
||||
delete start_events;
|
||||
ui->tabWidget->setEnabled(true);
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Done"));
|
||||
|
||||
if ((ui->statgen_checkBox_graph->checkState() == 2) && (check == true))
|
||||
{
|
||||
QString filename = output;
|
||||
if (!filename.contains(QDir::separator()))
|
||||
filename = QFileInfo(QDir(workDir), filename).absoluteFilePath();
|
||||
StatgenGraphWindow *graphwin;
|
||||
graphwin = new StatgenGraphWindow(this, filename);
|
||||
graphwin->show();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_envir_pushButton_start_clicked()
|
||||
{
|
||||
ui->centralWidget->setDisabled(true);
|
||||
start_events->start_envir(mm_envir_path);
|
||||
ui->centralWidget->setEnabled(true);
|
||||
QString workDir = ui->envir_lineEdit_workDir->text();
|
||||
QString input = ui->envir_lineEdit_input->text();
|
||||
QString cellX, cellY, cellZ;
|
||||
cellX.setNum(ui->envir_doubleSpinBox_cellX->value(), 'f', 4);
|
||||
cellY.setNum(ui->envir_doubleSpinBox_cellY->value(), 'f', 4);
|
||||
cellZ.setNum(ui->envir_doubleSpinBox_cellZ->value(), 'f', 4);
|
||||
QString output = ui->envir_lineEdit_output->text();
|
||||
QString molecule = QString::number(ui->envir_spinBox_molecule->value());
|
||||
QString radius;
|
||||
radius.setNum(ui->envir_doubleSpinBox_radius->value(), 'f', 4);
|
||||
QString log;
|
||||
if (ui->envir_checkBox_log->checkState() == 2)
|
||||
log = ui->envir_lineEdit_log->text();
|
||||
else
|
||||
log = QString("#");
|
||||
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Processing 'envir'..."));
|
||||
ui->tabWidget->setDisabled(true);
|
||||
start_events = new Start_events(this);
|
||||
bool check = start_events->start_envir(mm_envir_path,
|
||||
workDir,
|
||||
input,
|
||||
cellX, cellY, cellZ,
|
||||
output,
|
||||
molecule,
|
||||
radius,
|
||||
log);
|
||||
delete start_events;
|
||||
ui->tabWidget->setEnabled(true);
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Done"));
|
||||
}
|
||||
|
||||
void MainWindow::on_radf_pushButton_start_clicked()
|
||||
{
|
||||
ui->centralWidget->setDisabled(true);
|
||||
start_events->start_radf(mm_radf_path);
|
||||
ui->centralWidget->setEnabled(true);
|
||||
QString workDir = ui->radf_lineEdit_workDir->text();
|
||||
QString mask = ui->radf_lineEdit_input->text();
|
||||
QString firstStep = QString::number(ui->radf_spinBox_stepsFirst->value());
|
||||
QString lastStep = QString::number(ui->radf_spinBox_stepsLast->value());
|
||||
QString cellX, cellY, cellZ;
|
||||
cellX.setNum(ui->radf_doubleSpinBox_cellX->value(), 'f', 4);
|
||||
cellY.setNum(ui->radf_doubleSpinBox_cellY->value(), 'f', 4);
|
||||
cellZ.setNum(ui->radf_doubleSpinBox_cellZ->value(), 'f', 4);
|
||||
QString output = ui->radf_lineEdit_output->text();
|
||||
QString atom0 = QString::number(ui->radf_spinBox_atoms0->value());
|
||||
QString atom3 = QString::number(ui->radf_spinBox_atoms3->value());
|
||||
QString atom1, atom2, atom4, atom5;
|
||||
if (ui->radf_comboBox_atom->currentIndex() == 1)
|
||||
{
|
||||
atom1 = QString::number(ui->radf_spinBox_atoms1->value());
|
||||
atom2 = QString::number(ui->radf_spinBox_atoms1->value());
|
||||
atom4 = QString::number(ui->radf_spinBox_atoms1->value());
|
||||
atom5 = QString::number(ui->radf_spinBox_atoms1->value());
|
||||
}
|
||||
else
|
||||
atom1 = QString("#");
|
||||
QString radMin, radMax, radStep, angMin, angMax, angStep;
|
||||
radMin.setNum(ui->radf_doubleSpinBox_radMin->value(), 'f', 3);
|
||||
radMax.setNum(ui->radf_doubleSpinBox_radMax->value(), 'f', 3);
|
||||
radStep.setNum(ui->radf_doubleSpinBox_radStep->value(), 'f', 3);
|
||||
if (ui->radf_checkBox_ang->checkState() == 2)
|
||||
{
|
||||
angMin.setNum(ui->radf_doubleSpinBox_angMin->value(), 'f', 2);
|
||||
angMax.setNum(ui->radf_doubleSpinBox_angMax->value(), 'f', 2);
|
||||
angStep.setNum(ui->radf_doubleSpinBox_angStep->value(), 'f', 2);
|
||||
}
|
||||
else
|
||||
angStep = QString("#");
|
||||
QString log;
|
||||
if (ui->radf_checkBox_log->checkState() == 2)
|
||||
log = ui->radf_lineEdit_log->text();
|
||||
else
|
||||
log = QString("#");
|
||||
int matrix;
|
||||
if (ui->radf_checkBox_matrix->checkState() == 2)
|
||||
matrix = 1;
|
||||
else
|
||||
matrix = 0;
|
||||
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Processing 'radf'..."));
|
||||
ui->tabWidget->setDisabled(true);
|
||||
start_events = new Start_events(this);
|
||||
bool check = start_events->start_radf(mm_radf_path,
|
||||
workDir,
|
||||
mask,
|
||||
firstStep,
|
||||
lastStep,
|
||||
cellX, cellY, cellZ,
|
||||
output,
|
||||
atom0, atom1, atom2,
|
||||
atom3, atom4, atom5,
|
||||
radMin, radMax, radStep,
|
||||
angMin, angMax, angStep,
|
||||
log, matrix);
|
||||
delete start_events;
|
||||
ui->tabWidget->setEnabled(true);
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Done"));
|
||||
|
||||
if ((ui->radf_checkBox_graph->checkState() == 2) && (check == true))
|
||||
{
|
||||
QString filename = output;
|
||||
if (!filename.contains(QDir::separator()))
|
||||
filename = QFileInfo(QDir(workDir), filename).absoluteFilePath();
|
||||
StatgenGraphWindow *graphwin;
|
||||
graphwin = new StatgenGraphWindow(this, filename);
|
||||
graphwin->show();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_pdb_pushButton_start_clicked()
|
||||
{
|
||||
ui->centralWidget->setDisabled(true);
|
||||
QString workDir = ui->pdb_lineEdit_workDir->text();
|
||||
QString input = ui->pdb_lineEdit_input->text();
|
||||
QString agl, cellX, cellY, cellZ;
|
||||
if (ui->pdb_comboBox_mode->currentIndex() == 0)
|
||||
start_events->start_pdb(mm_agl_path);
|
||||
{
|
||||
agl = ui->pdb_lineEdit_agl->text();
|
||||
cellX.setNum(ui->pdb_doubleSpinBox_cellX->value(), 'f', 4);
|
||||
cellY.setNum(ui->pdb_doubleSpinBox_cellY->value(), 'f', 4);
|
||||
cellZ.setNum(ui->pdb_doubleSpinBox_cellZ->value(), 'f', 4);
|
||||
}
|
||||
else
|
||||
agl = QString("#");
|
||||
QString output = ui->pdb_lineEdit_output->text();
|
||||
QString log;
|
||||
if (ui->pdb_checkBox_log->checkState() == 2)
|
||||
log = ui->pdb_lineEdit_log->text();
|
||||
else
|
||||
log = QString("#");
|
||||
|
||||
if (ui->pdb_comboBox_mode->currentIndex() == 0)
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Processing 'agl'..."));
|
||||
else if (ui->pdb_comboBox_mode->currentIndex() == 1)
|
||||
start_events->start_pdb(mm_trj2pdb_path);
|
||||
ui->centralWidget->setEnabled(true);
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Processing 'trj2pdb'..."));
|
||||
ui->tabWidget->setDisabled(true);
|
||||
start_events = new Start_events(this);
|
||||
bool check;
|
||||
if (ui->pdb_comboBox_mode->currentIndex() == 0)
|
||||
check = start_events->start_pdb(mm_agl_path,
|
||||
workDir,
|
||||
input,
|
||||
agl,
|
||||
cellX, cellY, cellZ,
|
||||
output,
|
||||
log);
|
||||
else if (ui->pdb_comboBox_mode->currentIndex() == 1)
|
||||
check = start_events->start_pdb(mm_trj2pdb_path,
|
||||
workDir,
|
||||
input,
|
||||
agl,
|
||||
cellX, cellY, cellZ,
|
||||
output,
|
||||
log);
|
||||
delete start_events;
|
||||
ui->tabWidget->setEnabled(true);
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Done"));
|
||||
}
|
||||
|
||||
// completion
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
class Clear_items;
|
||||
class SettingsWindow;
|
||||
class Start_events;
|
||||
class Update_fields;
|
||||
|
||||
namespace Ui {
|
||||
@ -100,6 +101,7 @@ private:
|
||||
friend class Clear_items;
|
||||
Update_fields *update_fields;
|
||||
friend class Update_fields;
|
||||
Start_events *start_events;
|
||||
|
||||
// window signals
|
||||
void createActions();
|
||||
|
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 2.8.0, 2013-08-10T04:57:48. -->
|
||||
<!-- Written by QtCreator 2.8.0, 2013-08-11T16:49:53. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ class Start_events : public QWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Start_events(MainWindow *wid = 0);
|
||||
void start_trj(QString mm_trj_path,
|
||||
bool start_trj(QString mm_trj_path,
|
||||
QString workDir,
|
||||
QString input,
|
||||
QString type,
|
||||
@ -20,10 +20,44 @@ public:
|
||||
QString mask,
|
||||
QString totalTypes,
|
||||
QString log);
|
||||
void start_statgen(QString mm_statgen_path);
|
||||
void start_envir(QString mm_envir_path);
|
||||
void start_radf(QString mm_radf_path);
|
||||
void start_pdb(QString mm_pdb_path);
|
||||
bool 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);
|
||||
bool start_envir(QString mm_envir_path,
|
||||
QString workDir,
|
||||
QString input,
|
||||
QString cellX, QString cellY, QString cellZ,
|
||||
QString output,
|
||||
QString molecule,
|
||||
QString radius,
|
||||
QString log);
|
||||
bool 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);
|
||||
bool start_pdb(QString mm_pdb_path,
|
||||
QString workDir,
|
||||
QString input,
|
||||
QString agl,
|
||||
QString cellX, QString cellY, QString cellZ,
|
||||
QString output,
|
||||
QString log);
|
||||
|
||||
signals:
|
||||
|
||||
|
Reference in New Issue
Block a user