加日志
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user