规范类名及命名空间名称

This commit is contained in:
李伟
2026-04-13 14:35:37 +08:00
parent c430ec229b
commit ace1c70ddf
217 changed files with 1271 additions and 1384 deletions
+2 -5
View File
@@ -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.");
}
}
}
}
+31 -10
View File
@@ -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)
{
}
}
+1 -1
View File
@@ -15,4 +15,4 @@ public class CameraFactory : ICameraFactory
_ => throw new NotSupportedException($"不支持的相机品牌: {cameraType}")
};
}
}
}
+1 -1
View File
@@ -36,4 +36,4 @@ public class GrabErrorEventArgs : EventArgs
ErrorCode = errorCode;
ErrorDescription = errorDescription;
}
}
}
+12 -1
View File
@@ -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);
}
}
+1 -1
View File
@@ -31,4 +31,4 @@ public static class PixelConverter
bitmap.Freeze();
return bitmap;
}
}
}