Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
fusge committed Mar 6, 2024
1 parent e8226f6 commit 9a728bd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 27 deletions.
44 changes: 21 additions & 23 deletions plugins/module_installer/rtxi_wizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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...");
Expand All @@ -379,33 +378,29 @@ 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",
url,
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);
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions src/nidaq_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 9a728bd

Please sign in to comment.