当前位置:网站首页>视觉上位系统设计开发(halcon-winform)
视觉上位系统设计开发(halcon-winform)
2022-07-03 15:08:00 【11eleven】
- 本文介绍如何实现一个视觉上位的方案配置系统的思路,基于C# winform,原生控件进行界面设计,流程UI交互,以及算子调用,设备通讯等等。
- 设计的思路大致是基于视觉库的算子,将算子封装成单个工具节点,例如图像导入,颜色转换,区域绘制,阈值分析,结果判断等等,可根据项目情况进行自定义节点的输入参数,运行参数,从而执行得到执行结果。另外加上设备通讯的驱动全局变量的流转,最后结果的输出完成整个的检测工作。
- 视觉上位的模块大致划分为以下几个模块
- 方案流程管理
- 流程节点关系
- 全局变量管理
- 图像绘制预览功能
- 设备通讯控制
- 节点算子执行方法
- 结果输出,图像输出
- 先上几张效果图。后续文章将从这几个块进行功能解析。
- 数据对象有:方案,流程、流程节点、节点基础信息、设备信息、设备事件信息、算子匹配的函数、全局变量、等等
public class SchemeConfig {
public static SchemeInfo Scheme { set; get; }
public static HWindow_Final HWindowControl { set; get; }}
public class SchemeInfo : BaseField, IEntity<long>
{public SchemeInfo()
{
Id = GeneratePrimaryKeyIdHelper.GetPrimaryKeyId();
}
public long Id { get; set; }
/// <summary>
/// 方案编码
/// </summary>
public string Code { get; set; }/// <summary>
/// 方案名称
/// </summary>
public string Name { get; set; }/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
public List<SchemeFlowInfoEntity> FlowList { set; get; }
public List<GlobalVariableModel> GlobalVariableList { set; get; }/// <summary>
/// 设备配置
/// </summary>
public GlobalDeviceConfig GlobalDeviceConfig { set; get; }}
public class GlobalDeviceConfig
{
public List<DeviceCommumicationClient> ClientList { set; get; } = new List<DeviceCommumicationClient>();
public List<CommumicationEventReceive> ReceiveList { set; get; } = new List<CommumicationEventReceive>();
public List<CommumicationEventSend> SendList { set; get; } = new List<CommumicationEventSend>();
}/// <summary>
/// 图像源
/// </summary>
public class ImageSourceContentModel: SchemeFlowNodeEntity
{
public override void InitData() {
NodeResultModels = new List<NodeResultModel>();
NodeResultModels.Add(new NodeResultModel() { NodeResultCode = NodeResultTypeEnum.ImageWidth.ToString(),NodeResultName =NodeResultTypeEnum.ImageWidth.GetDescription() });
NodeResultModels.Add(new NodeResultModel() { NodeResultCode = NodeResultTypeEnum.ImageHeight.ToString(), NodeResultName = NodeResultTypeEnum.ImageHeight.GetDescription() });
}
public int DefaultImageIndex { set; get; } = -1;
public string ImageFolderPath { set; get; }
/// <summary>
/// 图像地址PATH
/// </summary>
public List<string> ImagePathList { set; get; }}
/// <summary>
/// 几何创建
/// </summary>
public class GeometryContentModel : SchemeFlowNodeEntity
{/// <summary>
/// ROIJSON
/// </summary>
public string RoiDataJson { set; get; }/// <summary>
/// ROI几何
/// </summary>
public List<ROI> Regions { set; get; } = new List<ROI>();//roi集合}
/// <summary>
/// blob
/// </summary>
public class BlobContentModel : SchemeFlowNodeEntity
{public override void InitData()
{
}
}/// <summary>
/// 颜色转换
/// </summary>
public class ColorRgbContentModel : SchemeFlowNodeEntity
{
}/// <summary>
/// Result
/// </summary>
public class ConditionResultContentModel : SchemeFlowNodeEntity
{
/// <summary>
/// 判断条件 0:全部符合,1:任意条件符合
/// </summary>
public int JudgeType { set; get; }public List<ResultConditionJudgeModel> JudgeList { set; get; } = new List<ResultConditionJudgeModel>();
public Color OkColor { set; get; }
public Color NgColor { set; get; }
public int ResultLocationX { set; get; }
public int ResultLocationY { set; get; }
}public class ResultConditionJudgeModel {
public string VariableCode { set; get; }
public string VariableName { set; get; }
public decimal MinValue { set; get; }
public decimal MaxValue { set; get; }
}
/// <summary>
/// 工具节点类型
/// </summary>
public enum ToolNodeTypeEnum:long
{
/// <summary>
/// 图像源
/// </summary>
ImageSource=0,
/// <summary>
/// 几何
/// </summary>
Geometry=1,
/// <summary>
/// blob分析
/// </summary>
Blob=2,
/// <summary>
/// 条件结果
/// </summary>
ConditionResult=3,
/// <summary>
/// 颜色转换
/// </summary>
ColorRgb=4,
}

边栏推荐
- Tencent internship interview sorting
- 基础SQL教程
- App global exception capture
- MySQL reports an error: [error] mysqld: file '/ mysql-bin. 010228‘ not found (Errcode: 2 “No such file or directory“)
- [pytorch learning notes] transforms
- 4-29——4.32
- Zero copy underlying analysis
- 5-1 blocking / non blocking, synchronous / asynchronous
- 4-33--4-35
- C string format (decimal point retention / decimal conversion, etc.)
猜你喜欢

The state does not change after the assignment of El switch

Tencent internship interview sorting

What is embedding (encoding an object into a low dimensional dense vector), NN in pytorch Principle and application of embedding
![[wechat applet] wxss template style](/img/28/f9d12bf761e25f9564d92697cf049d.png)
[wechat applet] wxss template style

【微信小程序】WXSS 模板样式

Unity hierarchical bounding box AABB tree

解决pushgateway数据多次推送会覆盖的问题

Byte practice plane longitude 2

High quality workplace human beings must use software to recommend, and you certainly don't know the last one

B2020 分糖果
随机推荐
[opengl] pre bake using computational shaders
使用JMeter对WebService进行压力测试
SQL server installation location cannot be changed
Pytorch深度学习和目标检测实战笔记
What is machine reading comprehension? What are the applications? Finally someone made it clear
[transform] [practice] use pytoch's torch nn. Multiheadattention to realize self attention
Vs+qt multithreading implementation -- run and movetothread
MySQL reports an error: [error] mysqld: file '/ mysql-bin. 010228‘ not found (Errcode: 2 “No such file or directory“)
Several sentences extracted from the book "leather bag"
Besides lying flat, what else can a 27 year old do in life?
Introduction to opengl4.0 tutorial computing shaders
The state does not change after the assignment of El switch
Tencent internship interview sorting
[probably the most complete in Chinese] pushgateway entry notes
What is label encoding? How to distinguish and use one hot encoding and label encoding?
TPS61170QDRVRQ1
Zero copy underlying analysis
Série yolov5 (i) - - netron, un outil de visualisation de réseau
Global and Chinese markets for ionization equipment 2022-2028: Research Report on technology, participants, trends, market size and share
Class part2