feat(camera): 启动自动初始化并在测量前重试失败的初始化

- 程序启动后自动连接左右相机、应用参数并完成一次白平衡
- 测量请求到达时若相机未初始化成功,再初始化一次
- 重试成功继续同一测量请求,失败返回 INITIALIZATION 和 robot_valid=false
- 初始化期间允许一个待处理测量请求,并支持取消
- IPC 状态增加 initialization_in_progress
- 手动白平衡先失效初始化缓存并同步更新就绪状态
- 将带宽设置收口到 CameraManager,更新接入文档

验证:MSVC x64编译通过;启动重试8、IPC9、白平衡6、抓取7项测试通过
This commit is contained in:
lidg
2026-10-28 15:19:11 +08:00
parent 374ea6a4bf
commit 07632e7de1
8 changed files with 81 additions and 20 deletions
+3 -7
View File
@@ -251,13 +251,7 @@ bool CameraPanel::applyParameters(int cameraIndex)
if(!m_mgr->isConnected(index))return false;
const bool exposure=m_mgr->setExposureTime(index,ui.spinExposure->value());
const bool gain=m_mgr->setGain(index,ui.spinGain->value());
bool bandwidth=false;
try {
auto features=m_mgr->getDevice(index)->GetRemoteFeatureControl();
features->GetIntFeature("DeviceLinkSelector")->SetValue(0);
features->GetEnumFeature("DeviceLinkThroughputLimitMode")->SetValue(ui.chkBandwidthLimit->isChecked()?"On":"Off");
bandwidth=true;
}catch(...){emit logMessage(QString::fromUtf8("[Camera] 带宽限制模式设置失败"));}
const bool bandwidth=m_mgr->setBandwidthLimit(index,ui.chkBandwidthLimit->isChecked());
return exposure&&gain&&bandwidth;
}
@@ -304,6 +298,8 @@ void CameraPanel::onApplyWhiteBalance()
auto apply = [&](CameraManager::CamIndex ci, const QString& name) {
if (!m_mgr->isConnected(ci)) return;
m_remoteInitialized[ci]=false;
emit remoteInitializationChanged(int(ci));
if (m_mgr->applyWhiteBalanceOnce(ci)) {
applied = true;
emit logMessage(QString::fromUtf8("%1自动白平衡已执行(Once)").arg(name));