Files
XplorePlane/XP.Camera/CameraFactory.cs
T
2026-04-13 14:36:18 +08:00

18 lines
538 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($"不支持的相机品牌: {cameraType}")
};
}
}