正确显示区域框线,没收到温度数据时也显示
This commit is contained in:
@@ -601,7 +601,7 @@ namespace JoyD.Windows.CS.Toprie
|
||||
// 延迟启动相机,避免界面卡顿
|
||||
ThreadPool.QueueUserWorkItem(delegate
|
||||
{
|
||||
while(!IsDevicePingable)
|
||||
while (!IsDevicePingable)
|
||||
Thread.Sleep(3000); // 延迟3秒后启动
|
||||
_isFirst = false;
|
||||
this.Invoke(new Action(() =>
|
||||
@@ -2936,23 +2936,7 @@ namespace JoyD.Windows.CS.Toprie
|
||||
|
||||
if (_deviceManager.CurrentImageMode == ImageMode.Infrared)
|
||||
{
|
||||
// 2. 如果没有温度数据或温度数据的时间3秒之前,返回
|
||||
TemperatureData temperatureData = _deviceManager.LastTemperature;
|
||||
if (temperatureData == null || temperatureData.Timestamp == null)
|
||||
return;
|
||||
|
||||
TimeSpan timeDiff = DateTime.Now - temperatureData.Timestamp;
|
||||
if (timeDiff.TotalSeconds > 3)
|
||||
return;
|
||||
|
||||
// 3. 温度显示菜单下如果未勾选区域温度和全局温度,则不显示任何温度信息
|
||||
if (!_showGlobalTemperature && !_showAreaTemperature)
|
||||
return;
|
||||
|
||||
// 4. 如果勾选了全局温度且未勾选区域温度,则显示全局温度(居中显示),否则显示区域温度(居中显示)
|
||||
bool isGlobalTemperatureMode = _showGlobalTemperature && !_showAreaTemperature;
|
||||
|
||||
// 5. 如果勾选了区域温度,则显示区域框和编号,否则不显示区域框
|
||||
// 1. 先绘制区域框线,不受温度数据影响,只受显示设置影响
|
||||
if (_showAreaTemperature)
|
||||
{
|
||||
try
|
||||
@@ -2986,7 +2970,21 @@ namespace JoyD.Windows.CS.Toprie
|
||||
}
|
||||
}
|
||||
|
||||
// 6. 根据温度模式显示温度数据
|
||||
// 2. 温度数据绘制逻辑,仍受温度数据有效性影响
|
||||
TemperatureData temperatureData = _deviceManager.LastTemperature;
|
||||
if (temperatureData != null && temperatureData.Timestamp != null)
|
||||
{
|
||||
TimeSpan timeDiff = DateTime.Now - temperatureData.Timestamp;
|
||||
if (timeDiff.TotalSeconds <= 3)
|
||||
{
|
||||
// 3. 温度显示菜单下如果未勾选区域温度和全局温度,则不显示任何温度信息
|
||||
if (!_showGlobalTemperature && !_showAreaTemperature)
|
||||
return;
|
||||
|
||||
// 4. 如果勾选了全局温度且未勾选区域温度,则显示全局温度(居中显示),否则显示区域温度(居中显示)
|
||||
bool isGlobalTemperatureMode = _showGlobalTemperature && !_showAreaTemperature;
|
||||
|
||||
// 5. 根据温度模式显示温度数据
|
||||
if (isGlobalTemperatureMode)
|
||||
{
|
||||
// 准备温度文本
|
||||
@@ -3073,7 +3071,8 @@ namespace JoyD.Windows.CS.Toprie
|
||||
// 标记信息正在显示
|
||||
_isDisplayingInfo = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
private void SaveTemperatureToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
@@ -3208,5 +3207,5 @@ namespace JoyD.Windows.CS.Toprie
|
||||
MessageBox.Show($"打开配置窗口时出错: {ex.Message}", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user