// Copyright 2008 Nanorex, Inc. See LICENSE file for details.
#include "DataWindow.h"
/* CONSTRUCTOR */
DataWindow::DataWindow(QWidget *parent) : QWidget(parent) {
//setAttribute(Qt::WA_DeleteOnClose);
static int sequenceNumber = 1;
QString curFile = tr("document%1").arg(sequenceNumber++);
setWindowTitle(curFile);
}
/* FUNCTION: closeEvent */
void DataWindow::closeEvent(QCloseEvent *event) {
event->accept();
}
/* FUNCTION: formatParamter */
void DataWindow::formatParameter(string& key, string& value, string& units) {
string originalValue = value;
value = "
" + value;
units = " | ";
//
// Results parameters
//
if (key == "RunResult") {
key = "Run Result";
if (originalValue == "0")
value = "Success";
else if (originalValue == "1")
value = " | Still running";
else if (originalValue == "2")
value = " | Failure";
else if (originalValue == "3")
value = " | Aborted";
} else if (key == "RunResultMessage") {
key = "Run Result Message";
} else if (key == "FinalStep") {
key = "Final Step";
} else if (key == "MaximumForce") {
key = "Maximum Force";
units = "kJ mol-1 nm-1 | ";
} else if (key == "TotalEnergy") {
key = "Total Energy";
units = "kJ mol-1";
//
// GROMACS parameters
//
} else if (key == "GMX.emstep") {
key = "Initial step-size (emstep)";
units = "nm";
} else if (key == "GMX.emtol") {
key = "Maximum force criteria (emtol)";
units = "kJ mol-1 nm-1";
} else if (key == "GMX.epsilon_r") {
key = "Relative dielectric constant (epsilon_r)";
} else if (key == "GMX.integrator") {
key = "Integrator (integrator)";
if (originalValue == "cg")
value = "Conjugate gradients";
} else if (key == "GMX.ns_type") {
key = "Neighbor search (ns_type)";
} else if (key == "GMX.nstcgsteep") {
key = "Steep descent frequencty (nstcgsteep)";
units = "steps | ";
} else if (key == "GMX.nsteps") {
key = "Maximum integration steps (nsteps)";
} else if (key == "GMX.nstlist") {
key = "Neighbor list update frequency (nstlist)";
units = "steps";
} else if (key == "GMX.pbc") {
key = "Periodic boundary conditions (pbc)";
} else if (key == "GMX.rcoulomb") {
key = "Coulomb cutoff (rcoulomb)";
units = "nm";
} else if (key == "GMX.rlist") {
key = "Neighbor list cutoff (rlist)";
units = "nm";
} else if (key == "GMX.rvdw") {
key = "LJ or Buckingham cut-off (rvdw)";
units = "nm";
}
}