feat: 使用SignalR来控制jtag边界扫描

This commit is contained in:
2025-08-01 19:55:55 +08:00
parent 2adeca3b99
commit 9adc5295f8
20 changed files with 973 additions and 571 deletions

View File

@@ -133,7 +133,7 @@ public class Board
/// </summary>
public enum BoardStatus
{
/// <summary>
/// <summary>
/// 未启用状态,无法被使用
/// </summary>
Disabled,
@@ -558,6 +558,31 @@ public class AppDataConnection : DataConnection
return new(boards[0]);
}
/// <summary>
/// 根据用户名获取实验板信息
/// </summary>
/// <param name="userName">用户名</param>
/// <returns>包含实验板信息的结果,如果未找到则返回空</returns>
public Result<Optional<Board>> GetBoardByUserName(string userName)
{
var boards = this.BoardTable.Where(board => board.OccupiedUserName == userName).ToArray();
if (boards.Length > 1)
{
logger.Error($"数据库中存在多个相同用户名的实验板: {userName}");
return new(new Exception($"数据库中存在多个相同用户名的实验板: {userName}"));
}
if (boards.Length == 0)
{
logger.Info($"未找到用户名对应的实验板: {userName}");
return new(Optional<Board>.None);
}
logger.Debug($"成功获取实验板信息: {userName}");
return new(boards[0]);
}
/// <summary>
/// 获取所有实验板信息
/// </summary>