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));