Skip to content

Commit

Permalink
Updated checks for applications (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
marip8 authored Aug 2, 2024
1 parent 814a973 commit 7f4758b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
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

0 comments on commit 7f4758b

Please sign in to comment.