diff --git a/tools/lammps-gui/chartviewer.cpp b/tools/lammps-gui/chartviewer.cpp index 22f8e2f32b..d176dd98b7 100644 --- a/tools/lammps-gui/chartviewer.cpp +++ b/tools/lammps-gui/chartviewer.cpp @@ -138,8 +138,7 @@ void ChartWindow::quit() void ChartWindow::reset_zoom() { int choice = columns->currentData().toInt(); - if ((choice >= 0) && (choice < charts.size())) - charts[choice]->reset_zoom(); + if ((choice >= 0) && (choice < charts.size())) charts[choice]->reset_zoom(); } void ChartWindow::stop_run() diff --git a/tools/lammps-gui/lammpsgui.cpp b/tools/lammps-gui/lammpsgui.cpp index ca8ee043f8..101ee72484 100644 --- a/tools/lammps-gui/lammpsgui.cpp +++ b/tools/lammps-gui/lammpsgui.cpp @@ -885,8 +885,9 @@ void LammpsGui::logupdate() else slideshow->hide(); } else { - slideshow->setWindowTitle( - QString("LAMMPS-GUI - Slide Show - %1 - Run %2").arg(current_file).arg(run_counter)); + slideshow->setWindowTitle(QString("LAMMPS-GUI - Slide Show - %1 - Run %2") + .arg(current_file) + .arg(run_counter)); if (QSettings().value("viewslide", true).toBool()) slideshow->show(); } slideshow->add_image(imagefile); @@ -1254,50 +1255,51 @@ void LammpsGui::help() msg.setWindowTitle("LAMMPS-GUI Quick Help"); msg.setWindowIcon(QIcon(":/icons/lammps-icon-128x128.png")); msg.setText("
This is LAMMPS-GUI version " LAMMPS_GUI_VERSION "
"); - msg.setInformativeText("

LAMMPS-GUI is a graphical text editor that is customized for " - "editing LAMMPS input files and linked to the LAMMPS " - "library and thus can run LAMMPS directly using the contents of the " - "text buffer as input. It can retrieve and display information from " - "LAMMPS while it is running and display visualizations created " - "with the dump image command.

" - "

The main window of the LAMMPS-GUI is a text editor window with " - "LAMMPS specific syntax highlighting. When typing Ctrl-Enter " - "or clicking on 'Run LAMMMPS' in the 'Run' menu, LAMMPS will be run " - "with the contents of editor buffer as input. The output of the LAMMPS " - "run is captured and displayed in an Output window. The thermodynamic data " - "is displayed in a chart window. Both are updated regularly during the " - "run, as is a progress bar in the main window. The running simulation " - "can be stopped cleanly by typing Ctrl-/ or by clicking on " - "'Stop LAMMPS' in the 'Run' menu. While LAMMPS is not running, " - "an image of the simulated system can be created and shown in an image " - "viewer window by typing Ctrl-i or by clicking on 'View Image' " - "in the 'Run' menu. Multiple image settings can be changed through the " - "buttons in the menu bar and the image will be re-renderd. In case " - "an input file contains a dump image command, LAMMPS-GUI will load " - "the images as they are created and display them in a slide show.

" - "

When opening a file, the editor will determine the directory " - "where the input file resides and switch its current working directory " - "to that same folder and thus enabling the run to read other files in " - "that folder, e.g. a data file. The GUI will show its current working " - "directory in the status bar. In addition to using the menu, the " - "editor window can also receive files as the first command line " - "argument or via drag-n-drop from a graphical file manager or a " - "desktop environment.

" - "

Almost all commands are accessible via keyboard shortcuts. Which " - "those shortcuts are, is typically shown next to their entries in the " - "menus. " - "In addition, the documentation for the command in the current line " - "can be viewed by typing Ctrl-? or by choosing the respective " - "entry in the context menu, available by right-clicking the mouse. " - "Log, chart, slide show, and image windows can be closed with " - "Ctrl-W and the application terminated with Ctrl-Q.

" - "

The 'About LAMMPS-GUI' dialog will show the LAMMPS version and the " - "features included into the LAMMPS library linked to the LAMMPS-GUI. " - "A number of settings can be adjusted in the 'Preferences' dialog (in " - "the 'Edit' menu or from Ctrl-P) which includes selecting " - "accelerator packages and number of OpenMP threads. Due to its nature " - "as a graphical application, it is not possible to use the " - "LAMMPS-GUI in parallel with MPI.

"); + msg.setInformativeText( + "

LAMMPS-GUI is a graphical text editor that is customized for " + "editing LAMMPS input files and linked to the LAMMPS " + "library and thus can run LAMMPS directly using the contents of the " + "text buffer as input. It can retrieve and display information from " + "LAMMPS while it is running and display visualizations created " + "with the dump image command.

" + "

The main window of the LAMMPS-GUI is a text editor window with " + "LAMMPS specific syntax highlighting. When typing Ctrl-Enter " + "or clicking on 'Run LAMMMPS' in the 'Run' menu, LAMMPS will be run " + "with the contents of editor buffer as input. The output of the LAMMPS " + "run is captured and displayed in an Output window. The thermodynamic data " + "is displayed in a chart window. Both are updated regularly during the " + "run, as is a progress bar in the main window. The running simulation " + "can be stopped cleanly by typing Ctrl-/ or by clicking on " + "'Stop LAMMPS' in the 'Run' menu. While LAMMPS is not running, " + "an image of the simulated system can be created and shown in an image " + "viewer window by typing Ctrl-i or by clicking on 'View Image' " + "in the 'Run' menu. Multiple image settings can be changed through the " + "buttons in the menu bar and the image will be re-renderd. In case " + "an input file contains a dump image command, LAMMPS-GUI will load " + "the images as they are created and display them in a slide show.

" + "

When opening a file, the editor will determine the directory " + "where the input file resides and switch its current working directory " + "to that same folder and thus enabling the run to read other files in " + "that folder, e.g. a data file. The GUI will show its current working " + "directory in the status bar. In addition to using the menu, the " + "editor window can also receive files as the first command line " + "argument or via drag-n-drop from a graphical file manager or a " + "desktop environment.

" + "

Almost all commands are accessible via keyboard shortcuts. Which " + "those shortcuts are, is typically shown next to their entries in the " + "menus. " + "In addition, the documentation for the command in the current line " + "can be viewed by typing Ctrl-? or by choosing the respective " + "entry in the context menu, available by right-clicking the mouse. " + "Log, chart, slide show, and image windows can be closed with " + "Ctrl-W and the application terminated with Ctrl-Q.

" + "

The 'About LAMMPS-GUI' dialog will show the LAMMPS version and the " + "features included into the LAMMPS library linked to the LAMMPS-GUI. " + "A number of settings can be adjusted in the 'Preferences' dialog (in " + "the 'Edit' menu or from Ctrl-P) which includes selecting " + "accelerator packages and number of OpenMP threads. Due to its nature " + "as a graphical application, it is not possible to use the " + "LAMMPS-GUI in parallel with MPI.

"); msg.setIconPixmap(QPixmap(":/icons/lammps-icon-128x128.png").scaled(64, 64)); msg.setStandardButtons(QMessageBox::Close); msg.exec(); diff --git a/tools/lammps-gui/logwindow.cpp b/tools/lammps-gui/logwindow.cpp index fa12dcf483..56dce35179 100644 --- a/tools/lammps-gui/logwindow.cpp +++ b/tools/lammps-gui/logwindow.cpp @@ -30,7 +30,8 @@ #include #include -const QString LogWindow::yaml_regex = QStringLiteral("^(keywords:.*$|data:$|---$|\\.\\.\\.$| - \\[.*\\]$)"); +const QString LogWindow::yaml_regex = + QStringLiteral("^(keywords:.*$|data:$|---$|\\.\\.\\.$| - \\[.*\\]$)"); LogWindow::LogWindow(const QString &_filename, QWidget *parent) : QPlainTextEdit(parent), filename(_filename) diff --git a/tools/lammps-gui/preferences.cpp b/tools/lammps-gui/preferences.cpp index 1bd3bc0d52..207b68cb66 100644 --- a/tools/lammps-gui/preferences.cpp +++ b/tools/lammps-gui/preferences.cpp @@ -93,7 +93,7 @@ void Preferences::accept() // store selected accelerator QList allButtons = tabWidget->findChildren(); - for (auto & allButton : allButtons) { + for (auto &allButton : allButtons) { if (allButton->isChecked()) { if (allButton->objectName() == "none") settings->setValue("accelerator", QString::number(AcceleratorTab::None)); @@ -411,13 +411,13 @@ AcceleratorTab::AcceleratorTab(QSettings *_settings, LammpsWrapper *_lammps, QWi auto *choices = new QFrame; auto *choiceLayout = new QVBoxLayout; #if defined(_OPENMP) - auto *ntlabel = new QLabel(QString("Number of threads (max %1):").arg(maxthreads)); - auto *ntchoice = new QLineEdit(settings->value("nthreads", maxthreads).toString()); + auto *ntlabel = new QLabel(QString("Number of threads (max %1):").arg(maxthreads)); + auto *ntchoice = new QLineEdit(settings->value("nthreads", maxthreads).toString()); #else - auto *ntlabel = new QLabel(QString("Number of threads (OpenMP not available):")); - auto *ntchoice = new QLineEdit("1"); + auto *ntlabel = new QLabel(QString("Number of threads (OpenMP not available):")); + auto *ntchoice = new QLineEdit("1"); #endif - auto *intval = new QIntValidator(1, maxthreads, this); + auto *intval = new QIntValidator(1, maxthreads, this); ntchoice->setValidator(intval); ntchoice->setObjectName("nthreads"); #if !defined(_OPENMP) diff --git a/tools/lammps-gui/stdcapture.cpp b/tools/lammps-gui/stdcapture.cpp index 8be543e70e..dfef407faa 100644 --- a/tools/lammps-gui/stdcapture.cpp +++ b/tools/lammps-gui/stdcapture.cpp @@ -94,7 +94,8 @@ bool StdCapture::EndCapture() buf[bytesRead] = 0; m_captured += buf; } else if (bytesRead < 0) { - fd_blocked = ((errno == EAGAIN) || (errno == EWOULDBLOCK) || (errno == EINTR)) && (maxwait > 0); + fd_blocked = + ((errno == EAGAIN) || (errno == EWOULDBLOCK) || (errno == EINTR)) && (maxwait > 0); if (fd_blocked) std::this_thread::sleep_for(std::chrono::milliseconds(10)); --maxwait;