提交位移台和对焦系统代码
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
namespace HardwareControl.Core.FocusSystem
|
||||
{
|
||||
/// <summary>
|
||||
/// 定焦系统上传的系统信息(0xF5)解析结果。
|
||||
/// </summary>
|
||||
/// <param name="FocusPosition">对焦校准位置。</param>
|
||||
/// <param name="Error">设备端错误码:0=无错误,11=测距超时,12=超负极限,13=超正极限。</param>
|
||||
/// <param name="ErrorDescription">错误码的中文描述。</param>
|
||||
/// <param name="Location">滑台位置。</param>
|
||||
/// <param name="LaserOnline">激光器是否在线。</param>
|
||||
/// <param name="VoltageVolts">电源电压(V)。</param>
|
||||
/// <param name="ExtendedVoltageVolts">扩展板电压(V)。</param>
|
||||
/// <param name="HardwareVersion">硬件版本号。</param>
|
||||
/// <param name="SoftwareVersion">软件版本号。</param>
|
||||
/// <param name="StartTimeMinutes">开机时间(分钟)。</param>
|
||||
/// <param name="SyncTime">同步延时。</param>
|
||||
/// <param name="IsDebugMode">是否处于 Debug 模式(sys_sta 非 0)。</param>
|
||||
/// <param name="ReceivedAt">本机解析到该帧的时间。</param>
|
||||
public sealed record FocusSystemStatus(
|
||||
int FocusPosition,
|
||||
int Error,
|
||||
string ErrorDescription,
|
||||
int Location,
|
||||
bool LaserOnline,
|
||||
double VoltageVolts,
|
||||
double ExtendedVoltageVolts,
|
||||
int HardwareVersion,
|
||||
int SoftwareVersion,
|
||||
int StartTimeMinutes,
|
||||
int SyncTime,
|
||||
bool IsDebugMode,
|
||||
DateTimeOffset ReceivedAt)
|
||||
{
|
||||
public static string DescribeError(int error) => error switch
|
||||
{
|
||||
0 => "无错误",
|
||||
11 => "测距超时",
|
||||
12 => "超负极限",
|
||||
13 => "超正极限",
|
||||
_ => $"未知错误({error})",
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user