Skip to content

Commit

Permalink
FIX: camera not connected solved
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Settimi committed May 31, 2024
1 parent 50e5248 commit 92401cf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion imgui.ini
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Collapsed=0
[Window][augmented_carpentry]
Pos=414,26
Size=384,463
Collapsed=0
Collapsed=1

[Window][bla]
Pos=30,352
Expand Down
12 changes: 8 additions & 4 deletions src/AIAC/ACInfoModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,14 @@ namespace AIAC
AIAC_ERROR("ACInfoModel::Load() file does not exist");
return false;
}
if (std::filesystem::is_directory(path)){
AIAC_ERROR("ACInfoModel::Load() path is a directory");
return false;
}
if (path.find(".acim") == std::string::npos){
AIAC_ERROR("ACInfoModel::Load() file is not .acim");
return false;
}

m_FilePath = path;

Expand Down Expand Up @@ -349,10 +357,6 @@ namespace AIAC
auto centerPoint = (holeInfo.m_Start + holeInfo.m_End) * 0.5f;
std::string shortenHoleID = m_TimberInfo.ShortenComponentID(holeInfo.m_ID);
holeInfo.m_IDLabelGO = GOText::Add(shortenHoleID, centerPoint, m_LabelSize);
auto radiusText = std::to_string(holeInfo.m_Radius);
radiusText = radiusText.substr(0, radiusText.find(".") + 3);
holeInfo.m_RadiusLabelGO = GOText::Add(radiusText, holeInfo.m_Start, m_LabelSize);
holeInfo.m_RadiusLabelGO->SetVisibility(false);

holeInfo.m_GOPrimitives.push_back(holeInfo.m_AxisGO);
holeInfo.m_GOPrimitives.push_back(holeInfo.m_CylinderGO);
Expand Down
3 changes: 2 additions & 1 deletion src/AIAC/LayerCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ namespace AIAC
m_CurrentDeviceIndex = AIAC::Config::Get<int>("AIAC", "CamID", 0);
SetCurrentDeviceIndex(m_CurrentDeviceIndex);
} else {
throw std::runtime_error("No camera found");
throw std::runtime_error("No camera found, connect a camera");
}
}
catch(const std::runtime_error& e)
{
AIAC_ERROR(e.what());
AIAC::Application::GetInstance().Close();
}
}

Expand Down
1 change: 0 additions & 1 deletion src/AIAC/ScannedModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ namespace AIAC
AIAC_ERROR("ACInfoModel::Load() path is empty");
return false;
}

if(!std::filesystem::exists(path)){
AIAC_ERROR("ACInfoModel::Load() file does not exist");
return false;
Expand Down

0 comments on commit 92401cf

Please sign in to comment.