From 5fc4b0d01d59b6a72c30b5d8f03996b401cb4480 Mon Sep 17 00:00:00 2001 From: zqm Date: Wed, 21 Jan 2026 15:24:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Toprie/Toprie/DeviceManager.cs | 9 +++++++ .../CS/Framework4.0/Toprie/Toprie/preview.cs | 27 ++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/Windows/CS/Framework4.0/Toprie/Toprie/DeviceManager.cs b/Windows/CS/Framework4.0/Toprie/Toprie/DeviceManager.cs index 428d87c..4e1ffea 100644 --- a/Windows/CS/Framework4.0/Toprie/Toprie/DeviceManager.cs +++ b/Windows/CS/Framework4.0/Toprie/Toprie/DeviceManager.cs @@ -2331,6 +2331,15 @@ namespace JoyD.Windows.CS.Toprie // 添加到温度数据对象中 temperatureData.ZoneTemperatures[zone.Index] = zoneTempData; + + // 针对测温区1添加详细日志 + if (zone.Index == 1) + { + Console.WriteLine($"测温区1信息 - 坐标: ({absoluteX},{absoluteY}), 大小: {absoluteWidth}x{absoluteHeight}"); + Console.WriteLine($"测温区1温度 - 最高: {maxTemp:F2} °C, 最低: {minTemp:F2} °C, 平均: {sumTemp / count:F2} °C"); + Console.WriteLine($"测温区1使用的温度矩阵: RealTemperatureMatrix"); + Console.WriteLine($"测温区1遍历的像素点数量: {count}"); + } } } catch (Exception ex) diff --git a/Windows/CS/Framework4.0/Toprie/Toprie/preview.cs b/Windows/CS/Framework4.0/Toprie/Toprie/preview.cs index deeaa23..1c7cb06 100644 --- a/Windows/CS/Framework4.0/Toprie/Toprie/preview.cs +++ b/Windows/CS/Framework4.0/Toprie/Toprie/preview.cs @@ -209,6 +209,9 @@ namespace JoyD.Windows.CS // 映射到原始数据点坐标 Point dataPoint = MapToDataPoint(imagePoint); + // 添加鼠标移动日志 + Console.WriteLine($"鼠标移动 - 控件坐标: ({e.Location.X},{e.Location.Y}), 图像坐标: ({imagePoint.X},{imagePoint.Y}), 数据点: ({dataPoint.X},{dataPoint.Y})"); + // 使用锁保护_currentDataPoint的访问 lock (_dataPointLock) { @@ -294,7 +297,29 @@ namespace JoyD.Windows.CS if (x >= 0 && x < _temperatureData.TemperatureMatrix.GetLength(1) && // 列索引有效 y >= 0 && y < _temperatureData.TemperatureMatrix.GetLength(0)) // 行索引有效 { - return _temperatureData.TemperatureMatrix[y, x]; // [行][列]访问 + float temperature = _temperatureData.TemperatureMatrix[y, x]; // [行][列]访问 + + // 添加鼠标位置温度日志 + Console.WriteLine($"鼠标位置温度 - 数据点: ({x},{y}), 温度: {temperature:F2} °C, 使用矩阵: TemperatureMatrix"); + + // 同时记录RealTemperatureMatrix中的对应温度(如果可用) + if (_temperatureData.RealTemperatureMatrix != null) + { + int realX = x * 2; + int realY = y * 2; + if (realX >= 0 && realX < _temperatureData.RealTemperatureMatrix.GetLength(1) && + realY >= 0 && realY < _temperatureData.RealTemperatureMatrix.GetLength(0)) + { + float realTemp = _temperatureData.RealTemperatureMatrix[realY, realX]; + Console.WriteLine($"对应RealTemperatureMatrix温度 - 坐标: ({realX},{realY}), 温度: {realTemp:F2} °C"); + if (Math.Abs(temperature - realTemp) > 0.1f) + { + Console.WriteLine($"温度差异: {Math.Abs(temperature - realTemp):F2} °C"); + } + } + } + + return temperature; } return float.NaN;