843c4d67a6
- 新增 HikvisionCameraController 实现 ICameraController - CameraFactory 支持 Basler/Hikvision 动态切换(config.json 配置) - PixelConverter 支持 Bayer RG/GR/GB/BG 8-bit 解码 - 修复采集链断裂问题(finally 中触发下一帧) - 相机设置面板:宽高和像素格式改为只读显示 - NavigationPropertyPanelViewModel 日志和状态文本改为英文 - 添加 MvCameraControl.Net.dll 到 ExternalLibraries
18 lines
534 B
C#
18 lines
534 B
C#
namespace XP.Camera;
|
|
|
|
/// <summary>
|
|
/// 统一相机工厂,根据品牌名称创建对应的相机控制器。
|
|
/// </summary>
|
|
public class CameraFactory : ICameraFactory
|
|
{
|
|
/// <inheritdoc />
|
|
public ICameraController CreateController(string cameraType)
|
|
{
|
|
return cameraType switch
|
|
{
|
|
"Basler" => new BaslerCameraController(),
|
|
"Hikvision" => new HikvisionCameraController(),
|
|
_ => throw new NotSupportedException($"Unsupported Camera Type: {cameraType}")
|
|
};
|
|
}
|
|
} |