can修改

This commit is contained in:
2026-09-12 20:31:45 +08:00
parent 4acb4d8d13
commit c4fc2d80fd
4 changed files with 689 additions and 5 deletions
+5 -1
View File
@@ -636,11 +636,14 @@ namespace CANModule.ViewModels
{
// 提取实际 CAN ID(去掉扩展帧标志位)
int actualId = (int)(canId & 0x1FFFFFFF);
// 原始字节转为 [0x00, 0x01, ...] 格式,供监视表格直接显示
string hexData = 十六进制字符串转换(data);
var find = CanMessageList.FirstOrDefault(s => s.报文ID == actualId && s.通道 == channel);
if (find != null)
{
find.时间戳 = (ulong)DateTimeOffset.Now.ToUnixTimeMilliseconds();
find.长度 = dlcLength;
find.数据 = hexData;
}
else
{
@@ -649,7 +652,8 @@ namespace CANModule.ViewModels
通道 = (byte)channel,
报文ID = actualId,
时间戳 = (ulong)DateTimeOffset.Now.ToUnixTimeMilliseconds(),
长度 = dlcLength
长度 = dlcLength,
数据 = hexData
});
}
});