automatically define variable "gui_run" to contain the run number
This commit is contained in:
@ -417,6 +417,11 @@ void CodeEditor::setGroupList()
|
||||
void CodeEditor::setVarNameList()
|
||||
{
|
||||
QStringList vars;
|
||||
|
||||
// variable "gui_run" is always defined by LAMMPS GUI
|
||||
vars << QString("${gui_run}");
|
||||
vars << QString("v_gui_run");
|
||||
|
||||
LammpsWrapper *lammps = &qobject_cast<LammpsGui *>(parent())->lammps;
|
||||
int nvar = lammps->id_count("variable");
|
||||
char buffer[200];
|
||||
|
||||
@ -1002,6 +1002,10 @@ void LammpsGui::do_run(bool use_buffer)
|
||||
runner = new LammpsRunner(this);
|
||||
is_running = true;
|
||||
++run_counter;
|
||||
|
||||
// define "gui_run" variable set to run_counter value
|
||||
lammps.command("variable gui_run delete");
|
||||
lammps.command(std::string("variable gui_run index " + std::to_string(run_counter)).c_str());
|
||||
if (use_buffer) {
|
||||
// always add final newline since the text edit widget does not do it
|
||||
char *input = mystrdup(ui->textEdit->toPlainText() + "\n");
|
||||
|
||||
Reference in New Issue
Block a user