fix: 修复Debugger处理数据时,最终转化为字节时出现的转化问题
This commit is contained in:
		@@ -406,13 +406,15 @@ public class DebuggerController : ControllerBase
 | 
			
		||||
                        return StatusCode(StatusCodes.Status500InternalServerError, "数据越界");
 | 
			
		||||
                    }
 | 
			
		||||
                    var sampleBytes = rawData[sampleOffset..(sampleOffset + 4)];
 | 
			
		||||
                    UInt32 sample = BitConverter.ToUInt32(Common.Number.ReverseBytes(sampleBytes, 4).Value, 0);
 | 
			
		||||
                    UInt32 sample = Common.Number.BytesToUInt32(sampleBytes, true).Value;
 | 
			
		||||
                    // 提取wireWidth位
 | 
			
		||||
                    UInt32 mask = (wireWidth == 32) ? 0xFFFFFFFF : ((1u << wireWidth) - 1u);
 | 
			
		||||
                    channelUintArr[i] = (sample >> wireStart) & mask;
 | 
			
		||||
                }
 | 
			
		||||
                logger.Debug($"{channel.name} HexData: {BitConverter.ToString(channelUintArr.SelectMany(BitConverter.GetBytes).ToArray())}");
 | 
			
		||||
                var base64 = Convert.ToBase64String(channelUintArr.SelectMany(BitConverter.GetBytes).ToArray());
 | 
			
		||||
                var channelBytes = new byte[4 * depth];
 | 
			
		||||
                Buffer.BlockCopy(channelUintArr, 0, channelBytes, 0, channelBytes.Length);
 | 
			
		||||
                logger.Debug($"{channel.name} HexData: {BitConverter.ToString(channelBytes)}");
 | 
			
		||||
                var base64 = Convert.ToBase64String(channelBytes);
 | 
			
		||||
                channelDataList.Add(new ChannelCaptureData { name = channel.name, data = base64 });
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user