规范类名及命名空间名称
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
using Basler.Pylon;
|
||||
using Serilog;
|
||||
|
||||
using CameraImageGrabbedEventArgs = XP.Camera.ImageGrabbedEventArgs;
|
||||
using CameraGrabErrorEventArgs = XP.Camera.GrabErrorEventArgs;
|
||||
using CameraImageGrabbedEventArgs = XP.Camera.ImageGrabbedEventArgs;
|
||||
|
||||
namespace XP.Camera;
|
||||
|
||||
@@ -177,7 +176,6 @@ public class BaslerCameraController : ICameraController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public void ExecuteSoftwareTrigger()
|
||||
{
|
||||
@@ -460,7 +458,6 @@ public class BaslerCameraController : ICameraController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ConnectionLost 事件处理。在 pylon SDK 事件线程上调用。
|
||||
/// </summary>
|
||||
@@ -514,4 +511,4 @@ public class BaslerCameraController : ICameraController
|
||||
throw new InvalidOperationException("Camera is not connected. Call Open() first.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,23 +3,44 @@ namespace XP.Camera;
|
||||
/// <summary>所有相机相关错误的基类异常。</summary>
|
||||
public class CameraException : Exception
|
||||
{
|
||||
public CameraException() { }
|
||||
public CameraException(string message) : base(message) { }
|
||||
public CameraException(string message, Exception innerException) : base(message, innerException) { }
|
||||
public CameraException()
|
||||
{ }
|
||||
|
||||
public CameraException(string message) : base(message)
|
||||
{
|
||||
}
|
||||
|
||||
public CameraException(string message, Exception innerException) : base(message, innerException)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>当相机连接意外断开时抛出的异常。</summary>
|
||||
public class ConnectionLostException : CameraException
|
||||
{
|
||||
public ConnectionLostException() { }
|
||||
public ConnectionLostException(string message) : base(message) { }
|
||||
public ConnectionLostException(string message, Exception innerException) : base(message, innerException) { }
|
||||
public ConnectionLostException()
|
||||
{ }
|
||||
|
||||
public ConnectionLostException(string message) : base(message)
|
||||
{
|
||||
}
|
||||
|
||||
public ConnectionLostException(string message, Exception innerException) : base(message, innerException)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>当系统中无可用相机设备时抛出的异常。</summary>
|
||||
public class DeviceNotFoundException : CameraException
|
||||
{
|
||||
public DeviceNotFoundException() { }
|
||||
public DeviceNotFoundException(string message) : base(message) { }
|
||||
public DeviceNotFoundException(string message, Exception innerException) : base(message, innerException) { }
|
||||
}
|
||||
public DeviceNotFoundException()
|
||||
{ }
|
||||
|
||||
public DeviceNotFoundException(string message) : base(message)
|
||||
{
|
||||
}
|
||||
|
||||
public DeviceNotFoundException(string message, Exception innerException) : base(message, innerException)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -15,4 +15,4 @@ public class CameraFactory : ICameraFactory
|
||||
_ => throw new NotSupportedException($"不支持的相机品牌: {cameraType}")
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,4 +36,4 @@ public class GrabErrorEventArgs : EventArgs
|
||||
ErrorCode = errorCode;
|
||||
ErrorDescription = errorDescription;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,18 +28,29 @@ public interface ICameraController : IDisposable
|
||||
void StopGrabbing();
|
||||
|
||||
double GetExposureTime();
|
||||
|
||||
void SetExposureTime(double microseconds);
|
||||
|
||||
double GetGain();
|
||||
|
||||
void SetGain(double value);
|
||||
|
||||
int GetWidth();
|
||||
|
||||
void SetWidth(int value);
|
||||
|
||||
int GetHeight();
|
||||
|
||||
void SetHeight(int value);
|
||||
|
||||
string GetPixelFormat();
|
||||
|
||||
void SetPixelFormat(string format);
|
||||
|
||||
event EventHandler<ImageGrabbedEventArgs> ImageGrabbed;
|
||||
|
||||
event EventHandler<GrabErrorEventArgs> GrabError;
|
||||
|
||||
event EventHandler ConnectionLost;
|
||||
}
|
||||
|
||||
@@ -50,4 +61,4 @@ public interface ICameraFactory
|
||||
{
|
||||
/// <summary>根据相机品牌创建控制器实例。</summary>
|
||||
ICameraController CreateController(string cameraType);
|
||||
}
|
||||
}
|
||||
@@ -31,4 +31,4 @@ public static class PixelConverter
|
||||
bitmap.Freeze();
|
||||
return bitmap;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user