Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated file checks for application arguments #202

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions gui/src/app/camera_intrinsic_calibration_app.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <industrial_calibration/gui/camera_intrinsic_calibration_widget.h>
#include <filesystem>
#include <QApplication>
#include <QMessageBox>
#include <QTextStream>
Expand Down Expand Up @@ -65,12 +66,12 @@ int main(int argc, char** argv)
// Attempt to load configuration and observations files if available
try
{
if (argc > 1)
if (argc > 1 && std::filesystem::is_regular_file(argv[1]))
{
w.loadConfig(argv[1]);
QMessageBox::information(nullptr, "Configuration", "Successfully loaded calibration configuration");
}
if (argc > 2)
if (argc > 2 && std::filesystem::is_regular_file(argv[2]))
w.loadObservations(argv[2]);
}
catch (const std::exception& ex)
Expand Down
5 changes: 3 additions & 2 deletions gui/src/app/extrinsic_hand_eye_calibration_app.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <industrial_calibration/gui/extrinsic_hand_eye_calibration_widget.h>
#include <filesystem>
#include <QApplication>
#include <QMessageBox>
#include <QTextStream>
Expand Down Expand Up @@ -58,12 +59,12 @@ int main(int argc, char** argv)
// Attempt to load configuration and observations files if available
try
{
if (argc > 1)
if (argc > 1 && std::filesystem::is_regular_file(argv[1]))
{
w.loadConfig(argv[1]);
QMessageBox::information(nullptr, "Configuration", "Successfully loaded calibration configuration");
}
if (argc > 2)
if (argc > 2 && std::filesystem::is_regular_file(argv[2]))
w.loadObservations(argv[2]);
}
catch (const std::exception& ex)
Expand Down