add overloads for automatic string style conversions
This commit is contained in:
@ -494,7 +494,7 @@ void ImageViewer::do_recenter()
|
|||||||
"variable LAMMPSGUI_CX equal (xcm(%1,x)-xlo)/lx\n"
|
"variable LAMMPSGUI_CX equal (xcm(%1,x)-xlo)/lx\n"
|
||||||
"variable LAMMPSGUI_CY equal (xcm(%1,y)-ylo)/ly\n"
|
"variable LAMMPSGUI_CY equal (xcm(%1,y)-ylo)/ly\n"
|
||||||
"variable LAMMPSGUI_CZ equal (xcm(%1,z)-zlo)/lz\n").arg(group);
|
"variable LAMMPSGUI_CZ equal (xcm(%1,z)-zlo)/lz\n").arg(group);
|
||||||
lammps->commands_string(commands.toLocal8Bit());
|
lammps->commands_string(commands);
|
||||||
xcenter = lammps->extract_variable("LAMMPSGUI_CX");
|
xcenter = lammps->extract_variable("LAMMPSGUI_CX");
|
||||||
ycenter = lammps->extract_variable("LAMMPSGUI_CZ");
|
ycenter = lammps->extract_variable("LAMMPSGUI_CZ");
|
||||||
zcenter = lammps->extract_variable("LAMMPSGUI_CZ");
|
zcenter = lammps->extract_variable("LAMMPSGUI_CZ");
|
||||||
@ -667,7 +667,7 @@ void ImageViewer::createImage()
|
|||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
last_dump_cmd = dumpcmd;
|
last_dump_cmd = dumpcmd;
|
||||||
lammps->command(dumpcmd.toLocal8Bit());
|
lammps->command(dumpcmd);
|
||||||
|
|
||||||
QImageReader reader(dumpfile.fileName());
|
QImageReader reader(dumpfile.fileName());
|
||||||
reader.setAutoTransform(true);
|
reader.setAutoTransform(true);
|
||||||
|
|||||||
@ -493,14 +493,14 @@ void LammpsGui::start_exe()
|
|||||||
vmdfile.write(".psf}\n");
|
vmdfile.write(".psf}\n");
|
||||||
vmdfile.close();
|
vmdfile.close();
|
||||||
args << "-e" << vmdfile.fileName();
|
args << "-e" << vmdfile.fileName();
|
||||||
lammps.command(datacmd.toLocal8Bit());
|
lammps.command(datacmd);
|
||||||
auto *vmd = new QProcess(this);
|
auto *vmd = new QProcess(this);
|
||||||
vmd->start(exe, args);
|
vmd->start(exe, args);
|
||||||
}
|
}
|
||||||
if (exe == "ovito") {
|
if (exe == "ovito") {
|
||||||
QStringList args;
|
QStringList args;
|
||||||
args << datafile.fileName();
|
args << datafile.fileName();
|
||||||
lammps.command(datacmd.toLocal8Bit());
|
lammps.command(datacmd);
|
||||||
auto *ovito = new QProcess(this);
|
auto *ovito = new QProcess(this);
|
||||||
ovito->start(exe, args);
|
ovito->start(exe, args);
|
||||||
}
|
}
|
||||||
@ -800,7 +800,7 @@ void LammpsGui::inspect_file(const QString &fileName)
|
|||||||
|
|
||||||
start_lammps();
|
start_lammps();
|
||||||
lammps.command("clear");
|
lammps.command("clear");
|
||||||
lammps.command(QString("read_restart %1").arg(fileName).toLocal8Bit());
|
lammps.command(QString("read_restart %1").arg(fileName));
|
||||||
capturer->BeginCapture();
|
capturer->BeginCapture();
|
||||||
lammps.command("info system group compute fix");
|
lammps.command("info system group compute fix");
|
||||||
capturer->EndCapture();
|
capturer->EndCapture();
|
||||||
@ -816,7 +816,7 @@ void LammpsGui::inspect_file(const QString &fileName)
|
|||||||
infoviewer->show();
|
infoviewer->show();
|
||||||
ilist->info = infoviewer;
|
ilist->info = infoviewer;
|
||||||
dumpinfo.remove();
|
dumpinfo.remove();
|
||||||
lammps.command(QString("write_data %1 pair ij noinit").arg(infodata).toLocal8Bit());
|
lammps.command(QString("write_data %1 pair ij noinit").arg(infodata));
|
||||||
auto *dataviewer =
|
auto *dataviewer =
|
||||||
new FileViewer(infodata, QString("LAMMPS-GUI: data file for %1").arg(shortName));
|
new FileViewer(infodata, QString("LAMMPS-GUI: data file for %1").arg(shortName));
|
||||||
dataviewer->show();
|
dataviewer->show();
|
||||||
|
|||||||
@ -14,6 +14,9 @@
|
|||||||
#ifndef LAMMPSWRAPPER_H
|
#ifndef LAMMPSWRAPPER_H
|
||||||
#define LAMMPSWRAPPER_H
|
#define LAMMPSWRAPPER_H
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
class LammpsWrapper {
|
class LammpsWrapper {
|
||||||
public:
|
public:
|
||||||
LammpsWrapper();
|
LammpsWrapper();
|
||||||
@ -23,8 +26,14 @@ public:
|
|||||||
void close();
|
void close();
|
||||||
void finalize();
|
void finalize();
|
||||||
|
|
||||||
|
void file(const QString &fname) { file(fname.toStdString()); }
|
||||||
|
void file(const std::string &fname) { file(fname.c_str()); }
|
||||||
void file(const char *);
|
void file(const char *);
|
||||||
|
void command(const QString &cmd) { command(cmd.toStdString()); }
|
||||||
|
void command(const std::string &cmd) { command(cmd.c_str()); }
|
||||||
void command(const char *);
|
void command(const char *);
|
||||||
|
void commands_string(const QString &cmd) { commands_string(cmd.toStdString()); }
|
||||||
|
void commands_string(const std::string &cmd) { commands_string(cmd.c_str()); }
|
||||||
void commands_string(const char *);
|
void commands_string(const char *);
|
||||||
|
|
||||||
void force_timeout();
|
void force_timeout();
|
||||||
|
|||||||
Reference in New Issue
Block a user