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_CY equal (xcm(%1,y)-ylo)/ly\n"
|
||||
"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");
|
||||
ycenter = lammps->extract_variable("LAMMPSGUI_CZ");
|
||||
zcenter = lammps->extract_variable("LAMMPSGUI_CZ");
|
||||
@ -667,7 +667,7 @@ void ImageViewer::createImage()
|
||||
settings.endGroup();
|
||||
|
||||
last_dump_cmd = dumpcmd;
|
||||
lammps->command(dumpcmd.toLocal8Bit());
|
||||
lammps->command(dumpcmd);
|
||||
|
||||
QImageReader reader(dumpfile.fileName());
|
||||
reader.setAutoTransform(true);
|
||||
|
||||
@ -493,14 +493,14 @@ void LammpsGui::start_exe()
|
||||
vmdfile.write(".psf}\n");
|
||||
vmdfile.close();
|
||||
args << "-e" << vmdfile.fileName();
|
||||
lammps.command(datacmd.toLocal8Bit());
|
||||
lammps.command(datacmd);
|
||||
auto *vmd = new QProcess(this);
|
||||
vmd->start(exe, args);
|
||||
}
|
||||
if (exe == "ovito") {
|
||||
QStringList args;
|
||||
args << datafile.fileName();
|
||||
lammps.command(datacmd.toLocal8Bit());
|
||||
lammps.command(datacmd);
|
||||
auto *ovito = new QProcess(this);
|
||||
ovito->start(exe, args);
|
||||
}
|
||||
@ -800,7 +800,7 @@ void LammpsGui::inspect_file(const QString &fileName)
|
||||
|
||||
start_lammps();
|
||||
lammps.command("clear");
|
||||
lammps.command(QString("read_restart %1").arg(fileName).toLocal8Bit());
|
||||
lammps.command(QString("read_restart %1").arg(fileName));
|
||||
capturer->BeginCapture();
|
||||
lammps.command("info system group compute fix");
|
||||
capturer->EndCapture();
|
||||
@ -816,7 +816,7 @@ void LammpsGui::inspect_file(const QString &fileName)
|
||||
infoviewer->show();
|
||||
ilist->info = infoviewer;
|
||||
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 =
|
||||
new FileViewer(infodata, QString("LAMMPS-GUI: data file for %1").arg(shortName));
|
||||
dataviewer->show();
|
||||
|
||||
@ -14,6 +14,9 @@
|
||||
#ifndef LAMMPSWRAPPER_H
|
||||
#define LAMMPSWRAPPER_H
|
||||
|
||||
#include <QString>
|
||||
#include <string>
|
||||
|
||||
class LammpsWrapper {
|
||||
public:
|
||||
LammpsWrapper();
|
||||
@ -23,8 +26,14 @@ public:
|
||||
void close();
|
||||
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 command(const QString &cmd) { command(cmd.toStdString()); }
|
||||
void command(const std::string &cmd) { command(cmd.c_str()); }
|
||||
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 force_timeout();
|
||||
|
||||
Reference in New Issue
Block a user