增加检测区配置和公共类定义

This commit is contained in:
zqm
2026-01-08 10:30:32 +08:00
parent 44c593941f
commit 5af285fd92
4 changed files with 138 additions and 66 deletions

View File

@@ -0,0 +1,136 @@
using System;
using System.Collections.Generic;
using System.Drawing;
namespace JoyD.Windows.CS
{
/// <summary>
/// 检测区配置类,用于存储检测区的信息
/// </summary>
public class DetectionZone
{
/// <summary>
/// 检测区X坐标
/// </summary>
public int X { get; set; }
/// <summary>
/// 检测区Y坐标
/// </summary>
public int Y { get; set; }
/// <summary>
/// 检测区宽度
/// </summary>
public int Width { get; set; }
/// <summary>
/// 检测区高度
/// </summary>
public int Height { get; set; }
/// <summary>
/// 检测区颜色
/// </summary>
public Color Color { get; set; }
/// <summary>
/// 检测区配置类的默认构造函数
/// </summary>
public DetectionZone()
{
X = 0;
Y = 0;
Width = 512;
Height = 384;
Color = Color.Black;
}
}
/// <summary>
/// 测温区配置类,用于存储测温区的信息
/// </summary>
public class TemperatureZone
{
/// <summary>
/// 测温区索引
/// </summary>
public int Index { get; set; }
/// <summary>
/// 测温区X坐标
/// </summary>
public int X { get; set; }
/// <summary>
/// 测温区Y坐标
/// </summary>
public int Y { get; set; }
/// <summary>
/// 测温区宽度
/// </summary>
public int Width { get; set; }
/// <summary>
/// 测温区高度
/// </summary>
public int Height { get; set; }
/// <summary>
/// 测温区颜色
/// </summary>
public Color Color { get; set; }
}
/// <summary>
/// 温差配置类,用于存储温差图的配置信息
/// </summary>
public class TemperatureDiffConfig
{
/// <summary>
/// 温差图例列表,存储温度值和对应颜色
/// </summary>
public List<Tuple<double, Color>> TemperatureLegend { get; set; }
/// <summary>
/// 像素温度数据字典,存储每个像素点的温度值
/// </summary>
public Dictionary<Point, double> PixelTemperatureData { get; set; }
/// <summary>
/// 温差配置类的默认构造函数
/// </summary>
public TemperatureDiffConfig()
{
TemperatureLegend = new List<Tuple<double, Color>>();
PixelTemperatureData = new Dictionary<Point, double>();
}
}
/// <summary>
/// 区域信息类,用于存储绘制的区域信息
/// </summary>
public class RegionInfo
{
/// <summary>
/// 区域索引
/// </summary>
public int Index { get; set; }
/// <summary>
/// 区域颜色
/// </summary>
public Color Color { get; set; }
/// <summary>
/// 区域矩形(图像坐标)
/// </summary>
public Rectangle ImageRectangle { get; set; }
/// <summary>
/// 区域矩形(控件坐标)
/// </summary>
public Rectangle ControlRectangle { get; set; }
}
}

View File

@@ -8,6 +8,7 @@ using System.Net.Sockets;
using System.IO; using System.IO;
using System.Threading; using System.Threading;
using System.Drawing; using System.Drawing;
using JoyD.Windows.CS;
namespace JoyD.Windows.CS.Toprie namespace JoyD.Windows.CS.Toprie
{ {
@@ -263,61 +264,6 @@ namespace JoyD.Windows.CS.Toprie
} }
} }
/// <summary>
/// 测温区配置类
/// </summary>
public class TemperatureZone
{
/// <summary>
/// 测温区索引
/// </summary>
public int Index { get; set; }
/// <summary>
/// 测温区X坐标
/// </summary>
public int X { get; set; }
/// <summary>
/// 测温区Y坐标
/// </summary>
public int Y { get; set; }
/// <summary>
/// 测温区宽度
/// </summary>
public int Width { get; set; }
/// <summary>
/// 测温区高度
/// </summary>
public int Height { get; set; }
/// <summary>
/// 测温区颜色
/// </summary>
public Color Color { get; set; }
}
/// <summary>
/// 温差配置类
/// </summary>
public class TemperatureDiffConfig
{
/// <summary>
/// 温度图例数据
/// </summary>
public List<Tuple<double, Color>> TemperatureLegend { get; set; }
/// <summary>
/// 像素温度数据
/// </summary>
public Dictionary<Point, double> PixelTemperatureData { get; set; }
/// <summary>
/// 初始化温差配置类
/// </summary>
public TemperatureDiffConfig()
{
TemperatureLegend = new List<Tuple<double, Color>>();
PixelTemperatureData = new Dictionary<Point, double>();
}
}
/// <summary> /// <summary>
/// 设备管理器类,负责设备的连接、管理和通信 /// 设备管理器类,负责设备的连接、管理和通信
/// </summary> /// </summary>

View File

@@ -2189,17 +2189,6 @@ namespace JoyD.Windows.CS
} }
} }
/// <summary>
/// 存储区域信息的类,包含矩形框(图像坐标)、颜色和序号
/// </summary>
private class RegionInfo
{
// 存储相对于图像的矩形坐标
public Rectangle ImageRectangle { get; set; }
public Color Color { get; set; }
public int Index { get; set; }
}
/// <summary> /// <summary>
/// 创建或更新叠加层图像(完全重绘) /// 创建或更新叠加层图像(完全重绘)
/// 仅在必要时调用,如图像尺寸改变或需要完全重绘 /// 仅在必要时调用,如图像尺寸改变或需要完全重绘

View File

@@ -74,6 +74,7 @@
<Compile Include="Camera.Designer.cs"> <Compile Include="Camera.Designer.cs">
<DependentUpon>Camera.cs</DependentUpon> <DependentUpon>Camera.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="CommonTypes.cs" />
<Compile Include="DeviceManager.cs" /> <Compile Include="DeviceManager.cs" />
<Compile Include="preview.cs"> <Compile Include="preview.cs">
<SubType>Form</SubType> <SubType>Form</SubType>