fix: 修改commandID,并修复七段数码管的配置问题

This commit is contained in:
SikongJueluo 2025-08-21 20:58:23 +08:00
parent e5b492247c
commit 78dcc5a629
9 changed files with 37 additions and 28 deletions

View File

@ -41,7 +41,7 @@ public class DebuggerController : ControllerBase
return null;
var board = boardRet.Value.Value;
return new DebuggerClient(board.IpAddr, board.Port, 1);
return new DebuggerClient(board.IpAddr, board.Port, 7);
}
catch (Exception ex)
{

View File

@ -41,7 +41,7 @@ public class LogicAnalyzerController : ControllerBase
return null;
var board = boardRet.Value.Value;
return new Analyzer(board.IpAddr, board.Port, 0);
return new Analyzer(board.IpAddr, board.Port, 11);
}
catch (Exception ex)
{

View File

@ -168,7 +168,7 @@ public class DigitalTubesHub : Hub<IDigitalTubesReceiver>, IDigitalTubesHub
var cts = new CancellationTokenSource();
var scanTaskInfo = new DigitalTubesScanTaskInfo(
board.ID.ToString(), Context.ConnectionId,
new SevenDigitalTubesCtrl(board.IpAddr, board.Port, 0)
new SevenDigitalTubesCtrl(board.IpAddr, board.Port, 6)
);
scanTaskInfo.ScanTask = ScanAllTubes(scanTaskInfo);

View File

@ -20,7 +20,7 @@ public class Camera
private static readonly NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
readonly int timeout = 500;
readonly int taskID;
readonly int taskID = 8;
readonly int port;
readonly string address;
private IPEndPoint ep;

View File

@ -0,0 +1,8 @@
示波器12
逻辑分析仪: 11
Jtag: 10
矩阵键盘1
HDMI9
Camera: 8
Debugger: 7
七段数码港6

View File

@ -385,6 +385,7 @@ public class Jtag
private const int CLOCK_FREQ = 50; // MHz
readonly int timeout;
readonly int taskID = 10;
readonly int port;
/// <summary>
@ -415,7 +416,7 @@ public class Jtag
{
BurstType = BurstType.FixedBurst,
BurstLength = 0,
CommandID = 0,
CommandID = (byte)this.taskID,
Address = devAddr,
IsWrite = false,
};
@ -429,7 +430,7 @@ public class Jtag
if (!MsgBus.IsRunning)
return new(new Exception("Message Bus not Working!"));
var retPack = await MsgBus.UDPServer.WaitForDataAsync(this.ep, 0, this.timeout);
var retPack = await MsgBus.UDPServer.WaitForDataAsync(this.ep, this.taskID, this.timeout);
if (!retPack.IsSuccessful || !retPack.Value.IsSuccessful)
return new(new Exception("Send address package failed"));
@ -449,7 +450,7 @@ public class Jtag
UInt32 resultMask = 0xFF_FF_FF_FF, UInt32 delayMilliseconds = 0, string progressId = "")
{
{
var ret = await UDPClientPool.WriteAddr(this.ep, 0, devAddr, data, this.timeout, progressId);
var ret = await UDPClientPool.WriteAddr(this.ep, this.taskID, devAddr, data, this.timeout, progressId);
if (!ret.IsSuccessful) return new(ret.Error);
if (!ret.Value) return new(new Exception("Write FIFO failed"));
}
@ -458,7 +459,7 @@ public class Jtag
await Task.Delay(TimeSpan.FromMilliseconds(delayMilliseconds));
{
var ret = await UDPClientPool.ReadAddrWithWait(this.ep, 0, JtagAddr.STATE, result, resultMask, 0, this.timeout);
var ret = await UDPClientPool.ReadAddrWithWait(this.ep, this.taskID, JtagAddr.STATE, result, resultMask, 0, this.timeout);
if (!ret.IsSuccessful) return new(ret.Error);
_progressTracker?.AdvanceProgress(progressId, 10);
return ret.Value;
@ -471,7 +472,7 @@ public class Jtag
{
{
var ret = await UDPClientPool.WriteAddr(
this.ep, 0, devAddr, data, this.timeout, progressId);
this.ep, this.taskID, devAddr, data, this.timeout, progressId);
if (!ret.IsSuccessful) return new(ret.Error);
if (!ret.Value) return new(new Exception("Write FIFO failed"));
}
@ -480,7 +481,7 @@ public class Jtag
await Task.Delay(TimeSpan.FromMilliseconds(delayMilliseconds));
{
var ret = await UDPClientPool.ReadAddrWithWait(this.ep, 0, JtagAddr.STATE, result, resultMask, 0, this.timeout);
var ret = await UDPClientPool.ReadAddrWithWait(this.ep, this.taskID, JtagAddr.STATE, result, resultMask, 0, this.timeout);
if (!ret.IsSuccessful) return new(ret.Error);
_progressTracker.AdvanceProgress(progressId, 10);
return ret.Value;
@ -625,7 +626,7 @@ public class Jtag
if (ret.Value)
{
var array = new UInt32[UInt32Num];
var retData = await UDPClientPool.ReadAddr4Bytes(ep, 0, JtagAddr.READ_DATA, (int)UInt32Num);
var retData = await UDPClientPool.ReadAddr4Bytes(ep, this.taskID, JtagAddr.READ_DATA, (int)UInt32Num);
if (!retData.IsSuccessful)
return new(new Exception("Read FIFO failed when Load DR"));
Buffer.BlockCopy(retData.Value, 0, array, 0, (int)UInt32Num * 4);
@ -642,9 +643,9 @@ public class Jtag
public async ValueTask<Result<uint>> ReadIDCode()
{
// Clear Data
MsgBus.UDPServer.ClearUDPData(this.address, 0);
MsgBus.UDPServer.ClearUDPData(this.address, this.taskID);
logger.Trace($"Clear up udp server {this.address,0} receive data");
logger.Trace($"Clear up udp server {this.address} {this.taskID} receive data");
Result<bool> ret;
@ -680,9 +681,9 @@ public class Jtag
public async ValueTask<Result<uint>> ReadStatusReg()
{
// Clear Data
MsgBus.UDPServer.ClearUDPData(this.address, 0);
MsgBus.UDPServer.ClearUDPData(this.address, this.taskID);
logger.Trace($"Clear up udp server {this.address,0} receive data");
logger.Trace($"Clear up udp server {this.address} {this.taskID} receive data");
Result<bool> ret;
@ -719,9 +720,9 @@ public class Jtag
byte[] bitstream, string progressId = "")
{
// Clear Data
MsgBus.UDPServer.ClearUDPData(this.address, 0);
MsgBus.UDPServer.ClearUDPData(this.address, this.taskID);
logger.Trace($"Clear up udp server {this.address,0} receive data");
logger.Trace($"Clear up udp server {this.address} {this.taskID} receive data");
_progressTracker.AdvanceProgress(progressId, 10);
@ -819,9 +820,9 @@ public class Jtag
logger.Debug($"Get boundary scan registers number: {portNum}");
// Clear Data
MsgBus.UDPServer.ClearUDPData(this.address, 0);
MsgBus.UDPServer.ClearUDPData(this.address, this.taskID);
logger.Trace($"Clear up udp server {this.address,0} receive data");
logger.Trace($"Clear up udp server {this.address} {this.taskID} receive data");
Result<bool> ret;
@ -886,9 +887,9 @@ public class Jtag
public async ValueTask<Result<bool>> SetSpeed(UInt32 speed)
{
// Clear Data
MsgBus.UDPServer.ClearUDPData(this.address, 0);
MsgBus.UDPServer.ClearUDPData(this.address, this.taskID);
logger.Trace($"Clear up udp server {this.address,0} receive data");
logger.Trace($"Clear up udp server {this.address} {this.taskID} receive data");
var ret = await WriteFIFO(
JtagAddr.SPEED_CTRL, (speed << 16) | speed,

View File

@ -87,7 +87,7 @@ class OscilloscopeCtrl
private static readonly NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
readonly int timeout = 2000;
readonly int taskID = 0;
readonly int taskID = 12;
readonly int port;
readonly string address;

View File

@ -138,7 +138,7 @@ public class HttpHdmiVideoStreamService : BackgroundService
client = new HdmiVideoStreamClient()
{
HdmiInClient = new HdmiIn(board.IpAddr, board.Port, 1),
HdmiInClient = new HdmiIn(board.IpAddr, board.Port, 9),
// JpegClient = new Jpeg(board.IpAddr, board.Port, 1),
CTS = new CancellationTokenSource(),
Offset = 0

View File

@ -98,7 +98,7 @@ const props = withDefaults(defineProps<Props>(), {
size: 1,
color: "red",
enableDigitalTwin: false,
digitalTwinNum: 0,
digitalTwinNum: 1,
afterglowDuration: 500,
cathodeType: "common",
pins: () => [
@ -179,7 +179,7 @@ const eqps = useEquipments();
async function initDigitalTwin() {
if (
!props.enableDigitalTwin ||
props.digitalTwinNum < 0 ||
props.digitalTwinNum <= 0 ||
props.digitalTwinNum > 31
)
return;
@ -200,12 +200,12 @@ watch(
() => {
if (
!eqps.sevenSegmentDisplayData ||
props.digitalTwinNum < 0 ||
props.digitalTwinNum <= 0 ||
props.digitalTwinNum > 31
)
return;
handleDigitalTwinData(eqps.sevenSegmentDisplayData[props.digitalTwinNum]);
handleDigitalTwinData(eqps.sevenSegmentDisplayData[props.digitalTwinNum - 1]);
},
);
@ -394,7 +394,7 @@ export function getDefaultProps() {
size: 1,
color: "red",
enableDigitalTwin: false,
digitalTwinNum: 0,
digitalTwinNum: 1,
afterglowDuration: 500,
cathodeType: "common",
pins: [