Skip to content

Commit

Permalink
[#76] Add missing default handlers for two switch statement (#78)
Browse files Browse the repository at this point in the history
- Set err properly in those two default handlers now.
- Add a statistical summary when camera is in some unknown states.
  • Loading branch information
jilinzhouas authored Feb 16, 2022
1 parent 6d6c21b commit dbf6af5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/avt_vimba_camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,9 @@ bool AvtVimbaCamera::getFeatureValue(const std::string& feature_str, T& val)
val = static_cast<T>(nValue);
}
break;
default:
err = VmbErrorNotFound;
break;
}
if (err != VmbErrorSuccess)
{
Expand Down Expand Up @@ -543,6 +546,9 @@ bool AvtVimbaCamera::getFeatureValue(const std::string& feature_str, std::string
val = strValue;
}
break;
default:
err = VmbErrorNotFound;
break;
}
if (err != VmbErrorSuccess)
{
Expand Down Expand Up @@ -1243,6 +1249,7 @@ void AvtVimbaCamera::getCurrentState(diagnostic_updater::DiagnosticStatusWrapper
stat.summary(diagnostic_msgs::DiagnosticStatus::ERROR, "Camera has encountered an error");
break;
default:
stat.summary(diagnostic_msgs::DiagnosticStatus::ERROR, "Camera is in unknown state");
break;
}
}
Expand Down

0 comments on commit dbf6af5

Please sign in to comment.