From 9a728bdcf10ba79ca1d6377c6d69b28ac2843be9 Mon Sep 17 00:00:00 2001 From: "Ivan F. Valerio" Date: Wed, 6 Mar 2024 12:02:51 -0500 Subject: [PATCH] fix formatting --- plugins/module_installer/rtxi_wizard.cpp | 44 +++++++++++------------- src/nidaq_driver.cpp | 8 ++--- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/plugins/module_installer/rtxi_wizard.cpp b/plugins/module_installer/rtxi_wizard.cpp index 4be93aad..23862412 100644 --- a/plugins/module_installer/rtxi_wizard.cpp +++ b/plugins/module_installer/rtxi_wizard.cpp @@ -357,8 +357,7 @@ void RTXIWizard::Panel::installFromString(const std::string& module_name) { const QString name = QString(module_name.c_str()); // Let the user know that RTXI is installing the plugin. - auto progress = - QProgressDialog("Installing plugin", "Cancel", 0, 5, this); + auto progress = QProgressDialog("Installing plugin", "Cancel", 0, 5, this); progress.setMinimumDuration(0); progress.setWindowModality(Qt::WindowModal); progress.setLabelText("Starting..."); @@ -379,8 +378,8 @@ void RTXIWizard::Panel::installFromString(const std::string& module_name) // QApplication::processEvents(); // If the repo already exists, pull from master. If not, clone it. QStringList clone_args; - if(!(QDir(source_location).exists())){ - clone_args = QStringList{ + if (!(QDir(source_location).exists())) { + clone_args = QStringList { "clone", "-b", "master", @@ -388,24 +387,20 @@ void RTXIWizard::Panel::installFromString(const std::string& module_name) source_location, }; } else { - clone_args = QStringList{ - "-C", - source_location, - "pull" - }; + clone_args = QStringList {"-C", source_location, "pull"}; } const std::string git_command(GIT_COMMAND); - int status = system((git_command + " " + clone_args.join(" ").toStdString()).c_str()); + int status = + system((git_command + " " + clone_args.join(" ").toStdString()).c_str()); if (status != 0) { ERROR_MSG("Could not complete installation for module {}", name.toStdString()); // Re-enable buttons only after compilation is done. Otherwise you get race // conditions if buttons are pressed before modules are done compiling. - ERROR_MSG("Repo update failed with command: {}", - git_command + - std::string(" ") + - clone_args.join(" ").toStdString()); + ERROR_MSG( + "Repo update failed with command: {}", + git_command + std::string(" ") + clone_args.join(" ").toStdString()); cloneButton->setEnabled(true); rebuildListWidgets(); availableListWidget->setDisabled(false); @@ -439,9 +434,10 @@ void RTXIWizard::Panel::installFromString(const std::string& module_name) progress.setLabelText("Configuring..."); progress.setValue(2); - status = system((make_cmd.toStdString()+" "+make_config_args.join(" ").toStdString()).c_str()); - if (status != 0) - { + status = system( + (make_cmd.toStdString() + " " + make_config_args.join(" ").toStdString()) + .c_str()); + if (status != 0) { QMessageBox::critical( nullptr, "Error", @@ -465,9 +461,10 @@ void RTXIWizard::Panel::installFromString(const std::string& module_name) progress.setLabelText("Building..."); progress.setValue(3); - status = system((make_cmd.toStdString()+" "+make_build_args.join(" ").toStdString()).c_str()); - if (status != 0) - { + status = system( + (make_cmd.toStdString() + " " + make_build_args.join(" ").toStdString()) + .c_str()); + if (status != 0) { QMessageBox::critical( nullptr, "Error", @@ -487,9 +484,10 @@ void RTXIWizard::Panel::installFromString(const std::string& module_name) progress.setLabelText("Installing..."); progress.setValue(4); // QApplication::processEvents(); - status = system((make_cmd.toStdString()+" "+make_install_args.join(" ").toStdString()).c_str()); - if (status != 0) - { + status = system( + (make_cmd.toStdString() + " " + make_install_args.join(" ").toStdString()) + .c_str()); + if (status != 0) { QMessageBox::critical( nullptr, "Error", diff --git a/src/nidaq_driver.cpp b/src/nidaq_driver.cpp index 09e7f793..b90bc5af 100644 --- a/src/nidaq_driver.cpp +++ b/src/nidaq_driver.cpp @@ -34,16 +34,16 @@ relies on the fact that the order with which the channel_t structs in the driver discovery process is preserved and is generated in the same way inside device instantiation. -This driver also heavily relies on NIDAQmx tasks to perform inputs -and outputs. In addition, the driver only supports software timing. More efficient -ways may become obvious in the future, so keep this in mind if making +This driver also heavily relies on NIDAQmx tasks to perform inputs +and outputs. In addition, the driver only supports software timing. More +efficient ways may become obvious in the future, so keep this in mind if making changes. The final crucial concept in the design is the use of indices throughout the interface. This was inherited from past driver designs, primarliy the obsolete analogy driver. This driver simply continues that tradition, and most values regarding range, units, and ranges, are stored as DAQ::index_t values that -refer to predefined settings in arrays generated by functions such as +refer to predefined settings in arrays generated by functions such as DAQ::get_default_ranges(). This was done to improve generality, and we expect this to continue for future drivers.