From aa06408621c4ad2ac4f816e12b7855313a6a0404 Mon Sep 17 00:00:00 2001 From: zqm Date: Fri, 31 Oct 2025 11:20:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B8=A9=E5=BA=A6=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=EF=BC=9A=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E5=B8=A7=E5=A4=A7=E5=B0=8F=E8=AE=A1=E7=AE=97=EF=BC=88?= =?UTF-8?q?=E5=8C=85=E5=90=AB24=E5=AD=97=E8=8A=82=E5=A4=B4=E9=83=A8?= =?UTF-8?q?=EF=BC=89=E5=92=8C=E4=BD=BF=E7=94=A8=E6=AD=A3=E7=A1=AE=E7=9A=84?= =?UTF-8?q?=E5=88=86=E8=BE=A8=E7=8E=87=E5=8F=82=E6=95=B0=EF=BC=88256x192?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CS/Framework4.0/Toprie/Toprie/DeviceManager.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Windows/CS/Framework4.0/Toprie/Toprie/DeviceManager.cs b/Windows/CS/Framework4.0/Toprie/Toprie/DeviceManager.cs index 81bbdb9..799ddf0 100644 --- a/Windows/CS/Framework4.0/Toprie/Toprie/DeviceManager.cs +++ b/Windows/CS/Framework4.0/Toprie/Toprie/DeviceManager.cs @@ -1271,7 +1271,12 @@ namespace JoyD.Windows.CS.Toprie /// 累积的温度数据 private void ProcessReceivedTemperatureData(List dataAccumulator) { - const int TEMPERATURE_DATA_FRAME_SIZE = 256 * 192 * 2; // 假设分辨率为256x192,每个温度值2字节 + // 根据TemperatureData类的要求,每个温度帧包含24字节头部 + 温度数据 + // 根据注释,设备实际提供的数据分辨率应为256x192,最终映射到512x384显示 + const int WIDTH = 256; + const int HEIGHT = 192; + const int HEADER_SIZE = 24; + const int TEMPERATURE_DATA_FRAME_SIZE = HEADER_SIZE + WIDTH * HEIGHT * 2; // 24字节头部 + 每个温度值2字节 try { @@ -1285,10 +1290,8 @@ namespace JoyD.Windows.CS.Toprie // 获取温度补偿值 float compensationValue = GetTemperatureCompensationValue(); - // 创建温度数据对象,添加缺少的width和height参数 - const int width = 640; // 假设设备分辨率为640x480 - const int height = 480; - TemperatureData temperatureData = new TemperatureData(temperatureFrame, width, height, compensationValue); + // 创建温度数据对象,使用正确的分辨率参数 + TemperatureData temperatureData = new TemperatureData(temperatureFrame, WIDTH, HEIGHT, compensationValue); // 触发温度数据接收事件 OnTemperatureReceived(new TemperatureReceivedEventArgs(temperatureData, temperatureFrame, compensationValue));