00. 目录

文章目录

  • 00. 目录
  • 01. 概述
  • 02. 签名
  • 03. 描述
  • 04. 注意
  • 05. 参数
  • 06. 结果
  • 07. 附录

01. 概述

dev_set_check - 指定HDevelop中的错误处理方式。

02. 签名

dev_set_check( : : Mode : )

03. 描述

dev_set_check指定在发生错误时HDevelop如何应对,即如果算子的返回状态不是H_MSG_TRUE(2)。

如果Mode的值是’give_error’—这是系统默认值—则一个错误的算子调用会抛出一个异常,这个异常在HDevelop程序中可以被catch语句捕获到。 但是,如果在HDevelop程序中没有周围的try-catch块,而且程序在HDevelop中运行,则程序在错误的算子处停止运行,并且打开错误消息框以显示错误文本。 另外,相应的调用的算子被输入到“算子窗口”中,使得用户可以容易地编辑并且可能修正错误的算子调用的参数。 如果该程序是从HDevEngine调用的,并且该异常未在HDevelop程序中捕获,则会抛出一个HDevEngineException对象,并退出该程序。

如果Mode设置为’〜give_error’,则错误将被忽略,程序继续运行下一个算子。 dev_set_check(’〜give_error’)旨在与dev_error_var一起使用,dev_error_var可以检查算子调用返回的结果状态。

原文描述

dev_set_check specifies how HDevelop has to react in case of an error, i.e., if the return state of an operator is not H_MSG_TRUE (2).

If Mode has the value ‘give_error’—which is the system default—an erroneous operator call will throw an exception, that can be caught within the HDevelop program by the catch statement. However, if there is no surrounding try-catch block in the HDevelop program and the program is executed within HDevelop, the program execution stops at the erroneous operator and an error message box is opened to display the error text. In addition, the appropriate operator call is entered into the ‘Operator Window’, so that the user can easily edit and possibly correct the parameters of the erroneous operator call. If the procedure was called from HDevEngine and the exception is not caught within the HDevelop program, an HDevEngineException object is thrown and the procedure is left.

If Mode is set to ‘~give_error’, the error will be ignored and the program continues with the next operator. dev_set_check(’~give_error’) is intended to be used in connection with dev_error_var, which allows to check the result state that is returned by the operator calls.

04. 注意

使用HDevelop的代码导出功能,为该算子生成的代码可能与相关的HALCON算子具有不同的行为。 有关将HDevelop图形算子(graphics operators)导出为不同编程语言的代码的详细说明,请参阅’HDevelop User’s Guide’中的’Code Export -> General Aspects of Code Generation -> Graphics Windows’一章。

05. 参数

Mode (input_control)   string → (string)
  错误处理的模式。
  Default value: ‘give_error’

06. 结果

如果指定参数的值正确,则dev_set_check返回2(H_MSG_TRUE)。 否则会引发异常并返回错误代码。

HDevelop例程

sock_recv.hdev Receive image and tuple data via socket connection
projective_trans_image.hdev Apply projective transformations to an image
get_rectangle_pose_barcode.hdev Estimate 3D pose of bar codes
get_mposition.hdev Query mouse position and button status
error_handling_timeout.hdev Handle grab errors
dev_set_check.hdev Enable/Disable error handling in HDevelop
dev_error_var.hdev Catch errors in HDevelop
cbm_sbm.hdev Compare component-based matching to shape-based matching
cbm_param_visual.hdev Analyze the parameters of component-based matching
cbm_bin_switch.hdev Locate a switch and test its state using component-based matching
bottlet.hdev Train numbers on a beer bottle
3d_position_of_rectangle.hdev Estimate 3D pose of rectangular objects

程序示例

dev_close_window ()
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
dev_error_var (Error, 1)
dev_set_check ('~give_error')
FileName := 'wrong_name'
read_image (Image, FileName)
ReadError := Error
if (ReadError != H_MSG_TRUE)write_string (WindowHandle, 'wrong file name: '+FileName)
endif
* Now the program will stop with an exception
dev_set_check ('give_error')
read_image (Image, FileName)

07. 附录

7.1 机器视觉博客汇总
网址:https://dengjin.blog.csdn.net/article/details/116837497

