增加检测区配置和公共类定义
This commit is contained in:
136
Windows/CS/Framework4.0/Toprie/Toprie/CommonTypes.cs
Normal file
136
Windows/CS/Framework4.0/Toprie/Toprie/CommonTypes.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ using System.Net.Sockets;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Drawing;
|
||||
using JoyD.Windows.CS;
|
||||
|
||||
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>
|
||||
|
||||
@@ -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>
|
||||
/// 创建或更新叠加层图像(完全重绘)
|
||||
/// 仅在必要时调用,如图像尺寸改变或需要完全重绘
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
<Compile Include="Camera.Designer.cs">
|
||||
<DependentUpon>Camera.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CommonTypes.cs" />
|
||||
<Compile Include="DeviceManager.cs" />
|
||||
<Compile Include="preview.cs">
|
||||
<SubType>Form</SubType>
|
||||
|
||||
Reference in New Issue
Block a user