feat: 提交前端逻辑分析仪后台捕获;Camera现在可以以更高帧率运行

This commit is contained in:
alivender
2025-07-16 21:14:23 +08:00
parent d551cbe793
commit 8e19587a16
8 changed files with 378 additions and 316 deletions

View File

@@ -1,5 +1,6 @@
using System.Collections;
using System.Net;
using Common;
using DotNext;
namespace Peripherals.LogicAnalyzerClient;
@@ -23,17 +24,17 @@ static class AnalyzerAddr
/// 10: 全局非与(~&amp;) <br/>
/// 11: 全局非或(~&#124;) <br/>
/// </summary>
public const UInt32 GLOBAL_TRIG_MODE = BASE + 0x0000_0000;
public const UInt32 GLOBAL_TRIG_MODE = BASE + 0x0000_0001;
/// <summary>
/// 0x0000_0010 - 0x0000_0017 R/W [5:0] 信号M的触发操作符共8路 <br/>
/// [2:0] M's Operator: 000 == <br/>
/// [5:3] M's Operator: 000 == <br/>
/// 001 != <br/>
/// 010 &lt; <br/>
/// 011 &lt;= <br/>
/// 100 &gt; <br/>
/// 101 &gt;= <br/>
/// [5:3] M's Value: 000 LOGIC 0 <br/>
/// [2:0] M's Value: 000 LOGIC 0 <br/>
/// 001 LOGIC 1 <br/>
/// 010 X(not care) <br/>
/// 011 RISE <br/>
@@ -266,7 +267,7 @@ public class Analyzer
logger.Error("ReadAddr returned invalid data for capture status");
return new(new Exception("Failed to read capture status"));
}
UInt32 status = BitConverter.ToUInt32(ret.Value.Options.Data, 0);
UInt32 status = Number.BytesToUInt32(ret.Value.Options.Data).Value;
return (CaptureStatus)status;
}
@@ -304,8 +305,8 @@ public class Analyzer
if (signalIndex < 0 || signalIndex >= AnalyzerAddr.SIGNAL_TRIG_MODE.Length)
return new(new ArgumentException($"Signal index must be 0~{AnalyzerAddr.SIGNAL_TRIG_MODE.Length}"));
// 计算模式值: [2:0] 操作符, [5:3] 信号值
UInt32 mode = ((UInt32)val << 3) | (UInt32)op;
// 计算模式值: [2:0] 信号值, [5:3] 操作符
UInt32 mode = ((UInt32)op << 3) | (UInt32) val;
var addr = AnalyzerAddr.SIGNAL_TRIG_MODE[signalIndex];
var ret = await UDPClientPool.WriteAddr(this.ep, this.taskID, addr, mode, this.timeout);