Skip to content
Snippets Groups Projects
Commit 08953f12 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Allow config exposure change

parent 43a780bb
Branches
No related tags found
1 merge request!316Resolves #343 GUI and Frame Refactor
Pipeline #28332 passed
...@@ -96,6 +96,15 @@ PylonDevice::PylonDevice(nlohmann::json &config) ...@@ -96,6 +96,15 @@ PylonDevice::PylonDevice(nlohmann::json &config)
left_hm_ = cv::cuda::HostMem(height_, width_, CV_8UC4); left_hm_ = cv::cuda::HostMem(height_, width_, CV_8UC4);
right_hm_ = cv::cuda::HostMem(height_, width_, CV_8UC4); right_hm_ = cv::cuda::HostMem(height_, width_, CV_8UC4);
hres_hm_ = cv::cuda::HostMem(fullheight_, fullwidth_, CV_8UC4); hres_hm_ = cv::cuda::HostMem(fullheight_, fullwidth_, CV_8UC4);
on("exposure", [this](const ftl::config::Event &e) {
if (lcam_->GetDeviceInfo().GetModelName() != "Emulation") {
lcam_->ExposureTime.SetValue(value("exposure", 24000.0f)); // Exposure time in microseconds
}
if (rcam_ && rcam_->GetDeviceInfo().GetModelName() != "Emulation") {
rcam_->ExposureTime.SetValue(value("exposure", 24000.0f)); // Exposure time in microseconds
}
});
} }
PylonDevice::~PylonDevice() { PylonDevice::~PylonDevice() {
...@@ -149,7 +158,7 @@ void PylonDevice::_configureCamera(CBaslerUniversalInstantCamera *cam) { ...@@ -149,7 +158,7 @@ void PylonDevice::_configureCamera(CBaslerUniversalInstantCamera *cam) {
if (cam->GetDeviceInfo().GetModelName() != "Emulation") { if (cam->GetDeviceInfo().GetModelName() != "Emulation") {
// Emulated device throws exception with these // Emulated device throws exception with these
cam->ExposureTime.SetValue(24000.0f); // Exposure time in microseconds cam->ExposureTime.SetValue(value("exposure", 24000.0f)); // Exposure time in microseconds
cam->LightSourcePreset.SetValue(Basler_UniversalCameraParams::LightSourcePreset_Tungsten2800K); // White balance option cam->LightSourcePreset.SetValue(Basler_UniversalCameraParams::LightSourcePreset_Tungsten2800K); // White balance option
} }
} }
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment