From 5af285fd92a5fecd876c34b68992c12b4ba1741c Mon Sep 17 00:00:00 2001 From: zqm Date: Thu, 8 Jan 2026 10:30:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A3=80=E6=B5=8B=E5=8C=BA?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=92=8C=E5=85=AC=E5=85=B1=E7=B1=BB=E5=AE=9A?= =?UTF-8?q?=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Framework4.0/Toprie/Toprie/CommonTypes.cs | 136 ++++++++++++++++++ .../Toprie/Toprie/DeviceManager.cs | 56 +------- .../CS/Framework4.0/Toprie/Toprie/Setting.cs | 11 -- .../Framework4.0/Toprie/Toprie/Toprie.csproj | 1 + 4 files changed, 138 insertions(+), 66 deletions(-) create mode 100644 Windows/CS/Framework4.0/Toprie/Toprie/CommonTypes.cs diff --git a/Windows/CS/Framework4.0/Toprie/Toprie/CommonTypes.cs b/Windows/CS/Framework4.0/Toprie/Toprie/CommonTypes.cs new file mode 100644 index 0000000..f0a7922 --- /dev/null +++ b/Windows/CS/Framework4.0/Toprie/Toprie/CommonTypes.cs @@ -0,0 +1,136 @@ +using System; +using System.Collections.Generic; +using System.Drawing; + +namespace JoyD.Windows.CS +{ + /// + /// 检测区配置类,用于存储检测区的信息 + /// + public class DetectionZone + { + /// + /// 检测区X坐标 + /// + public int X { get; set; } + + /// + /// 检测区Y坐标 + /// + public int Y { get; set; } + + /// + /// 检测区宽度 + /// + public int Width { get; set; } + + /// + /// 检测区高度 + /// + public int Height { get; set; } + + /// + /// 检测区颜色 + /// + public Color Color { get; set; } + + /// + /// 检测区配置类的默认构造函数 + /// + public DetectionZone() + { + X = 0; + Y = 0; + Width = 512; + Height = 384; + Color = Color.Black; + } + } + + /// + /// 测温区配置类,用于存储测温区的信息 + /// + public class TemperatureZone + { + /// + /// 测温区索引 + /// + public int Index { get; set; } + + /// + /// 测温区X坐标 + /// + public int X { get; set; } + + /// + /// 测温区Y坐标 + /// + public int Y { get; set; } + + /// + /// 测温区宽度 + /// + public int Width { get; set; } + + /// + /// 测温区高度 + /// + public int Height { get; set; } + + /// + /// 测温区颜色 + /// + public Color Color { get; set; } + } + + /// + /// 温差配置类,用于存储温差图的配置信息 + /// + public class TemperatureDiffConfig + { + /// + /// 温差图例列表,存储温度值和对应颜色 + /// + public List> TemperatureLegend { get; set; } + + /// + /// 像素温度数据字典,存储每个像素点的温度值 + /// + public Dictionary PixelTemperatureData { get; set; } + + /// + /// 温差配置类的默认构造函数 + /// + public TemperatureDiffConfig() + { + TemperatureLegend = new List>(); + PixelTemperatureData = new Dictionary(); + } + } + + /// + /// 区域信息类,用于存储绘制的区域信息 + /// + public class RegionInfo + { + /// + /// 区域索引 + /// + public int Index { get; set; } + + /// + /// 区域颜色 + /// + public Color Color { get; set; } + + /// + /// 区域矩形(图像坐标) + /// + public Rectangle ImageRectangle { get; set; } + + /// + /// 区域矩形(控件坐标) + /// + public Rectangle ControlRectangle { get; set; } + } +} \ No newline at end of file diff --git a/Windows/CS/Framework4.0/Toprie/Toprie/DeviceManager.cs b/Windows/CS/Framework4.0/Toprie/Toprie/DeviceManager.cs index d022310..b23e708 100644 --- a/Windows/CS/Framework4.0/Toprie/Toprie/DeviceManager.cs +++ b/Windows/CS/Framework4.0/Toprie/Toprie/DeviceManager.cs @@ -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 } } - /// - /// 测温区配置类 - /// - public class TemperatureZone - { - /// - /// 测温区索引 - /// - public int Index { get; set; } - /// - /// 测温区X坐标 - /// - public int X { get; set; } - /// - /// 测温区Y坐标 - /// - public int Y { get; set; } - /// - /// 测温区宽度 - /// - public int Width { get; set; } - /// - /// 测温区高度 - /// - public int Height { get; set; } - /// - /// 测温区颜色 - /// - public Color Color { get; set; } - } - - /// - /// 温差配置类 - /// - public class TemperatureDiffConfig - { - /// - /// 温度图例数据 - /// - public List> TemperatureLegend { get; set; } - /// - /// 像素温度数据 - /// - public Dictionary PixelTemperatureData { get; set; } - - /// - /// 初始化温差配置类 - /// - public TemperatureDiffConfig() - { - TemperatureLegend = new List>(); - PixelTemperatureData = new Dictionary(); - } - } - /// /// 设备管理器类,负责设备的连接、管理和通信 /// diff --git a/Windows/CS/Framework4.0/Toprie/Toprie/Setting.cs b/Windows/CS/Framework4.0/Toprie/Toprie/Setting.cs index 2d3a27b..f0a2a1e 100644 --- a/Windows/CS/Framework4.0/Toprie/Toprie/Setting.cs +++ b/Windows/CS/Framework4.0/Toprie/Toprie/Setting.cs @@ -2189,17 +2189,6 @@ namespace JoyD.Windows.CS } } - /// - /// 存储区域信息的类,包含矩形框(图像坐标)、颜色和序号 - /// - private class RegionInfo - { - // 存储相对于图像的矩形坐标 - public Rectangle ImageRectangle { get; set; } - public Color Color { get; set; } - public int Index { get; set; } - } - /// /// 创建或更新叠加层图像(完全重绘) /// 仅在必要时调用,如图像尺寸改变或需要完全重绘 diff --git a/Windows/CS/Framework4.0/Toprie/Toprie/Toprie.csproj b/Windows/CS/Framework4.0/Toprie/Toprie/Toprie.csproj index 41ab994..1365566 100644 --- a/Windows/CS/Framework4.0/Toprie/Toprie/Toprie.csproj +++ b/Windows/CS/Framework4.0/Toprie/Toprie/Toprie.csproj @@ -74,6 +74,7 @@ Camera.cs + Form