【机器视觉】 dev_set_check算子相关推荐

  1. 机器视觉 边缘检测算子

    1.实验目的 利用opencv python实现对下图实现边缘检测算子. 2.实验过程 (1)在python安装opencv库, pip install opencv-python. (2)在pyth ...

  2. 【机器视觉】机器视觉博客汇总

    00. 目录 文章目录 00. 目录 01. 机器视觉概述 02. 机器视觉环境搭建 03. Halcon初级教程 04. Halcon中级教程 05. Halcon高级教程 06. Halcon与Q ...

  3. 拉普拉斯噪声公式_高斯拉普拉斯算子(Laplace of Gaussian)

    高斯拉普拉斯(Laplace of Gaussian) Laplace算子作为一种优秀的边缘检测算子,在边缘检测中得到了广泛的应用.该方法通过对图像 求图像的二阶倒数的零交叉点来实现边缘的检测,公式表 ...

  4. 【机器视觉】 dev_error_var算子

    00. 目录 文章目录 00. 目录 01. 概述 02. 签名 03. 描述 04. 注意 05. 参数 06. 结果 07. 附录 01. 概述 dev_error_var - 定义或取消定义一个 ...

  5. 【机器视觉】 try算子

    00. 目录 文章目录 00. 目录 01. 概述 02. 签名 03. 描述 04. 注意 05. 参数 06. 结果 07. 附录 01. 概述 try - 开始一个程序分段,检测并捕获异常. 0 ...

  6. 【机器视觉】 endtry算子

    00. 目录 文章目录 00. 目录 01. 概述 02. 签名 03. 描述 04. 注意 05. 参数 06. 结果 07. 附录 01. 概述 endtry - 结束异常处理语句块. 02. 签 ...

  7. 【机器视觉】 catch算子

    00. 目录 文章目录 00. 目录 01. 概述 02. 签名 03. 描述 04. 注意 05. 参数 06. 结果 07. 附录 01. 概述 catch - 捕获在前面的try块中抛出的异常. ...

  8. 【机器视觉】 throw算子

    00. 目录 文章目录 00. 目录 01. 概述 02. 签名 03. 描述 04. 注意 05. 参数 06. 结果 07. 附录 01. 概述 throw- 抛出一个用户定义的异常或重新抛出一个 ...

  9. python 视觉技术_python+opencv实现机器视觉基础技术(边缘提取,图像滤波,边缘检测算子,投影,车牌字符分割)...

    机器视觉是人工智能正在快速发展的一个分支.简单说来,机器视觉就是用机器代替人眼来做测量和判断.它是一项综合技术,包括图像处理.机械工程技术.控制.电光源照明.光学成像.传感器.模拟与数字视频技术.计算 ...

最新文章

  1. SpringBoot第十八篇: 定时任务(Scheduling Tasks)
  2. 姗姗来迟的Serverless如何助力微服务和DevOps
  3. Exchange 2007 的邮件监控器
  4. iphone 一些小游戏.
  5. Python学习笔记之基本数据结构方法
  6. Android stadio 自定义debug release keystore
  7. ElasticSearch 2 (21) - 语言处理系列之单词识别
  8. 如何安装_毛巾架如何安装
  9. Beta Daily Scrum 第七天
  10. Codeforces Round #762 (Div. 3)
  11. 有机会多熟悉下开源框架
  12. java druid sqlite_springboot整合druid抛出dbType not support : sqlite异常
  13. Font Manager :字体管理及批量安装工具
  14. [Linux 使用(2)] 64位Linux下安装jboss-as-7.1 以及jdk1.7
  15. python如何导入numpy简书_如何使用python3.x成功导入numpy?
  16. 使用Python自由切分pdf文件提取任意页面
  17. mysql系列:登陆和退出
  18. 广东计算机考试1级时间安排,1级计算机考试时间
  19. 防火墙透明模式下虚拟系统配置实例
  20. 网页打开慢的原因及分析

热门文章

  1. 自己编写jQuery插件之表单验证
  2. 转:PHP非阻塞模式
  3. 在sitecopy中设置不支持passive模式的ftp服务器
  4. RGB to HSB or RGB to HSL
  5. 上海Oracle高峰会感悟
  6. 7-42 学术会议地点统计问题-hebust (10 分)
  7. exp oracle 表空间,oracle之EXP导出表空间错误解决
  8. 强大的uml java_IDEA 还是强大啊,一键把项目生成 UML 类图…
  9. Java黑皮书课后题第4章:4.16(随机字符)编写一个程序,使用Math.random()方法显示一个随机的大写字母
  10. Docker进阶-快速扩容