feat: 完善部分jtag边界扫描websocket代码
This commit is contained in:
parent
9fe0ee959f
commit
2e9e378457
|
@ -1,4 +1,6 @@
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Cors;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using Microsoft.AspNetCore.SignalR;
|
using Microsoft.AspNetCore.SignalR;
|
||||||
using DotNext;
|
using DotNext;
|
||||||
|
@ -23,6 +25,7 @@ public interface IJtagReceiver
|
||||||
}
|
}
|
||||||
|
|
||||||
[Authorize]
|
[Authorize]
|
||||||
|
[EnableCors("Users")]
|
||||||
public class JtagHub : Hub<IJtagReceiver>, IJtagHub
|
public class JtagHub : Hub<IJtagReceiver>, IJtagHub
|
||||||
{
|
{
|
||||||
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
||||||
|
|
|
@ -439,7 +439,7 @@ public class Jtag
|
||||||
if (retPackLen != 4)
|
if (retPackLen != 4)
|
||||||
return new(new Exception($"RecvDataPackage BodyData Length not Equal to 4: Total {retPackLen} bytes"));
|
return new(new Exception($"RecvDataPackage BodyData Length not Equal to 4: Total {retPackLen} bytes"));
|
||||||
|
|
||||||
return Convert.ToUInt32(Common.Number.BytesToUInt64(retPackOpts.Data).Value);
|
return Convert.ToUInt32(Common.Number.BytesToUInt32(retPackOpts.Data).Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
async ValueTask<Result<bool>> WriteFIFO
|
async ValueTask<Result<bool>> WriteFIFO
|
||||||
|
|
|
@ -336,7 +336,7 @@ public class UDPClientPool
|
||||||
$"Device {address} receive data is {retData.Length} bytes instead of 4 bytes"));
|
$"Device {address} receive data is {retData.Length} bytes instead of 4 bytes"));
|
||||||
|
|
||||||
// Check result
|
// Check result
|
||||||
var retCode = Convert.ToUInt32(Common.Number.BytesToUInt64(retData).Value);
|
var retCode = Convert.ToUInt32(Common.Number.BytesToUInt32(retData).Value);
|
||||||
if (Common.Number.BitsCheck(retCode, result, resultMask)) return true;
|
if (Common.Number.BitsCheck(retCode, result, resultMask)) return true;
|
||||||
}
|
}
|
||||||
catch (Exception error)
|
catch (Exception error)
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
<UploadCard
|
<UploadCard
|
||||||
class="bg-base-200"
|
|
||||||
:upload-event="eqps.jtagUploadBitstream"
|
:upload-event="eqps.jtagUploadBitstream"
|
||||||
:download-event="eqps.jtagDownloadBitstream"
|
:download-event="eqps.jtagDownloadBitstream"
|
||||||
:bitstream-file="eqps.jtagBitstream"
|
:bitstream-file="eqps.jtagBitstream"
|
||||||
|
|
|
@ -29,7 +29,7 @@ export const useEquipments = defineStore("equipments", () => {
|
||||||
new Error("JtagClient Mutex Timeout!"),
|
new Error("JtagClient Mutex Timeout!"),
|
||||||
);
|
);
|
||||||
const jtagHubConnection = new HubConnectionBuilder()
|
const jtagHubConnection = new HubConnectionBuilder()
|
||||||
.withUrl("/hubs/JtagHub")
|
.withUrl("http://localhost:5000/hubs/JtagHub")
|
||||||
.withAutomaticReconnect()
|
.withAutomaticReconnect()
|
||||||
.build();
|
.build();
|
||||||
const jtagHubProxy =
|
const jtagHubProxy =
|
||||||
|
@ -43,7 +43,7 @@ export const useEquipments = defineStore("equipments", () => {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
jtagHubConnection.start();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Matrix Key
|
// Matrix Key
|
||||||
|
@ -87,6 +87,7 @@ export const useEquipments = defineStore("equipments", () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function jtagBoundaryScanSetOnOff(enable: boolean) {
|
async function jtagBoundaryScanSetOnOff(enable: boolean) {
|
||||||
|
jtagHubConnection.start();
|
||||||
enableJtagBoundaryScan.value = enable;
|
enableJtagBoundaryScan.value = enable;
|
||||||
if (enable) {
|
if (enable) {
|
||||||
jtagHubProxy.startBoundaryScan(jtagBoundaryScanFreq.value);
|
jtagHubProxy.startBoundaryScan(jtagBoundaryScanFreq.value);
|
||||||
|
|
|
@ -306,8 +306,8 @@ async function checkAndInitializeBoard() {
|
||||||
|
|
||||||
// 根据实验板信息更新equipment store
|
// 根据实验板信息更新equipment store
|
||||||
function updateEquipmentFromBoard(board: Board) {
|
function updateEquipmentFromBoard(board: Board) {
|
||||||
equipments.setAddr(board.ipAddr);
|
equipments.boardAddr = board.ipAddr;
|
||||||
equipments.setPort(board.port);
|
equipments.boardPort = board.port;
|
||||||
|
|
||||||
console.log(`实验板信息已更新到equipment store:`, {
|
console.log(`实验板信息已更新到equipment store:`, {
|
||||||
address: board.ipAddr,
|
address: board.ipAddr,
|
||||||
|
|
Loading…
Reference in New Issue